Skip to content

Commit cf7193b

Browse files
author
Zheng Qin
committed
feat: per module requirements
1 parent d4b8db7 commit cf7193b

File tree

11 files changed

+439
-547
lines changed

11 files changed

+439
-547
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 & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# Copyright 2024 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
151
apiVersion: blueprints.cloud.google.com/v1alpha1
162
kind: BlueprintMetadata
173
metadata:
@@ -75,26 +61,13 @@ spec:
7561
roles:
7662
- level: Project
7763
roles:
78-
- roles/cloudkms.admin
79-
- roles/cloudkms.cryptoKeyEncrypterDecrypter
80-
- roles/cloudscheduler.admin
64+
- roles/resourcemanager.projectIamAdmin
65+
- roles/serviceusage.serviceUsageAdmin
8166
- roles/cloudsql.admin
82-
- roles/compute.admin
83-
- roles/compute.networkAdmin
8467
- roles/iam.serviceAccountAdmin
8568
- roles/iam.serviceAccountUser
86-
- roles/monitoring.editor
87-
- roles/resourcemanager.projectIamAdmin
88-
- roles/storage.admin
89-
- roles/workflows.admin
9069
services:
91-
- cloudkms.googleapis.com
9270
- cloudresourcemanager.googleapis.com
93-
- cloudscheduler.googleapis.com
94-
- compute.googleapis.com
9571
- iam.googleapis.com
96-
- monitoring.googleapis.com
97-
- servicenetworking.googleapis.com
9872
- serviceusage.googleapis.com
9973
- sqladmin.googleapis.com
100-
- workflows.googleapis.com

modules/backup/metadata.yaml

Lines changed: 75 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# Copyright 2024 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
151
apiVersion: blueprints.cloud.google.com/v1alpha1
162
kind: BlueprintMetadata
173
metadata:
@@ -61,10 +47,21 @@ spec:
6147
location: examples/private_service_access
6248
interfaces:
6349
variables:
64-
- name: backup_monitoring_frequency
65-
description: Timeframe in which there should be at least one successfull backup
50+
- name: region
51+
description: The region where to run the workflow
6652
varType: string
67-
defaultValue: 1d
53+
defaultValue: us-central1
54+
- name: service_account
55+
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
56+
varType: string
57+
- name: project_id
58+
description: The project ID
59+
varType: string
60+
required: true
61+
- name: sql_instance
62+
description: The name of the SQL instance to backup
63+
varType: string
64+
required: true
6865
- name: backup_retention_time
6966
description: The number of days backups should be kept
7067
varType: number
@@ -73,69 +70,88 @@ spec:
7370
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.
7471
varType: number
7572
defaultValue: 31
73+
- name: scheduler_timezone
74+
description: The Timezone in which the Scheduler Jobs are triggered
75+
varType: string
76+
defaultValue: Etc/GMT
7677
- name: backup_schedule
7778
description: The cron schedule to execute the internal backup
7879
varType: string
7980
defaultValue: 45 2 * * *
81+
- name: export_schedule
82+
description: The cron schedule to execute the export to GCS
83+
varType: string
84+
defaultValue: 15 3 * * *
85+
- name: enable_internal_backup
86+
description: Wether to create internal backups with this module
87+
varType: bool
88+
defaultValue: true
89+
- name: enable_export_backup
90+
description: Weather to create exports to GCS Buckets with this module
91+
varType: bool
92+
defaultValue: true
93+
- name: export_databases
94+
description: The list of databases that should be exported - if is an empty set all databases will be exported
95+
varType: set(string)
96+
defaultValue: []
97+
- name: export_uri
98+
description: The bucket and path uri for exporting to GCS
99+
varType: string
100+
required: true
80101
- name: compress_export
81102
description: Whether or not to compress the export when storing in the bucket; Only valid for MySQL and PostgreSQL
82103
varType: bool
83104
defaultValue: true
105+
- name: enable_connector_params
106+
description: Whether to enable connector-specific parameters for Google Workflow SQL Export.
107+
varType: bool
108+
defaultValue: false
84109
- name: connector_params_timeout
85110
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).
86111
varType: number
87112
defaultValue: 1800
88-
- name: create_notification_channel
89-
description: If set to true it will create email notification channel
113+
- name: unique_suffix
114+
description: Unique suffix to add to scheduler jobs and workflows names.
115+
varType: string
116+
defaultValue: ""
117+
- name: log_db_name_to_export
118+
description: Whether or not to log database name in the export workflow
90119
varType: bool
91120
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
121+
- name: use_sql_instance_replica_in_exporter
122+
description: Whether or not to use replica instance on exporter workflow.
98123
varType: bool
99124
defaultValue: false
100-
- name: enable_connector_params
101-
description: Whether to enable connector-specific parameters for Google Workflow SQL Export.
125+
- name: sql_instance_replica
126+
description: The name of the SQL instance replica to export
127+
varType: string
128+
- name: use_serverless_export
129+
description: Whether to use serverless export for DB export
102130
varType: bool
103131
defaultValue: false
104-
- name: enable_export_backup
105-
description: Weather to create exports to GCS Buckets with this module
132+
- name: monitoring_email
133+
description: Email address to send alerts
134+
varType: string
135+
- name: enable_backup_monitoring
136+
description: Whether to monitor backup workflows or not
106137
varType: bool
107-
defaultValue: true
138+
defaultValue: false
139+
- name: backup_monitoring_frequency
140+
description: Timeframe in which there should be at least one successfull backup
141+
varType: string
142+
defaultValue: 1d
108143
- name: enable_export_monitoring
109144
description: Whether to monitor export workflows or not
110145
varType: bool
111146
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: []
120147
- name: export_monitoring_frequency
121148
description: Timeframe in which there should be at least one successfull export
122149
varType: string
123150
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
151+
- name: create_notification_channel
152+
description: If set to true it will create email notification channel
134153
varType: bool
135154
defaultValue: false
136-
- name: monitoring_email
137-
description: Email address to send alerts
138-
varType: string
139155
- name: notification_channel_name
140156
description: Name of the email notification channel to be created. Only needed when create_notification_channel is set to true.
141157
varType: string
@@ -144,40 +160,10 @@ spec:
144160
description: List of existing notification channels to send alerts to
145161
varType: list(string)
146162
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.
163+
- name: deletion_protection
164+
description: Whether Terraform will be prevented from destroying the workflow.
179165
varType: bool
180-
defaultValue: false
166+
defaultValue: true
181167
outputs:
182168
- name: backup_workflow_name
183169
description: The name for internal backup workflow
@@ -191,26 +177,12 @@ spec:
191177
roles:
192178
- level: Project
193179
roles:
194-
- roles/cloudkms.admin
195-
- roles/cloudkms.cryptoKeyEncrypterDecrypter
196-
- roles/cloudscheduler.admin
197-
- roles/cloudsql.admin
198-
- roles/compute.admin
199-
- roles/compute.networkAdmin
200-
- roles/iam.serviceAccountAdmin
201180
- roles/iam.serviceAccountUser
202-
- roles/monitoring.editor
203-
- roles/resourcemanager.projectIamAdmin
204-
- roles/storage.admin
205-
- roles/workflows.admin
181+
- roles/logging.logWriter
182+
- roles/cloudsql.admin
206183
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
214184
- serviceusage.googleapis.com
215185
- sqladmin.googleapis.com
216-
- workflows.googleapis.com
186+
providerVersions:
187+
- source: hashicorp/google
188+
version: ">= 6.11.0, < 7"

