-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backup_config attribute to cockroach_cluster resource #242
Add backup_config attribute to cockroach_cluster resource #242
Conversation
This brings in sdk changes for controlling backup configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The markdown files lgtm! All comments non-blocking, optional nits.
@@ -28,6 +28,7 @@ data "cockroach_cluster" "cockroach" { | |||
### Read-Only | |||
|
|||
- `account_id` (String) The cloud provider account ID that hosts the cluster. Needed for CMEK and other advanced features. | |||
- `backup_config` (Attributes) (see [below for nested schema](#nestedatt--backup_config)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `backup_config` (Attributes) (see [below for nested schema](#nestedatt--backup_config)) | |
- `backup_config` (Attributes) Refer to [Nested Schema for `backup_config`](#nestedatt--backup_config). |
That change might be overly doc-sy.
Do you need the anchor link <a id="nestedatt--backup_config"></a>
? Would it work to just use the heading as the link, so it would probably be (#nested-schema-for-backup_config). I'm assuming this works the same as other .md files, but maybe I'm wrong!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all generated automatically. We could customize it, but I'm unclear if we could do it in a way that wouldn't provide ongoing maintenance. It may be possible but It would need to be considered for a separate project and would need to be prioritized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, makes sense!
|
||
Changing the value of `backup_config.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 modified retention_days once and as a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these options assume you already have modified retention_days once and as a | |
these options assume you already have modified `retention_days` once and as a |
these options assume you already have modified retention_days once and as a | ||
result must open a support ticket: | ||
|
||
* Change it and then open a ticket before applying: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Change it and then open a ticket before applying: | |
* Change it, and then open a ticket before applying the change to Terraform. To do this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional nit; just trying to connect the numbered steps to this sentence.
1. Update `backup_config.retention_days` to the new value in Terraform. | ||
1. Before applying the run, contact support to change | ||
`backup_config.retention_days` to the new value. | ||
1. Apply the changes in Terraform. A Terraform READ operation will complete, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Apply the changes in Terraform. A Terraform READ operation will complete, | |
1. Apply the changes in Terraform. A Terraform `READ` operation will complete, |
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 `backup_config.retention_days` from | ||
Terraform, update it via ticket, and then add it back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terraform, update it via ticket, and then add it back. | |
Terraform, update it via ticket, and then add it back. To do this: |
CHANGELOG.md
Outdated
- management of cluster backup settings is now supported using the | ||
`backup_config` attribute on the `cockroach_cluster` resource. See | ||
[Cluster Backups](https://www.cockroachlabs.com/docs/cockroachcloud/managed-backups) | ||
for more information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- management of cluster backup settings is now supported using the | |
`backup_config` attribute on the `cockroach_cluster` resource. See | |
[Cluster Backups](https://www.cockroachlabs.com/docs/cockroachcloud/managed-backups) | |
for more information. | |
- Management of cluster backup settings is now supported using the | |
`backup_config` attribute on the `cockroach_cluster` resource. For more information, refer to | |
[Cluster Backups](https://www.cockroachlabs.com/docs/cockroachcloud/managed-backups). |
these options assume you already have modified retention_days once and as a | ||
result must open a support ticket: | ||
|
||
* Change it and then open a ticket before applying: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Change it and then open a ticket before applying: | |
* Change it, and then open a ticket before applying the change to Terraform. To do this: |
* Temporarily remove management of the `backup_config.retention_days` from | ||
Terraform, update it via ticket, and then add it back. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Temporarily remove management of the `backup_config.retention_days` from | |
Terraform, update it via ticket, and then add it back. | |
* Temporarily remove management of the `backup_config.retention_days` from | |
Terraform, update it via ticket, and then add it back. To do this: |
|
||
Changing the value of `backup_config.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 modified retention_days once and as a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these options assume you already have modified retention_days once and as a | |
these options assume you already have modified `retention_days` once and as a |
1. Update `backup_config.retention_days` to the new value in Terraform. | ||
1. Before applying the run, contact support to change | ||
`backup_config.retention_days` to the new value. | ||
1. Apply the changes in Terraform. A Terraform READ operation will complete, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Apply the changes in Terraform. A Terraform READ operation will complete, | |
1. Apply the changes in Terraform. A Terraform `READ` operation will complete, |
8b59700
to
29282c1
Compare
Thanks for your attention on this @kathancox . I've made the requested changes here. |
The ability to manage backup configurations for clusters is added here.
29282c1
to
25b0dd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM looks great, I think this looks much better than having it as its own resource.
The ability to manage backup configurations for clusters is added here.
Note that this is an alternate approach to #241 . Here we add the backup_config as an attribute on the cluster resource instead of giving it a dedicated resource. This pattern is more in line with our other resources because conceptually, the backup configuration for a cluster exists whether or not it is being managed in terraform.
@kathancox I've copied most of the documentation over directly from the other PR that you reviewed. There were some changes in format because now that the backup config is attached to an attribute, there wasn't as much room to put the large block of text necessary for documenting the work arounds for setting retention days. Instead, I created a separate page as a "guide" for this purpose.
Commit checklist
make generate
)