Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes for EC2 instances, making it possible to run your applications with persistent block volumes that offer 99.999% availability.
AWS provides SSDs and HDDs for volumes: General Purpose SSD volumes, Provisioned IOPS SSD volumes, Throughput Optimized HDD volumes, Cold HDD volumes. Learn more through the documentation: Amazon EBS volume types
Create an IAM Policy that only allows users to initialize EC2 with EBS volume: gp3
IAM
EC2_InstanceTypeRestrict
, Select EC2_InstanceTypeRestrict{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:*",
"Resource": "*"
},
{
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:*:148922931563:volume/*",
"Condition": {
"StringNotLike": {
"ec2:VolumeType": "gp3"
}
}
},
{
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:*:148922931563:instance/*",
"Condition": {
"StringNotLike": {
"ec2:VolumeType": "gp3",
"ec2:InstanceType": [
"t3.small",
"t3.large"
]
}
}
}
]
}
Select Save changes
Check Permissions policies for Instance Type: t3.small and EBS volume gp3
EC2
In the Name section, enter EC2_t3.small_gp3
In the Architecture section, keep the value 64-bit (x86)
In the Instance type section, select the triangle symbol, enter t3.small
In the key pair name section, select the triangle symbol, select Proceed without a key pair (Not recommended)
Select Storage, select volume ID
Check Permissions policies for Instance Type: t3.small and EBS volume gp2
EC2
In the Name section, enter EC2_t3.small_gp2
In the Architecture section, keep the value 64-bit (x86)
In the Instance type section, select the triangle symbol, enter t3.small
In the key pair name section, select the triangle symbol, select Proceed without a key pair (Not recommended)
In the Configure storage section, select the triangle symbol, select gp2
Select launch instance
Noted: you can see the IOPS is 100/3000
You can proceed to step 3 again, creating EC2 with instance type t3.small and EBS volume: io1, io2. To check the effectiveness of permission policy: EC2_InstanceTypeRestrict