Skip to content

Resource: awsAppsyncType

Provides an AppSync Type.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsAppsyncGraphqlApiExample = new aws.appsyncGraphqlApi.AppsyncGraphqlApi(
  this,
  "example",
  {
    authenticationType: "API_KEY",
    name: "example",
  }
);
const awsAppsyncTypeExample = new aws.appsyncType.AppsyncType(
  this,
  "example_1",
  {
    apiId: awsAppsyncGraphqlApiExample.id,
    definition:
      "type Mutation\n\n{\nputPost(id: ID!,title: String! ): Post\n\n}\n",
    format: "SDL",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsAppsyncTypeExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • apiId - (Required) GraphQL API ID.
  • format - (Required) The type format: sdl or json.
  • definition - (Required) The type definition.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - The ARN of the type.
  • description - The type description.
  • id - The ID is constructed from apiId:format:name.
  • name - The type name.

Import

Appsync Types can be imported using the id e.g.,

$ terraform import aws_appsync_type.example api-id:format:name