From 43c7def09a6ce05753a4fd8a54da7ee98128554b Mon Sep 17 00:00:00 2001
From: Ajithesh Navaneethakrishnan
You must grant the execution role the permissions needed ' + 'to access the same IAM resources that the step can access. ' + 'The execution role can be a cross-account IAM Role.
' +) \ No newline at end of file diff --git a/tests/unit/customizations/emr/test_add_steps.py b/tests/unit/customizations/emr/test_add_steps.py index c806adb9f9e9..1087bf19e9b3 100644 --- a/tests/unit/customizations/emr/test_add_steps.py +++ b/tests/unit/customizations/emr/test_add_steps.py @@ -255,6 +255,27 @@ def test_streaming_step_with_default_fields(self): cmd=cmd, expected_result=expected_result, expected_result_release=expected_result_release) + def test_step_with_execution_role_arn(self): + cmd = self.prefix + 'Type=Streaming,' + self.STREAMING_ARGS + cmd += ' --execution-role-arn arn:aws:iam::123456789010:role/sample ' + expected_result = { + 'ExecutionRoleArn': 'arn:aws:iam::123456789010:role/sample', + 'JobFlowId': 'j-ABC', + 'Steps': [ + {'Name': 'Streaming program', + 'ActionOnFailure': 'CONTINUE', + 'HadoopJarStep': self.STREAMING_HADOOP_SCRIPT_RUNNER_STEP + } + ] + } + expected_result_release = copy.deepcopy(expected_result) + expected_result_release['Steps'][0]['HadoopJarStep'] = \ + self.STREAMING_HADOOP_COMMAND_RUNNER_STEP + + self.assert_params_for_ami_and_release_based_clusters( + cmd=cmd, expected_result=expected_result, + expected_result_release=expected_result_release) + def test_streaming_step_missing_args(self): cmd = self.prefix + 'Type=Streaming' expected_error_msg = '\naws: error: The following ' + \