Bad error message when trying to delete non-existent origin from the CloudFront Distribution

1

Steps

  1. Create S3 bucket
  2. Create CloudFront Distribution

a. Use S3 bucket as an origin

b. Create CloudFront Distribution

  1. Delete S3 bucket
  2. Open Distribution created before
  3. Go to Origins
  4. Click on radio button to the left from origin
  5. Press Delete button above, Press delete again on the confirmation screen

Actual result: Error message:

Failed to delete origin: 1 validation error detected: Value '[]' at 'distributionConfig.origins.items' failed to satisfy constraint: Member must have length greater than or equal to 1

error message

Expected result: Human Readable error message.

Denis
asked 7 months ago985 views
1 Answer
2

As mentioned in the CloudFront API Reference, CloudFront requires at least one origin when you create or update a distribution, and it doesn't matter whether your origin exists or not.

If you want to delete a non-existing origin, you need to add a new origin first, then delete the old one.

profile picture
HS
answered 7 months ago
  • It's clear, the behavior is correct. The problem is only with the bad error message.

  • Then you can contact AWS Support and send a request to improve the error message if you have a better one.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions