[英]Error when using EC2 Instance Connect in the instance was created from Cluster ECS
[英]Restricting access to ECS EC2 instance types using IAM Policies
我有一個關於使用 IAM 策略限制對 AWS 資源的訪問的查詢。 我能夠將 ec2 資源限制為 *. 微, *。 納米,*。 小的, *。 中等的。 然而,當我在 ECS(彈性容器服務)中嘗試同樣的事情時,我什至能夠部署 *. 大, *。 具有相同 IAM 權限集的集群部分中的 xlarge、*.2xlarge 等實例類型。 在 ECS 的 IAM 中,我找不到任何可以限制 ECS-EC2 集群大小的特定方法。 有人可以幫我解決這個問題嗎?
提前致謝。
請在下面找到政策
{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "ecs: ", "ec2: "
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:*:*:instance/*",
"Condition": {
"ForAnyValue:StringNotLike": {
"ec2:InstanceType": [
"*.nano",
"*.micro",
"*.small",
"*.medium"
]
}
}
}
] }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.