amazon-web-servicesaws-secrets-manageramazon-app-runner

Access a single key from AWS Secret in apprunner.yaml


I am trying to deploy to apprunner via apprunner.yaml

I have stored two key value pairs in single AWS secret.

ARN: xxxx Under this, there are key1:value1 and key2:value How can access these keys as env variables in apprunner.yaml. key1 env variable should have value1 as value and so on..

https://docs.aws.amazon.com/apprunner/latest/dg/config-file-examples.html

This above page has some examples. But it doesn't say how to access different key value pairs stored under same secret.

My current yaml file

runtime: python311
build:
  commands:
    build:
      - pip install -r requirements.txt
run:
  runtime-version: 3.11.7
  command: sh hello.sh
  network:
    port: 8000

Thank you!

I am pretty new to App Runner


Solution

  • It can be accessed like

     secrets:
        - name: secret1
          value-from: "arn:aws:secretsmanager:us-east-1:123456789012:secret:testingstackAppRunnerConstr-kJFXde2ULKbT-S7t8xR:key1::"