Tracking license usage on AWS ECS Fargate

You can track the license usage of your IBM® software that is deployed on AWS ECS Fargate.

If you deploy IBM software on AWS ECS Fargate, you can use this solution to track your license usage and remain compliant.

Tracking license usage with License Service on AWS ECS Fargate is only enabled for specific IBM software products. To learn whether your product is enabled check your product's documentation.

Procedure

To track license usage on AWS ECS Fargate complete the following steps.

Note: To complete these steps, you need to use the Task Definition of your product.

  1. Go to the AWS Console.
  2. Configure the S3 bucket to store the license usage data. The name of the bucket must follow the ibm-license-service-<AWS_accountID> pattern. For more information, see Creating a bucket in AWS documentation.
  3. Create the dedicated taskRoleArn. This role is required to permit the logger to access the dedicated S3 storage. For more information, see Creating IAM Roles in AWS documentation.
  4. Create the following IAM policy with read and write access, and define it on the S3 bucket. This policy connects permissions for S3 bucket with previously created taskRoleArn.

    {
     "Version": "2012-10-17",
     "Statement": [
       {
         "Effect": "Allow",
         "Principal": {
           "AWS": "<YOUR_TASK_ROLE_ARN>"
         },
         "Action": [
           "s3:PutObject",
           "s3:GetObject"
         ],
         "Resource": "arn:aws:s3:::<AWS_S3_BUCKET_NAME>/*"
       }
     ]
    }
    

    For more information, see IAM JSON policy elements and Adding a bucket policy using the Amazon S3 console in AWS documentation.

  5. Create a new TaskDefinition, or expand or create a new version of an existing TaskDefinition by using the TaskDefinition of your product. For more information, see Creating TaskDefinition in AWS documentation.

  6. In the TaskDefinition:

    1. Check the product’s dockerLabels section in your product's TaskDefinition. The product name, metric and other metadata should fit the entitlement that you purchased.
    2. Provide the name of the S3 bucket that you configured in step 2 through the AWS_S3_BUCKET_NAME environment variable. This bucket will store the licensing information.
    3. Provide the taskRoleArn that you created in step 3.
    4. Fill in any other fields that are relevant from AWS or your perspective.

      Note: You can additionally configure the following parameters:

      • Logs. For more information, see LogConfiguration in AWS documentation.
      • By default, the logger connects to the S3 bucket via HTTPS. If you need to change this setting because of your SecurityGroup configuration, you can change the value of AWS_S3_HTTPS_ENABLED to false.
  7. Create the Task. For more information, see Task management in the new Amazon ECS console and Service management in the new Amazon ECS console in AWS documentation.

  8. Check the health status of IBM License Usage Logger inside the Task that you created in AWS console. The status should say Healthy. For more information, see HealthCheck in AWS documentation.

Checking license usage

The license usage information is stored in the IBM-License-usage directory on the S3 bucket that you defined during the configuration. The data is refreshed every 5 minutes, starting at the top of the hour.

An example of the folder structure on the S3 bucket:

  IBM-License-usage                                   <- root folder name
    2022-05-04                                        <- folder - day for which the data was gathered in YYYY-MM-DD format
        product-<productID>                           <- folder with the data for the product with the provided product id for which the data was gathered
            task-<taskID>.csv                         <- file with task instance details
            task-<taskID>.csv                         <- file with task instance details
        product-...                                   <- folder with the data for another product
            task-...                                  <- another task instance details
    2022-05-05                                        <- folder with the data for another day

Sample output for sample task-.csv file:

Timestamp,                  CloudpakName,                   CloudpakId,                       CloudpakMetric,  ProductCloudpakRatio, ProductName,                        ProductId,                         ProductMetric,           vCPU,   ClusterId,                                                LoggerVersion
2022-05-06 14:00:00,        IBM WebSphere Hybrid Edition,   6358611af04743f99f42dadcd6e39d52, ,                4:1,                  IBM WebSphere Application Server,   63a2a4dfc91f4485994c7aab94c55ab1,  VIRTUAL_PROCESSOR_CORE,  0.25,   arn:aws:ecs:eu-central-1:675801125365:cluster/lmatyasik,  1.0
2022-04-06 14:05:00,        IBM WebSphere Hybrid Edition,   6358611af04743f99f42dadcd6e39d52, ,                4:1,                  IBM WebSphere Application Server,   63a2a4dfc91f4485994c7aab94c55ab1,  VIRTUAL_PROCESSOR_CORE,  0.25,   arn:aws:ecs:eu-central-1:675801125365:cluster/lmatyasik,  1.0

To find the highest license usage, first you need to find the highest daily usage. To do that, calculate the sum for the product, or IBM Cloud Pak® with a given metric that is deployed on the specific cluster for each timestamp from all available task-<taskID>.csv files. Once you identify the highest license usage for each day, compare the values and find the highest license usage in the period.

To simplify getting the daily aggregated values, you can use the open-source license usage aggregator for Fargate. This open-source tool is not required for compliance purposes. For more information, see License usage aggregator for Fargate in GitHub.