Struct aws_sdk_cloudfront::client::fluent_builders::UpdateDistribution [−][src]
pub struct UpdateDistribution<C = DynConnector, M = AwsMiddleware, R = Standard> { /* fields omitted */ }
Expand description
Fluent builder constructing a request to UpdateDistribution
.
Updates the configuration for a web distribution.
When you update a distribution, there are more required fields than when you create a distribution. When you update your distribution by using this API action, follow the steps here to get the current configuration and then make your updates, to make sure that you include all of the required fields. To view a summary, see Required Fields for Create Distribution and Update Distribution in the Amazon CloudFront Developer Guide.
The update process includes getting the current distribution configuration, updating the XML document that is
returned to make your changes, and then submitting an UpdateDistribution
request to make the updates.
For information about updating a distribution using the CloudFront console instead, see Creating a Distribution in the Amazon CloudFront Developer Guide.
To update a web distribution using the CloudFront API
-
Submit a GetDistributionConfig request to get the current configuration and an
Etag
header for the distribution.If you update the distribution again, you must get a new
Etag
header. -
Update the XML document that was returned in the response to your
GetDistributionConfig
request to include your changes.When you edit the XML file, be aware of the following:
-
You must strip out the ETag parameter that is returned.
-
Additional fields are required when you update a distribution. There may be fields included in the XML file for features that you haven't configured for your distribution. This is expected and required to successfully update the distribution.
-
You can't change the value of
CallerReference
. If you try to change this value, CloudFront returns anIllegalUpdate
error. -
The new configuration replaces the existing configuration; the values that you specify in an
UpdateDistribution
request are not merged into your existing configuration. When you add, delete, or replace values in an element that allows multiple values (for example,CNAME
), you must specify all of the values that you want to appear in the updated distribution. In addition, you must update the correspondingQuantity
element.
-
-
Submit an
UpdateDistribution
request to update the configuration for your distribution:-
In the request body, include the XML document that you updated in Step 2. The request body must include an XML document with a
DistributionConfig
element. -
Set the value of the HTTP
If-Match
header to the value of theETag
header that CloudFront returned when you submitted theGetDistributionConfig
request in Step 1.
-
-
Review the response to the
UpdateDistribution
request to confirm that the configuration was successfully updated. -
Optional: Submit a GetDistribution request to confirm that your changes have propagated. When propagation is complete, the value of
Status
isDeployed
.
Implementations
impl<C, M, R> UpdateDistribution<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
impl<C, M, R> UpdateDistribution<C, M, R> where
C: SmithyConnector,
M: SmithyMiddleware<C>,
R: NewRequestPolicy,
pub async fn send(
self
) -> Result<UpdateDistributionOutput, SdkError<UpdateDistributionError>> where
R::Policy: SmithyRetryPolicy<UpdateDistributionInputOperationOutputAlias, UpdateDistributionOutput, UpdateDistributionError, UpdateDistributionInputOperationRetryAlias>,
pub async fn send(
self
) -> Result<UpdateDistributionOutput, SdkError<UpdateDistributionError>> where
R::Policy: SmithyRetryPolicy<UpdateDistributionInputOperationOutputAlias, UpdateDistributionOutput, UpdateDistributionError, UpdateDistributionInputOperationRetryAlias>,
Sends the request and returns the response.
If an error occurs, an SdkError
will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
The distribution's configuration information.
The distribution's configuration information.
The value of the ETag
header that you received when retrieving the
distribution's configuration. For example: E2QWRUHAPOMQZL
.
The value of the ETag
header that you received when retrieving the
distribution's configuration. For example: E2QWRUHAPOMQZL
.
Trait Implementations
Auto Trait Implementations
impl<C = DynConnector, M = AwsMiddleware, R = Standard> !RefUnwindSafe for UpdateDistribution<C, M, R>
impl<C, M, R> Send for UpdateDistribution<C, M, R> where
C: Send + Sync,
M: Send + Sync,
R: Send + Sync,
impl<C, M, R> Sync for UpdateDistribution<C, M, R> where
C: Send + Sync,
M: Send + Sync,
R: Send + Sync,
impl<C, M, R> Unpin for UpdateDistribution<C, M, R>
impl<C = DynConnector, M = AwsMiddleware, R = Standard> !UnwindSafe for UpdateDistribution<C, M, R>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more