Automate AMI Subscription Monitoring to Cut AWS Marketplace Costs

Automate AMI Subscription Monitoring to Cut AWS Marketplace Costs

Managing Amazon Machine Image (AMI) subscriptions in AWS Marketplace can be complex, especially with frequent changes in Amazon Elastic Compute Cloud (EC2) instance types. Without an automated system, organizations may face unexpected costs from on-demand licenses when agreements are not updated.

This guide outlines how to create an automated monitoring solution for AWS Marketplace AMIs. By utilizing Amazon EventBridge, AWS Lambda, and Amazon Simple Email Service (SES), organizations can track EC2 instance type changes and receive alerts when subscription amendments are necessary, potentially reducing costs by up to 72%.

Prerequisites

Before implementing this solution, ensure that the necessary prerequisites are in place.

How the Solution Works

The solution captures real-time EC2 instance modifications. When an EC2 instance is stopped, AWS Lambda records its state, including instance type and AMI license, in Amazon DynamoDB. Any modifications to the instance type are captured by EventBridge, which triggers Lambda to compare the new configuration with the stored state. If an amendment is required, a notification is sent via Amazon SES, detailing the instance and providing a direct link for amending the agreement.

Architecture Overview

The architecture consists of a hub-and-spoke model:

  • Hub Account: Integrates EventBridge, Lambda, DynamoDB, and Amazon SES.
  • Spoke Accounts: Require only EventBridge rules to forward EC2 lifecycle events to the hub account's event bus.

Configuration Notes

The Lambda function can be configured with a SkipAgreementVerification parameter. Setting this to true allows notifications for all EC2 instance type changes on instances with AWS Marketplace AMI annual subscriptions, enhancing monitoring across all instances.

Deployment Steps

To deploy the hub account resources, follow these steps:

  1. Use AWS CloudFormation templates to set up the hub account.
  2. Validate the Amazon SES email address for notifications.
  3. Deploy spoke account resources in each AWS account to be monitored.

Each email notification will include details about the instance change, such as instance ID, previous and new instance types, and the associated AMI subscription that may require amendment.

Benefits of Automation

This automated monitoring solution provides several advantages:

  • Cost control by maintaining oversight of AMI subscriptions.
  • Reduced manual effort in monitoring and managing subscriptions.
  • Enhanced visibility into license usage and compliance.

Next Steps

After deploying the solution, it is crucial to simulate an EC2 instance type change to verify its functionality. To avoid incurring charges, organizations should delete the CloudFormation stack and resources when no longer needed.

This approach empowers organizations to optimize their AWS Marketplace AMI subscriptions and maximize the value of their license investments.

This editorial summary reflects AWS and other public reporting on Automate AMI Subscription Monitoring to Cut AWS Marketplace Costs.

Reviewed by WTGuru editorial team.