I am trying to delete a cloudfront distribution via the AWS CLI. Doing
aws cloudfront delete-distribution --id <DISTRIBUTION-ID>
I am getting the following error:
A client error (InvalidIfMatchVersion) occurred when calling the DeleteDistribution operation:
The If-Match version is missing or not valid for the resource.
I do not quite understand, what this error means and how to get around it.
From this documentation I assume, that it is necessary to disable the distribution first. But if so - how do I to do this with the CLI?