-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathserverless.yml
124 lines (110 loc) · 3.39 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
# serverless config file to load AWS lambda of DevOps Dojo Bot
#
# For full config options, check the docs:
# docs.serverless.com
service: devops-dojo-robot
frameworkVersion: "^2.1.0"
provider:
name: aws
runtime: nodejs12.x
region: ${env:AWS_REGION}
stage: ${env:AWS_STAGE}
tags:
Name: "Online DevOps Dojo coach"
environment: ${env:AWS_STAGE}
application-id: online-devops-dojo
Application: online-devops-dojo
version: "1.2.0" # This is the version of the lambda (js)
owner: "philippe.berthonneau@dxc.com"
group: "doe"
iamManagedPolicies:
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
# you can define service wide environment variables here
# environment:
# variable1: value1
# Upload only files useful on AWS
package:
exclude:
- './**'
include:
- handler.js
- index.js
- node_modules/**
- package*.json
functions:
lambda:
handler: handler.probot
environment:
WEBHOOK_SECRET: ${env:WEBHOOK_SECRET}
APP_ID: ${env:APP_ID}
PRIVATE_KEY: ${env:PRIVATE_KEY}
VERSION: "1.5.0" # This is the latest version from the changelog
# create the API Gateway
events:
- http:
path: /
method: get
- http:
path: /
method: post
# The following are a few example events you can configure
# NOTE: Please make sure to change your handler code to work with those events
# Check the event documentation for details
# events:
# - http:
# path: users/create
# method: get
# - s3: ${env:BUCKET}
# - schedule: rate(10 minutes)
# - sns: greeter-topic
# - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000
# - alexaSkill: amzn1.ask.skill.xx-xx-xx-xx
# - alexaSmartHome: amzn1.ask.skill.xx-xx-xx-xx
# - 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"
#resources#
# Resources:
# myDefaultRole:
# Type: AWS::IAM::Role
# Properties:
# Path: /my/default/path/
# RoleName: MyDefaultRole # required if you want to use 'serverless deploy --function' later on
# AssumeRolePolicyDocument:
# Version: '2017'
# Statement:
# - Effect: Allow
# Principal:
# Service:
# - lambda.amazonaws.com
# Action: sts:AssumeRole
# # note that these rights are needed if you want your function to be able to communicate with resources within your vpc
# ManagedPolicyArns:
# - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
# - arn:aws:iam::aws:policy/AmazonSSMFullAccess