aboutsummaryrefslogtreecommitdiffstats
path: root/terraform/iam.tf
diff options
context:
space:
mode:
Diffstat (limited to 'terraform/iam.tf')
-rw-r--r--terraform/iam.tf28
1 files changed, 28 insertions, 0 deletions
diff --git a/terraform/iam.tf b/terraform/iam.tf
new file mode 100644
index 0000000..0286993
--- /dev/null
+++ b/terraform/iam.tf
@@ -0,0 +1,28 @@
+resource "aws_iam_role" "sensyne_demo_cluster" {
+ name = "sensyne_demo_eks_cluster"
+
+ assume_role_policy = <<POLICY
+{
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Principal": {
+ "Service": "eks.amazonaws.com"
+ },
+ "Action": "sts:AssumeRole"
+ }
+ ]
+}
+POLICY
+}
+
+resource "aws_iam_role_policy_attachment" "demo_cluster_AmazonEKSClusterPolicy" {
+ policy_arn = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy"
+ role = "${aws_iam_role.sensyne_demo_cluster.name}"
+}
+
+resource "aws_iam_role_policy_attachment" "demo_cluster_AmazonEKSServicePolicy" {
+ policy_arn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy"
+ role = "${aws_iam_role.sensyne_demo_cluster.name}"
+}