-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy-cloudfront.sh
More file actions
executable file
·29 lines (23 loc) · 1.15 KB
/
deploy-cloudfront.sh
File metadata and controls
executable file
·29 lines (23 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Create CloudFront distribution
echo "Creating CloudFront distribution..."
DISTRIBUTION_ID=$(aws cloudfront create-distribution --distribution-config file://cloudfront-config.json --query 'Distribution.Id' --output text)
if [ $? -eq 0 ]; then
echo "CloudFront distribution created successfully!"
echo "Distribution ID: $DISTRIBUTION_ID"
# Get the CloudFront domain name
CLOUDFRONT_DOMAIN=$(aws cloudfront get-distribution --id $DISTRIBUTION_ID --query 'Distribution.DomainName' --output text)
echo "CloudFront Domain: $CLOUDFRONT_DOMAIN"
echo ""
echo "Next steps:"
echo "1. Wait for distribution to deploy (15-20 minutes)"
echo "2. Create SSL certificate for collections.cloudcontactai.com in AWS Certificate Manager"
echo "3. Update the distribution to use the SSL certificate"
echo "4. Create CNAME record: collections.cloudcontactai.com -> $CLOUDFRONT_DOMAIN"
# Save distribution info
echo "DISTRIBUTION_ID=$DISTRIBUTION_ID" > cloudfront-info.env
echo "CLOUDFRONT_DOMAIN=$CLOUDFRONT_DOMAIN" >> cloudfront-info.env
else
echo "Failed to create CloudFront distribution"
exit 1
fi