infra
infra copied to clipboard
Starting/Stopping/Restarting an environment should trigger a cloudfront invalidation
Error pages take excessively long to propegate when turning off an environment, and when updating an environment the edge caches could hold onto stale assets.
The invalidation must be performed as the last step in all cases. We must wait for the first instance to come online or the last instance to go offline before doing the invalidation or it may not be effective.
EX: aws cloudfront create-invalidation --distribution-id EFCZGUFIBB1UY --paths "/staging*"