New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment variables from SSM Parameter Store or Secrets Manager #2512
Comments
Hi 👋, thanks for opening! While we look into this... If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions. Lastly, please make sure you've specified the |
Is this in the pipeline? |
I was able to make it work by accessing directly the SSM store through the AWS CLI in the Amplify Build. As mentioned previously, I also needed to use npm private registry in my build to build my nextjs application. Here is the Amplify config: version: 1
frontend:
phases:
preBuild:
commands:
- export GITHUB_API_TOKEN=$(aws ssm get-parameter --name GITHUB_API_TOKEN --query Parameter.Value --output text --with-decryption)
- echo $GITHUB_API_TOKEN
- npm config set //npm.pkg.github.com/:_authToken $GITHUB_API_TOKEN
- npm ci
build:
commands:
- npm run build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/* Cheers 👌🏻 |
Hey @alexabidri 👋🏻 Is there any previous setup that needs to be done in order of access to the AWS CLI commands? I tried with export RECAPTCHA_SITE_KEY=$(aws ssm get-parameter --name RECAPTCHA_SITE_KEY --query Parameter.Value --output text --with-decryption) but I get this error: aws: command not found Are you using a specific build image? I'm using Edit: solved this issue by installing the AWS CLI manually. |
It seems currently the only way to set environment variables on an Amplify app is by providing a plaintext value. It would be really useful to provide them from Parameter Store or Secrets Manager. I have an app which requires private npm authentication during the build stage. Currently I have to provide the GitHub personal access token to Amplify as a plaintext value. I also have to remember to update it here when I regenerate the token.
The text was updated successfully, but these errors were encountered: