This repository has been archived by the owner on Sep 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
86 lines (78 loc) · 2.37 KB
/
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
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
AWS
Sample SAM Template for AWS
Metadata:
AWS::ServerlessRepo::Application:
Name: PublicationChannelRegister
Description: Channel Registry for publications
Author: Unit
SpdxLicenseId: MIT
LicenseUrl: LICENSE
Labels: ['${GIT_REPO}', '${CODEBUILD_RESOLVED_SOURCE_VERSION}', '@${BUILD_TIMESTAMP}']
# SemanticVersion: is set via SAM command line
Parameters:
CustomDomain:
Type: String
Description: Custom API to connect this lambda to
CustomDomainBasePath:
Type: String
Description: Base path mapping in CustomDomain
Globals:
Function:
Timeout: 20
Resources:
ApiAccessLogGroup:
Type: AWS::Logs::LogGroup
FindChannelApi:
Type: AWS::Serverless::Api
Properties:
AccessLogSetting:
DestinationArn: !GetAtt ApiAccessLogGroup.Arn
Format: '{ "apiId": "$context.apiId", "requestId": "$context.requestId", "requestTime": "$context.requestTime", "requestTimeEpoch": "$context.requestTimeEpoch", "httpMethod": "$context.httpMethod", "path": "$context.path", "status": "$context.status", "error.message": "$context.error.message" }'
StageName: Prod
Cors:
AllowMethods: "'POST,OPTIONS'"
AllowHeaders: "'Content-Type'"
AllowOrigin: "'*'"
EndpointConfiguration: REGIONAL
Models:
Search:
type: object
required:
- tableId
- searchTerm
properties:
tableId:
type: integer
searchTerm:
type: string
FindChannelFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: find-channel
Handler: no.unit.nva.channel.MainHandler::handleRequest
Runtime: java11
MemorySize: 1408
Environment:
Variables:
ALLOWED_ORIGIN: '*'
Events:
FindChannel:
Type: Api
Properties:
Path: /search
Method: POST
RestApiId:
Ref: FindChannelApi
RequestModel:
Model: Search
Required: true
FindChannelBasePathMapping:
Type: AWS::ApiGateway::BasePathMapping
Properties:
BasePath: !Ref CustomDomainBasePath
DomainName: !Ref CustomDomain
RestApiId: !Ref FindChannelApi
Stage: !Ref FindChannelApi.Stage