-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 protocol_version to lb_target_group #17260
Conversation
Add `protocol_version` to `lb_target_group` resource and data source.
11e70c8
to
29ba172
Compare
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.
Looks good 🎉
GovCloud:
resource_aws_lb_test.go:1236: skipping acceptance testing: region does not support ELBv2 Gateway Load Balancers
--- PASS: TestAccAWSLBTargetGroup_BackwardsCompatibility (56.54s)
--- PASS: TestAccAWSLBTargetGroup_basic (40.43s)
--- PASS: TestAccAWSLBTargetGroup_basicUdp (46.21s)
--- PASS: TestAccAWSLBTargetGroup_changeNameForceNew (90.92s)
--- PASS: TestAccAWSLBTargetGroup_changePortForceNew (117.35s)
--- PASS: TestAccAWSLBTargetGroup_changeProtocolForceNew (99.21s)
--- PASS: TestAccAWSLBTargetGroup_changeVpcForceNew (101.07s)
--- PASS: TestAccAWSLBTargetGroup_defaults_application (75.92s)
--- PASS: TestAccAWSLBTargetGroup_defaults_network (63.80s)
--- PASS: TestAccAWSLBTargetGroup_enableHealthCheck (56.77s)
--- PASS: TestAccAWSLBTargetGroup_generatedName (50.27s)
--- PASS: TestAccAWSLBTargetGroup_namePrefix (51.28s)
--- PASS: TestAccAWSLBTargetGroup_networkLB_TargetGroup (134.29s)
--- PASS: TestAccAWSLBTargetGroup_networkLB_TargetGroupWithProxy (105.27s)
--- PASS: TestAccAWSLBTargetGroup_Protocol_Tcp_HealthCheck_Protocol (89.92s)
--- PASS: TestAccAWSLBTargetGroup_Protocol_Tls (39.86s)
--- PASS: TestAccAWSLBTargetGroup_ProtocolVersion (47.01s)
--- PASS: TestAccAWSLBTargetGroup_stickinessDefaultALB (149.95s)
--- PASS: TestAccAWSLBTargetGroup_stickinessDefaultNLB (126.28s)
--- PASS: TestAccAWSLBTargetGroup_stickinessInvalidALB (70.69s)
--- PASS: TestAccAWSLBTargetGroup_stickinessInvalidNLB (48.36s)
--- PASS: TestAccAWSLBTargetGroup_stickinessValidALB (97.44s)
--- PASS: TestAccAWSLBTargetGroup_stickinessValidNLB (191.75s)
--- PASS: TestAccAWSLBTargetGroup_tags (145.03s)
--- PASS: TestAccAWSLBTargetGroup_TCP_HTTPHealthCheck (110.31s)
--- PASS: TestAccAWSLBTargetGroup_updateHealthCheck (131.94s)
--- PASS: TestAccAWSLBTargetGroup_updateSticknessEnabled (185.76s)
--- PASS: TestAccAWSLBTargetGroup_withoutHealthcheck (22.87s)
--- PASS: TestAccAWSLBTargetGroupAttachment_BackwardsCompatibility (105.42s)
--- PASS: TestAccAWSLBTargetGroupAttachment_basic (121.10s)
--- PASS: TestAccAWSLBTargetGroupAttachment_disappears (98.57s)
--- PASS: TestAccAWSLBTargetGroupAttachment_ipAddress (97.38s)
--- PASS: TestAccAWSLBTargetGroupAttachment_lambda (42.92s)
--- PASS: TestAccAWSLBTargetGroupAttachment_Port (94.73s)
--- SKIP: TestAccAWSLBTargetGroup_Protocol_Geneve (0.34s)
us-west-2
:
--- PASS: TestAccAWSLBTargetGroup_BackwardsCompatibility (39.40s)
--- PASS: TestAccAWSLBTargetGroup_basic (51.82s)
--- PASS: TestAccAWSLBTargetGroup_basicUdp (81.91s)
--- PASS: TestAccAWSLBTargetGroup_changeNameForceNew (108.65s)
--- PASS: TestAccAWSLBTargetGroup_changePortForceNew (112.60s)
--- PASS: TestAccAWSLBTargetGroup_changeProtocolForceNew (104.21s)
--- PASS: TestAccAWSLBTargetGroup_changeVpcForceNew (109.53s)
--- PASS: TestAccAWSLBTargetGroup_defaults_application (58.73s)
--- PASS: TestAccAWSLBTargetGroup_defaults_network (57.31s)
--- PASS: TestAccAWSLBTargetGroup_enableHealthCheck (72.86s)
--- PASS: TestAccAWSLBTargetGroup_generatedName (53.18s)
--- PASS: TestAccAWSLBTargetGroup_namePrefix (41.12s)
--- PASS: TestAccAWSLBTargetGroup_networkLB_TargetGroup (97.84s)
--- PASS: TestAccAWSLBTargetGroup_networkLB_TargetGroupWithProxy (59.74s)
--- PASS: TestAccAWSLBTargetGroup_Protocol_Geneve (35.15s)
--- PASS: TestAccAWSLBTargetGroup_Protocol_Tcp_HealthCheck_Protocol (73.36s)
--- PASS: TestAccAWSLBTargetGroup_Protocol_Tls (34.92s)
--- PASS: TestAccAWSLBTargetGroup_ProtocolVersion (59.72s)
--- PASS: TestAccAWSLBTargetGroup_stickinessDefaultALB (57.54s)
--- PASS: TestAccAWSLBTargetGroup_stickinessDefaultNLB (131.41s)
--- PASS: TestAccAWSLBTargetGroup_stickinessInvalidALB (89.38s)
--- PASS: TestAccAWSLBTargetGroup_stickinessInvalidNLB (83.36s)
--- PASS: TestAccAWSLBTargetGroup_stickinessValidALB (119.94s)
--- PASS: TestAccAWSLBTargetGroup_stickinessValidNLB (121.50s)
--- PASS: TestAccAWSLBTargetGroup_tags (136.20s)
--- PASS: TestAccAWSLBTargetGroup_TCP_HTTPHealthCheck (68.39s)
--- PASS: TestAccAWSLBTargetGroup_updateHealthCheck (109.77s)
--- PASS: TestAccAWSLBTargetGroup_updateSticknessEnabled (128.11s)
--- PASS: TestAccAWSLBTargetGroup_withoutHealthcheck (20.47s)
--- PASS: TestAccAWSLBTargetGroupAttachment_BackwardsCompatibility (101.78s)
--- PASS: TestAccAWSLBTargetGroupAttachment_basic (116.08s)
--- PASS: TestAccAWSLBTargetGroupAttachment_disappears (101.74s)
--- PASS: TestAccAWSLBTargetGroupAttachment_ipAddress (112.30s)
--- PASS: TestAccAWSLBTargetGroupAttachment_lambda (52.70s)
--- PASS: TestAccAWSLBTargetGroupAttachment_Port (99.45s)
@@ -40,6 +40,11 @@ func dataSourceAwsLbTargetGroup() *schema.Resource { | |||
Computed: true, | |||
}, | |||
|
|||
"protocol_version": { |
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.
Nice catch! I've heard from a friend that it's really bad to add an attribute to the resource but not the data source.
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.
Thanks! I almost missed it.
@@ -294,6 +308,10 @@ func resourceAwsLbTargetGroupCreate(d *schema.ResourceData, meta interface{}) er | |||
} | |||
params.Port = aws.Int64(int64(d.Get("port").(int))) | |||
params.Protocol = aws.String(d.Get("protocol").(string)) | |||
switch d.Get("protocol").(string) { | |||
case elbv2.ProtocolEnumHttp, elbv2.ProtocolEnumHttps: |
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.
I personally like switch
even in simple logic since it's so clean. Some suggest if
is better here but I like it.
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.
Same here. I forget sometimes when I'm deep in what I'm doing though.
I suspect you'll also want to do something about gRPC matchers, as this community pull request attempted, @bill-rich: #16132 |
This has been released in version 3.27.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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! |
Add
protocol_version
tolb_target_group
resource and data source.Community Note
Closes #15929
Output from acceptance testing: