-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note that this commit is still a work in progress as the final SDK changes required for its use are not deployed yet.
- Loading branch information
Showing
15 changed files
with
1,342 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "cockroach_backup_config Resource - terraform-provider-cockroach" | ||
subcategory: "" | ||
description: |- | ||
The backup settings for a cluster. | ||
Each cluster has backup settings that determine if backups are enabled, | ||
how frequently they are taken, and how long they are retained for. | ||
The cockroach_backup_config resource allows you to manage backup | ||
settings. It's important to note that the existence, or lack of this resource | ||
does not indicate whether a backup configuration exists or not. If | ||
the cockroach_backup_config resource exists, it indicates that Terraform is | ||
managing the backup configuration. | ||
As a result, removing the resource from the Terraform configuration will not | ||
affect the settings in the backup configuration. | ||
retention_days Edit Restrictions | ||
retention_days can only be set once. It is necessary to open a | ||
support ticket to modify the setting again. For this reason, consider the | ||
following when managing the value in Terraform: | ||
* (Optional) Refrain from including retention_days in the Terraform resource to | ||
rely on server-side management of the value instead. | ||
* If the initial value for retention_days in | ||
the cockroach_backup_config resource is the default value (i.e. 30), it will be | ||
possible to modify the retention setting one more time. | ||
* If the initial value set for retention_days in | ||
the cockroach_backup_config resource is not the default, it will not be | ||
possible to modify the retention setting again. Further modifications will | ||
require a support ticket. | ||
Changing the value of retention_days after using your one change will be a | ||
multi-step operation. Here are two workflows that will work. Both of these | ||
options assume you already have a cockroach_backup_config resource | ||
that can no longer be updated: | ||
Change it and then open a ticket before applying: | ||
Update retention_days to the new value in Terraform.Before applying the run, contact support to change the retention_days to the new value.Apply the changes in Terraform. A Terraform READ operation will complete, | ||
recognize the existing value, and update the tf state.Temporarily remove management of the resource from Terraform, update it via | ||
ticket, and then add it back. | ||
Remove management of retention_days from the Terraform resourceRun the apply. Nothing will change but Terraform is no longer managing that value.Open a support ticket to update retention_days to the new value.(Optional) Add retention_days back to the Terraform config with the | ||
new value and apply the no-op update. | ||
--- | ||
|
||
# cockroach_backup_config (Resource) | ||
|
||
The backup settings for a cluster. | ||
|
||
Each cluster has backup settings that determine if backups are enabled, | ||
how frequently they are taken, and how long they are retained for. | ||
The `cockroach_backup_config` resource allows you to manage backup | ||
settings. It's important to note that the existence, or lack of this resource | ||
does not indicate whether a backup configuration exists or not. If | ||
the `cockroach_backup_config` resource exists, it indicates that Terraform is | ||
managing the backup configuration. | ||
|
||
As a result, removing the resource from the Terraform configuration will not | ||
affect the settings in the backup configuration. | ||
|
||
### `retention_days` Edit Restrictions | ||
|
||
`retention_days` can only be set once. It is necessary to open a | ||
support ticket to modify the setting again. For this reason, consider the | ||
following when managing the value in Terraform: | ||
* (Optional) Refrain from including `retention_days` in the Terraform resource to | ||
rely on server-side management of the value instead. | ||
* If the initial value for `retention_days` in | ||
the `cockroach_backup_config` resource is the default value (i.e. 30), it will be | ||
possible to modify the retention setting one more time. | ||
* If the initial value set for `retention_days` in | ||
the `cockroach_backup_config` resource is not the default, it will not be | ||
possible to modify the retention setting again. Further modifications will | ||
require a support ticket. | ||
|
||
Changing the value of `retention_days` after using your one change will be a | ||
multi-step operation. Here are two workflows that will work. Both of these | ||
options assume you already have a `cockroach_backup_config` resource | ||
that can no longer be updated: | ||
|
||
* Change it and then open a ticket before applying: | ||
1. Update `retention_days` to the new value in Terraform. | ||
1. Before applying the run, contact support to change the `retention_days` to the new value. | ||
1. Apply the changes in Terraform. A Terraform READ operation will complete, | ||
recognize the existing value, and update the tf state. | ||
* Temporarily remove management of the resource from Terraform, update it via | ||
ticket, and then add it back. | ||
1. Remove management of `retention_days` from the Terraform resource | ||
1. Run the apply. Nothing will change but Terraform is no longer managing that value. | ||
1. Open a support ticket to update `retention_days` to the new value. | ||
1. (Optional) Add `retention_days` back to the Terraform config with the | ||
new value and apply the no-op update. | ||
|
||
## Example Usage | ||
|
||
```terraform | ||
resource "cockroach_backup_config" "backed_up_cluster" { | ||
id = cockroach_cluster.backed_up_cluster.id | ||
enabled = true | ||
frequence_minutes = 60 | ||
retention_days = 30 | ||
} | ||
resource "cockroach_backup_config" "no_backups_cluster" { | ||
id = cockroach_cluster.no_backups_cluster.id | ||
enabled = false | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `enabled` (Boolean) Indicates whether backups are enabled. If set to false, no backups will be created. | ||
- `id` (String) Cluster ID. | ||
|
||
### Optional | ||
|
||
- `frequency_minutes` (Number) The frequency of backups in minutes. Valid values are [5, 10, 15, 30, 60, 240, 1440] | ||
- `retention_days` (Number) The number of days to retain backups for. Valid values are [2, 7, 30, 90, 365]. Can only be set once, further changes require opening a support ticket. [See more](#retention_days-edit-restrictions). | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# format <resource> <cluster id> | ||
terraform import cockroach_backup_config.backed_up_cluster 1f69fdd2-600a-4cfc-a9ba-16995df0d77d | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# format <resource> <cluster id> | ||
terraform import cockroach_backup_config.backed_up_cluster 1f69fdd2-600a-4cfc-a9ba-16995df0d77d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
resource "cockroach_backup_config" "backed_up_cluster" { | ||
id = cockroach_cluster.backed_up_cluster.id | ||
enabled = true | ||
frequence_minutes = 60 | ||
retention_days = 30 | ||
} | ||
|
||
resource "cockroach_backup_config" "no_backups_cluster" { | ||
id = cockroach_cluster.no_backups_cluster.id | ||
enabled = false | ||
} |
Oops, something went wrong.