Skip to content

Instantly share code, notes, and snippets.

@chalfant
Last active December 21, 2015 19:39
Show Gist options
  • Save chalfant/6356150 to your computer and use it in GitHub Desktop.
Save chalfant/6356150 to your computer and use it in GitHub Desktop.
IAM Role, Policy and Instance Profile for Keyless Entry
"InstanceRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [ {
"Effect": "Allow",
"Principal": {
"Service": [ "ec2.amazonaws.com" ]
},
"Action": [ "sts:AssumeRole" ]
} ]
},
"Path": "/"
}
},
"InstancePolicies": {
"Type": "AWS::IAM::Policy",
"Properties": {
"PolicyName": "root",
"PolicyDocument": {
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeTags"
],
"Resource":"*"
}
]
},
"Roles": [ { "Ref": "InstanceRole" } ]
}
},
"RootInstanceProfile": {
"Type": "AWS::IAM::InstanceProfile",
"Properties": {
"Path": "/",
"Roles": [ { "Ref": "InstanceRole" } ]
}
},
"IamInstanceProfile": { "Ref": "RootInstanceProfile" },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment