hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.71k stars 9.07k forks source link

[Bug]: aws_route53recoverycontrolconfig_safety_rule Name update does not work without change in wait_period_ms #37763

Open sdlevi27 opened 3 months ago

sdlevi27 commented 3 months ago

Terraform Core Version

1.5.5

AWS Provider Version

5.51.1

Affected Resource(s)

aws_route53recoverycontrolconfig_safety_rule

Expected Behavior

Name should be updated when only updating the Name property on an existing Route 53 Recovery Controller Safety Rule

Actual Behavior

Module fails with error Error: updating Route53 Recovery Control Config Assertion Rule: InvalidParameter: 1 validation error(s) found. missing required field, UpdateSafetyRuleInput.AssertionRuleUpdate.WaitPeriodMs.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "aws_route53recoverycontrolconfig_safety_rule" "safety_rules" {
  asserted_controls = [arn:aws:route53-recovery-control::XXX:controlpanel/XXX/routingcontrol/XXX]
  control_panel_arn = arn:aws:route53-recovery-control::XXX:controlpanel/XXX/routingcontrol/XXX
  name              = my-routing-control
  wait_period_ms    = 5000

  rule_config {
    inverted  = false
    threshold = 1
    type      = "ATLEAST"
  }
}

Steps to Reproduce

Deploy Routing Control using Terraform Update name from my-routing-control to my-routing-control2.
Do not update any other parameters in the resource. Run Terraform Apply

Debug Output

No response

Panic Output

No response

Important Factoids

Can work around by modifying wait_period_ms parameter as part of the Update with name parameter, however, that also fails in Terraform with a separate error (but the routing control is successfully updated in AWS!)

Error: updating Route53 Recovery Control Config Assertion Rule: describing Route53 Recovery Control Config Control Panel: ValidationException: Malformed control panel arn Arn(arn:aws:route53-recovery-control::XXX:controlpanel/XXX/safetyrule/XXX)

References

Appears to be issue at https://github.com/hashicorp/terraform-provider-aws/blob/v5.51.1/internal/service/route53recoverycontrolconfig/safety_rule.go#L332

Per https://docs.aws.amazon.com/recovery-cluster/latest/api/safetyrule.html, WaitPeriodMs is always required on update.

Would you like to implement a fix?

Yes

github-actions[bot] commented 3 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue