Skip to content

Commit 4bb7b4a

Browse files
authored
fix(TF>=1.3)!: update terraform & metadata (#156)
1 parent a4ca9fe commit 4bb7b4a

File tree

11 files changed

+474
-437
lines changed

11 files changed

+474
-437
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This Terraform module makes it easier to manage [organization policies](https://cloud.google.com/resource-manager/docs/organization-policy/overview) for your Google Cloud environment, particularly when you want to have exclusion rules. This module will allow you to set a top-level org policy and then disable it on individual projects or folders easily.
44

55
## Compatibility
6-
This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+. If you find incompatibilities using Terraform >=0.13, please open an issue.
6+
This module is meant for use with Terraform 1.3+ and tested using Terraform 1.10+. If you find incompatibilities using Terraform >=1.3, please open an issue.
77
If you haven't
88
[upgraded](https://www.terraform.io/upgrade-guides/0-13.html) and need a Terraform
99
0.12.x-compatible version of this module, the last released version
@@ -79,20 +79,20 @@ No outputs.
7979

8080
## Requirements
8181
### Terraform plugins
82-
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13.0
83-
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) >= v2.5.0
82+
- [Terraform](https://www.terraform.io/downloads.html) >= 1.3
83+
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) >= v3.53
8484

8585
### Permissions
8686
In order to execute this module, the Service Account you run as must have the **Organization Policy Administrator** (`roles/orgpolicy.PolicyAdmin`) role.
8787

8888
## Install
8989
### Terraform
90-
Be sure you have the correct Terraform version (0.12.x), you can choose the binary here:
90+
Be sure you have the correct Terraform version (>= 1.3.x), you can choose the binary here:
9191
- https://releases.hashicorp.com/terraform/
9292

9393
### Terraform plugins
9494

95-
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) >= v2.5.0
95+
- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) >= v3.53
9696

9797

9898
### Fast install (optional)

metadata.yaml

