Skip to content

Instantly share code, notes, and snippets.

@kuronekomichael
Created February 19, 2017 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kuronekomichael/dce17380c6c376ffcdf3efdedaf1478b to your computer and use it in GitHub Desktop.
Save kuronekomichael/dce17380c6c376ffcdf3efdedaf1478b to your computer and use it in GitHub Desktop.
(社内勉強会用)EC2にフルアクセスできるんだけど、起動できるEC2インスタンスは t2.micro だけに限るというポリシー
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "ec2:*",
"Effect": "Allow",
"Resource": "*"
},
{
"Effect": "Deny",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:*:*:instance/*"
],
"Condition": {
"StringNotEquals": {
"ec2:InstanceType": [
"t2.micro"
]
}
}
},
{
"Effect": "Allow",
"Action": "ec2:RunInstances",
"Resource": [
"arn:aws:ec2:region::image/ami-*",
"arn:aws:ec2:region:account:network-interface/*",
"arn:aws:ec2:region:account:instance/*",
"arn:aws:ec2:region:account:subnet/*",
"arn:aws:ec2:region:account:volume/*",
"arn:aws:ec2:region:account:key-pair/*",
"arn:aws:ec2:region:account:security-group/*"
]
},
{
"Effect": "Allow",
"Action": "elasticloadbalancing:*",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "cloudwatch:*",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "autoscaling:*",
"Resource": "*"
}
]
}
@kuronekomichael
Copy link
Author

ポリシーAPN: arn:aws:iam::400744529344:policy/AmazonEC2FullAccess-t2micro-only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment