-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
49 lines (46 loc) · 1.22 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
service: scmr-sum
provider:
name: aws
runtime: python3.9
stage: ${opt:stage, self:custom.defaultStage}
region: ap-northeast-1
timeout: 300
memorySize: 128
environment:
SLACK_URL: https://slack.com/api/files.upload
iamRoleStatements:
- Effect: 'Allow'
Action:
- 'ec2:CreateNetworkInterface'
- 'ec2:DescribeNetworkInterfaces'
- 'ec2:DeleteNetworkInterface'
Resource:
- '*'
vpc:
securityGroupIds:
Fn::Split:
- ','
- ${file(./env/${self:provider.stage}.yml):VPC_SECURITY_GROUP_IDS}
subnetIds:
- ${file(./env/${self:provider.stage}.yml):VPC_SUBNET1_ID}
- ${file(./env/${self:provider.stage}.yml):VPC_SUBNET2_ID}
# vpc:
# securityGroupIds:
# Fn::Split:
# - ','
# - ${file(./env/${self:provider.stage}.yml):VPC_SECURITY_GROUP_IDS}
# subnetIds:
# Fn::Split:
# - ','
# - ${file(./env/${self:provider.stage}.yml):VPC_SUBNET_IDS}
custom:
defaultStage: dev
environment:
dev: ${file(env/dev.yml)}
prod: ${file(env/prod.yml)}
functions:
main:
handler: handler.main
environment: ${self:custom.environment.${self:provider.stage}}
events:
- schedule: cron(0 16 L * ? *)