Detect, troubleshoot & optimize AWS environments in real-time ->

Amazon Web Service (AWS)

API Gateway

Amazon API Gateway is a fully managed service that enables developers to create, publish, maintain, monitor, and secure APIs at any scale. It basically connects non-AWS applications to AWS back-end resources, such as servers and code. The API gateway accepts and processes concurrent API calls, which happens when APIs submit requests to a server. It manages traffic, authorizes end users and monitors performance.
API Gateway charges for the number of API calls received and the amount of data transferred out, with varying prices based on the geographical region in which the service is used. You are also charged for the amount of storage used by your APIs and the amount of data transferred in. The cost of using API Gateway can vary based on the number of API calls made, the size of data transferred, and the amount of storage used.
Direct Cost



Indirect Cost
No items found.
Terraform Name
API Gateway
  • rest_api_id - (Required) ID of the associated REST API
  • parent_id - (Required) ID of the parent API resource
  • path_part - (Required) Last path segment of this API resource.

Associating resources with a
API Gateway
Resources do not "belong" to a
API Gateway
Rather, one or more Security Groups are associated to a resource.
API Gateway
via Terraform:
The following HCL creates 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 =
 parent_id   = aws_api_gateway_rest_api.MyDemoAPI.root_resource_id
 path_part   = "mydemoresource"

API Gateway
via CLI:

--rest-api-id <value>
--parent-id <value>
--path-part <value>
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--endpoint-url <value>]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]


aws apigateway create-resource --rest-api-id 1234123412 --parent-id a1b2c3 --path-part 'new-resource'

Best Practices for
API Gateway

Categorized by Availability, Security & Compliance and Cost

Explore all the rules our platform covers
Related blog posts
All Resources