aws/aws-sdk-ruby — pull request #225 by schneems (2013-04-12 13:08:53+00:00)
Title: Cloud Front Docs: target_origin_id must match id

The target_origin_id value of both `default_cache_behavior` and `cache_behaviors` must match an id specified under origins[:items].map(&:id), while this is documented in that section:

```
* `:id` - *required* - (String) A unique identifier for the
origin. The value of Id must be unique within the distribution.
You use the value of Id when you create a cache behavior. The
Id identifies the origin that CloudFront routes a request to
when the request matches the path pattern for that cache
```

It is not documented in `target_origin_id`. If you try to specify a `target_origin_id` that does not exist in an origins items id you will get a somewhat cryptic error:

```
AWS::CloudFront::Errors::NoSuchOrigin: One or more of your origins do not exist.
```

After receiving this error it looks like the Origin Item is configured properly when it really means you've specified cache behavior that points at a nonexistent origin id.

This documentation change brings the required knowledge closer to the field where it is needed.