Profile Applicability: Level 2
Description
Amazon CloudFront origin failover ensures high availability by automatically switching to a secondary origin if the primary origin is unavailable or returns specific HTTP response status codes that indicate a failure. This feature is crucial for maintaining uninterrupted service and improving the reliability of your web applications.
Rationale
High Availability: Ensures continuous service by automatically switching to a secondary origin when the primary origin fails.
Improved Reliability: Reduces the risk of downtime and service interruptions.
Enhanced User Experience: Provides a seamless experience for users by preventing service disruptions.
Impact
Pros:
Ensures high availability and continuous service.
Reduces the risk of downtime and service interruptions.
Enhances user experience by preventing disruptions.
Cons:
May require additional configuration and testing.
Potential temporary disruption during the setup process.
Default Value
By default, origin failover is not enabled for CloudFront distributions. It must be explicitly configured with a primary and secondary origin.
Pre-Requisite
IAM Permissions:
cloudfront:GetDistribution
cloudfront:UpdateDistribution
AWS CLI installed and configured.
Remediation
Test Plan:
Using AWS Console:
Sign in to the AWS Management Console.
Navigate to the CloudFront Dashboard.
Click on the Distributions tab in the top left navigation menu.
Select the Distribution you want to audit.
Click on the Origins tab in the top menu.
Check if an origin group is configured with a primary and secondary origin.
Using AWS CLI:
Check Origin Failover Status:
aws cloudfront get-distribution --id <distribution-id> --query 'Distribution.DistributionConfig.Origins.Items[*].OriginGroup'
Implementation Steps:
Using AWS Console:
Sign in to the AWS Management Console.
Navigate to the CloudFront Dashboard.
Click on the Distributions tab in the top left navigation menu.
Select the Distribution you want to modify.
Click on the Origins tab in the top menu.
Create an origin group with a primary and secondary origin.
Configure the cache behavior to use the origin group.
Save the changes.
Using AWS CLI:
Save the JSON file document named distconfig-origin-failover.json.
Update the distribution:
aws cloudfront update-distribution --id <distribution-id> --distribution-config file://distconfig-origin-failover.json
Backout Plan
Using AWS Console:
Navigate to the CloudFront Dashboard.
Select the Distribution.
Click Edit Attributes.
Remove the origin group configuration.
Click Save changes to save the changes.
Using AWS CLI:
aws cloudfront update-distribution --id <distribution-id> --distribution-config file://distconfig-original.json