From 38455c8e1943e2ffb8bf1f2306095b3c08cf559a Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Tue, 24 Sep 2019 14:36:34 +0100 Subject: [PATCH] Step Functions - Remove STS-client and refer to hardcoded account-id --- moto/stepfunctions/models.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/moto/stepfunctions/models.py b/moto/stepfunctions/models.py index 8db9db1a..7784919b 100644 --- a/moto/stepfunctions/models.py +++ b/moto/stepfunctions/models.py @@ -1,9 +1,9 @@ import boto -import boto3 import re from datetime import datetime from moto.core import BaseBackend from moto.core.utils import iso_8601_datetime_without_milliseconds +from moto.sts.models import ACCOUNT_ID from uuid import uuid4 from .exceptions import ExecutionDoesNotExist, InvalidArn, InvalidName, StateMachineDoesNotExist @@ -156,12 +156,7 @@ class StepFunctionBackend(BaseBackend): raise InvalidArn(invalid_msg) def _get_account_id(self): - if self._account_id: - return self._account_id - sts = boto3.client("sts") - identity = sts.get_caller_identity() - self._account_id = identity['Account'] - return self._account_id + return ACCOUNT_ID stepfunction_backends = {_region.name: StepFunctionBackend(_region.name) for _region in boto.awslambda.regions()}