-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
IAM AssumedRole doesn't work in ECS #2186
Comments
To work around this, I created an IAM user with a policy containing the 3 permissions I noted above, and set the |
It doesn't work on EKS either. Using version The env vars on the pod are correct:
But it still tries to assume the role from instance instead. |
@bploetz @max-rocket-internet I'm so sorry that this issue did not get any attention in a long time. Are you still experiencing the issue? If so please reply with a comment and I'll investigate. Have you added |
It works with |
@max-rocket-internet great! |
It looks like this issue hasn’t been active in longer than a week. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please add a comment to prevent automatic closure, or if the issue is already closed please feel free to reopen it. |
I originally reported this in prometheus/cloudwatch_exporter#243, as I wasn't sure if this was an issue with the Prometheus cloudwatch exporter, or the underlying AWS Java SDK which it uses.
I'm trying to run the prom/cloudwatch-exporter:cloudwatch_exporter-0.7.0 Docker container on AWS ECS. The ECS Service is using an IAM Role Policy which includes the permissions:
The following error occurs when starting the exporter:
It seems as if the assumed IAM Role attached to the container is not honored correctly.
I then tried adding the same IAM Role policy permissions noted above to the underlying EC2 host's IAM Role, and ran the exporter directly on the EC2 instance. This starts cleanly.
I searched through the aws-sdk-java issues looking for issues pertaining to assumed roles within an ECS container and didn't find anything, but perhaps I missed it.
The text was updated successfully, but these errors were encountered: