Skip to content

Instantly share code, notes, and snippets.

@kmcquade
Created October 19, 2020 15:59
Show Gist options
  • Save kmcquade/2e8f87a82db2d30baa90dfdecba29a3c to your computer and use it in GitHub Desktop.
Save kmcquade/2e8f87a82db2d30baa90dfdecba29a3c to your computer and use it in GitHub Desktop.
image-baking-enforcement-scp.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EnforceApprovedImageOwners",
"Action": [
"ec2:RunInstances"
],
"Effect": "Deny",
"Resource": "arn:aws:ec2:*::image/ami-*",
"Condition": {
"StringNotEquals": {
"ec2:Owner": [
"000000000000", # Approved image baking account
"111111111111", # Any other accounts that you want to allow image baking from
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment