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).

AWS::AppSync::GraphQLApi

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.

Syntax

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

JSON

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

Properties

AdditionalAuthenticationProviders

A list of additional authentication providers for the GraphqlApi API.

Required: No

Type: List of AdditionalAuthenticationProvider

Update requires: No interruption

AuthenticationType

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

LambdaAuthorizerConfig

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

LogConfig

The Amazon CloudWatch Logs configuration.

Required: No

Type: LogConfig

Update requires: No interruption

Name

The API name.

Required: Yes

Type: String

Update requires: No interruption

OpenIDConnectConfig

The OpenID Connect configuration.

Required: No

Type: OpenIDConnectConfig

Update requires: No interruption

Tags

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

Required: No

Type: List of Tag

Update requires: No interruption

UserPoolConfig

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

Required: No

Type: UserPoolConfig

Update requires: No interruption

XrayEnabled

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

Required: No

Type: Boolean

Update requires: No interruption

Return values

Ref

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

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.

ApiId

Unique Amazon AppSync GraphQL API identifier.

Arn

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

GraphQLUrl

The Endpoint URL of your GraphQL API.

Examples

GraphQL API Creation Example

The following example creates a GraphQL API.

YAML

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

JSON

{ "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