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

Add EP-10573: Support for AWS Lambda #10644

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

Conversation

timflannagan
Copy link
Member

Description

Add an enhancement proposal for #10573.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

design/10573.md Outdated

### API Changes

#### Upstream
Copy link
Member Author

Choose a reason for hiding this comment

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

Pseudoblocked based on the outcome of the #10611 issue.

Copy link

Choose a reason for hiding this comment

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

just to confirm the plan is to keep upstream (or whatever it's named) as there is some details - that need to be kept or reimplemented.

Signed-off-by: timflannagan <[email protected]>
@timflannagan timflannagan force-pushed the design/aws-lambda-proposal branch from e500633 to e1ec54c Compare February 17, 2025 20:27
design/10573.md Outdated
)

// AwsUpstream is an upstream that configures AWS Lambda functionality.
type AwsUpstream struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

One mistake I think we made the first go around with the AWS API, and that the upstream filter does a good job at, is separating the feature from the auth mechanism. There's a bit of language around here around a separation of Lambda and AWS Auth which I think is a good direction to move in. Perhaps AWS Auth on the upstream and Lambda on the route or something like that.

Copy link
Contributor

Choose a reason for hiding this comment

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

it feels like aws connectivity is unlikely to be formalized as part of sig gateway apis so i like the idea of hewing closely to the envoy implementation for now and leaking some of that back in our api. Therefore it would be cool if we can say that the upstream will sign requests for aws or something.
https://github.com/envoyproxy/envoy/blob/cedb633dafc8fe69cb52098a8db2527126db9ee7/docs/root/configuration/http/http_filters/aws_request_signing_filter.rst#L2

design/10573.md Outdated
The AWS Lambda plugin will be implemented in the `internal/kgateway/extensions2/plugins/upstream` directory. At a high-level, the following changes will be made:

1. Configure the lambda ARN in the [upstream HTTP filter](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/aws_lambda_filter#configuration-as-an-upstream-http-filter).
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this an upstream_http_filter on the router or on the cluster?

Copy link
Member Author

Choose a reason for hiding this comment

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

The latter

- Add mention that API needs to be foundational enough to support other AWS services
- Add IRSA as a goal
- Refactor proposal to embed function-level config in the Upstream API (vs. RoutePolicy API)
- Clarify Istio auto-mtls testing requirement
- Identify Localstack IAM pro limitations for IRSA integration
- Separate auth and lambda configuration in the AWS Upstream

Signed-off-by: timflannagan <[email protected]>
Signed-off-by: timflannagan <[email protected]>
Copy link
Contributor

@lgadban lgadban left a comment

Choose a reason for hiding this comment

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

Very solid write-up, no major feedback.

Will defer approval for a bit the give the other reviewers a chance to review

design/10573.md Outdated

### Alternative 1: Adopt existing synthetic `Parameter` GVK

The previous approach for this feature relied on the synthetic `Parameter` GVK. This proposal moves away from this approach in favor of a more flexible and maintainable solution that can be extended to support other AWS services in the future.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth explicitly calling out that the Gloo Gateway synthetic Parameter approach limits us to a single config per "parameter", meaning it's not feasible to express all necessary pieces of the AWSLambdaConfig (at least without redesign)

Copy link
Member Author

@timflannagan timflannagan Feb 25, 2025

Choose a reason for hiding this comment

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

WYDT? 80207c2 (and 186adcc).

@lgadban
Copy link
Contributor

lgadban commented Feb 25, 2025

Had another thought here, not sure if it's something we should discuss on the design doc or in the impl;

Is there a difference between the Solo Lambda filter and the upstream AWS filter w.r.t. the amount of envoy clusters created?

@timflannagan
Copy link
Member Author

@lgadban I'd have to defer to others on that. AFAIK, the previous envoy-gloo implementation translate a portion on the cluster and processed the Parameters GVK on the per-route filter. That's fairly consistent with how the upstream lambda filter operates, so I think the implementation w.r.t # of clusters would be the same.

Good idea on chalking this up on the implementation PR though -- I wanted to capture some of the high-level plugin changes since this proposal had implementation-specific concerns (e.g. envoy-gloo vs upstream envoy) that needed consensus for historical purposes, but nothing prevents us from updating the doc if there's any drift in the proposed implementation.

- Not recommended for production use
- Suitable only for development and testing
3. **Future Authentication Methods** (Optional):
- AWS STS token exchange
Copy link

Choose a reason for hiding this comment

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

I might be mistaken, but was under the impression that AWS secret approach allows user to supply - Either AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY or AWS STS Token (which short lived)

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

Successfully merging this pull request may close these issues.

6 participants