» Resource: aws_apigatewayv2_domain_name

Manages an Amazon API Gateway Version 2 domain name. More information can be found in the Amazon API Gateway Developer Guide.

» Example Usage

» Basic

resource "aws_apigatewayv2_domain_name" "example" {
  domain_name = "ws-api.example.com"

  domain_name_configuration {
    certificate_arn = "${aws_acm_certificate.example.arn}"
    endpoint_type   = "REGIONAL"
    security_policy = "TLS_1_2"
  }
}

» Argument Reference

The following arguments are supported:

The domain_name_configuration object supports the following:

  • certificate_arn - (Required) The ARN of an AWS-managed certificate that will be used by the endpoint for the domain name. AWS Certificate Manager is the only supported source. Use the aws_acm_certificate resource to configure an ACM certificate.
  • endpoint_type - (Required) The endpoint type. Valid values: REGIONAL.
  • security_policy - (Required) The Transport Layer Security (TLS) version of the security policy for the domain name. Valid values: TLS_1_2.
  • hosted_zone_id - (Computed) The Amazon Route 53 Hosted Zone ID of the endpoint.
  • target_domain_name - (Computed) The target domain name.

» Attribute Reference

In addition to all arguments above, the following attributes are exported:

» Timeouts

aws_apigatewayv2_domain_name provides the following Timeouts configuration options:

  • update - (Default 60 minutes) Used for updating the domain name

» Import

aws_apigatewayv2_domain_name can be imported by using the domain name, e.g.

$ terraform import aws_apigatewayv2_domain_name.example ws-api.example.com