Skip to content

Commit

Permalink
added changes for public site
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-ellis-sp committed Sep 6, 2024
1 parent d06a553 commit 4fe6a75
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ Resources:
BucketEncryption:
ServerSideEncryptionConfiguration:
- BucketKeyEnabled: true
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: 404.html
DeveloperSailpointWebSiteBucketPolicy:
Type: "AWS::S3::BucketPolicy"
Properties:
Expand All @@ -150,18 +153,22 @@ Resources:
Condition:
StringEquals:
"AWS:SourceArn": !Join [ "", [ "arn:aws:cloudfront::", !Ref "AWS::AccountId", ":distribution/", !Ref DeveloperSailpointCloudFrontDistribution ] ]

- Sid: "PublicReadGetObject"
Effect: "Allow"
Principal: "*"
Action:
- "s3:GetObject"
Resource: !Join [ "", [ "arn:aws:s3:::", !Ref DeveloperSailpointWebSiteBucket, "/*" ] ]
# CloudFront Distribution for hosting the single page app website
DeveloperSailpointCloudFrontDistribution:
Type: "AWS::CloudFront::Distribution"
Properties:
DistributionConfig:
Origins:
- DomainName: !GetAtt DeveloperSailpointWebSiteBucket.RegionalDomainName
- DomainName: !Join ["", [!Ref DeveloperSailpointWebSiteBucket, ".s3-website-", !Ref "AWS::Region", ".amazonaws.com"]]
Id: "DeveloperSailpointWebS3Origin"
OriginAccessControlId: !GetAtt CloudFrontOriginAccessControl.Id
S3OriginConfig:
OriginAccessIdentity: ""
CustomOriginConfig:
OriginProtocolPolicy: "http-only"
Enabled: true
DefaultRootObject: "index.html"
HttpVersion: "http2"
Expand Down

0 comments on commit 4fe6a75

Please sign in to comment.