Skip to content

Commit

Permalink
Remove obsolete variable from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
snovikov committed Sep 12, 2024
1 parent 00e16d2 commit e1712ee
Show file tree
Hide file tree
Showing 25 changed files with 56 additions and 99 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ jobs:

- name: "make test"
run: |
make test ARGS="-var aws_account_id_hub=${TF_VAR_aws_account_id_hub} -var aws_account_id_satellite=[${TF_VAR_aws_account_id_satellite}]"
make test ARGS="-var role_to_assume_hub=${TF_VAR_role_to_assume} -var aws_account_id_hub=${TF_VAR_aws_account_id_hub} -var role_to_assume_hub=${TF_VAR_role_to_assume} -var aws_account_id_satellite=${TF_VAR_aws_account_id_satellite}"
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_VAR_aws_account_id_hub: ${{ secrets.aws_account_id_hub }}
TF_VAR_aws_account_id_satellite: ${{ secrets.aws_account_id_satellite }}
TF_VAR_role_to_assume: ${{ secrets.ROLE_TO_ASSUME }}
TF_VAR_aws_account_id_hub: ${{ secrets.AWS_ACCOUNT_ID_HUB }}
TF_VAR_aws_account_id_satellite: ${{ secrets.AWS_ACCOUNT_ID_SATELLITE }}
7 changes: 4 additions & 3 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ jobs:

