From 7a02a34de8a66cdae969b8695e862af1c28a3ea9 Mon Sep 17 00:00:00 2001 From: Rob Morgan Date: Thu, 22 Apr 2021 08:10:13 +0800 Subject: [PATCH] Terraform v0.14 update (#60) --- .circleci/config.yml | 7 ++-- .gitignore | 5 ++- README.md | 2 +- examples/client-certificate/main.tf | 12 +++++-- examples/mysql-private-ip/main.tf | 12 +++++-- examples/mysql-public-ip/main.tf | 12 +++++-- examples/mysql-replicas/main.tf | 12 +++++-- examples/postgres-private-ip/main.tf | 12 +++++-- examples/postgres-public-ip/main.tf | 12 +++++-- examples/postgres-replicas/main.tf | 12 +++++-- main.tf | 12 +++++-- modules/cloud-sql/README-MySQL.md | 2 +- modules/cloud-sql/README-PostgreSQL.md | 2 +- modules/cloud-sql/README.md | 2 +- modules/cloud-sql/main.tf | 4 +-- outputs.tf | 14 ++++---- test/go.mod | 2 +- test/go.sum | 47 +++----------------------- 18 files changed, 98 insertions(+), 85 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8122785..c7fce54 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,11 +7,12 @@ env: &env environment: GRUNTWORK_INSTALLER_VERSION: v0.0.30 TERRATEST_LOG_PARSER_VERSION: v0.30.4 - MODULE_CI_VERSION: v0.29.1 - TERRAFORM_VERSION: 0.13.5 + MODULE_CI_VERSION: v0.33.2 + TERRAFORM_VERSION: 0.14.8 TERRAGRUNT_VERSION: NONE PACKER_VERSION: NONE - GOLANG_VERSION: 1.13.8 + GOLANG_VERSION: 1.16 + GO111MODULE: auto jobs: precommit: diff --git a/.gitignore b/.gitignore index 6d7a06c..9821e30 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,7 @@ vendor #VIM swap files *.swp -.test-data \ No newline at end of file +.test-data +# Ignore Terraform lock files, as we want to test the Terraform code in these repos with the latest provider +# versions. +.terraform.lock.hcl diff --git a/README.md b/README.md index ec9b448..d1607dd 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![Maintained by Gruntwork.io](https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg)](https://gruntwork.io/?ref=repo_google_cloudsql) [![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/gruntwork-io/terraform-google-sql.svg?label=latest)](http://github.com/gruntwork-io/terraform-google-sql/releases/latest) -![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.13.0-blue.svg) +![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.14.0-blue.svg) This repo contains modules for running relational databases such as MySQL and PostgreSQL on [Google Cloud Platform (GCP)](https://cloud.google.com/) using [Cloud SQL](https://cloud.google.com/sql/). diff --git a/examples/client-certificate/main.tf b/examples/client-certificate/main.tf index b4d7f14..7951d67 100644 --- a/examples/client-certificate/main.tf +++ b/examples/client-certificate/main.tf @@ -7,16 +7,22 @@ # ------------------------------------------------------------------------------ provider "google-beta" { - version = "~> 3.57.0" project = var.project region = var.region } terraform { - # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting + # This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting # 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. + # forwards compatible with 0.14.x code. required_version = ">= 0.12.26" + + required_providers { + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.57.0" + } + } } # ------------------------------------------------------------------------------ diff --git a/examples/mysql-private-ip/main.tf b/examples/mysql-private-ip/main.tf index 3d7e9fa..1e1ae9b 100644 --- a/examples/mysql-private-ip/main.tf +++ b/examples/mysql-private-ip/main.tf @@ -7,16 +7,22 @@ # ------------------------------------------------------------------------------ provider "google-beta" { - version = "~> 3.57.0" project = var.project region = var.region } terraform { - # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting + # This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting # 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. + # forwards compatible with 0.14.x code. required_version = ">= 0.12.26" + + required_providers { + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.57.0" + } + } } # ------------------------------------------------------------------------------ diff --git a/examples/mysql-public-ip/main.tf b/examples/mysql-public-ip/main.tf index c584722..164fecc 100644 --- a/examples/mysql-public-ip/main.tf +++ b/examples/mysql-public-ip/main.tf @@ -7,16 +7,22 @@ # ------------------------------------------------------------------------------ provider "google-beta" { - version = "~> 3.57.0" project = var.project region = var.region } terraform { - # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting + # This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting # 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. + # forwards compatible with 0.14.x code. required_version = ">= 0.12.26" + + required_providers { + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.57.0" + } + } } # ------------------------------------------------------------------------------ diff --git a/examples/mysql-replicas/main.tf b/examples/mysql-replicas/main.tf index 677629b..5dc6b7d 100644 --- a/examples/mysql-replicas/main.tf +++ b/examples/mysql-replicas/main.tf @@ -7,16 +7,22 @@ # ------------------------------------------------------------------------------ provider "google-beta" { - version = "~> 3.57.0" project = var.project region = var.region } terraform { - # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting + # This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting # 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. + # forwards compatible with 0.14.x code. required_version = ">= 0.12.26" + + required_providers { + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.57.0" + } + } } # ------------------------------------------------------------------------------ diff --git a/examples/postgres-private-ip/main.tf b/examples/postgres-private-ip/main.tf index b3453bd..af22941 100644 --- a/examples/postgres-private-ip/main.tf +++ b/examples/postgres-private-ip/main.tf @@ -7,16 +7,22 @@ # ------------------------------------------------------------------------------ provider "google-beta" { - version = "~> 3.57.0" project = var.project region = var.region } terraform { - # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting + # This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting # 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. + # forwards compatible with 0.14.x code. required_version = ">= 0.12.26" + + required_providers { + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.57.0" + } + } } # ------------------------------------------------------------------------------ diff --git a/examples/postgres-public-ip/main.tf b/examples/postgres-public-ip/main.tf index f31dab0..d9ecc37 100644 --- a/examples/postgres-public-ip/main.tf +++ b/examples/postgres-public-ip/main.tf @@ -7,16 +7,22 @@ # ------------------------------------------------------------------------------ provider "google-beta" { - version = "~> 3.57.0" project = var.project region = var.region } terraform { - # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting + # This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting # 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. + # forwards compatible with 0.14.x code. required_version = ">= 0.12.26" + + required_providers { + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.57.0" + } + } } # ------------------------------------------------------------------------------ diff --git a/examples/postgres-replicas/main.tf b/examples/postgres-replicas/main.tf index f0c3714..6ef5113 100644 --- a/examples/postgres-replicas/main.tf +++ b/examples/postgres-replicas/main.tf @@ -7,16 +7,22 @@ # ------------------------------------------------------------------------------ provider "google-beta" { - version = "~> 3.57.0" project = var.project region = var.region } terraform { - # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting + # This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting # 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. + # forwards compatible with 0.14.x code. required_version = ">= 0.12.26" + + required_providers { + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.57.0" + } + } } # ------------------------------------------------------------------------------ diff --git a/main.tf b/main.tf index 73f6112..6c80f0b 100644 --- a/main.tf +++ b/main.tf @@ -7,16 +7,22 @@ # ------------------------------------------------------------------------------ provider "google-beta" { - version = "~> 3.57.0" project = var.project region = var.region } terraform { - # This module is now only being tested with Terraform 0.13.x. However, to make upgrading easier, we are setting + # This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting # 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. + # forwards compatible with 0.14.x code. required_version = ">= 0.12.26" + + required_providers { + google-beta = { + source = "hashicorp/google-beta" + version = "~> 3.57.0" + } + } } # ------------------------------------------------------------------------------ diff --git a/modules/cloud-sql/README-MySQL.md b/modules/cloud-sql/README-MySQL.md index b95da04..b088533 100644 --- a/modules/cloud-sql/README-MySQL.md +++ b/modules/cloud-sql/README-MySQL.md @@ -12,7 +12,7 @@ # MySQL [![Maintained by Gruntwork.io](https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg)](https://gruntwork.io/?ref=repo_google_cloudsql) [![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/gruntwork-io/terraform-google-sql.svg?label=latest)](http://github.com/gruntwork-io/terraform-google-sql/releases/latest) -![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.12.0-blue.svg) +![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.14.0-blue.svg) This module deploys MySQL on top of Google's Cloud SQL Service. The cluster is managed by GCP and automatically handles standby failover, read replicas, backups, patching, and encryption. diff --git a/modules/cloud-sql/README-PostgreSQL.md b/modules/cloud-sql/README-PostgreSQL.md index de26d8c..a3388b3 100644 --- a/modules/cloud-sql/README-PostgreSQL.md +++ b/modules/cloud-sql/README-PostgreSQL.md @@ -12,7 +12,7 @@ # PostgreSQL [![Maintained by Gruntwork.io](https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg)](https://gruntwork.io/?ref=repo_google_cloudsql) [![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/gruntwork-io/terraform-google-sql.svg?label=latest)](http://github.com/gruntwork-io/terraform-google-sql/releases/latest) -![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.12.0-blue.svg) +![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.14.0-blue.svg) This module deploys PostgreSQL on top of Google's Cloud SQL Service. The cluster is managed by GCP and automatically handles standby failover, read replicas, backups, patching, and encryption. diff --git a/modules/cloud-sql/README.md b/modules/cloud-sql/README.md index 7f4d4e4..dca0094 100644 --- a/modules/cloud-sql/README.md +++ b/modules/cloud-sql/README.md @@ -2,7 +2,7 @@ [![Maintained by Gruntwork.io](https://img.shields.io/badge/maintained%20by-gruntwork.io-%235849a6.svg)](https://gruntwork.io/?ref=repo_google_cloudsql) [![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/gruntwork-io/terraform-google-sql.svg?label=latest)](http://github.com/gruntwork-io/terraform-google-sql/releases/latest) -![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.12.0-blue.svg) +![Terraform Version](https://img.shields.io/badge/tf-%3E%3D0.14.0-blue.svg)