-
Notifications
You must be signed in to change notification settings - Fork 0
/
tempate-east.yaml
51 lines (51 loc) · 1.56 KB
/
tempate-east.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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Parameters:
DomainName:
Description: Name of the domain
Type: String
Default: ericksonapartments.com
ConstraintDescription: must be the name of an existing Hosted Zone in Route53.
HostName:
Description: Hostname part of the URL for the website.
Type: String
Default: test
HostedZoneId:
Description: Hosted Zone ID needed for SSL certificate validation.
Type: String
Default: Z33VHQIJYZI635
Resources:
cloudFrontS3IndexHtml:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub ${AWS::StackName}-cloudFrontS3IndexHtml
Description: CloudFront S3 index.html edge lambda
Handler: index.handler
CodeUri: src/cloudFrontS3IndexHtml
Runtime: nodejs18.x
Timeout: 5
AutoPublishAlias: riznob
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
- edgelambda.amazonaws.com
Action: sts:AssumeRole
mySSLCertificate:
Type: AWS::CertificateManager::Certificate
Properties:
DomainName: !Sub ${HostName}.${DomainName}
DomainValidationOptions:
- DomainName: !Sub ${HostName}.${DomainName}
HostedZoneId: !Ref HostedZoneId
ValidationMethod: DNS
Outputs:
SSLCertificateArn:
Description: SSL Certificate ARN
Value: !Ref mySSLCertificate
EdgeLambdaArn:
Description: Edge Lambda ARN
Value: !Ref cloudFrontS3IndexHtml.Version