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(
|
raise InvalidParameterValueException(
|
||||||
"computeResources must contain {0}".format(param)
|
"computeResources must contain {0}".format(param)
|
||||||
)
|
)
|
||||||
|
for profile in self.iam_backend.get_instance_profiles():
|
||||||
if self.iam_backend.get_role_by_arn(cr["instanceRole"]) is None:
|
if profile.arn == cr["instanceRole"]:
|
||||||
|
break
|
||||||
|
else:
|
||||||
raise InvalidParameterValueException(
|
raise InvalidParameterValueException(
|
||||||
"could not find instanceRole {0}".format(cr["instanceRole"])
|
"could not find instanceRole {0}".format(cr["instanceRole"])
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user