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

resource/lb_listener_rule: Fix action.forward.target_group minimum #19806

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

don-code
Copy link

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

This change mirrors the one made in #15112, but for nondefault rule attachments on load balancers. The particular issue fixed is as follows when attempting to create a forwarding rule with only one target group:

resource "aws_lb_listener_rule" "default" {
  listener_arn = aws_alb_listener.listener.arn
  priority = 50000

  action {
    type = "forward"

    forward {
      target_group {
        arn = aws_alb_target_group.target_group.arn
      }
    }
  }
}
Error: List shorter than MinItems

  on main.tf line 354, in resource "aws_lb_listener_rule" "default":
 354:       target_group {

Attribute supports 2 item minimum, config has 1 declared

Closes #18072

This change mirrors the one made in hashicorp#15112, but for nondefault rule
attachments on load balancers. The particular issue fixed is as follows
when attempting to create a forwarding rule with only one target group:

```
resource "aws_lb_listener_rule" "default" {
  listener_arn = aws_alb_listener.listener.arn
  priority = 50000

  action {
    type = "forward"

    forward {
      target_group {
        arn = aws_alb_target_group.target_group.arn
      }
    }
  }
}
```

```
Error: List shorter than MinItems

  on main.tf line 354, in resource "aws_lb_listener_rule" "default":
 354:       target_group {

Attribute supports 2 item minimum, config has 1 declared
```

This should fix hashicorp#18072.
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/XS Managed by automation to categorize the size of a PR. labels Jun 15, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @don-code 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@breathingdust breathingdust added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 3, 2021
@zhelding zhelding self-assigned this Sep 9, 2021
don-code and others added 2 commits October 7, 2021 12:17
This change mirrors the one made in hashicorp#15112, but for nondefault rule
attachments on load balancers. The particular issue fixed is as follows
when attempting to create a forwarding rule with only one target group:

```
resource "aws_lb_listener_rule" "default" {
  listener_arn = aws_alb_listener.listener.arn
  priority = 50000

  action {
    type = "forward"

    forward {
      target_group {
        arn = aws_alb_target_group.target_group.arn
      }
    }
  }
}
```

```
Error: List shorter than MinItems

  on main.tf line 354, in resource "aws_lb_listener_rule" "default":
 354:       target_group {

Attribute supports 2 item minimum, config has 1 declared
```

This should fix hashicorp#18072.
@github-actions github-actions bot added size/XL Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Oct 7, 2021
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/L Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Oct 7, 2021
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

@zhelding zhelding assigned zhelding and unassigned zhelding Mar 23, 2022
@zhelding zhelding removed their assignment Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/elbv2 Issues and PRs that pertain to the elbv2 service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistency between documentation and schema (aws_lb_listener_rule)
3 participants