From 33398d628f5ad69e9c52da705493798a047f85dd Mon Sep 17 00:00:00 2001 From: James Thorniley Date: Thu, 3 Oct 2019 13:59:23 +0100 Subject: [PATCH] fix: iam role arn should have two colons --- moto/stepfunctions/models.py | 2 +- tests/test_stepfunctions/test_stepfunctions.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moto/stepfunctions/models.py b/moto/stepfunctions/models.py index 7784919b0..c783e91f8 100644 --- a/moto/stepfunctions/models.py +++ b/moto/stepfunctions/models.py @@ -59,7 +59,7 @@ class StepFunctionBackend(BaseBackend): u'\u0090', u'\u0091', u'\u0092', u'\u0093', u'\u0094', u'\u0095', u'\u0096', u'\u0097', u'\u0098', u'\u0099', u'\u009A', u'\u009B', u'\u009C', u'\u009D', u'\u009E', u'\u009F'] - accepted_role_arn_format = re.compile('arn:aws:iam:(?P[0-9]{12}):role/.+') + accepted_role_arn_format = re.compile('arn:aws:iam::(?P[0-9]{12}):role/.+') accepted_mchn_arn_format = re.compile('arn:aws:states:[-0-9a-zA-Z]+:(?P[0-9]{12}):stateMachine:.+') accepted_exec_arn_format = re.compile('arn:aws:states:[-0-9a-zA-Z]+:(?P[0-9]{12}):execution:.+') diff --git a/tests/test_stepfunctions/test_stepfunctions.py b/tests/test_stepfunctions/test_stepfunctions.py index 10953ce2d..6c7fd8e26 100644 --- a/tests/test_stepfunctions/test_stepfunctions.py +++ b/tests/test_stepfunctions/test_stepfunctions.py @@ -78,7 +78,7 @@ def test_state_machine_creation_requires_valid_role_arn(): with assert_raises(ClientError) as exc: client.create_state_machine(name=name, definition=str(simple_definition), - roleArn='arn:aws:iam:1234:role/unknown_role') + roleArn='arn:aws:iam::1234:role/unknown_role') @mock_stepfunctions @@ -375,4 +375,4 @@ def _get_account_id(): def _get_default_role(): - return 'arn:aws:iam:' + _get_account_id() + ':role/unknown_sf_role' + return 'arn:aws:iam::' + _get_account_id() + ':role/unknown_sf_role'