0

How can I restrict users to create EBS volume with a size greater than 20 GB? Is there any available policy condition keys to in a policy?

Manoj Acharya
  • 1,331
  • 2
  • 15
  • 27

1 Answers1

1

You can use one of the Numeric Condition Operators against the ec2:VolumeSize condition. The following would restrict creation of an EBS volume to one of 20GB or less:

{
    "Version" : "2012-10-17",
    "Statement" : [
        {
            "Sid": "EC2CreateVolume",
            "Effect": "Allow",
            "Action": "ec2:CreateVolume",
            "Resource": "*",
            "Condition": {
                "NumericLessThanEquals": {
                    "ec2:VolumeSize": "20"
                }
            }
        }
    ]
}
ptierno
  • 9,534
  • 2
  • 23
  • 35