- Newest
- Most votes
- Most comments
Yes, there are limitations on environment variables in AWS Amplify, though the exact limit isn't explicitly stated for Amplify specifically. However, this issue is likely related to size limitations rather than the number of variables.
In AWS services, there's often a limit on the total size of environment variables rather than the number. For example, in Elastic Beanstalk, there's a limit of 4096 bytes for environment variables. While this isn't directly applicable to Amplify, it suggests that AWS services often have such limitations.
For Amplify, the issue you're experiencing with 30 environment variables not working, while fewer than 10 work fine, indicates there might be a similar size limitation in place. The total size of all your environment variables combined (including their names and values) may be exceeding an undocumented limit.
To work around this issue, you could try the following:
- Reduce the size of your environment variable names and values where possible.
- Consider moving some of the less sensitive configuration into your codebase directly.
- For sensitive information, use AWS Secrets Manager or AWS Systems Manager Parameter Store to store larger sets of configuration data, and then retrieve these in your application code as needed.
If you continue to face issues, you may want to reach out to AWS Support for more specific guidance on Amplify's limitations and best practices for managing larger sets of environment variables.
Sources
Environment variables in beanstalk are removed | AWS re:Post
How to correctly include and reference secret environment variables (AWS Amplify, process.env.secrets) | AWS re:Post
Yes, there are limits for environment variables in AWS Amplify. For new AWS accounts, there are stricter initial limitations that get automatically increased over time based on usage. While the standard quota for AWS Amplify apps is 25 per region, new accounts often have lower quotas.
For environment variables specifically:
You can pass up to 28 environment variables
Each variable name and value can be up to 512 characters long
If you need more than 28 environment variables, consider:
Using an initialization script which has no limit on variables
Consolidating related variables
Using AWS Systems Manager Parameter Store with a hierarchical structure
Requesting a quota increase through AWS Support (though this may not be immediately approved for new accounts)
Relevant content
- asked 8 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 5 years ago
