Migrate EBS Volumes from gp2 to gp3

What It Does

Migrates Amazon EBS volumes from gp2 to gp3. The gp3 volumes offer better price-performance compared to gp2, allowing cost savings without compromising performance. This migration is performed safely with snapshot backup and volume modification.

Risk and Scope

Detail
Value

Risk Level

Low

AWS Service Targeted

EC2 / EBS

Permissions Required

Optimization Policies Addressed

This runbook remediates violation tickets triggered by of the following policy:

Policy ID
Policy Name

ebs_1

General purpose EBS volumes should be of gp3 volume type

Risk Mitigation

Risk Mitigation Strategy

How to Install

Refer to the Runbook Setup Guide for steps to install and enable this runbook in your environment.

Runbook Workflow

Step 1: Start

Trigger: Begins the workflow to migrate EBS volumes from gp2 to gp3.

Step 2: DescribeVolumes

Action: Executes DescribeVolumes on EC2 to gather details of all volumes.

Step 3: setIOPS

Action: Runs a script to determine the appropriate IOPS value for the gp3 volume.

Step 4: If/Else

Condition: Determines whether the volume type is gp2.

  1. If the volume is gp2, proceeds with the migration steps:

    1. SnapshotVolume Executes CreateSnapshot on EC2 to create a backup of the volume.

    2. WaitForSnapshotCompletion Executes DescribeSnapshots to ensure the snapshot has completed.

    3. ModifyVolume Executes ModifyVolume on EC2 to convert the volume type to gp3 with the specified IOPS.

  2. Else: Terminates the runbook as the volume is not gp2.

See How it Works

Triggering the Runbook

To run this workflow:

1. Locate the Ticket

Identify the ticket associated with the above mentioned policy violation.

2. Execute the Runbook

Follow the steps described in the executing a runbook section to apply this runbook to the ticket.

Last updated