AWS Cloud Operations & Migrations Blog

Mechanisms to govern license usage with AWS License Manager

AWS License Manager streamlines the process of bringing software vendor licenses to the cloud. As you build your applications in AWS that use third party licenses or move your on-premises workloads to AWS, you can save costs by using bring-your-own-license (BYOL) opportunities. This can be done by re-purposing your existing license inventory for use with cloud resources. This blog describes how to use AWS License Manager to govern the license usage.

The first step for governing license usage is to create License configurations in AWS License Manager.  License configuration is a set of licensing rules based on the terms of your enterprise agreements and represents the licensing terms with your software vendor. Your license configuration specifies how your licenses are counted (for example, by vCPUs, Cores, Sockets or number of instances). It also specifies limits on your usage, so that you can prevent usage from going over the number of allocated licenses. Additionally, it can also specify other constraints on your licenses, such as the tenancy type.

You can prevent license usage when the available licenses are exhausted by selecting the “Enforce license limit” option in license configuration. When this limit exceeds, the instance launch is blocked to control overages. For example, 16vCPUs limit is chosen in the launch configuration used in this blog.

The next step is to attach the license configuration to any of the following mechanisms that you use to launch EC2 instances:

  • Amazon Machine Image (AMI)
  • EC2 Launch Template
  • AWS CloudFormation
  • AWS Service Catalog
  • Software acquired from AWS Marketplace.

Let’s look at how to govern license usage with each of the above mechanisms.

Amazon Machine Image

An Amazon Machine Image (AMI) provides the information required to launch an instance. You can launch multiple instances from a single AMI when you need multiple instances with the same configuration. In AWS License Manager, you can associate AMIs with a license configuration to track licenses usage. This association will track the new Amazon EC2 instances that are created from those AMIs.

Or, you can manually associate running environments with a license configuration.

EC2 Launch Template

EC2 Launch Template is used to create a saved EC2 instance configuration that can be reused or shared for future launches. Let’s create a new launch template from EC2 console as below.

On the Launch Templates screen, select “Create launch template” option.

Provide the required details, select the corresponding license configuration in the advanced details section as shown below, and create the launch template.

The launch template has been successfully created. Now let’s launch a new EC2 instance from this launch template. This example uses t2.medium instance type, which has 2 vCPUs.

SQL license consumption can now be monitored in the AWS License Manager launch configuration.

AWS CloudFormation

AWS CloudFormation helps customers implement Infrastructure as Code. AWS CloudFormation provisions your application resources in a safe, repeatable manner, allowing you to build and rebuild your infrastructure and applications, without having to perform manual actions or write custom scripts.

Let’s see how to use CloudFormation Templates to set up license tracking. First, let’s create a new stack, which defines resources to be deployed as a single unit.

 

 

You can choose to select an existing template or a sample template, or you can create a new template. In the template, under the EC2 Resource section, use the parameter “LicenseSpecifications”. This parameter is used to pass “LicenseConfigurationArn” value that is associated with EC2.

Notice the license specifications element in the template code. This enables us to specify which license configuration to use for this resource when creating a stack. Create the stack by configuring stack options, including tags, permissions and other advanced options. This example uses t2.medium instance type which has 2 vCPUs After a few minutes, you can refresh the events list to ensure that the stack deployment has succeeded.

Let’s return to the AWS License Manager. Notice the additional license consumption of the new t2.medium instance that has 2 vCPUs.

AWS Service Catalog

AWS Service Catalog allows organizations to create and manage catalogs of IT services that are approved for use on AWS. These IT services can include everything from virtual machine images, servers, software, and databases to complete multi-tier application architectures.

You can also configure products in the AWS Service Catalog to track license consumption. Let’s create a new product to see how this works. Select create product option from the AWS Service Catalog console and enter some basic details about the product and proceed through the wizard. You can include an AWS CloudFormation Template file that defines this product. This template file can include the code used in the above AWS CloudFormation section where you can input license configuration details. Give this version a title and complete the product creation.

Once the product has been successfully created, you can choose to make this product available as a portfolio to end users. Whenever this product is used, license consumption is recorded.

AWS Marketplace

AWS Marketplace is a digital catalog with thousands of software listings from independent software vendors that make it easy to find, test, buy, and deploy software that runs on AWS. AWS Marketplace also facilitates using your own licenses by providing a separate bring your own license AMI.

Let’s see how to track bring your own license usage while using AWS Marketplace products. For example, Let’s search for a BYOL supported Palo Alto product in AWS Marketplace.

The delivery method for this product is Amazon Machine Image. To use this product, you can subscribe to the product once subscribed you will be able to use the AWS Marketplace software by using the AMI. Since this is a BYOL product, to track the license consumption, follow the below steps below:

  1. Create a license configuration in AWS License Manager with appropriate license type (vCPU or instance) based on license agreement with the vendor.
  2. Then create EC2 Launch template with the AWS Marketplace AMI and attach the license configuration to the launch template as discussed in the above EC2 Launch Template section.

These are the different ways to govern license consumption in AWS. With any of these mechanisms, AWS License Manager tracks any violation of the licensing limits specified in the license configuration to control license usage and prevent the launch of a new, non-compliant instance. These limits get evaluated during instance launches or while attaching licensing rules to existing instances. When license usage exceeds soft limits that you do not want to enforce, AWS License Manager sends notifications to license administrators and end users with Amazon Simple Notification Service. Notifications are sent as emails, text messages or alerts to inform them that an instance is non-compliant.

For example, the license configuration “Windows SQL 2016 Server” currently has 4 of 16 vCPUs consumed. Now let us launch a new c4.4xlarge instance using the launch template “SQL2016_LaunchTemplate” as discussed in the above EC2 Launch Template section.

A c4.4xlarge instance has 16 vCPUs. This results in exceeding the total 16 vCPU limit in the license configuration. This can be tracked in the AWS License Manager dashboard as below,

For the license configurations with an enforced hard limit, AWS License Manager blocks new instances from being launched using AWS License Manager’s built-in integration with EC2 and sends an alert to end users and license administrators.

Conclusion

Using AWS License Manager, you can track and govern the license usage throughout the lifecycle of an instance. When an instance is stopped or terminated, that BYOL license is released and is available for re-use.

Watch this video to see a demonstration of using AWS License Manager for enforcing license rules while launching new instances using Amazon Machine Images, EC2 Launch Templates, AWS CloudFormation Templates, AWS Service Catalog, or software acquired from AWS Marketplace. To learn more about how to manage licenses using AWS License Manager, check out the documentation.

About the Author

Harshitha Putta is a Cloud Infrastructure Architect with AWS Professional Services in Seattle, WA. She is passionate about building innovative solutions using AWS services to help customers achieve their business objectives. She enjoys spending time with family and friends, playing board games and hiking.