In last section, you associated a SSL certificate with the sample website and add an alternative domain name. The CloudFront distribution is changed, you can see the config difference and rollback the changes using snapshot.
Navigate to CloudFront Extensions console (you can find the link in the Outputs tab of cloudFrontExtensionsConsole stack).
In the navigation panel, under Distribution management, choose Snapshot.
Choose the sample website distribution (you can find it by DistributionID in Outputs tab of CFExtSampleWorkshop stack).
Choose Create Snapshot.
In the window that pops up, enter a Snapshot Name (a unique key used to identify this snapshot), and also description.
Choose Create.
Click Refresh button to see the newly created snapshot.
Choose these two snapshots, click Actions > Compare to see the difference between the snapshots.
The differences are shown in red, you can see there are two differences, the above one is Alias, the below one is ViewerCertificate.
Go back to snapshot list page.
Choose the first snapshot to rollback, click Actions > Apply to other distributions.
Select the sample website distribution (you can find it in Outputs tab of CFExtSampleWorkshop stack). Type in Confirm and click Apply button.
Go to CloudFront console.
Choose the sample website distribution.
The distribution status is Deploying since you have applied the snapshot to it.
Wait until the distribution Last modified field changed from Deploying to a specific date time.
Access the sample website with your domain name again. It will show messages like this. The sample website can’t be accessed by your domain name since you have rollback the configuration. But you can still access it by CloudFront domain name (xxx.cloudfront.net).
In this section, you viewed the difference between two snapshots and rollback the configuration of the sample website. By using snapshot, you can easily rollback or copy CloudFront configuration.
When you apply a snapshot, the target distribution configuration will be replaced.
Snapshot is created manually, if you want to save the configuration automatically, try Change history under Distribution management.