Invalidate AWS CloudFront cache

A CloudFront CDN distribution cache can be completely invalidated as follows via aws CLI:

DISTRIBUTION_ID="E2U8LOLFHMCFV2"
aws cloudfront create-invalidation --distribution-id ${DISTRIBUTION_ID} --paths '/*'

Invalidations are billed per path:

Paying for Object Invalidation The first 1,000 invalidation paths that you submit per month are free; you pay for each invalidation path over 1,000 in a month. An invalidation path can be for a single object (such as /images/logo.jpg) or for multiple objects (such as /images/* ). A path that includes the * wildcard counts as one path even if it causes CloudFront to invalidate thousands of objects.

This limit of 1000 invalidation paths per month applies to the total number of invalidation paths across all of the distributions that you create with one AWS account. For example, if you use the AWS account john@example.com to create three distributions, and you submit 600 invalidation paths for each distribution in a given month (for a total of 1,800 invalidation paths), AWS will charge you for 800 invalidation paths in that month. For specific information about invalidation pricing, see Amazon CloudFront Pricing. For more information about invalidation paths, see Invalidation paths.

References: