mirror of
https://github.com/jlengrand/engine.git
synced 2026-03-10 08:11:21 +00:00
41 lines
1.1 KiB
HCL
41 lines
1.1 KiB
HCL
resource "aws_iam_role" "eks_workers" {
|
|
name = "qovery-eks-workers-${var.kubernetes_cluster_id}"
|
|
|
|
tags = local.tags_eks
|
|
|
|
assume_role_policy = <<POLICY
|
|
{
|
|
"Version": "2012-10-17",
|
|
"Statement": [
|
|
{
|
|
"Effect": "Allow",
|
|
"Principal": {
|
|
"Service": "ec2.amazonaws.com"
|
|
},
|
|
"Action": "sts:AssumeRole"
|
|
}
|
|
]
|
|
}
|
|
POLICY
|
|
}
|
|
|
|
resource "aws_iam_role_policy_attachment" "node_AmazonEKSWorkerNodePolicy" {
|
|
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"
|
|
role = aws_iam_role.eks_workers.name
|
|
}
|
|
|
|
resource "aws_iam_role_policy_attachment" "node_AmazonEKS_CNI_Policy" {
|
|
policy_arn = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"
|
|
role = aws_iam_role.eks_workers.name
|
|
}
|
|
|
|
resource "aws_iam_role_policy_attachment" "node_AmazonEC2ContainerRegistryReadOnly" {
|
|
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
|
|
role = aws_iam_role.eks_workers.name
|
|
}
|
|
|
|
resource "aws_iam_instance_profile" "workers" {
|
|
name = "qovery-eks-workers-${var.kubernetes_cluster_id}"
|
|
role = aws_iam_role.eks_workers.name
|
|
}
|