-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
57 lines (52 loc) · 1.94 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
AWSTemplateFormatVersion: '2010-09-09'
Description: |
InstaPostLinkExtractor API, which extracts links from a Instagram post's description,
as Instagram does not make links in post descriptions clickable due to security reasons.
Transform: 'AWS::Serverless-2016-10-31'
Resources:
InstaPostLinkExtractorFunction:
Type: 'AWS::Serverless::Function'
Properties:
Handler: src/handler.lambda_handler
Description: 'Extracts links from a Instagram post description'
Runtime: python3.12
MemorySize: 128
Timeout: 10
Events:
InstaPostLinkExtractorApi:
Type: Api
Properties:
Path: /insta-post-link-extractor
Method: post
RestApiId:
Ref: InstaPostLinkExtractorApi
Auth:
ApiKeyRequired: true
InstaPostLinkExtractorApi:
Type: 'AWS::Serverless::Api'
Properties:
Name: InstaPostLinkExtractorApi
Description: 'API for extracting links from a Instagram post description'
StageName: prod
EndpointConfiguration: REGIONAL
ApiKeySourceType: HEADER
Auth:
UsagePlan:
CreateUsagePlan: PER_API
Description: 'Usage plan for InstaPostLinkExtractorApi'
UsagePlanName: 'InstaPostLinkExtractorUsagePlan'
Quota:
Limit: 1024
Period: DAY
Throttle:
BurstLimit: 16
RateLimit: 1
Outputs:
InstaPostLinkExtractorApi:
Description: 'API Gateway endpoint URL for Prod stage for InstaPostLinkExtractorApi'
Value:
!Sub 'https://${InstaPostLinkExtractorApi}.execute-api.${AWS::Region}.amazonaws.com/prod/insta-post-link-extractor/'
InstaPostLinkExtractorApiApiKeyConsoleUrl:
Description: 'API Gateway API Key Console URL for InstaPostLinkExtractorApi'
Value:
!Sub 'https://${AWS::Region}.console.aws.amazon.com/apigateway/main/api-keys/${InstaPostLinkExtractorApiApiKey}?region=${AWS::Region}'