Skip to content

Conversation

@kylewin
Copy link

@kylewin kylewin commented May 12, 2025

When running terraform plan, this dynamic block keeps showing up no matter we enable/disable stickiness

 ~ stickiness {
          ~ enabled         = false -> true
            # (3 unchanged attributes hidden)
        }

This is to fix

Signed-off-by: Kyle Nguyen [email protected]

fix-stickiness-dynamic-block

Signed-off-by: Kyle Nguyen <[email protected]>
@kylewin kylewin changed the title fix-stickiness-dynamic-block fix: stickiness dynamic block default value of enabled May 12, 2025
@kylewin kylewin changed the title fix: stickiness dynamic block default value of enabled fix: Stickiness dynamic block default value of enabled May 12, 2025
@kylewin kylewin marked this pull request as draft May 12, 2025 12:17
@bryantbiggs
Copy link
Member

This is not a valid change:

  1. Its a breaking change since it changes the default behavior
  2. I don't see how changing from true to false will have an impact on the issue you are describing

@kylewin
Copy link
Author

kylewin commented May 12, 2025

@bryantbiggs Hi Bryan, allow me to have some ideas before we actually close this PR

  1. Although it changes the behavior, we should follow AWS defaults. It's disabled as in here. So if stickiness.value.enabled is not set, we should make it false
  2. Yes you're right, it should be a mitigation rather than a 'fix'. I found a case that even if we Terraform apply with enabled = true, the next time we run terraform plan, it will still shows a change

Reproduce:

  1. Enable stickiness in a target_group
stickiness = {
        enabled = true
        type    = "source_ip"
}
  1. Apply terraform -> Terraform informs applied and enabled Stickiness whereas it doesn't
  2. Rerun terraform plan, the change happens again. Expecting No changes

@bryantbiggs
Copy link
Member

Although it changes the behavior, we should follow AWS defaults. It's disabled as in here. So if stickiness.value.enabled is not set, we should make it false

You have linked to the classic load balancer - this is the application/networking load balancer, also called elastic load balancer v2 (classic load balancer is v1). So this point is moot. Also, in the upstream provider, the default is true https://github.com/hashicorp/terraform-provider-aws/blob/ceb3b4086f100e4dd7ed40c8cdb7f536788402a9/internal/service/elbv2/target_group.go#L288

I found a case that even if we Terraform apply with enabled = true, the next time we run terraform plan, it will still shows a change

I'm still not following how changing this from true to false would have any effect on the behavior described

@kylewin
Copy link
Author

kylewin commented May 16, 2025

You have linked to the classic load balancer

Sorry my bad, alright I concur this

I'm still not following how changing this from true to false would have any effect on the behavior described

If you stated it's true by default, we dont need this anymore

Thank you for your time

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants