Skip to content

Instantly share code, notes, and snippets.

@aws-joe
Created February 10, 2017 21:50
Show Gist options
  • Save aws-joe/416a1189eb67359b0627b4a9aa95a9d6 to your computer and use it in GitHub Desktop.
Save aws-joe/416a1189eb67359b0627b4a9aa95a9d6 to your computer and use it in GitHub Desktop.
$cfCreateDistData = [
'DistributionConfig' => [ // REQUIRED
'Aliases' => [
'Items' => ['dev-null.link', 'www.dev-null.link' ],
'Quantity' => 2, // REQUIRED
],
'CacheBehaviors' => [
'Items' => [
[
'AllowedMethods' => [
'CachedMethods' => [
'Items' => [ 'HEAD', 'GET', 'OPTIONS' ], // REQUIRED
'Quantity' => 3, // REQUIRED
],
'Items' => [ 'HEAD', 'GET', 'OPTIONS' ], // REQUIRED
'Quantity' => 3, // REQUIRED
],
'Compress' => true,
//'DefaultTTL' => <integer>,
'ForwardedValues' => [ // REQUIRED
'Cookies' => [ // REQUIRED
'Forward' => 'all', // REQUIRED
'WhitelistedNames' => [
// 'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
],
],
'Headers' => [
//'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
],
'QueryString' => true, // REQUIRED
'QueryStringCacheKeys' => [
//'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
],
],
'LambdaFunctionAssociations' => [
//'Items' => [
// [
// 'EventType' => 'viewer-request|viewer-response|origin-request|origin-response',
// 'LambdaFunctionARN' => '<string>',
// ],
// ...
//],
'Quantity' => 0, // REQUIRED
],
//'MaxTTL' => <integer>,
'MinTTL' => 0, // REQUIRED
'PathPattern' => '*', // REQUIRED
'SmoothStreaming' => false,
'TargetOriginId' => 'eb-www-dev-null-link', // REQUIRED
'TrustedSigners' => [ // REQUIRED
'Enabled' => false, // REQUIRED
//'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
],
'ViewerProtocolPolicy' => 'allow-all', // REQUIRED
],
// ...
],
'Quantity' => 1, // REQUIRED
],
'CallerReference' => 'ref-www-dev-nll-link', // REQUIRED
'Comment' => 'CloudFront Distro Blog Dev-Null-Link', // REQUIRED
'CustomErrorResponses' => [
//'Items' => [
// [
// 'ErrorCachingMinTTL' => <integer>,
// 'ErrorCode' => <integer>, // REQUIRED
// 'ResponseCode' => '<string>',
// 'ResponsePagePath' => '<string>',
// ],
// ...
//],
'Quantity' => 0, // REQUIRED
],
'DefaultCacheBehavior' => [ // REQUIRED
'AllowedMethods' => [
'CachedMethods' => [
'Items' => [ 'HEAD', 'GET', 'OPTIONS' ], // REQUIRED
'Quantity' => 3, // REQUIRED
],
'Items' => [ 'HEAD', 'GET', 'OPTIONS' ], // REQUIRED
'Quantity' => 3, // REQUIRED
],
'Compress' => true,
//'DefaultTTL' => <integer>,
'ForwardedValues' => [ // REQUIRED
'Cookies' => [ // REQUIRED
'Forward' => 'all', // REQUIRED
'WhitelistedNames' => [
//'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
],
],
'Headers' => [
//'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
],
'QueryString' => true, // REQUIRED
'QueryStringCacheKeys' => [
//'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
],
],
'LambdaFunctionAssociations' => [
//'Items' => [
// [
// 'EventType' => 'viewer-request|viewer-response|origin-request|origin-response',
// 'LambdaFunctionARN' => '<string>',
// ],
// ...
//],
'Quantity' => 0, // REQUIRED
],
//'MaxTTL' => <integer>,
'MinTTL' => 0, // REQUIRED
'SmoothStreaming' => false,
'TargetOriginId' => 'eb-www-dev-null-link', // REQUIRED
'TrustedSigners' => [ // REQUIRED
'Enabled' => false, // REQUIRED
//'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
],
'ViewerProtocolPolicy' => 'allow-all', // REQUIRED
],
'DefaultRootObject' => 'index.php',
'Enabled' => true, // REQUIRED
//'HttpVersion' => 'http1.1|http2',
//'IsIPV6Enabled' => true || false,
'Logging' => [
'Bucket' => 'cf-dev-null-s3', // REQUIRED
'Enabled' => false, // REQUIRED
'IncludeCookies' => false, // REQUIRED
'Prefix' => 'blog-dv-', // REQUIRED
],
'Origins' => [ // REQUIRED
'Items' => [
[
'CustomHeaders' => [
//'Items' => [
// [
// 'HeaderName' => '<string>', // REQUIRED
// 'HeaderValue' => '<string>', // REQUIRED
// ],
// ...
//],
'Quantity' => 0, // REQUIRED
],
'CustomOriginConfig' => [
'HTTPPort' => 80, // REQUIRED
'HTTPSPort' =>443, // REQUIRED
'OriginProtocolPolicy' => 'match-viewer', // REQUIRED
'OriginSslProtocols' => [
'Items' => [ 'TLSv1', 'TLSv1.1', 'TLSv1.2' ], // REQUIRED
'Quantity' => 3, // REQUIRED
],
],
'DomainName' => 'eb.dev-null.link', // REQUIRED
'Id' => 'eb-www-dev-null-link', // REQUIRED
'OriginPath' => '/www',
//'S3OriginConfig' => [
// 'OriginAccessIdentity' => '<string>', // REQUIRED
//],
],
// ...
],
'Quantity' => 1, // REQUIRED
],
'PriceClass' => 'PriceClass_All',
'Restrictions' => [
'GeoRestriction' => [ // REQUIRED
//'Items' => ['<string>', ...],
'Quantity' => 0, // REQUIRED
'RestrictionType' => 'none', // REQUIRED
],
],
'ViewerCertificate' => [
'ACMCertificateArn' => '<ACM Certificate ARN>',
'Certificate' => '<ACM Certificate ARN>',
'CertificateSource' => 'acm',
//'CloudFrontDefaultCertificate' => true,
//'IAMCertificateId' => '<string>',
'MinimumProtocolVersion' => 'TLSv1',
'SSLSupportMethod' => 'sni-only',
],
//'WebACLId' => '<string>',
]
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment