Skip to content

Commit

Permalink
Tf013update (#18)
Browse files Browse the repository at this point in the history
* Add providers an versions

* Update Makefile and docs after removing obsolete parameter

* Remove obsolete list function

* Add lock file to .gitignore

* Add CODEOWNERS

* Add release drafter

* Fix formatting
  • Loading branch information
snovikov authored Sep 28, 2021
1 parent c6cf78b commit 508d5f5
Show file tree
Hide file tree
Showing 23 changed files with 114 additions and 48 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Flaconi/devops
24 changes: 24 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
name-template: '$NEXT_MINOR_VERSION 🌈'
tag-template: '$NEXT_MINOR_VERSION'
categories:
- title: '🚀 Features'
labels:
- feature
- enhancement
- title: '🐛 Bug Fixes'
labels:
- fix
- bugfix
- bug
- title: '🧰 Maintenance'
labels:
- chore
- dependencies
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
branches:
- master
template: |
## What's Changed
$CHANGES
15 changes: 15 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*.tfstate
*.tfstate.*

# Exclude the providers lock file introduced by TF0.14
.terraform.lock.hcl

# Crash log files
crash.log

Expand Down
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ TF_MODULES = $(sort $(dir $(wildcard $(CURRENT_DIR)modules/*/)))
# -------------------------------------------------------------------------------------------------
# Container versions
# -------------------------------------------------------------------------------------------------
TF_VERSION = light
TFDOCS_VERSION = 0.8.1-0.18
FL_VERSION = 0.2
JL_VERSION = latest-0.4
TF_VERSION = 0.13.7
TFDOCS_VERSION = 0.9.1-0.28
FL_VERSION = 0.4
JL_VERSION = 1.6.0-0.5


# -------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -79,12 +79,9 @@ test: _pull-tf
echo "------------------------------------------------------------"; \
if docker run $$(tty -s && echo "-it" || echo) --rm -v "$(CURRENT_DIR):/t" --workdir "$${DOCKER_PATH}" hashicorp/terraform:$(TF_VERSION) \
init \
-verify-plugins=true \
-lock=false \
-upgrade=true \
-reconfigure \
-input=false \
-get-plugins=true \
-get=true \
.; then \
echo "OK"; \
Expand Down Expand Up @@ -171,7 +168,7 @@ _gen-main:
-e DELIM_START='$(DELIM_START)' \
-e DELIM_CLOSE='$(DELIM_CLOSE)' \
cytopia/terraform-docs:$(TFDOCS_VERSION) \
terraform-docs-replace-012 $(TFDOCS_ARGS) md README.md; then \
terraform-docs-replace $(TFDOCS_ARGS) md README.md; then \
echo "OK"; \
else \
echo "Failed"; \
Expand All @@ -190,7 +187,7 @@ _gen-examples:
-e DELIM_START='$(DELIM_START)' \
-e DELIM_CLOSE='$(DELIM_CLOSE)' \
cytopia/terraform-docs:$(TFDOCS_VERSION) \
terraform-docs-replace-012 $(TFDOCS_ARGS) md $${DOCKER_PATH}/README.md; then \
terraform-docs-replace $(TFDOCS_ARGS) md $${DOCKER_PATH}/README.md; then \
echo "OK"; \
else \
echo "Failed"; \
Expand All @@ -210,7 +207,7 @@ _gen-modules:
-e DELIM_START='$(DELIM_START)' \
-e DELIM_CLOSE='$(DELIM_CLOSE)' \
cytopia/terraform-docs:$(TFDOCS_VERSION) \
terraform-docs-replace-012 $(TFDOCS_ARGS) md $${DOCKER_PATH}/README.md; then \
terraform-docs-replace $(TFDOCS_ARGS) md $${DOCKER_PATH}/README.md; then \
echo "OK"; \
else \
echo "Failed"; \
Expand Down
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,30 @@ It is implied on [this][9] documentation page and they've been made aware of
this fact.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

| Name | Version |
|------|---------|
| terraform | >= 0.13 |
| aws | >= 3 |

## Providers

| Name | Version |
|------|---------|
| aws.hub | n/a |
| aws.satellite | n/a |
| aws.hub | >= 3 |
| aws.satellite | >= 3 |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:-----:|
|------|-------------|------|---------|:--------:|
| aws\_account\_id\_hub | AWS account number containing the TGW hub | `string` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `any` | n/a | yes |
| role\_to\_assume\_hub | IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB) | `string` | n/a | yes |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| aws\_account\_id\_satellite | AWS account number containing the TGW satellite | `string` | `""` | no |
| hub\_destination\_cidr\_blocks | List of CIDRs to be routed for the hub | `list(string)` | `[]` | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| private\_subnets\_strict\_acl\_rules | Create additional ACLs for private subnets to restrict inbound traffic only to VPC itself and VPCs paired over TGW | `bool` | `false` | no |
| ram\_resource\_association\_id | Identifier of the Resource Access Manager Resource Association | `string` | `""` | no |
| role\_to\_assume\_satellite | IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE) | `string` | `""` | no |
Expand Down
12 changes: 8 additions & 4 deletions examples/satellite-all/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Standalone invocation of the Transit Gateway satellite module

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.

## Providers

No provider.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:-----:|
|------|-------------|------|---------|:--------:|
| aws\_account\_id\_hub | AWS account number containing the TGW hub | `string` | n/a | yes |
| aws\_account\_id\_satellite | List of AWS account numbers representing the satellites of the TGW | `list(string)` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `any` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `string` | n/a | yes |
| role\_to\_assume\_hub | IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB) | `string` | n/a | yes |
| role\_to\_assume\_satellite | IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE) | `string` | n/a | yes |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| hub\_destination\_cidr\_blocks | List of CIDRs to be routed for the hub | `list(string)` | `[]` | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| route\_entire\_satellite\_vpc | Boolean flag for toggling the creation of network routes for all the subnets of the satellite VPC | `bool` | `false` | no |
| route\_private\_subnets\_via\_tgw | Use TGW attachment as a default route (0.0.0.0/0) for private subnets. Value `satellite_destination_cidr_block`s will be ignored. | `bool` | `false` | no |
| satellite\_create | Boolean flag for toggling the handling of satellite resources | `bool` | `false` | no |
Expand Down
3 changes: 1 addition & 2 deletions examples/satellite-all/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module "tgw-satellite-all" {
aws.hub = aws.hub
}

aws_login_profile = var.aws_login_profile
satellite_create = var.satellite_create
satellite_create = var.satellite_create

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = local.aws_account_id_satellite
Expand Down
1 change: 1 addition & 0 deletions examples/satellite-all/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ variable "satellite_create" {

variable "aws_login_profile" {
description = "Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles"
type = string
}

variable "aws_account_id_hub" {
Expand Down
12 changes: 8 additions & 4 deletions examples/satellite-default-route-all/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Standalone invocation of the Transit Gateway satellite module

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.

## Providers

No provider.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:-----:|
|------|-------------|------|---------|:--------:|
| aws\_account\_id\_hub | AWS account number containing the TGW hub | `string` | n/a | yes |
| aws\_account\_id\_satellite | List of AWS account numbers representing the satellites of the TGW | `list(string)` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `any` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `string` | n/a | yes |
| role\_to\_assume\_hub | IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB) | `string` | n/a | yes |
| role\_to\_assume\_satellite | IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE) | `string` | n/a | yes |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| hub\_destination\_cidr\_blocks | List of CIDRs to be routed for the hub | `list(string)` | `[]` | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| route\_entire\_satellite\_vpc | Boolean flag for toggling the creation of network routes for all the subnets of the satellite VPC | `bool` | `false` | no |
| route\_private\_subnets\_via\_tgw | Use TGW attachment as a default route (0.0.0.0/0) for private subnets. Value `satellite_destination_cidr_block`s will be ignored. | `bool` | `false` | no |
| satellite\_create | Boolean flag for toggling the handling of satellite resources | `bool` | `false` | no |
Expand Down
3 changes: 1 addition & 2 deletions examples/satellite-default-route-all/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module "tgw-satellite-default-route-all" {
aws.hub = aws.hub
}

aws_login_profile = var.aws_login_profile
satellite_create = var.satellite_create
satellite_create = var.satellite_create

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = local.aws_account_id_satellite
Expand Down
1 change: 1 addition & 0 deletions examples/satellite-default-route-all/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ variable "satellite_create" {

variable "aws_login_profile" {
description = "Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles"
type = string
}

variable "aws_account_id_hub" {
Expand Down
12 changes: 8 additions & 4 deletions examples/satellite-default-route/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Standalone invocation of the Transit Gateway satellite module

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.

## Providers

No provider.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:-----:|
|------|-------------|------|---------|:--------:|
| aws\_account\_id\_hub | AWS account number containing the TGW hub | `string` | n/a | yes |
| aws\_account\_id\_satellite | List of AWS account numbers representing the satellites of the TGW | `list(string)` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `any` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `string` | n/a | yes |
| role\_to\_assume\_hub | IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB) | `string` | n/a | yes |
| role\_to\_assume\_satellite | IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE) | `string` | n/a | yes |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| hub\_destination\_cidr\_blocks | List of CIDRs to be routed for the hub | `list(string)` | `[]` | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| route\_entire\_satellite\_vpc | Boolean flag for toggling the creation of network routes for all the subnets of the satellite VPC | `bool` | `false` | no |
| route\_private\_subnets\_via\_tgw | Use TGW attachment as a default route (0.0.0.0/0) for private subnets. Value `satellite_destination_cidr_block`s will be ignored. | `bool` | `false` | no |
| satellite\_create | Boolean flag for toggling the handling of satellite resources | `bool` | `false` | no |
Expand Down
3 changes: 1 addition & 2 deletions examples/satellite-default-route/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module "tgw-satellite-default-route" {
aws.hub = aws.hub
}

aws_login_profile = var.aws_login_profile
satellite_create = var.satellite_create
satellite_create = var.satellite_create

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = local.aws_account_id_satellite
Expand Down
1 change: 1 addition & 0 deletions examples/satellite-default-route/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ variable "satellite_create" {

variable "aws_login_profile" {
description = "Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles"
type = string
}

variable "aws_account_id_hub" {
Expand Down
12 changes: 8 additions & 4 deletions examples/satellite/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Standalone invocation of the Transit Gateway satellite module

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

No requirements.

## Providers

No provider.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:-----:|
|------|-------------|------|---------|:--------:|
| aws\_account\_id\_hub | AWS account number containing the TGW hub | `string` | n/a | yes |
| aws\_account\_id\_satellite | List of AWS account numbers representing the satellites of the TGW | `list(string)` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `any` | n/a | yes |
| aws\_login\_profile | Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles | `string` | n/a | yes |
| role\_to\_assume\_hub | IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB) | `string` | n/a | yes |
| role\_to\_assume\_satellite | IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE) | `string` | n/a | yes |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| attachment\_subnet\_filters | List of maps selecting the subnet(s) where TGW will be attached | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| hub\_destination\_cidr\_blocks | List of CIDRs to be routed for the hub | `list(string)` | `[]` | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))<br></pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]<br></pre> | no |
| private\_subnet\_filters | List of maps selecting the subnet(s) which are private | <pre>list(object({<br> name = string<br> values = list(string)<br> }))</pre> | <pre>[<br> {<br> "name": "tag:Name",<br> "values": [<br> "*private*"<br> ]<br> }<br>]</pre> | no |
| private\_subnets\_strict\_acl\_rules | Create additional ACLs for private subnets to restrict inbound traffic only to VPC itself and VPCs paired over TGW | `bool` | `false` | no |
| route\_entire\_satellite\_vpc | Boolean flag for toggling the creation of network routes for all the subnets of the satellite VPC | `bool` | `false` | no |
| route\_private\_subnets\_via\_tgw | Use TGW attachment as a default route (0.0.0.0/0) for private subnets. Value `satellite_destination_cidr_block`s will be ignored. | `bool` | `false` | no |
Expand Down
3 changes: 1 addition & 2 deletions examples/satellite/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module "tgw-satellite" {
aws.hub = aws.hub
}

aws_login_profile = var.aws_login_profile
satellite_create = var.satellite_create
satellite_create = var.satellite_create

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = local.aws_account_id_satellite
Expand Down
1 change: 1 addition & 0 deletions examples/satellite/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ variable "satellite_create" {

variable "aws_login_profile" {
description = "Name of the AWS login profile as seen under ~/.aws/config used for assuming cross-account roles"
type = string
}

variable "aws_account_id_hub" {
Expand Down
Loading

0 comments on commit 508d5f5

Please sign in to comment.