Answers: <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>so you need to provide the <code>aws</code> credentials to docker which has access to the manger</p>
  
  <p>you can follow on of these methods:</p>
  
  <p>providing the credentials with <code>run</code> command:</p>
  
  <pre><code>docker run -e AWS_ACCESS_KEY_ID=XXXX -e AWS_SECRET_ACCESS_KEY=XXXX myimage
  </code></pre>
  
  <p>or providing the file <code>~/.aws/credentials</code> and then create your container:</p>
  
  <pre><code>docker-machine create --driver amazonec2 --amazonec2-open-port 8000 --amazonec2-region us-west-1 aws-sandbox
  </code></pre>
  
  <p>see <a href="https://docs.docker.com/machine/examples/aws/" rel="nofollow noreferrer">this</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2019-11-01T19:33:53.317Z
Answers: 2019-11-01T19:33:53.317Z
Answers: LinPy
Body: <p>All the tutorials I've seen for AWS Secrets Manager have secrets being retrieved by the CLI. How is this done in production? </p>
  
  <p>Can I mount a set of secrets to a docker container as a file? </p>
  
Tags: <docker><amazon-web-services>
Title: Accessing AWS Secrets Manager from Docker
UserDisplayName: AfterWorkGuinness
ThreadText: # Accessing AWS Secrets Manager from Docker
  
  (Asked by: username_0 on 2019-10-24)
  
  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?
  
  **Tags:** docker, amazon-web-services
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-11-01. Score: 1
  
  > 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](https://docs.docker.com/machine/examples/aws/)
  
  
  ---
  
  