def _create_policy_statements()

in aws_emr_launch/constructs/step_functions/emr_tasks.py [0:0]


    def _create_policy_statements(self) -> List[iam.PolicyStatement]:
        stack = core.Stack.of(self)

        policy_statements = list()

        policy_statements.append(
            iam.PolicyStatement(
                effect=iam.Effect.ALLOW,
                actions=[
                    "elasticmapreduce:AddJobFlowSteps",
                    "elasticmapreduce:DescribeStep",
                    "elasticmapreduce:CancelSteps",
                ],
                resources=[f"arn:aws:elasticmapreduce:{core.Aws.REGION}:{core.Aws.ACCOUNT_ID}:cluster/*"],
            )
        )

        if self._integration_pattern == sfn.IntegrationPattern.RUN_JOB:
            policy_statements.append(
                iam.PolicyStatement(
                    effect=iam.Effect.ALLOW,
                    actions=["events:PutTargets", "events:PutRule", "events:DescribeRule"],
                    resources=[
                        stack.format_arn(
                            service="events",
                            resource="rule",
                            resource_name="StepFunctionsGetEventForEMRAddJobFlowStepsRule",
                        )
                    ],
                )
            )

        return policy_statements