Skip to content

Conversation

@acaremrullah
Copy link

Issue #, if available: N/A

Description of changes:

Summary

Adds support for AWS Lambda's Tenant Isolation Mode feature to enable per-tenant isolation for multi-tenant applications.

Changes

SDK Update

  • Upgraded github.com/aws/aws-sdk-go-v2/service/lambda from v1.75.0 to v1.87.1 to include TenancyConfig API support

API Types

  • Added TenancyConfig type with TenantIsolationMode field to apis/v1alpha1/types.go
  • Added TenancyConfig field to FunctionSpec in apis/v1alpha1/function.go

Controller Implementation

  • Updated pkg/resource/function/sdk.go to handle TenancyConfig in:
    • newCreateRequestPayload - sets TenancyConfig on CreateFunction API call
    • sdkFind - reads TenancyConfig from GetFunction response
    • sdkCreate - reads TenancyConfig from CreateFunction response

CRD Updates

  • Regenerated CRD manifests with TenancyConfig field
  • Updated both config/crd/bases/lambda.services.k8s.aws_functions.yaml and helm/crds/lambda.services.k8s.aws_functions.yaml

Testing

  • Added example function manifest test/e2e/resources/function_tenancy.yaml demonstrating tenant isolation configuration

Usage Example

apiVersion: lambda.services.k8s.aws/v1alpha1
kind: Function
metadata:
  name: my-function
spec:
  name: my-function
  runtime: python3.9
  handler: index.handler
  role: arn:aws:iam::123456789012:role/lambda-role
  code:
    s3Bucket: my-bucket
    s3Key: function.zip
  tenancyConfig:
    tenantIsolationMode: "PER_TENANT"

AWS Documentation

Notes

  • TenancyConfig cannot be modified after function creation (AWS API limitation)
  • Only available in regions except Asia Pacific (New Zealand), AWS GovCloud (US), and China

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot requested review from jlbutler and michaelhtm January 14, 2026 12:43
@ack-prow
Copy link

ack-prow bot commented Jan 14, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: acaremrullah
Once this PR has been reviewed and has the lgtm label, please assign michaelhtm for approval by writing /assign @michaelhtm in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 14, 2026
@ack-prow
Copy link

ack-prow bot commented Jan 14, 2026

Hi @acaremrullah. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@acaremrullah
Copy link
Author

/assign @michaelhtm

Copy link
Contributor

@knottnt knottnt left a comment

Choose a reason for hiding this comment

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

@acaremrullah Thanks for the PR! Left a few comments.

@@ -0,0 +1,17 @@
apiVersion: lambda.services.k8s.aws/v1alpha1
Copy link
Contributor

Choose a reason for hiding this comment

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

Normally there would be an e2e test associated with the resources in this folder. Could you either add a test to validate setting the tenancy config or remove this?

metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.19.0
controller-gen.kubebuilder.io/version: v0.20.0
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Could you use v0.19.0 here.

A list of tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)
to apply to the function.
type: object
tenancyConfig:
Copy link
Contributor

Choose a reason for hiding this comment

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

When adding a new field a CRD I'd expect to see some changes the files associated with our code-generator to fetch a new version of the AWS API model that includes the new field and/or remove it from a a list of ignored fields in generator.yaml. Since, this is a newer AWS feature you'll likely need to update the version of the AWS SDK used to generate the lambda-controller here to use a newer version of AWS Lambda's API model. If that results in additional fields being added that you don't want to take on in this PR you can add them to the ignored fields (see docs).

} else {
ko.Spec.Timeout = nil
}
if resp.TenancyConfig != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

If TenancyConfig can only be set on creation we may want to mark this field as immutable in generator.yaml. That way user's can get some feedback if they try to change it in an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants