如何使用CLI更新20种不同的Cloudfront分布

时间:2019-07-11 16:20:15

标签: amazon-web-services

我在aws帐户中创建了20个cloudfront-distribution。全部都配置有originsslprotocl:SSLv3。如果我使用以下命令,我需要编辑20个json文件以禁用/删除“ SSLv3”,请您分享您的输入内容,以使用cli找出问题。

“ aws cloudfront更新分发--id E29BDBENPXM1VE-分发配置文件://secure-ssl.json --if-match E1FDVLLC5LJOKG”

我遵循的禁用/删除Originsslprotocol:SSLv3的步骤

1)“ aws cloudfront更新分发--id E29BDBENPXM1VE-分发配置文件://secure-ssl.json --if-match E1FDVLLC5LJOKG” 2)aws cloudfront get-distribution-config --id E29BDBENPXM1VE 3)将step2输出存储在secure-ssl.json中,并从json文件中删除Etg,分发参数,originprotocol:SSLv3值 4)aws cloudfront更新分发--id E29BDBENPXM1VE-分发配置文件://secure-ssl.json --if-match E1FDVLLC5LJOKG

{

    "Comment": "", 
    "CacheBehaviors": {
        "Quantity": 0
    }, 
    "IsIPV6Enabled": true, 
    "Logging": {
        "Bucket": "", 
        "Prefix": "", 
        "Enabled": false, 
        "IncludeCookies": false
    }, 
    "WebACLId": "", 
    "Origins": {
        "Items": [
            {
                "OriginPath": "", 
                "CustomOriginConfig": {
                    "OriginSslProtocols": {
                        "Items": [
                            "TLSv1.1", 
                            "TLSv1.2"
                        ], 
                        "Quantity": 2
                    }, 
                    "OriginProtocolPolicy": "http-only", 
                    "OriginReadTimeout": 30, 
                    "HTTPPort": 80, 
                    "HTTPSPort": 443, 
                    "OriginKeepaliveTimeout": 5
                }, 
                "CustomHeaders": {
                    "Quantity": 0
                }, 
                "Id": "ELB-cicdpipeline-646360150", 
                "DomainName": "cicdpipeline-646360150.us-west-2.elb.amazonaws.com"
            }
        ], 
        "Quantity": 1
    }, 
    "DefaultRootObject": "", 
    "PriceClass": "PriceClass_All", 
    "Enabled": true, 
    "DefaultCacheBehavior": {
        "FieldLevelEncryptionId": "", 
        "TrustedSigners": {
            "Enabled": false, 
            "Quantity": 0
        }, 
        "LambdaFunctionAssociations": {
            "Quantity": 0
        }, 
        "TargetOriginId": "ELB-cicdpipeline-646360150", 
        "ViewerProtocolPolicy": "allow-all", 
        "ForwardedValues": {
            "Headers": {
                "Quantity": 0
            }, 
            "Cookies": {
                "Forward": "none"
            }, 
            "QueryStringCacheKeys": {
                "Quantity": 0
            }, 
            "QueryString": false
        }, 
        "MaxTTL": 31536000, 
        "SmoothStreaming": false, 
        "DefaultTTL": 86400, 
        "AllowedMethods": {
            "Items": [
                "HEAD", 
                "GET"
            ], 
            "CachedMethods": {
                "Items": [
                    "HEAD", 
                    "GET"
                ], 
                "Quantity": 2
            }, 
            "Quantity": 2
        }, 
        "MinTTL": 0, 
        "Compress": false
    }, 
    "CallerReference": "1562748965921", 
    "ViewerCertificate": {
        "CloudFrontDefaultCertificate": true, 
        "MinimumProtocolVersion": "TLSv1", 
        "CertificateSource": "cloudfront"
    }, 
    "CustomErrorResponses": {
        "Quantity": 0
    }, 
    "OriginGroups": {
        "Quantity": 0
    }, 
    "HttpVersion": "http1.1", 
    "Restrictions": {
        "GeoRestriction": {
            "RestrictionType": "none", 
            "Quantity": 0
        }
    }, 
    "Aliases": {
        "Quantity": 0
    }
}

}

使用上述方法修改一个发行版至少需要10-15分钟。

1)是否有任何方法/ cli命令仅用于更新/修改产地slprotocol 2)更新发行版时删除Etag的原因是什么?

0 个答案:

没有答案