You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/project_cleanup/README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Old Project Cleanup Utility Module
2
2
3
-
This module schedules a job to clean up GCP projects older than a specified length of time, that match a particular key-value pair. This job runs every 5 minutes via Google Cloud Scheduled Functions. Please see the [utility's readme](./function_source/README.md) for more information as to its operation and configuration.
3
+
This module schedules a job to clean up GCP projects older than a specified length of time, that match a particular labels. This job runs every 5 minutes via Google Cloud Scheduled Functions. Please see the [utility's readme](./function_source/README.md) for more information as to its operation and configuration.
4
4
5
5
## Requirements
6
6
@@ -21,12 +21,17 @@ The following services must be enabled on the project housing the cleanup functi
21
21
22
22
| Name | Description | Type | Default | Required |
23
23
|------|-------------|:----:|:-----:|:-----:|
24
+
| job\_schedule | Cleaner function run frequency, in cron syntax | string |`"*/5 * * * *"`| no |
24
25
| max\_project\_age\_in\_hours | The maximum number of hours that a GCP project, selected by `target_tag_name` and `target_tag_value`, can exist | number |`"6"`| no |
25
26
| organization\_id | The organization ID whose projects to clean up | string | n/a | yes |
26
27
| project\_id | The project ID to host the scheduled function in | string | n/a | yes |
27
28
| region | The region the project is in (App Engine specific) | string | n/a | yes |
28
-
| target\_tag\_name | The name of a tag to filter GCP projects on for consideration by the cleanup utility | string |`"cft-ephemeral"`| no |
29
-
| target\_tag\_value | The value of a tag to filter GCP projects on for consideration by the cleanup utility | string |`"true"`| no |
29
+
| target\_excluded\_labels | Map of project lablels that won't be deleted. | map(string) |`<map>`| no |
30
+
| target\_folder\_id | Folder ID to delete all projects under. | string |`""`| no |
31
+
| target\_included\_labels | Map of project lablels that will be deleted. | map(string) |`<map>`| no |
32
+
| target\_tag\_name | The name of a tag to filter GCP projects on for consideration by the cleanup utility (legacy, use `target_included_labels` map instead). | string |`""`| no |
33
+
| target\_tag\_value | The value of a tag to filter GCP projects on for consideration by the cleanup utility (legacy, use `target_included_labels` map instead). | string |`""`| no |
34
+
| topic\_name | Name of pubsub topic connecting the scheduled projects cleanup function | string |`"pubsub_scheduled_project_cleaner"`| no |
Copy file name to clipboardExpand all lines: modules/project_cleanup/function_source/README.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,9 @@
3
3
This is a simple utility that scans a GCP organization for projects matching certain criteria, and enqueues such projects for deletion. Currently supported criteria are the combination of:
4
4
5
5
-**Age:** Only projects older than the configured age, in hours, will be marked for deletion.
6
-
-**Key-Value Pair:** Only projects whose labels contain the provided key-value pair will be marked for deletion.
6
+
-**Key-Value Pair Include:** Only projects whose labels contain the provided key-value pair will be marked for deletion.
7
+
-**Key-Value Pair Exclude:** Projects whose labels contain the provided key-value pair won't be marked for deletion.
8
+
-**Folder ID:** Only projects under this Folder ID will be recursively marked for deletion.
7
9
8
10
Both of these criteria must be met for a project to be deleted.
9
11
@@ -13,9 +15,10 @@ The following environment variables may be specified to configure the cleanup ut
13
15
14
16
| Name | Description | Type | Default | Required |
15
17
|------|-------------|:----:|:-----:|:-----:|
16
-
|`TARGET_TAG_NAME`| The tag name to match on for identifying projects to delete | string | n/a | yes |
17
-
|`TARGET_TAG_VALUE`| The tag value to match on for identifying projects to delete | string | n/a | yes |
18
-
|`MAX_PROJECT_AGE_HOURS`| The project age, in hours, at which point deletion should be considered | integer | n/a | yes |
18
+
|`TARGET_EXCLUDED_LABELS`| Labels to match on for identifying projects to avoid deletion | string | n/a | no |
19
+
|`TARGET_FOLDER_ID`| Folder ID to delete prjojects under | string | n/a | yes |
20
+
|`TARGET_INCLUDED_LABELS`| Labels to match on for identifying projects to delete | string | n/a | no |
21
+
|`MAX_PROJECT_AGE_HOURS`| The project age, in hours, at which point deletion should be considered | integer | n/a | no |
0 commit comments