Lines changed: 105 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Google LLC
1+
# Copyright 2022-2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -19,109 +19,108 @@ metadata:
1919
annotations:
2020
config.kubernetes.io/local-config: "true"
2121
spec:
22-
title: Google Cloud Organization Policy Terraform Module
23-
source:
24-
repo: https://github.com/terraform-google-modules/terraform-google-org-policy.git
25-
sourceType: git
26-
version: 5.4.0
27-
actuationTool:
28-
type: Terraform
29-
version: '>= 0.13'
30-
subBlueprints:
31-
- name: bucket_policy_only
32-
location: modules/bucket_policy_only
33-
- name: domain_restricted_sharing
34-
location: modules/domain_restricted_sharing
35-
- name: org_policy_v2
36-
location: modules/org_policy_v2
37-
- name: restrict_vm_external_ips
38-
location: modules/restrict_vm_external_ips
39-
- name: skip_default_network
40-
location: modules/skip_default_network
41-
examples:
42-
- name: basic_org_policies
43-
location: examples/basic_org_policies
44-
- name: boolean_org_exclude
45-
location: examples/boolean_org_exclude
46-
- name: boolean_project_allow
47-
location: examples/boolean_project_allow
48-
- name: list_folder_deny
49-
location: examples/list_folder_deny
50-
- name: list_org_exclude
51-
location: examples/list_org_exclude
52-
- name: v2_boolean_org_enforce
53-
location: examples/v2_boolean_org_enforce
54-
variables:
55-
- name: allow
56-
description: (Only for list constraints) List of values which should be allowed
57-
type: list(string)
58-
default:
59-
- ""
60-
required: false
61-
- name: allow_list_length
62-
description: The number of elements in the allow list
63-
type: number
64-
default: 0
65-
required: false
66-
- name: constraint
67-
description: The constraint to be applied
68-
type: string
69-
required: true
70-
- name: deny
71-
description: (Only for list constraints) List of values which should be denied
72-
type: list(string)
73-
default:
74-
- ""
75-
required: false
76-
- name: deny_list_length
77-
description: The number of elements in the deny list
78-
type: number
79-
default: 0
80-
required: false
81-
- name: enforce
82-
description: If boolean constraint, whether the policy is enforced at the root; if list constraint, whether to deny all (true) or allow all
83-
type: bool
84-
required: false
85-
- name: exclude_folders
86-
description: Set of folders to exclude from the policy
87-
type: set(string)
88-
default: []
89-
required: false
90-
- name: exclude_projects
91-
description: Set of projects to exclude from the policy
92-
type: set(string)
93-
default: []
94-
required: false
95-
- name: folder_id
96-
description: The folder id for putting the policy
97-
type: string
98-
required: false
99-
- name: organization_id
100-
description: The organization id for putting the policy
101-
type: string
102-
required: false
103-
- name: policy_for
104-
description: 'Resource hierarchy node to apply the policy to: can be one of `organization`, `folder`, or `project`.'
105-
type: string
106-
required: true
107-
- name: policy_type
108-
description: The constraint type to work with (either 'boolean' or 'list')
109-
type: string
110-
default: list
111-
required: false
112-
- name: project_id
113-
description: The project id for putting the policy
114-
type: string
115-
required: false
116-
roles:
117-
- level: Project
22+
info:
23+
title: Google Cloud Organization Policy Terraform Module
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-org-policy.git
26+
sourceType: git
27+
version: 5.4.0
28+
actuationTool:
29+
flavor: Terraform
30+
version: ">= 1.3"
31+
description: {}
32+
content:
33+
subBlueprints:
34+
- name: bucket_policy_only
35+
location: modules/bucket_policy_only
36+
- name: domain_restricted_sharing
37+
location: modules/domain_restricted_sharing
38+
- name: org_policy_v2
39+
location: modules/org_policy_v2
40+
- name: restrict_vm_external_ips
41+
location: modules/restrict_vm_external_ips
42+
- name: skip_default_network
43+
location: modules/skip_default_network
44+
examples:
45+
- name: basic_org_policies
46+
location: examples/basic_org_policies
47+
- name: boolean_org_exclude
48+
location: examples/boolean_org_exclude
49+
- name: boolean_project_allow
50+
location: examples/boolean_project_allow
51+
- name: list_folder_deny
52+
location: examples/list_folder_deny
53+
- name: list_org_exclude
54+
location: examples/list_org_exclude
55+
- name: v2_boolean_org_enforce
56+
location: examples/v2_boolean_org_enforce
57+
interfaces:
58+
variables:
59+
- name: policy_for
60+
description: "Resource hierarchy node to apply the policy to: can be one of `organization`, `folder`, or `project`."
61+
varType: string
62+
required: true
63+
- name: organization_id
64+
description: The organization id for putting the policy
65+
varType: string
66+
- name: folder_id
67+
description: The folder id for putting the policy
68+
varType: string
69+
- name: project_id
70+
description: The project id for putting the policy
71+
varType: string
72+
- name: enforce
73+
description: If boolean constraint, whether the policy is enforced at the root; if list constraint, whether to deny all (true) or allow all
74+
varType: bool
75+
- name: allow
76+
description: (Only for list constraints) List of values which should be allowed
77+
varType: list(string)
78+
defaultValue:
79+
- ""
80+
- name: deny
81+
description: (Only for list constraints) List of values which should be denied
82+
varType: list(string)
83+
defaultValue:
84+
- ""
85+
- name: exclude_folders
86+
description: Set of folders to exclude from the policy
87+
varType: set(string)
88+
defaultValue: []
89+
- name: exclude_projects
90+
description: Set of projects to exclude from the policy
91+
varType: set(string)
92+
defaultValue: []
93+
- name: constraint
94+
description: The constraint to be applied
95+
varType: string
96+
required: true
97+
- name: policy_type
98+
description: The constraint type to work with (either 'boolean' or 'list')
99+
varType: string
100+
defaultValue: list
101+
- name: allow_list_length
102+
description: The number of elements in the allow list
103+
varType: number
104+
defaultValue: 0
105+
- name: deny_list_length
106+
description: The number of elements in the deny list
107+
varType: number
108+
defaultValue: 0
109+
requirements:
118110
roles:
119-
- roles/orgpolicy.policyAdmin
120-
- level: Project
121-
roles:
122-
- roles/owner
123-
services:
124-
- cloudresourcemanager.googleapis.com
125-
- storage-api.googleapis.com
126-
- serviceusage.googleapis.com
127-
- orgpolicy.googleapis.com
111+
- level: Project
112+
roles:
113+
- roles/orgpolicy.policyAdmin
114+
- level: Project
115+
roles:
116+
- roles/owner
117+
services:
118+
- cloudresourcemanager.googleapis.com
119+
- storage-api.googleapis.com
120+
- serviceusage.googleapis.com
121+
- orgpolicy.googleapis.com
122+
providerVersions:
123+
- source: hashicorp/google
124+
version: ">= 3.53, < 7"
125+
- source: hashicorp/null
126+
version: ">= 2.1"
Lines changed: 64 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 Google LLC
1+
# Copyright 2022-2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -19,63 +19,67 @@ metadata:
1919
annotations:
2020
config.kubernetes.io/local-config: "true"
2121
spec:
22-
title: Bucket Policy Only Module
23-
source:
24-
repo: https://github.com/terraform-google-modules/terraform-google-org-policy.git
25-
sourceType: git
26-
version: 5.4.0
27-
actuationTool:
28-
type: Terraform
29-
version: '>= 0.13'
30-
examples:
31-
- name: basic_org_policies
32-
location: examples/basic_org_policies
33-
- name: boolean_org_exclude
34-
location: examples/boolean_org_exclude
35-
- name: boolean_project_allow
36-
location: examples/boolean_project_allow
37-
- name: list_folder_deny
38-
location: examples/list_folder_deny
39-
- name: list_org_exclude
40-
location: examples/list_org_exclude
41-
- name: v2_boolean_org_enforce
42-
location: examples/v2_boolean_org_enforce
43-
variables:
44-
- name: exclude_folders
45-
description: Set of folders to exclude from the policy
46-
type: set(string)
47-
default: []
48-
required: false
49-
- name: exclude_projects
50-
description: Set of projects to exclude from the policy
51-
type: set(string)
52-
default: []
53-
required: false
54-
- name: folder_id
55-
description: The folder id for putting the policy
56-
type: string
57-
required: false
58-
- name: organization_id
59-
description: The organization id for putting the policy
60-
type: string
61-
required: false
62-
- name: policy_for
63-
description: 'Resource hierarchy node to apply the policy to: can be one of `organization`, `folder`, or `project`.'
64-
type: string
65-
required: true
66-
- name: project_id
67-
description: The project id for putting the policy
68-
type: string
69-
required: false
70-
roles:
71-
- level: Project
22+
info:
23+
title: Bucket Policy Only Module
24+
source:
25+
repo: https://github.com/terraform-google-modules/terraform-google-org-policy.git
26+
sourceType: git
27+
dir: /modules/bucket_policy_only
28+
version: 5.4.0
29+
actuationTool:
30+
flavor: Terraform
31+
version: ">= 1.3"
32+
description: {}
33+
content:
34+
examples:
35+
- name: basic_org_policies
36+
location: examples/basic_org_policies
37+
- name: boolean_org_exclude
38+
location: examples/boolean_org_exclude
39+
- name: boolean_project_allow
40+
location: examples/boolean_project_allow
41+
- name: list_folder_deny
42+
location: examples/list_folder_deny
43+
- name: list_org_exclude
44+
location: examples/list_org_exclude
45+
- name: v2_boolean_org_enforce
46+
location: examples/v2_boolean_org_enforce
47+
interfaces:
48+
variables:
49+
- name: policy_for
50+
description: "Resource hierarchy node to apply the policy to: can be one of `organization`, `folder`, or `project`."
51+
varType: string
52+
required: true
53+
- name: organization_id
54+
description: The organization id for putting the policy
55+
varType: string
56+
- name: folder_id
57+
description: The folder id for putting the policy
58+
varType: string
59+
- name: project_id
60+
description: The project id for putting the policy
61+
varType: string
62+
- name: exclude_folders
63+
description: Set of folders to exclude from the policy
64+
varType: set(string)
65+
defaultValue: []
66+
- name: exclude_projects
67+
description: Set of projects to exclude from the policy
68+
varType: set(string)
69+
defaultValue: []
70+
requirements:
7271
roles:
73-
- roles/owner
74-
- level: Project
75-
roles:
76-
- roles/orgpolicy.policyAdmin
77-
services:
78-
- cloudresourcemanager.googleapis.com
79-
- storage-api.googleapis.com
80-
- serviceusage.googleapis.com
81-
- orgpolicy.googleapis.com
72+
- level: Project
73+
roles:
74+
- roles/orgpolicy.policyAdmin
75+
- level: Project
76+
roles:
77+
- roles/owner
78+
services:
79+
- cloudresourcemanager.googleapis.com
80+
- storage-api.googleapis.com
81+
- serviceusage.googleapis.com
82+
- orgpolicy.googleapis.com
83+
providerVersions:
84+
- source: hashicorp/google
85+
version: ">= 3.53, < 7"

modules/bucket_policy_only/versions.tf

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

1717
terraform {
18-
required_version = ">= 0.13"
18+
required_version = ">= 1.3"
1919
required_providers {
2020

2121
google = {

0 commit comments

Comments
 (0)