Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 740b522

Browse files
committed
Remove legacy IAM_POLICY_VERSION import in IAM CloudFormation model
1 parent f09a9ac commit 740b522

File tree

1 file changed

+3
-2
lines changed
  • localstack/services/cloudformation/models

1 file changed

+3
-2
lines changed

‎localstack/services/cloudformation/models/iam.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
)
1717
from localstack.services.cloudformation.service_models import GenericBaseModel
1818
from localstack.services.iam.provider import SERVICE_LINKED_ROLE_PATH_PREFIX
19-
from localstack.services.lambda_.legacy.lambda_api import IAM_POLICY_VERSION
2019
from localstack.utils.aws import arns
2120
from localstack.utils.common import ensure_list
2221
from localstack.utils.functions import call_safe
2322

2423
LOG = logging.getLogger(__name__)
2524

25+
DEFAULT_IAM_POLICY_VERSION = "2012-10-17"
26+
2627

2728
class IAMManagedPolicy(GenericBaseModel):
2829
@staticmethod
@@ -363,7 +364,7 @@ def _post_create(
363364
doc = dict(policy["PolicyDocument"])
364365
doc = remove_none_values(doc)
365366

366-
doc["Version"] = doc.get("Version") or IAM_POLICY_VERSION
367+
doc["Version"] = doc.get("Version") or DEFAULT_IAM_POLICY_VERSION
367368
statements = ensure_list(doc["Statement"])
368369
for statement in statements:
369370
if isinstance(statement.get("Resource"), list):

0 commit comments

Comments
 (0)