Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.

Commit 2e91b11

Browse files
author
Ben Smith
authored
Merge pull request #26 from rdok/patch-1
Fix restricting S3 assets access.
2 parents f4277b6 + c7c871d commit 2e91b11

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

0.4-Building-A-Serverless-Laravel-App-With-AWS-SAM/template.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ Resources:
9999
# The assets (S3)
100100
- Id: Assets
101101
DomainName: !GetAtt Assets.RegionalDomainName
102-
S3OriginConfig: {} # this key is required to tell CloudFront that this is an S3 origin, even though nothing is configured
102+
S3OriginConfig:
103+
OriginAccessIdentity: !Sub "origin-access-identity/cloudfront/${S3OriginIdentityExample}"
103104
# The default behavior is to send everything to AWS Lambda
104105
DefaultCacheBehavior:
105106
AllowedMethods: [GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE]
@@ -140,4 +141,4 @@ Resources:
140141
Outputs:
141142
Domain:
142143
Description: 'CloudFront domain name'
143-
Value: !GetAtt Cloudfrontdistribution.DomainName
144+
Value: !GetAtt Cloudfrontdistribution.DomainName

0 commit comments

Comments
 (0)