File tree Expand file tree Collapse file tree 7 files changed +16
-0
lines changed
examples/postgresql-backup-provided-service-account Expand file tree Collapse file tree 7 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ This example shows how to create:
55- a PostgreSQL Cloud SQL Instance
66- A GCS Bucket for storing the Backup
77- The Workflows for exports (external backups) and (internal) backups
8+ - The Workflows with serverless export
89
910## Run Terraform
1011
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ module "backup" {
5353 backup_retention_time = 1
5454 backup_schedule = " 5 * * * *"
5555 export_schedule = " 10 * * * *"
56+ use_serverless_export = true
5657 service_account = " ${ data . google_project . test_project . number } [email protected] " 5758}
5859
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ fetch workflows.googleapis.com/Workflow
7171| sql\_ instance | The name of the SQL instance to backup | ` string ` | n/a | yes |
7272| sql\_ instance\_ replica | The name of the SQL instance replica to export | ` string ` | ` null ` | no |
7373| unique\_ suffix | Unique suffix to add to scheduler jobs and workflows names. | ` string ` | ` "" ` | no |
74+ | use\_ serverless\_ export | Whether to use serverless export for DB export | ` bool ` | ` false ` | no |
7475| use\_ sql\_ instance\_ replica\_ in\_ exporter | Whether or not to use replica instance on exporter workflow. | ` bool ` | ` false ` | no |
7576
7677## Outputs
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ resource "google_workflows_workflow" "sql_export" {
113113 enableConnectorParams = var.enable_connector_params
114114 connectorParamsTimeout = var.connector_params_timeout
115115 logDbName = var.log_db_name_to_export
116+ serverlessExport = var.use_serverless_export
116117 })
117118}
118119
Original file line number Diff line number Diff line change @@ -102,6 +102,10 @@ spec:
102102 description : Unique suffix to add to scheduler jobs and workflows names.
103103 type : string
104104 default : " "
105+ - name : use_serverless_export
106+ description : Whether to use serverless export for DB export
107+ type : bool
108+ default : false
105109 outputs :
106110 - name : backup_workflow_name
107111 description : The name for internal backup workflow
Original file line number Diff line number Diff line change 6161 body:
6262 exportContext:
6363 databases: [$${database}]
64+ offload: " ${ serverlessExport } "
6465 uri: $${" ${ gcsBucket } /${ instanceName } -" + database + " -" + backupTime + % { if compressExport == true }" .sql.gz" % { else }" .sql" % { endif }}
6566% { endif }
6667
@@ -109,5 +110,6 @@ main:
109110 body:
110111 exportContext:
111112 databases: $${databases}
113+ offload: " ${ serverlessExport } "
112114 uri: $${" ${ gcsBucket } /${ instanceName } -" + backupTime + % { if compressExport == true }" .sql.gz" % { else }" .sql" % { endif }}
113115% { endif }
Original file line number Diff line number Diff line change @@ -132,3 +132,9 @@ variable "sql_instance_replica" {
132132 type = string
133133 default = null
134134}
135+
136+ variable "use_serverless_export" {
137+ description = " Whether to use serverless export for DB export"
138+ type = bool
139+ default = false
140+ }
You can’t perform that action at this time.
0 commit comments