Menu
Amazon CloudFront
API Reference (API Version 2016-09-29)

CreateCloudFrontOriginAccessIdentity

Creates a new origin access identity. If you're using Amazon S3 for your origin, you can use an origin access identity to require users to access your content using a CloudFront URL instead of the Amazon S3 URL. For more information about how to use origin access identities, see Serving Private Content through CloudFront in the Amazon CloudFront Developer Guide.

Request Syntax

POST /2016-09-29/origin-access-identity/cloudfront HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<CreateCloudFrontOriginAccessIdentityRequest>
   <CloudFrontOriginAccessIdentityConfig>
      <CallerReference>string</CallerReference>
      <Comment>string</Comment>
   </CloudFrontOriginAccessIdentityConfig>
</CreateCloudFrontOriginAccessIdentityRequest>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request requires the following data in XML format.

CreateCloudFrontOriginAccessIdentityRequest

Root level tag for the CreateCloudFrontOriginAccessIdentityRequest parameters.

Required: Yes

CloudFrontOriginAccessIdentityConfig

The current configuration information for the identity.

Type: CloudFrontOriginAccessIdentityConfig object

Required: Yes

Response Syntax

HTTP/1.1 201
Location: Location
ETag: ETag
<?xml version="1.0" encoding="UTF-8"?>
<CreateCloudFrontOriginAccessIdentityResult>
   <CloudFrontOriginAccessIdentity>
      <CloudFrontOriginAccessIdentityConfig>
         <CallerReference>string</CallerReference>
         <Comment>string</Comment>
      </CloudFrontOriginAccessIdentityConfig>
      <Id>string</Id>
      <S3CanonicalUserId>string</S3CanonicalUserId>
   </CloudFrontOriginAccessIdentity>
</CreateCloudFrontOriginAccessIdentityResult>

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The response returns the following HTTP headers.

ETag

The current version of the origin access identity created.

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.

The following data is returned in XML format by the service.

CreateCloudFrontOriginAccessIdentityResult

Root level tag for the CreateCloudFrontOriginAccessIdentityResult parameters.

Required: Yes

CloudFrontOriginAccessIdentity

The origin access identity's information.

Type: CloudFrontOriginAccessIdentity object

Errors

For information about the errors that are common to all actions, see Common Errors.

CloudFrontOriginAccessIdentityAlreadyExists

If the CallerReference is a value you already sent in a previous request to create an identity but the content of the CloudFrontOriginAccessIdentityConfig is different from the original request, CloudFront returns a CloudFrontOriginAccessIdentityAlreadyExists error.

HTTP Status Code: 409

InconsistentQuantities

The value of Quantity and the size of Items do not match.

HTTP Status Code: 400

InvalidArgument

The argument is invalid.

HTTP Status Code: 400

MissingBody

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

HTTP Status Code: 400

TooManyCloudFrontOriginAccessIdentities

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

HTTP Status Code: 400