I want to invalidate files on Amazon after I've put them. But I' confused with the DistributionID:
private AmazonS3 s3; private AmazonCloudFront cloudFront;
... AWSCredentials cred = new PropertiesCredentials( AmazonWorker.class.getResourceAsStream("AwsCredentials.properties")); s3 = new AmazonS3Client(cred); cloudFront = new AmazonCloudFrontClient(cred); ... PutObjectResult por = s3.putObject(new PutObjectRequest(bucketName, path, is, metadata)); List<String> list = new ArrayList<String>() {}; list.add(bucketName + "/" + path); CreateInvalidationResult res = cloudFront.createInvalidation ( new CreateInvalidationRequest ( "DistributionId", new InvalidationBatch ( list, UUID.randomUUID().toString() ) ) );
So, where could I get "DistributionId"?
The DistributionID is shown in the Management Console after you create the Distribution:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With