During re-invent 2020, AWS made a couple of announcements related to containerization service offerings. Which are:
🔥 Four new services:
- AWS Proton (a new service to manage and automate container development and deployment)
- Amazon ECS Anywhere (run ECS on-premises environments)
- Amazon EKS Anywhere (run EKS on-premises environments)
- Amazon ECR Public - (host and share public repos just like DockerHub)
📦 Containerization Comes to Lambda:
You can now package and deploy AWS Lambda functions as a container image of up to 10 GB
In this tutorial, I am going to show how you can take a test drive of AWS proton and deploy your first app on it.
ℹ️ Notice: It's a preview program and not 100% stable at the time of writing
ℹ️ Notice: Make sure your AWS account has "Administrative access" before proceeding (root accounts have it by default).
ℹ️ Notice: If you don't have ECS experience then I will highly recommend you to complete this series first
Go to AWS Proton Console
From the AWS Proton Console, click "Account Roles" and then click "Create"
From the AWS Proton Console, click "Environment templates" from the left sidebar
Enter any name as "Template name" and "Template display name", select "Staging" as the compatible environment template (it should be the same as "Template display name" in step 2 ☝🏽), and click "Create service template"
Give any name to "Service Name", enter the branch (of your Github repo) name you would like to use, enter your repo id in the format
account-id/repo-name, select the github connection we created in step 1 and then click "Next" - you can also fork this sample app if you don't have any
Give a name to your instance, selected the environment we created earlier, give a port number (default is 80), set the desired count to 1 (it's literally the same as setting the number of tasks in ECS), select X-small as size (I tried looking for some reference for these sizes and how they map to vCPUs/memory but I couldn't find in the official doc at the time of writing this article), give any name to "Unique name", click "Create"
It will take a while before the status is changed to "Succeeded" from "In Progress". Actually, behind the scenes, it will create an ECS cluster, service, task def, task, cloud build project, cloud pipeline, etc.
That's it, thank you so much for following along!
🐞 Bugs and their workarounds
When I first tried AWS Proton there were a number of bugs that I found, most of them have already been fixed and chances are when you are reading this the remaining ones are also fixed
By default, it was always going to Nginx image and I had to get the URI of my image from ECR and then update the service instance manually (actions->update specs)
Sometimes it wouldn't show me "Use one of our sample template bundles", for that go to AWS Proton console, click get started, and from there click "Create environment template"
If the pipeline failed it wouldn't give any error and the status of the instance would show "in progress". To fix that, go to AWS Pipeline and see at which stage it has failed and why and fix it (you can also access the associated code build project from there)
I couldn't update/delete failed pipelines even after using the CLI so you can manually delete it by going to ECS and removing/stopping associated service or task(s) - see the Github issue