Skip to content

Instantly share code, notes, and snippets.

@krotkiewicz
Created July 25, 2017 17: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 krotkiewicz/4dcbda7a63dc6bfd66ae53d059139a59 to your computer and use it in GitHub Desktop.
Save krotkiewicz/4dcbda7a63dc6bfd66ae53d059139a59 to your computer and use it in GitHub Desktop.
resource "aws_iam_role" "role" {
name = "rabbitmq"
assume_role_policy = "${data.aws_iam_policy_document.policy_doc.json}"
}
resource "aws_iam_role_policy" "policy" {
name = "rabbitmq"
role = "${aws_iam_role.role.id}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingInstances",
"ec2:DescribeInstances"
],
"Resource": [
"*"
]
}
]
}
EOF
}
resource "aws_iam_instance_profile" "profile" {
name = "rabbitmq"
role = "${aws_iam_role.role.name}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment