Skip to content

Commit

Permalink
add provider
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed May 31, 2021
1 parent f1c9ae0 commit ff86722
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
114 changes: 114 additions & 0 deletions peer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# About aws-vpc-setup :: peer

This submodule creates a peering connection with a different VPC, and sets up appropriate network
ACLs and routing between the two CIDR blocks.

# Usage

```hcl
module "peer_services" {
source = "git@github.e.it.census.gov:terraform-modules/aws-vpc-setup.git//peer"
# self
vpc_id = module.vpc.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
route_table_ids = [ "rtb-12345678" ]
network_acl_ids = [ "nacl-12345678" ]
nacl_rule_number = 2500
rule_increment = 1
tags = {}
# peer
peer_account_id = var.peer_account_id
peer_vpc_id = var.peer_vpc_id
peer_vpc_name = var.peer_vpc_name
# peer_vpc_cidr_block = var.peer_vpc_cidr_block
peer_vpc_index = var.peer_vpc_index
peer_vpc_short_name = var.peer_vpc_short_name
# peer_vpc_full_name = var.peer_vpc_full_name
# peer_vpc_environment = var.peer_vpc_environment
# peer_tags = {}
peer_route_table_ids = [ "rtb-87654321" ]
peer_network_acl_ids = [ "nacl-87654321" ]
peer_nacl_rule_number = 2500
peer_rule_increment = 1
providers = {
aws.self = aws
aws.peer = aws.us-gov-east-1
}
}
```

## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws.peer"></a> [aws.peer](#provider\_aws.peer) | n/a |
| <a name="provider_aws.self"></a> [aws.self](#provider\_aws.self) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_arn.peer_current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) | data source |
| [aws_arn.self_current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/arn) | data source |
| [aws_caller_identity.peer_current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_caller_identity.self_current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source |
| [aws_region.peer_current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
| [aws_region.self_current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |
| [aws_route_tables.default_peer_route_tables](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route_tables) | data source |
| [aws_route_tables.default_self_route_tables](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/route_tables) | data source |
| [aws_vpc.peer_vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source |
| [aws_vpc.self_vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_account_alias"></a> [account\_alias](#input\_account\_alias) | AWS Account Alias | `string` | `""` | no |
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | AWS Account ID (default will pull from current user) | `string` | `""` | no |
| <a name="input_nacl_rule_number"></a> [nacl\_rule\_number](#input\_nacl\_rule\_number) | Starting rule number within the rule | `number` | `null` | no |
| <a name="input_network_acl_ids"></a> [network\_acl\_ids](#input\_network\_acl\_ids) | VPC Network ACL IDs | `list(string)` | `[]` | no |
| <a name="input_override_prefixes"></a> [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no |
| <a name="input_peer_account_alias"></a> [peer\_account\_alias](#input\_peer\_account\_alias) | Peer AWS Account Alias | `string` | `""` | no |
| <a name="input_peer_account_id"></a> [peer\_account\_id](#input\_peer\_account\_id) | Peer AWS Account ID | `string` | `""` | no |
| <a name="input_peer_nacl_rule_number"></a> [peer\_nacl\_rule\_number](#input\_peer\_nacl\_rule\_number) | Peer Starting rule number within the rule | `number` | `null` | no |
| <a name="input_peer_network_acl_ids"></a> [peer\_network\_acl\_ids](#input\_peer\_network\_acl\_ids) | Peer VPC Network ACL IDs | `list(string)` | `[]` | no |
| <a name="input_peer_route_table_ids"></a> [peer\_route\_table\_ids](#input\_peer\_route\_table\_ids) | Peer VPC route table IDs (default: all *private* route tables at peer VPC) | `list(string)` | `[]` | no |
| <a name="input_peer_rule_increment"></a> [peer\_rule\_increment](#input\_peer\_rule\_increment) | Peer Rule number increment per new CIDR block | `number` | `1` | no |
| <a name="input_peer_tags"></a> [peer\_tags](#input\_peer\_tags) | Peer AWS Tags to apply to appropriate resources (default: current var.tags) | `map(string)` | `{}` | no |
| <a name="input_peer_vpc_cidr_block"></a> [peer\_vpc\_cidr\_block](#input\_peer\_vpc\_cidr\_block) | Peer VPC CIDR Block (default: obtain from peer VPC) | `string` | `""` | no |
| <a name="input_peer_vpc_environment"></a> [peer\_vpc\_environment](#input\_peer\_vpc\_environment) | Peer VPC environment purpose (infrastructure, common, shared, dev, stage, ite, prod) | `string` | `null` | no |
| <a name="input_peer_vpc_full_name"></a> [peer\_vpc\_full\_name](#input\_peer\_vpc\_full\_name) | Peer VPC full name component (vpc{index}-{vpc\_name}) | `string` | `null` | no |
| <a name="input_peer_vpc_id"></a> [peer\_vpc\_id](#input\_peer\_vpc\_id) | Peer VPC ID | `string` | n/a | yes |
| <a name="input_peer_vpc_index"></a> [peer\_vpc\_index](#input\_peer\_vpc\_index) | Peer VPC index number (integer starting at 1) | `number` | `null` | no |
| <a name="input_peer_vpc_name"></a> [peer\_vpc\_name](#input\_peer\_vpc\_name) | Peer VPC name component used through the VPC descrbing its purpose | `string` | `null` | no |
| <a name="input_peer_vpc_short_name"></a> [peer\_vpc\_short\_name](#input\_peer\_vpc\_short\_name) | Peer VPC short name component (vpc{index}) | `string` | `null` | no |
| <a name="input_route_table_ids"></a> [route\_table\_ids](#input\_route\_table\_ids) | Self VPC route table IDs (default: all *private* route tables at self VPC) | `list(string)` | `[]` | no |
| <a name="input_rule_increment"></a> [rule\_increment](#input\_rule\_increment) | Rule number increment per new CIDR block | `number` | `1` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | AWS Tags to apply to appropriate resources (S3, KMS). Do not include safeguard tags here, use the data\_safeguard field for such things. | `map(string)` | `{}` | no |
| <a name="input_vpc_cidr_block"></a> [vpc\_cidr\_block](#input\_vpc\_cidr\_block) | Self VPC CIDR Block (default: obtain from self VPC) | `string` | `""` | no |
| <a name="input_vpc_environment"></a> [vpc\_environment](#input\_vpc\_environment) | VPC environment purpose (infrastructure, common, shared, dev, stage, ite, prod) | `string` | `null` | no |
| <a name="input_vpc_full_name"></a> [vpc\_full\_name](#input\_vpc\_full\_name) | VPC full name component (vpc{index}-{vpc\_name}) | `string` | `null` | no |
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC ID | `string` | n/a | yes |
| <a name="input_vpc_index"></a> [vpc\_index](#input\_vpc\_index) | VPC index number (integer starting at 1) | `number` | `null` | no |
| <a name="input_vpc_name"></a> [vpc\_name](#input\_vpc\_name) | VPC name component used through the VPC descrbing its purpose (ex: dice-dev) | `string` | `null` | no |
| <a name="input_vpc_short_name"></a> [vpc\_short\_name](#input\_vpc\_short\_name) | VPC short name component (vpc{index}) | `string` | `null` | no |

## Outputs

No outputs.
7 changes: 7 additions & 0 deletions peer/provider.aws.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
provider "aws" {
alias = "self"
}

provider "aws" {
alias = "peer"
}

0 comments on commit ff86722

Please sign in to comment.