Reputation: 13583
I have an API server running on a docker container, and the docker container runs on an AWS ec2 instance.
Is it possible to make the server execute AWS CLI commands without putting my aws credentials on the docker container?
Because I think the aws credentials should only be placed on my local machine.
I don't think it is safe to place it on a remote machine which can be accessed by other people.
Upvotes: 12
Views: 7832
Reputation: 52393
Yes. Attach IAM role to your EC2 instance. No need to place the AWS credentials in the EC2 instance. Your application/CLI will get the credentials automatically.
Upvotes: 17