Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Created February 7, 2023 13:21
Show Gist options
  • Save thanakijwanavit/5c1442f9439a9dad1e79e2162a793c5e to your computer and use it in GitHub Desktop.
Save thanakijwanavit/5c1442f9439a9dad1e79e2162a793c5e to your computer and use it in GitHub Desktop.
aws sam lambda with docker image
Resources:
HelloWorldAPI:
Type: AWS::Serverless::Api
Properties:
Name: Hello World API
StageName: Prod
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
PackageType: Image
ImageConfig:
Command: ["app.lambda_handler"]
Events:
HelloWorld:
Type: Api # More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
Properties:
RestApiId: !Ref HelloWorldAPI
Path: /hello
Method: get
Metadata:
Dockerfile: hello_world_docker
DockerContext: .
DockerTag: v1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment