I am trying to understand if the following is possible…
Upload a static site to S3.
Create a cloud formation distribution.
Link to a custom domain name from route 53
Attach a custom https certificate from Amazon’s certificate manager.
I’ve had a look at both the serverless-finch and serverless-single-page-app-plugin plugins. The former works quite nicely to upload my static site to s3 and I believe the latter will set up a cloud front distribution.
I’m struggling to understand how to connect the dots.
Firstly - is this what the serverless framework is designed to do? Or should I look at a different tool (e.g. Terraform).
If I’m in the right place I think I need to understand how to link up both my Route 53 domain and my HTTPS certificate to my cloudfront distribution.
Or is it the case that I would set these up once manually and then use serverless to manage the deploy my static site in the s3 bucket and the lambda APIs I will have for the actual site functionality?
It uses netily do complete the process that is deploying to s3 -> cloudfront and then a custom domain at route 53 . Can we do it using serverless only ?
in my experience…there are better ways to transfer your web site to S3 buckets. while i imagine there’s a way that serverless can do this…gulp is probably an easier tool - along with this add-on:
gulp.task(‘invalidate-cloudfront’, function() {
var cfSettings = {
distribution: ‘===your name====’, // Cloudfront distribution ID
wait: false, // Whether to wait until invalidation is completed (default: false)
paths: [’/*’], // Configure OriginPath to be removed of file path to invalidation
indexRootPath: true // Invalidate index.html root paths (foo/index.html and foo/) (default: false)
};