AWS::AppSync::GraphQLApi
The AWS::AppSync::GraphQLApi
resource creates a new AppSync GraphQL API.
This is the top-level construct for your application. For more information, see Quick Start
in the AWS AppSync Developer Guide.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::AppSync::GraphQLApi", "Properties" : { "AdditionalAuthenticationProviders" :
AdditionalAuthenticationProviders
, "AuthenticationType" :String
, "LogConfig" :LogConfig
, "Name" :String
, "OpenIDConnectConfig" :OpenIDConnectConfig
, "Tags" :Tags
, "UserPoolConfig" :UserPoolConfig
, "XrayEnabled" :Boolean
} }
YAML
Type: AWS::AppSync::GraphQLApi Properties: AdditionalAuthenticationProviders:
AdditionalAuthenticationProviders
AuthenticationType:String
LogConfig:LogConfig
Name:String
OpenIDConnectConfig:OpenIDConnectConfig
Tags:Tags
UserPoolConfig:UserPoolConfig
XrayEnabled:Boolean
Properties
AdditionalAuthenticationProviders
-
A list of additional authentication providers for the
GraphqlApi
API.Required: No
Type: AdditionalAuthenticationProviders
Update requires: No interruption
AuthenticationType
-
Security configuration for your GraphQL API. For allowed values (such as
API_KEY
,AWS_IAM
, orAMAZON_COGNITO_USER_POOLS
,OPENID_CONNECT
), see Security in the AWS AppSync Developer Guide.Required: Yes
Type: String
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: Tags
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 representing whether X-Ray tracing is enabled 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.
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
-
CreateGraphqlApi operation in the AWS AppSync API Reference.