mirror of
https://github.com/farcasclaudiu/terraform-course.git
synced 2026-06-28 17:02:05 +03:00
eks-demo
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
resource "aws_iam_role" "demo-cluster" {
|
||||
name = "terraform-eks-demo-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.demo-cluster.name}"
|
||||
}
|
||||
|
||||
resource "aws_iam_role_policy_attachment" "demo-cluster-AmazonEKSServicePolicy" {
|
||||
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy"
|
||||
role = "${aws_iam_role.demo-cluster.name}"
|
||||
}
|
||||
Reference in New Issue
Block a user