Check AWS Cloudfront invalidation complete time?

1k Views Asked by At

I would like to know at what point in time a given Cloudfront invalidation has been completed.

When browsing invalidations in AWS Console, I can only see Date created timestamp, as per attached image.

enter image description here

I would like to know what is the date of completion. Couldn't find any info in the docs, also aws cli get-invalidations api doesn't say anything about it.

Is it possible at all? Basically what im trying to achieve is to measure how much time my invalidations take, so I can assertain if this is the cause of tests failures in my project.

Cheers!

2

There are 2 best solutions below

0
On

Use the Get Invalidation API call, call it repeatedly, and note down the time status switched to 'Completed'.

https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_GetInvalidation.html

If you're using boto3, you can use a waiter.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudfront/waiter/InvalidationCompleted.html

If you've got Enterprise support, get your TAM to submit a feature request, or a +1 on an existing feature request if one exists. (At this point (Dec 2023), I'd guess the feature request surely exists).

3
On

As per AWS:- Invalidate the Amazon S3 objects

Object invalidations typically take from 10 to 100 seconds to complete. You can check the status of an invalidation by viewing your distribution from the CloudFront console.