aws-amplify / aws-amplify/amplify-hosting
Amplify Console doesn't ask for nested stack parameters or doesn't pass on environment variables to nested stack
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Use case: I was working on a sample Amplify app which will allow signed in users to upload to a S3 bucket using the webapp. The users would be allowed to sign up only if they use an email with a specific domain (e.g. ‘amazon.com’)
I have added pre-auth function for domain whitelisting. I was able to deploy and test it in multiple environments successfully with different domains using Amplify CLI (Amplify CLI asks for DOMAINWHITELIST parameter as part of amplify publish/push).
When I tried to deploy the GitHub repo with Amplify Console, it doesn’t ask for the DOMAINWHITELIST parameter required for the pre-auth function and hence the app doesn’t allow anybody to sign up.
If I pass on DOMAINWHITELIST parameter in environment variables in advanced settings or in build settings yaml file, it doesn’t propagate to the nested stack (pre-auth function).
**To Reproduce**
1. Go to Amplify Console and try to deploy with Github repo: https://github.com/aniruddhawani/amplify-s3-upload
2. Add DOMAINWHITELIST parameter in environment variables in advanced settings or add to the build file as documented here: https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html
**Expected behavior**
Amplify Console should ask for such parameters required for nested stacks. Or the parameter should be passed on to the nested stacks so that it can be used by the resources in the nested stack.
**Additional context**
N/A
**Sample code**
https://github.com/aniruddhawani/amplify-s3-upload
Contributor guide
Research direction
Reproduce the deployment with the sample repository and inspect the Amplify Console advanced environment settings and build settings YAML mentioned in the report. Trace how DOMAINWHITELIST reaches the pre-auth function's nested stack. Done means the Console either requests the nested-stack parameter or passes the configured value through so sign-up works across environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- ci-cd, cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100