You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please describe which feature you have a question about?
Documentation explains how to access environment variables from amplify.yml file using bash syntax $MY_ENV_VARIABLE, but it does not explain how to access environment secrets from the same file. It only has instructions on how to access them using process.env.secrets.
Provide additional details
N/A
What AWS Services are you utilizing?
N/A
Provide additional details e.g. code snippets
N/A
The text was updated successfully, but these errors were encountered:
Secrets are placed in an environment variable named $secrets (lowercase). It is a stringified JSON object so accessing it via bash script may be a little complicated to manipulate. Unless you use jq or a similar tool, I recommend writing a JS script that reads them like so:
@ferdingler
Reading the documentation, it's really not clear to me how to make it all happen in the yaml file.
The documentation recommends to name the SSM variable as "/amplify/{your_app_id}/{your_backend_environment_name}/{your_parameter_name}". Is that mandatory?
I think I found that my app_id is the last part of the app arn (d******) but what is my "backend_environment_name" here?
For now I went with "develop" as it's the name of my branch.
Therefore, I create 2 ssm parameters that store my ssh keys:
/amplify/d3swn9gxhv0r3p/develop/amplify_key
and
/amplify/d3swn9gxhv0r3p/develop/amplify_key.pub
Now I am trying to configure amplify.yml and read these secrets:
echo "$secrets" returns an empty string.
What am I doing wrong? I'm pretty lost.
Any chance you could point us to a full example?
Please describe which feature you have a question about?
Documentation explains how to access environment variables from
amplify.yml
file using bash syntax$MY_ENV_VARIABLE
, but it does not explain how to access environment secrets from the same file. It only has instructions on how to access them usingprocess.env.secrets
.Provide additional details
N/A
What AWS Services are you utilizing?
N/A
Provide additional details e.g. code snippets
N/A
The text was updated successfully, but these errors were encountered: