https://pulumi.com logo
Title
b

bland-pharmacist-96854

01/08/2023, 4:37 PM
Hi! Does anyone have an example of running a lambda function from an image using python?
m

millions-furniture-75402

01/09/2023, 2:03 PM
Something like
import pulumi
import pulumi_awsx as awsx

repository = awsx.ecr.Repository("repository")
image = awsx.ecr.Image("image",
    repository_url=repository.url,
    path="./app")

lambda_function = aws.lambda_.Function("mylambda",
    role=iam.lambda_role.arn,
    runtime="python3.7",
    handler="hello.handler",
    image_config={ command: ["mylambda.handler"] },
)
And here is a much older example (I believe there are differences with the SDK now) https://github.com/pulumi/pulumitv/tree/master/modern-infrastructure-wednesday/2020-12-09
p

proud-art-41399

01/09/2023, 4:54 PM
And here's an official TypeScript example, for reference – https://github.com/pulumi/examples/blob/master/aws-ts-lambda-thumbnailer/index.ts.