Skip to content

Commit e60b991

Browse files
authored
Update main.tf
Update SQL Server PITR sample.
1 parent fbf0147 commit e60b991

File tree

1 file changed

+29
-7
lines changed
  • cloud_sql/sqlserver_instance_pitr

1 file changed

+29
-7
lines changed

cloud_sql/sqlserver_instance_pitr/main.tf

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,43 @@
1515
*/
1616

1717
# [START cloud_sql_sqlserver_instance_pitr]
18+
# Creates a SQL SERVER Enterprise Plus edition instance. Unless specified otherwise, PITR is enabled by default.
1819
resource "google_sql_database_instance" "default" {
19-
name = "sqlserver-instance-pitr"
20+
name = "sqlserver-enterprise-plus-instance-pitr"
2021
region = "asia-northeast1"
2122
database_version = "SQLSERVER_2019_ENTERPRISE"
22-
root_password = "INSERT-PASSWORD-HERE"
2323
settings {
24-
tier = "db-custom-4-26624"
24+
tier = "db-perf-optimized-N-2"
25+
edition = "ENTERPRISE_PLUS"
2526
backup_configuration {
2627
enabled = true
27-
start_time = "20:55"
28-
transaction_log_retention_days = "3"
2928
}
3029
}
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.
30+
# Setting the `deletion_protection` flag to true ensures you can't accidentally delete the instance
31+
# using Terraform. Setting the `deletion_protection_enabled` flag to true protects the instance at the
32+
# Google Cloud level.
3333
deletion_protection = false
3434
}
3535
# [END cloud_sql_sqlserver_instance_pitr]
36+
37+
# [START cloud_sql_sqlserver_instance_update_pitr]
38+
# Enables PITR on a SQL SERVER Enterprise edition instance. Unless specified otherwise, when creating an Enterprise edition
39+
# instance, PITR is disabled by default.
40+
resource "google_sql_database_instance" "default" {
41+
name = "sqlserver-enterprise-instance-pitr"
42+
region = "asia-northeast1"
43+
database_version = "SQLSERVER_2019_ENTERPRISE"
44+
settings {
45+
tier = "db-custom-4-26624"
46+
edition = "ENTERPRISE_PLUS"
47+
backup_configuration {
48+
enabled = true
49+
point_in_time_recovery_enabled = true
50+
}
51+
}
52+
# Setting the `deletion_protection` flag to true ensures you can't accidentally delete the instance
53+
# using Terraform. Setting the `deletion_protection_enabled` flag to true protects the instance at the
54+
# Google Cloud level.
55+
deletion_protection = false
56+
}
57+
# [END cloud_sql_sqlserver_instance_update_pitr]

0 commit comments

Comments
 (0)