Skip to content

Commit 895b501

Browse files
authoredJun 14, 2024··
feat(TPG>=5.33)!: add support for setting cloud armor tier of the project (#921)
1 parent 6e5e388 commit 895b501

File tree

8 files changed

+40
-7
lines changed

8 files changed

+40
-7
lines changed
 

‎README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ There are multiple examples included in the [examples](./examples/) folder but s
2929
```hcl
3030
module "project-factory" {
3131
source = "terraform-google-modules/project-factory/google"
32-
version = "~> 15.0"
32+
version = "~> 16.0"
3333
3434
name = "pf-test-1"
3535
random_project_id = true
@@ -132,6 +132,7 @@ determining that location is as follows:
132132
| budget\_display\_name | The display name of the budget. If not set defaults to `Budget For <projects[0]|All Projects>` | `string` | `null` | no |
133133
| budget\_labels | A single label and value pair specifying that usage from only this set of labeled resources should be included in the budget. | `map(string)` | `{}` | no |
134134
| budget\_monitoring\_notification\_channels | A list of monitoring notification channels in the form `[projects/{project_id}/notificationChannels/{channel_id}]`. A maximum of 5 channels are allowed. | `list(string)` | `[]` | no |
135+
| cloud\_armor\_tier | Managed protection tier to be set. Possible values are: CA\_STANDARD, CA\_ENTERPRISE\_PAYGO | `string` | `null` | no |
135136
| consumer\_quotas | The quotas configuration you want to override for the project. | <pre>list(object({<br> service = string,<br> metric = string,<br> dimensions = map(string),<br> limit = string,<br> value = string,<br> }))</pre> | `[]` | no |
136137
| create\_project\_sa | Whether the default service account for the project shall be created | `bool` | `true` | no |
137138
| default\_network\_tier | Default Network Service Tier for resources created in this project. If unset, the value will not be modified. See https://cloud.google.com/network-tiers/docs/using-network-service-tiers and https://cloud.google.com/network-tiers. | `string` | `""` | no |
@@ -199,8 +200,8 @@ determining that location is as follows:
199200
- [gcloud sdk](https://cloud.google.com/sdk/install) >= 269.0.0
200201
- [jq](https://stedolan.github.io/jq/) >= 1.6
201202
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13.0
202-
- [terraform-provider-google] plugin >= 5.22
203-
- [terraform-provider-google-beta] plugin >= 5.22
203+
- [terraform-provider-google] plugin >= 5.33
204+
- [terraform-provider-google-beta] plugin >= 5.33
204205
- [terraform-provider-gsuite] plugin ~> 0.1.x if GSuite functionality is desired
205206

206207
### Permissions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Upgrading to Project Factory v16.0
2+
3+
The v16.0 release of Project Factory is a backwards incompatible release.
4+
5+
### Google Cloud Platform Provider upgrade
6+
7+
The Project Factory module now requires version `5.33` or higher of the Google Cloud Platform Provider and `5.33` or higher of the Google Cloud Platform Beta Provider.

‎main.tf

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ module "project-factory" {
7070
vpc_service_control_sleep_duration = var.vpc_service_control_sleep_duration
7171
default_network_tier = var.default_network_tier
7272
tag_binding_values = var.tag_binding_values
73+
cloud_armor_tier = var.cloud_armor_tier
7374
}
7475

7576
/******************************************

‎modules/core_project_factory/main.tf

+11
Original file line numberDiff line numberDiff line change
@@ -388,3 +388,14 @@ resource "google_tags_tag_binding" "bindings" {
388388
parent = "//cloudresourcemanager.googleapis.com/projects/${google_project.main.number}"
389389
tag_value = "tagValues/${each.value}"
390390
}
391+
392+
/******************************************
393+
Cloud Armor tier of the project
394+
*****************************************/
395+
396+
resource "google_compute_project_cloud_armor_tier" "cloud_armor_tier_config" {
397+
count = var.cloud_armor_tier == null ? 0 : 1
398+
399+
project = var.project_id
400+
cloud_armor_tier = var.cloud_armor_tier
401+
}

‎modules/core_project_factory/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,9 @@ variable "tag_binding_values" {
270270
type = list(string)
271271
default = []
272272
}
273+
274+
variable "cloud_armor_tier" {
275+
description = "Managed protection tier to be set. Possible values are: CA_STANDARD, CA_ENTERPRISE_PAYGO"
276+
type = string
277+
default = null
278+
}

‎modules/core_project_factory/versions.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ terraform {
2020
required_providers {
2121
google = {
2222
source = "hashicorp/google"
23-
version = ">= 5.22, < 6"
23+
version = ">= 5.33, < 6"
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = ">= 5.22, < 6"
27+
version = ">= 5.33, < 6"
2828
}
2929
null = {
3030
source = "hashicorp/null"

‎variables.tf

+7
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,10 @@ variable "tag_binding_values" {
359359
type = list(string)
360360
default = []
361361
}
362+
363+
364+
variable "cloud_armor_tier" {
365+
description = "Managed protection tier to be set. Possible values are: CA_STANDARD, CA_ENTERPRISE_PAYGO"
366+
type = string
367+
default = null
368+
}

‎versions.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ terraform {
1919
required_providers {
2020
google = {
2121
source = "hashicorp/google"
22-
version = ">= 5.22, < 6"
22+
version = ">= 5.33, < 6"
2323
}
2424
google-beta = {
2525
source = "hashicorp/google-beta"
26-
version = ">= 5.22, < 6"
26+
version = ">= 5.33, < 6"
2727
}
2828
}
2929
provider_meta "google" {

0 commit comments

Comments
 (0)
Please sign in to comment.