выполняю следующее - создаю s3bucket, policybucket и cloudfront
ловлю ошибку такую, сил нет, думал проблема с IAM, но нет, хотя сама ошибка говорит иное, но все же, сильно не бейте, ток начал изучать
Resource handler returned message: "Invalid request provided: Exactly one of CustomOriginConfig and S3OriginConfig must be specified" (RequestToken: 869c8f31-7b85-c04d-ab7d-3e8d28e90857, HandlerErrorCode: InvalidRequest)
Сам distribution:
S3CloudFrontDistribution:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
Comment: CDN for S3-backed website
Aliases:
- !Ref DomainName
CustomErrorResponses:
-
ErrorCode: 403
ResponsePagePath: /index.html
ResponseCode: 200
ErrorCachingMinTTL: 0
-
ErrorCode: 404
ResponsePagePath: /index.html
ResponseCode: 200
ErrorCachingMinTTL: 30
DefaultCacheBehavior:
AllowedMethods:
- HEAD
- GET
CachedMethods:
- GET
- HEAD
TargetOriginId: !Sub ${S3Bucket}.s3-website-us-east1.${AWS::Region}.amazonaws.com
Compress: false
ViewerProtocolPolicy: redirect-to-https
CachePolicyId: 658327ea-f89d-4fab-a63d-7e88639e59f6
Enabled: True
HttpVersion: http2
IPV6Enabled: false
DefaultRootObject: index.html
Origins:
- CustomOriginConfig:
HTTPPort: 80
HTTPSPort: 443
OriginKeepaliveTimeout: 5
OriginProtocolPolicy: 30
OriginSSLProtocols:
- TLSv1
- TLSv1.1
- TLSv1.2
DomainName: !Sub ${S3Bucket}.s3-website-us-east1.${AWS::Region}.amazonaws.com
Id: !Sub ${S3Bucket}.s3-website-us-east1.${AWS::Region}.amazonaws.com
S3OriginConfig:
OriginAccessIdentity: !Sub 'origin-access-identity/cloudfront/${CloudFrontOAI}'
PriceClass: PriceClass_All
ViewerCertificate:
AcmCertificateArn: !Ref CertificateArn
MinimumProtocolVersion: TLSv1.1_2016
SslSupportMethod: sni-only