-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
executable file
·55 lines (55 loc) · 1.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
AWSTemplateFormatVersion: 2010-09-09
Description: >-
Il bot per counter "Più pulito"
Transform:
- AWS::Serverless-2016-10-31
Parameters:
TokenApi:
Type: String
Resources:
DynamoDBTable:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PROVISIONED
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
KeySchema:
- AttributeName: pk
KeyType: HASH
- AttributeName: sk
KeyType: RANGE
AttributeDefinitions:
- AttributeName: pk
AttributeType: S
- AttributeName: sk
AttributeType: S
MainFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./src/handlers
Handler: handler.index
Runtime: nodejs14.x
Architectures:
- x86_64
MemorySize: 128
Timeout: 100
Environment:
Variables:
TOKEN: !Ref TokenApi
DB: !Ref DynamoDBTable
Description: Webhook for Telegram Bot
Policies:
- AWSLambdaBasicExecutionRole
- DynamoDBCrudPolicy:
TableName: !Ref DynamoDBTable
Events:
ApiEvent:
Type: Api
Properties:
Path: /webhook
Method: post
Outputs:
Endpoint:
Description: Webhook
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/webhook"