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

ECS task role ignored #333

Closed
dee-kryvenko opened this issue Jul 27, 2017 · 4 comments
Closed

ECS task role ignored #333

dee-kryvenko opened this issue Jul 27, 2017 · 4 comments

Comments

@dee-kryvenko
Copy link

I am unsure this is kitchen-ec2 issue, but accordingly to aws/aws-sdk-ruby#1309 generally it should work. I have validated that my container has AWS_CONTAINER_CREDENTIALS_RELATIVE_URI set and also that AWS CLI picking it up correctly, so I can only guess something happens within kitchen-ec2.
I've tested on 1.3.2 and 1.2.0 in combination with a few ruby aws-sdk recent versions, and current behaviour is that it's picking up cluster EC2 role instead of task role.

@dee-kryvenko
Copy link
Author

Looks like the issue is here https://github.com/test-kitchen/kitchen-ec2/blob/v1.3.2/lib/kitchen/driver/aws/client.rb#L77. It's picking up InstanceProfileCredentials as last resort not considering ECSCredentials and AWS_CONTAINER_CREDENTIALS_RELATIVE_URI and not using credentials chain to delegate this to sdk.

@cheeseplus
Copy link
Contributor

This could be added as a new feature, probably just missed as most folks aren't using kitchen-ec2 with ECS.

@cheeseplus
Copy link
Contributor

We've cut kitchen-ec2 2.0.0 which basically dumps all our custom logic and defers to the AWS SDK so this should be resolved once that gem is updated in all the appropriate places.

@dee-kryvenko
Copy link
Author

@cheeseplus I just tested with kitchen-ec2 2.0.0 - it is now correctly picking up task role instead of cluster instances role. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants