Skip to content

Commit db4fc4b

Browse files
authored
chore: Update CI and examples for Terraform (#1619)
* chore: Update Ci and examples for Terraform - upgrade terraform versions - replaced philips vpc module by aws-terraform-vpc module - dropped support for terrform pre 1.x from examples * chore: Update Ci and examples for Terraform - upgrade terraform versions - replaced philips vpc module by aws-terraform-vpc module - dropped support for terrform pre 1.x from examples - upgrade terraform versions - replaced philips vpc module by aws-terraform-vpc module - dropped support for terrform pre 1.x from examples replace local by var ref * check formatting for latest terraform version * fix formatting * fix formatting * fix formatting
1 parent 39c019c commit db4fc4b

File tree

18 files changed

+246
-109
lines changed

18 files changed

+246
-109
lines changed

.github/workflows/terraform.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ on:
99
- "modules/*/lambdas/**"
1010

1111
env:
12-
tf_version: "1.0."
13-
tf_working_dir: "."
1412
AWS_REGION: eu-west-1
1513
jobs:
1614
verify_module:
1715
name: Verify module
1816
strategy:
1917
matrix:
20-
terraform: [1.0.8]
18+
terraform: [1.1.3, 'latest']
2119
runs-on: ubuntu-latest
2220
container:
2321
image: hashicorp/terraform:${{ matrix.terraform }}
@@ -31,7 +29,11 @@ jobs:
3129
touch modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/runner-binaries-syncer.zip
3230
- name: terraform init
3331
run: terraform init -get -backend=false -input=false
34-
- name: check terraform formatting
32+
- if: contains(matrix.terraform, '1.1.')
33+
name: check terraform formatting
34+
run: terraform fmt -recursive -check=true -write=false
35+
- if: contains(matrix.terraform, 'latest') # check formatting for the latest release but avoid failing the build
36+
name: check terraform formatting
3537
run: terraform fmt -recursive -check=true -write=false
3638
continue-on-error: true
3739
- name: validate terraform
@@ -42,7 +44,7 @@ jobs:
4244
strategy:
4345
fail-fast: false
4446
matrix:
45-
terraform: [0.14.3, 0.15.5, 1.0.8]
47+
terraform: [1.0.11, 1.1.3, 'latest']
4648
example: ["default", "ubuntu", "prebuilt", "arm64", "ephemeral", "windows"]
4749
defaults:
4850
run:
@@ -54,9 +56,12 @@ jobs:
5456
- uses: actions/checkout@v2
5557
- name: terraform init
5658
run: terraform init -get -backend=false -input=false
57-
- if: contains(matrix.terraform, '1.0.')
59+
- if: contains(matrix.terraform, '1.1.')
60+
name: check terraform formatting
61+
run: terraform fmt -recursive -check=true -write=false
62+
- if: contains(matrix.terraform, 'latest') # check formatting for the latest release but avoid failing the build
5863
name: check terraform formatting
5964
run: terraform fmt -recursive -check=true -write=false
6065
continue-on-error: true
61-
- name: validate terraform
66+
- name: validate terraform011
6267
run: terraform validate

examples/arm64/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module "runners" {
3737

3838
enable_organization_runners = false
3939
# Runners will automatically get the "arm64" label
40-
runner_extra_labels = "default,example"
40+
runner_extra_labels = "default,example"
4141

4242
# enable access to the runners via SSM
4343
enable_ssm_on_runners = true

examples/default/.terraform.lock.hcl

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/default/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = ">= 3.27"
5+
version = ">= 3.71"
66
}
77
local = {
88
source = "hashicorp/local"
@@ -11,5 +11,5 @@ terraform {
1111
source = "hashicorp/random"
1212
}
1313
}
14-
required_version = ">= 0.14"
14+
required_version = ">= 1"
1515
}

examples/default/vpc.tf

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
module "vpc" {
2-
source = "git::https://github.com/philips-software/terraform-aws-vpc.git?ref=2.2.0"
2+
source = "terraform-aws-modules/vpc/aws"
3+
version = "3.11.2"
4+
5+
name = "vpc-${local.environment}"
6+
cidr = "10.0.0.0/16"
7+
8+
azs = ["${local.aws_region}a", "${local.aws_region}b", "${local.aws_region}c"]
9+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
10+
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
11+
12+
enable_dns_hostnames = true
13+
enable_nat_gateway = true
14+
map_public_ip_on_launch = false
15+
single_nat_gateway = true
16+
17+
tags = {
18+
Environment = local.environment
19+
}
320

4-
environment = local.environment
5-
aws_region = local.aws_region
6-
create_private_hosted_zone = false
721
}

