Disables and deletes a cloudfront distribution with the given distributionId. Complete with eventbridge event trigger that will fire when a specified cloudwatch alarm is triggered.
This app uses the serverless framework to deploy the required aws resources to your account and will need to be installed before use.
Note: Ensure an alarm is setup in cloudwatch that is tied to the cloudfront distribution and is named TooManyRequests, set the threshold appropriately for your needs.
$ ./gradlew build$ sls deploy$ sls remove$ sls invoke --function delete-cloud-front-disribution --data '{"queryStringParameters": {"distributionId": "<distributionId>"}}'