-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yml
More file actions
57 lines (53 loc) · 1.35 KB
/
template.yml
File metadata and controls
57 lines (53 loc) · 1.35 KB
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
55
56
57
AWSTemplateFormatVersion: 2010-09-09
Description: >-
godemo-lambda
Transform: AWS::Serverless-2016-10-31
Globals:
Function:
Timeout: 5
Parameters:
AppId:
Type: String
Default: test2
MongoDB:
Type: String
Default: localhost
Resources:
godemoLambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: godemoLambda
CodeUri: ./
Handler: go-rest-api
Runtime: go1.x
MemorySize: 128
Timeout: 15
Description: godemo lambda function
Environment:
Variables:
MONGO_URL: !Ref MongoDB
APP_ID: !Ref AppId
Policies:
- AWSLambdaBasicExecutionRole
- AWSLambdaVPCAccessExecutionRole
- AWSLambda_ReadOnlyAccess
VpcConfig:
SecurityGroupIds:
- sg-062b035623f5d43af
SubnetIds:
- subnet-f8afadb0
- subnet-c8ceb292
- subnet-953a08f3
Events:
ApiEvent:
Type: HttpApi
Outputs:
godemoLambdaAPI:
Description: "API Gateway endpoint URL for Go Function"
Value: !Sub "https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/default"
godemoLambda:
Description: "First Lambda Function ARN"
Value: !GetAtt godemoLambda.Arn
godemoLambdaIamRole:
Description: "Implicit IAM Role created for Go function"
Value: !GetAtt godemoLambdaRole.Arn