Sets the configuration for an Amazon CloudFront origin access identity (OAI). Use this when updating the configuration. Currently, only comments may be updated. Follow the same process as 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.
When attempting to change configuration items that are not allowed to be updated, Amazon CloudFront
returns an IllegalUpdate
error.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
An Identity ID for an existing OAI. |
|
|
Required |
The configuration XML generated by |
|
|
Required |
The ETag header value retrieved from a call to |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Update the OAI configuration.
// Create a new CloudFront distribution from an S3 bucket. $cdn = new AmazonCloudFront(); // Get the existing OAI configuration $config = $cdn->get_oai_config('E3HV63EQPFPPOA'); // Was the request successful? if ($config->isOK()) { // Grab the ETag header $etag = $config->header['etag']; // Update the configuration. (Returns XML.) $updated_xml = $cdn->update_oai_xml($config, array( 'Comment' => 'This is my updated comment.' )); // Update the OAI configuration. $response = $cdn->set_oai_config('E3HV63EQPFPPOA', $updated_xml, $etag); // Success? var_dump($response->isOK()); }Result:
bool(true)
Related Methods
See Also
Source
Method defined in services/cloudfront.class.php | Toggle source view (10 lines) | View on GitHub