Does Pūlumi implement a Cloudfront Invalidation? I...
# general
Does Pūlumi implement a Cloudfront Invalidation? I can’t find it in the API docs…
There's nothing built in - as this is an imperative action you can take, not a resource you would like to exist. There re many ways to do this though - if you have an S3 bucket for example, you can hook up an event handler on writes to that bucket which sends invalidation requests to cloudfront. Along the lines of, though this would actually be much easier in Pulumi where you can just do
. Alternatively, you could invoke the AWS SDK directly from your Pulumi deployment to force an invalidation. Right now, you would likely do this on every deployment, but we are working on mechanisms to provide more control (like "run this code only when this resource is (re-)created)").
👍 1
Thanks @white-balloon-205! I thought that it’s handy that the Pulumi script creates the list of bucket objects that need to be updated, and those are also the objects that would have to be invalidated. I’ll take a look at the links you sent.
I don't think the solution suggested will work well. It will create an invalidation request on every new object. It will get worse if you try to invalidate on every update