-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Adding additional policy to node group IAM role #2053
Comments
Same issue exists for self_managed_node_groups and iam_role_additional_policies
There was an issue tracking upgrades #1744, but this issue is for both upgrades and fresh installs. This issue #1988 mentions using a policy doc to get around this limitation. This was probably just not tested, in light of terraforms requirement that are arguments to a for_each be known at time of plan. I have a fork of EKS module and I am experimenting a different way to handle this, the output for the IAM role created for each esg was removed so we can no longer easily add new policies after the fact. |
This is available and is one of the recommended ways to getting around this issue currently
|
Awesome, thank you, i saw that worker_iam_role_name was removed I was looking for if it was replaced by something. |
@bryantbiggs - Regarding the output |
@chandanpjain no - the output provided is sufficient I believe |
@chandanpjain did you try using https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/examples/eks_managed_node_group/main.tf#L314
|
using
|
nope, that would be the name used on the IAM role - it does not have anything to do with additional policies |
@liqwid You need to declare it inside each node group definition |
This issue has been resolved in version 19.0.0 🎉 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Description
We are creating multiple clusters using same set of terraform files and variable values for each one of them is set using
tfvar
files. Each of our clusters can have different set of eks managed node groups and these are controlled by settingcreate
flag in the respectivetfvar
file for the cluster.In addition to this, we are setting additional policy to the node groups. As per this comment to avoid the terraform issue with for-each, we are using
aws_iam_role_policy_attachment
to attach the additional policy.Let's take a simple example of
eks
module creating cluster with 2 node groups and below scenarios,When we try to deploy these 2 clusters, ClusterA is successfully deployed. For ClusterB, the IAM policy is updated for the node group which is enabled to be created but fails with:
This seems to indicate that the output
module.eks.eks_managed_node_groups
is returning both the node group names irrespective ofcreate
flag set totrue
orfalse
.To work around this we tried to parse the output
module.eks.eks_managed_node_groups
and add condition to check if there isiam_role_name
is set.But, this seems doesn't seem help and we'll end up in the same terraform issue with for-each.
Could you please see if the output for
module.eks.eks_managed_node_groups
can be set to only use the values for node groups which are getting created?Also, please suggest any alternate options for this so that we can overcome this blocker for us.
Versions
Module version [Required]: 18.20.5
Terraform version: 1.1.7
Provider version(s): 4.12.1
The text was updated successfully, but these errors were encountered: