cloudfront-ui
Overview
Provisions the CloudFront distribution that fronts the firefly-s3-ui bucket for web UI delivery. Also creates the Route 53 alias record mapping the UI domain name to the CloudFront distribution.
CloudFormation Stack
firefly-cloudfront-ui
Dependencies
Deploy
acm— provides theCertificateArnfor the CloudFront alternate domains3-ui— the origin bucket must exist before the distribution can reference it
Delete
delete-ui-app— UI assets and any active CloudFront references should be cleared first
Required By
Deploy
ui-app— the CloudFront distribution ID and domain are needed to deploy the UI app and invalidate the cache
Delete
delete-s3-ui— CloudFront UI distribution must be deleted before the origin bucketdelete-acm(transitively)
Deploy Workflow
Description
Looks up the CertificateArn from the firefly-acm stack output, then deploys the firefly-cloudfront-ui CloudFormation stack. CloudFront distribution propagation takes 15–20 minutes. The stack also creates a Route 53 ALIAS record for the UI domain.
Steps
- Checkout repository
- Configure AWS credentials
- Install SAM CLI
- Lookup
CertificateArnfromfirefly-acmstack output sam build— template:templates/cloudfront-ui.yamlsam deploy— stack:firefly-cloudfront-ui; params:UiBucketName,CertificateArn,UiDomain,HostedZoneId
Sequence Diagram
Delete Workflow
Description
Deletes the firefly-cloudfront-ui CloudFormation stack, removing the CloudFront distribution and the Route 53 alias record. Must run after delete-ui-app to ensure the distribution is not serving live traffic.
Steps
- Configure AWS credentials
- Install SAM CLI
sam delete --stack-name firefly-cloudfront-ui --no-prompts --region
Sequence Diagram
Failure Scenarios
| Scenario | Cause | Resolution |
|---|---|---|
| CNAME already associated with another distribution | Another CloudFront distribution in the account has the same alternate domain name | Remove the alternate domain name from the conflicting distribution, then re-run |
Stack left in UPDATE_IN_PROGRESS after cancellation | Workflow was cancelled during the 15–20 minute CloudFront propagation window | Wait for the update to finish before re-running |
CertificateArn lookup fails | firefly-acm stack not deployed or output not present | Deploy acm first |