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

feat(appsync): add support for GraphQLApi environment variables #29112

Closed
wants to merge 3 commits into from

Conversation

onlybakam
Copy link
Contributor

@onlybakam onlybakam commented Feb 14, 2024

Reason for this change

AppSync introduced a new property on the L1 cfn resource AWS::AppSync::GraphQLApi: EnvironmentVariables. This change adds the functionality on the L2 appsync.GraphqlApi construct.

Description of changes

Changes are in aws-appsync/lib/graphqlapi.ts. Updated the GraphqlApi props to take in a new environmentVariables object. Added a new public function addEnvironmentVariable that adds an environment variable to the API.

Create a new API with env vars:

const api = new appsync.GraphqlApi(stack, 'baseApi', {
  name: 'api',
  schema: appsync.SchemaFile.fromAsset(...),
  environmentVariables: {
    key: 'value',
  },
});

Add a new env var:

api.addEnvironmentVariable('new_key', 'another');

Description of how you validated changes

  • added new unit test: appsync-env-vars.test.ts
  • added new integration test: integ.appsync-env-vars.ts

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Feb 14, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team February 14, 2024 22:26
@github-actions github-actions bot added the p2 label Feb 14, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@onlybakam onlybakam changed the title feat(aws-appsync): Add support for GraphQLApi environment variables feat(appsync): Add support for GraphQLApi environment variables Feb 14, 2024
@onlybakam onlybakam changed the title feat(appsync): Add support for GraphQLApi environment variables feat(appsync): add support for GraphQLApi environment variables Feb 14, 2024
@hoegertn
Copy link
Contributor

How does this relate to #29064

@aws-cdk-automation aws-cdk-automation dismissed their stale review February 14, 2024 22:37

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@onlybakam
Copy link
Contributor Author

How does this relate to #29064

did not see this before; but this is awesome and essentially the same! I can close this PR.

@onlybakam onlybakam closed this Feb 14, 2024
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 2c8e3e7
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants