Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
Terraform v0.14 update (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
robmorgan authored Apr 22, 2021
1 parent ad56d7b commit 7a02a34
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 85 deletions.
7 changes: 4 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ vendor
#VIM swap files
*.swp

.test-data
.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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
12 changes: 9 additions & 3 deletions examples/client-certificate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

# ------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions examples/mysql-private-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

# ------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions examples/mysql-public-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

# ------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions examples/mysql-replicas/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

# ------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions examples/postgres-private-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

# ------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions examples/postgres-public-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

# ------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions examples/postgres-replicas/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

# ------------------------------------------------------------------------------
Expand Down
12 changes: 9 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}

# ------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion modules/cloud-sql/README-MySQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion modules/cloud-sql/README-PostgreSQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion modules/cloud-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


<!-- NOTE: We use absolute linking here instead of relative linking, because the terraform registry does not support
Expand Down
4 changes: 2 additions & 2 deletions modules/cloud-sql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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"
}

Expand Down
14 changes: 7 additions & 7 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@

output "master_instance_name" {
description = "The name of the database instance"
value = "${module.postgres.master_instance_name}"
value = module.postgres.master_instance_name
}

output "master_ip_addresses" {
description = "All IP addresses of the instance as list of maps, see https://www.terraform.io/docs/providers/google/r/sql_database_instance.html#ip_address-0-ip_address"
value = "${module.postgres.master_ip_addresses}"
value = module.postgres.master_ip_addresses
}

output "master_private_ip" {
description = "The private IPv4 address of the master instance"
value = "${module.postgres.master_private_ip_address}"
value = module.postgres.master_private_ip_address
}

output "master_instance" {
description = "Self link to the master instance"
value = "${module.postgres.master_instance}"
value = module.postgres.master_instance
}

output "master_proxy_connection" {
description = "Instance path for connecting with Cloud SQL Proxy. Read more at https://cloud.google.com/sql/docs/mysql/sql-proxy"
value = "${module.postgres.master_proxy_connection}"
value = module.postgres.master_proxy_connection
}

# ------------------------------------------------------------------------------
Expand All @@ -33,10 +33,10 @@ output "master_proxy_connection" {

output "db_name" {
description = "Name of the default database"
value = "${module.postgres.db_name}"
value = module.postgres.db_name
}

output "db" {
description = "Self link to the default database"
value = "${module.postgres.db}"
value = module.postgres.db
}
2 changes: 1 addition & 1 deletion test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20200504171905-7e668d9ad0ba
github.com/go-sql-driver/mysql v1.5.0
github.com/gruntwork-io/terratest v0.30.23
github.com/gruntwork-io/terratest v0.31.3
github.com/lib/pq v1.5.1
github.com/stretchr/testify v1.5.1
)
Loading

0 comments on commit 7a02a34

Please sign in to comment.