-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yml
56 lines (56 loc) · 1.43 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
---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Line Bot
Parameters:
ApiStageName:
Type: String
Default: v1
ChannelSecret:
Type: String
NoEcho: 'true'
ChannelAccessToken:
Type: String
NoEcho: 'true'
Resources:
Api:
Type: AWS::Serverless::Api
Properties:
Name: !Join ['-', [!Ref AWS::StackName, apigw]]
StageName: !Ref ApiStageName
Auth:
DefaultAuthorizer: NONE
Function:
Type: AWS::Serverless::Function
Properties:
Handler: bootstrap
Runtime: provided.al2
Architectures:
- arm64
CodeUri: ./bootstrap.zip
FunctionName: !Join ['-', [!Ref AWS::StackName, lambda]]
Description: Line Bot
Timeout: 120
MemorySize: 128
Policies:
- AWSLambdaBasicExecutionRole
Environment:
Variables:
LINE_CHANNEL_SECRET: !Ref ChannelSecret
LINE_CHANNEL_ACCESS_TOKEN: !Ref ChannelAccessToken
Events:
HttpPost:
Type: Api
Properties:
Path: /line/hook
Method: post
RestApiId: !Ref Api
LogGroup:
Type: AWS::Logs::LogGroup
Properties:
LogGroupName: !Join ['', [/aws/lambda/, !Ref Function]]
RetentionInDays: '7'
Outputs:
WebhookUrl:
Description: Line Bot web-hook URL
Value: !Sub "https://${Api}.execute-api.${AWS::Region}.amazonaws.com/${ApiStageName}/line/hook"