Skip to content

Build the hub

Apply terraform/accounts/network in central mode: BIND, hub outbound, two FORWARD rules (forward + reverse), and a RAM share to the spoke accounts.

Before apply: Prerequisites — especially RAM org sharing from the management account.

What this creates

All in the network VPC:

Resource Detail
Private subnets (2 AZs) SSM interface endpoints (1 AZ) + S3 gateway endpoint
BIND @ 10.0.0.10 Authoritative for corp.demo.internal and 100.0.10.in-addr.arpa
Outbound endpoint 2 ENIs (billable)
FORWARD rules (×2) Forward zone + reverse zone → 10.0.0.10 (same endpoint)
RAM share Both rules; principals = dev + sandbox
dig test client SSM + bind-utils

Configure

cd terraform/accounts/network
cp terraform.tfvars.example terraform.tfvars
(no output)

Edit terraform.tfvars (account IDs from Check profiles):

outbound_pattern     = "central"
workload_account_ids = ["234567890123", "345678901234"]

Apply

Mutation guard

Local agent shells need export R53_OUTBOUND_ALLOW_AWS=1 before apply/destroy.

terraform init
Initializing the backend...
Initializing provider plugins...
...
Terraform has been successfully initialized!
terraform apply
Apply complete! Resources: 36 added, 0 changed, 0 destroyed.

Outputs:

account_id               = "123456789012"
dns_server_ip            = "10.0.0.10"
resolver_rule_id         = "rslvr-rr-c6f17286c56046a89"
reverse_resolver_rule_id = "rslvr-rr-1cac69d7e92e481eb"
reverse_zone_name        = "100.0.10.in-addr.arpa"
test_client_instance_id  = "i-09e2fb6ff74bd0f8b"

Capture outputs for spokes

terraform output -raw resolver_rule_id
rslvr-rr-c6f17286c56046a89
terraform output -raw reverse_resolver_rule_id
rslvr-rr-1cac69d7e92e481eb
terraform output -raw ram_share_arn
arn:aws:ram:ap-southeast-2:123456789012:resource-share/b50d638e-1d5a-467a-a0d7-6458bda162c6
terraform output -raw dns_server_ip
10.0.0.10
terraform output -raw vpc_id
vpc-012a14c39b799bad7
terraform output -raw vpc_cidr
10.0.0.0/16
terraform output -raw account_id
123456789012
terraform output -raw test_client_instance_id
i-09e2fb6ff74bd0f8b

Keep resolver_rule_id and reverse_resolver_rule_id for the next step.

Next: Attach spokes.