CloudFront Distribution ID

I want to revoke files on Amazon after they have been added. But I was "confused with the DistributionID:

private AmazonS3 s3; private cloud AmazonCloudFront;

...

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 can I get the "DistributionId"?

+3


source to share


1 answer


The DistributionID is displayed in the Management Console after creating a Distribution:



enter image description here

+3


source







All Articles