AWS Lambda: Support ImageConfig properties
See original GitHub issueThere is new image:
option that can create AWS Lambda function based on docker container image.
It would be nice to support image_config
as well, to override image Command
, EntryPoint
and WorkingDirectory
.
functions:
hello:
image: ${env:DOCKER_IMAGE}
hello2:
image: ${env:DOCKER_IMAGE}
image_config:
command: ["app.handler2"]
or even
provider:
image: ${env:DOCKER_IMAGE}
functions:
hello:
image_config:
command: ["app.handler"]
hello2:
image_config:
command: ["app.handler2"]
working_dir: "/var/task/experimental"
hello3:
image_config:
command: ["app.swift_handler"]
entry_point:
- /var/runtime/swift_bootstrap
Use case description
It would be possible to share one docker image and choose specific handler per lambda function.
It would be event better if provider
section allows to define global image, shared between all lambda functions that contain image_config parameter. Similar like it’s done for layers
.
Proposed solution
At the moment you can achieve similar thing overriding LambdaFunction in Resources
service: sls-container-image-test
useDotenv: true
provider:
name: aws
region: ap-northeast-1
functions:
hello:
image: ${env:DOCKER_IMAGE}
hello2:
image: ${env:DOCKER_IMAGE}
resources:
Resources:
Hello2LambdaFunction:
Type: AWS::Lambda::Function
Properties:
ImageConfig:
EntryPoint:
- /var/runtime/bootstrap
Command: ["app.handler2"]
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top Results From Across the Web
AWS::Lambda::Function ImageConfig - AWS CloudFormation
Use the AWS CloudFormation AWS::Lambda::Function.ImageConfig resource for Lambda. ... Properties. Command. Specifies parameters that you want to pass in ...
Read more >AWS::Lambda::Function ImageConfig - Amazon CloudFormation
Use the Amazon CloudFormation AWS::Lambda::Function.ImageConfig resource for Lambda. ... SyntaxProperties. Services or capabilities described in Amazon Web ...
Read more >Container image support for AWS Lambda via cloudformation
Yes it does. AWS::Lambda::Function has new properties specific to container images, such as: ImageConfig; PackageType; ImageUri.
Read more >aws.lambda.Function - Pulumi
Documentation for the aws.lambda.Function resource with examples, input properties, output properties, lookup functions, and supporting types.
Read more >Let's Try Lambda Container Support with SAM CLI - hayao-k.dev
Introduction Container image support for AWS Lambda was announced at ... Properties: PackageType: Image # ImageConfig: # Uncomment this to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@arekt great thanks for proposal. We’re definitely open for it, still to be more on par with current conventions I believe it should be configured in a way that we expand already defined
image
property, So extended configuration we could look as follows:What do you think?
Also what exactly properties do you believe we should support, and how will they map to generated CloudFormation template?
@NaveenTartLabs For general support please check: