Setting up static assets

Setting up an S3 bucket and CloudFront distribution to host static media isn't complicated and, in theory, we could add this to the Resources section of our serverless.yml file. The ability of Serverless to manage so many resources via CloudFormation is a slippery slope, since setting up systems can quickly become an exercise in learning and debugging CloudFormation. Another downside of a growing Resources section in the serverless.yml file is that deployments will take longer and longer. It's possible to only deploy application code during development, which results in single-digit second deployments; but when some system resource is updated, including environment variables, the entire CloudFormation stack needs ...

Get Serverless Design Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.