2016-03-07 72 views
3

試圖規定,通過真實分佈CloudFront的靜態網站水桶CloudFront的分佈。CloudFormation創建伐木鬥

以下CloudFormation模板工程,如果我省略了Logging配置分佈:

{ 
... 

"PrimeBucket": { 
    "Properties": { 
     "AccessControl": "PublicRead", 
     "WebsiteConfiguration": { 
      "ErrorDocument": "error.html", 
      "IndexDocument": "index.html" 
     } 
    }, 
    "Type": "AWS::S3::Bucket" 
}, 
"PrimeBucketDistribution": { 
    "Properties": { 
     "DistributionConfig": { 
      "DefaultCacheBehavior": { 
       "AllowedMethods": [ 
        "GET", 
        "HEAD", 
        "OPTIONS" 
       ], 
       "ForwardedValues": { 
        "QueryString": "false" 
       }, 
       "TargetOriginId": "BucketOrigin", 
       "ViewerProtocolPolicy": "allow-all" 
      }, 
      "Enabled": "true", 
      "Logging": { 
       "Bucket": { 
        "Ref": "PrimeBucketLogs" 
       }, 
       "IncludeCookies": "false" 
      }, 
      "Origins": [ 
       { 
        "DomainName": { 
         "Fn::GetAtt": [ 
          "PrimeBucket", 
          "DomainName" 
         ] 
        }, 
        "Id": "BucketOrigin", 
        "S3OriginConfig": {} 
       } 
      ] 
     } 
    }, 
    "Type": "AWS::CloudFront::Distribution" 
}, 
"PrimeBucketLogs": { 
    "Type": "AWS::S3::Bucket" 
} 
} 

如果我有Logging我得到的錯誤:

The parameter Logging Bucket does not refer to a valid S3 bucket.

是否有任何額外的魔法需要爲了它是與CloudFront的兼容應用到日誌鬥?在文檔中找不到任何內容。

+0

你有沒有設法想出解決辦法? –

+0

不記得:( –

回答

4

嘗試指定你的水桶名"bucketname.s3.amazonaws.com",而不僅僅是"bucketname"