forked from fishbrain/codebuild-slack-notifier
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
57 lines (52 loc) · 1.58 KB
/
serverless.yml
File metadata and controls
57 lines (52 loc) · 1.58 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
service:
name: ${self:custom.package.name}
plugins:
- serverless-webpack
- serverless-iam-roles-per-function
- serverless-pseudo-parameters
custom:
package: ${file(./package.json)}
provider:
name: aws
stage: ${opt:stage, 'tools'}
memorySize: 512
runtime: nodejs12.x
timeout: 30
region: ${opt:region, 'us-west-2'}
environment:
DEBUG: ${self:custom.env.DEBUG, 'true'}
TRACE: ${self:custom.env.TRACE, 'true'}
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}
S3_SLACK_COMMIT_BUCKET: cb-to-slack-tools-serverlessdeploymentbucket-1ndhem0ioiw1k
package:
individually: true
functions:
PostUpdateToSlack:
handler: 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'