From d23aae2b937dd9d2c2815baa922e894b31181eb0 Mon Sep 17 00:00:00 2001 From: Denis O Date: Tue, 27 Jun 2023 19:28:09 +0000 Subject: [PATCH 1/3] GCP tests fixes --- examples/packer-basic-example/build-gcp.pkr.hcl | 2 +- examples/terraform-gcp-hello-world-example/main.tf | 4 ++-- modules/gcp/compute_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/packer-basic-example/build-gcp.pkr.hcl b/examples/packer-basic-example/build-gcp.pkr.hcl index 59c462969..4d620493a 100644 --- a/examples/packer-basic-example/build-gcp.pkr.hcl +++ b/examples/packer-basic-example/build-gcp.pkr.hcl @@ -21,7 +21,7 @@ source "googlecompute" "ubuntu-bionic" { image_family = "terratest" image_name = "terratest-packer-example-${formatdate("YYYYMMDD-hhmm", timestamp())}" project_id = var.gcp_project_id - source_image_family = "ubuntu-1804-lts" + source_image_family = "ubuntu-2204-lts" ssh_username = "ubuntu" zone = var.gcp_zone } diff --git a/examples/terraform-gcp-hello-world-example/main.tf b/examples/terraform-gcp-hello-world-example/main.tf index cb4cbadbe..80bbe4bcd 100644 --- a/examples/terraform-gcp-hello-world-example/main.tf +++ b/examples/terraform-gcp-hello-world-example/main.tf @@ -15,10 +15,10 @@ resource "google_compute_instance" "example" { machine_type = "f1-micro" zone = "us-east1-b" - # website::tag::2:: Run Ubuntu 18.04 on the instace + # website::tag::2:: Run Ubuntu 22.04 on the instance boot_disk { initialize_params { - image = "ubuntu-os-cloud/ubuntu-1804-lts" + image = "ubuntu-os-cloud/ubuntu-2204-lts" } } diff --git a/modules/gcp/compute_test.go b/modules/gcp/compute_test.go index b94da5198..61bc057ba 100644 --- a/modules/gcp/compute_test.go +++ b/modules/gcp/compute_test.go @@ -20,7 +20,7 @@ import ( const DEFAULT_MACHINE_TYPE = "f1-micro" const DEFAULT_IMAGE_FAMILY_PROJECT_NAME = "ubuntu-os-cloud" -const DEFAULT_IMAGE_FAMILY_NAME = "family/ubuntu-1804-lts" +const DEFAULT_IMAGE_FAMILY_NAME = "family/ubuntu-2204-lts" // Zones that support running f1-micro instances var ZonesThatSupportF1Micro = []string{"us-central1-a", "us-east1-b", "us-west1-a", "europe-north1-a", "europe-west1-b", "europe-central2-a"} From 3e59462ab44f0dd25c77cd5e4c53c2fd41af9327 Mon Sep 17 00:00:00 2001 From: Denis O Date: Tue, 27 Jun 2023 19:35:04 +0000 Subject: [PATCH 2/3] Fix for terraform-aws-rds-example --- examples/terraform-aws-rds-example/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/terraform-aws-rds-example/main.tf b/examples/terraform-aws-rds-example/main.tf index 7fab49131..b493a3e97 100644 --- a/examples/terraform-aws-rds-example/main.tf +++ b/examples/terraform-aws-rds-example/main.tf @@ -109,7 +109,7 @@ resource "aws_db_instance" "example" { engine = var.engine_name engine_version = var.engine_version port = var.port - name = var.database_name + db_name = var.database_name username = var.username password = var.password instance_class = var.instance_class From ed1e06325eed5c68b0c666af9a03580c232244f7 Mon Sep 17 00:00:00 2001 From: Denis O Date: Wed, 28 Jun 2023 20:05:55 +0000 Subject: [PATCH 3/3] Fixed AWS provider to version 4.x --- examples/terraform-aws-rds-example/main.tf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/terraform-aws-rds-example/main.tf b/examples/terraform-aws-rds-example/main.tf index b493a3e97..5e9e20dfe 100644 --- a/examples/terraform-aws-rds-example/main.tf +++ b/examples/terraform-aws-rds-example/main.tf @@ -12,6 +12,13 @@ terraform { # 0.12.26 as the minimum version, as that version added support for required_providers with source URLs, making it # forwards compatible with 0.13.x code. required_version = ">= 0.12.26" + + required_providers { + aws = { + source = "hashicorp/aws" + version = ">= 4.61.0, < 5.0.0" + } + } } # ---------------------------------------------------------------------------------------------------------------------