Batch: computeResources.instanceRole is an instance profile
It's not an IAM role (the API parameter name in Batch is a misnomer). Validation by matching against known role ARNs will always fail. Scan the known instance profile ARNs instead.
This commit is contained in:
parent
4d5bf1c5c6
commit
ad234f225f
@ -815,8 +815,10 @@ class BatchBackend(BaseBackend):
|
||||
raise InvalidParameterValueException(
|
||||
"computeResources must contain {0}".format(param)
|
||||
)
|
||||
|
||||
if self.iam_backend.get_role_by_arn(cr["instanceRole"]) is None:
|
||||
for profile in self.iam_backend.get_instance_profiles():
|
||||
if profile.arn == cr["instanceRole"]:
|
||||
break
|
||||
else:
|
||||
raise InvalidParameterValueException(
|
||||
"could not find instanceRole {0}".format(cr["instanceRole"])
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user