r/aws_rds_cluster_instance: Change monitoring_interval
from Default
to Computed
to inherit the value from the cluster
#44544
+158
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_instance
resource was created as an instance member of anaws_rds_cluster
resource withmonitoring_interval
specified, themonitoring_interval
of the instance was set to the same value as the cluster.terraform plan
again, the AWS Provider showed a persistent drift to update themonitoring_interval
argument ofaws_rds_cluster_instance
to0
.monitoring_interval
argument ofaws_rds_cluster_instance
hadDefault: 0
. Since it was not explicitly specified in the configuration, the AWS Provider planned to reset it to0
.monitoring_interval
value inaws_rds_cluster_instance
can be derived from the corresponding value inaws_rds_cluster
, it should be marked asComputed
. The issue was caused by the missingComputed
attribute for this argument.Changes
monitoring_interval
argument ofaws_rds_cluster_instance
fromDefault: 0
toComputed: true
.TypeInt
, the value0
is treated the same asnil
when sent to the AWS API, meaning it is not included in API requests. However, it is still stored as0
in the Terraform state.Optional
andComputed
, changing it fromDefault
toComputed
does not alter the existing resource behavior.Optional
andComputed
, 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
monitoring_interval
value inaws_rds_cluster
is inherited by the correspondingaws_rds_cluster_instance
with this change and no persistent drift are shown.Relations
Closes #43487
Output from Acceptance Testing