Configures a regional API Gateway with an ACM certificate and sets up a corresponding DNS record using Route53.

Terraform Template

resource "aws_api_gateway_domain_name" "example" {
  domain_name = "api.example.com"

  endpoint_configuration {
    types = ["REGIONAL"]
  }
  regional_certificate_arn = "aws_acm_certificate_validation.example.certificate_arn"
}

resource "aws_route53_record" "example" {

  alias {
    evaluate_target_health = true
    name = aws_api_gateway_domain_name.example.regional_domain_name
    zone_id = aws_api_gateway_domain_name.example.regional_zone_id
  }
  name = aws_api_gateway_domain_name.example.domain_name
  type = "A"
  zone_id = "aws_route53_zone.example.id"
}