使用aws cli json创建cloudfront分发

pieyvz9o  于 2022-12-30  发布在  其他
关注(0)|答案(1)|浏览(132)

嗨,我正在尝试从aws cli创建一个新的自定义起源cloudfront分布。但我得到以下错误。我已经检查了我的json文件。没有发现错误,但aws cli抛出以下错误
[ec2-user@ip-172-31-20-146 ~]$ aws云前端创建-分发-分发-配置“$(
这是我的json文件

{
  "DistributionConfig": {
    "CallerReference": "fucking16483256",
    "Aliases": {
      "Quantity": 1,
      "Items": [
        "cdn.nammacloud.com"
      ]
    },
    "Origins": {
      "Quantity": 1,
      "Items": [
        {
          "origin": {
            "CustomOriginConfig": {
              "OriginProtocolPolicy": "match-viewer",
              "HTTPPort": 80,
              "HTTPSPort": 443
            },
            "Id": "Custom-www.nammacloud.com",
            "DomainName": "www.nammacloud.com"
          }
        }
      ]
    },
    "DefaultCacheBehavior": {
      "TargetOriginId": "Custom-www.nammacloud.com",
      "ViewerProtocolPolicy": "allow-all",
      "MinTTL": 3600
    },
    "Comment": "new distribution",
    "Logging": {
      "Bucket": "",
      "Prefix": "",
      "Enabled": false,
      "IncludeCookies": false
    },
    "PriceClass": "PriceClass_All"
  }
}
g6ll5ycj

g6ll5ycj1#

尝试删除 Package “DistributionConfig”对象,因此:

{
  "CallerReference": "f***ing16483256",
  "Aliases": {
    "Quantity": 1,
    "Items": [
      "cdn.nammacloud.com"
    ]
  },
  "Origins": {
    "Quantity": 1,
    "Items": [{
      "origin": {
        "CustomOriginConfig": {
          "OriginProtocolPolicy": "match-viewer",
          "HTTPPort": 80,
          "HTTPSPort": 443
        },
        "Id": "Custom-www.nammacloud.com",
        "DomainName": "www.nammacloud.com"
      }
    }]
  },
  "DefaultCacheBehavior": {
    "TargetOriginId": "Custom-www.nammacloud.com",
    "ViewerProtocolPolicy": "allow-all",
    "MinTTL": 3600
  },
  "Comment": "new distribution",
  "Logging": {
    "Bucket": "",
    "Prefix": "",
    "Enabled": false,
    "IncludeCookies": false
  },
  "PriceClass": "PriceClass_All"
}

相关问题