Skip to content

Conversation

tomoikey
Copy link

@tomoikey tomoikey commented Sep 30, 2025

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.

No changes to security controls.

Description

Fixes perpetual diff issue for Lambda target groups with stickiness, target_failover, and target_group_health attributes.

Lambda target type only supports lambda.multi_value_headers.enabled attribute. AWS API silently ignores stickiness, target_failover, and target_group_health configuration for Lambda target groups, but Terraform was detecting them as diffs. This means diffs will continue to appear indefinitely even after applying. Detecting diffs in the plan for changes that are not actually applied is undesirable.

This change adds DiffSuppressFunc to these three attributes to suppress diffs when target_type is lambda, using the existing suppressIfTargetType() helper function.

Before

  ~ update in-place
...
  ~ resource "aws_lb_target_group" "test" {
...
      ~ stickiness {
          + cookie_duration = 86400
          + enabled         = false
          + type            = "lb_cookie"
        }

      ~ target_failover {
          + on_deregistration = "no_rebalance"
          + on_unhealthy      = "no_rebalance"
        }

      ~ target_group_health {
          ~ dns_failover {
              + minimum_healthy_targets_count      = "off"
              + minimum_healthy_targets_percentage = "off"
            }
          ~ unhealthy_state_routing {
              + minimum_healthy_targets_count      = 1
              + minimum_healthy_targets_percentage = "off"
            }
        }
...
Plan: 0 to add, 1 to change, 0 to destroy.

After

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes
are needed.

Relations

None

References

The following target group attributes are supported if the target group type is instance or ip:
(omitted)

The following target group attribute is supported if the target group type is lambda:
(omitted)

@tomoikey tomoikey requested a review from a team as a code owner September 30, 2025 13:32
Copy link
Contributor

github-actions bot commented Sep 30, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/XS Managed by automation to categorize the size of a PR. labels Sep 30, 2025
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants