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

r/lb_target_group: Respect threshold & interval for TCP LBs #2323

Merged
merged 2 commits into from
Nov 16, 2017

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Nov 16, 2017

Something I noticed when reading #2170

Although most issues were solved in #2251 we also (IMO unintentionally) ignored UnhealthyThresholdCount and interval.

Interval cannot be updated after initial creation, so I just added appropriate error message after pondering with CustomizeDiff and realizing that it doesn't work for nested fields (yet) 😞

Closes #2170

Test results

TF_ACC=1 go test ./aws -v -run=TestAccAWSLBTargetGroup_networkLB_TargetGroup -timeout 120m
=== RUN   TestAccAWSLBTargetGroup_networkLB_TargetGroup
--- PASS: TestAccAWSLBTargetGroup_networkLB_TargetGroup (160.47s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	160.498s

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Nov 16, 2017
@radeksimko radeksimko added this to the v1.3.0 milestone Nov 16, 2017
@radeksimko radeksimko requested a review from catsby November 16, 2017 16:38
}

healthCheckProtocol := strings.ToLower(healthCheck["protocol"].(string))

if !d.IsNewResource() && d.HasChange("health_check.0.interval") && healthCheckProtocol == "tcp" {
Copy link
Contributor

Choose a reason for hiding this comment

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

From our chat just now I learned that ResourceDiff.ForceNew doesn't accept dot-separated paths like this and that's why you are doing this check in here.

The downside of doing it in here is that it won't fail until apply time. A possible compromise is to do this check inside CustomizeDiff and have it return an error (rather than calling ForceNew) if it detects a change like this. That way it will fail during plan time rather than apply time.

Not ideal of course, but I think better than generating a plan successfully and then bailing out partway through apply.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ha, that's a good idea actually 🤔 I'll change it.

@radeksimko radeksimko merged commit 20ad210 into master Nov 16, 2017
@radeksimko radeksimko deleted the b-nlb-tg-fields branch November 16, 2017 18:08
@catsby
Copy link
Contributor

catsby commented Nov 17, 2017

Curious why we didn't use the customize diff to mark the attribute as ForceNew here and document that they can't be changed?

@radeksimko
Copy link
Member Author

@catsby this is because CustomizeDiff doesn't work for nested fields (yet) - per our recent conversation on Slack.

@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants