Skip to content

Commit

Permalink
Merge pull request #167 from lorengordon/bad-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
lorengordon authored Jan 4, 2022
2 parents da82894 + bb25207 commit 3dc0303
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.2
current_version = 2.0.0
commit = True
message = Bumps version to {new_version}
tag = False
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
## terraform-aws-tardigrade-transit-gateway-attachment Change Log
## terraform-aws-tardigrade-transit-gateway Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

### 2.0.0

**Commit Delta**: [Change from 1.0.2 release](https://github.com/plus3it/terraform-aws-tardigrade-transit-gateway/compare/1.0.2..2.0.0)

**Released**: 2021.12.29

**Summary**:

* Removes variables in cross-account-vpc-attachment module that were used to
create a dependency so the attachment would succeed. These variables are no
longer needed, presumably due to new retry functionality in the AWS provider.
* Uses `configuration_aliases` instead of empty provider blocks.
* Bumps minimum terraform version to 0.15 for the cross-account and cross-region
modules.

### 0.0.0

**Commit Delta**: N/A
Expand Down
4 changes: 1 addition & 3 deletions modules/cross-account-vpc-attachment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Terraform module for managing a cross-account Transit Gateway VPC Attachment.

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.15 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |

## Providers
Expand All @@ -26,8 +26,6 @@ Terraform module for managing a cross-account Transit Gateway VPC Attachment.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_ram_resource_association_id"></a> [ram\_resource\_association\_id](#input\_ram\_resource\_association\_id) | ID of the RAM resource association for the Transit Gateway | `string` | n/a | yes |
| <a name="input_ram_share_id"></a> [ram\_share\_id](#input\_ram\_share\_id) | ID of the RAM Share associated with the Transit Gateway | `string` | n/a | yes |
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | List of subnets to associate with the VPC attachment | `list(string)` | n/a | yes |
| <a name="input_transit_gateway_id"></a> [transit\_gateway\_id](#input\_transit\_gateway\_id) | ID of the Transit Gateway | `string` | n/a | yes |
| <a name="input_dns_support"></a> [dns\_support](#input\_dns\_support) | Whether DNS support is enabled. Valid values: disable, enable. | `string` | `"enable"` | no |
Expand Down
13 changes: 1 addition & 12 deletions modules/cross-account-vpc-attachment/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
provider "aws" {
alias = "owner"
}

module "vpc_attachment" {
source = "../vpc-attachment"

Expand All @@ -10,15 +6,8 @@ module "vpc_attachment" {
cross_account = true
dns_support = var.dns_support
ipv6_support = var.ipv6_support
tags = var.tags
vpc_routes = [for route in var.vpc_routes : route if route.provider == "aws"]

tags = merge(
{
ram_share_id = var.ram_share_id
ram_resource_association_id = var.ram_resource_association_id
},
var.tags,
)
}

module "vpc_accepter" {
Expand Down
10 changes: 0 additions & 10 deletions modules/cross-account-vpc-attachment/variables.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
variable "ram_share_id" {
description = "ID of the RAM Share associated with the Transit Gateway"
type = string
}

variable "ram_resource_association_id" {
description = "ID of the RAM resource association for the Transit Gateway"
type = string
}

variable "subnet_ids" {
description = "List of subnets to associate with the VPC attachment"
type = list(string)
Expand Down
6 changes: 5 additions & 1 deletion modules/cross-account-vpc-attachment/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
terraform {
required_version = ">= 0.13"
required_version = ">= 0.15"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.0"

configuration_aliases = [
aws.owner
]
}
}
}
2 changes: 1 addition & 1 deletion modules/cross-region-peering-attachment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ may be the same or different accounts, but must be different regions.

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.15 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |

## Providers
Expand Down
4 changes: 0 additions & 4 deletions modules/cross-region-peering-attachment/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
provider "aws" {
alias = "peer"
}

module "peering_attachment" {
source = "../peering-attachment"

Expand Down
6 changes: 5 additions & 1 deletion modules/cross-region-peering-attachment/versions.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
terraform {
required_version = ">= 0.13"
required_version = ">= 0.15"

required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.0"

configuration_aliases = [
aws.peer
]
}
}
}
19 changes: 14 additions & 5 deletions tests/cross-account-vpc-attachment/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
provider "aws" {
region = "us-east-1"
profile = "resource-member"
profile = "aws"

default_tags {
tags = {
TARDIGRADE_TEST = true
}
}
}

provider "aws" {
region = "us-east-1"
alias = "owner"
profile = "resource-owner"
profile = "awsalternate"

default_tags {
tags = {
TARDIGRADE_TEST = true
}
}
}

module "vpc_attachment" {
Expand All @@ -17,9 +29,6 @@ module "vpc_attachment" {
aws.owner = aws.owner
}

ram_share_id = module.ram_share_accepter.share_accepter.share_id
ram_resource_association_id = module.ram_share.resource_associations["tardigrade-tgw"].resource_association.id

subnet_ids = module.vpc_member.private_subnets
transit_gateway_id = module.tgw.transit_gateway.id
routes = local.routes
Expand Down
4 changes: 2 additions & 2 deletions tests/cross-region-peering-attachment/main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
provider "aws" {
region = "us-east-1"
profile = "resource-member"
profile = "aws"
}

provider "aws" {
region = "us-east-2"
alias = "peer"
profile = "resource-owner"
profile = "awsalternate"
}

module "peering_attachment" {
Expand Down
3 changes: 2 additions & 1 deletion tests/tgw/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
provider "aws" {
region = "us-east-1"
region = "us-east-1"
profile = "aws"
}

module "tgw" {
Expand Down

0 comments on commit 3dc0303

Please sign in to comment.