Triage and Remediation
Remediation
Using Console
Using Console
To remediate the misconfiguration of unused reserved instances in AWS, you can follow the below steps:
- Log in to the AWS Management Console.
- Navigate to the EC2 Dashboard.
- Click on the “Reserved Instances” option from the left-hand menu.
- Identify the unused reserved instances that need to be remediated.
- Select the unused reserved instances that you want to modify.
- Click on the “Actions” button and select “Modify Reserved Instances”.
- In the “Modify Reserved Instances” window, select the “Apply to” option and choose the instances that you want to apply the reserved instances to.
- Click on the “Add to queue” button to add the modification to the queue.
- Review the changes and click on the “Modify Reserved Instances” button to apply the changes.
Using CLI
Using CLI
To remediate the issue of unused reserved instances in AWS using AWS CLI, follow these steps:
-
Identify the unused reserved instances by running the following command:
This command will list all the reserved instances that are in active state but not being used.
-
Once you have identified the unused reserved instances, you can either modify or delete them.
To modify the unused reserved instances, you can change the instance type or the availability zone to match your current usage. To modify a reserved instance, run the following command:
Replace
<reservation-id>
with the ID of the unused reserved instance,<new-count>
with the number of instances you want to reserve,<new-type>
with the instance type you want to reserve, and<new-zone>
with the availability zone you want to reserve the instance in. To delete the unused reserved instances, run the following command:Replace<reservation-id>
with the ID of the unused reserved instance you want to delete. - Verify that the unused reserved instances have been modified or deleted by running the command in step 1 again.
Using Python
Using Python
To remediate the misconfiguration “Reserved Instances Should Not Be Unused” in AWS using python, follow these steps:By following these steps, you can remediate the misconfiguration “Reserved Instances Should Not Be Unused” in AWS using python.
- Identify the unused reserved instances in your AWS account. You can do this by using the AWS SDK for Python (boto3) to list all your reserved instances and their utilization status.
- Once you have identified the unused reserved instances, you can either sell them on the AWS Reserved Instance Marketplace or exchange them for other instances that you need. To sell the unused reserved instances, you can use the AWS SDK for Python (boto3) to create a listing on the AWS Reserved Instance Marketplace.
- If you want to exchange the unused reserved instances for other instances, you can use the AWS SDK for Python (boto3) to modify the reserved instances.