The stack name is the same as the name I assigned to the module. I checked the role created from Terraform and found the role is there. Then I used the aws cli command to check if the instance profile has been created. From the output I can see the instance profile has been created. Please see below for verification:
I see the principle for this role is ""Service": "ec2.amazonaws.com"", it looks like the cloudformation service is not listed in the principle, this may cause the cloudformation cannot find this role or instance profile. (correct me if i am wrong)
{
"Path": "/",
"InstanceProfileName": "jason-pipeline-imagebuilder-instance-profile-20220922071727921200000002",
"InstanceProfileId": "AIPAWF2ABWU5GN24MBMYM",
"Arn": "arn:aws:iam::xxxxxxxxxxx:instance-profile/jason-pipeline-imagebuilder-instance-profile-20220922071727921200000002",
"CreateDate": "2022-09-22T07:17:27+00:00",
"Roles": [
{
"Path": "/",
"RoleName": "jason-pipeline-imagebuilder-role-20220922071727266500000001",
"RoleId": "AROAWF2ABWU5FOMOKJO32",
"Arn": "arn:aws:iam::xxxxxxxx:role/jason-pipeline-imagebuilder-role-20220922071727266500000001",
"CreateDate": "2022-09-22T07:17:27+00:00",
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
}
]
},
module "imagebuilder-pipeline" {
source = "rhythmictech/imagebuilder-pipeline/aws"
version = "0.5.2"
# insert the 2 required variables here
description = "Jason Testing pipeline"
name = "jason-pipeline"
# tags = local.tags
tags = {
created_on = "09212022"
}
recipe_arn = module.test_recipe.recipe_arn
public = false
}