-
Create an AWS account Account-A for the root hosted zone.
-
Create an AWS account Account-B for the static assets.
-
Register a domain in Account-A.
-
Create a root hosted zone in Account-A.
-
Create a DNS delegation IAM role in Account-A with the identity-based policy
{ "Version": "2012-10-17", "Statement": [ { "Action": [ "route53:ChangeResourceRecordSets", "route53:GetHostedZone" ], "Resource": "arn:aws:route53:::hostedzone/<root hosted zone id>", "Effect": "Allow" }, { "Action": "route53:ListHostedZonesByName", "Resource": "*", "Effect": "Allow" } ] }
-
Create a sub hosted zone in Account-B.
-
Create cross account zone delegation records in Account-B from the sub hosted zone to the root hosted zone using the DNS delegation IAM role from Account-A.
-
Create an S3 bucket Account-B.
-
Request an ACM certificate in Account-B for the sub hosted zone.
-
Create a CloudFront distribution in Account-B using the S3 bucket as the origin, specifying a default root object, and adding the alternate domain names.
-
Create a resource-based policy for the S3 bucket in Account-B, allowing the CloudFront service principal to perform
s3:GetObject
on the S3 bucket with the condition that the source is from the new CloudFront distribution.
Last active
August 17, 2024 15:33
-
-
Save airicbear/ebf79a00bfe2e6235f07379f50d5e826 to your computer and use it in GitHub Desktop.
Create a static website in CloudFront
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment