Posted On: Feb 6, 2024

AWS AppSync is a managed service that connects applications to data. With AppSync, API developers can write resolvers and functions in JavaScript to define the business logic that connects their AppSync GraphQL and Pub/Sub APIs to data.

AppSync now allows developers to define environment variables for their GraphQL API, making it easier to configure their code’s behavior without having to change their resolver or function implementation. Developers can define key-value pairs on their GraphQL API at configuration time, and access them in their resolvers and functions at runtime when resolving GraphQL requests. Environment variables are available in JavaScript and VTL code. Developers can define environment variables on GraphQL APIs at creation time or in an update from the AWS AppSync console or with AWS CloudFormation, AWS Cloud Development Kit (CDK), the AWS CLI and the AWS SDKs.

This feature is available in all AWS regions supported by AppSync. For more details, refer to the AppSync documentation.