限制 EBS 卷创建超过阈值的 IAM 策略
IAM policy to restrict EBS volume creation above threshold
如何限制用户创建大于 20 GB 的 EBS 卷?策略中是否有任何可用的策略条件键?
您可以针对 ec2:VolumeSize
条件使用 Numeric Condition Operators 之一。以下内容会将 EBS 卷的创建限制为 20GB 或更小:
{
"Version" : "2012-10-17",
"Statement" : [
{
"Sid": "EC2CreateVolume",
"Effect": "Allow",
"Action": "ec2:CreateVolume",
"Resource": "*",
"Condition": {
"NumericLessThanEquals": {
"ec2:VolumeSize": "20"
}
}
}
]
}
如何限制用户创建大于 20 GB 的 EBS 卷?策略中是否有任何可用的策略条件键?
您可以针对 ec2:VolumeSize
条件使用 Numeric Condition Operators 之一。以下内容会将 EBS 卷的创建限制为 20GB 或更小:
{
"Version" : "2012-10-17",
"Statement" : [
{
"Sid": "EC2CreateVolume",
"Effect": "Allow",
"Action": "ec2:CreateVolume",
"Resource": "*",
"Condition": {
"NumericLessThanEquals": {
"ec2:VolumeSize": "20"
}
}
}
]
}