5 ms·
S3 static site with SSL and automatic deploys using Travis
- fancy_pantser 10y agoNote you'll have to manually create and deploy those Let's Encrypt certificates every 90 days because you didn't automate it (which is what they want/prefer). https://letsencrypt.org/2015/11/09/why-90-days.html https://letsencrypt.org/2015/11/09/why-90-days.html
- andrelaszlo 10y agoYes I should add that to the notes (author here). Thanks for pointing it out. I have been thinking about ways to automate it but haven't come up with anything I like yet. Any ideas? Might switch to ACM otherwise.
- simonw 10y agoIt may be possible to automate using a scheduled AWS lambda function - though you would need to host a dynamic path under your cloudfront-hosted domain which triggers a lambda function as part of the renewal process.
- colinbartlett 10y agoIf you happen to use DNSimple for DNS, they recently released a Let's Encrypt integration that verifies via DNS record. They have web hooks and also make the certs and private keys available via API, so I imagine you could set something up with Lambda. But in my experience, Amazon's certs are so easy to setup and use there is no reason not to.
- throwaway2016a 10y agoWhy is it using Let's Encrypt when AWS offers it's own certificates that are free, auto-renew, take seconds to setup in CloudFront, and as far as I know are just as widely recognized?
- andrelaszlo 10y agoJust for fun actually, it will probably turn out to be a PITA :)
- throwaway2016a 10y agoI can appreciate that.
- bobfunk 10y agoHave a look at Netlify, https://www.netlify.com https://www.netlify.com, (disclaimer I'm a cofounder). You can get all of this in 30 seconds on our free plan + instant cache invalidation, deploy previews (we'll give you a unique preview url for every pull request), atomic deploys and no issues with deleting files :)
- StavrosK 10y agoI second this, I tried it the other day and it really did take 30 seconds, it was great. I'm going to be using them for all my static sites now.
- tf2manu994 10y agoYep, theyre great. One major problem for me is that their build logs are in pure Black, and don't have any colour output. Also, afaik you can't set up a multi stage build step, like Travis.
- bobfunk 10y agoYou can setup multi stage builds like: npm run build && npm run test
- nivertech 10y agoDoes free plan works with multiple custom domains or single domain only?
- moodysalem 10y agoMost of the time it's fine to just use Github pages though. I do something like this for my site https://oauth2cloud.com https://oauth2cloud.com though.
- martiuk 10y agoNow just to set up the redirect so your visitors can only view in https.
- willglynn 10y agoCloudFront makes adding redirects easy -- set "Viewer Protocol Policy: Redirect HTTP to HTTPS" and it'll return 301s as appropriate. Done. http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-viewers-to-cloudfront.html http://docs.aws.amazon.com/AmazonCloudFront/latest/Developer... Now let's say you want to use HSTS so that browsers automatically rewrite HTTP to HTTPS. HSTS can protect users from agents that manipulate HTTP traffic, and it is therefore complementary to any redirection strategy. S3 lets you specify headers with your objects, like Cache-Control and Content-Type and such, but it doesn't support Strict-Transport-Security. (You can get S3 to use custom headers, but they must start with x-amz-meta-, which doesn't help here.) If the S3 origin can't return Strict-Transport-Security, that leaves CloudFront -- but CloudFront has no specific mechanism for HSTS nor any general mechanism for adding a response header. So... it's trivial to set a policy to redirect HTTP to HTTPS, but it's impossible to get S3->CloudFront to articulate that policy with Strict-Transport-Security headers. Sigh.