|
15 | 15 | */ |
16 | 16 |
|
17 | 17 | # [START cloud_sql_sqlserver_instance_pitr] |
| 18 | +# Creates a SQL SERVER Enterprise Plus edition instance. Unless specified otherwise, PITR is enabled by default. |
18 | 19 | resource "google_sql_database_instance" "default" { |
19 | | - name = "sqlserver-instance-pitr" |
| 20 | + name = "sqlserver-enterprise-plus-instance-pitr" |
20 | 21 | region = "asia-northeast1" |
21 | 22 | database_version = "SQLSERVER_2019_ENTERPRISE" |
22 | | - root_password = "INSERT-PASSWORD-HERE" |
23 | 23 | settings { |
24 | | - tier = "db-custom-4-26624" |
| 24 | + tier = "db-perf-optimized-N-2" |
| 25 | + edition = "ENTERPRISE_PLUS" |
25 | 26 | backup_configuration { |
26 | 27 | enabled = true |
27 | | - start_time = "20:55" |
28 | | - transaction_log_retention_days = "3" |
29 | 28 | } |
30 | 29 | } |
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. |
33 | 33 | deletion_protection = false |
34 | 34 | } |
35 | 35 | # [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