Skip to content

Resource: awsAppsyncApiKey

Provides an AppSync API Key.

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 awsAppsyncApiKeyExample = new aws.appsyncApiKey.AppsyncApiKey(
  this,
  "example_1",
  {
    apiId: awsAppsyncGraphqlApiExample.id,
    expires: "2018-05-03T04:00:00Z",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsAppsyncApiKeyExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • apiId - (Required) ID of the associated AppSync API
  • description - (Optional) API key description. Defaults to "Managed by Terraform".
  • expires - (Optional) RFC3339 string representation of the expiry date. Rounded down to nearest hour. By default, it is 7 days from the date of creation.

Attributes Reference

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

  • id - API Key ID (Formatted as ApiId:Key)
  • key - API key

Import

awsAppsyncApiKey can be imported using the AppSync API ID and key separated by :, e.g.,

$ terraform import aws_appsync_api_key.example xxxxx:yyyyy