IAM to prevent launching Public AMIs

0

Is there any IAM Permission that can prevent launching any Public AMIs. I want my user to launch only Private AMIs. Is there any other mechanism in EC2?

已提问 8 个月前214 查看次数
2 回答
2
已接受的回答

You can leverage Condition operator in IAM JSON policy elements Eg. Boolean conditions enable the creation of Condition elements that limit access by comparing a key to either "true" or "false."

{
            "Sid": "DenyLaunchingPublicAMI",
            "Effect": "Deny",
            "Action": "ec2:RunInstances",
            "Resource": "arn:aws:ec2:<region>::image/ami-*",
            "Condition": {
                "Bool": {
                    "ec2:Public": "true"
                }
 }

Document:

已回答 8 个月前
profile picture
专家
已审核 8 个月前
1
AWS
已回答 7 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则