How to get instance role from a nodegroup created with ClusterNodeGroupOptions?TypeScript
In the Pulumi AWS EKS package, the
eks.Clusterclass provides a method
getCoreInstanceProfileNamethat returns the instance profile name. However, this instance profile is not the same as the IAM role associated with each node in the nodegroup.
Unfortunately, due to the current design of the AWS EKS Pulumi provider, it's not directly possible to retrieve the IAM role for an individual node or node group. The AWS EKS Pulumi provider does not currently expose a method to get the IAM role of a NodeGroup created with
However, typically, when creating an EKS node group, you provide the NodeInstanceRole as part of the NodeGroupOptions object. This IAM role is usually created and managed separately (either manually in the AWS IAM console or using Pulumi AWS IAM resources), and then passed as an argument when creating the node group.
Here's an excerpt of code to illustrate:
In this case, you already know the IAM role associated with the node group as it's been created and managed by you (or Pulumi).