Skip to content

Commit

Permalink
make zone data be per-vpc
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Apr 22, 2023
1 parent d73eeb4 commit dc4f02f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions route53-zone-association/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ resource "aws_route53_zone_association" "peer_zones" {

resource "aws_ssm_parameter" "self_zones" {
for_each = var.enable_ssm_parameter ? { for k, v in data.aws_route53_zone.zones : k => v.zone_id } : {}
name = format("/local/%v/route53/zones/%v", local.region, each.key)
name = format("/local/%v/route53/%v/zones/%v", local.region, var.vpc_id, each.key)
description = format("Route53 Zone Details for %v", each.key)
type = "String"
value = jsonencode({
name = each.key
account_id = data.aws_caller_identity.peer.account_id
region = data.aws_region.peer.name
zone_id = each.value
name = each.key
self_account_id = data.aws_caller_identity.self.account_id
peer_account_id = data.aws_caller_identity.peer.account_id
self_region = data.aws_region.self.name
peer_region = data.aws_region.peer.name
zone_id = each.value
vpc_id = var.vpc_id
# create_time = try(time_static.vpce[0].unix, null)
})

Expand Down

0 comments on commit dc4f02f

Please sign in to comment.