swyxio / swyxdotio

This is the repo for swyx's blog - Blog content is created in github issues, then posted on swyx.io as blog pages! Comment/watch to follow along my blog within GitHub
https://swyx.io
MIT License
336 stars 45 forks source link

You Can Run Containers on AWS Amplify Now #322

Closed swyxio closed 2 years ago

swyxio commented 2 years ago

source: devto devToUrl: "https://dev.to/swyx/you-can-run-containers-on-aws-amplify-now-23ka" devToReactions: 62 devToReadingTime: 3 devToPublishedAt: "2020-12-11T14:24:37.337Z" devToViewsCount: 4118 title: You Can Run Containers on AWS Amplify Now published: true description: AWS just added the easiest way to deploy long running serverful code alongside a serverless architecture. category: tutorial tags: Tech, AWS slug: amplify-serverless-containers cover_image: https://d2908q01vomqb2.cloudfront.net/0a57cb53ba59c46fc4b692527a38a87c78d84028/2020/12/10/Artboard-Copy.png

The second week of AWS re:Invent brought a surprise major announcement from the AWS Amplify team: You can run Docker containers as AWS Amplify APIs now!!!

The main Achilles heel of migrating to serverless architectures is having to relearn and rewrite traditional serverful code. With the new Amplify Serverless Containers, it is now possible to deploy code in stateful Docker containers with the exact same workflow as the rest of Amplify CLI.

# example of the new CLI workflow, see docs for details
# Amplify CLI version 4.39+

$ amplify init # if you're setting up new Amplify project

$ amplify configure project
 > Do you want to enable container-based deployments? Yes

$ amplify add api

Please select from one of the below mentioned services: REST
? Which service would you like to use 
  API Gateway + Lambda 
❯ API Gateway + AWS Fargate (Container-based) 

For the first time, this opens up the possibility of running Rails, Django, Laravel, or any other traditionally serverful APIs seamlessly alongside a serverless architecture. If it fits in a Docker container, you can run it! This thus unlocks the full capabilities of their respective ecosystems.

Emphasis on seamless integration: this means that frontend and mobile developers don't need to go to 9 months of cloud school (having to learn the details of VPC, subnets, NACLs, IAM policies, SSL generation, continuous deploy, cost optimization, etc) just in order to get a containerized API up and running on AWS.

This, to me, is a big deal for a number of interrelated reasons:

So, yeah. I think this is awesome - You can run basically anything on AWS Amplify now - meaning that you spend less time wrangling infrastructure and more time writing valuable features. Don't take my word for it, see Ant Stanley (organizer of Serverless Days and overall cloud expert):

{% twitter 1337088737243783174 %}

P.S. for those who are making comparisons with AWS CDK, note that this capability was actually made with CDK - it solves a higher level problem than CDK.