-
Notifications
You must be signed in to change notification settings - Fork 2
/
sam_template.yaml
59 lines (59 loc) · 1.79 KB
/
sam_template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Resources:
fqndServiceGw:
Type: AWS::Serverless::Api
Properties:
Name: fqdnServiceGw
StageName: prod
DefinitionBody:
swagger: "2.0"
info:
version: "2018-06-11T16:14:04Z"
title: "fqdnServiceProxy"
paths:
/:
x-amazon-apigateway-any-method:
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri: !Sub "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${fqdnServiceLamdba.Arn}/invocations"
responses: {}
/{proxy+}:
x-amazon-apigateway-any-method:
x-amazon-apigateway-integration:
httpMethod: POST
type: aws_proxy
uri: !Sub "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${fqdnServiceLamdba.Arn}/invocations"
responses: {}
Variables:
dbtable: !Ref fqndServiceTable
secret: defaultSecret
fqdnServiceLamdba:
Type: AWS::Serverless::Function
Properties:
FunctionName: fqdnServiceLamdba
Handler: dnsfeedsrv.handler
Runtime: nodejs8.10
Timeout: 3
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref fqndServiceTable
CodeUri:
Bucket: oauth2shared
Key: dnsfeedsrv.zip
Events:
Main:
Type: Api
Properties:
Path: /
Method: ANY
RestApiId: !Ref fqndServiceGw
Wildcard:
Type: Api
Properties:
Path: '/{proxy+}'
Method: ANY
RestApiId: !Ref fqndServiceGw
fqndServiceTable:
Type: AWS::Serverless::SimpleTable