From 454f537144f3b5c9fbb665de9eb4a0b067e75d45 Mon Sep 17 00:00:00 2001 From: Pradhapan Rajendran Date: Mon, 27 Feb 2023 16:18:31 -0500 Subject: [PATCH] add stricter typing to construct assume role policy --- samtranslator/model/iam.py | 2 +- samtranslator/model/stepfunctions/events.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samtranslator/model/iam.py b/samtranslator/model/iam.py index a756ea3f3..5d263096b 100644 --- a/samtranslator/model/iam.py +++ b/samtranslator/model/iam.py @@ -33,7 +33,7 @@ class IAMManagedPolicy(Resource): class IAMRolePolicies: @classmethod - def construct_assume_role_policy_for_service_principal(cls, service_principal): # type: ignore[no-untyped-def] + def construct_assume_role_policy_for_service_principal(cls, service_principal: str) -> Dict[str, Any]: return { "Version": "2012-10-17", "Statement": [ diff --git a/samtranslator/model/stepfunctions/events.py b/samtranslator/model/stepfunctions/events.py index 6b47ece1d..d0e182307 100644 --- a/samtranslator/model/stepfunctions/events.py +++ b/samtranslator/model/stepfunctions/events.py @@ -63,7 +63,7 @@ def _construct_role(self, resource, permissions_boundary=None, prefix=None, suff """ role_logical_id = self._generate_logical_id(prefix=prefix, suffix=suffix, resource_type="Role") # type: ignore[no-untyped-call] event_role = IAMRole(role_logical_id, attributes=resource.get_passthrough_resource_attributes()) - event_role.AssumeRolePolicyDocument = IAMRolePolicies.construct_assume_role_policy_for_service_principal( # type: ignore[no-untyped-call] + event_role.AssumeRolePolicyDocument = IAMRolePolicies.construct_assume_role_policy_for_service_principal( self.principal ) state_machine_arn = resource.get_runtime_attr("arn")