howech/cfndsl — pull request #28 by josh-wrale (2013-10-04 04:10:47+00:00)
Title: IAM Additions and Small Corrections and/or Improvements

See: docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html

I'm taking a wild guess at things, because I am using cfndsl for a large project. Please let me know your thoughts.

Thanks,
Joshua

Here's an example snippet I tested for this:

```
# Resources

# IAM

# NAT Role
Role( "NATRole" ) {
AssumeRolePolicyDocument( {
"Statement" => [ {
"Effect" => "Allow",
"Principal" => {
"Service" => [ "ec2.amazonaws.com" ]
},
"Action" => [ "sts:AssumeRole" ]
} ]
} )
Path '/'
Policy {
PolicyName "NAT_Takeover"
PolicyDocument( {
"Statement" => [ {
"Effect" => "Allow",
"Action" => [
"ec2:DescribeInstances",
"ec2:DescribeRouteTables",
"ec2:CreateRoute",
"ec2:ReplaceRoute",
"ec2:StartInstances",
"ec2:StopInstances"
],
"Resource" => "*"
} ]
} )
}
}

# NAT Role Profile
InstanceProfile( "NATRoleProfile" ) {
Path "/"
Roles [ Ref( "NATRole" ) ]
}
```