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...

POST Origin Access Identity

Description

This action creates a new CloudFront origin access identity. You can create up to 100 per AWS account. For information about why and how you use CloudFront origin access identities, go to Serving Private Content in the Amazon CloudFront Developer Guide.

To create a new CloudFront origin access identity, you do a POST on the 2010-11-01/origin-access-identity/cloudfront resource. The request body must include an XML document with a CloudFrontOriginAccessIdentityConfig element. The response echoes the CloudFrontOriginAccessIdentityConfig element and returns other metadata about the origin access identity.

Requests

Syntax

POST /2010-11-01/origin-access-identity/cloudfront HTTP/1.1
Host: cloudfront.amazonaws.com
Authorization: [AWS authentication string]
Date: [time stamp]
[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 request must include the headers required in all CloudFront requests. For more information, see Common REST Headers.

Elements

Name Description Required

CloudFrontOriginAccessIdentityConfig

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

Type: CloudFrontOriginAccessIdentityConfig complex type

Default: None

Yes

Responses

Syntax

201 Created
Location: [URI of new origin access identity]
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/>   
      <Comment/>
   </CloudFrontOriginAccessIdentityConfig>
</CloudFrontOriginAccessIdentity>

Headers

NameDescription

Location

The fully qualified URI of the new origin access identity just created. For example: https://cloudfront.amazonaws.com/2010-11-01/origin-access-identity/cloudfront/E74FTE3AJFJ256A

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

CloudFrontOriginAccessIdentityAlreadyExists

The caller reference you attempted to create the origin access identity with is associated with another identity.

409

MissingBody

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

400

TooManyCloudFrontOriginAccessIdentities

Processing your request would cause you to exceed the maximum number of CloudFront origin access identities allowed.

400

Examples

The following example request creates a new CloudFront origin access identity.

Sample Request

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

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

Sample Response

201 Created
Location: https://cloudfront.amazonaws.com/2010-11-01/origin-access-identity/cloudfront/E74FTE3AJFJ256A
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>My comments</Comment>
   </CloudFrontOriginAccessIdentityConfig>
</CloudFrontOriginAccessIdentity>