awscli 1.42.33__py3-none-any.whl → 1.44.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of awscli might be problematic. Click here for more details.

Files changed (146) hide show
  1. awscli/__init__.py +1 -1
  2. awscli/alias.py +3 -3
  3. awscli/argprocess.py +2 -1
  4. awscli/arguments.py +1 -1
  5. awscli/bcdoc/docevents.py +3 -0
  6. awscli/clidocs.py +19 -2
  7. awscli/clidriver.py +55 -9
  8. awscli/customizations/argrename.py +1 -0
  9. awscli/customizations/cliinputjson.py +4 -0
  10. awscli/customizations/cloudformation/deploy.py +19 -3
  11. awscli/customizations/cloudtrail/validation.py +22 -2
  12. awscli/customizations/commands.py +2 -1
  13. awscli/customizations/eks/update_kubeconfig.py +12 -1
  14. awscli/customizations/emr/argumentschema.py +355 -344
  15. awscli/customizations/emr/createcluster.py +12 -0
  16. awscli/customizations/emr/emrutils.py +83 -50
  17. awscli/customizations/emr/helptext.py +10 -0
  18. awscli/customizations/emr/steputils.py +92 -52
  19. awscli/customizations/globalargs.py +169 -0
  20. awscli/customizations/paginate.py +66 -1
  21. awscli/customizations/s3/filegenerator.py +4 -1
  22. awscli/customizations/s3/fileinfo.py +4 -1
  23. awscli/customizations/s3/fileinfobuilder.py +6 -0
  24. awscli/customizations/s3/s3handler.py +9 -0
  25. awscli/customizations/s3/subcommands.py +147 -6
  26. awscli/customizations/s3/syncstrategy/base.py +9 -0
  27. awscli/customizations/s3/syncstrategy/caseconflict.py +92 -0
  28. awscli/customizations/s3/utils.py +14 -0
  29. awscli/customizations/scalarparse.py +48 -9
  30. awscli/data/cli.json +5 -0
  31. awscli/examples/cloudformation/create-generated-template.rst +50 -0
  32. awscli/examples/cloudformation/create-stack-refactor.rst +16 -0
  33. awscli/examples/cloudformation/delete-generated-template.rst +10 -0
  34. awscli/examples/cloudformation/describe-generated-template.rst +62 -0
  35. awscli/examples/cloudformation/describe-resource-scan.rst +38 -0
  36. awscli/examples/cloudformation/describe-stack-refactor.rst +20 -0
  37. awscli/examples/cloudformation/execute-stack-refactor.rst +10 -0
  38. awscli/examples/cloudformation/list-generated-templates.rst +41 -0
  39. awscli/examples/cloudformation/list-resource-scan-related-resources.rst +47 -0
  40. awscli/examples/cloudformation/list-resource-scan-resources.rst +30 -0
  41. awscli/examples/cloudformation/list-stack-refactor-actions.rst +71 -0
  42. awscli/examples/cloudformation/start-resource-scan.rst +14 -0
  43. awscli/examples/global_options.rst +4 -0
  44. awscli/examples/global_synopsis.rst +1 -0
  45. awscli/examples/ivs-realtime/get-composition.rst +7 -4
  46. awscli/examples/ivs-realtime/start-composition.rst +88 -3
  47. awscli/examples/lambda/create-function.rst +4 -4
  48. awscli/examples/lambda/get-function.rst +3 -3
  49. awscli/examples/lambda/list-functions.rst +6 -6
  50. awscli/examples/medical-imaging/create-datastore.rst +19 -2
  51. awscli/examples/medical-imaging/get-datastore.rst +24 -1
  52. awscli/examples/securityhub/describe-hub.rst +6 -4
  53. awscli/examples/servicediscovery/create-service.rst +50 -10
  54. awscli/examples/servicediscovery/delete-namespace.rst +18 -4
  55. awscli/examples/servicediscovery/delete-service-attributes.rst +15 -3
  56. awscli/examples/servicediscovery/delete-service.rst +13 -3
  57. awscli/examples/servicediscovery/deregister-instance.rst +18 -2
  58. awscli/examples/servicediscovery/discover-instances-revision.rst +18 -1
  59. awscli/examples/servicediscovery/discover-instances.rst +32 -2
  60. awscli/examples/servicediscovery/get-instance.rst +30 -4
  61. awscli/examples/servicediscovery/get-instances-health-status.rst +19 -1
  62. awscli/examples/servicediscovery/get-namespace.rst +40 -9
  63. awscli/examples/servicediscovery/get-operation.rst +32 -6
  64. awscli/examples/servicediscovery/get-service-attributes.rst +25 -3
  65. awscli/examples/servicediscovery/get-service.rst +35 -7
  66. awscli/examples/servicediscovery/list-instances.rst +38 -3
  67. awscli/examples/servicediscovery/list-namespaces.rst +45 -22
  68. awscli/examples/servicediscovery/list-services.rst +30 -2
  69. awscli/examples/servicediscovery/register-instance.rst +18 -2
  70. awscli/examples/servicediscovery/update-http-namespace.rst +22 -5
  71. awscli/examples/servicediscovery/update-instance-custom-health-status.rst +14 -1
  72. awscli/examples/servicediscovery/update-private-dns-namespace.rst +22 -5
  73. awscli/examples/servicediscovery/update-public-dns-namespace.rst +22 -5
  74. awscli/examples/servicediscovery/update-service-attributes.rst +14 -2
  75. awscli/examples/servicediscovery/update-service.rst +20 -4
  76. awscli/paramfile.py +21 -4
  77. awscli/testutils.py +17 -0
  78. awscli/topics/config-vars.rst +1 -1
  79. awscli/topics/s3-case-insensitivity.rst +105 -0
  80. awscli/topics/topic-tags.json +16 -0
  81. awscli/utils.py +19 -2
  82. {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/METADATA +5 -3
  83. {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/RECORD +91 -132
  84. awscli/examples/qldb/cancel-journal-kinesis-stream.rst +0 -15
  85. awscli/examples/qldb/create-ledger.rst +0 -43
  86. awscli/examples/qldb/delete-ledger.rst +0 -10
  87. awscli/examples/qldb/describe-journal-kinesis-stream.rst +0 -29
  88. awscli/examples/qldb/describe-journal-s3-export.rst +0 -30
  89. awscli/examples/qldb/describe-ledger.rst +0 -23
  90. awscli/examples/qldb/export-journal-to-s3.rst +0 -28
  91. awscli/examples/qldb/get-block.rst +0 -55
  92. awscli/examples/qldb/get-digest.rst +0 -17
  93. awscli/examples/qldb/get-revision.rst +0 -57
  94. awscli/examples/qldb/list-journal-kinesis-streams-for-ledger.rst +0 -30
  95. awscli/examples/qldb/list-journal-s3-exports-for-ledger.rst +0 -31
  96. awscli/examples/qldb/list-journal-s3-exports.rst +0 -46
  97. awscli/examples/qldb/list-ledgers.rst +0 -24
  98. awscli/examples/qldb/list-tags-for-resource.rst +0 -17
  99. awscli/examples/qldb/stream-journal-to-kinesis.rst +0 -46
  100. awscli/examples/qldb/tag-resource.rst +0 -11
  101. awscli/examples/qldb/untag-resource.rst +0 -11
  102. awscli/examples/qldb/update-ledger-permissions-mode.rst +0 -34
  103. awscli/examples/qldb/update-ledger.rst +0 -63
  104. awscli/examples/robomaker/batch-describe-simulation-job.rst +0 -150
  105. awscli/examples/robomaker/cancel-simulation-job.rst +0 -6
  106. awscli/examples/robomaker/create-deployment-job.rst +0 -37
  107. awscli/examples/robomaker/create-fleet.rst +0 -18
  108. awscli/examples/robomaker/create-robot-application-version.rst +0 -31
  109. awscli/examples/robomaker/create-robot-application.rst +0 -29
  110. awscli/examples/robomaker/create-robot.rst +0 -20
  111. awscli/examples/robomaker/create-simulation-application-version.rst +0 -39
  112. awscli/examples/robomaker/create-simulation-application.rst +0 -38
  113. awscli/examples/robomaker/create-simulation-job.rst +0 -43
  114. awscli/examples/robomaker/delete-fleet.rst +0 -7
  115. awscli/examples/robomaker/delete-robot-application.rst +0 -7
  116. awscli/examples/robomaker/delete-robot.rst +0 -7
  117. awscli/examples/robomaker/delete-simulation-application.rst +0 -7
  118. awscli/examples/robomaker/deregister-robot.rst +0 -14
  119. awscli/examples/robomaker/describe-deployment-job.rst +0 -38
  120. awscli/examples/robomaker/describe-fleet.rst +0 -28
  121. awscli/examples/robomaker/describe-robot-application.rst +0 -29
  122. awscli/examples/robomaker/describe-robot.rst +0 -21
  123. awscli/examples/robomaker/describe-simulation-application.rst +0 -37
  124. awscli/examples/robomaker/describe-simulation-job.rst +0 -45
  125. awscli/examples/robomaker/list-deployment-jobs.rst +0 -57
  126. awscli/examples/robomaker/list-fleets.rst +0 -22
  127. awscli/examples/robomaker/list-robot-applications.rst +0 -32
  128. awscli/examples/robomaker/list-robots.rst +0 -45
  129. awscli/examples/robomaker/list-simulation-applications.rst +0 -50
  130. awscli/examples/robomaker/list-simulation-jobs.rst +0 -80
  131. awscli/examples/robomaker/list-tags-for-resource.rst +0 -16
  132. awscli/examples/robomaker/register-robot.rst +0 -14
  133. awscli/examples/robomaker/restart-simulation-job.rst +0 -7
  134. awscli/examples/robomaker/sync-deployment-job.rst +0 -30
  135. awscli/examples/robomaker/tag-resource.rst +0 -7
  136. awscli/examples/robomaker/untag-resource.rst +0 -7
  137. awscli/examples/robomaker/update-robot-application.rst +0 -28
  138. awscli/examples/robomaker/update-simulation-application.rst +0 -36
  139. {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws +0 -0
  140. {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws.cmd +0 -0
  141. {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_bash_completer +0 -0
  142. {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_completer +0 -0
  143. {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_zsh_completer.sh +0 -0
  144. {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/LICENSE.txt +0 -0
  145. {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/WHEEL +0 -0
  146. {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/top_level.txt +0 -0
@@ -212,6 +212,11 @@ class CreateCluster(Command):
212
212
  'schema': argumentschema.AUTO_TERMINATION_POLICY_SCHEMA,
213
213
  'help_text': helptext.AUTO_TERMINATION_POLICY,
214
214
  },
215
+ {
216
+ 'name': 'monitoring-configuration',
217
+ 'schema': argumentschema.MONITORING_CONFIGURATION_SCHEMA,
218
+ 'help_text': helptext.MONITORING_CONFIGURATION,
219
+ },
215
220
  {
216
221
  'name': 'extended-support',
217
222
  'action': 'store_true',
@@ -553,6 +558,13 @@ class CreateCluster(Command):
553
558
  parsed_args.auto_termination_policy,
554
559
  )
555
560
 
561
+ if parsed_args.monitoring_configuration is not None:
562
+ emrutils.apply_dict(
563
+ params,
564
+ 'MonitoringConfiguration',
565
+ parsed_args.monitoring_configuration,
566
+ )
567
+
556
568
  self._validate_required_applications(parsed_args)
557
569
 
558
570
  run_job_flow_response = emrutils.call(
@@ -15,12 +15,10 @@ import json
15
15
  import logging
16
16
  import os
17
17
 
18
+ from botocore.exceptions import NoCredentialsError
18
19
 
19
20
  from awscli.clidriver import CLIOperationCaller
20
- from awscli.customizations.emr import constants
21
- from awscli.customizations.emr import exceptions
22
- from botocore.exceptions import WaiterError, NoCredentialsError
23
- from botocore import xform_name
21
+ from awscli.customizations.emr import constants, exceptions
24
22
 
25
23
  LOG = logging.getLogger(__name__)
26
24
 
@@ -56,11 +54,16 @@ def parse_key_value_string(key_value_string):
56
54
 
57
55
 
58
56
  def apply_boolean_options(
59
- true_option, true_option_name, false_option, false_option_name):
57
+ true_option, true_option_name, false_option, false_option_name
58
+ ):
60
59
  if true_option and false_option:
61
- error_message = \
62
- 'aws: error: cannot use both ' + true_option_name + \
63
- ' and ' + false_option_name + ' options together.'
60
+ error_message = (
61
+ 'aws: error: cannot use both '
62
+ + true_option_name
63
+ + ' and '
64
+ + false_option_name
65
+ + ' options together.'
66
+ )
64
67
  raise ValueError(error_message)
65
68
  elif true_option:
66
69
  return True
@@ -91,13 +94,16 @@ def apply_params(src_params, src_key, dest_params, dest_key):
91
94
 
92
95
 
93
96
  def build_step(
94
- jar, name='Step',
95
- action_on_failure=constants.DEFAULT_FAILURE_ACTION,
96
- args=None,
97
- main_class=None,
98
- properties=None):
99
- check_required_field(
100
- structure='HadoopJarStep', name='Jar', value=jar)
97
+ jar,
98
+ name='Step',
99
+ action_on_failure=constants.DEFAULT_FAILURE_ACTION,
100
+ args=None,
101
+ main_class=None,
102
+ properties=None,
103
+ log_uri=None,
104
+ encryption_key_arn=None,
105
+ ):
106
+ check_required_field(structure='HadoopJarStep', name='Jar', value=jar)
101
107
 
102
108
  step = {}
103
109
  apply_dict(step, 'Name', name)
@@ -108,17 +114,26 @@ def build_step(
108
114
  apply_dict(jar_config, 'MainClass', main_class)
109
115
  apply_dict(jar_config, 'Properties', properties)
110
116
  step['HadoopJarStep'] = jar_config
117
+ step_monitoring_config = {}
118
+ s3_monitoring_configuration = {}
119
+ apply_dict(s3_monitoring_configuration, 'LogUri', log_uri)
120
+ apply_dict(
121
+ s3_monitoring_configuration, 'EncryptionKeyArn', encryption_key_arn
122
+ )
123
+ if s3_monitoring_configuration:
124
+ step_monitoring_config['S3MonitoringConfiguration'] = (
125
+ s3_monitoring_configuration
126
+ )
127
+ step['StepMonitoringConfiguration'] = step_monitoring_config
111
128
 
112
129
  return step
113
130
 
114
131
 
115
- def build_bootstrap_action(
116
- path,
117
- name='Bootstrap Action',
118
- args=None):
132
+ def build_bootstrap_action(path, name='Bootstrap Action', args=None):
119
133
  if path is None:
120
134
  raise exceptions.MissingParametersError(
121
- object_name='ScriptBootstrapActionConfig', missing='Path')
135
+ object_name='ScriptBootstrapActionConfig', missing='Path'
136
+ )
122
137
  ba_config = {}
123
138
  apply_dict(ba_config, 'Name', name)
124
139
  script_config = {}
@@ -132,20 +147,22 @@ def build_bootstrap_action(
132
147
  def build_s3_link(relative_path='', region='us-east-1'):
133
148
  if region is None:
134
149
  region = 'us-east-1'
135
- return 's3://{0}.elasticmapreduce{1}'.format(region, relative_path)
150
+ return f's3://{region}.elasticmapreduce{relative_path}'
136
151
 
137
152
 
138
153
  def get_script_runner(region='us-east-1'):
139
154
  if region is None:
140
155
  region = 'us-east-1'
141
156
  return build_s3_link(
142
- relative_path=constants.SCRIPT_RUNNER_PATH, region=region)
157
+ relative_path=constants.SCRIPT_RUNNER_PATH, region=region
158
+ )
143
159
 
144
160
 
145
161
  def check_required_field(structure, name, value):
146
162
  if not value:
147
163
  raise exceptions.MissingParametersError(
148
- object_name=structure, missing=name)
164
+ object_name=structure, missing=name
165
+ )
149
166
 
150
167
 
151
168
  def check_empty_string_list(name, value):
@@ -153,8 +170,14 @@ def check_empty_string_list(name, value):
153
170
  raise exceptions.EmptyListError(param=name)
154
171
 
155
172
 
156
- def call(session, operation_name, parameters, region_name=None,
157
- endpoint_url=None, verify=None):
173
+ def call(
174
+ session,
175
+ operation_name,
176
+ parameters,
177
+ region_name=None,
178
+ endpoint_url=None,
179
+ verify=None,
180
+ ):
158
181
  # We could get an error from get_endpoint() about not having
159
182
  # a region configured. Before this happens we want to check
160
183
  # for credentials so we can give a good error message.
@@ -162,8 +185,11 @@ def call(session, operation_name, parameters, region_name=None,
162
185
  raise NoCredentialsError()
163
186
 
164
187
  client = session.create_client(
165
- 'emr', region_name=region_name, endpoint_url=endpoint_url,
166
- verify=verify)
188
+ 'emr',
189
+ region_name=region_name,
190
+ endpoint_url=endpoint_url,
191
+ verify=verify,
192
+ )
167
193
  LOG.debug('Calling ' + str(operation_name))
168
194
  return getattr(client, operation_name)(**parameters)
169
195
 
@@ -181,7 +207,8 @@ def get_client(session, parsed_globals):
181
207
  'emr',
182
208
  region_name=get_region(session, parsed_globals),
183
209
  endpoint_url=parsed_globals.endpoint_url,
184
- verify=parsed_globals.verify_ssl)
210
+ verify=parsed_globals.verify_ssl,
211
+ )
185
212
 
186
213
 
187
214
  def get_cluster_state(session, parsed_globals, cluster_id):
@@ -209,12 +236,13 @@ def which(program):
209
236
  return None
210
237
 
211
238
 
212
- def call_and_display_response(session, operation_name, parameters,
213
- parsed_globals):
239
+ def call_and_display_response(
240
+ session, operation_name, parameters, parsed_globals
241
+ ):
214
242
  cli_operation_caller = CLIOperationCaller(session)
215
243
  cli_operation_caller.invoke(
216
- 'emr', operation_name,
217
- parameters, parsed_globals)
244
+ 'emr', operation_name, parameters, parsed_globals
245
+ )
218
246
 
219
247
 
220
248
  def display_response(session, operation_name, result, parsed_globals):
@@ -222,7 +250,8 @@ def display_response(session, operation_name, result, parsed_globals):
222
250
  # Calling a private method. Should be changed after the functionality
223
251
  # is moved outside CliOperationCaller.
224
252
  cli_operation_caller._display_response(
225
- operation_name, result, parsed_globals)
253
+ operation_name, result, parsed_globals
254
+ )
226
255
 
227
256
 
228
257
  def get_region(session, parsed_globals):
@@ -244,8 +273,9 @@ def join(values, separator=',', lastSeparator='and'):
244
273
  return values[0]
245
274
  else:
246
275
  separator = '%s ' % separator
247
- return ' '.join([separator.join(values[:-1]),
248
- lastSeparator, values[-1]])
276
+ return ' '.join(
277
+ [separator.join(values[:-1]), lastSeparator, values[-1]]
278
+ )
249
279
 
250
280
 
251
281
  def split_to_key_value(string):
@@ -255,21 +285,24 @@ def split_to_key_value(string):
255
285
  return string.split('=', 1)
256
286
 
257
287
 
258
- def get_cluster(cluster_id, session, region,
259
- endpoint_url, verify_ssl):
260
- describe_cluster_params = {'ClusterId': cluster_id}
261
- describe_cluster_response = call(
262
- session, 'describe_cluster', describe_cluster_params,
263
- region, endpoint_url,
264
- verify_ssl)
288
+ def get_cluster(cluster_id, session, region, endpoint_url, verify_ssl):
289
+ describe_cluster_params = {'ClusterId': cluster_id}
290
+ describe_cluster_response = call(
291
+ session,
292
+ 'describe_cluster',
293
+ describe_cluster_params,
294
+ region,
295
+ endpoint_url,
296
+ verify_ssl,
297
+ )
265
298
 
266
- if describe_cluster_response is not None:
267
- return describe_cluster_response.get('Cluster')
299
+ if describe_cluster_response is not None:
300
+ return describe_cluster_response.get('Cluster')
268
301
 
269
302
 
270
- def get_release_label(cluster_id, session, region,
271
- endpoint_url, verify_ssl):
272
- cluster = get_cluster(cluster_id, session, region,
273
- endpoint_url, verify_ssl)
274
- if cluster is not None:
275
- return cluster.get('ReleaseLabel')
303
+ def get_release_label(cluster_id, session, region, endpoint_url, verify_ssl):
304
+ cluster = get_cluster(
305
+ cluster_id, session, region, endpoint_url, verify_ssl
306
+ )
307
+ if cluster is not None:
308
+ return cluster.get('ReleaseLabel')
@@ -570,3 +570,13 @@ UNHEALTHY_NODE_REPLACEMENT = (
570
570
  )
571
571
 
572
572
  EXTENDED_SUPPORT = '<p>Reserved.</p> '
573
+
574
+ MONITORING_CONFIGURATION = (
575
+ '<p>Monitoring configuration for an Amazon EMR cluster. '
576
+ 'The configuration specifies CloudWatch logging settings for the cluster. '
577
+ 'You can configure the CloudWatchLogConfiguration which includes '
578
+ 'the Enabled flag (required), LogGroupName, LogStreamNamePrefix, '
579
+ 'EncryptionKeyArn, and LogTypes. The LogTypes parameter is a map '
580
+ 'of log type categories (e.g., "STEP_LOGS", "SPARK_DRIVER", '
581
+ '"SPARK_EXECUTOR") to a list of file names (e.g., "STDOUT", "STDERR").</p>'
582
+ )
@@ -11,9 +11,7 @@
11
11
  # ANY KIND, either express or implied. See the License for the specific
12
12
  # language governing permissions and limitations under the License.
13
13
 
14
- from awscli.customizations.emr import emrutils
15
- from awscli.customizations.emr import constants
16
- from awscli.customizations.emr import exceptions
14
+ from awscli.customizations.emr import constants, emrutils, exceptions
17
15
 
18
16
 
19
17
  def build_step_config_list(parsed_step_list, region, release_label):
@@ -29,23 +27,24 @@ def build_step_config_list(parsed_step_list, region, release_label):
29
27
  step_config = build_custom_jar_step(parsed_step=step)
30
28
  elif step_type == constants.STREAMING:
31
29
  step_config = build_streaming_step(
32
- parsed_step=step, release_label=release_label)
30
+ parsed_step=step, release_label=release_label
31
+ )
33
32
  elif step_type == constants.HIVE:
34
33
  step_config = build_hive_step(
35
- parsed_step=step, region=region,
36
- release_label=release_label)
34
+ parsed_step=step, region=region, release_label=release_label
35
+ )
37
36
  elif step_type == constants.PIG:
38
37
  step_config = build_pig_step(
39
- parsed_step=step, region=region,
40
- release_label=release_label)
38
+ parsed_step=step, region=region, release_label=release_label
39
+ )
41
40
  elif step_type == constants.IMPALA:
