patterndockerMinor
Accessing AWS Secrets Manager from Docker
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?
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
you can follow on of these methods:
providing the credentials with
or providing the file
see this
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 mangeryou 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 myimageor 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-sandboxsee this
Code Snippets
docker run -e AWS_ACCESS_KEY_ID=XXXX -e AWS_SECRET_ACCESS_KEY=XXXX myimagedocker-machine create --driver amazonec2 --amazonec2-open-port 8000 --amazonec2-region us-west-1 aws-sandboxContext
StackExchange DevOps Q#9566, answer score: 1
Revisions (0)
No revisions yet.