Open adityadhole24 opened 2 years ago
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
The obvious workaround is to explicitly include request_interval = "30"
in your Terraform code. But I agree this shouldn't be necessary.
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v0.12.31 AWS Provider v3.70.0
Affected Resource(s)
Terraform Configuration Files
Debug Output
Gist for the 2nd terraform apply debug output - https://gist.github.com/adityadhole24/e0416201dcd5b25b2d866d14b133cd6d
Expected Behavior
The first
terraform apply
command with the given configuration should lead to successful creation of the Route53 health check. A secondterraform apply
command (without making any changes to the configuration externally, of course), should detect no changes.Actual Behavior
The behavior for the first
terraform apply
command matches with the expected behavior. The health check is created successfully.However, for the 2nd
terraform apply
command, Terraform (wrongly) detects a change in the configuration - It detects that the value forrequest_interval
has changed from null to 30 (default value forrequest_interval
that is configured by AWS for HTTP/HTTPS/TCP Health Checks), and tries to force the value back to null.Since the
request_interval
parameter cannot be updated once the health check has been created (as per AWS CLI docs), Terraform forces a replacement to change its value.The replacement happens successfully, however it has no real effect. The
request_interval
parameter will (of course) continue to have the AWS-configured default value of 30.Every subsequent
terraform apply
has the same behavior as above (force-replacements with no real effect).Steps to Reproduce
terraform apply
terraform apply
(without any modifications made to the configuration)Important Factoids
Specifying a value for
RequestInterval
is optional when creating a Route53 Health Check of 'type' = HTTP/HTTPS/TCP using the AWS CLI commandcreate-health-check
as well. A default value of 30 is configured by AWS for the parameter when creating such health checks.The same AWS-defaults are configured when the
request_interval
parameter is skipped in Terraform and the resource gets created successfully in the 1stterraform apply
command. However, the problem lies in the fact that Terraform detects a change in the subsequent apply (when there is no real change) and tries to incorrectly revert it, resulting in a unnecessary forced replacement.References