-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
61 lines (56 loc) · 1.51 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
Transform: AWS::Serverless-2016-10-31
Parameters:
TelegramApiToken:
Type: String
Keyword:
Type: String
Metadata:
AWS::ServerlessRepo::Application:
Name: Telegram-Bot-Rekognition
Author: Salvatore Cozzubo
ReadmeUrl: README.md
LicenseUrl: LICENSE
Labels:
- telegram
- rekognition
- nodejs
SourceCodeUrl: https://github.com/SalvoCozzubo/telegram-bot-rekognition
HomePageUrl: https://www.salvatorecozzubo.com
Description: Deploy a webhook for Telegram Bot that uses AWS Rekognition to get labels from user's picture message
SemanticVersion: 1.0.1
Resources:
WebhookFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: src/webhook
Runtime: nodejs14.x
Handler: index.handler
Architectures:
- arm64
Timeout: 10
Events:
Api:
Type: Api
Properties:
Path: /webhook
Method: POST
Environment:
Variables:
TELEGRAM_API_TOKEN: !Ref TelegramApiToken
KEYWORD: !Ref Keyword
Layers:
- !Ref Dependencies
Policies:
- RekognitionDetectOnlyPolicy: {}
Dependencies:
Type: AWS::Serverless::LayerVersion
Properties:
CompatibleRuntimes:
- nodejs14.x
ContentUri: src/layer-deps
Metadata:
BuildMethod: nodejs14.x
Outputs:
WebEndpoint:
Description: "API Gateway endpoint URL"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Stage/webhook"