-
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.
Merge pull request #9 from terraform-modules/add-example
add example
- Loading branch information
Showing
51 changed files
with
2,222 additions
and
0 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| ## Requirements | ||
|
|
||
| No requirements. | ||
|
|
||
| ## Providers | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="provider_aws.do2-govcloud_west_vpc3-dev"></a> [aws.do2-govcloud\_west\_vpc3-dev](#provider\_aws.do2-govcloud\_west\_vpc3-dev) | n/a | | ||
|
|
||
| ## Modules | ||
|
|
||
| | Name | Source | Version | | ||
| |------|--------|---------| | ||
| | <a name="module_do2-govcloud_west_vpc3-dev"></a> [do2-govcloud\_west\_vpc3-dev](#module\_do2-govcloud\_west\_vpc3-dev) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//peer | n/a | | ||
|
|
||
| ## Resources | ||
|
|
||
| | Name | Type | | ||
| |------|------| | ||
| | [aws_vpc.do2-govcloud_west_vpc3-dev](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source | | ||
|
|
||
| ## Inputs | ||
|
|
||
| No inputs. | ||
|
|
||
| ## Outputs | ||
|
|
||
| No outputs. |
19 changes: 19 additions & 0 deletions
19
examples/typical/.off/credentials.do2-govcloud_vpc3-dev.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,19 @@ | ||
| #--- | ||
| # peer to 107.. us-gov-west-1 vpc3-dev | ||
| #--- | ||
| provider "aws" { | ||
| alias = "do2-govcloud_west_vpc3-dev" | ||
| region = "us-gov-west-1" | ||
| profile = "107742151971-do2-govcloud" | ||
| } | ||
|
|
||
| # #--- | ||
| # # peer to 107.. us-gov-east-1 vpc3-dev | ||
| # # only need this peer set up in one place (current to west) | ||
| # #--- | ||
| # provider "aws" { | ||
| # alias = "do2-govcloud_east_vpc3-dev" | ||
| # region = "us-gov-east-1" | ||
| # profile = "107742151971-do2-govcloud" | ||
| # } | ||
| # |
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,46 @@ | ||
| #--- | ||
| # current (us-gov-east-1) to us-gov-west-1 | ||
| # only need this peer set up in one place (current to west) | ||
| #--- | ||
| data "aws_vpc" "do2-govcloud_west_vpc3-dev" { | ||
| provider = aws.do2-govcloud_west_vpc3-dev | ||
| filter { | ||
| name = "tag:Name" | ||
| values = [var.peer_settings["do2-govcloud_west_vpc3-dev"].peer_name] | ||
| } | ||
| } | ||
|
|
||
| module "do2-govcloud_west_vpc3-dev" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//peer" | ||
| providers = { | ||
| aws.self = aws | ||
| aws.peer = aws.do2-govcloud_west_vpc3-dev | ||
| } | ||
|
|
||
| ## self | ||
| vpc_id = local.vpc_id | ||
| vpc_name = var.vpc_name | ||
| vpc_cidr_block = var.vpc_cidr_block | ||
| vpc_index = var.vpc_index | ||
| vpc_short_name = var.vpc_short_name | ||
| vpc_full_name = var.vpc_full_name | ||
| vpc_environment = var.vpc_environment | ||
| rule_number = var.peer_settings["do2-govcloud_west_vpc3-dev"].rule_number | ||
| tags = {} | ||
|
|
||
| ## peer | ||
| peer_vpc_id = data.aws_vpc.do2-govcloud_west_vpc3-dev.id | ||
| peer_vpc_name = var.peer_settings["do2-govcloud_west_vpc3-dev"].vpc_name | ||
| peer_vpc_index = var.peer_settings["do2-govcloud_west_vpc3-dev"].vpc_index | ||
| peer_vpc_short_name = var.peer_settings["do2-govcloud_west_vpc3-dev"].vpc_short_name | ||
| peer_vpc_full_name = var.peer_settings["do2-govcloud_west_vpc3-dev"].peer_name | ||
| peer_rule_number = var.peer_settings["do2-govcloud_west_vpc3-dev"].rule_number | ||
| peer_network_acl_filter = [ | ||
| format("nacl-*%v", var.peer_settings["do2-govcloud_west_vpc3-dev"].peer_name), | ||
| format("nacl-%v-private", var.peer_settings["do2-govcloud_west_vpc3-dev"].peer_name), | ||
| ] | ||
| peer_route_table_filter = [ | ||
| format("route-%v", var.peer_settings["do2-govcloud_west_vpc3-dev"].peer_name), | ||
| format("route-%v-private-*", var.peer_settings["do2-govcloud_west_vpc3-dev"].peer_name), | ||
| ] | ||
| } |
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,44 @@ | ||
| formatter: markdown table | ||
|
|
||
| header-from: main.tf | ||
| footer-from: "" | ||
|
|
||
| sections: | ||
| ## hide: [] | ||
| show: | ||
| - data-sources | ||
| - header | ||
| - footer | ||
| - inputs | ||
| - modules | ||
| - outputs | ||
| - providers | ||
| - requirements | ||
| - resources | ||
|
|
||
| output: | ||
| file: README.md | ||
| mode: inject | ||
| template: |- | ||
| <!-- BEGIN_TF_DOCS --> | ||
| {{ .Content }} | ||
| <!-- END_TF_DOCS --> | ||
| ## output-values: | ||
| ## enabled: false | ||
| ## from: "" | ||
| ## | ||
| ## sort: | ||
| ## enabled: true | ||
| ## by: name | ||
| ## | ||
| ## settings: | ||
| ## anchor: true | ||
| ## color: true | ||
| ## default: true | ||
| ## description: false | ||
| ## escape: true | ||
| ## indent: 2 | ||
| ## required: true | ||
| ## sensitive: true | ||
| ## type: true |
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,87 @@ | ||
| <!-- BEGIN_TF_DOCS --> | ||
| ## Requirements | ||
|
|
||
| No requirements. | ||
|
|
||
| ## Providers | ||
|
|
||
| | Name | Version | | ||
| |------|---------| | ||
| | <a name="provider_aws"></a> [aws](#provider\_aws) | n/a | | ||
| | <a name="provider_aws.peer_main_east"></a> [aws.peer\_main\_east](#provider\_aws.peer\_main\_east) | n/a | | ||
| | <a name="provider_aws.peer_main_west"></a> [aws.peer\_main\_west](#provider\_aws.peer\_main\_west) | n/a | | ||
|
|
||
| ## Modules | ||
|
|
||
| | Name | Source | Version | | ||
| |------|--------|---------| | ||
| | <a name="module_base-security-groups"></a> [base-security-groups](#module\_base-security-groups) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//security-groups | n/a | | ||
| | <a name="module_flowlogs"></a> [flowlogs](#module\_flowlogs) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//flowlogs | n/a | | ||
| | <a name="module_nacls"></a> [nacls](#module\_nacls) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//nacls | n/a | | ||
| | <a name="module_nacls_endpoints"></a> [nacls\_endpoints](#module\_nacls\_endpoints) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//nacl-rules | n/a | | ||
| | <a name="module_nacls_enterprise"></a> [nacls\_enterprise](#module\_nacls\_enterprise) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//nacl-rules | n/a | | ||
| | <a name="module_nacls_public_nat"></a> [nacls\_public\_nat](#module\_nacls\_public\_nat) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//nacl-rules | n/a | | ||
| | <a name="module_nacls_public_vpc"></a> [nacls\_public\_vpc](#module\_nacls\_public\_vpc) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//nacl-rules | n/a | | ||
| | <a name="module_peer_services_main_east"></a> [peer\_services\_main\_east](#module\_peer\_services\_main\_east) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//peer | n/a | | ||
| | <a name="module_peer_services_main_west"></a> [peer\_services\_main\_west](#module\_peer\_services\_main\_west) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//peer | n/a | | ||
| | <a name="module_routing"></a> [routing](#module\_routing) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//routing | n/a | | ||
| | <a name="module_sg_web"></a> [sg\_web](#module\_sg\_web) | git@github.e.it.census.gov:terraform-modules/aws-common-security-groups.git//web | n/a | | ||
| | <a name="module_subnets"></a> [subnets](#module\_subnets) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//subnets | n/a | | ||
| | <a name="module_vpc"></a> [vpc](#module\_vpc) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc | n/a | | ||
| | <a name="module_vpce_autoscaling"></a> [vpce\_autoscaling](#module\_vpce\_autoscaling) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_ec2"></a> [vpce\_ec2](#module\_vpce\_ec2) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_ecr_api"></a> [vpce\_ecr\_api](#module\_vpce\_ecr\_api) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_ecr_dkr"></a> [vpce\_ecr\_dkr](#module\_vpce\_ecr\_dkr) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_ecs"></a> [vpce\_ecs](#module\_vpce\_ecs) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_elasticfilesystem"></a> [vpce\_elasticfilesystem](#module\_vpce\_elasticfilesystem) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_elasticloadbalancing"></a> [vpce\_elasticloadbalancing](#module\_vpce\_elasticloadbalancing) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_kms"></a> [vpce\_kms](#module\_vpce\_kms) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_logs"></a> [vpce\_logs](#module\_vpce\_logs) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_secretsmanager"></a> [vpce\_secretsmanager](#module\_vpce\_secretsmanager) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_ssm"></a> [vpce\_ssm](#module\_vpce\_ssm) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpce_sts"></a> [vpce\_sts](#module\_vpce\_sts) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpc-interface-endpoint | n/a | | ||
| | <a name="module_vpn"></a> [vpn](#module\_vpn) | git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//vpn | n/a | | ||
|
|
||
| ## Resources | ||
|
|
||
| | Name | Type | | ||
| |------|------| | ||
| | [aws_availability_zone.zone](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zone) | data source | | ||
| | [aws_availability_zones.zones](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zones) | data source | | ||
| | [aws_subnet_ids.endpoint_subnets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/subnet_ids) | data source | | ||
| | [aws_vpc.service_main_east](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source | | ||
| | [aws_vpc.service_main_west](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source | | ||
|
|
||
| ## Inputs | ||
|
|
||
| | Name | Description | Type | Default | Required | | ||
| |------|-------------|------|---------|:--------:| | ||
| | <a name="input_peer_settings"></a> [peer\_settings](#input\_peer\_settings) | VPC Peering NACL settings to additional VPCs | <pre>map(object(<br> {<br> peer_name = string<br> region = string<br> vpc_index = number<br> vpc_name = string<br> vpc_short_name = string<br> rule_number = number<br> }<br> ))</pre> | `{}` | no | | ||
| | <a name="input_private_subnets"></a> [private\_subnets](#input\_private\_subnets) | List of objects with private subnet information to be created | <pre>list(object({<br> base_cidr = string<br> label = string<br> bits = number<br> private = bool<br> tags = map(string)<br> # subnets = list(string)<br> # labels = list(string)<br> # availability_zones = list(string)<br> }))</pre> | `[]` | no | | ||
| | <a name="input_public_subnets"></a> [public\_subnets](#input\_public\_subnets) | List of objects with public subnet information to be created | <pre>list(object({<br> base_cidr = string<br> label = string<br> bits = number<br> private = bool<br> tags = map(string)<br> # subnets = list(string)<br> # labels = list(string)<br> # availability_zones = list(string)<br> }))</pre> | `[]` | no | | ||
| | <a name="input_services_peer_settings"></a> [services\_peer\_settings](#input\_services\_peer\_settings) | VPC Peering NACL settings to main enterprise govcloud | <pre>map(object(<br> {<br> peer_name = string<br> region = string<br> rule_number = number<br> }<br> ))</pre> | `{}` | no | | ||
| | <a name="input_vpc_cidr_block"></a> [vpc\_cidr\_block](#input\_vpc\_cidr\_block) | VPC CIDR Block | `string` | n/a | yes | | ||
| | <a name="input_vpc_enable_awsdns"></a> [vpc\_enable\_awsdns](#input\_vpc\_enable\_awsdns) | Enable AWS DNS on the VPC | `bool` | `false` | no | | ||
| | <a name="input_vpc_enable_igw"></a> [vpc\_enable\_igw](#input\_vpc\_enable\_igw) | Enable AWS Internet Gateway (IGW) on the VPC (true \| false[x]) | `bool` | `false` | no | | ||
| | <a name="input_vpc_enable_nat"></a> [vpc\_enable\_nat](#input\_vpc\_enable\_nat) | Enable AWS NAT Gateway on the VPC (true \| false[x]) | `bool` | `false` | no | | ||
| | <a name="input_vpc_enable_vpn"></a> [vpc\_enable\_vpn](#input\_vpc\_enable\_vpn) | Enable AWS VPN Configuration on the VPC (true[x] \| false) | `bool` | `true` | no | | ||
| | <a name="input_vpc_environment"></a> [vpc\_environment](#input\_vpc\_environment) | VPC environment purpose (common, shared, dev, stage, ite, prod) | `string` | `""` | no | | ||
| | <a name="input_vpc_index"></a> [vpc\_index](#input\_vpc\_index) | VPC index number. This used for NACL rule number caculations. | `number` | n/a | yes | | ||
| | <a name="input_vpc_name"></a> [vpc\_name](#input\_vpc\_name) | VPC Name including environment (if necessary), excluding vpc{N} | `string` | n/a | yes | | ||
| | <a name="input_vpc_short_name"></a> [vpc\_short\_name](#input\_vpc\_short\_name) | VPC short name component, vpc{index} | `string` | n/a | yes | | ||
| | <a name="input_vpn_settings"></a> [vpn\_settings](#input\_vpn\_settings) | VPN Connection details array of site, bgp\_asn\_id and ip\_address | <pre>list(object(<br> {<br> site = string<br> bgp_asn_id = number<br> ip_address = string<br> }<br> ))</pre> | `[]` | no | | ||
|
|
||
| ## Outputs | ||
|
|
||
| | Name | Description | | ||
| |------|-------------| | ||
| | <a name="output_private_subnets_ids"></a> [private\_subnets\_ids](#output\_private\_subnets\_ids) | Resulting private subnets list of objects: subnet, label, availability\_zone, id | | ||
| | <a name="output_public_subnets_ids"></a> [public\_subnets\_ids](#output\_public\_subnets\_ids) | Resulting public subnets list of objects: subnet, label, availability\_zone, id | | ||
| | <a name="output_security_groups"></a> [security\_groups](#output\_security\_groups) | Security Group map(object{name, id, arn}) | | ||
| | <a name="output_sg_web_id"></a> [sg\_web\_id](#output\_sg\_web\_id) | Common Web security group | | ||
| | <a name="output_vpc_arn"></a> [vpc\_arn](#output\_vpc\_arn) | VPC ARN | | ||
| | <a name="output_vpc_id"></a> [vpc\_id](#output\_vpc\_id) | VPC ID | | ||
| | <a name="output_vpc_info"></a> [vpc\_info](#output\_vpc\_info) | VPC info | | ||
| | <a name="output_vpn_labels"></a> [vpn\_labels](#output\_vpn\_labels) | VPN Label for Description field of Endpoint device (Cisco ASR) | | ||
| | <a name="output_vpn_tunnel_endpoints"></a> [vpn\_tunnel\_endpoints](#output\_vpn\_tunnel\_endpoints) | VPN Tunnel Endpoint IP Addresses | | ||
| <!-- END_TF_DOCS --> |
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,44 @@ | ||
| formatter: markdown table | ||
|
|
||
| header-from: main.tf | ||
| footer-from: "" | ||
|
|
||
| sections: | ||
| ## hide: [] | ||
| show: | ||
| - data-sources | ||
| - header | ||
| - footer | ||
| - inputs | ||
| - modules | ||
| - outputs | ||
| - providers | ||
| - requirements | ||
| - resources | ||
|
|
||
| output: | ||
| file: README.md | ||
| mode: inject | ||
| template: |- | ||
| <!-- BEGIN_TF_DOCS --> | ||
| {{ .Content }} | ||
| <!-- END_TF_DOCS --> | ||
| ## output-values: | ||
| ## enabled: false | ||
| ## from: "" | ||
| ## | ||
| ## sort: | ||
| ## enabled: true | ||
| ## by: name | ||
| ## | ||
| ## settings: | ||
| ## anchor: true | ||
| ## color: true | ||
| ## default: true | ||
| ## description: false | ||
| ## escape: true | ||
| ## indent: 2 | ||
| ## required: true | ||
| ## sensitive: true | ||
| ## type: true |
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 @@ | ||
| <!-- BEGIN_TF_DOCS --> | ||
| ## Requirements | ||
|
|
||
| No requirements. | ||
|
|
||
| ## Providers | ||
|
|
||
| No providers. | ||
|
|
||
| ## Modules | ||
|
|
||
| No modules. | ||
|
|
||
| ## Resources | ||
|
|
||
| No resources. | ||
|
|
||
| ## Inputs | ||
|
|
||
| No inputs. | ||
|
|
||
| ## Outputs | ||
|
|
||
| No outputs. | ||
| <!-- END_TF_DOCS --> |
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,44 @@ | ||
| formatter: markdown table | ||
|
|
||
| header-from: main.tf | ||
| footer-from: "" | ||
|
|
||
| sections: | ||
| ## hide: [] | ||
| show: | ||
| - data-sources | ||
| - header | ||
| - footer | ||
| - inputs | ||
| - modules | ||
| - outputs | ||
| - providers | ||
| - requirements | ||
| - resources | ||
|
|
||
| output: | ||
| file: README.md | ||
| mode: inject | ||
| template: |- | ||
| <!-- BEGIN_TF_DOCS --> | ||
| {{ .Content }} | ||
| <!-- END_TF_DOCS --> | ||
| ## output-values: | ||
| ## enabled: false | ||
| ## from: "" | ||
| ## | ||
| ## sort: | ||
| ## enabled: true | ||
| ## by: name | ||
| ## | ||
| ## settings: | ||
| ## anchor: true | ||
| ## color: true | ||
| ## default: true | ||
| ## description: false | ||
| ## escape: true | ||
| ## indent: 2 | ||
| ## required: true | ||
| ## sensitive: true | ||
| ## type: true |
Oops, something went wrong.