Modify IAM Role

In order for the X-Ray daemon to communicate with the service, we need to add a policy to the worker nodes’ AWS Identity and Access Management (IAM) role.

First, we will need to ensure the Role Name our workers use is set in our environment:

test -n "$ROLE_NAME" && echo ROLE_NAME is "$ROLE_NAME" || echo ROLE_NAME is not set
Expand here if you need to export the Role Name
# Example Output
ROLE_NAME is eks-workshop-nodegroup
This IAM policy has been attached to the correct role for you.
You can proceed with the next step.

aws iam attach-role-policy --role-name $ROLE_NAME \
--policy-arn arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess