Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,31 @@ Resources:
## CloudFront access logs storage
CloudFrontAccessLogsBucket:
Type: AWS::S3::Bucket
Properties:
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerPreferred
AccessControl: LogDeliveryWrite

CloudFrontAccessLogsBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket: !Ref CloudFrontAccessLogsBucket
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: cloudfront.amazonaws.com
Action: s3:PutObject
Resource: !Sub "${CloudFrontAccessLogsBucket.Arn}/*"
- Effect: Allow
Principal:
Service: cloudfront.amazonaws.com
Action:
- s3:GetBucketAcl
- s3:PutBucketAcl
Resource: !GetAtt CloudFrontAccessLogsBucket.Arn

## Amplify Application for hosting
AmplifyApp:
Expand Down