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

Commit

Permalink
Update to Terraform 1.x (#68)
Browse files Browse the repository at this point in the history
* Bump tf to version 1.0
* Bump terraform-aws-ci
* Mark private key output as sensitive
* remove deprecated list() function
  • Loading branch information
bwhaley authored Aug 23, 2021
1 parent 6128b76 commit 5134a7b
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ env: &env
environment:
GRUNTWORK_INSTALLER_VERSION: v0.0.30
TERRATEST_LOG_PARSER_VERSION: v0.30.4
MODULE_CI_VERSION: v0.33.2
TERRAFORM_VERSION: 0.14.8
MODULE_CI_VERSION: v0.38.4
TERRAFORM_VERSION: 1.0.3
TERRAGRUNT_VERSION: NONE
PACKER_VERSION: NONE
GOLANG_VERSION: 1.16
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
command: |
pip install pre-commit==1.21.0 cfgv==2.0.1 zipp==1.1.0 yapf
go get golang.org/x/tools/cmd/goimports
export GOPATH=~/go/bin && export PATH=$PATH:$GOPATH
export GOPATH=~/go/bin && export PATH=$PATH:$GOPATH
pre-commit install
pre-commit run --all-files
Expand Down
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.14.0-blue.svg)
![Terraform Version](https://img.shields.io/badge/tf-%3E%3D1.0.x-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
4 changes: 2 additions & 2 deletions examples/client-certificate/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "google-beta" {
}

terraform {
# This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"

required_providers {
Expand Down
1 change: 1 addition & 0 deletions examples/client-certificate/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ output "client_ca_cert" {
output "client_private_key" {
description = "Private key associated with the client certificate."
value = google_sql_ssl_cert.client_cert.private_key
sensitive = true
}
4 changes: 2 additions & 2 deletions examples/mysql-private-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "google-beta" {
}

terraform {
# This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"

required_providers {
Expand Down
4 changes: 2 additions & 2 deletions examples/mysql-public-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "google-beta" {
}

terraform {
# This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"

required_providers {
Expand Down
4 changes: 2 additions & 2 deletions examples/mysql-replicas/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "google-beta" {
}

terraform {
# This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"

required_providers {
Expand Down
4 changes: 2 additions & 2 deletions examples/postgres-private-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "google-beta" {
}

terraform {
# This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"

required_providers {
Expand Down
4 changes: 2 additions & 2 deletions examples/postgres-public-ip/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "google-beta" {
}

terraform {
# This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"

required_providers {
Expand Down
4 changes: 2 additions & 2 deletions examples/postgres-replicas/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "google-beta" {
}

terraform {
# This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"

required_providers {
Expand Down
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ provider "google-beta" {
}

terraform {
# This module is now only being tested with Terraform 0.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"

required_providers {
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.14.0-blue.svg)
![Terraform Version](https://img.shields.io/badge/tf-%3E%3D1.0.x-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.14.0-blue.svg)
![Terraform Version](https://img.shields.io/badge/tf-%3E%3D1.0.x-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.14.0-blue.svg)
![Terraform Version](https://img.shields.io/badge/tf-%3E%3D1.0.x-blue.svg)


<!-- NOTE: We use absolute linking here instead of relative linking, because the terraform registry does not support
Expand Down
8 changes: 4 additions & 4 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.14.x. However, to make upgrading easier, we are setting
# This module is now only being tested with Terraform 1.0.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.14.x code.
# forwards compatible with 1.0.x code.
required_version = ">= 0.12.26"
}

Expand Down Expand Up @@ -68,7 +68,7 @@ resource "google_sql_database_instance" "master" {
}

dynamic "location_preference" {
for_each = var.master_zone == null ? [] : list(var.master_zone)
for_each = var.master_zone == null ? [] : [var.master_zone]

content {
zone = location_preference.value
Expand Down Expand Up @@ -205,7 +205,7 @@ resource "google_sql_database_instance" "failover_replica" {
}

dynamic "location_preference" {
for_each = var.mysql_failover_replica_zone == null ? [] : list(var.mysql_failover_replica_zone)
for_each = var.mysql_failover_replica_zone == null ? [] : [var.mysql_failover_replica_zone]

content {
zone = location_preference.value
Expand Down
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.36.3
github.com/gruntwork-io/terratest v0.37.5
github.com/lib/pq v1.5.1
github.com/stretchr/testify v1.5.1
)
13 changes: 9 additions & 4 deletions test/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,23 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/gruntwork-io/go-commons v0.8.0 h1:k/yypwrPqSeYHevLlEDmvmgQzcyTwrlZGRaxEM6G0ro=
github.com/gruntwork-io/go-commons v0.8.0/go.mod h1:gtp0yTtIBExIZp7vyIV9I0XQkVwiQZze678hvDXof78=
github.com/gruntwork-io/terratest v0.36.3 h1:R/wCo6RSPJMQBt573XQy07Ylp7J7BX3SgCB+bi06QfU=
github.com/gruntwork-io/terratest v0.36.3/go.mod h1:GIVJGBV1WIv1vxIG31Ycy0CuHYfXuvvkilNQuC9Wi+o=
github.com/gruntwork-io/terratest v0.37.5 h1:W93EhxcxDApa5Xyj/TOpDXx+i5IssTopy5LbEUJkPuA=
github.com/gruntwork-io/terratest v0.37.5/go.mod h1:CSHpZNJdqYQ+TUrigM100jcahRUV5X6w7K2kZJ8iylY=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI=
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw=
github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hashicorp/hcl/v2 v2.8.2 h1:wmFle3D1vu0okesm8BTLVDyJ6/OL9DCLUwn0b2OptiY=
github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY=
github.com/hashicorp/terraform-json v0.9.0 h1:WE7+Wt93W93feOiCligElSyS0tlDzwZUtJuDGIBr8zg=
github.com/hashicorp/terraform-json v0.9.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE=
github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw=
github.com/hashicorp/terraform-json v0.12.0/go.mod h1:pmbq9o4EuL43db5+0ogX10Yofv1nozM+wskr/bGFJpI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
Expand Down Expand Up @@ -339,11 +341,13 @@ github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326/go.mod h1:9fxibJc
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY=
github.com/miekg/dns v1.1.31/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down Expand Up @@ -399,6 +403,7 @@ github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U=
github.com/sebdah/goldie v1.0.0/go.mod h1:jXP4hmWywNEwZzhMuv2ccnqTSFpuq8iyQhtQdkkZBH4=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
Expand Down

0 comments on commit 5134a7b

Please sign in to comment.