This commit is contained in:
Edward Viaene
2018-07-31 18:14:57 +00:00
parent 0ade7786cd
commit b80ec258ad
+26
View File
@@ -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
}