AWS EKS nodegroup role #13381
-
I believe when you start a new cluster via EKS, it assigns a default IAM Role to the nodegroup. This role is used to get access to AWS Service. I am trying to setup Cloudwatch logging and looks like I need to add "CloudWatchAgentServerPolicy" to that nodegroup role. I am trying to get to 100% CDK only infrastructure. Does anyone know? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Found it .. for someone else to find IRole nodeGroupRole = (IRole) mainCluster.getDefaultNodegroup().getRole(); |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Found it .. for someone else to find
IRole nodeGroupRole = (IRole) mainCluster.getDefaultNodegroup().getRole();
nodeGroupRole.addManagedPolicy(
ManagedPolicy.fromAwsManagedPolicyName("CloudWatchAgentServerPolicy"));