Skip to content

Conversation

tabito-hara
Copy link
Contributor

@tabito-hara tabito-hara commented Oct 4, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

Analysis

  • aws_rds_cluster monitoring_interval inconsistencies and errors #43487 reported that when an aws_rds_cluster_instance resource was created as an instance member of an aws_rds_cluster resource with monitoring_interval specified, the monitoring_interval of the instance was set to the same value as the cluster.
  • However, when running terraform plan again, the AWS Provider showed a persistent drift to update the monitoring_interval argument of aws_rds_cluster_instance to 0.
    • This occurs because the monitoring_interval argument of aws_rds_cluster_instance had Default: 0. Since it was not explicitly specified in the configuration, the AWS Provider planned to reset it to 0.
    • As the monitoring_interval value in aws_rds_cluster_instance can be derived from the corresponding value in aws_rds_cluster, it should be marked as Computed. The issue was caused by the missing Computed attribute for this argument.

Changes

  • Change the monitoring_interval argument of aws_rds_cluster_instance from Default: 0 to Computed: true.
    • Since the argument type is TypeInt, the value 0 is treated the same as nil when sent to the AWS API, meaning it is not included in API requests. However, it is still stored as 0 in the Terraform state.
      • This behavior is verified in the basic acceptance test with an additional check.
    • Therefore, although the argument behavior changes to Optional and Computed, changing it from Default to Computed does not alter the existing resource behavior.
    • Because the argument is now both Optional and Computed, Terraform does not detect drift when it is not explicitly specified in the configuration. This behavior is documented in the argument’s description.

Acceptance Tests

  • The newly added acceptance test verifies that the monitoring_interval value in aws_rds_cluster is inherited by the corresponding aws_rds_cluster_instance with this change and no persistent drift are shown.

Relations

Closes #43487

Output from Acceptance Testing

$ make testacc TESTS='TestAccRDSClusterInstance_' PKG=rds
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 b-aws_rds_cluster_instance-mark_monitoring_interval_computed 🌿...
TF_ACC=1 go1.24.6 test ./internal/service/rds/... -v -count 1 -parallel 20 -run='TestAccRDSClusterInstance_'  -timeout 360m -vet=off
2025/10/04 23:49:07 Creating Terraform AWS Provider (SDKv2-style)...
2025/10/04 23:49:07 Initializing Terraform AWS Provider (SDKv2-style)...
=== 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
=== RUN   TestAccRDSClusterInstance_clusterLevelMonitoringInterval
=== PAUSE TestAccRDSClusterInstance_clusterLevelMonitoringInterval
=== CONT  TestAccRDSClusterInstance_basic
=== CONT  TestAccRDSClusterInstance_MonitoringRoleARN_enabledToDisabled
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKeyToCustomKey
=== CONT  TestAccRDSClusterInstance_az
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1
=== CONT  TestAccRDSClusterInstance_copyTagsToSnapshot
=== CONT  TestAccRDSClusterInstance_monitoringInterval
=== CONT  TestAccRDSClusterInstance_caCertificateIdentifier
=== CONT  TestAccRDSClusterInstance_identifierPrefix
=== CONT  TestAccRDSClusterInstance_isAlreadyBeingDeleted
=== CONT  TestAccRDSClusterInstance_tags
=== CONT  TestAccRDSClusterInstance_identifierGenerated
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraPostgresql
=== CONT  TestAccRDSClusterInstance_MonitoringRoleARN_removedToEnabled
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraPostgresql_defaultKeyToCustomKey
=== CONT  TestAccRDSClusterInstance_MonitoringRoleARN_enabledToRemoved
=== CONT  TestAccRDSClusterInstance_clusterLevelMonitoringInterval
=== CONT  TestAccRDSClusterInstance_Replica_basic
=== CONT  TestAccRDSClusterInstance_disappears
=== CONT  TestAccRDSClusterInstance_publiclyAccessible
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraPostgresql (692.68s)
=== CONT  TestAccRDSClusterInstance_performanceInsightsRetentionPeriod
--- PASS: TestAccRDSClusterInstance_identifierGenerated (708.71s)
=== CONT  TestAccRDSClusterInstance_kmsKey
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraMySQL1 (772.28s)
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql
--- PASS: TestAccRDSClusterInstance_MonitoringRoleARN_enabledToRemoved (774.83s)
=== CONT  TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1
--- PASS: TestAccRDSClusterInstance_basic (798.69s)
--- PASS: TestAccRDSClusterInstance_identifierPrefix (831.63s)
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraPostgresql_defaultKeyToCustomKey (836.18s)
--- PASS: TestAccRDSClusterInstance_copyTagsToSnapshot (867.43s)
--- PASS: TestAccRDSClusterInstance_isAlreadyBeingDeleted (878.31s)
--- PASS: TestAccRDSClusterInstance_az (884.56s)
--- PASS: TestAccRDSClusterInstance_disappears (901.54s)
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsKMSKeyIDAuroraMySQL1_defaultKeyToCustomKey (928.12s)
--- PASS: TestAccRDSClusterInstance_MonitoringRoleARN_removedToEnabled (1109.39s)
--- PASS: TestAccRDSClusterInstance_MonitoringRoleARN_enabledToDisabled (1236.42s)
--- PASS: TestAccRDSClusterInstance_publiclyAccessible (1292.86s)
--- PASS: TestAccRDSClusterInstance_caCertificateIdentifier (1311.93s)
--- PASS: TestAccRDSClusterInstance_tags (1389.11s)
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsEnabled_auroraPostgresql (700.00s)
--- PASS: TestAccRDSClusterInstance_kmsKey (886.28s)
--- PASS: TestAccRDSClusterInstance_monitoringInterval (1624.59s)
--- PASS: TestAccRDSClusterInstance_PerformanceInsightsKMSKeyID_auroraMySQL1 (903.03s)
--- PASS: TestAccRDSClusterInstance_clusterLevelMonitoringInterval (1882.74s)
--- PASS: TestAccRDSClusterInstance_performanceInsightsRetentionPeriod (1313.23s)
--- PASS: TestAccRDSClusterInstance_Replica_basic (2975.25s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/rds        2979.512s

Copy link
Contributor

github-actions bot commented Oct 4, 2025

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • 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 needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/rds Issues and PRs that pertain to the rds service. size/L Managed by automation to categorize the size of a PR. labels Oct 4, 2025
@tabito-hara tabito-hara marked this pull request as ready for review October 4, 2025 16:40
@tabito-hara tabito-hara requested a review from a team as a code owner October 4, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. needs-triage Waiting for first response or review from a maintainer. service/rds Issues and PRs that pertain to the rds service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_rds_cluster monitoring_interval inconsistencies and errors
1 participant