Skip to content

Commit e4c9b03

Browse files
authored
fix: remove unused vars, add upgrade guide (#596)
BREAKING CHANGE: Some unused variables were removed. See the upgrade guide for details. BREAKING CHANGE: Buckets now enable uniform bucket-level access by default. See the upgrade guide for details.
1 parent 64461a2 commit e4c9b03

File tree

24 files changed

+41
-121
lines changed

24 files changed

+41
-121
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ determining that location is as follows:
126126
| 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 |
127127
| consumer\_quotas | The quotas configuration you want to override for the project. | <pre>list(object({<br> service = string,<br> metric = string,<br> limit = string,<br> value = string,<br> }))</pre> | `[]` | no |
128128
| create\_project\_sa | Whether the default service account for the project shall be created | `bool` | `true` | no |
129-
| credentials\_path | Path to a service account credentials file with rights to run the Project Factory. If this file is absent Terraform will fall back to Application Default Credentials. | `string` | `""` | no |
130129
| default\_service\_account | Project default service account setting: can be one of `delete`, `deprivilege`, `disable`, or `keep`. | `string` | `"disable"` | no |
131130
| disable\_dependent\_services | Whether services that are enabled and which depend on this service should also be disabled when this service is destroyed. | `bool` | `true` | no |
132131
| disable\_services\_on\_destroy | Whether project services will be disabled when the resources are destroyed | `bool` | `true` | no |
@@ -136,7 +135,6 @@ determining that location is as follows:
136135
| grant\_services\_security\_admin\_role | Whether or not to grant Kubernetes Engine Service Agent the Security Admin role on the host project so it can manage firewall rules | `bool` | `false` | no |
137136
| group\_name | A group to control the project by being assigned group\_role (defaults to project editor) | `string` | `""` | no |
138137
| group\_role | The role to give the controlling group (group\_name) over the project (defaults to project editor) | `string` | `"roles/editor"` | no |
139-
| impersonate\_service\_account | An optional service account to impersonate. This cannot be used with credentials\_path. If this service account is not specified and credentials\_path is absent, the module will use Application Default Credentials. | `string` | `""` | no |
140138
| labels | Map of labels for project | `map(string)` | `{}` | no |
141139
| lien | Add a lien on the project to prevent accidental deletion | `bool` | `false` | no |
142140
| name | The name for the project | `string` | n/a | yes |
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Upgrading to Project Factory v11.0
2+
3+
The v11.0 release of Project Factory is a backwards incompatible release.
4+
5+
## Migration Instructions
6+
7+
### Unused variables have been removed
8+
9+
Variables `credentials_path` and `impersonate_service_account` have been removed as we have removed the need for gcloud and local-execs in [v10.0](https://github.com/terraform-google-modules/terraform-google-project-factory/blob/master/docs/upgrading_to_project_factory_v10.0.md). This change should be no-op.
10+
11+
```diff
12+
module "project-factory" {
13+
source = "terraform-google-modules/project-factory/google"
14+
- version = "~> 10.0"
15+
+ version = "~> 11.0"
16+
17+
name = "pf-test-1"
18+
random_project_id = "true"
19+
org_id = "1234567890"
20+
usage_bucket_name = "pf-test-1-usage-report-bucket"
21+
usage_bucket_prefix = "pf/test/1/integration"
22+
billing_account = "ABCDEF-ABCDEF-ABCDEF"
23+
- credentials_path = "..."
24+
- impersonate_service_account = "..."
25+
}
26+
```
27+
28+
### Uniform Bucket Level Access is enabled by default
29+
30+
Uniform Bucket Level Access is enabled by default and controlled by the `bucket_ula` variable.
31+
32+
If you want to keep Uniform Bucket Level Access disabled, this variable should be set to false.

examples/gke_shared_vpc/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ More information about GKE with Shared VPC can be found here: https://cloud.goog
2929
| Name | Description | Type | Default | Required |
3030
|------|-------------|------|---------|:--------:|
3131
| billing\_account | billing account | `any` | n/a | yes |
32-
| credentials\_path | Path to a Service Account credentials file with permissions documented in the readme | `any` | n/a | yes |
3332
| org\_id | organization id | `any` | n/a | yes |
3433
| shared\_vpc | The ID of the host project which hosts the shared VPC | `any` | n/a | yes |
3534
| shared\_vpc\_subnets | List of subnets fully qualified subnet IDs (ie. projects/$PROJECT\_ID/regions/$REGION/subnetworks/$SUBNET\_ID) | `list(string)` | `[]` | no |

examples/gke_shared_vpc/main.tf

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
locals {
18-
credentials_file_path = var.credentials_path
19-
}
20-
2117
provider "google" {
22-
credentials = file(local.credentials_file_path)
23-
version = "~> 3.30"
18+
version = "~> 3.30"
2419
}
2520

2621
provider "google-beta" {
27-
credentials = file(local.credentials_file_path)
28-
version = "~> 3.30"
22+
version = "~> 3.30"
2923
}
3024

3125
provider "null" {
@@ -44,6 +38,5 @@ module "project-factory" {
4438
billing_account = var.billing_account
4539
svpc_host_project_id = var.shared_vpc
4640
activate_apis = ["compute.googleapis.com", "container.googleapis.com", "cloudbilling.googleapis.com"]
47-
credentials_path = local.credentials_file_path
4841
shared_vpc_subnets = var.shared_vpc_subnets
4942
}

examples/gke_shared_vpc/variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "credentials_path" {
18-
description = "Path to a Service Account credentials file with permissions documented in the readme"
19-
}
20-
2117
variable "org_id" {
2218
description = "organization id"
2319
}

examples/group_project/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Expected variables:
2222
| admin\_email | Admin user email on Gsuite. This should be a user account, not a service account. | `any` | n/a | yes |
2323
| api\_sa\_group | An existing G Suite group email to place the Google APIs Service Account for the project in | `any` | n/a | yes |
2424
| billing\_account | The ID of the billing account to associate this project with | `any` | n/a | yes |
25-
| credentials\_file\_path | Service account json auth path | `any` | n/a | yes |
2625
| organization\_id | The organization id for the associated services | `any` | n/a | yes |
2726
| project\_group\_name | The name of a G Suite group to create for controlling the project | `any` | n/a | yes |
2827

examples/group_project/main.tf

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17-
locals {
18-
credentials_file_path = var.credentials_file_path
19-
}
20-
2117
/******************************************
2218
Provider configuration
2319
*****************************************/
2420
provider "google" {
25-
credentials = file(local.credentials_file_path)
26-
version = "~> 3.30"
21+
version = "~> 3.30"
2722
}
2823

2924
provider "google-beta" {
30-
credentials = file(local.credentials_file_path)
31-
version = "~> 3.30"
25+
version = "~> 3.30"
3226
}
3327

3428
provider "gsuite" {
35-
credentials = file(local.credentials_file_path)
3629
impersonated_user_email = var.admin_email
3730

3831
oauth_scopes = [
@@ -57,7 +50,6 @@ module "project-factory" {
5750
name = "group-sample-project"
5851
org_id = var.organization_id
5952
billing_account = var.billing_account
60-
credentials_path = local.credentials_file_path
6153
create_group = true
6254
group_name = var.project_group_name
6355
api_sa_group = var.api_sa_group

examples/group_project/variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ variable "admin_email" {
1818
description = "Admin user email on Gsuite. This should be a user account, not a service account."
1919
}
2020

21-
variable "credentials_file_path" {
22-
description = "Service account json auth path"
23-
}
24-
2521
variable "organization_id" {
2622
description = "The organization id for the associated services"
2723
}

examples/project-hierarchy/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Expected variables:
2727
|------|-------------|------|---------|:--------:|
2828
| admin\_email | Admin user email on Gsuite | `any` | n/a | yes |
2929
| billing\_account | The ID of the billing account to associate this project with | `any` | n/a | yes |
30-
| credentials\_path | Path to a service account credentials file with rights to run the Project Factory. If this file is absent Terraform will fall back to Application Default Credentials. | `string` | `""` | no |
3130
| organization\_id | The organization id for the associated services | `any` | n/a | yes |
3231

3332
## Outputs

examples/project-hierarchy/main.tf

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,18 @@
1414
* limitations under the License.
1515
*/
1616

17-
locals {
18-
credentials_file_path = var.credentials_path
19-
}
20-
2117
/******************************************
2218
Provider configuration
2319
*****************************************/
2420
provider "google" {
25-
credentials = file(local.credentials_file_path)
26-
version = "~> 3.30"
21+
version = "~> 3.30"
2722
}
2823

2924
provider "google-beta" {
30-
credentials = file(local.credentials_file_path)
31-
version = "~> 3.30"
25+
version = "~> 3.30"
3226
}
3327

3428
provider "gsuite" {
35-
credentials = file(local.credentials_file_path)
3629
impersonated_user_email = var.admin_email
3730

3831
oauth_scopes = [
@@ -63,7 +56,6 @@ module "project-prod-gke" {
6356
org_id = var.organization_id
6457
billing_account = var.billing_account
6558
folder_id = google_folder.prod.id
66-
credentials_path = local.credentials_file_path
6759
}
6860

6961
module "project-factory" {
@@ -73,5 +65,4 @@ module "project-factory" {
7365
org_id = var.organization_id
7466
billing_account = var.billing_account
7567
folder_id = google_folder.prod.id
76-
credentials_path = local.credentials_file_path
7768
}

0 commit comments

Comments
 (0)