2

Deleting a cloudfront distribution programmatically it is still necessary to wait for the distribution to be disabled - which can take a while, up to 30 minutes.

So how can I write a script that deletes an existing distribution, first disabling and then scheduling it's deletion?

Alexander Presber
  • 6,429
  • 2
  • 37
  • 66
  • In the page you have mentioned there is a reference to this http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/DeleteDistribution.html which describes the steps you need to take. What step exactly you need help with? – Alex Z Oct 17 '14 at 02:45
  • The problem is the delay between disabling and deleting the distribution. It seems impossible to write a program that deletes an active distribution, because waiting for the disabling seems necessary (and that takes time!). I miss a way to say "disable (if necessary), then delete", like in one quasi-step. You see? – Alexander Presber Oct 17 '14 at 16:02
  • Why you can't get distribution first, check if it is enabled. If not, just go and delete it. If it is enabled - do the slow version - disable, wait for propagation to complete, then go ahead and delete it – Alex Z Oct 17 '14 at 16:33

0 Answers0