AWS::AppSync::GraphQLApi
The
AWS::AppSync::GraphQLApi resource will create a new AWS AppSync GraphQL API.
This is the top level construct for your application. For more information see
Quickstart Guide.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::AppSync::GraphQLApi", "Properties" : { "UserPoolConfig" : UserPoolConfig, "OpenIDConnectConfig" : OpenIDConnectConfig, "Name" :String, "AuthenticationType" :String, "LogConfig" : LogConfig } }
YAML
Type: "AWS::AppSync::GraphQLApi" Properties: UserPoolConfig: UserPoolConfig OpenIDConnectConfig : OpenIDConnectConfig Name:StringAuthenticationType:StringLogConfig: LogConfig
Properties
UserPoolConfig-
Optional authorization configuration for using Amazon Cognito User Pools with your GraphQL endpoint.
Required: No
Type: UserPoolConfig
Update requires: No interruption
OpenIDConnectConfig-
Optional authorization configuration for using an OpenId Connect compliant service with your GraphQL endpoint.
Required: No
Type: OpenId Connect Config
Update requires: No interruption
Name-
Friendly name for your GraphQL API in AWS AppSync.
Required: Yes
Type: String
Update requires: No interruption
AuthenticationType-
Security configuration for your GraphQL API. For allowed values (such as API_KEY, AWS_IAM, or AMAZON_COGNITO_USER_POOLS, OPENID_CONNECT), see Security in the AWS AppSync Developer Guide.
Required: Yes
Type: String
Update requires: No interruption
LogConfig-
Logging configuration when writing GraphQL operations and tracing to Amazon Cloudwatch.
Required: No
Type: LogConfig
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.
GraphQLUrl-
The Endpoint URL of your GraphQL API.
Arn-
The Amazon Resource Name (ARN) of the API key, such as
arn:aws:appsync:us-east-1:123456789012:apis/graphqlapiid. ApiId-
Unique AWS AppSync GraphQL API Identifier.
For more information about using
Fn::GetAtt, see
Fn::GetAtt.
Examples
GraphQL API creation example
The following example creates a GraphQL API
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" } } } } } }
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
See Also
-
CreateGraphqlApi operation in the AWS AppSync API Reference
