-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
113 lines (105 loc) · 2.57 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
service: github-status-check
# app and org for use with dashboard.serverless.com
app: my-veracode
org: yaakovlerer
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
frameworkVersion: '2'
useDotenv: true
package:
exclude:
- test/**
- '**/*.test.js'
- 'empty.env'
- resources/**
- permissions/**
custom:
prod:
Stack: ExampleSite
LogLevel: info
dev:
Stack: ExampleSite
LogLevel: debug
settings:
ACCOUNT_ID: "#{AWS::AccountId}"
TARGET_REGION: ${self:provider.region}
logLevel: ${self:custom.${opt:stage, self:provider.stage, 'dev'}.LogLevel}
GITHUB_APP_ID: ${env:GITHUB_APP_ID}
GITHUB_APP_INSTALL_ID: ${env:GITHUB_APP_INSTALL_ID}
PEM: ${env:PEM}
provider:
name: aws
stage: prod
runtime: nodejs12.x
region: ap-southeast-2
apiGateway:
shouldStartNameWithService: true
iam:
role:
statements:
- Effect: "Allow"
Action:
- sqs:SendMessage
Resource:
- { "Fn::GetAtt" : ["ScanChecks","Arn"]}
- { "Fn::GetAtt" : ["ImportFindings","Arn"]}
environment: ${self:custom.settings}
lambdaHashingVersion: 20201221
plugins:
- serverless-pseudo-parameters
- serverless-iam-roles-per-function
functions:
# Listen to a call from GitHub Workflow
githubListener:
handler: githubHandler.webhookListen
memorySize: 128
timeout: 10
events:
- http:
path: /github
method: post
# - http:
# path: /checkScanStatus/{appGUID}
# method: get
veracodeForGithubBuildProcessor:
handler: handler.sqsSingleScanSample
memorySize: 128
timeout: 20
environment:
API_ID: ${env:API_ID}
API_KEY: ${env:API_KEY}
events:
- sqs:
arn:
Fn::GetAtt:
- ScanChecks
- Arn
batchSize: 1
veracodePopulateGithubIssues:
handler: awsHandlers/populateGithubIssues.handler
memorySize: 128
timeout: 30
environment:
API_ID: ${env:API_ID}
API_KEY: ${env:API_KEY}
events:
- sqs:
arn:
Fn::GetAtt:
- ImportFindings
- Arn
batchSize: 1
resources:
Resources:
ScanChecks:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "ScanChecks"
VisibilityTimeout: 90
MessageRetentionPeriod: 43200
ImportFindings:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "ImportFindings"
VisibilityTimeout: 45
MessageRetentionPeriod: 7200