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
-
arnoptional computed - string -
authentication_typerequired - string -
idoptional computed - string -
namerequired - string -
schemaoptional - string -
tagsoptional - map from string to string -
urisoptional computed - map from string to string -
xray_enabledoptional - bool -
additional_authentication_providerlist block-
authentication_typerequired - string -
openid_connect_configlist block -
user_pool_configlist block-
app_id_client_regexoptional - string -
aws_regionoptional computed - string -
user_pool_idrequired - string
-
-
-
log_configlist block-
cloudwatch_logs_role_arnrequired - string -
exclude_verbose_contentoptional - bool -
field_log_levelrequired - string
-
-
openid_connect_configlist block -
user_pool_configlist block-
app_id_client_regexoptional - string -
aws_regionoptional computed - string -
default_actionrequired - string -
user_pool_idrequired - 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
-
OpenIDConnectConfigoptional - OpenIDConnectConfig -
LambdaAuthorizerConfigoptional - LambdaAuthorizerConfig -
XrayEnabledoptional - Boolean -
UserPoolConfigoptional - UserPoolConfig -
Tagsoptional - Tags -
Namerequired - String -
AuthenticationTyperequired - String -
LogConfigoptional - LogConfig -
AdditionalAuthenticationProvidersoptional - AdditionalAuthenticationProviders
Explanation in CloudFormation Registry
The
AWS::AppSync::GraphQLApiresource 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.