Skip to content
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 cross-region replication support to AlloyDB #9012

Merged

Conversation

199201shubhamsahu
Copy link
Member

@199201shubhamsahu 199201shubhamsahu commented Sep 20, 2023

To Create a Secondary Cluster, cluster_type and secondary_config are the additional fields to be mentioned in the cluster.
The secondary cluster is dependent on the primary instance and the same needs to be added in the config using the depends_on field.
The field continuous_backup_config.enabled needs to be set false as continuous backup is not supported for secondary clusters.
The deletion_policy is set to FORCE as the secondary instance that will be created in the secondary cluster can not be deleted independently, but instead the entire secondary cluster needs to be deleted forcefully along with its secondary instance.

  cluster_type = "SECONDARY"
  deletion_policy = "FORCE"
  secondary_config {
    primary_cluster_name = <fully qualified primary cluster name>
    // Eg: primary_cluster_name = google_alloydb_cluster.<primary_cluster_name>.name
  }

  continuous_backup_config {
    enabled = false
  }

  depends_on = [google_alloydb_instance.<primary_instance_name>]

Part of hashicorp/terraform-provider-google#13251

Release Note Template for Downstream PRs (will be copied)

alloydb: added `cluster_type` and `secondary_config` fields to support secondary clusters in `google_alloydb_cluster` resource. 

@google-cla
Copy link

google-cla bot commented Sep 20, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a: Community Contributor Googler Core Contributor. Tests will run automatically.

@ScottSuarez, 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.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 4 files changed, 487 insertions(+))
Terraform Beta: Diff ( 4 files changed, 487 insertions(+))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 5 files changed, 136 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3080
Passed tests 2744
Skipped tests: 299
Affected tests: 37

Action taken

