CloudFront continuous deployment workflow
The following high-level workflow explains how to safely test and deploy configuration changes with CloudFront continuous deployment.
-
Choose the distribution that you want to use as the primary distribution. The primary distribution is one that currently serves production traffic.
-
From the primary distribution, create a staging distribution. A staging distribution starts as a copy of the primary distribution.
-
Create a traffic configuration inside a continuous deployment policy, and attach it to the primary distribution. This determines how CloudFront routes traffic to the staging distribution. For more information about routing requests to a staging distribution, see Route requests to the staging distribution.
-
Update the configuration of the staging distribution. For more information about the settings that you can update, see Update primary and staging distributions.
-
Monitor the staging distribution to determine whether the configuration changes perform as expected. For more information about monitoring a staging distribution, see Monitor a staging distribution.
As you monitor the staging distribution, you can:
-
Update the configuration of the staging distribution again, to continue testing configuration changes.
-
Update the continuous deployment policy (traffic configuration) to send more or less traffic to the staging distribution.
-
-
When you're satisfied with the performance of the staging distribution, promote the staging distribution's configuration to the primary distribution, which copies the staging distribution's configuration to the primary distribution. This also disables the continuous deployment policy which means that CloudFront routes all traffic to the primary distribution.
You can build automation that monitors the performance of the staging distribution (step 5) and promotes the configuration automatically (step 6) when certain criteria are met.
After you promote a configuration, you can reuse the same staging distribution the next time you want to test a configuration change.
For more information about working with staging distributions and continuous deployment policies in the CloudFront console, the AWS CLI, or the CloudFront API, see the following section.