From b4778527fdf4704b3f9a60956941a46d78dc60a6 Mon Sep 17 00:00:00 2001 From: dwara001 Date: Thu, 14 May 2026 11:59:42 -0400 Subject: [PATCH] update markdown to add shared-setup and vpc0 process --- docs/how-to/aws-vpc-setup/shared-vpc.md | 127 ++++-------------------- 1 file changed, 21 insertions(+), 106 deletions(-) diff --git a/docs/how-to/aws-vpc-setup/shared-vpc.md b/docs/how-to/aws-vpc-setup/shared-vpc.md index b8136a4b..66b0763d 100644 --- a/docs/how-to/aws-vpc-setup/shared-vpc.md +++ b/docs/how-to/aws-vpc-setup/shared-vpc.md @@ -184,92 +184,6 @@ Go into that git repository. * lab-gov internal lab-network-nonprod * 269244441389-lab-gov-network-nonprod -Then, go to the directory with desired region and selected VPC number. You **must** use one from the table above, as the files are copied from the network account in a later -step. There is no variation permitted here. - -```script -cd vpc-shared/west/general -cd vpc5 # ite -``` - -* edit `variables.share.auto.tfvars` -* add account or OU - -```hcl -share_organizational_unit_list = [ ] - -share_account_list = [ - { - alias = "ma48-gov" - account_id = "247901282001" - enabled = true - }, -] -``` - -```console -% tf-plan -. -. -% tf-plan summary -* tf-plan summary from log logs/plan.20230705.1688581247.log -> to-be created (30) - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-004877491965ff626:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-021984493e1e380ee:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-040f269a66fc4b393:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0449a3f9e37ef5a39:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-05082541fe0274138:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0648dcfba9b43df8c:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0692c31434d79f1e7:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-09eb4a4d53fb4f6da:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0a75fcbf843541aab:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0a9f392349a9f983c:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0b219a62f11ec6e03:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0cc5ceab4a41703ca:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0f4c538e1401a4200:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0f59e1f1643bee84e:247901282001"] will be created - # module.share_networks.aws_ram_principal_association.subnets_accounts["subnet-0f7df49f43efa76bf:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-004877491965ff626:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-021984493e1e380ee:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-040f269a66fc4b393:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0449a3f9e37ef5a39:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-05082541fe0274138:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0648dcfba9b43df8c:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0692c31434d79f1e7:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-09eb4a4d53fb4f6da:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0a75fcbf843541aab:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0a9f392349a9f983c:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0b219a62f11ec6e03:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0cc5ceab4a41703ca:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0f4c538e1401a4200:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0f59e1f1643bee84e:247901282001"] will be created - # module.share_networks.aws_ram_resource_association.subnets_accounts["subnet-0f7df49f43efa76bf:247901282001"] will be created - -> to-be updated (0) - -> to-be replaced (0) - -> to-be destroyed (0) - -> has changed (0) - -Plan: 30 to add, 0 to change, 0 to destroy -``` - -Then, if everything looks good, apply. - -```script -tf-apply -``` - -Perform the normal git operations (this should be done in a branch, add, commit, PR, apply from merged PR). - -## target account - -Now we will be working in the target account. That is, the account in which you want to *use* the shared VPC. -We have a per-region setup, as well as a per-VPC setup. For the first time setup of any shared VPC, you will copy the -code into the shared per-region setup. If you add another shared VPC into the account, for the same region, you need only -apply the shared per-region code. ### shared setup @@ -280,15 +194,10 @@ and the latest from that branch (`git pull origin tf-upgrade`). You'll then syn ```console % cd TARGET-ACCOUNT-REPO % cd vpc/west -% mkdir shared-setup % cd shared-setup # if needed to setup tf 1.x, run next line -% tf-run init - -% rsync -avRWH PATH/terraform-modules/aws-vpc-setup/examples/region-shared-setup/./ ./ -sending incremental file list -./ +Update credentials.network_account.auto.tfvars and uncomment the correct network prod account README.md credentials.network_account.auto.tfvars credentials.network_account.tf @@ -297,34 +206,38 @@ tags.tf tf-run.data versions.tf -sent 2946 bytes received 129 bytes 6150.00 bytes/sec -total size is 2512 speedup is 0.82 ``` Uncomment the appropriate `network_role_arn` from `credentials.network_account.auto.tfvars` based on what environment you are using (ent network-prod, ent dmz-network-prod, lab network-nonprod). -The apply has multiple steps, so be sure to run them both. You do not need need a plan here. - ```console -% tf-run apply -. -. -Plan: 158 to add, 0 to change, 0 to destroy. -. -. -Apply complete! Resources: 158 added, 0 changed, 0 destroyed. +% tf-run plan . . -Plan: 8 to add, 0 to change, 0 to destroy. +Plan: 1376 to add, 0 to change, 0 to destroy. +``` +% cd vpc/west/vpc0 +```console +% tf-run plan . . -Apply complete! Resources: 8 added, 0 changed, 0 destroyed. +Plan: 2 to add, 0 to change, 0 to destroy. ``` - Perform the normal git operations (this should be done in a branch, add, commit, PR, apply from merged PR; note it's okay here to add the files created after the apply, when doing this for the first time). +* commit, push, and PR +* review and merge +Then, if everything looks good, apply. + +```console +%tf-run apply + +Apply complete! Resources: 1376 to add, 0 to change, 0 to destroy. +. +``` + ### vpc setup Use the same vpc number as in the shared directory from the table. You will now copy in from the example code the per-vpc configuration files @@ -451,3 +364,5 @@ Perform the normal git operations (this should be done in a branch, add, commit, - update indicating no actions needed in network acount - add links - add table for DMZ vpc +* 1.0.15 -- 2026-05-14 + - update on markdown and adding directions on shared-setup and vpc0