cloudkj / scar Goto Github PK
View Code? Open in Web Editor NEWDeploy static websites in seconds - with HTTPS, a global CDN, and custom domains.
License: MIT License
Deploy static websites in seconds - with HTTPS, a global CDN, and custom domains.
License: MIT License
As per https://docs.aws.amazon.com/acm/latest/userguide/acm-regions.html, ACM has a restriction that requires certificates to be created in the us-east-1 region in order to be used with CloudFront:
To use an ACM Certificate with Amazon CloudFront, you must request or import the certificate in the US East (N. Virginia) region. ACM Certificates in this region that are associated with a CloudFront distribution are distributed to all the geographic locations configured for that distribution.
The docs should be updated to reflect this limitation. It's possible that CloudFormation Stack Sets can offer a path forward by requesting only the ACM certificate in us-east-1 but other resources in the chosen region, but some work is needed to see if that's possible.
See #9 (comment)
Adding this would remove the need for the third manual step in the quick start guide - to manually validate ownership of the domain by creating the CNAME records using the AWS ACM console.
Preliminary research seems to indicate that official CloudFormation support for template-driven certificate validation may be coming, but until then some potential solutions are:
I like the idea and am curious about what the monthly cost would be (or if it stays within the free tier) to run all these services.
Attempting to delete a newly created SCAR stack in CloudFormation currently fails due to the CNAME DNS record that is created manually as part of the validation step. A custom resource could be added to the template to remove this record from the hosted zone so that the record is deleted after validation is successful.
Template for a stack with no www
subdomain.
What tool did you use to make this image? https://github.com/cloudkj/scar#stack
A Lambda@Edge deployment would, I think, be a more lightweight solution for redirection than another bucket and distribution.
Something like (written for !Sub
):
exports.handler = async (event, context) => {
const request = event.Records[0].cf.request;
const headers = request.headers;
const host = headers.host[0].value.toLowerCase();
if (host == 'www.${APEX_DOMAIN}') {
/*
* Generate HTTP redirect response with 302 status code and Location header.
*/
const response = {
status: '302',
statusDescription: 'Found',
headers: {
location: [{
key: 'Location',
value: 'https://${APEX_DOMAIN}',
}],
},
};
return response;
} else {
return request;
}
};
$0.50 sounds nice, but doesn't ACM charge additional $400.00 for setup (after 30 days trial)?
https://aws.amazon.com/certificate-manager/pricing/
May be good to point out in the description?
Template for a stack that is the same as the default stack, but redirects requests for the www
subdomain to the apex domain.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.