cloudfront-fmc
Overview
Provisions the CloudFront distribution that fronts the firefly-s3-fmc bucket for FMC delivery. Also creates the Route 53 alias record mapping the FMC domain name to the CloudFront distribution.
CloudFormation Stack
firefly-cloudfront-fmc
Dependencies
Deploy
acm— provides theCertificateArnfor the CloudFront alternate domains3-fmc— the origin bucket must exist before the distribution can reference it
Delete
delete-fmc-app— FMC assets and any active CloudFront references should be cleared first
Required By
Deploy
fmc-app— the CloudFront distribution ID and domain are needed to deploy the FMC app and invalidate the cache
Delete
delete-s3-fmc— CloudFront FMC 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-fmc CloudFormation stack. CloudFront distribution propagation takes 15–20 minutes. The stack also creates a Route 53 ALIAS record for the FMC domain.
Steps
- Checkout repository
- Configure AWS credentials
- Install SAM CLI
- Lookup
CertificateArnfromfirefly-acmstack output sam build— template:templates/cloudfront-fmc.yamlsam deploy— stack:firefly-cloudfront-fmc; params:FmcBucketName,CertificateArn,FmcDomain,HostedZoneId
Sequence Diagram
Delete Workflow
Description
Deletes the firefly-cloudfront-fmc CloudFormation stack, removing the CloudFront distribution and the Route 53 alias record. Must run after delete-fmc-app to ensure the distribution is not serving live traffic.
Steps
- Configure AWS credentials
- Install SAM CLI
sam delete --stack-name firefly-cloudfront-fmc --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 |