Be default AWS ParallelCluster API limits the policies you’re allowed to attach with AdditionalIAMPolicies
to the following managed policies:
If you try and attach a policy outside of this list, you’ll get an error like:
API: iam:AttachRolePolicy User: ... is not authorized to perform: iam:AttachRolePolicy on resource: role api-cluster-2022-05-09-17-46-53-RoleHeadNode-EXNM6B7GER1S because no identity-based policy allows the iam:AttachRolePolicy action
To fix this, you can add additional IAM permissions to PCM like so:
ParallelClusterFunction
Configuration
> Permissions
> Click on the role under Role name
.AWSXRayDaemonWriteAccess
policy and remove itAdd permissions
> Create inline Policy
<account-id>
to your aws account id.{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"iam:AttachRolePolicy",
"iam:DetachRolePolicy"
],
"Effect": "Allow",
"Resource": "arn:aws:iam::<account-id>:role/parallelcluster/*"
}
]
}
pcluster-attach-detach-policies
and click Save.