Skip to content

Commit a1a42b7

Browse files
sql_database_instance disk_size and disk_autoresize can both be true (#6596) (#12641)
Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]>
1 parent 8ea6416 commit a1a42b7

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

.changelog/6596.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:note
2+
sql: improved disk_size and disk_autoresize docs
3+
```

google/resource_sql_database_instance.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func resourceSqlDatabaseInstance() *schema.Resource {
117117
Type: schema.TypeBool,
118118
Default: true,
119119
Optional: true,
120-
Description: `Used to block Terraform from deleting a SQL Instance.`,
120+
Description: `Used to block Terraform from deleting a SQL Instance. Defaults to true.`,
121121
},
122122
"settings": {
123123
Type: schema.TypeList,
@@ -191,7 +191,7 @@ func resourceSqlDatabaseInstance() *schema.Resource {
191191
settings.backup_configuration.enabled is set to true.
192192
For MySQL instances, ensure that settings.backup_configuration.binary_log_enabled is set to true.
193193
For Postgres instances, ensure that settings.backup_configuration.point_in_time_recovery_enabled
194-
is set to true.`,
194+
is set to true. Defaults to ZONAL.`,
195195
},
196196
"backup_configuration": {
197197
Type: schema.TypeList,
@@ -292,7 +292,7 @@ is set to true.`,
292292
Type: schema.TypeBool,
293293
Optional: true,
294294
Default: true,
295-
Description: `Enables auto-resizing of the storage size. Defaults to true. Set to false if you want to set disk_size.`,
295+
Description: `Enables auto-resizing of the storage size. Defaults to true.`,
296296
},
297297
"disk_autoresize_limit": {
298298
Type: schema.TypeInt,
@@ -305,14 +305,14 @@ is set to true.`,
305305
Optional: true,
306306
// Default is likely 10gb, but it is undocumented and may change.
307307
Computed: true,
308-
Description: `The size of data disk, in GB. Size of a running instance cannot be reduced but can be increased. If you want to set this field, set disk_autoresize to false.`,
308+
Description: `The size of data disk, in GB. Size of a running instance cannot be reduced but can be increased. The minimum value is 10GB.`,
309309
},
310310
"disk_type": {
311311
Type: schema.TypeString,
312312
Optional: true,
313313
Default: "PD_SSD",
314314
DiffSuppressFunc: caseDiffDashSuppress,
315-
Description: `The type of data disk: PD_SSD or PD_HDD.`,
315+
Description: `The type of data disk: PD_SSD or PD_HDD. Defaults to PD_SSD.`,
316316
},
317317
"ip_configuration": {
318318
Type: schema.TypeList,
@@ -634,7 +634,7 @@ is set to true.`,
634634
Optional: true,
635635
ForceNew: true,
636636
AtLeastOneOf: replicaConfigurationKeys,
637-
Description: `The number of seconds between connect retries.`,
637+
Description: `The number of seconds between connect retries. MySQL's default is 60 seconds.`,
638638
},
639639
"dump_file_path": {
640640
Type: schema.TypeString,

website/docs/r/sql_database_instance.html.markdown

+10-10
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ includes an up-to-date reference of supported versions.
206206
That service account needs the `Cloud KMS > Cloud KMS CryptoKey Encrypter/Decrypter` role on your
207207
key - please see [this step](https://cloud.google.com/sql/docs/mysql/configure-cmek#grantkey).
208208

209-
* `deletion_protection` - (Optional, Default: `true` ) Whether or not to allow Terraform to destroy the instance. Unless this field is set to false
210-
in Terraform state, a `terraform destroy` or `terraform apply` command that deletes the instance will fail.
209+
* `deletion_protection` - (Optional) Whether or not to allow Terraform to destroy the instance. Unless this field is set to false
210+
in Terraform state, a `terraform destroy` or `terraform apply` command that deletes the instance will fail. Defaults to `true`.
211211

212212
* `restore_backup_context` - (optional) The context needed to restore the database to a backup run. This field will
213213
cause Terraform to trigger the database to restore from the backup run indicated. The configuration is detailed below.
@@ -227,22 +227,22 @@ The `settings` block supports:
227227
* `activation_policy` - (Optional) This specifies when the instance should be
228228
active. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`.
229229

230-
* `availability_type` - (Optional, Default: `ZONAL`) The availability type of the Cloud SQL
230+
* `availability_type` - (Optional) The availability type of the Cloud SQL
231231
instance, high availability (`REGIONAL`) or single zone (`ZONAL`).' For all instances, ensure that
232232
`settings.backup_configuration.enabled` is set to `true`.
233233
For MySQL instances, ensure that `settings.backup_configuration.binary_log_enabled` is set to `true`.
234234
For Postgres instances, ensure that `settings.backup_configuration.point_in_time_recovery_enabled`
235-
is set to `true`.
235+
is set to `true`. Defaults to `ZONAL`.
236236

237237
* `collation` - (Optional) The name of server instance collation.
238238

239-
* `disk_autoresize` - (Optional, Default: `true`) Enables auto-resizing of the storage size. Set to false if you want to set `disk_size`.
239+
* `disk_autoresize` - (Optional) Enables auto-resizing of the storage size. Defaults to `true`.
240240

241-
* `disk_autoresize_limit` - (Optional, Default: `0`) The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit.
241+
* `disk_autoresize_limit` - (Optional) The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit.
242242

243-
* `disk_size` - (Optional, Default: `10`) The size of data disk, in GB. Size of a running instance cannot be reduced but can be increased. If you want to set this field, set `disk_autoresize` to false.
243+
* `disk_size` - (Optional) The size of data disk, in GB. Size of a running instance cannot be reduced but can be increased. The minimum value is 10GB.
244244

245-
* `disk_type` - (Optional, Default: `PD_SSD`) The type of data disk: PD_SSD or PD_HDD.
245+
* `disk_type` - (Optional) The type of data disk: PD_SSD or PD_HDD. Defaults to `PD_SSD`.
246246

247247
* `pricing_plan` - (Optional) Pricing plan for this instance, can only be `PER_USE`.
248248

@@ -375,8 +375,8 @@ to work, cannot be updated, and supports:
375375
* `client_key` - (Optional) PEM representation of the replica's private key. The
376376
corresponding public key in encoded in the `client_certificate`.
377377

378-
* `connect_retry_interval` - (Optional, Default: 60) The number of seconds
379-
between connect retries.
378+
* `connect_retry_interval` - (Optional) The number of seconds
379+
between connect retries. MySQL's default is 60 seconds.
380380

381381
* `dump_file_path` - (Optional) Path to a SQL file in GCS from which replica
382382
instances are created. Format is `gs://bucket/filename`.

0 commit comments

Comments
 (0)