This repository has been archived by the owner on Sep 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
serverless.yml
60 lines (55 loc) · 1.61 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
service:
name: ${self:custom.package.name}
plugins:
- serverless-scriptable-plugin
- serverless-iam-roles-per-function
- serverless-pseudo-parameters
custom:
package: ${file(./package.json)}
scriptHooks:
before:package:createDeploymentArtifacts: npm run build
provider:
name: aws
stage: ${opt:stage, 'tools'}
memorySize: 128
runtime: nodejs12.x
timeout: 15
region: ${opt:region, 'eu-west-1'}
environment:
DEBUG: ${self:custom.env.DEBUG, 'true'}
TRACE: ${self:custom.env.TRACE, 'false'}
STAGE: ${self:provider.stage}
REGION: ${self:provider.region}
VERSION: ${self:custom.package.version}
GIT_COMMIT_SHA: ${file(./env/gitCommitSha.js):gitCommitSHA}
SERVICE: ${self:service.name}
package:
individually: true
exclude:
- node_modules/aws-sdk/**
functions:
PostUpdateToSlack:
handler: dist/index.handler
reservedConcurrency: 1
iamRoleStatements:
- Effect: Allow
Action:
- ssm:GetParameter
Resource:
- arn:aws:ssm:${self:provider.region}:#{AWS::AccountId}:parameter/codebuild-slack-notifier/*
events:
- cloudwatchEvent:
event:
source:
- 'aws.codebuild'
detail-type:
- 'CodeBuild Build State Change'
- 'CodeBuild Build Phase Change'
- cloudwatchEvent:
event:
source:
- 'aws.codepipeline'
detail-type:
- 'CodePipeline Pipeline Execution State Change'
- 'CodePipeline Stage Execution State Change'
- 'CodePipeline Action Execution State Change'