How to create and assume an IAM role with terraform in the same plan
0
Is there a trick to both create and assume an IAM role in the same terraform plan? I am trying to use terraform to create EKS clusters by assuming a role that is created as part of the job. AWS assigns the identity that creates the cluster as the admin (system:master). I'd like to have a new role created and assigned for each cluster, but it seems to cause issues with Terraform's plan. The only part of the job that needs to assume the role is the cluster creation step. So far I've worked around the issue with resource targeting, which uses a separate step to target creation of the admin role before running the complete plan. However, it would be nice if I didn't need multiple steps to create the cluster. I'm somewhat new to Terraform, so I'm wondering if I'm overlooking someth...