Found 37 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButClusterTypeIsPrimary|TestAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButMissingClusterTypeSecondary|TestAccAlloydbCluster_secondaryClusterMissingSecondaryConfig|TestAccAlloydbCluster_secondaryClusterMandatoryFields|TestAccAlloydbCluster_alloydbSecondaryClusterBasicExample|TestAccAlloydbCluster_AutomatedBackupPolicyHandlesMidnight|TestAccAlloydbCluster_continuousBackup_noChangeIfRemoved|TestAccAlloydbCluster_alloydbClusterFullExample|TestAccAlloydbCluster_maximumFields|TestAccAlloydbCluster_withNetworkConfig|TestAccAlloydbInstance_alloydbInstanceBasicExample|TestAccAlloydbCluster_continuousBackup_update_noChangeIfDefaultsSet|TestAccAlloydbCluster_continuousBackup_enabledByDefault|TestAccAlloydbCluster_deleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_addAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_withNetworkConfigAndAllocatedIPRange|TestAccAlloydbCluster_continuousBackup_update|TestAccAlloydbCluster_mandatoryFields|TestAccAlloydbCluster_alloydbClusterBasicExample|TestAccAlloydbCluster_update|TestAccAlloydbBackup_alloydbBackupFullExample|TestAccAlloydbBackup_alloydbBackupBasicExample|TestAccAlloydbInstance_createInstanceWithMandatoryFields|TestAccAlloydbCluster_deleteTimeBasedRetentionPolicy|TestAccAlloydbInstance_createPrimaryAndReadPoolInstance|TestAccAlloydbInstance_createInstanceWithMaximumFields|TestAccAlloydbCluster_restore|TestAccAlloydbInstance_update|TestAccAlloydbInstance_createInstanceWithNetworkConfigAndAllocatedIPRange|TestAccAlloydbInstance_updateDatabaseFlagInPrimaryInstance|TestAccAlloydbCluster_CMEKInAutomatedBackupIsUpdatable|TestAccAlloydbBackup_update|TestAccAlloydbCluster_usingCMEK|TestAccAlloydbBackup_usingCMEK|TestAccAlloydbCluster_continuousBackup_CMEKIsUpdatable|TestAccAlloydbCluster_missingWeeklySchedule|TestAccAlloydbBackup_createBackupWithMandatoryFields

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButClusterTypeIsPrimary[Debug log]
TestAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButMissingClusterTypeSecondary[Debug log]
TestAccAlloydbCluster_secondaryClusterMissingSecondaryConfig[Debug log]
TestAccAlloydbCluster_secondaryClusterMandatoryFields[Debug log]
TestAccAlloydbCluster_AutomatedBackupPolicyHandlesMidnight[Debug log]
TestAccAlloydbCluster_continuousBackup_noChangeIfRemoved[Debug log]
TestAccAlloydbCluster_alloydbClusterFullExample[Debug log]
TestAccAlloydbCluster_maximumFields[Debug log]
TestAccAlloydbCluster_withNetworkConfig[Debug log]
TestAccAlloydbInstance_alloydbInstanceBasicExample[Debug log]
TestAccAlloydbCluster_continuousBackup_update_noChangeIfDefaultsSet[Debug log]
TestAccAlloydbCluster_continuousBackup_enabledByDefault[Debug log]
TestAccAlloydbCluster_deleteAutomatedBackupPolicyAndInitialUser[Debug log]
TestAccAlloydbCluster_addAutomatedBackupPolicyAndInitialUser[Debug log]
TestAccAlloydbCluster_withNetworkConfigAndAllocatedIPRange[Debug log]
TestAccAlloydbCluster_continuousBackup_update[Debug log]
TestAccAlloydbCluster_mandatoryFields[Debug log]
TestAccAlloydbCluster_alloydbClusterBasicExample[Debug log]
TestAccAlloydbCluster_update[Debug log]
TestAccAlloydbBackup_alloydbBackupFullExample[Debug log]
TestAccAlloydbBackup_alloydbBackupBasicExample[Debug log]
TestAccAlloydbCluster_deleteTimeBasedRetentionPolicy[Debug log]
TestAccAlloydbCluster_restore[Debug log]
TestAccAlloydbInstance_update[Debug log]
TestAccAlloydbInstance_createInstanceWithNetworkConfigAndAllocatedIPRange[Debug log]
TestAccAlloydbCluster_CMEKInAutomatedBackupIsUpdatable[Debug log]
TestAccAlloydbBackup_update[Debug log]
TestAccAlloydbCluster_usingCMEK[Debug log]
TestAccAlloydbBackup_usingCMEK[Debug log]
TestAccAlloydbCluster_continuousBackup_CMEKIsUpdatable[Debug log]
TestAccAlloydbCluster_missingWeeklySchedule[Debug log]
TestAccAlloydbBackup_createBackupWithMandatoryFields[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccAlloydbCluster_alloydbSecondaryClusterBasicExample[Error message] [Debug log]
TestAccAlloydbInstance_createInstanceWithMandatoryFields[Error message] [Debug log]
TestAccAlloydbInstance_createPrimaryAndReadPoolInstance[Error message] [Debug log]
TestAccAlloydbInstance_createInstanceWithMaximumFields[Error message] [Debug log]
TestAccAlloydbInstance_updateDatabaseFlagInPrimaryInstance[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

Copy link
Contributor

@GauravJain21 GauravJain21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit for test files: indentation.

Copy link
Contributor

@ScottSuarez ScottSuarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does delete mean in this instance? How is the secondary cluster getting cleaned up ?

@199201shubhamsahu
Copy link
Member Author

What does delete mean in this instance? How is the secondary cluster getting cleaned up ?

Delete for secondary cluster is the same as the primary cluster because the same API is called with the same url and parameter. So no modification is needed.

Copy link
Contributor

@ScottSuarez ScottSuarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me if the other reviewer signs off as well

Copy link
Contributor

@ScottSuarez ScottSuarez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I just noticed the VCR failures. We'll need to fix those before moving forward. This change makes sense to me though in philosophy

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 4 files changed, 489 insertions(+))
Terraform Beta: Diff ( 4 files changed, 489 insertions(+))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 5 files changed, 136 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3082
Passed tests 2777
Skipped tests: 299
Affected tests: 6

Action taken

Found 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_alloydbSecondaryClusterBasicExample|TestAccAlloydbInstance_createPrimaryAndReadPoolInstance|TestAccAlloydbInstance_createInstanceWithMaximumFields|TestAccAlloydbInstance_updateDatabaseFlagInPrimaryInstance|TestAccAlloydbInstance_createInstanceWithMandatoryFields|TestAccDataSourceGoogleServiceAccountAccessToken_basic

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccAlloydbCluster_alloydbSecondaryClusterBasicExample[Debug log]
TestAccDataSourceGoogleServiceAccountAccessToken_basic[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccAlloydbInstance_createPrimaryAndReadPoolInstance[Error message] [Debug log]
TestAccAlloydbInstance_createInstanceWithMaximumFields[Error message] [Debug log]
TestAccAlloydbInstance_updateDatabaseFlagInPrimaryInstance[Error message] [Debug log]
TestAccAlloydbInstance_createInstanceWithMandatoryFields[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@GauravJain21
Copy link
Contributor

All of these tests are failing due to service networking issue that is being tracked here: #8904

Error: https://screenshot.googleplex.com/8vfrTwfM6sWqYG8
We should comment these tests, and re-enable them once the issue from service networking team is resolved.
I have created a bug here to track it and I will re-enable them once service networking issue is resolved. b/301367801

@199201shubhamsahu Please comment these tests and add their names in the bug attached above so that I will enable them afterwards. Before doing that, please check if these tests are passing on you machine or not.

The tests which are already attached in the bug were all passing on the local/cloudtop machine but were failing in the nightly run due to service networking issue attached above.

We shouldn't be blocked due an issue in an unrelated service to release our feature to Terraform.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 497 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 5 files changed, 497 insertions(+), 9 deletions(-))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 5 files changed, 136 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3081
Passed tests 2780
Skipped tests: 299
Affected tests: 2

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccWorkstationsWorkstationConfig_update|TestAccWorkstationsWorkstationConfig_updateHostDetails

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccWorkstationsWorkstationConfig_update[Debug log]
TestAccWorkstationsWorkstationConfig_updateHostDetails[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 5 files changed, 497 insertions(+), 9 deletions(-))
Terraform Beta: Diff ( 5 files changed, 497 insertions(+), 9 deletions(-))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 5 files changed, 136 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3081
Passed tests 2780
Skipped tests: 299
Affected tests: 2

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccDataprocJobIamPolicy|TestAccDataprocClusterIamPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccDataprocJobIamPolicy[Debug log]
TestAccDataprocClusterIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@ScottSuarez
Copy link
Contributor

@199201shubhamsahu could you pull changes into this PR so it can be merged? There are merge conflicts.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 4 files changed, 1233 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 4 files changed, 1233 insertions(+), 6 deletions(-))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 5 files changed, 164 insertions(+))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 4 files changed, 1156 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 4 files changed, 1156 insertions(+), 6 deletions(-))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 5 files changed, 157 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3138
Passed tests 2792
Skipped tests: 318
Affected tests: 28

Action taken

Found 28 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_secondaryClusterWithNetworkConfigAndAllocatedIPRange|TestAccAlloydbCluster_secondaryClusterWithNetworkConfig|TestAccAlloydbCluster_secondaryClusterAddAutomatedBackupPolicy|TestAccAlloydbCluster_secondaryClusterUsingCMEK|TestAccAlloydbCluster_secondaryClusterMandatoryFields|TestAccAlloydbCluster_alloydbSecondaryClusterBasicExample|TestAccAlloydbCluster_secondaryClusterUpdate|TestAccAlloydbBackup_alloydbBackupBasicExample|TestAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButClusterTypeIsPrimary|TestAccAlloydbCluster_secondaryClusterMissingSecondaryConfig|TestAccAlloydbUser_updateRoles_BuiltIn|TestAccAlloydbUser_alloydbUserBuiltinExample|TestAccAlloydbBackup_createBackupWithMandatoryFields|TestAccAlloydbUser_updateRoles_IAM|TestAccAlloydbUser_alloydbUserIamExample|TestAccAlloydbBackup_update|TestAccAlloydbUser_updatePassword_BuiltIn|TestAccAlloydbCluster_restore|TestAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButMissingClusterTypeSecondary|TestAccAlloydbBackup_usingCMEK|TestAccAlloydbInstance_createInstanceWithMandatoryFields|TestAccAlloydbInstance_createPrimaryAndReadPoolInstance|TestAccAlloydbInstance_alloydbInstanceBasicExample|TestAccAlloydbInstance_createInstanceWithNetworkConfigAndAllocatedIPRange|TestAccAlloydbInstance_update|TestAccAlloydbBackup_alloydbBackupFullExample|TestAccBigQueryDataTable_bigtable|TestAccDataprocJobIamPolicy

Get to know how VCR tests work

mmv1/products/alloydb/Cluster.yaml Show resolved Hide resolved
mmv1/products/alloydb/Cluster.yaml Show resolved Hide resolved
mmv1/templates/terraform/pre_update/alloydb_cluster.go.erb Outdated Show resolved Hide resolved
`, context)
}

func TestAccAlloydbCluster_secondaryClusterUsingCMEK(t *testing.T) {
Copy link
Member

@rileykarson rileykarson Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional: We could consolidate the other secondary settings into a _full test if you wanted! Setting the fields at least once is the target.

Other than TestAccAlloydbCluster_secondaryClusterAddAutomatedBackupPolicy since that's an error. When we get to promotion we'll want to test promoting + setting that at the same time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other fields like initial_user, continuous_backup_config, automated_backup_policy can not be enabled or set, so keeping only basic secondary cluster.

Please let me know if you meant something else by _full test

Yes, will add all possible tests that exists in primary cluster to the promoted cluster tests as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non-blocking: We should document those fields not being available for secondary clusters somewhere.

mmv1/products/alloydb/Cluster.yaml Show resolved Hide resolved
@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterWithNetworkConfigAndAllocatedIPRange[Debug log]
TestAccAlloydbCluster_secondaryClusterWithNetworkConfig[Debug log]
TestAccAlloydbCluster_secondaryClusterAddAutomatedBackupPolicy[Debug log]
TestAccAlloydbCluster_secondaryClusterUsingCMEK[Debug log]
TestAccAlloydbCluster_secondaryClusterMandatoryFields[Debug log]
TestAccAlloydbCluster_alloydbSecondaryClusterBasicExample[Debug log]
TestAccAlloydbBackup_alloydbBackupBasicExample[Debug log]
TestAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButClusterTypeIsPrimary[Debug log]
TestAccAlloydbCluster_secondaryClusterMissingSecondaryConfig[Debug log]
TestAccAlloydbUser_updateRoles_BuiltIn[Debug log]
TestAccAlloydbUser_alloydbUserBuiltinExample[Debug log]
TestAccAlloydbBackup_createBackupWithMandatoryFields[Debug log]
TestAccAlloydbUser_updateRoles_IAM[Debug log]
TestAccAlloydbUser_alloydbUserIamExample[Debug log]
TestAccAlloydbBackup_update[Debug log]
TestAccAlloydbUser_updatePassword_BuiltIn[Debug log]
TestAccAlloydbCluster_restore[Debug log]
TestAccAlloydbCluster_secondaryClusterDefinedSecondaryConfigButMissingClusterTypeSecondary[Debug log]
TestAccAlloydbBackup_usingCMEK[Debug log]
TestAccAlloydbInstance_createInstanceWithMandatoryFields[Debug log]
TestAccAlloydbInstance_createPrimaryAndReadPoolInstance[Debug log]
TestAccAlloydbInstance_alloydbInstanceBasicExample[Debug log]
TestAccAlloydbInstance_createInstanceWithNetworkConfigAndAllocatedIPRange[Debug log]
TestAccAlloydbInstance_update[Debug log]
TestAccAlloydbBackup_alloydbBackupFullExample[Debug log]
TestAccBigQueryDataTable_bigtable[Debug log]
TestAccDataprocJobIamPolicy[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccAlloydbCluster_secondaryClusterUpdate[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 4 files changed, 1163 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 4 files changed, 1163 insertions(+), 6 deletions(-))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 5 files changed, 157 insertions(+))

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 4 files changed, 1135 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 4 files changed, 1135 insertions(+), 6 deletions(-))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 4 files changed, 155 insertions(+))

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One missing immutable, otherwise LGTM.

mmv1/products/alloydb/Cluster.yaml Show resolved Hide resolved
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

Terraform GA: Diff ( 4 files changed, 1136 insertions(+), 6 deletions(-))
Terraform Beta: Diff ( 4 files changed, 1136 insertions(+), 6 deletions(-))
TF Conversion: Diff ( 1 file changed, 39 insertions(+))
TF OiCS: Diff ( 4 files changed, 155 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3143
Passed tests 2815
Skipped tests: 318
Affected tests: 10

Action taken

Found 10 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccAlloydbCluster_update|TestAccAlloydbCluster_addAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_continuousBackup_update|TestAccAlloydbCluster_secondaryClusterUpdate|TestAccAlloydbCluster_CMEKInAutomatedBackupIsUpdatable|TestAccAlloydbCluster_secondaryClusterAddAutomatedBackupPolicy|TestAccAlloydbCluster_continuousBackup_CMEKIsUpdatable|TestAccAlloydbCluster_deleteAutomatedBackupPolicyAndInitialUser|TestAccAlloydbCluster_AutomatedBackupPolicyHandlesMidnight|TestAccAlloydbCluster_restore

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccAlloydbCluster_update[Debug log]
TestAccAlloydbCluster_addAutomatedBackupPolicyAndInitialUser[Debug log]
TestAccAlloydbCluster_continuousBackup_update[Debug log]
TestAccAlloydbCluster_secondaryClusterUpdate[Debug log]
TestAccAlloydbCluster_CMEKInAutomatedBackupIsUpdatable[Debug log]
TestAccAlloydbCluster_secondaryClusterAddAutomatedBackupPolicy[Debug log]
TestAccAlloydbCluster_continuousBackup_CMEKIsUpdatable[Debug log]
TestAccAlloydbCluster_deleteAutomatedBackupPolicyAndInitialUser[Debug log]
TestAccAlloydbCluster_AutomatedBackupPolicyHandlesMidnight[Debug log]
TestAccAlloydbCluster_restore[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

@rileykarson rileykarson merged commit 79d5d56 into GoogleCloudPlatform:main Oct 10, 2023
6 checks passed
cheftako added a commit to cheftako/k8s-config-connector that referenced this pull request Mar 25, 2024
Backport hashicorp/terraform-provider-google-beta#6474

To Create a Secondary Cluster, `cluster_type` and `secondary_config` are the additional fields to be mentioned in the cluster. The secondary cluster is dependent on the primary instance and the same needs to be added in the config using the `depends_on` field. The field continuous_backup_config.enabled needs to be set false as continuous backup is not supported for secondary clusters. The deletion_policy is set to FORCE as the secondary instance that will be created in the secondary cluster can not be deleted independently, but instead the entire secondary cluster needs to be deleted forcefully along with its secondary instance.

```
  cluster_type = "SECONDARY"
  deletion_policy = "FORCE"
  secondary_config {
    primary_cluster_name = <fully qualified primary cluster name>
    // Eg: primary_cluster_name = google_alloydb_cluster.<primary_cluster_name>.name
  }

  continuous_backup_config {
    enabled = false
  }

  depends_on = [google_alloydb_instance.<primary_instance_name>]
```

Part of [hashicorp/terraform-provider-google#13251](hashicorp/terraform-provider-google#13251)

**Release Note Template for Downstream PRs (will be copied)**

```
alloydb: added `cluster_type` and `secondary_config` fields to support secondary clusters in `google_alloydb_cluster` resource.
```

Derived from [GoogleCloudPlatform/magic-modules#9012](GoogleCloudPlatform/magic-modules#9012)
cheftako added a commit to cheftako/k8s-config-connector that referenced this pull request Mar 25, 2024
Backport hashicorp/terraform-provider-google-beta#6474

To Create a Secondary Cluster, `cluster_type` and `secondary_config` are the additional fields to be mentioned in the cluster. The secondary cluster is dependent on the primary instance and the same needs to be added in the config using the `depends_on` field. The field continuous_backup_config.enabled needs to be set false as continuous backup is not supported for secondary clusters. The deletion_policy is set to FORCE as the secondary instance that will be created in the secondary cluster can not be deleted independently, but instead the entire secondary cluster needs to be deleted forcefully along with its secondary instance.

```
  cluster_type = "SECONDARY"
  deletion_policy = "FORCE"
  secondary_config {
    primary_cluster_name = <fully qualified primary cluster name>
    // Eg: primary_cluster_name = google_alloydb_cluster.<primary_cluster_name>.name
  }

  continuous_backup_config {
    enabled = false
  }

  depends_on = [google_alloydb_instance.<primary_instance_name>]
```

Part of [hashicorp/terraform-provider-google#13251](hashicorp/terraform-provider-google#13251)

**Release Note Template for Downstream PRs (will be copied)**

```
alloydb: added `cluster_type` and `secondary_config` fields to support secondary clusters in `google_alloydb_cluster` resource.
```

Derived from [GoogleCloudPlatform/magic-modules#9012](GoogleCloudPlatform/magic-modules#9012)
@199201shubhamsahu 199201shubhamsahu deleted the alloydb-crr-support branch April 11, 2024 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants