AWS Proton: First look and hands-on at the preview edition
By: Vaibhav Rajput
Tags: AWS, Cloud, Web Services, Deployment, Latest

AWS has added another gem for the deployment lifecycle by making AWS Proton available for public preview since 1st December. Pay extra attention to “preview” here which means that it is not yet recommended to be used in the production environment and will be available to limited region namely Europe (Ireland), Asia Pacific (Tokyo), US East (N. Virginia), US East (Ohio) and US West (Oregon).

This also means that it is not added directly to the AWS CLI and you will have to manually configure a model for it if you’re a CLI fan. You can do the same using the following command

aws s3 cp s3://aws-proton-preview-public-files/model/proton-2020–07–20.normal.json .



aws s3 cp s3://aws-proton-preview-public-files/model/waiters2.json . aws configure add-model — service-model file://proton-2020–07–20.normal.json — service-name proton mv waiters2.json ~/.aws/models/proton-preview/2020–07–20/waiters-2.json rm proton-2020–07–20.normal.json

Core concepts

Before we move forward, let’s understand a few terminologies that you will be hearing in this article

Account Role — An IAM role with admin permissions which will be used by Proton to create and deploy resources

Environment — Any resource which will be needed by the application to be hosted like an ECS cluster or to be supported like a database etc.

Service — The application which will be deployed. It defines how we want our application to run within a given environment.

Schema — A file defining all the inputs and outputs that can be provided to the CloudFormation template during deployment.

Setting up

Let us now create our first Proton setup

1. Configure account role

Proton will be creating and managing resources on your behalf. Hence, you will have to acknowledge this by providing IAM permission to in the form of an Account Role.

To do this, create an IAM role with Admin privileges and choose this role under the Configure account roles menu.

2. Register an environment template

An environment template is a collection of template versions each having a set of CloudFormation, Schema and Manifest file.

At this point, you can just create an environment template by simply providing a name and an optional display name and description. We will create the templates in the next step.

3. Create a version

A version refers to a set of templates bundled into a .tar.gz file. Template bundles contain all of the information Proton needs to deploy environments and services. Template bundles become re-usable, standardized and curated once you create and register them as templates with Proton.

To create a version, simply bundle up your templates and push it to an S3 bucket. Now click on Create new version button and refer to the bucket and the tar inside it. This will by default create a minor version, however, you can check the option saying ☑Check to create a new major version.

Here you can see that the version status is set to Draft as it is not deployed yet.

So what should this tar include? 1. A CloudFormation template defining the resources as you can see in this example 2. A manifest file which will define the CloudFormation template to be used and which engine you will be using to provide the inputs and outputs through schema. One such manifest file can be seen here. 3. A schema file in which you specify the inputs and outputs for the CloudFormation files as shown here. The directory structure can be seen here

4. Publish version

Once the version is created and successfully registered, select the version and click on the Publish button.

Once published, the status will change from Draft to Published.

5. Create an environment

In this step, simply select the environment template created in the previous version and provide the parameters. This will deploy the last published environment.

6. Register a service template

Follow the same drill as you did for the environment templates to create a Service Template. While creating this, you can mention the environment template that this service will be using as follows

7. Create and publish a version

Unlike Environment, here you will create one more template, that will be the pipeline template. Deployment scripts and methods will vary from application to application and hence it is bound closely to the service.

An example can be seen here.

8. Deploy service

Once the version is ready, deploy it just as you deployed the environment and you are good to go!

So what do I get?

The biggest benefit here is version management. Until now, we had to use an external tool to manage which version is deployed and running in different environments but now Proton takes care of that.

Secondly, it provides a central management dashboard from where you can easily view, manage and upgrade the application and its infrastructure with just a few clicks.

Parting note

AWS has created a service for every step from development to deployment, may it be Cloud9 at the very beginning of your lifecycle to CodePipeline for the final deployment. Proton will fit right in this catalogue.