r/lb_target_group: Don't allow invalid configurations #15612
Labels
breaking-change
Introduces a breaking change in current functionality; usually deferred to the next major release.
enhancement
Requests to existing resources that expand the functionality or scope.
partition/aws-us-gov
Pertains to the aws-us-gov partition.
service/elbv2
Issues and PRs that pertain to the elbv2 service.
Milestone
Community Note
Description
Invalid
aws_lb_target_group
configurations were allowed in AWS provider 3.9 and before. In order to allow invalid configurations, the resource had error-avoiding logic inCustomizeDiff
,Read
, andUpdate
. This logic was removed with 3.10 which broke the invalid configurations. The logic was added back (#15613) to avoid breaking invalid configurations. This logic should be removed.The
aws_lb_target_group
can be fixed (not allowing invalid configurations) by following these steps (basically just undoing #15613):DiffSuppressFunc
fromstickiness.type
resourceAwsLbTargetGroupUpdate()
, inif d.HasChange("stickiness")
, remove the if statementif !stickiness["enabled"].(bool) && stickiness["type"].(string) == "lb_cookie"...
. DO NOT remove the else body: remove the if statement, the if body, and the else statement, and associated braces.flattenAwsLbTargetGroupStickiness()
, remove theif !stickinessMap["enabled"].(bool) && stickinessMap["type"].(string)
statement, the if body, and the else word. Leaveif err := d.Set("stickiness"...
New or Affected Resource(s)
Potential Terraform Configuration
This invalid configuration should result in an error even though the stickiness is disabled (consistent with the AWS API). This is invalid because the TCP protocol is not compatible with stickiness type of
lb_cookie
.Invalid Config, Should Cause Error
Invalid Config, Does Cause Error
Valid Config, Should Not Cause Error
Valid Config, Should Not Cause Error
References
The text was updated successfully, but these errors were encountered: