-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
127 lines (119 loc) · 3.32 KB
/
serverless.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
service: asgard
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "=X.X.X"
plugins:
- serverless-iam-roles-per-function
- serverless-plugin-tracing
provider:
name: aws
runtime: python3.6
region: us-east-1
tracing: true
memorySize: 128
timeout: 60
environment:
stage: ${opt:stage}
logRetentionInDays: 5
# you can define service wide environment variables here
# environment:
# variable1: value1
# you can add packaging information here
package:
# include:
# - include-me.py
# - include-me-dir/**
exclude:
- .git/**
- node_modules/**
- botocore/**
- boto3/**
functions:
get-launch-config-instance-type:
handler: get_lc_instance_type.handler
iamRoleStatements:
- Effect: "Allow"
Action:
- "autoscaling:DescribeLaunchConfigurations"
- "xray:Put*"
Resource: "*"
exclude-subnets:
handler: exclude_subnets.handler
iamRoleStatements:
- Effect: "Allow"
Action:
- "autoscaling:DescribeLaunchConfigurations"
- "autoscaling:CreateOrUpdateTags"
- "autoscaling:UpdateAutoScalingGroup"
- "lambda:InvokeFunction"
- "xray:Put*"
Resource: "*"
patch-asg:
handler: patch_asg.handler
iamRoleStatements:
- Effect: "Allow"
Action:
- "ec2:DescribeSubnets"
- "ec2:DescribeSpotPriceHistory"
- "lambda:InvokeFunction"
- "xray:Put*"
Resource: "*"
find-unavailable-instance-types:
handler: find_unavailable_instance_types.handler
iamRoleStatements:
- Effect: "Allow"
Action:
- "autoscaling:DescribeLaunchConfigurations"
- "autoscaling:DescribeAutoScalingGroups"
- "ec2:DescribeAvailabilityZones"
- "ec2:DescribeSpotPriceHistory"
- "lambda:InvokeFunction"
- "xray:Put*"
Resource: "*"
events:
- schedule:
rate: rate(1 minute)
enabled: true
input:
region: us-east-1
- schedule:
rate: rate(1 minute)
enabled: true
input:
region: eu-central-1
# - http:
# path: users/create
# method: get
# - s3: ${env:BUCKET}
# - sns: greeter-topic
# - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000
# - alexaSkill
# - iot:
# sql: "SELECT * FROM 'some_topic'"
# - cloudwatchEvent:
# event:
# source:
# - "aws.ec2"
# detail-type:
# - "EC2 Instance State-change Notification"
# detail:
# state:
# - pending
# - cloudwatchLog: '/aws/lambda/hello'
# - cognitoUserPool:
# pool: MyUserPool
# trigger: PreSignUp
# Define function environment variables here
# environment:
# variable2: value2
# you can add CloudFormation resource templates here
#resources:
# Resources:
# NewResource:
# Type: AWS::S3::Bucket
# Properties:
# BucketName: my-new-bucket
# Outputs:
# NewOutput:
# Description: "Description for the output"
# Value: "Some output value"