Skip to content

Commit

Permalink
feat(records): Add support for latency routing policy (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
egarbi committed Jun 28, 2022
1 parent 46044ec commit 206d82c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ module "records" {
failover_routing_policy = {
type = "SECONDARY"
}
},
{
name = "latency-test"
type = "A"
set_identifier = "latency-test"
alias = {
name = module.cloudfront.cloudfront_distribution_domain_name
zone_id = module.cloudfront.cloudfront_distribution_hosted_zone_id
evaluate_target_health = true
}
latency_routing_policy = {
region = "eu-west-1"
}
}
]

Expand Down
8 changes: 8 additions & 0 deletions modules/records/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ resource "aws_route53_record" "this" {
}
}

dynamic "latency_routing_policy" {
for_each = length(keys(lookup(each.value, "latency_routing_policy", {}))) == 0 ? [] : [true]

content {
region = each.value.latency_routing_policy.region
}
}

dynamic "weighted_routing_policy" {
for_each = length(keys(lookup(each.value, "weighted_routing_policy", {}))) == 0 ? [] : [true]

Expand Down

0 comments on commit 206d82c

Please sign in to comment.