Created
May 4, 2020 23:22
-
-
Save brunodasilvalenga/e5bb9a5e88aac0bc4aa0dc2941f40992 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_api_gateway_domain_name" "services_gateway" { | |
domain_name = "${local.workspace["services_gateway_hostname"]}" | |
regional_certificate_arn = "${data.aws_acm_certificate.domain_host.arn}" | |
endpoint_configuration { | |
types = ["REGIONAL"] | |
} | |
} | |
data "aws_route53_zone" "services_selected" { | |
name = "${local.workspace["services_gateway_hosted_zone"]}" | |
} | |
resource "aws_route53_record" "services_hostname" { | |
count = local.workspace["services_gateway_create_domain"] ? 1 : 0 | |
name = "${aws_api_gateway_domain_name.services_gateway.domain_name}" | |
type = "A" | |
zone_id = "${data.aws_route53_zone.services_selected.zone_id}" | |
alias { | |
evaluate_target_health = true | |
name = "${aws_api_gateway_domain_name.services_gateway.regional_domain_name}" | |
zone_id = "${aws_api_gateway_domain_name.services_gateway.regional_zone_id}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment