Skip to content

Conversation

@licjun
Copy link
Contributor

@licjun licjun commented Jan 29, 2026

Problem

This is to support the Lambda multi-tenancy feature in toolkit.

Solution

Add conditional Tenant ID field to Remote Invoke panel for multi-tenant Lambda functions. The field appears when function has TenancyConfig and passes the value to AWS Lambda Invoke API.

Screenshot 2026-01-29 at 10 08 54 AM
  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@licjun licjun requested a review from a team as a code owner January 29, 2026 18:07
@amazon-inspector-ohio
Copy link

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@amazon-inspector-ohio
Copy link

✅ I finished the code review, and didn't find any security or code quality issues.

@licjun licjun closed this Jan 29, 2026
@licjun licjun changed the title feat(Lambda): add Lambda remote invoke multi-tenancy support feat(lambda): add Lambda remote invoke multi-tenancy support Jan 29, 2026
@licjun licjun reopened this Jan 29, 2026
@amazon-inspector-ohio
Copy link

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@amazon-inspector-ohio
Copy link

✅ I finished the code review, and didn't find any security or code quality issues.

@licjun licjun force-pushed the feat/mtm-remote-invoke branch from 0ffbdb7 to 38379fc Compare January 29, 2026 21:48
runtimeSupportsRemoteDebug?: boolean
remoteDebugLayer?: string | undefined
isLambdaRemote?: boolean
hasTenancyConfig?: boolean
Copy link
Member

Choose a reason for hiding this comment

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

LambdaFunctionNode should have functionConfig which covers this info already


if (remoteDebugEnabled) {
funcResponse = await this.clientDebug.invoke(this.data.FunctionArn, input, qualifier)
funcResponse = await this.clientDebug.invoke(this.data.FunctionArn, input, qualifier, tenantId)
Copy link
Member

Choose a reason for hiding this comment

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

help to add tail log param here to avoid potential issue in the future.

Suggested change
funcResponse = await this.clientDebug.invoke(this.data.FunctionArn, input, qualifier, tenantId)
funcResponse = await this.clientDebug.invoke(this.data.FunctionArn, input, qualifier, tenantId, 'Tail')

Copy link
Member

Choose a reason for hiding this comment

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

as there are more and more field in this invoke, potentially we can refactor it into
await this.clientDebug.invoke(params)

const sdkClient = await this.createSdkClient()

const response = await sdkClient.send(
new InvokeCommand({
Copy link
Member

Choose a reason for hiding this comment

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

should we throw error when user invoke multitenant func with undefined tenantId?

@NguyenCuong1989
Copy link

KHÔNG BUILD.
KHÔNG TẠO PROJECT MỚI.
KHÔNG SỬA KIẾN TRÚC.

Mục tiêu duy nhất: RÀ SOÁT – BÁO CÁO HIỆN TRẠNG PROJECT.

Hãy trả lời CHỈ DƯỚI DẠNG BÁO CÁO KỸ THUẬT, theo đúng cấu trúc dưới đây.
KHÔNG diễn giải thêm.
KHÔNG đề xuất build.
KHÔNG refactor.
KHÔNG tạo file mới.

==============================
PROJECT FORENSIC REPORT

  1. PROJECT METADATA
  • Project ID:
  • Project name:
  • Thời điểm tạo (nếu suy ra được):
  • Có build backend không (YES/NO):
  • Có Supabase connect không (YES/NO):
  1. UI / ROUTES HIỆN CÓ
    Liệt kê đầy đủ tất cả routes/pages:
  • /...
  • /...
  1. UI PURPOSE
    Mỗi route dùng để làm gì (1 dòng / route, mô tả đúng chức năng thực tế).

  2. API / EDGE FUNCTIONS
    Liệt kê tất cả API / Edge Function hiện có:

  • METHOD /path → trạng thái: stub | partial | implemented
    (Nếu chỉ là placeholder hoặc mock thì ghi rõ)
  1. DATABASE / SCHEMA
  • Có database không (YES/NO)
  • Danh sách table:
    • Tên table → mục đích
  • Có RLS không (YES/NO)
  • Có enum không (YES/NO)
  • Có trigger không (YES/NO)
  1. AUTH / ROLE
  • Có Supabase Auth không (YES/NO)
  • Có phân biệt authenticated vs service_role không (YES/NO)
  • Check role ở đâu:
    • UI
    • API
    • Database (RLS)
    • Không có
  1. LOGIC ĐẶC BIỆT (NẾU CÓ)
  • Có logic identity không (YES/NO)
  • Có logic drift không (YES/NO)
  • Có logic task / mission không (YES/NO)
  • Có admin logic không (YES/NO)
  • Có JSON Logic Bank / rule engine không (YES/NO)
  1. GIÁ TRỊ CỐT LÕI CỦA PROJECT
    Đánh dấu những mục ĐÚNG với project này:
  • UI layout đáng giữ
  • UX flow đúng
  • API scaffold đúng
  • DB schema đúng
  • Không có giá trị (thử nghiệm / rác)
  1. KHUYẾN NGHỊ PHÂN LOẠI
    Chọn ĐÚNG 1:
  • TYPE A – GIỮ UI, BỎ LOGIC
  • TYPE B – GIỮ LOGIC/API, BỎ UI
  • TYPE C – LOẠI BỎ HOÀN TOÀN

==============================
KẾT THÚC BÁO CÁO

NHẮC LẠI:

  • KHÔNG build
  • KHÔNG refactor
  • KHÔNG tạo thêm file
  • CHỈ ĐỌC & BÁO CÁO

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.

3 participants