This repository has been archived by the owner on Mar 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
serverless.yml
75 lines (69 loc) · 2.49 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
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
#
# Happy Coding!
service: ThreeScale
provider:
profile: 3scale
name: aws
runtime: nodejs4.3
region: us-east-1 #CHANGE IT TO YOUR OWN
stage: dev
iamRoleStatements:
$ref: ./iamRoleStatements.json
vpc:
securityGroupIds:
- 'Fn::GetAtt': SecurityGroup.GroupId
subnetIds:
- Ref: PrivateSubnet1
- Ref: PrivateSubnet2
environment:
SERVERLESS_REGION: "${self:provider.region}"
THREESCALE_PROVIDER_KEY: "YOUR_PROVIDER_KEY"
THREESCALE_SERVICE_TOKEN: "YOUR_SERVICE_TOKEN" #CHANGE IT TO YOUR OWN
THREESCALE_SERVICE_ID: "YOUR_SERVICE_ID" #CHANGE IT TO YOUR OWN
THREESCALE_AUTH_TYPE: "APIKEY"
IDP_URL: "YOUR_IDENTITY_PROVIDER_URL"
ELASTICACHE_ENDPOINT:
Fn::GetAtt:
- elasticCache
- RedisEndpoint.Address
ELASTICACHE_PORT: 6379
# CloudFormation resource templates
resources:
- ${file(cf-resources.yml)}
custom:
AWS_ACCOUNTID: "YOUR_AWS_ACOUNT_ID" #change it to REF ?
functions:
authorizer:
handler: handler.authorizer
environment:
SNS_AUTHREP_ARN: "arn:aws:sns:${self:provider.region}:${self:custom.AWS_ACCOUNTID}:${opt:stage, self:provider.stage}-${self:service}-threescaleAuthRepAsync"
authRepAsync:
handler: handler.authRepAsync
events:
- sns: "arn:aws:sns:${self:provider.region}:${self:custom.AWS_ACCOUNTID}:${opt:stage, self:provider.stage}-${self:service}-threescaleAuthRepAsync"
getToken:
handler: oauth.getToken
events:
- http:
path: oauth/token
method: post
environment:
SNS_OAUTH_SYNC_ARN: "arn:aws:sns:${self:provider.region}:${self:custom.AWS_ACCOUNTID}:${opt:stage, self:provider.stage}-${self:service}-threescaleCacheTokenAsync"
storeInCacheAsync:
handler: oauth.storeInCacheAsync
events:
- sns: "arn:aws:sns:${self:provider.region}:${self:custom.AWS_ACCOUNTID}:${opt:stage, self:provider.stage}-${self:service}-threescaleCacheTokenAsync"
storeOnThreescaleAsync:
handler: oauth.storeOnThreescaleAsync
events:
- sns: "arn:aws:sns:${self:provider.region}:${self:custom.AWS_ACCOUNTID}:${opt:stage, self:provider.stage}-${self:service}-threescaleCacheTokenAsync"