Skip to content

Bug: invocation-type: Event is not supported. RequestResponse is only supported. #6900

Open
@ijtarano

Description

@ijtarano

Description:

It seems like Event in boto3 invoke method doesn't work with SAM Local even when boto3 accept this parameter (https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda/client/invoke.html)

Steps to reproduce:

import boto3
import json 

payload = {
}

lambda_client = boto3.client("lambda", endpoint_url="http://localhost:3001", region_name="eu-west-1")
lambda_function_name = "Lambda"

payload_json = json.dumps(payload)

response = lambda_client.invoke(
    InvocationType="Event", # This Event fails
    FunctionName=lambda_function_name,
    Payload=payload_json
)

Observed result:

ClientError: An error occurred (NotImplemented) when calling the Invoke operation: invocation-type: Event is not supported. RequestResponse is only supported.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. Amazon Linux:
  2. sam --version: SAM CLI, version 1.113.0
  3. AWS region: eu-west-1
{
  "version": "1.113.0",
  "system": {
    "python": "3.11.3",
    "os": "Linux-4.14.320-243.544.amzn2.x86_64-x86_64-with-glibc2.26"
  },
  "additional_dependencies": {
    "docker_engine": "20.10.23",
    "aws_cdk": "Not available",
    "terraform": "1.7.2"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions