Add support for restoring AlloyDB clusters via backup restore and PITR#8575
Conversation
…c-modules into marcfont/cbr Merge with main
|
Hello! I am a robot. It looks like you are a community contributor. @NickElliot, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
Hi Nick, I added an example file I am not quite sure how to validate that everything is set up the example correctly. Do you know if there's a way to see the markdown output, i.e. https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/alloydb_cluster? |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 5 files changed, 1385 insertions(+), 2 deletions(-)) |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 897 insertions(+), 2 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccAlloydbCluster_restore|TestAccAlloydbCluster_alloydbClusterRestoreExample |
|
Rerun these tests in REPLAYING mode to catch issues
|
| - !ruby/object:Api::Type::String | ||
| name: 'restoreSourceBackup' | ||
| ignore_read: true | ||
| immutable: true | ||
| conflicts: | ||
| - restore_source_cluster | ||
| - restore_point_in_time | ||
| description: | | ||
| The name of the backup that this cluster should be restored from. Conflicts with 'restore_source_cluster' and 'restore_point_in_time', both can't be set together. | ||
| - !ruby/object:Api::Type::String | ||
| name: 'restoreSourceCluster' | ||
| ignore_read: true | ||
| immutable: true | ||
| required_with: | ||
| - restore_point_in_time | ||
| conflicts: | ||
| - restore_source_backup | ||
| description: | | ||
| The name of the source cluster that this cluster should be restored from. The source cluster must have continuous | ||
| backup enabled for restore to succeed. Requires `restore_point_in_time` to also be set. | ||
|
|
||
| Conflicts with 'restore_source_backup', both can't be set together. | ||
| - !ruby/object:Api::Type::String | ||
| name: 'restorePointInTime' | ||
| ignore_read: true | ||
| immutable: true | ||
| required_with: | ||
| - restore_source_cluster | ||
| conflicts: | ||
| - restore_source_backup | ||
| description: | | ||
| The point in time that this cluster should be restored to, in RFC 3339 format. Requires `restore_source_cluster` to also be set. | ||
|
|
||
| Conflicts with 'restore_source_backup', both can't be set together. |
There was a problem hiding this comment.
Thanks for the explanation. I'd suggest that we keep the same structure as the API, as I feel that it may be slightly easier to read. Also it may be easier to keep in sync if more fields are added in the future.
|
|
||
| if restoreBackup != nil || restoreSourceCluster != nil { | ||
| // Use restore API if this is a restore instead of a create cluster call | ||
| url = strings.Replace(url, "clusters?clusterId", "clusters:restore?clusterId", 1) |
There was a problem hiding this comment.
Sorry I was not clear earlier. By "users can also specify cluster settings via restore", I mean if users specify any fields in the cluster object, what will it happen if it conflicts with the source it restores from. I'm not super familiar with the resource, and it seems that you've already answered the question in your earlier response that "cluster has no overlap with the source field". Then I think it should be fine.
|
Replying to #8575 (comment) - I understand your question now. The source cluster and destination cluster do not impact each other. Whatever is set in the destination cluster is what will be applied, and the restore doesn't care at all about the source cluster configuration. The restore will not copy any state from the source cluster. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Breaking Change(s) DetectedThe following breaking change(s) were detected within your pull request.
If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 882 insertions(+), 46 deletions(-)) |
1 similar comment
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Breaking Change(s) DetectedThe following breaking change(s) were detected within your pull request.
If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 882 insertions(+), 46 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccAlloydbCluster_restore |
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccAlloydbCluster_restore|TestAccDataLossPreventionStoredInfoType_dlpStoredInfoTypeGroupIndexUpdate|TestAccDataLossPreventionJobTrigger_dlpJobTriggerInspectCustomInfoTypes |
|
|
|
Rerun these tests in REPLAYING mode to catch issues
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 882 insertions(+), 2 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccAlloydbCluster_restore |
|
Rerun these tests in REPLAYING mode to catch issues
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 882 insertions(+), 2 deletions(-)) |
Tests analyticsTotal tests: Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccDataplexDatascan_dataplexDatascanFullProfileExample|TestAccDataplexDatascan_dataplexDatascanBasicQualityExample|TestAccDataSourceGoogleServiceAccountIdToken_impersonation |
|
Rerun these tests in REPLAYING mode to catch issues
|
shuyama1
left a comment
There was a problem hiding this comment.
Thanks for adding thorough tests!
GoogleCloudPlatform#8575) Co-authored-by: Nick Elliot <nickelliot@google.com> Co-authored-by: Shuya Ma <87669292+shuyama1@users.noreply.github.com>
GoogleCloudPlatform#8575) Co-authored-by: Nick Elliot <nickelliot@google.com> Co-authored-by: Shuya Ma <87669292+shuyama1@users.noreply.github.com>
Add support for restoring AlloyDB clusters via backup restore and PITR.
To restore a cluster directly from a backup, add the following line to your AlloyDB cluster:
To restore a cluster via PITR, add the following lines to your AlloyDB cluster:
Part of hashicorp/terraform-provider-google#13757. I am not fully closing the issue because I did not yet add support for data calls for backups as requested.
If this PR is for Terraform, I acknowledge that I have:
make testandmake lintin the generated providers to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)