Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS CLI create cloudfront distribution: --distribution-config

Trying a cloudfront distribution using the AWS CLI, one needs an argument --distribution-config

aws cloudfront create-distribution
aws: error: argument --distribution-config is required

I assume this is a json string with the configuration for the distribution, but I cannot find any documentation about it. Where can I find a minimal working example?

like image 829
Alexander Presber Avatar asked Nov 10 '22 01:11

Alexander Presber


1 Answers

The following JSON worked for me. I used get-distribution-config to generate it.

{
    "Comment": "example json",
    "CacheBehaviors": {
        "Quantity": 0
    },
    "Logging": {
        "Bucket": null,
        "Prefix": null,
        "Enabled": false,
        "IncludeCookies": false
    },
    "Origins": {
        "Items": [
            {
                "S3OriginConfig": {
                    "OriginAccessIdentity": null
                },
                "Id": "S3-origin",
                "DomainName": "example.s3.amazonaws.com"
            }
        ],
        "Quantity": 1
    },
    "DefaultRootObject": null,
    "PriceClass": "PriceClass_All",
    "Enabled": false,
    "DefaultCacheBehavior": {
        "TrustedSigners": {
            "Enabled": false,
            "Quantity": 0
        },
        "TargetOriginId": "S3-origin",
        "ViewerProtocolPolicy": "allow-all",
        "ForwardedValues": {
            "Headers": {
                "Quantity": 0
            },
            "Cookies": {
                "Forward": "none"
            },
            "QueryString": false
        },
        "SmoothStreaming": false,
        "AllowedMethods": {
            "Items": [
                "GET",
                "HEAD"
            ],
            "Quantity": 2
        },
        "MinTTL": 0
    },
    "CallerReference": "example",
    "ViewerCertificate": {
        "CloudFrontDefaultCertificate": true
    },
    "CustomErrorResponses": {
        "Quantity": 0
    },
    "Restrictions": {
        "GeoRestriction": {
            "RestrictionType": "none",
            "Quantity": 0
        }
    },
    "Aliases": {
        "Quantity": 0
    }
}
like image 70
imperalix Avatar answered Nov 14 '22 23:11

imperalix