I have:
* A module which creates an EC2 instance
* A module which creates an IAM instance profile that I use a machine role for the EC2 instance.
* I have a top level
main.tf which takes the output of the IAM module and passes it as input into the EC2 module
I consistently see an error of the form:
"* aws_instance.ec2: Error launching source instance: InvalidParameterValue: IAM Instance Profile "arn:aws:iam::<deleted>:instance-profile/<deleted>" has no associated IAM Roles"
If I immediately re-run terraform, it starts to create the EC2 instance - which suggests a timing problem?
Do I need to an explicit 'depends_on'?
I have seen this pretty consistently and across different terraform configurations.
I am running v0.16.12 of terraform.
As always: you are awesome and I love your product :D
Thanks!
Tim