added new values to docs-website.yml
parent
b2227eeb74
commit
a13f1cffb0
|
@ -32,7 +32,7 @@ Outputs:
|
||||||
|
|
||||||
DocsProdBucketArn:
|
DocsProdBucketArn:
|
||||||
Description: The ARN of the S3 bucket hosting the static content.
|
Description: The ARN of the S3 bucket hosting the static content.
|
||||||
Value: !GetAtt DocsBucket.Arn
|
Value: !GetAtt DocsV2Bucket.Arn
|
||||||
Export:
|
Export:
|
||||||
Name: !Sub ${AWS::StackName}-bucket-arn
|
Name: !Sub ${AWS::StackName}-bucket-arn
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ Resources:
|
||||||
Compress: true
|
Compress: true
|
||||||
ForwardedValues:
|
ForwardedValues:
|
||||||
QueryString: false
|
QueryString: false
|
||||||
TargetOriginId: the-s3-bucket
|
TargetOriginId: !Ref DocsV2Bucket
|
||||||
ViewerProtocolPolicy: redirect-to-https
|
ViewerProtocolPolicy: redirect-to-https
|
||||||
LambdaFunctionAssociations:
|
LambdaFunctionAssociations:
|
||||||
- EventType: origin-request
|
- EventType: origin-request
|
||||||
|
@ -65,8 +65,14 @@ Resources:
|
||||||
HttpVersion: http2
|
HttpVersion: http2
|
||||||
Origins:
|
Origins:
|
||||||
- DomainName:
|
- DomainName:
|
||||||
!Join [ "", [ !Ref DocsBucket, ".s3.amazonaws.com" ] ]
|
!Join [ "", [ !Ref DocsV2Bucket, ".s3.amazonaws.com" ] ]
|
||||||
Id: the-s3-bucket
|
Id: !Ref DocsV2Bucket
|
||||||
|
S3OriginConfig:
|
||||||
|
OriginAccessIdentity:
|
||||||
|
!Join [ "", [ "origin-access-identity/cloudfront/", !Ref DocsCloudFrontOriginAccessIdentity ] ]
|
||||||
|
- DomainName:
|
||||||
|
!Join [ "", [ !Ref DocsV1Bucket, ".s3.amazonaws.com" ] ]
|
||||||
|
Id: !Ref DocsV1Bucket
|
||||||
S3OriginConfig:
|
S3OriginConfig:
|
||||||
OriginAccessIdentity:
|
OriginAccessIdentity:
|
||||||
!Join [ "", [ "origin-access-identity/cloudfront/", !Ref DocsCloudFrontOriginAccessIdentity ] ]
|
!Join [ "", [ "origin-access-identity/cloudfront/", !Ref DocsCloudFrontOriginAccessIdentity ] ]
|
||||||
|
@ -85,7 +91,7 @@ Resources:
|
||||||
CloudFrontOriginAccessIdentityConfig:
|
CloudFrontOriginAccessIdentityConfig:
|
||||||
Comment: !Sub 'CloudFront Origin Access Identity for ${DomainName}'
|
Comment: !Sub 'CloudFront Origin Access Identity for ${DomainName}'
|
||||||
|
|
||||||
DocsBucket:
|
DocsV2Bucket:
|
||||||
Type: AWS::S3::Bucket
|
Type: AWS::S3::Bucket
|
||||||
Properties:
|
Properties:
|
||||||
BucketEncryption:
|
BucketEncryption:
|
||||||
|
@ -97,17 +103,43 @@ Resources:
|
||||||
- Key: Domain
|
- Key: Domain
|
||||||
Value: !Ref DomainName
|
Value: !Ref DomainName
|
||||||
|
|
||||||
DocsProdBucketPolicy:
|
DocsV2BucketPolicy:
|
||||||
Type: AWS::S3::BucketPolicy
|
Type: AWS::S3::BucketPolicy
|
||||||
Properties:
|
Properties:
|
||||||
Bucket: !Ref DocsBucket
|
Bucket: !Ref DocsV2Bucket
|
||||||
PolicyDocument:
|
PolicyDocument:
|
||||||
Statement:
|
Statement:
|
||||||
-
|
-
|
||||||
Action:
|
Action:
|
||||||
- s3:GetObject
|
- s3:GetObject
|
||||||
Effect: Allow
|
Effect: Allow
|
||||||
Resource: !Join [ "", [ "arn:aws:s3:::", !Ref DocsBucket, "/*" ] ]
|
Resource: !Join [ "", [ "arn:aws:s3:::", !Ref DocsV2Bucket, "/*" ] ]
|
||||||
|
Principal:
|
||||||
|
CanonicalUser: !GetAtt DocsCloudFrontOriginAccessIdentity.S3CanonicalUserId
|
||||||
|
|
||||||
|
DocsV1Bucket:
|
||||||
|
Type: AWS::S3::Bucket
|
||||||
|
Properties:
|
||||||
|
BucketEncryption:
|
||||||
|
ServerSideEncryptionConfiguration:
|
||||||
|
-
|
||||||
|
ServerSideEncryptionByDefault:
|
||||||
|
SSEAlgorithm: AES256
|
||||||
|
Tags:
|
||||||
|
- Key: Domain
|
||||||
|
Value: !Ref DomainName
|
||||||
|
|
||||||
|
DocsV1BucketPolicy:
|
||||||
|
Type: AWS::S3::BucketPolicy
|
||||||
|
Properties:
|
||||||
|
Bucket: !Ref Docs1Bucket
|
||||||
|
PolicyDocument:
|
||||||
|
Statement:
|
||||||
|
-
|
||||||
|
Action:
|
||||||
|
- s3:GetObject
|
||||||
|
Effect: Allow
|
||||||
|
Resource: !Join [ "", [ "arn:aws:s3:::", !Ref DocsV1Bucket, "/*" ] ]
|
||||||
Principal:
|
Principal:
|
||||||
CanonicalUser: !GetAtt DocsCloudFrontOriginAccessIdentity.S3CanonicalUserId
|
CanonicalUser: !GetAtt DocsCloudFrontOriginAccessIdentity.S3CanonicalUserId
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue