Posted On: Dec 10, 2020

Amplify CLI helps front-end web & mobile developers provision APIs and host websites. With today’s Amplify CLI release, you gain the ability to deploy the GraphQL & REST APIs and host websites using AWS Fargate in addition to existing AppSync, API Gateway and Amplify console options. Just run the “amplify configure project” command and enable the “container-based deployments” option.

Now, you can:

  • deploy REST APIs & GraphQL APIs based on Amplify-provided container templates;
  • bring your own containers from other projects - all you need is a Dockerfile or a Docker Compose configuration; 
  • use the out-of-the-box build & deploy pipeline or configure your own custom pipeline.

Amplify’s container-based deployment option is designed to have you focus on your business logic instead of the infrastructure setup as well as the build & deployment pipeline. Run “amplify add api” to create your first container-based API. Just edit the API source code and run “amplify push”. Amplify CLI automatically packages, builds and deploys your container-based API.

One of the key benefits of containers is portability. Amplify CLI also allows you to bring your own containers. The build & deployment options are automatically inferred through your Docker Compose configuration and provides you an escape hatch to do detailed tweaks throughout the build and deployment process. Builds can be completely managed via the Amplify CLI - without requiring Docker to be installed locally - or they can be decoupled and connected to a GitHub repo as source control in team workflows. Multiple environments for development team collaboration are also included.

Amplify libraries can be used to interact with your Fargate-backed APIs when using Amazon Cognito User Pools, giving mobile and web applications secure connectivity and access controls to resources in your VPC. Additionally, existing GraphQL and REST services such as AWS AppSync and Amazon API Gateway can be used in the same project along with Fargate APIs giving flexibility to mix and match for cost optimization and operational needs.

Get started by reading our blog post on how to deploy a new & existing container-based REST API with Amplify CLI, the documentation, or by running “amplify configure project” in your Amplify project.