Skip to content

Commit

Permalink
Fix CI to run in dedicated VPC
Browse files Browse the repository at this point in the history
  • Loading branch information
snovikov committed Sep 12, 2024
1 parent e1712ee commit 687674e
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: "make test"
run: |
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}"
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_satellite=${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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

- name: "make test"
run: |
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}"
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_satellite=${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 }}
Expand Down
1 change: 1 addition & 0 deletions examples/satellite-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_tgw"></a> [tgw](#module\_tgw) | github.com/flaconi/terraform-aws-transit-gateway-hub.git | v1.6.0 |
| <a name="module_tgw-satellite-all"></a> [tgw-satellite-all](#module\_tgw-satellite-all) | ../../ | n/a |

## Resources
Expand Down
13 changes: 11 additions & 2 deletions examples/satellite-all/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# The Transit Gateway (hub) has already been created in AWS, as a fixture for
# this test case due to not being able to use 'depends_on' on Terraform modules
module "tgw" {
source = "github.com/flaconi/terraform-aws-transit-gateway-hub.git?ref=v1.6.0"

name = var.transit_gateway_hub_name

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = [var.aws_account_id_satellite]
}

module "tgw-satellite-all" {
source = "../../"

Expand Down Expand Up @@ -27,4 +34,6 @@ module "tgw-satellite-all" {
route_private_subnets_via_tgw = var.route_private_subnets_via_tgw

private_subnet_filters = var.private_subnet_filters

depends_on = [module.tgw]
}
7 changes: 2 additions & 5 deletions examples/satellite-all/variables.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
satellite_create = true

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

vpc_name_to_attach = "default"
vpc_name_to_attach = "ci-tgw"

satellite_destination_cidr_blocks = ["208.67.222.222/32", "208.67.220.220/32"]
hub_destination_cidr_blocks = ["8.8.4.4/32", "8.8.8.8/32"]
Expand All @@ -19,7 +16,7 @@ attachment_subnet_filters = [
}
]

transit_gateway_hub_name = "test-tgw-fixture"
transit_gateway_hub_name = "test-tgw-satellite-all"

route_entire_satellite_vpc = true

Expand Down
1 change: 1 addition & 0 deletions examples/satellite-default-route-all/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_tgw"></a> [tgw](#module\_tgw) | github.com/flaconi/terraform-aws-transit-gateway-hub.git | v1.6.0 |
| <a name="module_tgw-satellite-default-route-all"></a> [tgw-satellite-default-route-all](#module\_tgw-satellite-default-route-all) | ../../ | n/a |

## Resources
Expand Down
13 changes: 11 additions & 2 deletions examples/satellite-default-route-all/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# The Transit Gateway (hub) has already been created in AWS, as a fixture for
# this test case due to not being able to use 'depends_on' on Terraform modules
module "tgw" {
source = "github.com/flaconi/terraform-aws-transit-gateway-hub.git?ref=v1.6.0"

name = var.transit_gateway_hub_name

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = [var.aws_account_id_satellite]
}

module "tgw-satellite-default-route-all" {
source = "../../"

Expand Down Expand Up @@ -27,4 +34,6 @@ module "tgw-satellite-default-route-all" {
route_private_subnets_via_tgw = var.route_private_subnets_via_tgw

private_subnet_filters = var.private_subnet_filters

depends_on = [module.tgw]
}
4 changes: 2 additions & 2 deletions examples/satellite-default-route-all/variables.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
satellite_create = true

vpc_name_to_attach = "default"
vpc_name_to_attach = "ci-tgw"

satellite_destination_cidr_blocks = ["208.67.222.222/32", "208.67.220.220/32"]
hub_destination_cidr_blocks = ["8.8.4.4/32", "8.8.8.8/32"]
Expand All @@ -16,7 +16,7 @@ attachment_subnet_filters = [
}
]

transit_gateway_hub_name = "test-tgw-fixture"
transit_gateway_hub_name = "test-tgw-satellite-default-route-all"

route_entire_satellite_vpc = true

Expand Down
1 change: 1 addition & 0 deletions examples/satellite-default-route/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_tgw"></a> [tgw](#module\_tgw) | github.com/flaconi/terraform-aws-transit-gateway-hub.git | v1.6.0 |
| <a name="module_tgw-satellite-default-route"></a> [tgw-satellite-default-route](#module\_tgw-satellite-default-route) | ../../ | n/a |

## Resources
Expand Down
13 changes: 11 additions & 2 deletions examples/satellite-default-route/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# The Transit Gateway (hub) has already been created in AWS, as a fixture for
# this test case due to not being able to use 'depends_on' on Terraform modules
module "tgw" {
source = "github.com/flaconi/terraform-aws-transit-gateway-hub.git?ref=v1.6.0"

name = var.transit_gateway_hub_name

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = [var.aws_account_id_satellite]
}

module "tgw-satellite-default-route" {
source = "../../"

Expand Down Expand Up @@ -27,4 +34,6 @@ module "tgw-satellite-default-route" {
route_private_subnets_via_tgw = var.route_private_subnets_via_tgw

private_subnet_filters = var.private_subnet_filters

depends_on = [module.tgw]
}
4 changes: 2 additions & 2 deletions examples/satellite-default-route/variables.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
satellite_create = true

vpc_name_to_attach = "default"
vpc_name_to_attach = "ci-tgw"

satellite_destination_cidr_blocks = ["208.67.222.222/32", "208.67.220.220/32"]
hub_destination_cidr_blocks = ["8.8.4.4/32", "8.8.8.8/32"]
Expand All @@ -16,7 +16,7 @@ attachment_subnet_filters = [
}
]

transit_gateway_hub_name = "test-tgw-fixture"
transit_gateway_hub_name = "test-tgw-satellite-default-route"

route_private_subnets_via_tgw = true

Expand Down
1 change: 1 addition & 0 deletions examples/satellite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_tgw"></a> [tgw](#module\_tgw) | github.com/flaconi/terraform-aws-transit-gateway-hub.git | v1.6.0 |
| <a name="module_tgw-satellite"></a> [tgw-satellite](#module\_tgw-satellite) | ../../ | n/a |

## Resources
Expand Down
13 changes: 11 additions & 2 deletions examples/satellite/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# The Transit Gateway (hub) has already been created in AWS, as a fixture for
# this test case due to not being able to use 'depends_on' on Terraform modules
module "tgw" {
source = "github.com/flaconi/terraform-aws-transit-gateway-hub.git?ref=v1.6.0"

name = var.transit_gateway_hub_name

aws_account_id_hub = var.aws_account_id_hub
aws_account_id_satellite = [var.aws_account_id_satellite]
}

module "tgw-satellite" {
source = "../../"

Expand Down Expand Up @@ -29,4 +36,6 @@ module "tgw-satellite" {
route_private_subnets_via_tgw = var.route_private_subnets_via_tgw

private_subnet_filters = var.private_subnet_filters

depends_on = [module.tgw]
}
4 changes: 2 additions & 2 deletions examples/satellite/variables.auto.tfvars
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
satellite_create = true

vpc_name_to_attach = "default"
vpc_name_to_attach = "ci-tgw"

satellite_destination_cidr_blocks = ["208.67.222.222/32", "208.67.220.220/32"]
hub_destination_cidr_blocks = ["8.8.4.4/32", "8.8.8.8/32"]
Expand All @@ -16,7 +16,7 @@ attachment_subnet_filters = [
}
]

transit_gateway_hub_name = "test-tgw-fixture"
transit_gateway_hub_name = "test-tgw-satellite"

private_subnets_strict_acl_rules = true

Expand Down

0 comments on commit 687674e

Please sign in to comment.