-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtemplate.yaml
54 lines (48 loc) · 1.17 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: lambda-custom-docker-image
Parameters:
Version:
Type: String
Default: 'v1'
Stage:
Type: String
Default: 'dev'
AllowedValues:
- dev
- stage
- prod
Project:
Type: String
Default: 'docker-image-test'
DockerPath:
Type: String
Default: './pytorch-example'
Globals:
Function:
Timeout: 180
MemorySize: 2048
Resources:
MyDockerLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub '${Project}-${Stage}'
PackageType: Image
Events:
HelloWorld:
Type: Api
Properties:
Path: /myexample # Replace this for most descriptive path
Method: post
Metadata:
Dockerfile: Dockerfile
DockerContext: !Sub '${DockerPath}'
DockerTag: 'latest'
Tags:
version: !Ref Version
stage: !Ref Stage
project: !Ref Project
Outputs:
MyCustomDockerApi:
Description: 'API Gateway Prod endpoint URL for My Docker Lambda function'
Value: !Sub 'https://${MyDockerLambda}.execute-api.${AWS::Region}.amazonaws.com/Prod/myexample/'