Provides a settings of an API Gateway Documentation Part.
resource "aws_api_gateway_documentation_part" "example" {
location {
type = "METHOD"
method = "GET"
path = "/example"
}
properties = "{\"description\":\"Example description\"}"
rest_api_id = aws_api_gateway_rest_api.example.id
}
resource "aws_api_gateway_rest_api" "example" {
name = "example_api"
}
This resource supports the following arguments:
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.rest_api_id
- (Required) ID of the associated Rest APIlocation
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.status_code
- (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
This resource exports the following attributes in addition to the arguments above:
documentation_part_id
- The DocumentationPart identifier, generated by API Gateway when the documentation part is created.id
- Unique ID of the Documentation PartIn Terraform v1.5.0 and later, use an import
block to import API Gateway documentation_parts using REST-API-ID/DOC-PART-ID
. For example:
import {
to = aws_api_gateway_documentation_part.example
id = "5i4e1ko720/3oyy3t"
}
Using terraform import
, import API Gateway documentation_parts using REST-API-ID/DOC-PART-ID
. For example:
% terraform import aws_api_gateway_documentation_part.example 5i4e1ko720/3oyy3t