Skip to content

Commit b4ae113

Browse files
authored
feat(deps)!: Update Terraform Google Provider to v6 (#320)
1 parent 01135a7 commit b4ae113

File tree

52 files changed

+215
-78
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+215
-78
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ For the cloudbuild submodule, see the README [cloudbuild](./modules/cloudbuild).
6363
| org\_id | GCP Organization ID | `string` | n/a | yes |
6464
| org\_project\_creators | Additional list of members to have project creator role accross the organization. Prefix of group: user: or serviceAccount: is required. | `list(string)` | `[]` | no |
6565
| parent\_folder | GCP parent folder ID in the form folders/{id} | `string` | `""` | no |
66+
| project\_deletion\_policy | The deletion policy for the project created. | `string` | `"PREVENT"` | no |
6667
| project\_id | Custom project ID to use for project created. If not supplied, the default id is {project\_prefix}-seed-{random suffix}. | `string` | `""` | no |
6768
| project\_labels | Labels to apply to the project. | `map(string)` | `{}` | no |
6869
| project\_prefix | Name prefix to use for projects created. | `string` | `"cft"` | no |

build/int.cloudbuild.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
timeout: 4200s
15+
timeout: 5400s
1616
steps:
1717
- id: swap-module-refs
1818
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'

docs/upgrading_to_v9.0.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,43 @@ The endpoint that is used to trigger a build was replaced with a new one that al
4040
```
4141
# module.cloudbuilder.google_workflows_workflow.builder will be updated in-place
4242
```
43+
44+
## Google Cloud Provider Project deletion_policy
45+
46+
The `deletion_policy` for [project-factory](https://github.com/terraform-google-modules/terraform-google-project-factory) module now defaults to `"PREVENT"` rather than `"DELETE"`.
47+
This aligns with the behavior in Google Cloud Platform Provider v6+.
48+
To maintain the old behavior in the projects created within the modules you can set the new variable `project_deletion_policy = "DELETE"`.
49+
50+
### Bootstrap main module
51+
52+
```diff
53+
module "bootstrap" {
54+
source = "terraform-google-modules/bootstrap/google"
55+
- version = "~> 8.0"
56+
+ version = "~> 9.0"
57+
58+
+ project_deletion_policy = "DELETE"
59+
```
60+
61+
### Cloud Build sub module
62+
63+
```diff
64+
module "cloudbuild" {
65+
source = "terraform-google-modules/bootstrap/google//modules/cloudbuild"
66+
- version = "~> 8.0"
67+
+ version = "~> 9.0"
68+
69+
+ project_deletion_policy = "DELETE"
70+
```
71+
72+
73+
### Cloud Build Source sub module
74+
75+
```diff
76+
module "tf_cloudbuild_source" {
77+
source = "terraform-google-modules/bootstrap/google//modules/tf_cloudbuild_source"
78+
- version = "~> 8.0"
79+
+ version = "~> 9.0"
80+
81+
+ project_deletion_policy = "DELETE"
82+
```

examples/cloudbuild_enabled/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This example combines the Organization bootstrap module with the Cloud Build sub
1414
| group\_org\_admins | Google Group for GCP Organization Administrators | `string` | n/a | yes |
1515
| org\_id | GCP Organization ID | `string` | n/a | yes |
1616
| org\_project\_creators | Additional list of members to have project creator role accross the organization. Prefix of group: user: or serviceAccount: is required. | `list(string)` | `[]` | no |
17+
| project\_deletion\_policy | The deletion policy for the project created. | `string` | `"PREVENT"` | no |
1718
| project\_prefix | Name prefix to use for projects created. | `string` | `"cft"` | no |
1819

1920
## Outputs

examples/cloudbuild_enabled/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ module "seed_bootstrap" {
3131
sa_enable_impersonation = true
3232
project_prefix = var.project_prefix
3333
force_destroy = var.force_destroy
34+
project_deletion_policy = var.project_deletion_policy
3435
}
3536

3637
module "cloudbuild_bootstrap" {
@@ -47,4 +48,5 @@ module "cloudbuild_bootstrap" {
4748
terraform_state_bucket = module.seed_bootstrap.gcs_bucket_tfstate
4849
project_prefix = var.project_prefix
4950
force_destroy = var.force_destroy
51+
project_deletion_policy = var.project_deletion_policy
5052
}

examples/cloudbuild_enabled/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ variable "force_destroy" {
5757
type = bool
5858
default = false
5959
}
60+
61+
variable "project_deletion_policy" {
62+
description = "The deletion policy for the project created."
63+
type = string
64+
default = "PREVENT"
65+
}

examples/cloudbuild_repo_connection_github/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
module "github_connection" {
18-
source = "terraform-google-modules/bootstrap/google//modules/cloudbuild_repo_connection"
18+
source = "terraform-google-modules/bootstrap/google//modules/cloudbuild_repo_connection"
1919
version = "~> 9.0"
2020

2121
project_id = var.project_id

examples/im_cloudbuild_workspace_github/apis.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "enabled_google_apis" {
1818
source = "terraform-google-modules/project-factory/google//modules/project_services"
19-
version = "~> 15.0"
19+
version = "~> 17.0"
2020

2121
project_id = var.project_id
2222
disable_services_on_destroy = false

examples/im_cloudbuild_workspace_gitlab/apis.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "enabled_google_apis" {
1818
source = "terraform-google-modules/project-factory/google//modules/project_services"
19-
version = "~> 15.0"
19+
version = "~> 17.0"
2020

2121
project_id = var.project_id
2222
disable_services_on_destroy = false

examples/simple-folder/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This example demonstrates the simplest usage of the GCP organization bootstrap m
1414
| org\_id | GCP Organization ID | `string` | n/a | yes |
1515
| org\_project\_creators | Additional list of members to have project creator role accross the organization. Prefix of group: user: or serviceAccount: is required. | `list(string)` | `[]` | no |
1616
| parent | GCP parent folder id of form folders/{id} | `string` | n/a | yes |
17+
| project\_deletion\_policy | The deletion policy for the project created. | `string` | `"PREVENT"` | no |
1718
| project\_prefix | Name prefix to use for projects created. | `string` | `"cft"` | no |
1819

1920
## Outputs

0 commit comments

Comments
 (0)