How do you convert all gp2 volumes in a region to gp3?
IntermediateProductionRapid-Fire AWS CLI
Answer
for v in $(aws ec2 describe-volumes --filters Name=volume-type,Values=gp2 \
--query 'Volumes[].VolumeId' --output text); do
aws ec2 modify-volume --volume-id "$v" --volume-type gp3
done
aws ec2 describe-volumes-modifications --query 'VolumesModifications[].[VolumeId,ModificationState,Progress]' --output table
The change is online. Check large gp2 volumes first: their baseline IOPS (3 per GB) may exceed gp3's 3,000 default, so set --iops to match.
More on Rapid-Fire AWS CLI
How do you check which identity and account the CLI is using?BeginnerHow do you log in with Identity Center (SSO) from the CLI?BeginnerHow do you assume a role manually and export the credentials?IntermediateHow do you list running instances with name, ID, type and private IP in a table?BeginnerHow do you find the latest Amazon Linux 2023 AMI without hard-coding an ID?BeginnerHow do you open a shell or port-forward to a private instance without SSH?Beginner