amplify-category-api
amplify-category-api copied to clipboard
Adding Table names from cdk-construct to Appsync environment variables
Amplify CLI Version
@aws-amplify/graphql-api-construct v1.1.2
Question
I'm trying to add the generated table names from the cdk construct to the appsync api as environment variables so that I can reference them in my pipeline resolvers for batch requests.
Something like this:
amplifyApi.resources.cfnResources.cfnGraphqlApi.environmentVariables = { TABLENAME: amplifyApi.resources.tables["Table"].tableName };
causes circular dependencies. As there doesn't seem to be an equivalent like this:
api.addEnvironmentVariable('EnvKey2', 'non-empty-2');
to add them after the tables / api has been created. Is there a better way to do this?