Skip to content

Commit

Permalink
Merge from aws/aws-sam-cli/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
aws-sam-cli-bot authored Nov 14, 2023
2 parents 3102565 + 891fb4c commit 93c7be0
Show file tree
Hide file tree
Showing 42 changed files with 811 additions and 238 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
ruby-version: "3.2"
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aws-sam-translator==1.79.0
docker~=6.1.0
dateparser~=1.1
requests~=2.31.0
aws_lambda_builders==1.40.0
aws_lambda_builders==1.41.0
tomlkit==0.12.2
watchdog==3.0.0
rich~=13.6.0
Expand Down
6 changes: 3 additions & 3 deletions requirements/reproducible-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ attrs==23.1.0 \
# jsonschema
# referencing
# sarif-om
aws-lambda-builders==1.40.0 \
--hash=sha256:660b1d284320172beca39971b2932549d1ae642aa94500bcf70b612771957480 \
--hash=sha256:a48f083f750d62d5a5cf0bac1fe224682b5ed83dd821d794802c791ec22e077b
aws-lambda-builders==1.41.0 \
--hash=sha256:b26280609269696d4c7ebe6ea208de5d02a8e4f14711ceac265510e28de65258 \
--hash=sha256:d48d0d9b704319cdb6bb19918a72bf6c06fd3a7012848f6bcc4b906d5686db17
# via aws-sam-cli (setup.py)
aws-sam-translator==1.79.0 \
--hash=sha256:6f0c6bbcebcc98c4f98dc238352a06b0befe7fb72535cca75712fffff4873875 \
Expand Down
6 changes: 3 additions & 3 deletions requirements/reproducible-mac.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ attrs==23.1.0 \
# jsonschema
# referencing
# sarif-om
aws-lambda-builders==1.40.0 \
--hash=sha256:660b1d284320172beca39971b2932549d1ae642aa94500bcf70b612771957480 \
--hash=sha256:a48f083f750d62d5a5cf0bac1fe224682b5ed83dd821d794802c791ec22e077b
aws-lambda-builders==1.41.0 \
--hash=sha256:b26280609269696d4c7ebe6ea208de5d02a8e4f14711ceac265510e28de65258 \
--hash=sha256:d48d0d9b704319cdb6bb19918a72bf6c06fd3a7012848f6bcc4b906d5686db17
# via aws-sam-cli (setup.py)
aws-sam-translator==1.79.0 \
--hash=sha256:6f0c6bbcebcc98c4f98dc238352a06b0befe7fb72535cca75712fffff4873875 \
Expand Down
6 changes: 3 additions & 3 deletions requirements/reproducible-win.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ attrs==23.1.0 \
# jsonschema
# referencing
# sarif-om
aws-lambda-builders==1.40.0 \
--hash=sha256:660b1d284320172beca39971b2932549d1ae642aa94500bcf70b612771957480 \
--hash=sha256:a48f083f750d62d5a5cf0bac1fe224682b5ed83dd821d794802c791ec22e077b
aws-lambda-builders==1.41.0 \
--hash=sha256:b26280609269696d4c7ebe6ea208de5d02a8e4f14711ceac265510e28de65258 \
--hash=sha256:d48d0d9b704319cdb6bb19918a72bf6c06fd3a7012848f6bcc4b906d5686db17
# via aws-sam-cli (setup.py)
aws-sam-translator==1.79.0 \
--hash=sha256:6f0c6bbcebcc98c4f98dc238352a06b0befe7fb72535cca75712fffff4873875 \
Expand Down
2 changes: 1 addition & 1 deletion samcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
SAM CLI version
"""

__version__ = "1.101.0"
__version__ = "1.102.0"
23 changes: 16 additions & 7 deletions samcli/commands/_utils/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,13 +587,22 @@ def remote_invoke_parameter_click_option():
type=RemoteInvokeBotoApiParameterType(),
callback=remote_invoke_boto_parameter_callback,
required=False,
help="Additional parameters that can be passed to invoke the resource.\n"
"The following additional parameters can be used to invoke a lambda resource and get a buffered response: "
"InvocationType='Event'|'RequestResponse'|'DryRun', LogType='None'|'Tail', "
"ClientContext='base64-encoded string' Qualifier='string'. "
"The following additional parameters can be used to invoke a lambda resource with response streaming: "
"InvocationType='RequestResponse'|'DryRun', LogType='None'|'Tail', "
"ClientContext='base64-encoded string', Qualifier='string'.",
help="Additional parameters that can be passed"
" to invoke the resource.\n\n"
"Lambda Function (Buffered stream): The following additional parameters can be used to invoke a lambda resource"
" and get a buffered response: InvocationType='Event'|'RequestResponse'|'DryRun', LogType='None'|'Tail', "
"ClientContext='base64-encoded string' Qualifier='string'.\n\n"
"Lambda Function (Response stream): The following additional parameters can be used to invoke a lambda resource"
" with response streaming: InvocationType='RequestResponse'|'DryRun', LogType='None'|'Tail', "
"ClientContext='base64-encoded string', Qualifier='string'.\n\n"
"Step Functions: The following additional parameters can be used to start a state machine execution: "
"name='string', traceHeader='string'\n\n"
"SQS Queue: The following additional parameters can be used to send a message to an SQS queue: "
"DelaySeconds=integer, MessageAttributes='json string', MessageSystemAttributes='json string',"
" MessageDeduplicationId='string', MessageGroupId='string'\n\n"
"Kinesis Data Stream: The following additional parameters can be used to put a record"
" in the kinesis data stream: PartitionKey='string', ExplicitHashKey='string',"
" SequenceNumberForOrdering='string', StreamARN='string' ",
)


Expand Down
2 changes: 1 addition & 1 deletion samcli/commands/build/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
Supported Runtimes
------------------
1. Python 3.7, 3.8, 3.9, 3.10, 3.11 using PIP\n
2. Nodejs 18.x, 16.x, 14.x, 12.x using NPM\n
2. Nodejs 20.x, 18.x, 16.x, 14.x, 12.x using NPM\n
3. Ruby 2.7, 3.2 using Bundler\n
4. Java 8, Java 11, Java 17 using Gradle and Maven\n
5. Dotnet6 using Dotnet CLI (without --use-container)\n
Expand Down
21 changes: 18 additions & 3 deletions samcli/commands/remote/invoke/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from samcli.lib.remote_invoke.remote_invoke_executors import RemoteInvokeOutputFormat
from samcli.lib.telemetry.event import EventTracker
from samcli.lib.telemetry.metric import track_command
from samcli.lib.utils.resources import AWS_LAMBDA_FUNCTION
from samcli.lib.utils.version_checker import check_newer_version

LOG = logging.getLogger(__name__)
Expand All @@ -30,7 +31,13 @@
DESCRIPTION = """
Invoke or send an event to resources in the cloud.
An event body can be passed using either -e (--event) or --event-file parameter.
Returned response will be written to stdout. Lambda logs will be written to stderr.
This command can be used to invoke a Lambda Function and get the output payload, start a State Machine execution
and wait for the output of the final step, send a message to SQS Queue, or put a data record to
Kinesis Data Streams.
Returned response will be written to stdout. Lambda logs and Step Function execution
errors will be written to stderr.
"""


Expand All @@ -50,7 +57,8 @@
"--event",
"-e",
help="The event that will be sent to the resource. The target parameter will depend on the resource type. "
"For instance: 'Payload' for Lambda which can be passed as a JSON string",
"For instance: 'Payload' for Lambda which can be passed as a JSON string, 'Input' for Step Functions, "
"'MessageBody' for SQS, and 'Data' for Kinesis data streams.",
)
@click.option(
"--event-file",
Expand Down Expand Up @@ -152,11 +160,18 @@ def do_cli(
stack_name=stack_name,
resource_id=resource_id,
) as remote_invoke_context:
if test_event_name:
if (
test_event_name
and remote_invoke_context.resource_summary
and remote_invoke_context.resource_summary.resource_type == AWS_LAMBDA_FUNCTION
):
lambda_test_event = remote_invoke_context.get_lambda_shared_test_event_provider()
LOG.debug("Retrieving remote event %s", test_event_name)
event = lambda_test_event.get_event(test_event_name, remote_invoke_context.resource_summary)
LOG.debug("Remote event contents: %s", event)
elif test_event_name:
LOG.info("Note: remote event is only supported for AWS Lambda Function resource.")
test_event_name = ""

event_type = RemoteInvokeEventType.get_event_type(
event=event,
Expand Down
Loading

0 comments on commit 93c7be0

Please sign in to comment.