Provides an API Gateway Resource.
resource "aws_api_gateway_rest_api" "MyDemoAPI" {
name = "MyDemoAPI"
description = "This is my API for demonstration purposes"
}
resource "aws_api_gateway_resource" "MyDemoResource" {
rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
parent_id = aws_api_gateway_rest_api.MyDemoAPI.root_resource_id
path_part = "mydemoresource"
}
This resource supports the following arguments:
rest_api_id
- (Required) ID of the associated REST APIparent_id
- (Required) ID of the parent API resourcepath_part
- (Required) Last path segment of this API resource.This resource exports the following attributes in addition to the arguments above:
id
- Resource's identifier.path
- Complete path for this API resource, including all parent paths.In Terraform v1.5.0 and later, use an import
block to import aws_api_gateway_resource
using REST-API-ID/RESOURCE-ID
. For example:
import {
to = aws_api_gateway_resource.example
id = "12345abcde/67890fghij"
}
Using terraform import
, import aws_api_gateway_resource
using REST-API-ID/RESOURCE-ID
. For example:
% terraform import aws_api_gateway_resource.example 12345abcde/67890fghij