42
41
  step_config = build_impala_step(
43
- parsed_step=step, region=region,
44
- release_label=release_label)
42
+ parsed_step=step, region=region, release_label=release_label
43
+ )
45
44
  elif step_type == constants.SPARK:
46
45
  step_config = build_spark_step(
47
- parsed_step=step, region=region,
48
- release_label=release_label)
46
+ parsed_step=step, region=region, release_label=release_label
47
+ )
49
48
  else:
50
49
  raise exceptions.UnknownStepTypeError(step_type=step_type)
51
50
 
@@ -57,14 +56,17 @@ def build_step_config_list(parsed_step_list, region, release_label):
57
56
  def build_custom_jar_step(parsed_step):
58
57
  name = _apply_default_value(
59
58
  arg=parsed_step.get('Name'),
60
- value=constants.DEFAULT_CUSTOM_JAR_STEP_NAME)
59
+ value=constants.DEFAULT_CUSTOM_JAR_STEP_NAME,
60
+ )
61
61
  action_on_failure = _apply_default_value(
62
62
  arg=parsed_step.get('ActionOnFailure'),
63
- value=constants.DEFAULT_FAILURE_ACTION)
63
+ value=constants.DEFAULT_FAILURE_ACTION,
64
+ )
64
65
  emrutils.check_required_field(
65
66
  structure=constants.CUSTOM_JAR_STEP_CONFIG,
66
67
  name='Jar',
67
- value=parsed_step.get('Jar'))
68
+ value=parsed_step.get('Jar'),
69
+ )
68
70
  return emrutils.build_step(
69
71
  jar=parsed_step.get('Jar'),
70
72
  args=parsed_step.get('Args'),
@@ -72,22 +74,27 @@ def build_custom_jar_step(parsed_step):
72
74
  action_on_failure=action_on_failure,
73
75
  main_class=parsed_step.get('MainClass'),
74
76
  properties=emrutils.parse_key_value_string(
75
- parsed_step.get('Properties')))
77
+ parsed_step.get('Properties')
78
+ ),
79
+ log_uri=parsed_step.get('LogUri'),
80
+ encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
81
+ )
76
82
 
77
83
 
78
84
  def build_streaming_step(parsed_step, release_label):
79
85
  name = _apply_default_value(
80
86
  arg=parsed_step.get('Name'),
81
- value=constants.DEFAULT_STREAMING_STEP_NAME)
87
+ value=constants.DEFAULT_STREAMING_STEP_NAME,
88
+ )
82
89
  action_on_failure = _apply_default_value(
83
90
  arg=parsed_step.get('ActionOnFailure'),
84
- value=constants.DEFAULT_FAILURE_ACTION)
91
+ value=constants.DEFAULT_FAILURE_ACTION,
92
+ )
85
93
 
86
94
  args = parsed_step.get('Args')
87
95
  emrutils.check_required_field(
88
- structure=constants.STREAMING_STEP_CONFIG,
89
- name='Args',
90
- value=args)
96
+ structure=constants.STREAMING_STEP_CONFIG, name='Args', value=args
97
+ )
91
98
  emrutils.check_empty_string_list(name='Args', value=args)
92
99
  args_list = []
93
100
 
@@ -103,27 +110,34 @@ def build_streaming_step(parsed_step, release_label):
103
110
  jar=jar,
104
111
  args=args_list,
105
112
  name=name,
106
- action_on_failure=action_on_failure)
113
+ action_on_failure=action_on_failure,
114
+ log_uri=parsed_step.get('LogUri'),
115
+ encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
116
+ )
107
117
 
108
118
 
109
119
  def build_hive_step(parsed_step, release_label, region=None):
110
120
  args = parsed_step.get('Args')
111
121
  emrutils.check_required_field(
112
- structure=constants.HIVE_STEP_CONFIG, name='Args', value=args)
122
+ structure=constants.HIVE_STEP_CONFIG, name='Args', value=args
123
+ )
113
124
  emrutils.check_empty_string_list(name='Args', value=args)
114
125
  name = _apply_default_value(
115
- arg=parsed_step.get('Name'),
116
- value=constants.DEFAULT_HIVE_STEP_NAME)
117
- action_on_failure = \
118
- _apply_default_value(
119
- arg=parsed_step.get('ActionOnFailure'),
120
- value=constants.DEFAULT_FAILURE_ACTION)
126
+ arg=parsed_step.get('Name'), value=constants.DEFAULT_HIVE_STEP_NAME
127
+ )
128
+ action_on_failure = _apply_default_value(
129
+ arg=parsed_step.get('ActionOnFailure'),
130
+ value=constants.DEFAULT_FAILURE_ACTION,
131
+ )
121
132
 
122
133
  return emrutils.build_step(
123
134
  jar=_get_runner_jar(release_label, region),
124
135
  args=_build_hive_args(args, release_label, region),
125
136
  name=name,
126
- action_on_failure=action_on_failure)
137
+ action_on_failure=action_on_failure,
138
+ log_uri=parsed_step.get('LogUri'),
139
+ encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
140
+ )
127
141
 
128
142
 
129
143
  def _build_hive_args(args, release_label, region):
@@ -131,8 +145,11 @@ def _build_hive_args(args, release_label, region):
131
145
  if release_label:
132
146
  args_list.append(constants.HIVE_SCRIPT_COMMAND)
133
147
  else:
134
- args_list.append(emrutils.build_s3_link(
135
- relative_path=constants.HIVE_SCRIPT_PATH, region=region))
148
+ args_list.append(
149
+ emrutils.build_s3_link(
150
+ relative_path=constants.HIVE_SCRIPT_PATH, region=region
151
+ )
152
+ )
136
153
 
137
154
  args_list.append(constants.RUN_HIVE_SCRIPT)
138
155
 
@@ -149,20 +166,25 @@ def _build_hive_args(args, release_label, region):
149
166
  def build_pig_step(parsed_step, release_label, region=None):
150
167
  args = parsed_step.get('Args')
151
168
  emrutils.check_required_field(
152
- structure=constants.PIG_STEP_CONFIG, name='Args', value=args)
169
+ structure=constants.PIG_STEP_CONFIG, name='Args', value=args
170
+ )
153
171
  emrutils.check_empty_string_list(name='Args', value=args)
154
172
  name = _apply_default_value(
155
- arg=parsed_step.get('Name'),
156
- value=constants.DEFAULT_PIG_STEP_NAME)
173
+ arg=parsed_step.get('Name'), value=constants.DEFAULT_PIG_STEP_NAME
174
+ )
157
175
  action_on_failure = _apply_default_value(
158
176
  arg=parsed_step.get('ActionOnFailure'),
159
- value=constants.DEFAULT_FAILURE_ACTION)
177
+ value=constants.DEFAULT_FAILURE_ACTION,
178
+ )
160
179
 
161
180
  return emrutils.build_step(
162
181
  jar=_get_runner_jar(release_label, region),
163
182
  args=_build_pig_args(args, release_label, region),
164
183
  name=name,
165
- action_on_failure=action_on_failure)
184
+ action_on_failure=action_on_failure,
185
+ log_uri=parsed_step.get('LogUri'),
186
+ encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
187
+ )
166
188
 
167
189
 
168
190
  def _build_pig_args(args, release_label, region):
@@ -170,8 +192,11 @@ def _build_pig_args(args, release_label, region):
170
192
  if release_label:
171
193
  args_list.append(constants.PIG_SCRIPT_COMMAND)
172
194
  else:
173
- args_list.append(emrutils.build_s3_link(
174
- relative_path=constants.PIG_SCRIPT_PATH, region=region))
195
+ args_list.append(
196
+ emrutils.build_s3_link(
197
+ relative_path=constants.PIG_SCRIPT_PATH, region=region
198
+ )
199
+ )
175
200
 
176
201
  args_list.append(constants.RUN_PIG_SCRIPT)
177
202
 
@@ -189,43 +214,55 @@ def build_impala_step(parsed_step, release_label, region=None):
189
214
  if release_label:
190
215
  raise exceptions.UnknownStepTypeError(step_type=constants.IMPALA)
191
216
  name = _apply_default_value(
192
- arg=parsed_step.get('Name'),
193
- value=constants.DEFAULT_IMPALA_STEP_NAME)
217
+ arg=parsed_step.get('Name'), value=constants.DEFAULT_IMPALA_STEP_NAME
218
+ )
194
219
  action_on_failure = _apply_default_value(
195
220
  arg=parsed_step.get('ActionOnFailure'),
196
- value=constants.DEFAULT_FAILURE_ACTION)
221
+ value=constants.DEFAULT_FAILURE_ACTION,
222
+ )
197
223
  args_list = [
198
224
  emrutils.build_s3_link(
199
- relative_path=constants.IMPALA_INSTALL_PATH, region=region),
200
- constants.RUN_IMPALA_SCRIPT]
225
+ relative_path=constants.IMPALA_INSTALL_PATH, region=region
226
+ ),
227
+ constants.RUN_IMPALA_SCRIPT,
228
+ ]
201
229
  args = parsed_step.get('Args')
202
230
  emrutils.check_required_field(
203
- structure=constants.IMPALA_STEP_CONFIG, name='Args', value=args)
231
+ structure=constants.IMPALA_STEP_CONFIG, name='Args', value=args
232
+ )
204
233
  args_list += args
205
234
 
206
235
  return emrutils.build_step(
207
236
  jar=emrutils.get_script_runner(region),
208
237
  args=args_list,
209
238
  name=name,
210
- action_on_failure=action_on_failure)
239
+ action_on_failure=action_on_failure,
240
+ log_uri=parsed_step.get('LogUri'),
241
+ encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
242
+ )
211
243
 
