AMI-Based Approach For Product Delivery on AWS Marketplace

AMI-Based Delivery AWS Marketplace

The AWS Marketplace has changed the way that software is managed and deployed. A vital component of the platform is the method of deployment that has made AWS Marketplace a huge success. This game-changing method of deployment is with Amazon Machine Image (AMI) set-up that addresses the problems posed by the traditional software installation methods.

The Marketplace has simplified the search and installation process for enterprise software, making AMI-based deployment the preferred approach for the users. An AMI (Amazon Machine Image) is a master image that contains the information required to launch virtual servers (or instances) in the cloud. AMI deployment makes the process seamless and faster than traditional software installations.

This blog post elucidates the process for AWS Marketplace sellers to list AMI-based products made out of AWS CloudFormation templates. You can use the templates to define a cluster or distributed architecture for the products or to select different AMI combinations or product configurations. The AWS CloudFormation templates can be configured to deliver single or multiple AMIs along with the associated config files and Lambda functions. For this article, we focus on providing a solution using a single AMI. Buyers can browse the selection of solutions on AWS Marketplace, buy with one click, and deploy with AWS CloudFormation templates.

Why use AMI-based delivery to sell products on the marketplace?

AMI-based delivery approach provides faster set-up as it doesn’t require manual installation or additional hardware, making the configuration process simpler. Other methods, such as Sagemaker, do not allow usage of other Amazon Web services and product bundling. Therefore, to overcome this hurdle, we use the AMI- based approach, which does not restrict any outbound calls to other Amazon Web Services as long as the custom IAM (Identity and Access Management) role has all the necessary policies to access the services.

The steps for AMI-based delivery using AWS CloudFormation are:

  • 1. Production-ready code
  • 2. EC2 (Elastic compute) instance setup for AMI creation
  • 3. Deployment and demo testing
  • 4. AMI creation from the deployed EC2 instance
  • 5. CloudFormation template creation and AMI testing
  • 6. Creation of topology diagrams
  • 7. Estimation of software and infrastructure pricing
  • 8. Completed product form (Commercial Product Form)
  • 9. Submitting product request

1. Production-ready code

This step involves developing the entire solution and packaging the code in a manner that makes the deployment easy. This solution was dockerized and ready to be tested before being shipped as an AMI. The services used for this use case were Amazon Textract, Amazon S3, Amazon EC2, Amazon CloudFormation, and Amazon VPC.

2. EC2 instance setup for AMI creation

As we previously packaged our code to be used, in this step we orchestrate the infrastructure necessary to deploy the code and activate it. First, we

  • Select an Ubuntu AMI (v20.04) to start with, then
  • Select an EC2 instance of the type, t2.micro (1 vCPUs, 1 GiB Memory) or t2.medium(2 vCPUs, 4 GiB Memory) suitable for your particular use case,
  • Furthermore, under Configure Instance Details enable Auto-assign public-ip, so that an endpoint for the application can be formed later. In addition, add an EBS (Elastic Block Store) volume according to your use case, optionally tags can be added, and
  • Finally, attach a security group with an HTTP inbound rule on port 80 to allow traffic to your web app. Now, we can review our configurations and launch the instance.

3. Deployment and demo testing

We manually enter the instance using AWS Session Manager and follow the below-mentioned steps:

  • Delete all the directories and codes present in the new instance except the image that is built using docker.
  • Spin up a new container from the docker image of your solution. Command: docker run -p 5000:5000 -d “image-tag-value”.
  • Finally, we test the API using the endpoint.

Eg: http://dummy_elastic_ip:port_number/path/to/the/route
We debug errors, if any, and move to the next step.
Example: http://dummy_elastic_ip:port_number/path/to/the/route

4. AMI creation from the deployed EC2 instance

Now, we terminate the session manager tab and stop the instance. We also create an AMI out of the selected instance.

5. CloudFormation template creation and AMI testing

We use YAML for creating and configuring AWS resources. To make the creation of CFT’s easy, we need to create product architecture. This architecture helps to map the understanding in the real world.

Finally, after the creation of all the resources, we test the solution endpoint, patch if new issues arise, and repeat steps 5 through 6.

Resources created through the CloudFormation Template:

  • AWS EC2 Instance
  • AWS Elastic IP
  • AWS Virtual Private Cloud (VPC)
  • Public Subnets
  • Endpoints
  • AWS IAM Roles; Custom Role for EC2 instance with all the necessary policies
  • IAM Instance Profile

As CFT deployments can be tricky, they require necessary permissions, especially when working with IAM role creation.

One requires access to a role that has IAM role creation policies attached to it. If the IAM role is not specified, the role which we use to login into the account is assumed for CFT creation.

Permissions to choose IAM Role for CFT Creation

The steps to consider before moving ahead with the submission are:

  • Store the Cloudformation template in a public S3 bucket so that the template URL can be shared with the AWS team.
  • Make the solution AMI public.

6. Creation of topology diagrams

AWS topology diagrams are used to describe the design, security, and deployment of applications built on the AWS cloud. The AWS marketplace solution requires a topology diagram to be submitted during the solution review.

Topology Diagram

7. Estimation of software and infrastructure pricing

The submission requires an estimated infrastructure price for the default configuration of each template.

8. Completed product form

For single-AMI products, use the Commercial Product form. This is an extensive excel document that needs to be completed and attached to the final submission.

9. Submitting product request

Use the AWS Marketplace Management Portal to submit the product, and allow three to five weeks for request processing, including:

  • Review of AWS CFTs, AMI, and metadata for the AMI and AWS CloudFormation template.
  • Publication of AWS CFT to AWS Marketplace products.

Bonus debugging tip:
Silent issues, which do not throw an explicit error, can be discovered by navigating to the /home/ubuntu/var/log folder and searching through the files present there.

The AWS Marketplace makes software purchase and installation quicker and seamless while offering flexible licensing options and transparency in usage costs. AWS Marketplace can be used to showcase snippets of larger product offerings or list a fully functional product to cater to the consumer needs.

As an AWS Advanced Consulting partner, Quantiphi leverages AWS data and machine learning platforms to enable organizations embark on a data and AI-led digital transformation journey, and harness their true potential through cross-functional collaboration of teams. Get in touch with us to learn more.

Written byquantiphi

Get your digital transformation started

Let's Talk