Skip to content
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

Accessing Secrets in Amplify Gen 1 App #1690

Open
sph94 opened this issue Jun 27, 2024 · 1 comment
Open

Accessing Secrets in Amplify Gen 1 App #1690

sph94 opened this issue Jun 27, 2024 · 1 comment
Labels
console Issues related to Amplify console UI/UX feature-request New feature or request

Comments

@sph94
Copy link

sph94 commented Jun 27, 2024

Amplify CLI Version

12.12.3

Question

I am trying to access secrets in my webhook. I am using Amplify Gen 1. I have entered the secrets under amplify > hosting settings > secrets, but I am unable to access them e.g. with process.env.WEBHOOK_SECRET (though accessing environment variables works fine) - but it just returns undefined when I log the secrets.

How can I access these secrets? On the amplify docs all I can see is "In Amplify Gen 1, you need to define environment variables and secrets using the CLI and store keys in both AWS Parameter Store and a local team-provider.json file."

Would be very helpful if there was actually further detail on accessing these. I cant see how I can do this in the CLI nor how the team-provider file should be edited.

Or is using process.env.WEBHOOK_SECRET just the wrong way to access them? If the secrets tab under hosting is just for Gen 2, it really should be specified on the page that this is the case.

@sph94 sph94 added pending-triage Incoming issues that need categorization question Question or confusion about some aspect of the product labels Jun 27, 2024
@ykethan
Copy link
Member

ykethan commented Jun 27, 2024

Hey @sph94, thank you for reaching out. The information is currently documented on https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html#environment-secrets

Transferring to the backend repository and marking this for improvements.

@ykethan ykethan transferred this issue from aws-amplify/amplify-cli Jun 27, 2024
@ykethan ykethan added feature-request New feature or request console Issues related to Amplify console UI/UX and removed question Question or confusion about some aspect of the product pending-triage Incoming issues that need categorization labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console Issues related to Amplify console UI/UX feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants