AWS AppSync Graphql API
This page shows how to write Terraform and CloudFormation for AWS AppSync Graphql API and write them securely.
aws_appsync_graphql_api (Terraform)
The Graphql API in AWS AppSync can be configured in Terraform with the resource name aws_appsync_graphql_api
. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "aws_appsync_graphql_api" "graphql_api" {
authentication_type = "API_KEY"
name = var.api_name
schema = var.schema
resource "aws_appsync_graphql_api" "main" {
authentication_type = "API_KEY"
name = var.api_name
schema = var.schema
tags = var.common_tags
}
resource "aws_appsync_graphql_api" "recipeBook" {
name = "tf_recipe_book_appsync"
authentication_type = "AWS_IAM"
}
resource "aws_appsync_datasource" "recipeBook" {
Parameters
-
arn
optional computed - string -
authentication_type
required - string -
id
optional computed - string -
name
required - string -
schema
optional - string -
tags
optional - map from string to string -
uris
optional computed - map from string to string -
xray_enabled
optional - bool -
additional_authentication_provider
list block-
authentication_type
required - string -
openid_connect_config
list block -
user_pool_config
list block-
app_id_client_regex
optional - string -
aws_region
optional computed - string -
user_pool_id
required - string
-
-
-
log_config
list block-
cloudwatch_logs_role_arn
required - string -
exclude_verbose_content
optional - bool -
field_log_level
required - string
-
-
openid_connect_config
list block -
user_pool_config
list block-
app_id_client_regex
optional - string -
aws_region
optional computed - string -
default_action
required - string -
user_pool_id
required - string
-
Explanation in Terraform Registry
Provides an AppSync GraphQL API.
AWS::AppSync::GraphQLApi (CloudFormation)
The GraphQLApi in AppSync can be configured in CloudFormation with the resource name AWS::AppSync::GraphQLApi
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
-
OpenIDConnectConfig
optional - OpenIDConnectConfig -
LambdaAuthorizerConfig
optional - LambdaAuthorizerConfig -
XrayEnabled
optional - Boolean -
UserPoolConfig
optional - UserPoolConfig -
Tags
optional - Tags -
Name
required - String -
AuthenticationType
required - String -
LogConfig
optional - LogConfig -
AdditionalAuthenticationProviders
optional - AdditionalAuthenticationProviders
Explanation in CloudFormation Registry
The
AWS::AppSync::GraphQLApi
resource creates a new AWS AppSync GraphQL API. This is the top-level construct for your application. For more information, see Quick Start in the AWS AppSync Developer Guide.
Frequently asked questions
What is AWS AppSync Graphql API?
AWS AppSync Graphql API is a resource for AppSync of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.
Where can I find the example code for the AWS AppSync Graphql API?
For Terraform, the alexlapinski/gtd-tool, JamesWoolfenden/terraform-aws-appsync and lydiacupery/recipe-book source code examples are useful. See the Terraform Example section for further details.