-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample.yaml
63 lines (61 loc) · 1.72 KB
/
sample.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
55
56
57
58
59
60
61
62
63
AWSTemplateFormatVersion: '2010-09-09'
Description: Test lambda
Metadata:
aws:
region: eu-west-1
capabilities: CAPABILITY_IAM
isTemplate: true
template:
name: "test-{{stages.0.name}}-zappone" # The name of the stack. Always use the project name as prefix
stage: "{{stages.0.name}}"
Resources:
SampleFunctionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: [lambda.amazonaws.com]
Action:
- sts:AssumeRole
Path: "/"
Policies:
- PolicyName: root
PolicyDocument:
Version: '2012-10-17'
Statement:
- Action:
- logs:*
Resource: arn:aws:logs:*:*:*
Effect: Allow
SampleFunction:
Type: AWS::Lambda::Function
Properties:
Code:
ZipFile: |
module.exports.awslambda = (event, context, callback) => {
callback(null, { message: 'Hello, world!', event });
};
Description: Lambda to test turbodeploy
Environment:
Variables:
elyenv: invalid
FunctionName: "test-{{stage}}-zappone"
Handler: index.awslambda
MemorySize: 128
Runtime: nodejs6.10
Timeout: '300'
Role: !GetAtt SampleFunctionRole.Arn
SampleFunctionAlias:
Type: AWS::Lambda::Alias
Properties:
FunctionName: !Ref SampleFunction
FunctionVersion: !GetAtt SampleFunctionVersion.Version
Name: "{{stage}}"
SampleFunctionVersion:
Type: AWS::Lambda::Version
Properties:
FunctionName: !Ref SampleFunction
Description: The first deployment