Creates a basic AWS API Gateway setup with a REST API, a resource, and a GET method.

Terraform Template

resource "aws_api_gateway_method" "MyDemoMethod" {
  authorization = "NONE"
  http_method = "GET"
  resource_id = aws_api_gateway_resource.MyDemoResource.id
  rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
}

resource "aws_api_gateway_resource" "MyDemoResource" {
  parent_id = aws_api_gateway_rest_api.MyDemoAPI.root_resource_id
  path_part = "mydemoresource"
  rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
}

resource "aws_api_gateway_rest_api" "MyDemoAPI" {
  description = "This is my API for demonstration purposes"
  name = "MyDemoAPI"
}