https://pulumi.com logo
Title
s

salmon-hairdresser-65532

03/16/2023, 3:30 PM
Hi all, I have a problem with Pulumi and AWS Lambda destinations. Let me demonstrate it via a small example.
import pulumi
import pulumi_aws as aws

service_function = aws.lambda_.Function(
    "lambda-service",
    runtime="python3.9",
    handler="handler.handler",
    memory_size=384,
    timeout=5,
    code=pulumi.FileArchive("/path/to/code"),
)

function_on_success = aws.lambda_.Function(
    "function_on_success",
    runtime="python3.9",
    handler="handler.handler",
    memory_size=384,
    timeout=5,
    code=pulumi.FileArchive("/path/to/code"),
)

success_destination = aws.lambda_.FunctionEventInvokeConfig(
    "success_destination",
    function_name=service_function.name,
    destination_config=aws.lambda_.FunctionEventInvokeConfigDestinationConfigArgs(
        on_success=aws.lambda_.FunctionEventInvokeConfigDestinationConfigOnSuccessArgs(
            destination=function_on_success.arn
        ),
    ),
)

pulumi.export("function-name", service_function.name)
I am using Localstack to test it locally and I would have expected that
awslocal lambda list-function-event-invoke-configs --function-name function-name
would show me the created destination. However, I get a 404 error since there seems to be not destaination. Also testing the functionality shows that there is no destination that has been createt (I tried it by invoking the first Lambda via SQS from the CLI). I think it might be a Localstack problem, since also putting it through the CLI does not work. Does anyone have similar issues and/or know a solution? If more details are necessary, please tell me and I will provide them. Of course this minimal example is actually part of a larger project. EDIT: I thought it put-function-event-invoke-config via CLI worked but now I see that it does not. I suspect this is rather a Localstack problem.
b

billowy-army-68599

03/16/2023, 4:43 PM
yes seems like a local stack problem, tbis works fine for against the aws api