mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2026-04-25 05:16:00 +03:00
[GH-ISSUE #507] Does not check ECS task role location #280
Labels
No labels
bug
bug
dataloss
duplicate
enhancement
feature request
help wanted
invalid
need info
performance
pull-request
question
question
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/s3fs-fuse#280
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @countergram on GitHub (Nov 21, 2016).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/507
Is it possible to use s3fs from within ECS with an IAM role? I can't get it to work.
s3fs has a hardcoded URL for roles:
http://169.254.169.254/latest/meta-data/iam/security-credentials/ECS container specific roles (Task roles) are at
http://169.254.170.2$AWS_CONTAINER_CREDENTIALS_RELATIVE_URI@psyvision commented on GitHub (Nov 1, 2017):
Hi @ggtakec - We've stumbled across this issue today and I'd like to get a pull request in to use the alternate URL to use the ECS task role rather than the EC2 instance role.
How do you think would be best to implement this? I.e. an additional command line switch to change the URL used or an alternative command line option e.g. task_iam_role?
@ggtakec commented on GitHub (Nov 5, 2017):
@psyvision @countergram
I'm sorry for not care about ECS.
If I implement this function, consider the following:
It maybe fixed S3fsCurl::CheckIAMCredentialUpdate, I think that it will be a way to add a review per function.
This function will be called from s3fs_check_service.
It seems that we need to aupport ECS on s3fs.
@psyvision commented on GitHub (Nov 5, 2017):
Hi @ggtakec no worries! I'm happy to work on implementing that, I had already had a good look over the code base but anted to check best practices.
I'll submit a pull request as I start getting things implemented.
@psyvision commented on GitHub (Nov 6, 2017):
Nearly got this working... :/
@psyvision commented on GitHub (Nov 8, 2017):
It works! I need to do a code tidy up to remove some of my debug logging.
I have a IAM role created with S3FullAccess. My ECS task is assigned this role. I can then mount a bucket with the following command:
s3fs -o allow_other -o ecs -o use_sse=1 my-bucket-name /mntNote
I've used jsoncpp to parse the JSON metadata returned by AWS because the previous parser wouldn't handle the ECS specific endpoint. At the moment this appears to be dynamically linked so I have to run
apt-get install libjsoncpp-devbefore I can use s3fs.My knowledge of the build setup here isn't great (I'm not really a C++ programmer) so I haven't worked out how to static link it yet. If I do I'll commit that change.
@ggtakec commented on GitHub (Nov 19, 2017):
@psyvision I merged your PR #671
If you found something wrong about it, please let me know.
Thanks all.