modules/mssql/metadata.yaml

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# Copyright 2024 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
151
apiVersion: blueprints.cloud.google.com/v1alpha1
162
kind: BlueprintMetadata
173
metadata:
@@ -81,6 +67,9 @@ spec:
8167
description: Sets random suffix at the end of the Cloud SQL resource name
8268
varType: bool
8369
defaultValue: false
70+
- name: maintenance_version
71+
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
72+
varType: string
8473
- name: database_version
8574
description: "The database version to use: SQLSERVER_2017_STANDARD, SQLSERVER_2017_ENTERPRISE, SQLSERVER_2017_EXPRESS, or SQLSERVER_2017_WEB"
8675
varType: string
@@ -298,6 +287,19 @@ spec:
298287
description: Enable or disable the creation of the default user
299288
varType: bool
300289
defaultValue: true
290+
- name: enable_dataplex_integration
291+
description: Enable database Dataplex integration
292+
varType: bool
293+
defaultValue: false
294+
- name: insights_config
295+
description: The insights_config settings for the database.
296+
varType: |-
297+
object({
298+
query_plans_per_minute = optional(number, 5)
299+
query_string_length = optional(number, 1024)
300+
record_application_tags = optional(bool, false)
301+
record_client_address = optional(bool, false)
302+
})
301303
outputs:
302304
- name: additional_users
303305
description: List of maps of additional users and passwords
@@ -547,29 +549,12 @@ spec:
547549
roles:
548550
- level: Project
549551
roles:
550-
- roles/cloudkms.admin
551-
- roles/cloudkms.cryptoKeyEncrypterDecrypter
552-
- roles/cloudscheduler.admin
553-
- roles/cloudsql.admin
554-
- roles/compute.admin
555-
- roles/compute.networkAdmin
556-
- roles/iam.serviceAccountAdmin
557552
- roles/iam.serviceAccountUser
558-
- roles/monitoring.editor
559-
- roles/resourcemanager.projectIamAdmin
560-
- roles/storage.admin
561-
- roles/workflows.admin
553+
- roles/logging.logWriter
554+
- roles/cloudsql.admin
562555
services:
563-
- cloudkms.googleapis.com
564-
- cloudresourcemanager.googleapis.com
565-
- cloudscheduler.googleapis.com
566-
- compute.googleapis.com
567-
- iam.googleapis.com
568-
- monitoring.googleapis.com
569-
- servicenetworking.googleapis.com
570556
- serviceusage.googleapis.com
571557
- sqladmin.googleapis.com
572-
- workflows.googleapis.com
573558
providerVersions:
574559
- source: hashicorp/google
575560
version: ">= 5.12, < 7"

0 commit comments

Comments
 (0)