Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
Create policy for cluster autoscaler and attach it
Browse files Browse the repository at this point in the history
Follows-up #600
  • Loading branch information
Krenair committed Oct 4, 2019
1 parent 2d693ba commit 034063d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/gsp-cluster/cluster-autoscaler.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ data "aws_iam_policy_document" "cluster_autoscaler_policy" {
resources = ["*"]
}
}

resource "aws_iam_policy" "cluster-autoscaler" {
name = "${var.cluster_name}-cluster-autoscaler"
description = "Policy for the cluster autoscaler"
policy = "${data.aws_iam_policy_document.cluster_autoscaler_policy.json}"
}

resource "aws_iam_policy_attachment" "cluster-autoscaler" {
name = "${var.cluster_name}-cluster-autoscaler"
roles = ["${aws_iam_role.cluster_autoscaler.name}"]
policy_arn = "${aws_iam_policy.cluster-autoscaler.arn}"
}

0 comments on commit 034063d

Please sign in to comment.