Created
August 13, 2012 16:23
-
-
Save altmind/3342325 to your computer and use it in GitHub Desktop.
cloudfront-createDistribution-correct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CreateDistributionResult distribution = cloudFrontClient.createDistribution( | |
| new CreateDistributionRequest().withDistributionConfig( | |
| new DistributionConfig() | |
| .withCallerReference(System.nanoTime().toString()) | |
| .withAliases( | |
| new Aliases() | |
| .withQuantity(0) | |
| ) | |
| .withDefaultRootObject("index.html") | |
| .withOrigins( | |
| new Origins() | |
| .withItems( | |
| [new Origin() | |
| .withId(bucketOriginId) | |
| .withDomainName("${bucketName}.s3.amazonaws.com") | |
| .withS3OriginConfig(new S3OriginConfig() | |
| .withOriginAccessIdentity("") | |
| ) | |
| ]) | |
| .withQuantity(1) | |
| ) | |
| .withDefaultCacheBehavior( | |
| new DefaultCacheBehavior() | |
| .withTargetOriginId(bucketOriginId) | |
| .withForwardedValues(new ForwardedValues().withQueryString(false)) | |
| .withTrustedSigners( | |
| new TrustedSigners() | |
| .withQuantity(0) | |
| .withEnabled(false) | |
| ) | |
| .withViewerProtocolPolicy(ViewerProtocolPolicy.AllowAll) | |
| .withMinTTL(0) | |
| ) | |
| .withCacheBehaviors( | |
| new CacheBehaviors() | |
| .withQuantity(0)) | |
| .withComment("Distribution for bucket ${bucketName} for user ${user.email}") | |
| .withLogging( | |
| new LoggingConfig() | |
| .withEnabled(false) | |
| .withBucket("") | |
| .withPrefix("") | |
| ) | |
| .withEnabled(true) | |
| ) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment