Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
wardviaene committed Jul 31, 2018
1 parent 0ade778 commit b80ec25
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions eks-demo/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,29 @@ resource "aws_iam_role_policy_attachment" "demo-cluster-AmazonEKSServicePolicy"
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy"
role = "${aws_iam_role.demo-cluster.name}"
}

# If no loadbalancer was ever created in this region, then this following role is necessary
resource "aws_iam_role_policy" "demo-cluster-service-linked-role" {
name = "service-linked-role"
role = "${aws_iam_role.demo-cluster.name}"

policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iam:CreateServiceLinkedRole",
"Resource": "arn:aws:iam::*:role/aws-service-role/*"
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeAccountAttributes"
],
"Resource": "*"
}
]
}
EOF
}

0 comments on commit b80ec25

Please sign in to comment.