HiveBrain v1.2.0
Get Started
← Back to all entries
patterndockerMinor

Accessing AWS Secrets Manager from Docker

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
dockersecretsawsmanagerfromaccessing

Problem

All the tutorials I've seen for AWS Secrets Manager have secrets being retrieved by the CLI. How is this done in production?

Can I mount a set of secrets to a docker container as a file?

Solution

Access to AWS Secrets Manager requires AWS credentials. Those
credentials must have permissions to access the AWS resources that you
want to access, such as your Secrets Manager secrets. The following
sections provide details on how you can use AWS Identity and Access
Management (IAM) policies to help secure access to your secrets and
control who can access and administer them.

so you need to provide the aws credentials to docker which has access to the manger

you can follow on of these methods:

providing the credentials with run command:

docker run -e AWS_ACCESS_KEY_ID=XXXX -e AWS_SECRET_ACCESS_KEY=XXXX myimage


or providing the file ~/.aws/credentials and then create your container:

docker-machine create --driver amazonec2 --amazonec2-open-port 8000 --amazonec2-region us-west-1 aws-sandbox


see this

Code Snippets

docker run -e AWS_ACCESS_KEY_ID=XXXX -e AWS_SECRET_ACCESS_KEY=XXXX myimage
docker-machine create --driver amazonec2 --amazonec2-open-port 8000 --amazonec2-region us-west-1 aws-sandbox

Context

StackExchange DevOps Q#9566, answer score: 1

Revisions (0)

No revisions yet.