Skip to content

Instantly share code, notes, and snippets.

@JohnPreston
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save JohnPreston/a83968b75a2ca75c0c73 to your computer and use it in GitHub Desktop.

Select an option

Save JohnPreston/a83968b75a2ca75c0c73 to your computer and use it in GitHub Desktop.
IAM deny instance type policy
## Eucalyptus Generator ###
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "ec2:RunInstances",
"Conditions": {
"StringNotEquals": {
"ec2:InstanceType": "m1.small"
}
},
"Resource": [
"arn:aws:ec2:::instance/*"
],
"Effect": "Deny"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "ec2:RunInstances",
"Conditions": {
"StringNotEquals": {
"ec2:InstanceType": ["m1.small", "t1.micro"]
}
},
"Resource": [
"arn:aws:ec2:::instance/*"
],
"Effect": "Deny"
}
]
}
## AWS Generator ##
{
"Statement": [
{
"Sid": "Stmt1416324054503",
"Action": [
"ec2:RunInstances"
],
"Effect": "Deny",
"Resource": "arn:aws:ec2:::instance/*",
"Condition": {
"StringEquals": {
"ec2:InstanceType": [
"t1.micro",
"m1.small"
]
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment