aws / aws/aws-elastic-beanstalk-cli
Rules option under "aws:elbv2:listener:listener_port" are not honored when using shared ALB
- Dominant language
- Python
- Stars
- 181
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Description
### Description
When using shared ALB, rules option under "aws:elbv2:listener:listener_port" are not honored, which should be supported as indicated by doc.
1. doc: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-elbv2-listener
> For a shared Application Load Balancer, you can specify only the Rule option. The other options aren't applicable to shared load balancers.
2. doc has examples: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-alb-shared.html
### Steps to reproduce
Provide steps to replicate. This should include: exact `ebcli` commands, any relevant configuration files(sanitized), platform version, region, as well as any additional information you think is relevant.
config In .ebextensions:
```
option_settings:
aws:elbv2:loadbalancer:
SharedLoadBalancer:
aws:elbv2:listener:443:
Rules: default,test
aws:elbv2:listenerrule:test:
HostHeaders:
PathPatterns: '/*'
Priority: 1
...
```
eb commands:
```
eb create --elb-type application --shared-lb --shared-lb-port 443
```
However, after env was created, there two places indicated that `aws:elbv2:listener:listener_port` wasn't honored.
1. In ALB Listener rules
Go to AWS console, in ALB, select the and listener 443, EB created a new rule which HTTP Host Header was not , instead, it was the EB env domain (I presume this is the default rule, instead of the "test" rule)
2. In EB env configuration
Go to AWS console, open configuration of the create EB env, choose "edit" in "Instance traffic and scaling", go to "Rules" section (bottom of the page), there were two entries, the first one: name = default, listener port = 443, priority = 2, host header = , path patterns = `/*`, which I presume was the defult rule. The second one was the problematic one, it had name = test, listener port is null (blank as shown in the table), priority = 1, host headers = , , path patterns = `/*`. In my understanding, the listener port should be 443 for the second one but it wasn't.
See two screenshots below for settings in ALB after updated by EB CLI, and settings in EB after updated by EB CLI.


### Expected result
I want to use the config in .ebextensions to create rule in shared ALB which allows the host header of my domain.
### Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
OS: mac os 12.6
EBCLI version: EB CLI 3.20.8 (Python 3.8.16 (default, Dec 16 2022, 20:05:32)
AWS Region: us-west-2
Contributor guide
Research direction
Start by reproducing the issue with the shown .ebextensions option_settings and the `eb create` command, then compare the shared ALB listener rules with the EB environment configuration. Done means the `test` rule uses listener port 443 and the configured host header instead of being left blank or replaced by the environment domain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100