Skip to content

Commit

Permalink
feat(TPG>=6.1)!: add support for IAM groups (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
imrannayer authored Oct 28, 2024
1 parent 171c492 commit 744870a
Show file tree
Hide file tree
Showing 64 changed files with 267 additions and 130 deletions.
2 changes: 1 addition & 1 deletion build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,5 @@ tags:
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.20'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.22'
_API_ACTIVATION_SECONDS_WAIT: '300'
2 changes: 1 addition & 1 deletion build/lint.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ tags:
- 'lint'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.20'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.22'
6 changes: 5 additions & 1 deletion docs/upgrading_to_sql_db_23.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

The 23.0 release of SQL DB is a backward incompatible release.

# Cloud SQL Service Account role update
# Cloud SQL Service Account role update in backup module

Changed `storage.objectCreator` role to `storage.objectAdmin` for Cloud SQL Service Account on the bucket used for exporting the database, due to GCP internal changes in the export process.

# Minimum provider version
Minimum provider version for `mysql`, `safer_mysql` and `postgresql sub-module` is `6.1`

6 changes: 3 additions & 3 deletions examples/mssql-failover-replica/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,7 +24,7 @@ locals {

module "mssql1" {
source = "terraform-google-modules/sql-db/google//modules/mssql"
version = "~> 22.0"
version = "~> 23.0"

region = local.region_1

Expand Down Expand Up @@ -56,7 +56,7 @@ module "mssql1" {

module "mssql2" {
source = "terraform-google-modules/sql-db/google//modules/mssql"
version = "~> 22.0"
version = "~> 23.0"

master_instance_name = module.mssql1.instance_name

Expand Down
2 changes: 1 addition & 1 deletion examples/mssql-failover-replica/network.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/mssql-failover-replica/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/mssql-failover-replica/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions examples/mssql-public/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

module "mssql" {
source = "terraform-google-modules/sql-db/google//modules/mssql"
version = "~> 22.0"
version = "~> 23.0"

name = var.name
random_instance_name = true
Expand Down
2 changes: 1 addition & 1 deletion examples/mssql-public/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/mssql-public/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions examples/mysql-backup-create-service-account/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

module "mysql" {
source = "terraform-google-modules/sql-db/google//modules/mysql"
version = "~> 22.0"
version = "~> 23.0"

name = "example-mysql-public"
database_version = "MYSQL_8_0"
Expand Down Expand Up @@ -45,7 +45,7 @@ resource "google_storage_bucket" "backup" {

module "backup" {
source = "terraform-google-modules/sql-db/google//modules/backup"
version = "~> 22.0"
version = "~> 23.0"

region = "us-central1"
project_id = var.project_id
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-backup-create-service-account/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-backup-create-service-account/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions examples/mysql-ha/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,7 +33,7 @@ locals {

module "mysql" {
source = "terraform-google-modules/sql-db/google//modules/mysql"
version = "~> 22.0"
version = "~> 23.0"

name = var.mysql_ha_name
random_instance_name = true
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-ha/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-ha/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
12 changes: 9 additions & 3 deletions examples/mysql-private/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,7 +39,7 @@ module "network-safer-mysql-simple" {

module "private-service-access" {
source = "terraform-google-modules/sql-db/google//modules/private_service_access"
version = "~> 22.0"
version = "~> 23.0"

project_id = var.project_id
vpc_network = module.network-safer-mysql-simple.network_name
Expand All @@ -48,7 +48,8 @@ module "private-service-access" {

module "safer-mysql-db" {
source = "terraform-google-modules/sql-db/google//modules/safer_mysql"
version = "~> 22.0"
version = "~> 23.0"


name = var.db_name
random_instance_name = true
Expand Down Expand Up @@ -96,6 +97,11 @@ module "safer-mysql-db" {
{
id = "dbadmin",
email = "dbadmin@develop.blueprints.joonix.net"
},
{
id = "subtest",
email = "subtest@develop.blueprints.joonix.net"
type = "CLOUD_IAM_GROUP"
}
]

Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-private/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-private/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions examples/mysql-psc/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,7 @@ locals {

module "mysql" {
source = "terraform-google-modules/sql-db/google//modules/mysql"
version = "~> 22.0"
version = "~> 23.0"

name = var.mysql_ha_name
random_instance_name = true
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-psc/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-psc/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions examples/mysql-public/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@ resource "random_id" "name" {

module "mysql-db" {
source = "terraform-google-modules/sql-db/google//modules/mysql"
version = "~> 22.0"
version = "~> 23.0"

name = var.db_name
random_instance_name = true
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-public/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/mysql-public/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions examples/postgresql-backup-provided-service-account/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

module "postgresql" {
source = "terraform-google-modules/sql-db/google//modules/postgresql"
version = "~> 22.0"
version = "~> 23.0"

name = "example-postgres"
random_instance_name = true
Expand Down Expand Up @@ -56,7 +56,7 @@ resource "google_monitoring_notification_channel" "email" {

module "backup" {
source = "terraform-google-modules/sql-db/google//modules/backup"
version = "~> 22.0"
version = "~> 23.0"

region = "us-central1"
project_id = var.project_id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions examples/postgresql-ha/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,7 @@ locals {

module "pg" {
source = "terraform-google-modules/sql-db/google//modules/postgresql"
version = "~> 22.0"
version = "~> 23.0"

name = var.pg_ha_name
random_instance_name = true
Expand Down
2 changes: 1 addition & 1 deletion examples/postgresql-ha/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/postgresql-ha/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions examples/postgresql-psc/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,7 @@ locals {

module "pg" {
source = "terraform-google-modules/sql-db/google//modules/postgresql"
version = "~> 22.0"
version = "~> 23.0"

name = var.pg_psc_name
random_instance_name = true
Expand Down
2 changes: 1 addition & 1 deletion examples/postgresql-psc/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion examples/postgresql-psc/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2019 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading

0 comments on commit 744870a

Please sign in to comment.