aws-network-hub-for-terraform
aws-network-hub-for-terraform copied to clipboard
Feature: Conditionally Enable Ingress to spoke-vpc via org-vpc-share
Issue #, if available: https://github.com/aws-samples/aws-network-hub-for-terraform/issues/27
Description of changes: The current solution does not easily enable Ingress to spoke accounts. Although it is possible by creating additional TF stacks to deploy - for example - ALBs in the Network-Hub account which forward to IP-based Target Groups in a Spoke account, I feel this makes IaC management & organization more difficult.
It is my opinion that this solution should also be responsible for allowing Ingress to Spoke accounts, via a single example-spoke-vpc deployment, which I feel is helpful when provisioning new sub-accounts.
This PR does just that, by creating a RAM resource share org-vpc-share
from the Network-Hub account that shares the inspection_vpc's public subnets. New spoke-vpc deployments have the option of joining this org-vpc-share
by enabling an Input Flag enable_ingress
. If enabled, the spoke-vpc module joins the VPC share, seamlessly allowing spoke-account resources like an ALB to deploy into the public subnets shared by the org-vpc-share
.
For me, it just makes sense to have this feature managed by these network-hub and network-spoke modules, rather than having to deploy additional cross-account stacks with cross-account dependencies. This is a one-time action managed by the same deployment responsible for provisioning spoke-vpcs.
This feature is backwards-compatible with the current version. While now the org-vpc-share
is created by default, new subaccounts / spoke-vpc's do not join the resource share by default unless the enable_ingress
input is explicitly set to true
.
Please let me know your thoughts on this, and feel free to suggest changes (especially to the new names used).
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
I guess this really isn't needed. One could just - in there spoke-account app tf stack - create an ALB resource by assuming role into the network-hub account.