212
244
 
213
245
  def build_spark_step(parsed_step, release_label, region=None):
214
246
  name = _apply_default_value(
215
- arg=parsed_step.get('Name'),
216
- value=constants.DEFAULT_SPARK_STEP_NAME)
247
+ arg=parsed_step.get('Name'), value=constants.DEFAULT_SPARK_STEP_NAME
248
+ )
217
249
  action_on_failure = _apply_default_value(
218
250
  arg=parsed_step.get('ActionOnFailure'),
219
- value=constants.DEFAULT_FAILURE_ACTION)
251
+ value=constants.DEFAULT_FAILURE_ACTION,
252
+ )
220
253
  args = parsed_step.get('Args')
221
254
  emrutils.check_required_field(
222
- structure=constants.SPARK_STEP_CONFIG, name='Args', value=args)
255
+ structure=constants.SPARK_STEP_CONFIG, name='Args', value=args
256
+ )
223
257
 
224
258
  return emrutils.build_step(
225
259
  jar=_get_runner_jar(release_label, region),
226
260
  args=_build_spark_args(args, release_label, region),
227
261
  name=name,
228
- action_on_failure=action_on_failure)
262
+ action_on_failure=action_on_failure,
263
+ log_uri=parsed_step.get('LogUri'),
264
+ encryption_key_arn=parsed_step.get('EncryptionKeyArn'),
265
+ )
229
266
 
230
267
 
231
268
  def _build_spark_args(args, release_label, region):
@@ -247,5 +284,8 @@ def _apply_default_value(arg, value):
247
284
 
248
285
 
249
286
  def _get_runner_jar(release_label, region):
250
- return constants.COMMAND_RUNNER if release_label \
287
+ return (
288
+ constants.COMMAND_RUNNER
289
+ if release_label
251
290
  else emrutils.get_script_runner(region)
291
+ )