AWS::AppSync::GraphQLApi - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


The AWS::AppSync::GraphQLApi resource creates a new Amazon AppSync GraphQL API. This is the top-level construct for your application. For more information, see Quick Start in the Amazon AppSync Developer Guide.


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::AppSync::GraphQLApi", "Properties" : { "AdditionalAuthenticationProviders" : [ AdditionalAuthenticationProvider, ... ], "AuthenticationType" : String, "LambdaAuthorizerConfig" : LambdaAuthorizerConfig, "LogConfig" : LogConfig, "Name" : String, "OpenIDConnectConfig" : OpenIDConnectConfig, "Tags" : [ Tag, ... ], "UserPoolConfig" : UserPoolConfig, "XrayEnabled" : Boolean } }



A list of additional authentication providers for the GraphqlApi API.

Required: No

Type: List of AdditionalAuthenticationProvider

Update requires: No interruption


Security configuration for your GraphQL API. For allowed values (such as API_KEY, AWS_IAM, AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT, or AWS_LAMBDA), see Security in the Amazon AppSync Developer Guide.

Required: Yes

Type: String

Update requires: No interruption


A LambdaAuthorizerConfig holds configuration on how to authorize Amazon AppSync API access when using the AWS_LAMBDA authorizer mode. Be aware that an Amazon AppSync API may have only one Lambda authorizer configured at a time.

Required: No

Type: LambdaAuthorizerConfig

Update requires: No interruption


The Amazon CloudWatch Logs configuration.

Required: No

Type: LogConfig

Update requires: No interruption


The API name.

Required: Yes

Type: String

Update requires: No interruption


The OpenID Connect configuration.

Required: No

Type: OpenIDConnectConfig

Update requires: No interruption


An arbitrary set of tags (key-value pairs) for this GraphQL API.

Required: No

Type: List of Tag

Update requires: No interruption


Optional authorization configuration for using Amazon Cognito user pools with your GraphQL endpoint.

Required: No

Type: UserPoolConfig

Update requires: No interruption


A flag indicating whether to use Amazon X-Ray tracing for this GraphqlApi.

Required: No

Type: Boolean

Update requires: No interruption

Return values


When you pass the logical ID of an AWS::AppSync::GraphQLApi resource to the intrinsic Ref function, the function returns the ARN of the GraphQL API, such as arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid.

For more information about using the Ref function, see Ref.


Fn::GetAtt returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using Fn::GetAtt, see Fn::GetAtt.


Unique Amazon AppSync GraphQL API identifier.


The Amazon Resource Name (ARN) of the API key, such as arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid.


The Endpoint URL of your GraphQL API.


GraphQL API Creation Example

The following example creates a GraphQL API.


Parameters: graphQlApiName: Type: String userPoolId: Type: String userPoolAwsRegion: Type: String defaultAction: Type: String Resources: GraphQLApi: Type: AWS::AppSync::GraphQLApi Properties: Name: Ref: graphQlApiName AuthenticationType: "AMAZON_COGNITO_USER_POOLS" UserPoolConfig: UserPoolId: Ref: userPoolId AwsRegion: Ref: userPoolAwsRegion DefaultAction: Ref: defaultAction


{ "Parameters": { "graphQlApiName": { "Type": "String" }, "userPoolId": { "Type": "String" }, "userPoolAwsRegion": { "Type": "String" }, "defaultAction": { "Type": "String" } }, "Resources": { "GraphQLApi": { "Type": "AWS::AppSync::GraphQLApi", "Properties": { "Name": { "Ref": "graphQlApiName" }, "AuthenticationType": "AMAZON_COGNITO_USER_POOLS", "UserPoolConfig": { "UserPoolId": { "Ref": "userPoolId" }, "AwsRegion": { "Ref": "userPoolAwsRegion" }, "DefaultAction": { "Ref": "defaultAction" } } } } } }

See also