awscc_apigatewayv2_api (Resource)

The AWS::ApiGatewayV2::Api resource creates an API. WebSocket APIs and HTTP APIs are supported. For more information about WebSocket APIs, see About WebSocket APIs in API Gateway in the API Gateway Developer Guide. For more information about HTTP APIs, see HTTP APIs in the API Gateway Developer Guide.

Example Usage

Basic Websockets API

resource "awscc_apigatewayv2_api" "example_api" {
  name                       = "example-websocket-api"
  protocol_type              = "WEBSOCKET"
  route_selection_expression = "$request.body.action"
  tags = {
    key = "Modified By"
    value = "AWSCC"
  }
}

Basic HTTP API

resource "awscc_apigatewayv2_api" "example_http_api" {
  name          = "example-http-api"
  protocol_type = "HTTP"
  tags = {
    key   = "Modified By"
    value = "AWSCC"
  }
}

Schema

Optional

Read-Only

Nested Schema for body_s3_location

Optional:

Nested Schema for cors_configuration

Optional:

Import

Import is supported using the following syntax:

$ terraform import awscc_apigatewayv2_api.example <resource ID>