File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
operations/deployment/terraform/modules/aws/route53 Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -26,19 +26,15 @@ locals {
2626# }
2727# }
2828
29- # data "aws_route53_records" "existing_dev" {
30- # count = true ? 1 : 0
31- # zone_id = data.aws_route53_zone.selected.zone_id
32- # name_regex = "${var.aws_r53_sub_domain_name}.${var.aws_r53_domain_name}"
33- # }
34- #
35- # # Or if you really need to check existing records, make it safer:
36- # locals {
37- # existing_zone_id = try(
38- # data.aws_route53_records.existing_dev[0].resource_record_sets[0].alias_target.zone_id,
39- # var.aws_elb_zone_id
40- # )
41- # }
29+ data "aws_route53_records" "existing_dev" {
30+ zone_id = data. aws_route53_zone . selected . zone_id
31+ name_regex = " ${ var . aws_r53_sub_domain_name } .${ var . aws_r53_domain_name } "
32+ }
33+
34+ # Or if you really need to check existing records, make it safer:
35+ locals {
36+ existing_zone_id = try (data. aws_route53_records . existing_dev . resource_record_sets [0 ]. alias_target . zone_id ) != " " ? data. aws_route53_records . existing_dev . resource_record_sets [0 ]. alias_target . zone_id : var. aws_elb_zone_id
37+ }
4238
4339locals {
4440 existing_zone_id = var. aws_elb_zone_id
You can’t perform that action at this time.
0 commit comments