Skip to content

Resource: awsApiGatewayDocumentationPart

Provides a settings of an API Gateway Documentation Part.

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 awsApiGatewayRestApiExample = new aws.apiGatewayRestApi.ApiGatewayRestApi(
  this,
  "example",
  {
    name: "example_api",
  }
);
const awsApiGatewayDocumentationPartExample =
  new aws.apiGatewayDocumentationPart.ApiGatewayDocumentationPart(
    this,
    "example_1",
    {
      location: {
        method: "GET",
        path: "/example",
        type: "METHOD",
      },
      properties: '{"description":"Example description"}',
      restApiId: awsApiGatewayRestApiExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsApiGatewayDocumentationPartExample.overrideLogicalId("example");

Argument Reference

The following argument is supported:

  • location - (Required) Location of the targeted API entity of the to-be-created documentation part. See below.
  • properties - (Required) Content map of API-specific key-value pairs describing the targeted API entity. The map must be encoded as a JSON string, e.g., "{ "description": "The API does ..." }". Only Swagger-compliant key-value pairs can be exported and, hence, published.
  • restApiId - (Required) ID of the associated Rest API

Nested fields

location

See supported entity types for each field in the official docs.

  • method - (Optional) HTTP verb of a method. The default value is * for any method.
  • name - (Optional) Name of the targeted API entity.
  • path - (Optional) URL path of the target. The default value is / for the root resource.
  • statusCode - (Optional) HTTP status code of a response. The default value is * for any status code.
  • type - (Required) Type of API entity to which the documentation content appliesE.g., api, method or REQUEST_BODY

Attributes Reference

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

  • id - Unique ID of the Documentation Part

Import

API Gateway documentation_parts can be imported using restApiId/docPartId, e.g.,

$ terraform import aws_api_gateway_documentation_part.example 5i4e1ko720/3oyy3t