-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
66 lines (62 loc) · 1.76 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Web GSM gateway
Globals:
Function:
Timeout: 10
Resources:
HttpApi:
Type: AWS::Serverless::HttpApi
Properties:
Domain:
CertificateArn: "arn:aws:acm:us-east-1:123456789012:certificate/create-and-put-arn-here"
DomainName: my.example.com
StageName: "$default"
DefaultRouteSettings:
ThrottlingRateLimit: 0.1
ThrottlingBurstLimit: 1
FailOnWarnings: true
OpenFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: open_barrier/
Handler: app.lambda_handler
Runtime: python3.8
Policies:
- AWSLambdaExecute # Managed Policy
- Version: '2012-10-17' # Policy Document
Statement:
- Effect: Allow
Action:
- dynamodb:GetItem
Resource: !GetAtt DynamoDBTable.Arn
Environment:
Variables:
TABLE_NAME: !Ref DynamoDBTable
TWILIO_ACCOUNT_SID: AAAAAAAABBBBBBBBB
TWILIO_AUTH_TOKEN: xxxxxxxxxxxyyyyyyyyyyyyyyyyyyyy
BARRIER_GSM_NUMBER: +555123456768
TELEGRAM_BOT_CREDENTIALS: 123456789:xxxxxxxxxxxxyyyyyyyyyyyyyy
Events:
Open:
Type: HttpApi
Properties:
Path: /open
Method: get
ApiId: !Ref HttpApi
OpenNamed:
Type: HttpApi
Properties:
Path: /open/{name}
Method: get
ApiId: !Ref HttpApi
DynamoDBTable:
Type: 'AWS::DynamoDB::Table'
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- KeyType: HASH
AttributeName: id