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

Listeners for Gateway Load Balancers must not specify port number or protocol #16228

Closed
mabdelghany opened this issue Nov 17, 2020 · 5 comments · Fixed by #16306
Closed

Listeners for Gateway Load Balancers must not specify port number or protocol #16228

mabdelghany opened this issue Nov 17, 2020 · 5 comments · Fixed by #16306
Assignees
Labels
bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Milestone

Comments

@mabdelghany
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform version: 0.13.5
Terraform AWS Provider version: v3.15.0_x5

Affected Resource(s)

  • aws_lb_listener

Expected Behavior

When adding a listener to the gateway load balancer, according to AWS Documentation for Cloudformation (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-listener.html), the port and protocol can not be specified when using a gateway load balancer.

Actual Behavior

When the port is not specified, Terraform complains that these are required parameters (per the Terraform documentation https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lb_listener#port)

Steps to Reproduce

The error is thrown a the terraform plan stage

References

@ghost ghost added the service/elbv2 Issues and PRs that pertain to the elbv2 service. label Nov 17, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 17, 2020
@gdavison gdavison changed the title Adding Listener to Gateway Load Balancer does not function as it should Listeners for Gateway Load Balancers must not specify port number or protocol Nov 17, 2020
@gdavison
Copy link
Contributor

port and protocol need to be Optional instead of Required

@gdavison gdavison added enhancement Requests to existing resources that expand the functionality or scope. bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. enhancement Requests to existing resources that expand the functionality or scope. labels Nov 17, 2020
@bflad bflad self-assigned this Nov 19, 2020
bflad added a commit that referenced this issue Nov 19, 2020
…ault protocol argument to HTTP for Application Load Balancers (Support Gateway Load Balancer)

Reference: #16228

Output from acceptance testing:

```
--- PASS: TestAccAWSLBListener_BackwardsCompatibility (164.54s)
--- PASS: TestAccAWSLBListener_basic (216.95s)
--- PASS: TestAccAWSLBListener_basicUdp (353.16s)
--- PASS: TestAccAWSLBListener_cognito (175.47s)
--- PASS: TestAccAWSLBListener_DefaultAction_Order (179.98s)
--- PASS: TestAccAWSLBListener_DefaultAction_Order_Recreates (210.11s)
--- PASS: TestAccAWSLBListener_fixedResponse (205.74s)
--- PASS: TestAccAWSLBListener_forwardWeighted (254.29s)
--- PASS: TestAccAWSLBListener_https (177.85s)
--- PASS: TestAccAWSLBListener_LoadBalancerArn_GatewayLoadBalancer (104.60s)
--- PASS: TestAccAWSLBListener_oidc (224.41s)
--- PASS: TestAccAWSLBListener_Protocol_Tls (338.84s)
--- PASS: TestAccAWSLBListener_redirect (215.20s)

--- PASS: TestAccAWSLBListenerRule_Action_Order (173.51s)
--- PASS: TestAccAWSLBListenerRule_Action_Order_Recreates (190.92s)
--- PASS: TestAccAWSLBListenerRule_BackwardsCompatibility (215.63s)
--- PASS: TestAccAWSLBListenerRule_basic (205.27s)
--- PASS: TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew (241.13s)
--- PASS: TestAccAWSLBListenerRule_cognito (204.34s)
--- PASS: TestAccAWSLBListenerRule_conditionAttributesCount (14.00s)
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader (213.13s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader (258.35s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader_invalid (0.56s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpRequestMethod (180.34s)
--- PASS: TestAccAWSLBListenerRule_conditionMultiple (193.68s)
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern (205.29s)
--- PASS: TestAccAWSLBListenerRule_conditionQueryString (245.64s)
--- PASS: TestAccAWSLBListenerRule_conditionSourceIp (203.60s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMixed (239.41s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMultiple (174.24s)
--- PASS: TestAccAWSLBListenerRule_fixedResponse (244.72s)
--- PASS: TestAccAWSLBListenerRule_forwardWeighted (298.68s)
--- PASS: TestAccAWSLBListenerRule_oidc (226.14s)
--- PASS: TestAccAWSLBListenerRule_priority (352.95s)
--- PASS: TestAccAWSLBListenerRule_redirect (162.81s)
--- PASS: TestAccAWSLBListenerRule_updateFixedResponse (233.36s)
--- PASS: TestAccAWSLBListenerRule_updateRulePriority (204.08s)
```
@bflad
Copy link
Contributor

bflad commented Nov 19, 2020

Fix submitted: #16306

bflad added a commit that referenced this issue Nov 25, 2020
…ault protocol argument to HTTP for Application Load Balancers (Support Gateway Load Balancer) (#16306)

* resource/aws_lb_listener: Mark port argument as optional and only default protocol argument to HTTP for Application Load Balancers (Support Gateway Load Balancer)

Reference: #16228

Output from acceptance testing:

```
--- PASS: TestAccAWSLBListener_BackwardsCompatibility (164.54s)
--- PASS: TestAccAWSLBListener_basic (216.95s)
--- PASS: TestAccAWSLBListener_basicUdp (353.16s)
--- PASS: TestAccAWSLBListener_cognito (175.47s)
--- PASS: TestAccAWSLBListener_DefaultAction_Order (179.98s)
--- PASS: TestAccAWSLBListener_DefaultAction_Order_Recreates (210.11s)
--- PASS: TestAccAWSLBListener_fixedResponse (205.74s)
--- PASS: TestAccAWSLBListener_forwardWeighted (254.29s)
--- PASS: TestAccAWSLBListener_https (177.85s)
--- PASS: TestAccAWSLBListener_LoadBalancerArn_GatewayLoadBalancer (104.60s)
--- PASS: TestAccAWSLBListener_oidc (224.41s)
--- PASS: TestAccAWSLBListener_Protocol_Tls (338.84s)
--- PASS: TestAccAWSLBListener_redirect (215.20s)

--- PASS: TestAccAWSLBListenerRule_Action_Order (173.51s)
--- PASS: TestAccAWSLBListenerRule_Action_Order_Recreates (190.92s)
--- PASS: TestAccAWSLBListenerRule_BackwardsCompatibility (215.63s)
--- PASS: TestAccAWSLBListenerRule_basic (205.27s)
--- PASS: TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew (241.13s)
--- PASS: TestAccAWSLBListenerRule_cognito (204.34s)
--- PASS: TestAccAWSLBListenerRule_conditionAttributesCount (14.00s)
--- PASS: TestAccAWSLBListenerRule_conditionHostHeader (213.13s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader (258.35s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpHeader_invalid (0.56s)
--- PASS: TestAccAWSLBListenerRule_conditionHttpRequestMethod (180.34s)
--- PASS: TestAccAWSLBListenerRule_conditionMultiple (193.68s)
--- PASS: TestAccAWSLBListenerRule_conditionPathPattern (205.29s)
--- PASS: TestAccAWSLBListenerRule_conditionQueryString (245.64s)
--- PASS: TestAccAWSLBListenerRule_conditionSourceIp (203.60s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMixed (239.41s)
--- PASS: TestAccAWSLBListenerRule_conditionUpdateMultiple (174.24s)
--- PASS: TestAccAWSLBListenerRule_fixedResponse (244.72s)
--- PASS: TestAccAWSLBListenerRule_forwardWeighted (298.68s)
--- PASS: TestAccAWSLBListenerRule_oidc (226.14s)
--- PASS: TestAccAWSLBListenerRule_priority (352.95s)
--- PASS: TestAccAWSLBListenerRule_redirect (162.81s)
--- PASS: TestAccAWSLBListenerRule_updateFixedResponse (233.36s)
--- PASS: TestAccAWSLBListenerRule_updateRulePriority (204.08s)
```

* tests/provider: Ignore out of date tflint rules  aws_lb_invalid_load_balancer_type and aws_lb_target_group_invalid_protocol

Reference: terraform-linters/tflint#975
@bflad bflad added this to the v3.18.0 milestone Nov 25, 2020
@bflad
Copy link
Contributor

bflad commented Nov 25, 2020

The fix for this has been merged and will release shortly with version 3.18.0 of the Terraform AWS Provider.

@ghost
Copy link

ghost commented Nov 25, 2020

This has been released in version 3.18.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!

@ghost
Copy link

ghost commented Dec 26, 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 as resolved and limited conversation to collaborators Dec 26, 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. service/elbv2 Issues and PRs that pertain to the elbv2 service.
Projects
None yet
3 participants