Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ignore changes to load_balancers and target_group_arns #252

Conversation

bryantbiggs
Copy link
Member

Description

Motivation and Context

Breaking Changes

  • No

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects
  • I have executed pre-commit run -a on my pull request

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to comprehend all the messages that were posted on this and linked issues and I don't understand WHY do we want to ignore changes in these additional arguments? They seem to be very important and it should have been addressed in the Terraform AWS provider, if their behavior is not consistent.

Am I missing something? Could you please explain briefly why this change is needed to be fixed in the module and not in provider?

@dusansusic
Copy link

@antonbabenko because each plan wants to remove asg instances from target groups. Next run will join it. This obviously causing downtime.

  ~ resource "aws_autoscaling_group" "idc" {
        id                               = "xxx-production-core-asg-a"
        name                             = "xxx-production-core-asg-a"
      ~ target_group_arns                = [
          - "arn:aws:elasticloadbalancing:eu-central-1:xxxx:targetgroup/tf-20231112171053124800000007/588de2cd885d173f",
        ]

next run:

  ~ resource "aws_autoscaling_group" "idc" {
        id                               = "xxx-production-core-asg-a"
        name                             = "xxx-production-core-asg-a"
      ~ target_group_arns                = [
          + "arn:aws:elasticloadbalancing:eu-central-1:xxxx:targetgroup/tf-20231112171053124800000007/588de2cd885d173f",
        ]

@dusansusic
Copy link

dusansusic commented Nov 30, 2023

also, @antonbabenko and @bryantbiggs from this doc we can find:

If aws_autoscaling_attachment resources reference your ASG configurations, you will need to add the lifecycle configuration block with an ignore_changes argument to prevent Terraform non-empty plans (i.e., forcing resource update) during the next state refresh.

Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the brief explanation, @dusansusic ! It is very clear to me now. Time to merge. 👌

@antonbabenko antonbabenko merged commit ef8235c into terraform-aws-modules:master Nov 30, 2023
7 checks passed
antonbabenko pushed a commit that referenced this pull request Nov 30, 2023
### [7.3.1](v7.3.0...v7.3.1) (2023-11-30)

### Bug Fixes

* Ignore changes to `load_balancers` and `target_group_arns` ([#252](#252)) ([ef8235c](ef8235c))
@antonbabenko
Copy link
Member

This PR is included in version 7.3.1 🎉

@bryantbiggs
Copy link
Member Author

ya'll beat me to it 😅 - I was thinking about this a bit more last night and was going to add the TODOs, so I've added them in #253 along with a bit more explanation of how and why we got here

@bryantbiggs bryantbiggs deleted the fix/ignore-load-balancer-target-groups branch November 30, 2023 13:49
@kkumtree
Copy link

I appreciate that my (but failed) pull request motivated you to make your pull request.

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 Jan 11, 2024
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.

4 participants