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

Rules option under "aws:elbv2:listener:listener_port" are not honored when using shared ALB #466

Open
Redliyu opened this issue Aug 16, 2023 · 1 comment

Comments

@Redliyu
Copy link

Redliyu commented Aug 16, 2023

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.

  1. 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: <existing_shared_alb_arn>
  aws:elbv2:listener:443:
    Rules: default,test
  aws:elbv2:listenerrule:test:
    HostHeaders: <my_website_domain>
    PathPatterns: '/*'
    Priority: 1
...

eb commands:

eb create <env_name> --elb-type application --shared-lb <existing_shared_alb_arn> --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 <alb_arn> and listener 443, EB created a new rule which HTTP Host Header was not <my_website_domain>, 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 = <eb_env_domain>, 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 = <my_website_domain>, <eb_env_domain>, 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.
Screen_Shot_2023-08-15_at_11_27_06_PM

Screen_Shot_2023-08-15_at_11_12_35_PM

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

@baschny
Copy link

baschny commented Feb 11, 2025

@Redliyu we are stumbling over the same issue. Have you managed to solve that 2 years ago?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants