Triage and Remediation
Remediation
Using Console
Using Console
Here are the step-by-step instructions to remediate the “EC2 Reserved Instances Recent Purchases Should Be Reviewed” misconfiguration in AWS using the AWS console:
- Login to your AWS account and go to the AWS EC2 console.
- Click on the “Reserved Instances” link in the left-hand navigation menu.
- Review the list of recently purchased reserved instances to identify any that were purchased in error or are no longer needed.
- Select the reserved instances that need to be modified or cancelled.
- Click on the “Actions” button and select “Modify Reserved Instances” or “Cancel Reserved Instances” depending on the action you want to take.
- Follow the prompts to modify or cancel the selected reserved instances.
- After making the necessary changes, review the list of reserved instances again to ensure that all recent purchases have been reviewed and remediated.
Using CLI
Using CLI
The EC2 Reserved Instances Recent Purchases Should Be Reviewed misconfiguration can be remediated in AWS using the following steps:Note: Replace Note: Replace This should remediate the EC2 Reserved Instances Recent Purchases Should Be Reviewed misconfiguration in AWS.
- Open the AWS CLI on your local machine.
- Run the following command to list all active Reserved Instances:
- Review the output of the above command and identify any recently purchased Reserved Instances that are not being utilized.
- Run the following command to modify or cancel the unused Reserved Instances:
<ID>
with the Reserved Instance ID and <COUNT>
with the desired instance count. <OFFERING_ID>
can be obtained from the Reserved Instance description.- Alternatively, to cancel the unused Reserved Instances, run the following command:
<ID>
with the Reserved Instance Listing ID.- Repeat step 4 and 5 for all unused Reserved Instances.
- Finally, run the following command to verify that all unused Reserved Instances have been modified or cancelled:
Using Python
Using Python
The misconfiguration “EC2 Reserved Instances Recent Purchases Should Be Reviewed” typically refers to a situation where an AWS account has recently purchased EC2 Reserved Instances, but they are not being fully utilized. To remediate this, you can use the following steps:By following these steps, you can identify and remediate underutilized EC2 Reserved Instances in your AWS account using Python and the boto3 SDK.
- Identify the underutilized EC2 Reserved Instances using the AWS SDK for Python (boto3) by calling the
describe_reserved_instances()
method of the EC2 client object. This method returns information about the specified Reserved Instances, including the number of instances that are currently in use.
- Filter the results to only include Reserved Instances that are not being fully utilized. You can do this by comparing the
InstanceCount
attribute to theInstanceCount
attribute of theState
object for each Reserved Instance.
- Review the list of underutilized EC2 Reserved Instances and take appropriate action. This could include modifying the instance type or family to better match your workload, or selling the underutilized Reserved Instances on the Reserved Instance Marketplace.