简体   繁体   中英

ECS task. How to use AWS CLI within container

I'm trying to use AWS cli commands inside the container.

I have given policy within ECS cluster instance but it seems the container comes up with error as it tries to call AWS CLI command inside the container as an entrypoint when it boots and fails.

My IAM role with Instance Profile allows to do KMS get and decrypt which is what I need for the AWS CLI operations

Is there a way to pass credentials like instance profile inside ECS task container?

To pass a role to your caontainer(s) in a task you can use IAM Roles for Tasks :

With IAM roles for Amazon ECS tasks, you can specify an IAM role that can be used by the containers in a task. Applications must sign their AWS API requests with AWS credentials, and this feature provides a strategy for managing credentials for your applications to use, similar to the way that Amazon EC2 instance profiles provide credentials to EC2 instances.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM