| Copyright | (c) 2013-2018 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.AWS.CloudFront.UpdateDistribution
Description
Updates the configuration for a web distribution. Perform the following steps.
For information about updating a distribution using the CloudFront console, see Creating or Updating a Web Distribution Using the CloudFront Console in the Amazon CloudFront Developer Guide .
To update a web distribution using the CloudFront API
- Submit a
GetDistributionConfigrequest to get the current configuration and anEtagheader for the distribution. - Update the XML document that was returned in the response to your
GetDistributionConfigrequest to include the desired changes. You can't change the value ofCallerReference. If you try to change this value, CloudFront returns anIllegalUpdateerror.
Important: The new configuration replaces the existing configuration; the values that you specify in an UpdateDistribution request are not merged into the 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 corresponding Quantity element.
- Submit an
UpdateDistributionrequest 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
DistributionConfigelement. - Set the value of the HTTP
If-Matchheader to the value of theETagheader that CloudFront returned when you submitted theGetDistributionConfigrequest in Step 1. - Review the response to the
UpdateDistributionrequest to confirm that the configuration was successfully updated. - Optional: Submit a
GetDistributionrequest to confirm that your changes have propagated. When propagation is complete, the value ofStatusisDeployed.
Important: Beginning with the 2012-05-05 version of the CloudFront API, we made substantial changes to the format of the XML document that you include in the request body when you create or update a distribution. With previous versions of the API, we discovered that it was too easy to accidentally delete one or more values for an element that accepts multiple values, for example, CNAMEs and trusted signers. Our changes for the 2012-05-05 release are intended to prevent these accidental deletions and to notify you when there's a mismatch between the number of values you say you're specifying in the Quantity element and the number of values you're actually specifying.
Synopsis
- updateDistribution :: DistributionConfig -> Text -> UpdateDistribution
- data UpdateDistribution
- udIfMatch :: Lens' UpdateDistribution (Maybe Text)
- udDistributionConfig :: Lens' UpdateDistribution DistributionConfig
- udId :: Lens' UpdateDistribution Text
- updateDistributionResponse :: Int -> UpdateDistributionResponse
- data UpdateDistributionResponse
- udrsETag :: Lens' UpdateDistributionResponse (Maybe Text)
- udrsDistribution :: Lens' UpdateDistributionResponse (Maybe Distribution)
- udrsResponseStatus :: Lens' UpdateDistributionResponse Int
Creating a Request
Arguments
| :: DistributionConfig | |
| -> Text | |
| -> UpdateDistribution |
Creates a value of UpdateDistribution with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
udIfMatch- The value of theETagheader that you received when retrieving the distribution's configuration. For example:E2QWRUHAPOMQZL.udDistributionConfig- The distribution's configuration information.udId- The distribution's id.
data UpdateDistribution Source #
The request to update a distribution.
See: updateDistribution smart constructor.
Instances
Request Lenses
udIfMatch :: Lens' UpdateDistribution (Maybe Text) Source #
The value of the ETag header that you received when retrieving the distribution's configuration. For example: E2QWRUHAPOMQZL .
udDistributionConfig :: Lens' UpdateDistribution DistributionConfig Source #
The distribution's configuration information.
Destructuring the Response
updateDistributionResponse Source #
Arguments
| :: Int | |
| -> UpdateDistributionResponse |
Creates a value of UpdateDistributionResponse with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
udrsETag- The current version of the configuration. For example:E2QWRUHAPOMQZL.udrsDistribution- The distribution's information.udrsResponseStatus- -- | The response status code.
data UpdateDistributionResponse Source #
The returned result of the corresponding request.
See: updateDistributionResponse smart constructor.
Instances
Response Lenses
udrsETag :: Lens' UpdateDistributionResponse (Maybe Text) Source #
The current version of the configuration. For example: E2QWRUHAPOMQZL .
udrsDistribution :: Lens' UpdateDistributionResponse (Maybe Distribution) Source #
The distribution's information.
udrsResponseStatus :: Lens' UpdateDistributionResponse Int Source #
- - | The response status code.