Open
Description
Describe the bug
The latest module (v0.5.2) throws the following error:
"The value supplied for parameter 'instanceProfileName' is not valid. The provided instance profile does not exist.
The might be a race condition here as I can see the resource on a destroy:
# aws_iam_instance_profile.this will be destroyed
- resource "aws_iam_instance_profile" "this" {
- arn = "arn:aws:iam::123443211234:instance-profile/test-pipe-imagebuilder-instance-profile-20210914083450236900000002" -> null
- create_date = "2021-09-14T08:34:52Z" -> null
- id = "test-pipe-imagebuilder-instance-profile-20210914083450236900000002" -> null
- name = "test-pipe-imagebuilder-instance-profile-20210914083450236900000002" -> null
- name_prefix = "test-pipe-imagebuilder-instance-profile-" -> null
- path = "/" -> null
- role = "test-pijp-tg-imagebuilder-role-20210914083448508400000001" -> null
- tags = {} -> null
- tags_all = {} -> null
- unique_id = "AIPA3JAHVOPNQES7DJZNN" -> null
}
There is probably something that I'm missing here. I can see the resource and as the name is a simple string, you'd suspect it to be valid.
To Reproduce
terraform apply
Full Stacktrace
│ Error: error waiting for CloudFormation Stack creation: failed to create CloudFormation stack, rollback requested (ROLLBACK_COMPLETE): ["The following resource(s) failed to create: [distConfig, infraConfig]. Rollback requested by user." "Resource creation cancelled" "Resource handler returned message: \"The value supplied for parameter 'instanceProfileName' is not valid. The provided instance profile does not exist. Please specify a different instance profile and try again. (Service: Imagebuilder, Status Code: 400, Request ID: 50600df7-a4fd-4eec-8b01-916d0405b38b, Extended Request ID: null)\" (RequestToken: c97e2aa0-68ca-0cb5-cc52-6bb03c098380, HandlerErrorCode: GeneralServiceException)"]