-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
64 lines (59 loc) · 1.49 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
62
63
64
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Shrinkify URL
Globals:
Function:
Timeout: 3
Parameters:
DBConnection:
Type: String
Default: NA
Resources:
ShrinkifyURL:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./api
Handler: main.handler
Runtime: go1.x
Timeout: 50
Events:
API:
Type: HttpApi
Properties:
Path: /{proxy+}
Method: any
HTML:
Type: HttpApi
Properties:
Path: /
Method: get
Environment:
Variables:
DYNAMO_TABLE: !Ref DBConnection
DynamoDBTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: shrinkifyurl
AttributeDefinitions:
- AttributeName: PK
AttributeType: S
- AttributeName: SK
AttributeType: S
KeySchema:
- AttributeName: PK
KeyType: HASH
- AttributeName: SK
KeyType: RANGE
BillingMode: PAY_PER_REQUEST
Outputs:
ShrinkifyApi:
Description: API Gateway endpoint URL for Prod for Shrinkify URL function
Value:
Fn::Sub: https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/
ShrinkifyURLFunction:
Description: Express Backend Lambda Function ARN
Value: !Sub ShrinkifyURL.Arn
ShrinkifyURLIamRole:
Description: Implicit IAM Role created for Shrinkify URL function
Value: !Sub ShrinkifyURLFunctionRole.Arn