88from samcli .cli .cli_config_file import ConfigProvider , configuration_option , save_params_option
99from samcli .cli .context import Context
1010from samcli .cli .main import aws_creds_options , common_options , pass_context , print_cmdline_args
11- from samcli .cli .types import RemoteInvokeOutputFormatType
11+ from samcli .cli .types import RemoteInvokeOutputFormatType , TenantIdType
1212from samcli .commands ._utils .command_exception_handler import command_exception_handler
1313from samcli .commands ._utils .options import remote_invoke_parameter_option
1414from samcli .commands .remote .invoke .core .command import RemoteInvokeCommand
6666 type = click .File ("r" , encoding = "utf-8" ),
6767 help = "The file that contains the event that will be sent to the resource." ,
6868)
69+ @click .option (
70+ "--tenant-id" ,
71+ type = TenantIdType (),
72+ help = "Tenant ID for multi-tenant Lambda functions. "
73+ "Used to ensure compute isolation between different tenants. "
74+ "Must be 1-256 characters, the allowed characters are a-z and A-Z, "
75+ "numbers, spaces, and the characters _ . : / = + - @" ,
76+ )
6977@click .option (
7078 "--test-event-name" ,
7179 help = "Name of the remote test event to send to the resource" ,
@@ -94,6 +102,7 @@ def cli(
94102 resource_id : str ,
95103 event : str ,
96104 event_file : TextIOWrapper ,
105+ tenant_id : str ,
97106 output : RemoteInvokeOutputFormat ,
98107 test_event_name : str ,
99108 parameter : dict ,
@@ -110,6 +119,7 @@ def cli(
110119 resource_id ,
111120 event ,
112121 event_file ,
122+ tenant_id ,
113123 output ,
114124 parameter ,
115125 test_event_name ,
@@ -125,6 +135,7 @@ def do_cli(
125135 resource_id : str ,
126136 event : str ,
127137 event_file : TextIOWrapper ,
138+ tenant_id : str ,
128139 output : RemoteInvokeOutputFormat ,
129140 parameter : dict ,
130141 test_event_name : str ,
@@ -187,7 +198,7 @@ def do_cli(
187198 EventTracker .track_event ("RemoteInvokeEventType" , event_type )
188199
189200 remote_invoke_input = RemoteInvokeExecutionInfo (
190- payload = event , payload_file = event_file , parameters = parameter , output_format = output
201+ payload = event , payload_file = event_file , tenant_id = tenant_id , parameters = parameter , output_format = output
191202 )
192203
193204 remote_invoke_context .run (remote_invoke_input = remote_invoke_input )
0 commit comments