如何修复aws-cli cloudfront更新分发命令? [英] Ho to fix aws-cli cloudfront update distribution command?
问题描述
我一直在尝试执行以下命令,但导致错误
I have been trying to execute below command but it resulted in an error
aws cloudfront update-distribution --id E29BDBENPXM1VE \
--Origins '{ "Items": [{
"OriginPath": "",
"CustomOriginConfig": {
"OriginSslProtocols": {
"Items": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
],
"Quantity": 3
}
}
}
]
}'
错误:::未知选项:{项目":[{"OriginPath":","CustomOriginConfig":{"OriginSsl协议":{项目": ["TLSv1","TLSv1.1","TLSv1.2"],数量":3}}}]},-来源
ERROR::: Unknown options: { "Items": [{ "OriginPath": "", "CustomOriginConfig": { "OriginSslProtocols": { "Items": [ "TLSv1", "TLSv1.1", "TLSv1.2" ], "Quantity": 3 } } } ] }, --Origins
我必须删除 cloudfront:OriginSslProtocols:SSLv3
aws cloudfront update-distribution --id E29BDBENPXM1VE \
--Origins '{ "Items": [{
"OriginPath": "",
"CustomOriginConfig": {
"OriginSslProtocols": {
"Items": [
"TLSv1",
"TLSv1.1",
"TLSv1.2"
],
"Quantity": 3
}
}
}
]
}'
1)如何解决以上代码,如果除以下命令以外的其他命令无法禁用/删除OriginSslProtocols:SSLv3
1) How to fix above code,if not possible if there any command other than below command to disable/remove OriginSslProtocols:SSLv3
aws cloudfront update-distribution --id E29BDBENPXM1VE --distribution-config file://secure-ssl.json --if-match E35YV3CGILXQDJ
推荐答案
您正在使用正确的命令,应该可以做您想做的事情.
但是,它稍微复杂一些.
You are using the right command and it should be possible to do what you want.
However, it is slightly more complicated.
cli命令 aws cloudfront update-distribution 的相应参考页显示:
The corresponding reference page for the cli command aws cloudfront update-distribution says:
更新分发时,与创建分发时相比,必填字段更多.
When you update a distribution, there are more required fields than when you create a distribution.
这就是为什么您必须遵循cli参考[1]中给出的步骤的原因:
That is why you must follow the steps which are given in the cli reference [1]:
- 提交GetDistributionConfig请求以获取当前配置以及该分发的Etag标头.
- 更新对GetDistributionConfig请求的响应中返回的XML文档,以包括您的更改.
- 提交UpdateDistribution请求以更新您的分发的配置:
- 在请求正文中,包含在步骤2中更新的XML文档.请求正文中必须包含带有DistributionConfig元素的XML文档.
- 将HTTP If-Match标头的值设置为在步骤1中提交GetDistributionConfig请求时CloudFront返回的ETag标头的值.
有关正确的xml格式的详细信息,请参见 CloudFront API参考 [2].
Fore info about the correct xml format is given in the CloudFront API Reference [2].
[1] https://docs.aws.amazon.com/cli/latest/reference/cloudfront/update-distribution.html
[2] https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html
这篇关于如何修复aws-cli cloudfront更新分发命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!