2 Answers
- Newest
- Most votes
- Most comments
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:
answered 7 months ago
1
You can also consult the following https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharingamis-intro.html#block-public-access-to-amis
answered 7 months ago
Relevant content
- asked 5 months ago
- asked 10 months ago
- asked 10 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 6 months ago