Manages an Amazon API Gateway Version 2 API mapping. More information can be found in the Amazon API Gateway Developer Guide.
resource "aws_apigatewayv2_api_mapping" "example" {
api_id = aws_apigatewayv2_api.example.id
domain_name = aws_apigatewayv2_domain_name.example.id
stage = aws_apigatewayv2_stage.example.id
}
This resource supports the following arguments:
api_id
- (Required) API identifier.domain_name
- (Required) Domain name. Use the aws_apigatewayv2_domain_name
resource to configure a domain name.stage
- (Required) API stage. Use the aws_apigatewayv2_stage
resource to configure an API stage.api_mapping_key
- (Optional) The API mapping key. Refer to REST API, HTTP API or WebSocket API.This resource exports the following attributes in addition to the arguments above:
id
- API mapping identifier.In Terraform v1.5.0 and later, use an import
block to import aws_apigatewayv2_api_mapping
using the API mapping identifier and domain name. For example:
import {
to = aws_apigatewayv2_api_mapping.example
id = "1122334/ws-api.example.com"
}
Using terraform import
, import aws_apigatewayv2_api_mapping
using the API mapping identifier and domain name. For example:
% terraform import aws_apigatewayv2_api_mapping.example 1122334/ws-api.example.com