Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access denied when using ECS task IAM role #1309

Closed
malekascha opened this issue Oct 6, 2016 · 5 comments
Closed

Access denied when using ECS task IAM role #1309

malekascha opened this issue Oct 6, 2016 · 5 comments
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. service-api General API label for AWS Services.

Comments

@malekascha
Copy link

I'm using the sdk to interact with s3. I have my application running in a container on ECS. When I assign an IAM role directly to the task that my ruby app is running on, it fails to detect the credentials and I get an access denied whenever I try to use the s3 client. It works fine when I bind the role to the EC2 instance that it's running on.

@awood45
Copy link
Member

awood45 commented Oct 6, 2016

The default credential provider chain forks between the ECS Credential Provider and the EC2 Credential Provider. If putting credentials on the instance fixed the issue, my suspicion is that the ENV variable isn't present in the container.

Can you double check that the credential provider feature flag is on?

On Oct 5, 2016, at 5:30 PM, Malek Ascha notifications@github.com wrote:

I'm using the sdk to interact with s3. I have my application running in a container on ECS. When I assign an IAM role directly to the task that my ruby app is running on, it fails to detect the credentials and I get an access denied whenever I try to use the s3 client. It works fine when I bind the role to the EC2 instance that it's running on.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@malekascha
Copy link
Author

How would I make sure that the flag is on? Is that something I would configure from the AWS console, or would it be in my Ruby code?

@awood45
Copy link
Member

awood45 commented Oct 10, 2016

Documentation is here.

The SDK is looking for the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable. If you're able to use EC2 instance metadata credentials, then that ENV variable is not present.

@awood45 awood45 added Version 2 service-api General API label for AWS Services. labels Oct 10, 2016
@awood45 awood45 added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Oct 17, 2016
@awood45
Copy link
Member

awood45 commented Oct 17, 2016

Did this resolve your issue, or does the issue persist?

@malekascha
Copy link
Author

Yes, it did. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing-soon This issue will automatically close in 4 days unless further comments are made. service-api General API label for AWS Services.
Projects
None yet
Development

No branches or pull requests

2 participants