Menu
Amazon CloudFront
API Reference (API Version 2018-06-18)

UpdatePublicKey

Update public key information. Note that the only value you can change is the comment.

Request Syntax

PUT /2018-06-18/public-key/Id/config HTTP/1.1 <?xml version="1.0" encoding="UTF-8"?> <PublicKeyConfig xmlns="http://cloudfront.amazonaws.com/doc/2018-06-18/"> <CallerReference>string</CallerReference> <Comment>string</Comment> <EncodedKey>string</EncodedKey> <Name>string</Name> </PublicKeyConfig>

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in XML format.

PublicKeyConfig

Root level tag for the PublicKeyConfig parameters.

Required: Yes

CallerReference

A unique number that ensures the request can't be replayed.

Type: String

Required: Yes

Comment

An optional comment about a public key.

Type: String

Required: No

EncodedKey

The encoded public key that you want to add to CloudFront to use with features like field-level encryption.

Type: String

Required: Yes

Name

The name for a public key you add to CloudFront to use with features like field-level encryption.

Type: String

Required: Yes

Response Syntax

HTTP/1.1 200 <?xml version="1.0" encoding="UTF-8"?> <PublicKey> <CreatedTime>timestamp</CreatedTime> <Id>string</Id> <PublicKeyConfig> <CallerReference>string</CallerReference> <Comment>string</Comment> <EncodedKey>string</EncodedKey> <Name>string</Name> </PublicKeyConfig> </PublicKey>

Response Elements

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

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

PublicKey

Root level tag for the PublicKey parameters.

Required: Yes

CreatedTime

A time you added a public key to CloudFront.

Type: Timestamp

Id

A unique ID assigned to a public key you've added to CloudFront.

Type: String

PublicKeyConfig

A complex data type for a public key you add to CloudFront to use with features like field-level encryption.

Type: PublicKeyConfig object

Errors

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

AccessDenied

Access denied.

HTTP Status Code: 403

CannotChangeImmutablePublicKeyFields

You can't change the value of a public key.

HTTP Status Code: 400

IllegalUpdate

Origin and CallerReference cannot be updated.

HTTP Status Code: 400

InvalidArgument

The argument is invalid.

HTTP Status Code: 400

InvalidIfMatchVersion

The If-Match version is missing or not valid for the distribution.

HTTP Status Code: 400

NoSuchPublicKey

The specified public key doesn't exist.

HTTP Status Code: 404

PreconditionFailed

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

HTTP Status Code: 412

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: