fix: iam role arn should have two colons

This commit is contained in:
James Thorniley 2019-10-03 13:59:23 +01:00
parent 4497f18c1a
commit 33398d628f
2 changed files with 3 additions and 3 deletions

View File

@ -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<account_id>[0-9]{12}):role/.+')
accepted_role_arn_format = re.compile('arn:aws:iam::(?P<account_id>[0-9]{12}):role/.+')
accepted_mchn_arn_format = re.compile('arn:aws:states:[-0-9a-zA-Z]+:(?P<account_id>[0-9]{12}):stateMachine:.+')
accepted_exec_arn_format = re.compile('arn:aws:states:[-0-9a-zA-Z]+:(?P<account_id>[0-9]{12}):execution:.+')

View File

@ -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'