-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemplate.yml
78 lines (74 loc) · 2.56 KB
/
template.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
AWSTemplateFormatVersion: 2010-09-09
Transform:
- AWS::Serverless-2016-10-31
- AWS::CodeStar
Parameters:
ProjectId:
Type: String
Description: AWS CodeStar projectID used to associate new resources to team members
Resources:
Lambda:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Join ['-', ['fw', !Ref 'ProjectId']]
Handler: index.handler
Runtime: nodejs8.10
MemorySize: 512
Timeout: 120
AutoPublishAlias: Latest
Environment:
Variables:
NODE_ENV: production
Role: arn:aws:iam::xxx:role/Worker-Lambda
RestApi:
Type: AWS::Serverless::Api
Properties:
StageName: Derp
DefinitionBody:
swagger: "2.0"
info:
version: "1.0"
title: [!Ref 'ProjectId']
host: "i4r9f0ntaf.execute-api.us-east-2.amazonaws.com"
basePath: "/Stage"
schemes:
- "https"
paths:
/starwars-char-data:
get:
responses:
"200":
description: "200 response"
security:
- api_key: []
x-amazon-apigateway-integration:
uri: !Join ['arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxx:function:', [!Ref 'ProjectId'], '/invocations']
passthroughBehavior: "when_no_match"
httpMethod: "GET"
type: "aws_proxy"
post:
responses:
"200":
description: "200 response"
security:
- api_key: []
x-amazon-apigateway-integration:
'arn:aws:iam::133345006009:role/FW-Worker-Lambda'
uri: !Join ['arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxx:function:', [!Ref 'ProjectId'], '/invocations']
passthroughBehavior: "when_no_match"
httpMethod: "POST"
type: "aws_proxy"
options:
responses:
"200":
description: "200 response"
x-amazon-apigateway-integration:
uri: !Join ['arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:xxx:function:', [!Ref 'ProjectId'], '/invocations']
passthroughBehavior: "when_no_match"
httpMethod: "POST"
type: "aws_proxy"
securityDefinitions:
api_key:
type: "apiKey"
name: "x-api-key"
in: "header"