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

Cannot set multiple key-value for an alb event "query" with the same key #11880

Open
4 tasks done
Inqnuam opened this issue Apr 1, 2023 · 3 comments · May be fixed by #11890 or #11881
Open
4 tasks done

Cannot set multiple key-value for an alb event "query" with the same key #11880

Inqnuam opened this issue Apr 1, 2023 · 3 comments · May be fixed by #11890 or #11881

Comments

@Inqnuam
Copy link
Contributor

Inqnuam commented Apr 1, 2023

Are you certain it's a bug?

  • Yes, it looks like a bug

Is the issue caused by a plugin?

  • It is not a plugin issue

Are you using the latest v3 release?

  • Yes, I'm using the latest v3 release

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Issue description

AWS Application Load Balancer listener rule allows to set multiple values for a single query key.
Screenshot 2023-04-01 at 13 54 16
Screenshot 2023-04-01 at 13 54 28

Currently this is not possible with Serverless Framework as query "value" is defined as string.

Service configuration (serverless.yml) content

service: sls-project

frameworkVersion: "3"

package:
  individually: true

provider:
  name: aws
  runtime: nodejs18.x
  versionFunctions: false
  region: eu-west-3
  vpc:
    subnetIds: [subnet-0e2db7f9558f501d7, subnet-0cde9f3600cab039a]
    securityGroupIds: [sg-029d2fbba38db2dc7]

functions:
  lambda:
    handler: src/handlers/lambda.default
    events:
      - alb:
          listenerArn: arn:aws:elasticloadbalancing:xxxx
          priority: 936
          conditions:
            path: "/users"
            method: [GET]
            query:
              role: admin
              role: guest

Command name and used flags

"N/A

Command output

"N/A

Environment information

Framework Core: 3.29.0 (local)
Plugin: 6.2.3
SDK: 4.3.2
@medikoo
Copy link
Contributor

medikoo commented Apr 3, 2023

@Inqnuam, thanks for opening. Indeed that's the case. It's a design bug on our side. Still it can be fixed. I propose following solution:

  • Allow arrays for query property values
  • Resolve arrays into multiple same query param values when resolving CF template

PR's welcome!

@Inqnuam Inqnuam linked a pull request Apr 3, 2023 that will close this issue
@Inqnuam
Copy link
Contributor Author

Inqnuam commented Apr 3, 2023

Allo arrays for query property values
Resolve arrays into multiple same query param values when resolving CF template

This is what is did in my initial PR but figured out that with that schema we simply can't cover all possible conditions.
Please check the new isolated PR.

@medikoo
Copy link
Contributor

medikoo commented May 8, 2023

@Inqnuam can you elaborate here, on other possible conditions that cannot be covered with what I propsoed (let's discuss this fully here, until we agree on best solution)

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