Skip to content

Resource: awsApiGatewayResource

Provides an API Gateway Resource.

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 awsApiGatewayRestApiMyDemoApi =
  new aws.apiGatewayRestApi.ApiGatewayRestApi(this, "MyDemoAPI", {
    description: "This is my API for demonstration purposes",
    name: "MyDemoAPI",
  });
new aws.apiGatewayResource.ApiGatewayResource(this, "MyDemoResource", {
  parentId: awsApiGatewayRestApiMyDemoApi.rootResourceId,
  pathPart: "mydemoresource",
  restApiId: awsApiGatewayRestApiMyDemoApi.id,
});

Argument Reference

The following arguments are supported:

  • restApiId - (Required) ID of the associated REST API
  • parentId - (Required) ID of the parent API resource
  • pathPart - (Required) Last path segment of this API resource.

Attributes Reference

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

  • id - Resource's identifier.
  • path - Complete path for this API resource, including all parent paths.

Import

awsApiGatewayResource can be imported using restApiId/resourceId, e.g.,

$ terraform import aws_api_gateway_resource.example 12345abcde/67890fghij