- name: "make test"
run: |
make test ARGS="-var aws_account_id_hub=${TF_VAR_aws_account_id_hub} -var aws_account_id_satellite=[${TF_VAR_aws_account_id_satellite}]"
make test ARGS="-var role_to_assume_hub=${TF_VAR_role_to_assume} -var aws_account_id_hub=${TF_VAR_aws_account_id_hub} -var role_to_assume_hub=${TF_VAR_role_to_assume} -var aws_account_id_satellite=${TF_VAR_aws_account_id_satellite}"
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
TF_VAR_aws_account_id_hub: ${{ secrets.aws_account_id_hub }}
TF_VAR_aws_account_id_satellite: ${{ secrets.aws_account_id_satellite }}
TF_VAR_role_to_assume: ${{ secrets.ROLE_TO_ASSUME }}
TF_VAR_aws_account_id_hub: ${{ secrets.AWS_ACCOUNT_ID_HUB }}
TF_VAR_aws_account_id_satellite: ${{ secrets.AWS_ACCOUNT_ID_SATELLITE }}
2 changes: 1 addition & 1 deletion examples/satellite-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_account_id_hub"></a> [aws\_account\_id\_hub](#input\_aws\_account\_id\_hub) | AWS account number containing the TGW hub | `string` | n/a | yes |
| <a name="input_aws_account_id_satellite"></a> [aws\_account\_id\_satellite](#input\_aws\_account\_id\_satellite) | List of AWS account numbers representing the satellites of the TGW | `list(string)` | n/a | yes |
| <a name="input_aws_account_id_satellite"></a> [aws\_account\_id\_satellite](#input\_aws\_account\_id\_satellite) | AWS account ID representing the satellites of the TGW | `string` | n/a | yes |
| <a name="input_role_to_assume_hub"></a> [role\_to\_assume\_hub](#input\_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 |
| <a name="input_role_to_assume_satellite"></a> [role\_to\_assume\_satellite](#input\_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 |
| <a name="input_attachment_subnet_filters"></a> [attachment\_subnet\_filters](#input\_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 |
Expand Down
6 changes: 0 additions & 6 deletions examples/satellite-all/locals.tf

This file was deleted.

5 changes: 1 addition & 4 deletions examples/satellite-all/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ module "tgw-satellite-all" {
satellite_create = var.satellite_create

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = local.aws_account_id_satellite

role_to_assume_hub = var.role_to_assume_hub
role_to_assume_satellite = var.role_to_assume_satellite
aws_account_id_satellite = var.aws_account_id_satellite

vpc_name_to_attach = var.vpc_name_to_attach

Expand Down
2 changes: 1 addition & 1 deletion examples/satellite-all/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ provider "aws" {
alias = "satellite"
region = "eu-central-1"
assume_role {
role_arn = "arn:aws:iam::${local.aws_account_id_satellite}:role/${var.role_to_assume_satellite}"
role_arn = "arn:aws:iam::${var.aws_account_id_satellite}:role/${var.role_to_assume_satellite}"
session_name = "tf-tgw-module-satellite"
}
}
Expand Down
18 changes: 9 additions & 9 deletions examples/satellite-all/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ variable "satellite_create" {
type = bool
}

variable "aws_account_id_hub" {
description = "AWS account number containing the TGW hub"
variable "aws_account_id_satellite" {
description = "AWS account ID representing the satellites of the TGW"
type = string
}

variable "aws_account_id_satellite" {
description = "List of AWS account numbers representing the satellites of the TGW"
type = list(string)
variable "role_to_assume_satellite" {
description = "IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE)"
type = string
}

variable "role_to_assume_hub" {
description = "IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB)"
variable "aws_account_id_hub" {
description = "AWS account number containing the TGW hub"
type = string
}

variable "role_to_assume_satellite" {
description = "IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE)"
variable "role_to_assume_hub" {
description = "IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB)"
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion examples/satellite-default-route-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_account_id_hub"></a> [aws\_account\_id\_hub](#input\_aws\_account\_id\_hub) | AWS account number containing the TGW hub | `string` | n/a | yes |
| <a name="input_aws_account_id_satellite"></a> [aws\_account\_id\_satellite](#input\_aws\_account\_id\_satellite) | List of AWS account numbers representing the satellites of the TGW | `list(string)` | n/a | yes |
| <a name="input_aws_account_id_satellite"></a> [aws\_account\_id\_satellite](#input\_aws\_account\_id\_satellite) | AWS account ID representing the satellites of the TGW | `string` | n/a | yes |
| <a name="input_role_to_assume_hub"></a> [role\_to\_assume\_hub](#input\_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 |
| <a name="input_role_to_assume_satellite"></a> [role\_to\_assume\_satellite](#input\_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 |
| <a name="input_attachment_subnet_filters"></a> [attachment\_subnet\_filters](#input\_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 |
Expand Down
6 changes: 0 additions & 6 deletions examples/satellite-default-route-all/locals.tf

This file was deleted.

5 changes: 1 addition & 4 deletions examples/satellite-default-route-all/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ module "tgw-satellite-default-route-all" {
satellite_create = var.satellite_create

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = local.aws_account_id_satellite

role_to_assume_hub = var.role_to_assume_hub
role_to_assume_satellite = var.role_to_assume_satellite
aws_account_id_satellite = var.aws_account_id_satellite

vpc_name_to_attach = var.vpc_name_to_attach

Expand Down
2 changes: 1 addition & 1 deletion examples/satellite-default-route-all/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ provider "aws" {
alias = "satellite"
region = "eu-central-1"
assume_role {
role_arn = "arn:aws:iam::${local.aws_account_id_satellite}:role/${var.role_to_assume_satellite}"
role_arn = "arn:aws:iam::${var.aws_account_id_satellite}:role/${var.role_to_assume_satellite}"
session_name = "tf-tgw-module-satellite"
}
}
Expand Down
3 changes: 0 additions & 3 deletions examples/satellite-default-route-all/variables.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
satellite_create = true

role_to_assume_hub = "ASSUME-ENG-CI"
role_to_assume_satellite = "ASSUME-ENG-CI"

vpc_name_to_attach = "default"

satellite_destination_cidr_blocks = ["208.67.222.222/32", "208.67.220.220/32"]
Expand Down
18 changes: 9 additions & 9 deletions examples/satellite-default-route-all/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ variable "satellite_create" {
type = bool
}

variable "aws_account_id_hub" {
description = "AWS account number containing the TGW hub"
variable "aws_account_id_satellite" {
description = "AWS account ID representing the satellites of the TGW"
type = string
}

variable "aws_account_id_satellite" {
description = "List of AWS account numbers representing the satellites of the TGW"
type = list(string)
variable "role_to_assume_satellite" {
description = "IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE)"
type = string
}

variable "role_to_assume_hub" {
description = "IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB)"
variable "aws_account_id_hub" {
description = "AWS account number containing the TGW hub"
type = string
}

variable "role_to_assume_satellite" {
description = "IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE)"
variable "role_to_assume_hub" {
description = "IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB)"
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion examples/satellite-default-route/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_account_id_hub"></a> [aws\_account\_id\_hub](#input\_aws\_account\_id\_hub) | AWS account number containing the TGW hub | `string` | n/a | yes |
| <a name="input_aws_account_id_satellite"></a> [aws\_account\_id\_satellite](#input\_aws\_account\_id\_satellite) | List of AWS account numbers representing the satellites of the TGW | `list(string)` | n/a | yes |
| <a name="input_aws_account_id_satellite"></a> [aws\_account\_id\_satellite](#input\_aws\_account\_id\_satellite) | AWS account ID representing the satellites of the TGW | `string` | n/a | yes |
| <a name="input_role_to_assume_hub"></a> [role\_to\_assume\_hub](#input\_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 |
| <a name="input_role_to_assume_satellite"></a> [role\_to\_assume\_satellite](#input\_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 |
| <a name="input_attachment_subnet_filters"></a> [attachment\_subnet\_filters](#input\_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 |
Expand Down
6 changes: 0 additions & 6 deletions examples/satellite-default-route/locals.tf

This file was deleted.

5 changes: 1 addition & 4 deletions examples/satellite-default-route/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ module "tgw-satellite-default-route" {
satellite_create = var.satellite_create

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = local.aws_account_id_satellite

role_to_assume_hub = var.role_to_assume_hub
role_to_assume_satellite = var.role_to_assume_satellite
aws_account_id_satellite = var.aws_account_id_satellite

vpc_name_to_attach = var.vpc_name_to_attach

Expand Down
2 changes: 1 addition & 1 deletion examples/satellite-default-route/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ provider "aws" {
alias = "satellite"
region = "eu-central-1"
assume_role {
role_arn = "arn:aws:iam::${local.aws_account_id_satellite}:role/${var.role_to_assume_satellite}"
role_arn = "arn:aws:iam::${var.aws_account_id_satellite}:role/${var.role_to_assume_satellite}"
session_name = "tf-tgw-module-satellite"
}
}
Expand Down
3 changes: 0 additions & 3 deletions examples/satellite-default-route/variables.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
satellite_create = true

role_to_assume_hub = "ASSUME-ENG-CI"
role_to_assume_satellite = "ASSUME-ENG-CI"

vpc_name_to_attach = "default"

satellite_destination_cidr_blocks = ["208.67.222.222/32", "208.67.220.220/32"]
Expand Down
18 changes: 9 additions & 9 deletions examples/satellite-default-route/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ variable "satellite_create" {
type = bool
}

variable "aws_account_id_hub" {
description = "AWS account number containing the TGW hub"
variable "aws_account_id_satellite" {
description = "AWS account ID representing the satellites of the TGW"
type = string
}

variable "aws_account_id_satellite" {
description = "List of AWS account numbers representing the satellites of the TGW"
type = list(string)
variable "role_to_assume_satellite" {
description = "IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE)"
type = string
}

variable "role_to_assume_hub" {
description = "IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB)"
variable "aws_account_id_hub" {
description = "AWS account number containing the TGW hub"
type = string
}

variable "role_to_assume_satellite" {
description = "IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE)"
variable "role_to_assume_hub" {
description = "IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB)"
type = string
}

Expand Down
2 changes: 1 addition & 1 deletion examples/satellite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_aws_account_id_hub"></a> [aws\_account\_id\_hub](#input\_aws\_account\_id\_hub) | AWS account number containing the TGW hub | `string` | n/a | yes |
| <a name="input_aws_account_id_satellite"></a> [aws\_account\_id\_satellite](#input\_aws\_account\_id\_satellite) | List of AWS account numbers representing the satellites of the TGW | `list(string)` | n/a | yes |
| <a name="input_aws_account_id_satellite"></a> [aws\_account\_id\_satellite](#input\_aws\_account\_id\_satellite) | AWS account ID representing the satellites of the TGW | `string` | n/a | yes |
| <a name="input_role_to_assume_hub"></a> [role\_to\_assume\_hub](#input\_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 |
| <a name="input_role_to_assume_satellite"></a> [role\_to\_assume\_satellite](#input\_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 |
| <a name="input_attachment_subnet_filters"></a> [attachment\_subnet\_filters](#input\_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 |
Expand Down
6 changes: 0 additions & 6 deletions examples/satellite/locals.tf

This file was deleted.

5 changes: 1 addition & 4 deletions examples/satellite/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ module "tgw-satellite" {
satellite_create = var.satellite_create

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = local.aws_account_id_satellite

role_to_assume_hub = var.role_to_assume_hub
role_to_assume_satellite = var.role_to_assume_satellite
aws_account_id_satellite = var.aws_account_id_satellite

vpc_name_to_attach = var.vpc_name_to_attach

Expand Down
2 changes: 1 addition & 1 deletion examples/satellite/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ provider "aws" {
alias = "satellite"
region = "eu-central-1"
assume_role {
role_arn = "arn:aws:iam::${local.aws_account_id_satellite}:role/${var.role_to_assume_satellite}"
role_arn = "arn:aws:iam::${var.aws_account_id_satellite}:role/${var.role_to_assume_satellite}"
session_name = "tf-tgw-module-satellite"
}
}
Expand Down
3 changes: 0 additions & 3 deletions examples/satellite/variables.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
satellite_create = true

role_to_assume_hub = "ASSUME-ENG-CI"
role_to_assume_satellite = "ASSUME-ENG-CI"

vpc_name_to_attach = "default"

satellite_destination_cidr_blocks = ["208.67.222.222/32", "208.67.220.220/32"]
Expand Down
18 changes: 9 additions & 9 deletions examples/satellite/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ variable "satellite_create" {
type = bool
}

variable "aws_account_id_hub" {
description = "AWS account number containing the TGW hub"
variable "aws_account_id_satellite" {
description = "AWS account ID representing the satellites of the TGW"
type = string
}

variable "aws_account_id_satellite" {
description = "List of AWS account numbers representing the satellites of the TGW"
type = list(string)
variable "role_to_assume_satellite" {
description = "IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE)"
type = string
}

variable "role_to_assume_hub" {
description = "IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB)"
variable "aws_account_id_hub" {
description = "AWS account number containing the TGW hub"
type = string
}

variable "role_to_assume_satellite" {
description = "IAM role name to assume in the AWS account containing the TGW satellite (eg. ASSUME-ROLE-SATELLITE)"
variable "role_to_assume_hub" {
description = "IAM role name to assume in the AWS account containing the TGW hub (eg. ASSUME-ROLE-HUB)"
type = string
}

Expand Down

0 comments on commit e1712ee

Please sign in to comment.