Skip to content

Instantly share code, notes, and snippets.

@davidwebstar34
Created September 15, 2020 07:32
Show Gist options
  • Save davidwebstar34/eebdc25ad165fdcfb13c5e3940b0bafd to your computer and use it in GitHub Desktop.
Save davidwebstar34/eebdc25ad165fdcfb13c5e3940b0bafd to your computer and use it in GitHub Desktop.
SCP deny AMIs
{
"Version": "2020-06-01",
"Statement": [
{
"Sid": "DenyAMIsExceptFromAccount",
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": "arn:aws:ec2:eu-west-1::image/{ami_id}",
"Condition": {
"StringNotEquals": {
"ec2:Owner": "{imagebuilder_account_id}", "{shared_account_id}"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment