-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add new attribute slow_start to aws_lb_target_group #4661
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bboerst -- thanks for this contribution! I left some initial comments below. Please let us know if you have any questions.
@@ -65,6 +65,7 @@ func TestAccAWSALBTargetGroup_basic(t *testing.T) { | |||
resource.TestCheckResourceAttr("aws_alb_target_group.test", "protocol", "HTTPS"), | |||
resource.TestCheckResourceAttrSet("aws_alb_target_group.test", "vpc_id"), | |||
resource.TestCheckResourceAttr("aws_alb_target_group.test", "deregistration_delay", "200"), | |||
resource.TestCheckResourceAttr("aws_alb_target_group.test", "slow_start", "0"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need to check slow_start
being equal to "0"
in the _basic
resource test and its configuration as the default applies to all configurations unless overridden. Speaking of which, we should have a completely separate acceptance test and configuration that actually sets this to a non-0 value and preferably tries to update it as well so we know that functionality works.
@@ -7586,6 +7586,10 @@ type TargetGroupAttribute struct { | |||
// from draining to unused. The range is 0-3600 seconds. The default value | |||
// is 300 seconds. | |||
// | |||
// * slow_start.duration_seconds - The amount time for targets to warm up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is failing CI due to:
$ make vendor-status
The following packages are missing or modified locally:
github.com/aws/aws-sdk-go/service/elbv2
Error: status failed for 1 package(s)
make: *** [vendor-status] Error 2
The command "make vendor-status" exited with 2.
When it comes to vendor updates we usually:
- Keep them separate from other code updates
- Use
govendor
to update the dependencies (for now)
I'll go ahead and submit the v1.13.55 update PR right now then you can rebase this PR on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependency PR submitted: #4663
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The full SDK update has been merged into master 👍
@@ -484,6 +490,7 @@ func testAccAWSALBTargetGroupConfig_basic(targetGroupName string) string { | |||
vpc_id = "${aws_vpc.test.id}" | |||
|
|||
deregistration_delay = 200 | |||
slow_start = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not include the default value in all the test configurations. It should only be specified in either configurations that actually require the setting or if the default is overridden.
@bflad This should be all set. Please double-check the acceptance tests that I wrote for this; this is my first time contributing to this project...
|
I'm seeing a bunch of the other acceptance testing failing, e.g.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still getting acceptance testing failures, but at this point I'll just fix it up on merge so we can get this released. 🚀
@@ -27,6 +27,7 @@ func TestAccDataSourceAWSALBTargetGroup_basic(t *testing.T) { | |||
resource.TestCheckResourceAttr("data.aws_lb_target_group.alb_tg_test_with_arn", "protocol", "HTTP"), | |||
resource.TestCheckResourceAttrSet("data.aws_lb_target_group.alb_tg_test_with_arn", "vpc_id"), | |||
resource.TestCheckResourceAttr("data.aws_lb_target_group.alb_tg_test_with_arn", "deregistration_delay", "300"), | |||
resource.TestCheckResourceAttr("data.aws_lb_target_group.alb_tg_test_with_arn", "slow_start", "0"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The data source testing is failing because d.Set("slow_start", ...)
is never called in the resource read function. This would normally be caught in the resource acceptance testing with a TestCase
that calls ImportStateVerify: true
.
=== RUN TestAccDataSourceAWSALBTargetGroup_basic
--- FAIL: TestAccDataSourceAWSALBTargetGroup_basic (494.14s)
testing.go:518: Step 0 error: Check failed: 2 error(s) occurred:
* Check 9/39 error: data.aws_lb_target_group.alb_tg_test_with_arn: Attribute 'slow_start' not found
* Check 28/39 error: data.aws_lb_target_group.alb_tg_test_with_name: Attribute 'slow_start' not found
After adding this to case "slow_start.duration_seconds":
slowStart, err := strconv.Atoi(aws.StringValue(attr.Value))
if err != nil {
return fmt.Errorf("Error converting slow_start.duration_seconds to int: %s", aws.StringValue(attr.Value))
}
d.Set("slow_start", slowStart)
} All tests are green:
|
This has been released in version 1.21.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
Fixes #4660
Changes proposed in this pull request:
Output from acceptance testing: