Resource: aws_api_gateway_resource

Provides an API Gateway Resource.

Example Usage

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"
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

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