-
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
7 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
examples/vpc-additional-peer/peers/peer-alias_peer-region_peer_vpc_name/locals.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,3 @@ | ||
| locals { | ||
| vpc_id = data.terraform_remote_state.vpc_west_vpc3.outputs.vpc_id | ||
| } |
49 changes: 49 additions & 0 deletions
49
examples/vpc-additional-peer/peers/peer-alias_peer-region_peer_vpc_name/peer.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,49 @@ | ||
| provider "aws" { | ||
| alias = "peer" | ||
| region = var.peer_settings.region | ||
| profile = var.peer_settings.profile | ||
| } | ||
|
|
||
| data "aws_vpc" "peer_vpc" { | ||
| provider = aws.peer | ||
| filter { | ||
| name = "tag:Name" | ||
| values = [var.peer_settings.name] | ||
| } | ||
| } | ||
|
|
||
| module "peer" { | ||
| source = "git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//peer" | ||
| providers = { | ||
| aws.self = aws | ||
| aws.peer = aws.peer | ||
| } | ||
|
|
||
| ## 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.rule_number | ||
| tags = local.common_tags | ||
|
|
||
| ## peer | ||
| peer_vpc_id = data.aws_vpc.peer_vpc.id | ||
| peer_vpc_name = var.peer_settings.vpc_name | ||
| peer_vpc_index = var.peer_settings.vpc_index | ||
| peer_vpc_short_name = var.peer_settings.vpc_short_name | ||
| peer_vpc_full_name = var.peer_settings.name | ||
| peer_rule_number = var.peer_settings.rule_number | ||
|
|
||
| peer_network_acl_filter = [ | ||
| format("nacl-*%v", var.peer_settings.name), | ||
| format("nacl-%v-private", var.peer_settings.name), | ||
| ] | ||
| peer_route_table_filter = [ | ||
| format("route-%v", var.peer_settings.name), | ||
| format("route-%v-private-*", var.peer_settings.name), | ||
| ] | ||
| } |
4 changes: 4 additions & 0 deletions
4
examples/vpc-additional-peer/peers/peer-alias_peer-region_peer_vpc_name/region.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,4 @@ | ||
| locals { | ||
| region = var.region | ||
| } | ||
|
|
11 changes: 11 additions & 0 deletions
11
examples/vpc-additional-peer/peers/peer-alias_peer-region_peer_vpc_name/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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| VERSION 1.0.2 | ||
| REMOTE-STATE | ||
| COMMAND tf-directory-setup.py -l none -f | ||
| COMMAND setup-new-directory.sh | ||
| COMMAND tf-init -upgrade | ||
| COMMAND ln -sf ../variables.peers.tf . | ||
| # COMMAND ln -sf ../variables.vpc.tf . | ||
| # COMMAND ln -sf ../variables.vpc.auto.tfvars . | ||
| 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,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,9 @@ | ||
| VERSION 1.0.1 | ||
| REMOTE-STATE | ||
| COMMAND tf-directory-setup.py -l none -f | ||
| COMMAND setup-new-directory.sh | ||
| COMMAND tf-init -upgrade | ||
| COMMAND ln -sf ../variables.vpc.tf . | ||
| COMMAND ln -sf ../variables.vpc.auto.tfvars . | ||
| 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,15 @@ | ||
| variable "peer_settings" { | ||
| description = "VPC Peering NACL settings to additional VPCs" | ||
| type = object( | ||
| { | ||
| name = string | ||
| region = string | ||
| profile = string | ||
| vpc_index = number | ||
| vpc_name = string | ||
| vpc_short_name = string | ||
| rule_number = number | ||
| } | ||
| ) | ||
| default = null | ||
| } |