Skip to content

Commit fbf0147

Browse files
rebecca-peteglasnt
andauthored
feat: Create SQL Server PITR sample (#794)
* Create /cloud_sql/sqlserver_instance_pitr/main.tf Create /cloud_sql/sqlserver_instance_pitr/main.tf Please verify resource, resource name, tier, and database_version. * Binary log can only be enabled for MySQL instances * root_password required for MSSQL * Update copyright year for cloud_sql/sqlserver_instance_pitr/main.tf --------- Co-authored-by: Katie McLaughlin <[email protected]>
1 parent b03e7ac commit fbf0147

File tree

1 file changed

+35
-0
lines changed
  • cloud_sql/sqlserver_instance_pitr

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
# [START cloud_sql_sqlserver_instance_pitr]
18+
resource "google_sql_database_instance" "default" {
19+
name = "sqlserver-instance-pitr"
20+
region = "asia-northeast1"
21+
database_version = "SQLSERVER_2019_ENTERPRISE"
22+
root_password = "INSERT-PASSWORD-HERE"
23+
settings {
24+
tier = "db-custom-4-26624"
25+
backup_configuration {
26+
enabled = true
27+
start_time = "20:55"
28+
transaction_log_retention_days = "3"
29+
}
30+
}
31+
# set `deletion_protection` to true, will ensure that one cannot accidentally delete this instance by
32+
# use of Terraform whereas `deletion_protection_enabled` flag protects this instance at the GCP level.
33+
deletion_protection = false
34+
}
35+
# [END cloud_sql_sqlserver_instance_pitr]

0 commit comments

Comments
 (0)