Sets up a basic API Gateway with a GET method and a mock integration, along with a 200 OK method response.

Terraform Template

resource "aws_api_gateway_integration" "MyDemoIntegration" {
  http_method = aws_api_gateway_method.MyDemoMethod.http_method
  resource_id = aws_api_gateway_resource.MyDemoResource.id
  rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
  type = "MOCK"
}

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_method_response" "response_200" {
  http_method = aws_api_gateway_method.MyDemoMethod.http_method
  resource_id = aws_api_gateway_resource.MyDemoResource.id
  rest_api_id = aws_api_gateway_rest_api.MyDemoAPI.id
  status_code = "200"
}

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