如何限制用户创建大小大于20GB的EBS卷?策略中是否有可用的策略条件键?
您可以使用 Numeric Condition Operators 反对 ec2:VolumeSize 条件。以下操作将EBS卷的创建限制为20GB或更低:
ec2:VolumeSize
{ "Version" : "2012-10-17", "Statement" : [ { "Sid": "EC2CreateVolume", "Effect": "Allow", "Action": "ec2:CreateVolume", "Resource": "*", "Condition": { "NumericLessThanEquals": { "ec2:VolumeSize": "20" } } } ] }