Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V4t #1783

Closed
wants to merge 2 commits into from
Closed

V4t #1783

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions modules/aws-eks-managed-node-groups/data.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
data "aws_iam_policy_document" "managed_ng_assume_role_policy" {
statement {
sid = "EKSWorkerAssumeRole"

actions = [
"sts:AssumeRole",
]

principals {
type = "Service"
identifiers = [local.ec2_principal]
}
}
locals{
managed_ng_assume_role_policy_json = jsonencode({
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Principal = {
Service = "${local.ec2_principal}"
}
Sid = "EKSWorkerAssumeRole"
},
]
Version = "2012-10-17"
})
}
2 changes: 1 addition & 1 deletion modules/aws-eks-managed-node-groups/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resource "aws_iam_role" "managed_ng" {

name = "${var.context.eks_cluster_id}-${local.managed_node_group["node_group_name"]}"
description = "EKS Managed Node group IAM Role"
assume_role_policy = data.aws_iam_policy_document.managed_ng_assume_role_policy.json
assume_role_policy = local.managed_ng_assume_role_policy_json
path = var.context.iam_role_path
permissions_boundary = var.context.iam_role_permissions_boundary
force_detach_policies = true
Expand Down
Loading