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

[Bug]: Changing identifier in RDS Cluster and Cluster Instance (aws_rds_cluster & aws_rds_cluster_instance) forces recreate #41030

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MS99-9
Copy link
Contributor

@MS99-9 MS99-9 commented Jan 22, 2025

Description

This pull request addresses the mentioned issue by ensuring that changes to the cluster_identifier attribute of the aws_rds_cluster_instance resource along with cluster_identifier and cluster_identifier_prefix attributes of the aws_rds_cluster resource don't trigger a recreation of the resource. This is achieved by removing ForceNew: true on the mentioned schema definitions.

Neither of those resources should be force recreated as this change can be done no issues on AWS Console

Relations

Similar #34935
Relates #38599
Closes #38644

References

Output from Acceptance Testing

% make testacc P=3 TESTS=TestAccRDSClusterInstance_ PKG=rds

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3 -run='TestAccRDSClusterInstance_'  -timeout 360m -vet=off
2025/01/21 22:14:44 Initializing Terraform AWS Provider...
=== RUN   TestAccRDSClusterInstance_basic
=== PAUSE TestAccRDSClusterInstance_basic
=== RUN   TestAccRDSClusterInstance_disappears
=== PAUSE TestAccRDSClusterInstance_disappears
=== RUN   TestAccRDSClusterInstance_identifierGenerated
=== PAUSE TestAccRDSClusterInstance_identifierGenerated
=== RUN   TestAccRDSClusterInstance_identifierPrefix
=== PAUSE TestAccRDSClusterInstance_identifierPrefix
=== RUN   TestAccRDSClusterInstance_tags
=== PAUSE TestAccRDSClusterInstance_tags
=== RUN   TestAccRDSClusterInstance_isAlreadyBeingDeleted
=== PAUSE TestAccRDSClusterInstance_isAlreadyBeingDeleted
=== RUN   TestAccRDSClusterInstance_az
=== PAUSE TestAccRDSClusterInstance_az
=== RUN   TestAccRDSClusterInstance_kmsKey
=== PAUSE TestAccRDSClusterInstance_kmsKey
=== RUN   TestAccRDSClusterInstance_publiclyAccessible
=== PAUSE TestAccRDSClusterInstance_publiclyAccessible
=== RUN   TestAccRDSClusterInstance_copyTagsToSnapshot
=== PAUSE TestAccRDSClusterInstance_copyTagsToSnapshot
=== RUN   TestAccRDSClusterInstance_caCertificateIdentifier
=== PAUSE TestAccRDSClusterInstance_caCertificateIdentifier
=== RUN   TestAccRDSClusterInstance_monitoringInterval
=== PAUSE TestAccRDSClusterInstance_monitoringInterval
=== RUN   TestAccRDSClusterInstance_MonitoringRoleARN_enabledToDisabled
=== PAUSE TestAccRDSClusterInstance_MonitoringRoleARN_enabledToDisabled
=== RUN   TestAccRDSClusterInstance_MonitoringRoleARN_enabledToRemoved
=== PAUSE TestAccRDSClusterInstance_MonitoringRoleARN_enabledToRemoved
=== RUN   TestAccRDSClusterInstance_MonitoringRoleARN_removedToEnabled
=== PAUSE TestAccRDSClusterInstance_MonitoringRoleARN_removedToEnabled
=== RUN   TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1
=== PAUSE TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1
=== RUN   TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql
=== PAUSE TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql
=== RUN   TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1
=== PAUSE TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1
=== RUN   TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKeyToCustomKey
=== PAUSE TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKeyToCustomKey
=== RUN   TestAccRDSClusterInstance_performanceInsightsRetentionPeriod
=== PAUSE TestAccRDSClusterInstance_performanceInsightsRetentionPeriod
=== RUN   TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraPostgresql
=== PAUSE TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraPostgresql
=== RUN   TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraPostgresql_defaultKeyToCustomKey
=== PAUSE TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraPostgresql_defaultKeyToCustomKey
=== RUN   TestAccRDSClusterInstance_Replica_basic
=== PAUSE TestAccRDSClusterInstance_Replica_basic
=== CONT  TestAccRDSClusterInstance_basic
=== CONT  TestAccRDSClusterInstance_MonitoringRoleARN_enabledToDisabled
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKeyToCustomKey
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKeyToCustomKey (1245.82s)
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1
--- PASS: TestAccRDSClusterInstance_MonitoringRoleARN_enabledToDisabled (1374.06s)
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1
--- PASS: TestAccRDSClusterInstance_basic (1420.96s)
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql (893.25s)
=== CONT  TestAccRDSClusterInstance_MonitoringRoleARN_removedToEnabled
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1 (1295.62s)
=== CONT  TestAccRDSClusterInstance_MonitoringRoleARN_enabledToRemoved
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1 (1222.79s)
=== CONT  TestAccRDSClusterInstance_az
=== CONT  TestAccRDSClusterInstance_monitoringInterval
--- PASS: TestAccRDSClusterInstance_MonitoringRoleARN_removedToEnabled (1401.71s)
--- PASS: TestAccRDSClusterInstance_az (1358.14s)
=== CONT  TestAccRDSClusterInstance_caCertificateIdentifier
--- PASS: TestAccRDSClusterInstance_MonitoringRoleARN_enabledToRemoved (1433.98s)
=== CONT  TestAccRDSClusterInstance_copyTagsToSnapshot
--- PASS: TestAccRDSClusterInstance_copyTagsToSnapshot (1318.32s)
=== CONT  TestAccRDSClusterInstance_publiclyAccessible
--- PASS: TestAccRDSClusterInstance_monitoringInterval (1766.80s)
=== CONT  TestAccRDSClusterInstance_kmsKey
--- PASS: TestAccRDSClusterInstance_caCertificateIdentifier (1550.44s)
=== CONT  TestAccRDSClusterInstance_identifierPrefix
--- PASS: TestAccRDSClusterInstance_publiclyAccessible (1308.64s)
=== CONT  TestAccRDSClusterInstance_isAlreadyBeingDeleted
--- PASS: TestAccRDSClusterInstance_identifierPrefix (1231.74s)
=== CONT  TestAccRDSClusterInstance_tags
--- PASS: TestAccRDSClusterInstance_kmsKey (1365.03s)
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraPostgresql_defaultKeyToCustomKey
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraPostgresql_defaultKeyToCustomKey (900.68s)
=== CONT  TestAccRDSClusterInstance_Replica_basic
--- PASS: TestAccRDSClusterInstance_Replica_basic (3407.15s)
=== CONT  TestAccRDSClusterInstance_identifierGenerated
--- PASS: TestAccRDSClusterInstance_isAlreadyBeingDeleted (1216.98s)
=== CONT  TestAccRDSClusterInstance_disappears
--- PASS: TestAccRDSClusterInstance_tags (1403.32s)
=== CONT  TestAccRDSClusterInstance_performanceInsightsRetentionPeriod
--- PASS: TestAccRDSClusterInstance_disappears (1074.86s)
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraPostgresql
--- PASS: TestAccRDSClusterInstance_identifierGenerated (1265.95s)
--- PASS: TestAccRDSClusterInstance_performanceInsightsRetentionPeriod (1580.58s)
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraPostgresql (870.71s)
PASS
ok    github.com/hashicorp/terraform-provider-aws/internal/service/rds        11770.293s

...
% make testacc P=3 TESTS=TestAccRDSCluster_basic PKG=rds

make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/rds/... -v -count 1 -parallel 3 -run='TestAccRDSCluster_basic'  -timeout 360m -vet=off
2025/01/22 10:02:19 Initializing Terraform AWS Provider...
=== RUN   TestAccRDSCluster_basic
=== PAUSE TestAccRDSCluster_basic
=== CONT  TestAccRDSCluster_basic
--- PASS: TestAccRDSCluster_basic (144.73s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/rds        150.058s

...

@MS99-9 MS99-9 requested a review from a team as a code owner January 22, 2025 09:22
Copy link

Community Note

Voting for Prioritization

  • Please vote on this pull request by adding a 👍 reaction to the original post to help the community and maintainers prioritize this pull request.
  • Please see our prioritization guide for information on how we prioritize.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/rds Issues and PRs that pertain to the rds service. needs-triage Waiting for first response or review from a maintainer. labels Jan 22, 2025
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jan 22, 2025
@MS99-9
Copy link
Contributor Author

MS99-9 commented Jan 29, 2025

@justinretzolk @ewbankkit can you please take a look at this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/rds Issues and PRs that pertain to the rds service.
Projects
None yet
2 participants