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

main.tf#L1
resource "aws_appsync_graphql_api" "graphql_api" {
    authentication_type = "API_KEY"
    name                = var.api_name

    schema = var.schema

aws_appsync_graphql_api.main.tf#L1
resource "aws_appsync_graphql_api" "main" {
  authentication_type = "API_KEY"
  name                = var.api_name
  schema              = var.schema
  tags                = var.common_tags
}
appsync.tf#L1
resource "aws_appsync_graphql_api" "recipeBook" {
  name = "tf_recipe_book_appsync"
  authentication_type = "AWS_IAM"
}

resource "aws_appsync_datasource" "recipeBook" {

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

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

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.