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

Adding Table names from cdk-construct to Appsync environment variables #2783

Open
jimjiminyjimjim opened this issue Aug 16, 2024 · 1 comment
Labels
cdk-constructs feature-request New feature or request

Comments

@jimjiminyjimjim
Copy link

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?

@jimjiminyjimjim jimjiminyjimjim added pending-triage question Further information is requested labels Aug 16, 2024
@AnilMaktala
Copy link
Member

Hey @jimjiminyjimjim,Thanks for raising this. As of now, fetching the table dynamically is not supported. We will mark it is a feature request for the team.As a workaround you can use the hard coded table name.

@AnilMaktala AnilMaktala added feature-request New feature or request and removed question Further information is requested labels Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cdk-constructs feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants