-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
411 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| locals { | ||
| _module_version = "2.6.2" | ||
| _module_version = "2.6.3" | ||
| _module_names = { | ||
| "_main_" = "aws-vpc-setup" | ||
|
|
||
|
|
||
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
examples/shared-vpc-setup/tags.tf → examples/region-shared-setup/tags.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| module "tag_shared" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//tag-shared-vpc-resources?ref=tf-upgrade" | ||
| network_account_profile = "057445207498-ent-gov-network-sa" | ||
| network_account_profile = "057405694017-ent-gov-network-prod" | ||
|
|
||
| ## optional, with defaults | ||
| ### tag_enabled_vpcs = true | ||
| ### tag_enabled_dhcp_options = true | ||
| ### tag_enabled_route_tables = true | ||
| ### tag_enabled_subnets = true | ||
| ### tag_enabled_network_acls = true | ||
| ### tag_enabled_transit_gateway = false | ||
| ### tag_enabled_transit_gateway = true | ||
| } |
3 changes: 1 addition & 2 deletions
3
examples/shared-vpc-setup/tf-run.data → examples/region-shared-setup/tf-run.data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| VERSION 1.0.1 | ||
| VERSION 1.0.0 | ||
| REMOTE-STATE | ||
| COMMAND tf-directory-setup.py -l none -f | ||
| COMMAND setup-new-directory.sh | ||
| COMMAND tf-init -upgrade | ||
| ALL | ||
| ALL | ||
| COMMAND tf-directory-setup.py -l s3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| terraform { | ||
| required_version = ">= 1.0" | ||
| required_providers { | ||
| aws = { | ||
| source = "hashicorp/aws" | ||
| version = ">= 4.0" | ||
| } | ||
| ## ldap = { | ||
| ## source = "trevex/ldap" | ||
| ## version = ">= 0.5.4" | ||
| ## } | ||
| ## external = { | ||
| ## source = "hashicorp/external" | ||
| ## version = ">= 1.0" | ||
| ## } | ||
| ## null = { | ||
| ## source = "hashicorp/null" | ||
| ## version = ">= 1.0" | ||
| ## } | ||
| ## random = { | ||
| ## source = "hashicorp/random" | ||
| ## version = ">= 1.0" | ||
| ## } | ||
| ## template = { | ||
| ## source = "hashicorp/template" | ||
| ## version = ">= 1.0" | ||
| ## } | ||
| ## infoblox = { | ||
| ## source = "infobloxopen/infoblox" | ||
| ## version = ">= 2.1.0" | ||
| ## } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #TFCOMMAND="terraform_0.13.7" | ||
| #TFCOMMAND="terraform_0.14.11" | ||
| TFCOMMAND="terraform_latest" | ||
| ## TF_CLI_CONFIG_FILE=$HOME/.tf-control.tfrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # https://www.terraform.io/docs/cli/config/config-file.html | ||
|
|
||
| plugin_cache_dir = "/data/terraform/terraform.d/plugin-cache" | ||
| #disable_checkpoint = true | ||
|
|
||
| provider_installation { | ||
| # filesystem_mirror { | ||
| # path = "/apps/terraform/terraform.d/providers" | ||
| # include = [ "*/*/*" ] | ||
| # } | ||
| filesystem_mirror { | ||
| path = "/data/terraform/terraform.d/providers" | ||
| include = [ "*/*/*" ] | ||
| } | ||
| # filesystem_mirror { | ||
| # path = "/apps/terraform/terraform.d/providers" | ||
| # include = [ "external.terraform.census.gov/*/*" ] | ||
| # } | ||
| direct { | ||
| include = [ "*/*/*" ] | ||
| } | ||
| } | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| - [x] nhpc-app1.rm.census.gov | ||
| - [x] nhpc-transfer1.rm.census.gov | ||
| - [x] nhpc-login1.rm.census.gov | ||
| - [x] nhpc-login2.rm.census.gov | ||
| - [x] hpc-compute1.rm.census.gov | ||
| - [ ] hpc-compute2.rm.census.gov | ||
| - [ ] hpc-compute3.rm.census.gov | ||
| - [ ] hpc-compute4.rm.census.gov | ||
| - [ ] hpc-compute5.rm.census.gov | ||
| - [ ] hpc-compute6.rm.census.gov | ||
| - [ ] hpc-compute7.rm.census.gov | ||
| - [ ] hpc-compute8.rm.census.gov | ||
| - [ ] hpc-compute9.rm.census.gov | ||
| - [ ] hpc-compute10.rm.census.gov | ||
| - [ ] hpc-compute11.rm.census.gov | ||
| - [ ] hpc-compute12.rm.census.gov | ||
| - [ ] hpc-compute13.rm.census.gov | ||
| - [ ] hpc-compute14.rm.census.gov | ||
| - [ ] hpc-compute15.rm.census.gov | ||
| - [ ] hpc-compute16.rm.census.gov | ||
| - [ ] hpc-compute17.rm.census.gov | ||
| - [ ] hpc-compute18.rm.census.gov | ||
| - [ ] hpc-compute19.rm.census.gov | ||
| - [ ] hpc-compute20.rm.census.gov | ||
| - [ ] hpc-compute21.rm.census.gov | ||
| - [ ] hpc-compute22.rm.census.gov | ||
| - [ ] hpc-compute23.rm.census.gov | ||
| - [ ] hpc-compute24.rm.census.gov | ||
| - [ ] hpc-compute25.rm.census.gov | ||
| - [ ] hpc-compute26.rm.census.gov | ||
| - [ ] hpc-compute27.rm.census.gov | ||
| - [ ] hpc-compute28.rm.census.gov | ||
| - [ ] hpc-compute29.rm.census.gov | ||
| - [ ] hpc-compute30.rm.census.gov | ||
| - [ ] hpc-compute31.rm.census.gov | ||
| - [ ] hpc-compute32.rm.census.gov | ||
| - [ ] hpc-compute33.rm.census.gov | ||
| - [ ] hpc-compute34.rm.census.gov | ||
| - [ ] hpc-compute35.rm.census.gov | ||
| - [ ] hpc-compute36.rm.census.gov | ||
| - [ ] hpc-compute37.rm.census.gov | ||
| - [ ] hpc-compute38.rm.census.gov | ||
| - [ ] hpc-compute39.rm.census.gov | ||
| - [ ] hpc-compute40.rm.census.gov | ||
| - [ ] hpc-compute41.rm.census.gov | ||
| - [ ] hpc-compute42.rm.census.gov | ||
| - [ ] hpc-compute43.rm.census.gov | ||
| - [ ] hpc-compute44.rm.census.gov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #TFCOMMAND="terraform_0.13.7" | ||
| #TFCOMMAND="terraform_0.14.11" | ||
| TFCOMMAND="terraform_latest" | ||
| ## TF_CLI_CONFIG_FILE=$HOME/.tf-control.tfrc |
23 changes: 23 additions & 0 deletions
23
examples/shared-vpc-setup-tf-upgrade/apps/.tf-control.tfrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # https://www.terraform.io/docs/cli/config/config-file.html | ||
|
|
||
| plugin_cache_dir = "/data/terraform/terraform.d/plugin-cache" | ||
| #disable_checkpoint = true | ||
|
|
||
| provider_installation { | ||
| # filesystem_mirror { | ||
| # path = "/apps/terraform/terraform.d/providers" | ||
| # include = [ "*/*/*" ] | ||
| # } | ||
| filesystem_mirror { | ||
| path = "/data/terraform/terraform.d/providers" | ||
| include = [ "*/*/*" ] | ||
| } | ||
| # filesystem_mirror { | ||
| # path = "/apps/terraform/terraform.d/providers" | ||
| # include = [ "external.terraform.census.gov/*/*" ] | ||
| # } | ||
| direct { | ||
| include = [ "*/*/*" ] | ||
| } | ||
| } | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| locals { | ||
| region = var.region | ||
| } | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| VERSION 1.0.0 | ||
| REMOTE-STATE | ||
| COMMAND tf-directory-setup.py -l none -f | ||
| COMMAND setup-new-directory.sh | ||
| COMMAND tf-init -upgrade | ||
| ALL | ||
| COMMAND tf-directory-setup.py -l s3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| terraform { | ||
| required_providers { | ||
| aws = { | ||
| source = "hashicorp/aws" | ||
| version = ">= 3.0" | ||
| } | ||
| # ldap = { | ||
| # source = "trevex/ldap" | ||
| # version = ">= 0.5.4" | ||
| # } | ||
| # external = { | ||
| # source = "hashicorp/external" | ||
| # version = ">= 1.0" | ||
| # } | ||
| # null = { | ||
| # source = "hashicorp/null" | ||
| # version = ">= 1.0" | ||
| # } | ||
| # random = { | ||
| # source = "hashicorp/random" | ||
| # version = ">= 1.0" | ||
| # } | ||
| # template = { | ||
| # source = "hashicorp/template" | ||
| # version = ">= 1.0" | ||
| # } | ||
| # infoblox = { | ||
| # source = "infobloxopen/infoblox" | ||
| # version = ">= 2.1.0" | ||
| # } | ||
| } | ||
| required_version = ">= 1.0" | ||
| } |
35 changes: 35 additions & 0 deletions
35
examples/shared-vpc-setup-tf-upgrade/outputs.shared-vpc.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| locals { | ||
| shared_vpc_info = { | ||
| vpc_id = data.aws_vpc.vpc.id | ||
| vpc_arn = data.aws_vpc.vpc.arn | ||
| vpc_cidr_block = data.aws_vpc.vpc.cidr_block | ||
| vpc_full_name = var.vpc_full_name | ||
| owner_id = data.aws_vpc.vpc.owner_id | ||
| vpc_environment = data.aws_vpc.vpc.tags["Environment"] | ||
| vpc_short_name = split("-", var.vpc_full_name)[0] | ||
| vpc_domain_name = data.aws_vpc_dhcp_options.dhcp_options.domain_name | ||
| # _raw = data.aws_vpc.vpc | ||
| } | ||
| shared_private_subnet_info = [for k, v in data.aws_subnet.subnet : { | ||
| id = v.id | ||
| arn = v.arn | ||
| availability_zone = v.availability_zone | ||
| owner_id = v.owner_id | ||
| cidr_block = v.cidr_block | ||
| subnet = v.cidr_block | ||
| label = replace(v.tags["Name"], format("%v-", var.vpc_full_name), "") | ||
| tags = v.tags | ||
| # _raw = v | ||
| }] | ||
| } | ||
|
|
||
|
|
||
| output "shared_vpc_info" { | ||
| description = "Details from shared VPC" | ||
| value = local.shared_vpc_info | ||
| } | ||
|
|
||
| output "shared_private_subnet_info" { | ||
| description = "Details from shared VPC subnets" | ||
| value = local.shared_private_subnet_info | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| locals { | ||
| region = var.region | ||
| } | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| data "aws_vpcs" "vpcs" { | ||
| filter { | ||
| name = "tag:Name" | ||
| values = [var.vpc_full_name] | ||
| } | ||
| } | ||
|
|
||
| data "aws_vpc" "vpc" { | ||
| id = coalesce(data.aws_vpcs.vpcs.ids[0], null) | ||
| } | ||
|
|
||
| data "aws_subnets" "subnets" { | ||
| filter { | ||
| name = "vpc-id" | ||
| values = [data.aws_vpc.vpc.id] | ||
| } | ||
| } | ||
|
|
||
| data "aws_subnet" "subnet" { | ||
| for_each = toset(data.aws_subnets.subnets.ids) | ||
| id = each.key | ||
| } | ||
|
|
||
| data "aws_vpc_dhcp_options" "dhcp_options" { | ||
| dhcp_options_id = data.aws_vpc.vpc.dhcp_options_id | ||
| } | ||
|
|
||
| ## output "vpcs" { | ||
| ## value = data.aws_vpcs.vpcs | ||
| ## } | ||
| ## | ||
| ## output "vpc" { | ||
| ## value = data.aws_vpc.vpc | ||
| ## } | ||
| ## | ||
| ## output "subnets" { | ||
| ## value = data.aws_subnets.subnets | ||
| ## } | ||
| ## | ||
| ## output "subnet" { | ||
| ## value = data.aws_subnet.subnet | ||
| ## } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| locals { | ||
| # vpc_info = data.terraform_remote_state.vpc_east_shared_vpc1.outputs.shared_vpc_info | ||
| # subnet_info = data.terraform_remote_state.vpc_east_shared_vpc1.outputs.shared_private_subnet_info | ||
| vpc_info = local.shared_vpc_info | ||
| subnet_info = local.shared_private_subnet_info | ||
| vpc_id = local.vpc_info.vpc_id | ||
|
|
||
| tags = { | ||
| CostAllocation = "csvd:infrastructure" | ||
| Environment = var.vpc_environment | ||
| } | ||
| } | ||
|
|
||
| # the only thing not shared are security groups, so they need to be created in each account/region and | ||
| # vpc where they intend to be used | ||
|
|
||
| module "base-security-groups" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//security-groups?ref=tf-upgrade" | ||
| vpc_id = local.vpc_id | ||
|
|
||
| enable_manage_default_sg = false | ||
| vpc_full_name = var.vpc_full_name | ||
| vpc_environment = var.vpc_environment | ||
| tags = local.tags | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| VERSION 1.0.0 | ||
| REMOTE-STATE | ||
| COMMAND tf-directory-setup.py -l none -f | ||
| COMMAND setup-new-directory.sh | ||
| COMMAND tf-init -upgrade | ||
| ALL | ||
| COMMAND tf-directory-setup.py -l s3 |
9 changes: 9 additions & 0 deletions
9
examples/shared-vpc-setup-tf-upgrade/variables.shared-vpc.auto.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # network_account_profile = "057445207498-ent-gov-network-sa" | ||
|
|
||
| vpc_name = "tgw-common" | ||
| vpc_full_name = "vpc1-tgw-common" | ||
| vpc_environment = "common" | ||
| vpc_domain_name = "common.network-sa-1.csp1.census.gov" | ||
| tgw_environment = "services" | ||
|
|
||
|
|
Oops, something went wrong.