-
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,327 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,117 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "cockroach_backup_config Resource - terraform-provider-cockroach" | ||
subcategory: "" | ||
description: |- | ||
The backup configuration for a cluster. | ||
Each cluster has a backup configuration that determines if backups are enabled, | ||
how frequently they are taken and how often they are retained for. This | ||
resource allows configuring those settings. It's important to note that the | ||
existence or lack of this resource doesn't not indicate whether a backup | ||
configuration exists or not. Rather, if Terraform is managing it or not. | ||
As a result of this, removal of the resource from the Terraform configuration | ||
will leave the backup configuration in the state it was before the removal. | ||
retention_days Edit Restrictions | ||
retention_days can only be set once. Further changes require opening a support | ||
ticket. For this reason, managing the value via terraform can require special | ||
care. Here are some useful tips: | ||
* Optionally, you can refrain from including retention_days in the | ||
terraform resource to fully rely on server side management of the value and not need any | ||
special care. | ||
* If the initial value for retention_days in the backupconfig resource is the | ||
default value (30), the single edit will not be used up and it can be changed one | ||
more time. | ||
* If the initial value set for retention_days in the backupconfig resource is | ||
not the default, the single edit will be used up on the first apply. Further | ||
edits 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 | ||
paths assume you already have a backup config resource that doesn't have any | ||
updates left: | ||
Change it and then open a ticket before applying: | ||
Update retention_days to the new desired value in terraform.Before applying the run, contact support to change the retention_days to the desired value.Apply the changes in terraform, a terraform READ operation will be done and see the existing value and update the tf state.Temporarily remove management of it from tf, 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 desired value.Optionally, add retention_days back to the terraform config with the new value and apply the no-op update. | ||
--- | ||
|
||
# cockroach_backup_config (Resource) | ||
|
||
The backup configuration for a cluster. | ||
|
||
Each cluster has a backup configuration that determines if backups are enabled, | ||
how frequently they are taken and how often they are retained for. This | ||
resource allows configuring those settings. It's important to note that the | ||
existence or lack of this resource doesn't not indicate whether a backup | ||
configuration exists or not. Rather, if Terraform is managing it or not. | ||
|
||
As a result of this, removal of the resource from the Terraform configuration | ||
will leave the backup configuration in the state it was before the removal. | ||
|
||
### `retention_days` Edit Restrictions | ||
|
||
`retention_days` can only be set once. Further changes require opening a support | ||
ticket. For this reason, managing the value via terraform can require special | ||
care. Here are some useful tips: | ||
* Optionally, you can refrain from including `retention_days` in the | ||
terraform resource to fully rely on server side management of the value and not need any | ||
special care. | ||
* If the initial value for `retention_days` in the backup_config resource is the | ||
default value (30), the single edit will not be used up and it can be changed one | ||
more time. | ||
* If the initial value set for `retention_days` in the backup_config resource is | ||
not the default, the single edit will be used up on the first apply. Further | ||
edits 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 | ||
paths assume you already have a backup config resource that doesn't have any | ||
updates left: | ||
|
||
* Change it and then open a ticket before applying: | ||
1. Update `retention_days` to the new desired value in terraform. | ||
1. Before applying the run, contact support to change the `retention_days` to the desired value. | ||
1. Apply the changes in terraform, a terraform READ operation will be done and see the existing value and update the tf state. | ||
* Temporarily remove management of it from tf, 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 desired value. | ||
1. Optionally, 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 the backup configuration is 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.