Open danhiris opened 6 years ago
From the stacktrace it looks like the AWS SDK itself is barfing on the validation.
Yes, the aws sdk has a separate variable for the path to the iam profile and won't let it use the path in the actual name. That variable doesn't seem to be something that the kitchen ec2 gem is aware of.
Hi,
I've just tested your behaviour but can not reproduce this. My tests:
aws iam create-role --path /testing/test/test2/ --role-name test --assume-role-policy-document file://assume-role-policy.json
Where assume-role-policy.json is defined as:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Principal": {"Service": "ec2.amazonaws.com"},
"Action": "sts:AssumeRole"
}
}
aws iam create-instance-profile --path testing/test/test --instance-profile-name test
aws iam add-role-to-instance-profile --instance-profile-name /testing/test/test/test --role-name test
-> Using "test" as role works for me very well:
iam_profile_name: test
Is there anything I'm doing wrong?
Best regards, Patrick
in kitchen.yml, there is no way to set the path of the role-name as you do with the aws cli commands.
If I use a profile name that includes a path, I get errors. It wortks fine if I use IAM profile names that are in the root roles/ path.
This is how I define the profile name. I tried single quotes and double quotes and didn't make a difference. iam_profile_name: "app/ec2/dev/app-ec2-inasandboxdev-profile-role-v1"
This is the debug of the errors I get when I used a profile nested within a path: