expose amplify-meta.json to backend functions & apis
See original GitHub issueIs your feature request related to a problem? Please describe.
Multienv support generates new resource identifiers for resources like Cognito User Pools, DynamoDB table names, and ElasticSearch endpoints. This makes referencing those resources from backend functions (added via amplify add function or amplify add api) challenging (and in some cases impossible) with hardcoding per-environment configuration outside the context of Amplify.
Describe the solution you’d like
- As part of the build process for Lambda functions, expose a copy of
amplify-meta.jsonthat the Lambda function can use to lookup desired resource identifiers. - DynamoDB table names created by the GraphQL transformer are not currently exposed in
amplify-meta.json; add those, please. - No information about the ElasticSearch service provisioned by
@searchableis currently included inamplify-meta.json; add that too, please.
Describe alternatives you’ve considered
Alternatively consider offering full support for the front-end functions included in the aws-amplify library, such as querying of GraphQL APIs, from back-end functions. FYI it currently “just works” if you include a fetch polyfill (e.g. cross-fetch/polyfill), but the authentication process is obviously geared toward use cases with a static user (as it stores a lot of data in global state).
Additional context Ref: #621
Issue Analytics
- State:
- Created 5 years ago
- Reactions:31
- Comments:12 (3 by maintainers)

Top Related StackOverflow Question
how does one access environmental variables outside of those generated by amplify such as for third party services such that can be stored in the SSM parameter store? https://serverless.com/framework/docs/providers/aws/guide/variables/ is a good execution of what I hope is exposed by Amplify.
This gonna be very helpful