1 Answer
- Newest
- Most votes
- Most comments
3
Yes, you can create an ECR repository and deploy an image-backed Lambda function directly from a Dockerfile without manually building and uploading the image outside of SAM, below the sample about SAM template of Dockerfile base on Yaml:
Resources:
MyLambdaFunction:
Type: AWS::Serverless::Function
Properties:
PackageType: Image
ImageConfig:
Command: ["app.lambda_handler"]
MemorySize: 512
Timeout: 10
Metadata:
Dockerfile: Dockerfile
DockerContext: ./path-to-docker-context
DockerTag: latest