25 lines
507 B
HCL
25 lines
507 B
HCL
resource "aws_iam_role" "eks-cluster" {
|
|
name = "iam role eks-cluster"
|
|
|
|
# Terraform's "jsonencode" function converts a
|
|
# Terraform expression result to valid JSON syntax.
|
|
assume_role_policy = jsonencode({
|
|
"Version" : "2012-10-17",
|
|
"Statement" : [
|
|
{
|
|
"Effect" : "Allow",
|
|
"Principal" : {
|
|
"Service" : [
|
|
"eks.amazonaws.com"
|
|
]
|
|
},
|
|
"Action" : "sts:AssumeRole"
|
|
}
|
|
]
|
|
})
|
|
|
|
tags = {
|
|
tag-key = "eks-cluster-rule"
|
|
}
|
|
}
|