-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.yml
83 lines (79 loc) · 2.34 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
AWSTemplateFormatVersion: 2010-09-09
Transform: "AWS::Serverless-2016-10-31"
Description: zoph.io - url-shortener - https://zoph.io - December 2022
Parameters:
pEnv:
Type: String
Description: Environment Name
pAWSRegion:
Type: String
Description: AWS Region
pProjectName:
Type: String
Description: Project Name
pProductName:
Type: String
Description: Product Name
pMinChar:
Type: String
Description: Minimum number of character for the random string
pMaxChar:
Type: String
Description: Maximum number of character for the random string
pDescription:
Type: String
Description: Project description
pAlertsRecipient:
Type: String
Description: Alerts recipient (prefer distribution list)
pCertificateArn:
Type: String
Description: ACM Certificate arn used for API Gateway and CloudFront
pHostedZoneId:
Type: String
Description: Route53 HostedZoneId where your domain belong
pDomain:
Type: String
Description: Route53 Domain (APEX)
pSubDomain:
Type: String
Description: Route53 Subdomain
pFallbackUrl:
Type: String
Description: Fallback URL when no long url is found in DynamoDB Table
Resources:
FrontStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: "./frontend/frontend.yml"
Parameters:
pCertificateArn: !Ref pCertificateArn
pDomain: !Ref pDomain
pSubDomain: !Ref pSubDomain
pProductName: !Ref pProductName
pProjectName: !Ref pProjectName
BackendStack:
Type: AWS::CloudFormation::Stack
Properties:
TemplateURL: "./backend/backend.yml"
Parameters:
pEnv: !Ref pEnv
pAWSRegion: !Ref pAWSRegion
pProjectName: !Ref pProjectName
pProductName: !Ref pProductName
pMinChar: !Ref pMinChar
pMaxChar: !Ref pMaxChar
pDescription: !Ref pDescription
pAlertsRecipient: !Ref pAlertsRecipient
pCertificateArn: !Ref pCertificateArn
pHostedZoneId: !Ref pHostedZoneId
pDomain: !Ref pDomain
pSubDomain: !Ref pSubDomain
pFallbackUrl: !Ref pFallbackUrl
Outputs:
S3BucketLogs:
Description: CloudFront distribution DomainName
Value: !GetAtt FrontStack.Outputs.CloudFrontDistribution
StaticWebsiteUrl:
Description: Static Website URL
Value: !Sub "https://short.${pDomain}"