Skip to content

Commit 9637fce

Browse files
committed
feat: adding the ability to associate a collection of hosted domains
1 parent a0b6cdd commit 9637fce

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dns.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ resource "aws_route53_resolver_rule_association" "vpc_associations" {
3232
resolver_rule_id = each.value
3333
vpc_id = module.vpc.vpc_attributes.id
3434
}
35+
36+
## Associate the route53 hosted zone with the VPC
37+
resource "aws_route53_zone_association" "association" {
38+
for_each = toset(var.associate_hosted_ids)
39+
40+
vpc_id = module.vpc.vpc_attributes.id
41+
zone_id = each.value
42+
}

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
variable "associate_hosted_ids" {
2+
description = "The list of hosted zone ids to associate with the VPC"
3+
type = list(string)
4+
default = []
5+
}
6+
17
variable "availability_zones" {
28
description = "The number of availability zone the network should be deployed into"
39
type = number

0 commit comments

Comments
 (0)