pub struct UpdateDistribution { /* private fields */ }
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
sourceimpl UpdateDistribution
impl UpdateDistribution
sourcepub async fn send(
self
) -> Result<UpdateDistributionOutput, SdkError<UpdateDistributionError>>
pub async fn send(
self
) -> Result<UpdateDistributionOutput, SdkError<UpdateDistributionError>>
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.
sourcepub fn distribution_config(self, input: DistributionConfig) -> Self
pub fn distribution_config(self, input: DistributionConfig) -> Self
The distribution's configuration information.
sourcepub fn set_distribution_config(self, input: Option<DistributionConfig>) -> Self
pub fn set_distribution_config(self, input: Option<DistributionConfig>) -> Self
The distribution's configuration information.
sourcepub fn if_match(self, input: impl Into<String>) -> Self
pub fn if_match(self, input: impl Into<String>) -> Self
The value of the ETag
header that you received when retrieving the distribution's configuration. For example: E2QWRUHAPOMQZL
.
sourcepub fn set_if_match(self, input: Option<String>) -> Self
pub fn set_if_match(self, input: Option<String>) -> Self
The value of the ETag
header that you received when retrieving the distribution's configuration. For example: E2QWRUHAPOMQZL
.
Trait Implementations
sourceimpl Clone for UpdateDistribution
impl Clone for UpdateDistribution
sourcefn clone(&self) -> UpdateDistribution
fn clone(&self) -> UpdateDistribution
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for UpdateDistribution
impl Send for UpdateDistribution
impl Sync for UpdateDistribution
impl Unpin for UpdateDistribution
impl !UnwindSafe for UpdateDistribution
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more