Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbabenko authored Aug 19, 2024
1 parent d5ea704 commit 49960e0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,10 @@ module "vpc2" {
}

module "vpc_otheraccount" {
source = "terraform-aws-modules/vpc/aws"
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.0"

provider = aws.second_account
version = "~> 5.0"

name = "my-second-account-vpc-for-private-route53-zone"
cidr = "172.16.0.0/12"
Expand Down
6 changes: 4 additions & 2 deletions modules/zone-cross-account-vpc-association/main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
resource "aws_route53_vpc_association_authorization" "this" {
provider = aws.r53_owner
for_each = { for k, v in var.zone_vpc_associations : k => v if var.create }

provider = aws.r53_owner
zone_id = each.value.zone_id
vpc_id = each.value.vpc_id
vpc_region = try(each.value.vpc_region, null)
}

resource "aws_route53_zone_association" "this" {
provider = aws.vpc_owner
for_each = aws_route53_vpc_association_authorization.this

provider = aws.vpc_owner
vpc_id = each.value.vpc_id
zone_id = each.value.zone_id
vpc_region = try(each.value.vpc_region, null)
Expand Down
2 changes: 1 addition & 1 deletion modules/zone-cross-account-vpc-association/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ terraform {
aws = {
source = "hashicorp/aws"
version = ">= 3.56"
configuration_aliases = [ aws.r53_owner, aws.vpc_owner ]
configuration_aliases = [aws.r53_owner, aws.vpc_owner]
}
}
}

0 comments on commit 49960e0

Please sign in to comment.