AWS License Consumption Status in CI/CD Pipeline | Exam Preparation

Get the Current License Consumption Status in Jenkins

Prev Question Next Question

Question

You are working in a large corporation, and your team is in charge of the new CI/CD pipeline for a migration project from on-premises to AWS.

The product used a license that limited the number of vCPUs, and it is decided that the same license will be used on the AWS platform.

The software is baked on Amazon AMI and several teams including QA, DEV and Production frequently launch new EC2 instances using the Jenkins pipeline.

Your team manager is worried that the number of servers used is getting too large and asked you to add a step in Jenkins to get the current license consumption status.

What is the best way for you to implement that?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer - D.

This question is related to license usage.

The first service to consider would be AWS License Manager, which streamlines the process of bringing software licenses to AWS.

Check the link on.

https://docs.aws.amazon.com/license-manager/index.html.

Option A is incorrect: This can potentially work; however, the calculation of the number of EC2 instances may be inaccurate since the license relies on vCPUs.

Option D is a better solution.

Option B is incorrect: It is not a straightforward solution since a single CLI command can fetch the information.

Option C is incorrect: Similar reason as Option.

B.Option D is CORRECT: A License Configuration can be created with the license type as vCPU:

The configuration can associate with an AMI, and then usage status is tracked.

Also, refer to.

https://docs.aws.amazon.com/cli/latest/reference/license-manager/list-usage-for-license-configuration.html

for the introduction of CLI list-usage-for-license-configuration.

Policy ARN —_arn:aws:iamn EEE olicy/CodeDeployDemo-EC2-Permissions (2)

Description

Permissions  Policyusage Policy versions += Access Advisor

Access advisor shows the service permissions granted to this user and when those services were last accessed. You can use this information to revise your policies. Learn more

Note: Recent activity usually appears within 4 hours. Data is stored for a maximum of 365 days, depending when your region began supporting this feature. Learn more

Filter: No filter ~

Service Name + Access by Entities Last Accessed ~

‘Amazon $3 s8-admin-access and 1 more 101 days ago

Showing 1 results

Option A: Use a shell script to count the total number of EC2 instances in all teams and compare the number with the limit that the license allows. This option may work but has some limitations. Counting the total number of EC2 instances may not accurately reflect the number of vCPUs used by each instance. Also, if teams launch instances outside the Jenkins pipeline, those instances will not be counted. Therefore, it may not provide an accurate representation of the license consumption status.

Option B: Create a Lambda to keep counting the number of servers and compare with the license limit. This option has some advantages over option A. A Lambda function can be triggered periodically, and it can count the number of vCPUs used by each instance accurately. It can also send alerts when the license limit is reached or exceeded. However, it requires some development work to create the Lambda function, and it may increase the overall cost of the pipeline.

Option C: Use a DynamoDB table to record the usage status of vCPU. Add a Jenkins step to read and write the table to manage the license consumption status. This option is similar to option B but uses a DynamoDB table instead of a Lambda function. A Jenkins step can write the number of vCPUs used by each instance to the DynamoDB table, and another Jenkins step can read the table to determine the license consumption status. This option has some advantages over option B as it does not require any development work to create the Lambda function. However, it may require some additional scripting work to set up the DynamoDB table and manage the table's data.

Option D: Create a License Configuration for this license in AWS License Manager. Call the CLI list-usage-for-license-configuration to get the license consumption status. This option is the most straightforward and recommended approach. AWS License Manager provides a License Configuration feature that allows you to create a license and associate it with an AWS resource, such as EC2 instances. The License Manager also provides a CLI command "list-usage-for-license-configuration" to get the license consumption status. This option requires minimal development and scripting work and provides an accurate representation of the license consumption status.

In conclusion, Option D is the best option as it provides a straightforward and accurate way to manage the license consumption status. It requires minimal development and scripting work and provides an accurate representation of the license consumption status.