Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CloudFront distribution id

Tags:

java

amazon-s3

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"?

like image 952
Programmer Programmer Avatar asked Oct 11 '25 16:10

Programmer Programmer


1 Answers

The DistributionID is shown in the Management Console after you create the Distribution:

enter image description here

like image 112
John Rotenstein Avatar answered Oct 14 '25 07:10

John Rotenstein