Lab complete!
Now that you have completed this lab, make sure to update your Well-Architected review if you have implemented these changes in your workload.
Click here to access the Well-Architected Tool
You can improve resiliency and increase availability for specific scenarios by setting up CloudFront with origin failover.
1.1 Click CloudFront to navigate to the dashboard.
1.2 Click the Create a CloudFront Distribution button.
1.3 DO NOT choose from the drop down list for the Origin domain value. Instead paste the CloudFormation Stack Output WebsiteURL value that you copied in Verify Websites section in the N. Virginia (us-east-1) region. There are differences when choosing to host from a Standard Amazon S3 bucket versus an Amazon S3 bucket thats configured as a website endpoint. For more information see Using various origins with CloudFront distributions.
1.4 In the Cache key and origin requests section, select CachingDisabled for the Cache Policy to disable CloudFront caching.
One of the purposes of using CloudFront is to reduce the number of requests that your origin server must respond to directly. With CloudFront caching, more objects are served from CloudFront edge locations, which are closer to your users. This reduces the load on your origin server and reduces latency. However, that behavior masks our mechanism (disabling the UI bucket) from properly simulating an outage. For more information, see Amazon CloudFront Optimizing caching and availability. In production, customers typically want to use the default value CachingOptimized.
1.5 Select Do not enable security protections for Web Application Firewall (WAF).
For production workloads, customers will want to consider using Web Application Firewall (WAF) to enable security protections to keep their applications secure from the most common web threats and security vulnerabilities.
1.6 Click the Create Distribution button.
We will now add an additional Origin and use our hot-secondary-uibucket-xxxx.
2.1 Click the Origins link, then click the Create origin button.
2.2 DO NOT choose from the drop down list for the Origin domain value. Instead paste the CloudFormation Stack Output WebsiteURL value that you copied in Verify Websites section in the N. California (us-west-1) region, then click Create Origin.
3.1 If you configured the origins correctly, you should see S3 static website for the Origin type. Click the Create Origin Group link.
3.2 Select hot-primary-uibucket-xxxx as the Origins, then click the Add button. Select hot-secondary-uibucket-xxxx as the Origins, then click the Add button. Enter hot-standby-origin-group
as the Name. Enable all checkboxes for Failover criteria, then click the Create origin group.
4.1 Click the Behaviors link. Select Default (*), then click the Edit button.
4.2 Select hot-standby-origin-group as the Origin and Origin Groups.
4.3 Click the Save changes button.
4.4 Click the Distributions link.
4.5 Wait for Status to be Enabled and for Last Modified to have a date.
5.1 Copy the CloudFront Distribution’s Domain Name into a new browser window.
5.2 Confirm that the website’s header says The Unicorn Shop - us-east-1.
Now that you have completed this lab, make sure to update your Well-Architected review if you have implemented these changes in your workload.
Click here to access the Well-Architected Tool