Attach spokes¶
Apply each spoke root once: terraform/accounts/dev, then
terraform/accounts/sandbox. In central they only associate the shared
rule — no local outbound endpoint (eni_count = 0).
What this creates (each spoke)¶
| Resource | Detail |
|---|---|
| Private subnets | SSM interface endpoints + S3 gateway |
| dig test client | SSM + bind-utils |
| Rule association | Shared FORWARD rules (corp + reverse) from network via RAM |
| Outbound endpoint | None in central |
Query path after this step:
Spoke dig → VPC Resolver → shared rule → hub ENIs → BIND. No peering required for resolution.
Configure (dev)¶
cd terraform/accounts/dev
cp terraform.tfvars.example terraform.tfvars
(no output)
Edit terraform.tfvars — set shared_resolver_rule_id from
Build the hub:
outbound_pattern = "central"
vpc_cidr = "10.1.0.0/16"
shared_resolver_rule_id = "rslvr-rr-c6f17286c56046a89"
shared_reverse_resolver_rule_id = "rslvr-rr-1cac69d7e92e481eb"
# ram_share_accept_required = false # default when org auto-accept works
# ram_share_arn = "..." # only if accept is required
Apply (dev)¶
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: 17 added, 0 changed, 0 destroyed.
Outputs:
account_id = "234567890123"
eni_count = 0
outbound_pattern = "central"
peering_connection_id = ""
resolver_endpoint_id = ""
test_client_instance_id = "i-09e4080d662e78cd7"
vpc_cidr = "10.1.0.0/16"
vpc_id = "vpc-0040c8b17ae1c1dc0"
Confirm the dig client ID for Verify with dig:
terraform output -raw test_client_instance_id
i-09e4080d662e78cd7
terraform output -raw eni_count
0
Configure (sandbox)¶
cd terraform/accounts/sandbox
cp terraform.tfvars.example terraform.tfvars
(no output)
Same rule ID; sandbox uses a different VPC CIDR:
outbound_pattern = "central"
vpc_cidr = "10.2.0.0/16"
shared_resolver_rule_id = "rslvr-rr-c6f17286c56046a89"
shared_reverse_resolver_rule_id = "rslvr-rr-1cac69d7e92e481eb"
Apply (sandbox)¶
terraform init
Terraform has been successfully initialized!
terraform apply
Apply complete! Resources: 17 added, 0 changed, 0 destroyed.
Outputs:
account_id = "345678901234"
eni_count = 0
outbound_pattern = "central"
peering_connection_id = ""
resolver_endpoint_id = ""
test_client_instance_id = "i-028971f8ce654c6e0"
vpc_cidr = "10.2.0.0/16"
vpc_id = "vpc-05fa5dc9ddd60cd39"
terraform output -raw test_client_instance_id
i-028971f8ce654c6e0
Next: Verify with dig.