Amazon CloudFront
API Reference (API Version 2010-11-01)
Print this pageEmail this pageGo to the ForumsView the PDFShare this page on TwitterShare this page on FacebookBookmark this page on DeliciousSubmit this page to RedditSubmit this page to DiggDid this page help you?  Yes  No   Tell us about it...

PUT Origin Access Identity Config

Description

This action sets the configuration for a CloudFront origin access identity. You use this when updating the configuration (the only part of the configuration you can update is the comments). You must follow the same process when updating an identity's configuration as you do when updating a distribution's configuration. For more information, go to Updating a Distribution's Configuration in the Amazon CloudFront Developer Guide.

To set an origin access identity's configuration, you do a PUT on the 2010-11-01/origin-access-identity/CloudFront/<identity ID>/config resource. The request body must include an XML document with a CloudFrontOriginAccessIdentityConfig element. The new CloudFrontOriginAccessIdentityConfig configuration replaces the existing configuration.

If you try to change configuration items that cannot be changed (the caller reference), CloudFront returns an IllegalUpdate error.

Requests

Syntax

PUT /2010-11-01/origin-access-identity/cloudfront/<identity ID>/config HTTP/1.1
Host: cloudfront.amazonaws.com
If-Match: [value from ETag header in previous GET response]
Authorization: [AWS authentication string]
[Other required headers]			

<?xml version="1.0" encoding="UTF-8"?>
<CloudFrontOriginAccessIdentityConfig xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
   <CallerReference>ref</CallerReference>
   <Comment>The comment.<Comment>
</CloudFrontOriginAccessIdentityConfig>

Headers

The following table lists the special request header the action uses in addition to the common request headers all actions use (for more information, see Common REST Headers).

NameDescriptionRequired

If-Match

The value of the ETag header you received when retrieving the identity's configuration. For example: E2QWRUHAPOMQZL

Type: String

Yes

Request Elements

Name Description Required

CloudFrontOriginAccessIdentityConfig

The identity's configuration information. For more information, see CloudFrontOriginAccessIdentityConfig Complex Type.

Type: CloudFrontOriginAccessIdentityConfig complex type

Yes

Responses

Syntax

200 OK
ETag: [ETag value to use later when doing a DELETE]
x-amz-request-id: [Request ID]
			
<?xml version="1.0" encoding="UTF-8"?>
<CloudFrontOriginAccessIdentity xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
   <Id/>
   <S3CanonicalUserId/>
   <CloudFrontOriginAccessIdentityConfig>
      <CallerReference>20091130090000</CallerReference>   
      <Comment>The comment.</Comment>
   </CloudFrontOriginAccessIdentityConfig>
</CloudFrontOriginAccessIdentity>

Headers

NameDescription

ETag

The current version of the configuration. For example: E2QWRUHAPOMQZL.

Type: String

Elements

NameDescription

CloudFrontOriginAccessIdentity

The origin access identity's information. For more information, see CloudFrontOriginAccessIdentity Complex Type.

Type: CloudFrontOriginAccessIdentity datatype

Special Errors

The following table lists the special errors returned in addition to the common errors all actions return (for more information, see Errors).

ErrorDescriptionHTTP Status Code

IllegalUpdate

Origin and CallerReference cannot be updated.

400

InvalidIfMatchVersion

The If-Match version is missing or not valid.

400

MissingBody

This operation requires a body. Ensure that the body is present and the Content-Type header is set.

400

NoSuchCloudFrontOriginAccessIdentity

The specified origin access identity does not exist.

404

PreconditionFailed

The precondition given in one or more of the request-header fields evaluated to false.

412

Examples

The following example request updates the configuration for the CloudFront origin access identity with ID E74FTE3AJFJ256A.

Sample Request

PUT /2010-11-01/origin-access-identity/cloudfront/E74FTE3AJFJ256A/config HTTP/1.1
Host: cloudfront.amazonaws.com
Authorization: AWS O39F6A430S6FJNPPGDR2:frJIUN8DYpKDtOLEXAMPLE=
Date: Thu, 19 Nov 2009 19:37:58 GMT
If-Match: E2QWRUHAPOMQZL
[Other required headers]

<?xml version="1.0" encoding="UTF-8"?>
<CloudFrontOriginAccessIdentityConfig xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
   <CallerReference>20091130090000</CallerReference>
   <Comment>A different comment</Comment>
</CloudFrontOriginAccessIdentityConfig>

Sample Response

200 OK
ETag: E9LHASXUMDPRTF
x-amz-request-id: request_id
			
<?xml version="1.0" encoding="UTF-8"?>
<CloudFrontOriginAccessIdentity xmlns="http://cloudfront.amazonaws.com/doc/2010-11-01/">
   <Id>E74FTE3AJFJ256A</Id>
   <S3CanonicalUserId>
      cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9a69ba19f
   </S3CanonicalUserId>
   <CloudFrontOriginAccessIdentityConfig>
      <CallerReference>20091130090000</CallerReference>
      <Comment>A different comment</Comment>
   </CloudFrontOriginAccessIdentityConfig>
</CloudFrontOriginAccessIdentity>