Skip to content

Commit

Permalink
Merge pull request #4 from clouddrove/CD-147
Browse files Browse the repository at this point in the history
fix labels managedby variables
  • Loading branch information
anmolnagpal committed Mar 27, 2020
2 parents 829e651 + 107a473 commit 040e2c0
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 39 deletions.
75 changes: 38 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Terraform AWS Transit Gateway
</h1>

<p align="center" style="font-size: 1.2rem;">
<p align="center" style="font-size: 1.2rem;">
Terraform module which creates Transit Gateway, Resource Association, Principal Association, Resource Share, Transit Gateway VPC Attachment on AWS.
</p>

Expand Down Expand Up @@ -38,7 +38,7 @@
<hr>


We eat, drink, sleep and most importantly love **DevOps**. We are working towards stratergies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.

This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.

Expand All @@ -49,7 +49,7 @@ We have [*fifty plus terraform modules*][terraform_modules]. A few of them are c

## Prerequisites

This module has a few dependencies:
This module has a few dependencies:

- [Terraform 0.12](https://learn.hashicorp.com/terraform/getting-started/install.html)
- [Go](https://golang.org/doc/install)
Expand All @@ -73,7 +73,7 @@ Here are some examples of how you can use this module in your inventory structur
### Transit Gateway For Single Account
```hcl
module "transit-gateway" {
source = "git::https://github.com/clouddrove/terraform-aws-transit-gateway.git?ref=tags/0.12.0"
source = "git::https://github.com/clouddrove/terraform-aws-transit-gateway.git?ref=tags/0.12.1"
name = "transit-gateway"
application = "clouddrove"
environment = "test"
Expand All @@ -100,7 +100,7 @@ Here are some examples of how you can use this module in your inventory structur
### Transit Gateway Diffrent AWS Account
```hcl
module "transit-gateway" {
source = "git::https://github.com/clouddrove/terraform-aws-transit-gateway.git?ref=tags/0.12.2"
source = "git::https://github.com/clouddrove/terraform-aws-transit-gateway.git?ref=tags/0.12.1"
name = "transit-gateway"
application = "clouddrove"
environment = "test"
Expand Down Expand Up @@ -128,47 +128,48 @@ Here are some examples of how you can use this module in your inventory structur

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| amazon_side_asn | Private Autonomous System Number (ASN) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs. Default value: 64512. | number | `64512` | no |
| application | Application (e.g. `cd` or `clouddrove`). | string | `` | no |
| attributes | Additional attributes (e.g. `1`). | list | `<list>` | no |
| auto_accept_shared_attachments | Whether resource attachment requests are automatically accepted. Valid values: disable, enable. Default value: disable. | string | `disable` | no |
| aws_ram_resource_share_accepter | Accepter the RAM. | bool | `false` | no |
| default_route_table_association | Whether resource attachments are automatically associated with the default association route table. Valid values: disable, enable. Default value: enable. | string | `enable` | no |
| default_route_table_propagation | Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: disable, enable. Default value: enable. | string | `enable` | no |
| description | Description of the EC2 Transit Gateway | string | `` | no |
| destination_cidr_block | The destination CIDR block. | list | `<list>` | no |
| enable | Whether or not to enable the entire module or not. | string | `true` | no |
| environment | Environment (e.g. `prod`, `dev`, `staging`). | string | `` | no |
| label_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
| name | Name (e.g. `app` or `cluster`). | string | `` | no |
| resource_share_account_ids | Ids of the account where the Transit Gateway should be shared. | list | `<list>` | no |
| resource_share_allow_external_principals | Whether or not to allow external principals for the Resource Share for the Transit Gateway. | bool | `true` | no |
| resource_share_arn | ARN of RAM. | string | `` | no |
| resource_share_enable | Whether or not to create a Resource Share for the Transit Gateway. | bool | `false` | no |
| subnet_ids | Subnets to attached to the Transit Gateway. These subnets will be used internally by AWS to install the Transit Gateway. | list | `<list>` | no |
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | map | `<map>` | no |
| tgw_create | Whether or not to create a Transit Gateway. | bool | `false` | no |
| transit_gateway_default_route_table_association | Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value: true. | bool | `true` | no |
| transit_gateway_default_route_table_propagation | Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value: true. | bool | `true` | no |
| transit_gateway_id | The ID of gateway id. | string | `` | no |
| use_existing_transit_gateway_id | if use existing gateway id. | bool | `false` | no |
| vpc_attachement_create | Whether or not to create the Transit Gateway VPC attachment. | bool | `false` | no |
| vpc_id | Identifier of EC2 VPC. | string | `` | no |
| vpn_ecmp_support | Whether VPN Equal Cost Multipath Protocol support is enabled. Valid values: disable, enable. Default value: enable. | string | `enable` | no |
| amazon\_side\_asn | Private Autonomous System Number \(ASN\) for the Amazon side of a BGP session. The range is 64512 to 65534 for 16-bit ASNs and 4200000000 to 4294967294 for 32-bit ASNs. Default value: 64512. | number | `"64512"` | no |
| application | Application \(e.g. `cd` or `clouddrove`\). | string | `""` | no |
| attributes | Additional attributes \(e.g. `1`\). | list | `<list>` | no |
| auto\_accept\_shared\_attachments | Whether resource attachment requests are automatically accepted. Valid values: disable, enable. Default value: disable. | string | `"disable"` | no |
| aws\_ram\_resource\_share\_accepter | Accepter the RAM. | bool | `"false"` | no |
| default\_route\_table\_association | Whether resource attachments are automatically associated with the default association route table. Valid values: disable, enable. Default value: enable. | string | `"enable"` | no |
| default\_route\_table\_propagation | Whether resource attachments automatically propagate routes to the default propagation route table. Valid values: disable, enable. Default value: enable. | string | `"enable"` | no |
| description | Description of the EC2 Transit Gateway | string | `""` | no |
| destination\_cidr\_block | The destination CIDR block. | list | `<list>` | no |
| enable | Whether or not to enable the entire module or not. | string | `"true"` | no |
| environment | Environment \(e.g. `prod`, `dev`, `staging`\). | string | `""` | no |
| label\_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"anmol@clouddrove.com"` | no |
| name | Name \(e.g. `app` or `cluster`\). | string | `""` | no |
| resource\_share\_account\_ids | Ids of the account where the Transit Gateway should be shared. | list | `<list>` | no |
| resource\_share\_allow\_external\_principals | Whether or not to allow external principals for the Resource Share for the Transit Gateway. | bool | `"true"` | no |
| resource\_share\_arn | ARN of RAM. | string | `""` | no |
| resource\_share\_enable | Whether or not to create a Resource Share for the Transit Gateway. | bool | `"false"` | no |
| subnet\_ids | Subnets to attached to the Transit Gateway. These subnets will be used internally by AWS to install the Transit Gateway. | list | `<list>` | no |
| tags | Additional tags \(e.g. map\(`BusinessUnit`,`XYZ`\). | map | `<map>` | no |
| tgw\_create | Whether or not to create a Transit Gateway. | bool | `"false"` | no |
| transit\_gateway\_default\_route\_table\_association | Boolean whether the VPC Attachment should be associated with the EC2 Transit Gateway association default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value: true. | bool | `"true"` | no |
| transit\_gateway\_default\_route\_table\_propagation | Boolean whether the VPC Attachment should propagate routes with the EC2 Transit Gateway propagation default route table. This cannot be configured or perform drift detection with Resource Access Manager shared EC2 Transit Gateways. Default value: true. | bool | `"true"` | no |
| transit\_gateway\_id | The ID of gateway id. | string | `""` | no |
| use\_existing\_transit\_gateway\_id | if use existing gateway id. | bool | `"false"` | no |
| vpc\_attachement\_create | Whether or not to create the Transit Gateway VPC attachment. | bool | `"false"` | no |
| vpc\_id | Identifier of EC2 VPC. | string | `""` | no |
| vpn\_ecmp\_support | Whether VPN Equal Cost Multipath Protocol support is enabled. Valid values: disable, enable. Default value: enable. | string | `"enable"` | no |

## Outputs

| Name | Description |
|------|-------------|
| resource_share_arn | The ARN of the RAM. |
| resource\_share\_arn | The ARN of the RAM. |
| tags | A mapping of tags to assign to the resource. |
| transit_gateway_id | The ID of the Transit Gateway. |
| transit\_gateway\_id | The ID of the Transit Gateway. |




## Testing
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.
In this module testing is performed with [terratest](https://github.com/gruntwork-io/terratest) and it creates a small piece of infrastructure, matches the output like ARN, ID and Tags name etc and destroy infrastructure in your AWS account. This testing is written in GO, so you need a [GO environment](https://golang.org/doc/install) in your system.

You need to run the following command in the testing folder:
```hcl
Expand All @@ -177,7 +178,7 @@ You need to run the following command in the testing folder:



## Feedback
## Feedback
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/terraform-aws-transit-gateway/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com).

If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/terraform-aws-transit-gateway)!
Expand All @@ -195,4 +196,4 @@ At [CloudDrove][website], we offer expert guidance, implementation support and s
[linkedin]: https://cpco.io/linkedin
[twitter]: https://twitter.com/clouddrove/
[email]: https://clouddrove.com/contact-us.html
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=
4 changes: 2 additions & 2 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ usage : |-
### Transit Gateway For Single Account
```hcl
module "transit-gateway" {
source = "git::https://github.com/clouddrove/terraform-aws-transit-gateway.git?ref=tags/0.12.0"
source = "git::https://github.com/clouddrove/terraform-aws-transit-gateway.git?ref=tags/0.12.1"
name = "transit-gateway"
application = "clouddrove"
environment = "test"
Expand All @@ -64,7 +64,7 @@ usage : |-
### Transit Gateway Diffrent AWS Account
```hcl
module "transit-gateway" {
source = "git::https://github.com/clouddrove/terraform-aws-transit-gateway.git?ref=tags/0.12.2"
source = "git::https://github.com/clouddrove/terraform-aws-transit-gateway.git?ref=tags/0.12.1"
name = "transit-gateway"
application = "clouddrove"
environment = "test"
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
module "labels" {
source = "git::https://github.com/clouddrove/terraform-labels.git?ref=tags/0.12.0"

enabled = var.enable
name = var.name
application = var.application
environment = var.environment
managedby = var.managedby
label_order = var.label_order
}

Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ variable "tags" {
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)."
}

variable "managedby" {
type = string
default = "anmol@clouddrove.com"
description = "ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'."
}

variable "enable" {
description = "Whether or not to enable the entire module or not."
default = true
Expand Down

0 comments on commit 040e2c0

Please sign in to comment.