Have you hosting static content on s3 and using CloudFront as CDN or https endpoint? This lambda can help you.

Create a python lambda, and use this code

Add this policy to lambda role:

Now, go to you bucket and configure a event like this, don’t forget to select you lambda function.

Lambda Event

After create the event add a distribution_id tag in you bucket with the id of you cloud front distribution.

Now every time that you site get updated, the lambda will invalidate all file changed in CloudFront cache.

A time ago I was trying to create a project with terraform and ansible that deploy a kubernetes cluster on aws. I put all of kubernetes nodes, in privates subnets. Of course I have a bastion host that allow me to run ssh in the nodes.
This was a simple project, a terraform module build an AMI that is used as base for all nodes. I have others terraform modules that create a vpc and some subnets, configure security groups, s3 buckets, route53 and some instances.

After the terraform run, I use some ansible playbook to configure some things, for…

Yago Nobre

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store