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 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南