Skip to content

Commit 0475973

Browse files
qz267Zheng Qin
andauthored
feat: per module requirements (#749)
Co-authored-by: Zheng Qin <zhengqin@google.com>
1 parent 3cb3eee commit 0475973

File tree

11 files changed

+476
-420
lines changed

11 files changed

+476
-420
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# Make will use bash instead of sh
1919
SHELL := /usr/bin/env bash
2020

21-
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.22
21+
DOCKER_TAG_VERSION_DEVELOPER_TOOLS := 1.25
2222
DOCKER_IMAGE_DEVELOPER_TOOLS := cft/developer-tools
2323
REGISTRY_URL := gcr.io/cloud-foundation-cicd
2424

@@ -80,7 +80,7 @@ docker_generate_docs:
8080
-e ENABLE_BPMETADATA \
8181
-v "$(CURDIR)":/workspace \
8282
$(REGISTRY_URL)/${DOCKER_IMAGE_DEVELOPER_TOOLS}:${DOCKER_TAG_VERSION_DEVELOPER_TOOLS} \
83-
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs'
83+
/bin/bash -c 'source /usr/local/bin/task_helper_functions.sh && generate_docs --per-module-requirements'
8484

8585
# Alias for backwards compatibility
8686
.PHONY: generate_docs

metadata.yaml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 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.
@@ -75,26 +75,13 @@ spec:
7575
roles:
7676
- level: Project
7777
roles:
78-
- roles/cloudkms.admin
79-
- roles/cloudkms.cryptoKeyEncrypterDecrypter
80-
- roles/cloudscheduler.admin
8178
- roles/cloudsql.admin
82-
- roles/compute.admin
83-
- roles/compute.networkAdmin
8479
- roles/iam.serviceAccountAdmin
8580
- roles/iam.serviceAccountUser
86-
- roles/monitoring.editor
8781
- roles/resourcemanager.projectIamAdmin
88-
- roles/storage.admin
89-
- roles/workflows.admin
82+
- roles/serviceusage.serviceUsageAdmin
9083
services:
91-
- cloudkms.googleapis.com
9284
- cloudresourcemanager.googleapis.com
93-
- cloudscheduler.googleapis.com
94-
- compute.googleapis.com
9585
- iam.googleapis.com
96-
- monitoring.googleapis.com
97-
- servicenetworking.googleapis.com
9886
- serviceusage.googleapis.com
9987
- sqladmin.googleapis.com
100-
- workflows.googleapis.com

modules/backup/metadata.yaml

Lines changed: 75 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 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.
@@ -61,10 +61,21 @@ spec:
6161
location: examples/private_service_access
6262
interfaces:
6363
variables:
64-
- name: backup_monitoring_frequency
65-
description: Timeframe in which there should be at least one successfull backup
64+
- name: region
65+
description: The region where to run the workflow
6666
varType: string
67-
defaultValue: 1d
67+
defaultValue: us-central1
68+
- name: service_account
69+
description: The service account to use for running the workflow and triggering the workflow by Cloud Scheduler - If empty or null a service account will be created. If you have provided a service account you need to grant the Cloud SQL Admin and the Workflows Invoker role to that
70+
varType: string
71+
- name: project_id
72+
description: The project ID
73+
varType: string
74+
required: true
75+
- name: sql_instance
76+
description: The name of the SQL instance to backup
77+
varType: string
78+
required: true
6879
- name: backup_retention_time
6980
description: The number of days backups should be kept
7081
varType: number
@@ -73,69 +84,88 @@ spec:
7384
description: The max amount of backups to list when fetching internal backup runs for the instance. This number must be larger then the amount of backups you wish to keep. E.g. for a daily backup schedule and a backup_retention_time of 30 days, you'd need to set this to at least 31 for old backups to get deleted.
7485
varType: number
7586
defaultValue: 31
87+
- name: scheduler_timezone
88+
description: The Timezone in which the Scheduler Jobs are triggered
89+
varType: string
90+
defaultValue: Etc/GMT
7691
- name: backup_schedule
7792
description: The cron schedule to execute the internal backup
7893
varType: string
7994
defaultValue: 45 2 * * *
95+
- name: export_schedule
96+
description: The cron schedule to execute the export to GCS
97+
varType: string
98+
defaultValue: 15 3 * * *
99+
- name: enable_internal_backup
100+
description: Wether to create internal backups with this module
101+
varType: bool
102+
defaultValue: true
103+
- name: enable_export_backup
104+
description: Weather to create exports to GCS Buckets with this module
105+
varType: bool
106+
defaultValue: true
107+
- name: export_databases
108+
description: The list of databases that should be exported - if is an empty set all databases will be exported
109+
varType: set(string)
110+
defaultValue: []
111+
- name: export_uri
112+
description: The bucket and path uri for exporting to GCS
113+
varType: string
114+
required: true
80115
- name: compress_export
81116
description: Whether or not to compress the export when storing in the bucket; Only valid for MySQL and PostgreSQL
82117
varType: bool
83118
defaultValue: true
119+
- name: enable_connector_params
120+
description: Whether to enable connector-specific parameters for Google Workflow SQL Export.
121+
varType: bool
122+
defaultValue: false
84123
- name: connector_params_timeout
85124
description: The end-to-end duration the connector call is allowed to run for before throwing a timeout exception. The default value is 1800 and this should be the maximum for connector methods that are not long-running operations. Otherwise, for long-running operations, the maximum timeout for a connector call is 31536000 seconds (one year).
86125
varType: number
87126
defaultValue: 1800
88-
- name: create_notification_channel
89-
description: If set to true it will create email notification channel
127+
- name: unique_suffix
128+
description: Unique suffix to add to scheduler jobs and workflows names.
129+
varType: string
130+
defaultValue: ""
131+
- name: log_db_name_to_export
132+
description: Whether or not to log database name in the export workflow
90133
varType: bool
91134
defaultValue: false
92-
- name: deletion_protection
93-
description: Whether Terraform will be prevented from destroying the workflow.
94-
varType: bool
95-
defaultValue: true
96-
- name: enable_backup_monitoring
97-
description: Whether to monitor backup workflows or not
135+
- name: use_sql_instance_replica_in_exporter
136+
description: Whether or not to use replica instance on exporter workflow.
98137
varType: bool
99138
defaultValue: false
100-
- name: enable_connector_params
101-
description: Whether to enable connector-specific parameters for Google Workflow SQL Export.
139+
- name: sql_instance_replica
140+
description: The name of the SQL instance replica to export
141+
varType: string
142+
- name: use_serverless_export
143+
description: Whether to use serverless export for DB export
102144
varType: bool
103145
defaultValue: false
104-
- name: enable_export_backup
105-
description: Weather to create exports to GCS Buckets with this module
146+
- name: monitoring_email
147+
description: Email address to send alerts
148+
varType: string
149+
- name: enable_backup_monitoring
150+
description: Whether to monitor backup workflows or not
106151
varType: bool
107-
defaultValue: true
152+
defaultValue: false
153+
- name: backup_monitoring_frequency
154+
description: Timeframe in which there should be at least one successfull backup
155+
varType: string
156+
defaultValue: 1d
108157
- name: enable_export_monitoring
109158
description: Whether to monitor export workflows or not
110159
varType: bool
111160
defaultValue: false
112-
- name: enable_internal_backup
113-
description: Wether to create internal backups with this module
114-
varType: bool
115-
defaultValue: true
116-
- name: export_databases
117-
description: The list of databases that should be exported - if is an empty set all databases will be exported
118-
varType: set(string)
119-
defaultValue: []
120161
- name: export_monitoring_frequency
121162
description: Timeframe in which there should be at least one successfull export
122163
varType: string
123164
defaultValue: 1d
124-
- name: export_schedule
125-
description: The cron schedule to execute the export to GCS
126-
varType: string
127-
defaultValue: 15 3 * * *
128-
- name: export_uri
129-
description: The bucket and path uri for exporting to GCS
130-
varType: string
131-
required: true
132-
- name: log_db_name_to_export
133-
description: Whether or not to log database name in the export workflow
165+
- name: create_notification_channel
166+
description: If set to true it will create email notification channel
134167
varType: bool
135168
defaultValue: false
136-
- name: monitoring_email
137-
description: Email address to send alerts
138-
varType: string
139169
- name: notification_channel_name
140170
description: Name of the email notification channel to be created. Only needed when create_notification_channel is set to true.
141171
varType: string
@@ -144,40 +174,10 @@ spec:
144174
description: List of existing notification channels to send alerts to
145175
varType: list(string)
146176
defaultValue: []
147-
- name: project_id
148-
description: The project ID
149-
varType: string
150-
required: true
151-
- name: region
152-
description: The region where to run the workflow
153-
varType: string
154-
defaultValue: us-central1
155-
- name: scheduler_timezone
156-
description: The Timezone in which the Scheduler Jobs are triggered
157-
varType: string
158-
defaultValue: Etc/GMT
159-
- name: service_account
160-
description: The service account to use for running the workflow and triggering the workflow by Cloud Scheduler - If empty or null a service account will be created. If you have provided a service account you need to grant the Cloud SQL Admin and the Workflows Invoker role to that
161-
varType: string
162-
- name: sql_instance
163-
description: The name of the SQL instance to backup
164-
varType: string
165-
required: true
166-
- name: sql_instance_replica
167-
description: The name of the SQL instance replica to export
168-
varType: string
169-
- name: unique_suffix
170-
description: Unique suffix to add to scheduler jobs and workflows names.
171-
varType: string
172-
defaultValue: ""
173-
- name: use_serverless_export
174-
description: Whether to use serverless export for DB export
175-
varType: bool
176-
defaultValue: false
177-
- name: use_sql_instance_replica_in_exporter
178-
description: Whether or not to use replica instance on exporter workflow.
177+
- name: deletion_protection
178+
description: Whether Terraform will be prevented from destroying the workflow.
179179
varType: bool
180-
defaultValue: false
180+
defaultValue: true
181181
outputs:
182182
- name: backup_workflow_name
183183
description: The name for internal backup workflow
@@ -191,26 +191,12 @@ spec:
191191
roles:
192192
- level: Project
193193
roles:
194-
- roles/cloudkms.admin
195-
- roles/cloudkms.cryptoKeyEncrypterDecrypter
196-
- roles/cloudscheduler.admin
197194
- roles/cloudsql.admin
198-
- roles/compute.admin
199-
- roles/compute.networkAdmin
200-
- roles/iam.serviceAccountAdmin
201195
- roles/iam.serviceAccountUser
202-
- roles/monitoring.editor
203-
- roles/resourcemanager.projectIamAdmin
204-
- roles/storage.admin
205-
- roles/workflows.admin
196+
- roles/logging.logWriter
206197
services:
207-
- cloudkms.googleapis.com
208-
- cloudresourcemanager.googleapis.com
209-
- cloudscheduler.googleapis.com
210-
- compute.googleapis.com
211-
- iam.googleapis.com
212-
- monitoring.googleapis.com
213-
- servicenetworking.googleapis.com
214198
- serviceusage.googleapis.com
215199
- sqladmin.googleapis.com
216-
- workflows.googleapis.com
200+
providerVersions:
201+
- source: hashicorp/google
202+
version: ">= 6.11.0, < 7"

modules/mssql/metadata.yaml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 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.
@@ -81,6 +81,9 @@ spec:
8181
description: Sets random suffix at the end of the Cloud SQL resource name
8282
varType: bool
8383
defaultValue: false
84+
- name: maintenance_version
85+
description: The current software version on the instance. This attribute can not be set during creation. Refer to available_maintenance_versions attribute to see what maintenance_version are available for upgrade. When this attribute gets updated, it will cause an instance restart. Setting a maintenance_version value that is older than the current one on the instance will be ignored
86+
varType: string
8487
- name: database_version
8588
description: "The database version to use: SQLSERVER_2017_STANDARD, SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, or SQLSERVER_2017_WEB"
8689
varType: string
@@ -298,6 +301,19 @@ spec:
298301
description: Enable or disable the creation of the default user
299302
varType: bool
300303
defaultValue: true
304+
- name: enable_dataplex_integration
305+
description: Enable database Dataplex integration
306+
varType: bool
307+
defaultValue: false
308+
- name: insights_config
309+
description: The insights_config settings for the database.
310+
varType: |-
311+
object({
312+
query_plans_per_minute = optional(number, 5)
313+
query_string_length = optional(number, 1024)
314+
record_application_tags = optional(bool, false)
315+
record_client_address = optional(bool, false)
316+
})
301317
outputs:
302318
- name: additional_users
303319
description: List of maps of additional users and passwords
@@ -547,29 +563,17 @@ spec:
547563
roles:
548564
- level: Project
549565
roles:
550-
- roles/cloudkms.admin
551-
- roles/cloudkms.cryptoKeyEncrypterDecrypter
552-
- roles/cloudscheduler.admin
553566
- roles/cloudsql.admin
554-
- roles/compute.admin
555-
- roles/compute.networkAdmin
556-
- roles/iam.serviceAccountAdmin
557567
- roles/iam.serviceAccountUser
558-
- roles/monitoring.editor
559-
- roles/resourcemanager.projectIamAdmin
560-
- roles/storage.admin
561-
- roles/workflows.admin
568+
- roles/logging.logWriter
562569
services:
563570
- cloudkms.googleapis.com
564571
- cloudresourcemanager.googleapis.com
565-
- cloudscheduler.googleapis.com
566572
- compute.googleapis.com
567573
- iam.googleapis.com
568574
- monitoring.googleapis.com
569-
- servicenetworking.googleapis.com
570575
- serviceusage.googleapis.com
571576
- sqladmin.googleapis.com
572-
- workflows.googleapis.com
573577
providerVersions:
574578
- source: hashicorp/google
575579
version: ">= 5.12, < 7"

modules/mysql/metadata.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ spec:
279279
retention_unit = optional(string)
280280
})
281281
defaultValue: {}
282+
- name: retain_backups_on_delete
283+
description: When this parameter is set to true, Cloud SQL retains backups of the instance even after the instance is deleted. The ON_DEMAND backup will be retained until customer deletes the backup or the project. The AUTOMATED backup will be retained based on the backups retention setting.
284+
varType: bool
285+
defaultValue: false
282286
- name: insights_config
283287
description: The insights_config settings for the database.
284288
varType: |-
@@ -914,35 +918,26 @@ spec:
914918
roles:
915919
- level: Project
916920
roles:
917-
- roles/cloudkms.admin
918-
- roles/cloudkms.autokeyAdmin
921+
- roles/iam.serviceAccountUser
922+
- roles/compute.networkAdmin
919923
- roles/cloudkms.cryptoKeyEncrypterDecrypter
920-
- roles/cloudscheduler.admin
924+
- roles/logging.logWriter
921925
- roles/cloudsql.admin
922-
- roles/compute.admin
923-
- roles/compute.networkAdmin
924-
- roles/iam.serviceAccountAdmin
925-
- roles/iam.serviceAccountUser
926-
- roles/monitoring.editor
927926
- roles/resourcemanager.projectIamAdmin
928-
- roles/storage.admin
929-
- roles/workflows.admin
930927
services:
931928
- cloudkms.googleapis.com
932929
- cloudresourcemanager.googleapis.com
933-
- cloudscheduler.googleapis.com
934930
- compute.googleapis.com
935931
- iam.googleapis.com
936932
- monitoring.googleapis.com
937933
- servicenetworking.googleapis.com
938934
- serviceusage.googleapis.com
939935
- sqladmin.googleapis.com
940-
- workflows.googleapis.com
941936
providerVersions:
942937
- source: hashicorp/google
943-
version: ">= 6.1, < 7"
938+
version: ">= 6.31, < 7"
944939
- source: hashicorp/google-beta
945-
version: ">= 6.1, < 7"
940+
version: ">= 6.31, < 7"
946941
- source: hashicorp/null
947942
version: ~> 3.1
948943
- source: hashicorp/random

0 commit comments

Comments
 (0)