examples/ephemeral/.terraform.lock.hcl

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/ephemeral/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = ">= 3.27"
5+
version = ">= 3.71"
66
}
77
local = {
88
source = "hashicorp/local"
@@ -11,5 +11,5 @@ terraform {
1111
source = "hashicorp/random"
1212
}
1313
}
14-
required_version = ">= 0.14"
14+
required_version = ">= 1"
1515
}

examples/ephemeral/vpc.tf

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
module "vpc" {
2-
source = "git::https://github.com/philips-software/terraform-aws-vpc.git?ref=2.2.0"
2+
source = "terraform-aws-modules/vpc/aws"
3+
version = "3.11.2"
4+
5+
name = "vpc-${local.environment}"
6+
cidr = "10.0.0.0/16"
7+
8+
azs = ["${local.aws_region}a", "${local.aws_region}b", "${local.aws_region}c"]
9+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
10+
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
11+
12+
enable_dns_hostnames = true
13+
enable_nat_gateway = true
14+
map_public_ip_on_launch = false
15+
single_nat_gateway = true
16+
17+
tags = {
18+
Environment = local.environment
19+
}
320

4-
environment = local.environment
5-
aws_region = local.aws_region
6-
create_private_hosted_zone = false
721
}

examples/permissions-boundary/vpc.tf

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
module "vpc" {
2-
source = "git::https://github.com/philips-software/terraform-aws-vpc.git?ref=2.1.0"
2+
source = "terraform-aws-modules/vpc/aws"
3+
version = "3.11.2"
4+
5+
name = "vpc-${local.environment}"
6+
cidr = "10.0.0.0/16"
7+
8+
azs = ["${local.aws_region}a", "${local.aws_region}b", "${local.aws_region}c"]
9+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
10+
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
11+
12+
enable_dns_hostnames = true
13+
enable_nat_gateway = true
14+
map_public_ip_on_launch = false
15+
single_nat_gateway = true
16+
17+
tags = {
18+
Environment = local.environment
19+
}
320

4-
environment = local.environment
5-
aws_region = local.aws_region
6-
create_private_hosted_zone = false
721
}

examples/prebuilt/.terraform.lock.hcl

Lines changed: 14 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/prebuilt/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ terraform {
22
required_providers {
33
aws = {
44
source = "hashicorp/aws"
5-
version = ">= 3.27"
5+
version = ">= 3.71"
66
}
77
local = {
88
source = "hashicorp/local"
@@ -11,5 +11,5 @@ terraform {
1111
source = "hashicorp/random"
1212
}
1313
}
14-
required_version = ">= 0.14"
14+
required_version = ">= 1"
1515
}

examples/prebuilt/vpc.tf

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
module "vpc" {
2-
source = "git::https://github.com/philips-software/terraform-aws-vpc.git?ref=2.2.0"
2+
source = "terraform-aws-modules/vpc/aws"
3+
version = "3.11.2"
4+
5+
name = "vpc-${local.environment}"
6+
cidr = "10.0.0.0/16"
7+
8+
azs = ["${var.aws_region}a", "${var.aws_region}b", "${var.aws_region}c"]
9+
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
10+
public_subnets = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
11+
12+
enable_dns_hostnames = true
13+
enable_nat_gateway = true
14+
map_public_ip_on_launch = false
15+
single_nat_gateway = true
16+
17+
tags = {
18+
Environment = local.environment
19+
}
320

4-
environment = local.environment
5-
aws_region = var.aws_region
6-
create_private_hosted_zone = false
721
}

examples/ubuntu/.terraform.lock.hcl

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/ubuntu/versions.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
terraform {
2+
required_providers {
3+
aws = {
4+
source = "hashicorp/aws"
5+
version = ">= 3.71"
6+
}
7+
local = {
8+
source = "hashicorp/local"
9+
}
10+
random = {
11+
source = "hashicorp/random"
12+
}
13+
}
14+
required_version = ">= 1"
15+
}

0 commit comments

Comments
 (0)