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.
- awscli/__init__.py +1 -1
- awscli/alias.py +3 -3
- awscli/argprocess.py +2 -1
- awscli/arguments.py +1 -1
- awscli/bcdoc/docevents.py +3 -0
- awscli/clidocs.py +19 -2
- awscli/clidriver.py +55 -9
- awscli/customizations/argrename.py +1 -0
- awscli/customizations/cliinputjson.py +4 -0
- awscli/customizations/cloudformation/deploy.py +19 -3
- awscli/customizations/cloudtrail/validation.py +22 -2
- awscli/customizations/commands.py +2 -1
- awscli/customizations/eks/update_kubeconfig.py +12 -1
- awscli/customizations/emr/argumentschema.py +355 -344
- awscli/customizations/emr/createcluster.py +12 -0
- awscli/customizations/emr/emrutils.py +83 -50
- awscli/customizations/emr/helptext.py +10 -0
- awscli/customizations/emr/steputils.py +92 -52
- awscli/customizations/globalargs.py +169 -0
- awscli/customizations/paginate.py +66 -1
- awscli/customizations/s3/filegenerator.py +4 -1
- awscli/customizations/s3/fileinfo.py +4 -1
- awscli/customizations/s3/fileinfobuilder.py +6 -0
- awscli/customizations/s3/s3handler.py +9 -0
- awscli/customizations/s3/subcommands.py +147 -6
- awscli/customizations/s3/syncstrategy/base.py +9 -0
- awscli/customizations/s3/syncstrategy/caseconflict.py +92 -0
- awscli/customizations/s3/utils.py +14 -0
- awscli/customizations/scalarparse.py +48 -9
- awscli/data/cli.json +5 -0
- awscli/examples/cloudformation/create-generated-template.rst +50 -0
- awscli/examples/cloudformation/create-stack-refactor.rst +16 -0
- awscli/examples/cloudformation/delete-generated-template.rst +10 -0
- awscli/examples/cloudformation/describe-generated-template.rst +62 -0
- awscli/examples/cloudformation/describe-resource-scan.rst +38 -0
- awscli/examples/cloudformation/describe-stack-refactor.rst +20 -0
- awscli/examples/cloudformation/execute-stack-refactor.rst +10 -0
- awscli/examples/cloudformation/list-generated-templates.rst +41 -0
- awscli/examples/cloudformation/list-resource-scan-related-resources.rst +47 -0
- awscli/examples/cloudformation/list-resource-scan-resources.rst +30 -0
- awscli/examples/cloudformation/list-stack-refactor-actions.rst +71 -0
- awscli/examples/cloudformation/start-resource-scan.rst +14 -0
- awscli/examples/global_options.rst +4 -0
- awscli/examples/global_synopsis.rst +1 -0
- awscli/examples/ivs-realtime/get-composition.rst +7 -4
- awscli/examples/ivs-realtime/start-composition.rst +88 -3
- awscli/examples/lambda/create-function.rst +4 -4
- awscli/examples/lambda/get-function.rst +3 -3
- awscli/examples/lambda/list-functions.rst +6 -6
- awscli/examples/medical-imaging/create-datastore.rst +19 -2
- awscli/examples/medical-imaging/get-datastore.rst +24 -1
- awscli/examples/securityhub/describe-hub.rst +6 -4
- awscli/examples/servicediscovery/create-service.rst +50 -10
- awscli/examples/servicediscovery/delete-namespace.rst +18 -4
- awscli/examples/servicediscovery/delete-service-attributes.rst +15 -3
- awscli/examples/servicediscovery/delete-service.rst +13 -3
- awscli/examples/servicediscovery/deregister-instance.rst +18 -2
- awscli/examples/servicediscovery/discover-instances-revision.rst +18 -1
- awscli/examples/servicediscovery/discover-instances.rst +32 -2
- awscli/examples/servicediscovery/get-instance.rst +30 -4
- awscli/examples/servicediscovery/get-instances-health-status.rst +19 -1
- awscli/examples/servicediscovery/get-namespace.rst +40 -9
- awscli/examples/servicediscovery/get-operation.rst +32 -6
- awscli/examples/servicediscovery/get-service-attributes.rst +25 -3
- awscli/examples/servicediscovery/get-service.rst +35 -7
- awscli/examples/servicediscovery/list-instances.rst +38 -3
- awscli/examples/servicediscovery/list-namespaces.rst +45 -22
- awscli/examples/servicediscovery/list-services.rst +30 -2
- awscli/examples/servicediscovery/register-instance.rst +18 -2
- awscli/examples/servicediscovery/update-http-namespace.rst +22 -5
- awscli/examples/servicediscovery/update-instance-custom-health-status.rst +14 -1
- awscli/examples/servicediscovery/update-private-dns-namespace.rst +22 -5
- awscli/examples/servicediscovery/update-public-dns-namespace.rst +22 -5
- awscli/examples/servicediscovery/update-service-attributes.rst +14 -2
- awscli/examples/servicediscovery/update-service.rst +20 -4
- awscli/paramfile.py +21 -4
- awscli/testutils.py +17 -0
- awscli/topics/config-vars.rst +1 -1
- awscli/topics/s3-case-insensitivity.rst +105 -0
- awscli/topics/topic-tags.json +16 -0
- awscli/utils.py +19 -2
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/METADATA +5 -3
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/RECORD +91 -132
- awscli/examples/qldb/cancel-journal-kinesis-stream.rst +0 -15
- awscli/examples/qldb/create-ledger.rst +0 -43
- awscli/examples/qldb/delete-ledger.rst +0 -10
- awscli/examples/qldb/describe-journal-kinesis-stream.rst +0 -29
- awscli/examples/qldb/describe-journal-s3-export.rst +0 -30
- awscli/examples/qldb/describe-ledger.rst +0 -23
- awscli/examples/qldb/export-journal-to-s3.rst +0 -28
- awscli/examples/qldb/get-block.rst +0 -55
- awscli/examples/qldb/get-digest.rst +0 -17
- awscli/examples/qldb/get-revision.rst +0 -57
- awscli/examples/qldb/list-journal-kinesis-streams-for-ledger.rst +0 -30
- awscli/examples/qldb/list-journal-s3-exports-for-ledger.rst +0 -31
- awscli/examples/qldb/list-journal-s3-exports.rst +0 -46
- awscli/examples/qldb/list-ledgers.rst +0 -24
- awscli/examples/qldb/list-tags-for-resource.rst +0 -17
- awscli/examples/qldb/stream-journal-to-kinesis.rst +0 -46
- awscli/examples/qldb/tag-resource.rst +0 -11
- awscli/examples/qldb/untag-resource.rst +0 -11
- awscli/examples/qldb/update-ledger-permissions-mode.rst +0 -34
- awscli/examples/qldb/update-ledger.rst +0 -63
- awscli/examples/robomaker/batch-describe-simulation-job.rst +0 -150
- awscli/examples/robomaker/cancel-simulation-job.rst +0 -6
- awscli/examples/robomaker/create-deployment-job.rst +0 -37
- awscli/examples/robomaker/create-fleet.rst +0 -18
- awscli/examples/robomaker/create-robot-application-version.rst +0 -31
- awscli/examples/robomaker/create-robot-application.rst +0 -29
- awscli/examples/robomaker/create-robot.rst +0 -20
- awscli/examples/robomaker/create-simulation-application-version.rst +0 -39
- awscli/examples/robomaker/create-simulation-application.rst +0 -38
- awscli/examples/robomaker/create-simulation-job.rst +0 -43
- awscli/examples/robomaker/delete-fleet.rst +0 -7
- awscli/examples/robomaker/delete-robot-application.rst +0 -7
- awscli/examples/robomaker/delete-robot.rst +0 -7
- awscli/examples/robomaker/delete-simulation-application.rst +0 -7
- awscli/examples/robomaker/deregister-robot.rst +0 -14
- awscli/examples/robomaker/describe-deployment-job.rst +0 -38
- awscli/examples/robomaker/describe-fleet.rst +0 -28
- awscli/examples/robomaker/describe-robot-application.rst +0 -29
- awscli/examples/robomaker/describe-robot.rst +0 -21
- awscli/examples/robomaker/describe-simulation-application.rst +0 -37
- awscli/examples/robomaker/describe-simulation-job.rst +0 -45
- awscli/examples/robomaker/list-deployment-jobs.rst +0 -57
- awscli/examples/robomaker/list-fleets.rst +0 -22
- awscli/examples/robomaker/list-robot-applications.rst +0 -32
- awscli/examples/robomaker/list-robots.rst +0 -45
- awscli/examples/robomaker/list-simulation-applications.rst +0 -50
- awscli/examples/robomaker/list-simulation-jobs.rst +0 -80
- awscli/examples/robomaker/list-tags-for-resource.rst +0 -16
- awscli/examples/robomaker/register-robot.rst +0 -14
- awscli/examples/robomaker/restart-simulation-job.rst +0 -7
- awscli/examples/robomaker/sync-deployment-job.rst +0 -30
- awscli/examples/robomaker/tag-resource.rst +0 -7
- awscli/examples/robomaker/untag-resource.rst +0 -7
- awscli/examples/robomaker/update-robot-application.rst +0 -28
- awscli/examples/robomaker/update-simulation-application.rst +0 -36
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws +0 -0
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws.cmd +0 -0
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_bash_completer +0 -0
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_completer +0 -0
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_zsh_completer.sh +0 -0
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/LICENSE.txt +0 -0
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/WHEEL +0 -0
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/top_level.txt +0 -0
awscli/__init__.py
CHANGED
awscli/alias.py
CHANGED
|
@@ -183,7 +183,7 @@ class ServiceAliasCommand(BaseAliasCommand):
|
|
|
183
183
|
parsed_alias_args, remaining = self._parser.parse_known_args(
|
|
184
184
|
alias_args
|
|
185
185
|
)
|
|
186
|
-
self._update_parsed_globals(parsed_alias_args, parsed_globals)
|
|
186
|
+
self._update_parsed_globals(parsed_alias_args, parsed_globals, remaining)
|
|
187
187
|
# Take any of the remaining arguments that were not parsed out and
|
|
188
188
|
# prepend them to the remaining args provided to the alias.
|
|
189
189
|
remaining.extend(args)
|
|
@@ -228,7 +228,7 @@ class ServiceAliasCommand(BaseAliasCommand):
|
|
|
228
228
|
)
|
|
229
229
|
return alias_args
|
|
230
230
|
|
|
231
|
-
def _update_parsed_globals(self, parsed_alias_args, parsed_globals):
|
|
231
|
+
def _update_parsed_globals(self, parsed_alias_args, parsed_globals, remaining):
|
|
232
232
|
global_params_to_update = self._get_global_parameters_to_update(
|
|
233
233
|
parsed_alias_args
|
|
234
234
|
)
|
|
@@ -237,7 +237,7 @@ class ServiceAliasCommand(BaseAliasCommand):
|
|
|
237
237
|
# global parameters provided in the alias before updating
|
|
238
238
|
# the original provided global parameter values
|
|
239
239
|
# and passing those onto subsequent commands.
|
|
240
|
-
emit_top_level_args_parsed_event(self._session, parsed_alias_args)
|
|
240
|
+
emit_top_level_args_parsed_event(self._session, parsed_alias_args, remaining)
|
|
241
241
|
for param_name in global_params_to_update:
|
|
242
242
|
updated_param_value = getattr(parsed_alias_args, param_name)
|
|
243
243
|
setattr(parsed_globals, param_name, updated_param_value)
|
awscli/argprocess.py
CHANGED
|
@@ -65,7 +65,7 @@ class TooComplexError(Exception):
|
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
def unpack_argument(
|
|
68
|
-
session, service_name, operation_name, cli_argument, value
|
|
68
|
+
session, service_name, operation_name, cli_argument, value, parsed_globals
|
|
69
69
|
):
|
|
70
70
|
"""
|
|
71
71
|
Unpack an argument's value from the commandline. This is part one of a two
|
|
@@ -83,6 +83,7 @@ def unpack_argument(
|
|
|
83
83
|
value=value,
|
|
84
84
|
service_name=service_name,
|
|
85
85
|
operation_name=operation_name,
|
|
86
|
+
parsed_globals=parsed_globals,
|
|
86
87
|
)
|
|
87
88
|
|
|
88
89
|
if value_override is not None:
|
awscli/arguments.py
CHANGED
awscli/bcdoc/docevents.py
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
DOC_EVENTS = {
|
|
16
|
+
'doc-meta-description': '.%s',
|
|
16
17
|
'doc-breadcrumbs': '.%s',
|
|
17
18
|
'doc-title': '.%s',
|
|
18
19
|
'doc-description': '.%s',
|
|
@@ -39,6 +40,8 @@ def generate_events(session, help_command):
|
|
|
39
40
|
# Now generate the documentation events
|
|
40
41
|
session.emit('doc-breadcrumbs.%s' % help_command.event_class,
|
|
41
42
|
help_command=help_command)
|
|
43
|
+
session.emit('doc-meta-description.%s' % help_command.event_class,
|
|
44
|
+
help_command=help_command)
|
|
42
45
|
session.emit('doc-title.%s' % help_command.event_class,
|
|
43
46
|
help_command=help_command)
|
|
44
47
|
session.emit('doc-description.%s' % help_command.event_class,
|
awscli/clidocs.py
CHANGED
|
@@ -17,7 +17,7 @@ import re
|
|
|
17
17
|
from botocore.model import StringShape
|
|
18
18
|
from botocore.utils import is_json_value_header
|
|
19
19
|
|
|
20
|
-
from awscli import SCALAR_TYPES
|
|
20
|
+
from awscli import SCALAR_TYPES, __version__ as AWS_CLI_VERSION
|
|
21
21
|
from awscli.argprocess import ParamShorthandDocGen
|
|
22
22
|
from awscli.bcdoc.docevents import DOC_EVENTS
|
|
23
23
|
from awscli.topictags import TopicTagDB
|
|
@@ -114,7 +114,8 @@ class CLIDocumentEventHandler:
|
|
|
114
114
|
full_cmd_list.append(cmd)
|
|
115
115
|
full_cmd_name = ' '.join(full_cmd_list)
|
|
116
116
|
doc.write(f':ref:`{cmd} <cli:{full_cmd_name}>`')
|
|
117
|
-
doc.
|
|
117
|
+
doc.writeln(' ]')
|
|
118
|
+
doc.writeln('')
|
|
118
119
|
|
|
119
120
|
def doc_title(self, help_command, **kwargs):
|
|
120
121
|
doc = help_command.doc
|
|
@@ -223,6 +224,9 @@ class CLIDocumentEventHandler:
|
|
|
223
224
|
)
|
|
224
225
|
doc.write('\n')
|
|
225
226
|
|
|
227
|
+
def doc_meta_description(self, help_command, **kwargs):
|
|
228
|
+
pass
|
|
229
|
+
|
|
226
230
|
def _document_enums(self, model, doc):
|
|
227
231
|
"""Documents top-level parameter enums"""
|
|
228
232
|
if isinstance(model, StringShape):
|
|
@@ -402,6 +406,13 @@ class ServiceDocumentEventHandler(CLIDocumentEventHandler):
|
|
|
402
406
|
else:
|
|
403
407
|
doc.style.tocitem(command_name)
|
|
404
408
|
|
|
409
|
+
def doc_meta_description(self, help_command, **kwargs):
|
|
410
|
+
doc = help_command.doc
|
|
411
|
+
reference = help_command.event_class.replace('.', ' ')
|
|
412
|
+
doc.writeln(".. meta::")
|
|
413
|
+
doc.writeln(f" :description: Learn about the AWS CLI {AWS_CLI_VERSION} {reference} commands.")
|
|
414
|
+
doc.writeln("")
|
|
415
|
+
|
|
405
416
|
|
|
406
417
|
class OperationDocumentEventHandler(CLIDocumentEventHandler):
|
|
407
418
|
AWS_DOC_BASE = 'https://docs.aws.amazon.com/goto/WebAPI'
|
|
@@ -618,6 +629,12 @@ class OperationDocumentEventHandler(CLIDocumentEventHandler):
|
|
|
618
629
|
for member_name, member_shape in output_shape.members.items():
|
|
619
630
|
self._doc_member(doc, member_name, member_shape, stack=[])
|
|
620
631
|
|
|
632
|
+
def doc_meta_description(self, help_command, **kwargs):
|
|
633
|
+
doc = help_command.doc
|
|
634
|
+
reference = help_command.event_class.replace('.', ' ')
|
|
635
|
+
doc.writeln(".. meta::")
|
|
636
|
+
doc.writeln(f" :description: Use the AWS CLI {AWS_CLI_VERSION} to run the {reference} command.")
|
|
637
|
+
doc.writeln("")
|
|
621
638
|
|
|
622
639
|
class TopicListerDocumentEventHandler(CLIDocumentEventHandler):
|
|
623
640
|
DESCRIPTION = (
|
awscli/clidriver.py
CHANGED
|
@@ -48,7 +48,7 @@ from awscli.help import (
|
|
|
48
48
|
ServiceHelpCommand,
|
|
49
49
|
)
|
|
50
50
|
from awscli.plugin import load_plugins
|
|
51
|
-
from awscli.utils import emit_top_level_args_parsed_event, write_exception, create_nested_client
|
|
51
|
+
from awscli.utils import emit_top_level_args_parsed_event, write_exception, create_nested_client, resolve_v2_debug_mode
|
|
52
52
|
from botocore import __version__ as botocore_version
|
|
53
53
|
from botocore import xform_name
|
|
54
54
|
|
|
@@ -225,7 +225,7 @@ class CLIDriver:
|
|
|
225
225
|
# that exceptions can be raised, which should have the same
|
|
226
226
|
# general exception handling logic as calling into the
|
|
227
227
|
# command table. This is why it's in the try/except clause.
|
|
228
|
-
self._handle_top_level_args(parsed_args)
|
|
228
|
+
self._handle_top_level_args(parsed_args, remaining)
|
|
229
229
|
self._emit_session_event(parsed_args)
|
|
230
230
|
HISTORY_RECORDER.record(
|
|
231
231
|
'CLI_VERSION', self.session.user_agent(), 'CLI'
|
|
@@ -279,8 +279,8 @@ class CLIDriver:
|
|
|
279
279
|
sys.stderr.write(msg)
|
|
280
280
|
sys.stderr.write('\n')
|
|
281
281
|
|
|
282
|
-
def _handle_top_level_args(self, args):
|
|
283
|
-
emit_top_level_args_parsed_event(self.session, args)
|
|
282
|
+
def _handle_top_level_args(self, args, remaining):
|
|
283
|
+
emit_top_level_args_parsed_event(self.session, args, remaining)
|
|
284
284
|
if args.profile:
|
|
285
285
|
self.session.set_config_variable('profile', args.profile)
|
|
286
286
|
if args.region:
|
|
@@ -542,9 +542,15 @@ class ServiceOperation:
|
|
|
542
542
|
event, parsed_args=parsed_args, parsed_globals=parsed_globals
|
|
543
543
|
)
|
|
544
544
|
call_parameters = self._build_call_parameters(
|
|
545
|
-
parsed_args, self.arg_table
|
|
545
|
+
parsed_args, self.arg_table, parsed_globals
|
|
546
546
|
)
|
|
547
547
|
|
|
548
|
+
self._detect_binary_file_migration_change(
|
|
549
|
+
self._session,
|
|
550
|
+
parsed_args,
|
|
551
|
+
parsed_globals,
|
|
552
|
+
self.arg_table
|
|
553
|
+
)
|
|
548
554
|
event = f'calling-command.{self._parent_name}.{self._name}'
|
|
549
555
|
override = self._emit_first_non_none_response(
|
|
550
556
|
event,
|
|
@@ -590,7 +596,7 @@ class ServiceOperation:
|
|
|
590
596
|
# CLIArguments for values.
|
|
591
597
|
parser.add_argument('help', nargs='?')
|
|
592
598
|
|
|
593
|
-
def _build_call_parameters(self, args, arg_table):
|
|
599
|
+
def _build_call_parameters(self, args, arg_table, parsed_globals):
|
|
594
600
|
# We need to convert the args specified on the command
|
|
595
601
|
# line as valid **kwargs we can hand to botocore.
|
|
596
602
|
service_params = {}
|
|
@@ -601,11 +607,11 @@ class ServiceOperation:
|
|
|
601
607
|
py_name = arg_object.py_name
|
|
602
608
|
if py_name in parsed_args:
|
|
603
609
|
value = parsed_args[py_name]
|
|
604
|
-
value = self._unpack_arg(arg_object, value)
|
|
610
|
+
value = self._unpack_arg(arg_object, value, parsed_globals)
|
|
605
611
|
arg_object.add_to_params(service_params, value)
|
|
606
612
|
return service_params
|
|
607
613
|
|
|
608
|
-
def _unpack_arg(self, cli_argument, value):
|
|
614
|
+
def _unpack_arg(self, cli_argument, value, parsed_globals):
|
|
609
615
|
# Unpacks a commandline argument into a Python value by firing the
|
|
610
616
|
# load-cli-arg.service-name.operation-name event.
|
|
611
617
|
session = self._session
|
|
@@ -613,7 +619,7 @@ class ServiceOperation:
|
|
|
613
619
|
operation_name = xform_name(self._name, '-')
|
|
614
620
|
|
|
615
621
|
return unpack_argument(
|
|
616
|
-
session, service_name, operation_name, cli_argument, value
|
|
622
|
+
session, service_name, operation_name, cli_argument, value, parsed_globals
|
|
617
623
|
)
|
|
618
624
|
|
|
619
625
|
def _create_argument_table(self):
|
|
@@ -661,6 +667,46 @@ class ServiceOperation:
|
|
|
661
667
|
parser = ArgTableArgParser(arg_table)
|
|
662
668
|
return parser
|
|
663
669
|
|
|
670
|
+
def _detect_binary_file_migration_change(
|
|
671
|
+
self,
|
|
672
|
+
session,
|
|
673
|
+
parsed_args,
|
|
674
|
+
parsed_globals,
|
|
675
|
+
arg_table
|
|
676
|
+
):
|
|
677
|
+
if (
|
|
678
|
+
session.get_scoped_config()
|
|
679
|
+
.get('cli_binary_format', None) == 'raw-in-base64-out'
|
|
680
|
+
):
|
|
681
|
+
# if cli_binary_format is set to raw-in-base64-out, then v2 behavior will
|
|
682
|
+
# be the same as v1, so there is no breaking change in this case.
|
|
683
|
+
return
|
|
684
|
+
if resolve_v2_debug_mode(parsed_globals):
|
|
685
|
+
parsed_args_to_check = {
|
|
686
|
+
arg: getattr(parsed_args, arg)
|
|
687
|
+
for arg in vars(parsed_args) if getattr(parsed_args, arg)
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
arg_values_to_check = [
|
|
691
|
+
arg.py_name for arg in arg_table.values()
|
|
692
|
+
if arg.py_name in parsed_args_to_check
|
|
693
|
+
and arg.argument_model.type_name == 'blob'
|
|
694
|
+
]
|
|
695
|
+
if arg_values_to_check:
|
|
696
|
+
print(
|
|
697
|
+
'\nAWS CLI v2 UPGRADE WARNING: When specifying a '
|
|
698
|
+
'blob-type parameter, AWS CLI v2 will assume the '
|
|
699
|
+
'parameter value is base64-encoded. This is different '
|
|
700
|
+
'from v1 behavior, where the AWS CLI will automatically '
|
|
701
|
+
'encode the value to base64. To retain v1 behavior in '
|
|
702
|
+
'AWS CLI v2, set the `cli_binary_format` configuration '
|
|
703
|
+
'variable to `raw-in-base64-out`. See '
|
|
704
|
+
'https://docs.aws.amazon.com/cli/latest/userguide/'
|
|
705
|
+
'cliv2-migration-changes.html'
|
|
706
|
+
'#cliv2-migration-binaryparam.\n',
|
|
707
|
+
file=sys.stderr
|
|
708
|
+
)
|
|
709
|
+
|
|
664
710
|
|
|
665
711
|
class CLIOperationCaller:
|
|
666
712
|
"""Call an AWS operation and format the response."""
|
|
@@ -95,6 +95,7 @@ ARGUMENT_RENAMES = {
|
|
|
95
95
|
'eks.update-cluster-version.version': 'kubernetes-version',
|
|
96
96
|
'eks.create-nodegroup.version': 'kubernetes-version',
|
|
97
97
|
'eks.update-nodegroup-version.version': 'kubernetes-version',
|
|
98
|
+
'eks.update-cluster-components-version.version': 'kubernetes-version',
|
|
98
99
|
'schemas.*.version': 'schema-version',
|
|
99
100
|
'sagemaker.delete-image-version.version': 'version-number',
|
|
100
101
|
'sagemaker.describe-image-version.version': 'version-number',
|
|
@@ -70,6 +70,10 @@ class CliInputJSONArgument(OverrideRequiredArgsArgument):
|
|
|
70
70
|
try:
|
|
71
71
|
# Try to load the JSON string into a python dictionary
|
|
72
72
|
input_data = json.loads(retrieved_json)
|
|
73
|
+
self._session.register(
|
|
74
|
+
f"get-cli-input-json-data",
|
|
75
|
+
lambda **inner_kwargs: input_data
|
|
76
|
+
)
|
|
73
77
|
except ValueError as e:
|
|
74
78
|
raise ParamError(
|
|
75
79
|
self.name, "Invalid JSON: %s\nJSON received: %s"
|
|
@@ -24,7 +24,8 @@ from awscli.customizations.cloudformation.yamlhelper import yaml_parse
|
|
|
24
24
|
|
|
25
25
|
from awscli.customizations.commands import BasicCommand
|
|
26
26
|
from awscli.compat import get_stdout_text_writer
|
|
27
|
-
from awscli.utils import
|
|
27
|
+
from awscli.customizations.utils import uni_print
|
|
28
|
+
from awscli.utils import create_nested_client, write_exception, resolve_v2_debug_mode
|
|
28
29
|
|
|
29
30
|
LOG = logging.getLogger(__name__)
|
|
30
31
|
|
|
@@ -316,18 +317,33 @@ class DeployCommand(BasicCommand):
|
|
|
316
317
|
s3_uploader = None
|
|
317
318
|
|
|
318
319
|
deployer = Deployer(cloudformation_client)
|
|
320
|
+
v2_debug = resolve_v2_debug_mode(parsed_globals)
|
|
319
321
|
return self.deploy(deployer, stack_name, template_str,
|
|
320
322
|
parameters, parsed_args.capabilities,
|
|
321
323
|
parsed_args.execute_changeset, parsed_args.role_arn,
|
|
322
324
|
parsed_args.notification_arns, s3_uploader,
|
|
323
325
|
tags, parsed_args.fail_on_empty_changeset,
|
|
324
|
-
parsed_args.disable_rollback)
|
|
326
|
+
parsed_args.disable_rollback, v2_debug)
|
|
325
327
|
|
|
326
328
|
def deploy(self, deployer, stack_name, template_str,
|
|
327
329
|
parameters, capabilities, execute_changeset, role_arn,
|
|
328
330
|
notification_arns, s3_uploader, tags,
|
|
329
|
-
fail_on_empty_changeset=True, disable_rollback=False
|
|
331
|
+
fail_on_empty_changeset=True, disable_rollback=False,
|
|
332
|
+
v2_debug=False):
|
|
330
333
|
try:
|
|
334
|
+
if v2_debug and fail_on_empty_changeset:
|
|
335
|
+
uni_print(
|
|
336
|
+
'\nAWS CLI v2 UPGRADE WARNING: In AWS CLI v2, deploying '
|
|
337
|
+
'an AWS CloudFormation Template that results in an empty '
|
|
338
|
+
'changeset will NOT result in an error by default. This '
|
|
339
|
+
'is different from v1 behavior, where empty changesets '
|
|
340
|
+
'result in an error by default. To migrate to v2 behavior '
|
|
341
|
+
'and resolve this warning, you can add the '
|
|
342
|
+
'`--no-fail-on-empty-changeset` flag to the command. '
|
|
343
|
+
'See https://docs.aws.amazon.com/cli/latest/userguide/'
|
|
344
|
+
'cliv2-migration-changes.html#cliv2-migration-cfn.\n',
|
|
345
|
+
out_file=sys.stderr
|
|
346
|
+
)
|
|
331
347
|
result = deployer.create_and_wait_for_changeset(
|
|
332
348
|
stack_name=stack_name,
|
|
333
349
|
cfn_template=template_str,
|
|
@@ -282,9 +282,10 @@ class DigestProvider(object):
|
|
|
282
282
|
"""
|
|
283
283
|
digests = []
|
|
284
284
|
marker = self._create_digest_key(start_date, prefix)
|
|
285
|
+
s3_digest_files_prefix = self._create_digest_prefix(start_date, prefix)
|
|
285
286
|
client = self._client_provider.get_client(bucket)
|
|
286
287
|
paginator = client.get_paginator('list_objects')
|
|
287
|
-
page_iterator = paginator.paginate(Bucket=bucket, Marker=marker)
|
|
288
|
+
page_iterator = paginator.paginate(Bucket=bucket, Marker=marker, Prefix=s3_digest_files_prefix)
|
|
288
289
|
key_filter = page_iterator.search('Contents[*].Key')
|
|
289
290
|
# Create a target start end end date
|
|
290
291
|
target_start_date = format_date(normalize_date(start_date))
|
|
@@ -294,7 +295,7 @@ class DigestProvider(object):
|
|
|
294
295
|
# Ensure digests are from the same trail.
|
|
295
296
|
digest_key_regex = re.compile(self._create_digest_key_regex(prefix))
|
|
296
297
|
for key in key_filter:
|
|
297
|
-
if digest_key_regex.match(key):
|
|
298
|
+
if key and digest_key_regex.match(key):
|
|
298
299
|
# Use a lexicographic comparison to know when to stop.
|
|
299
300
|
extracted_date = extract_digest_key_date(key)
|
|
300
301
|
if extracted_date > target_end_date:
|
|
@@ -361,6 +362,25 @@ class DigestProvider(object):
|
|
|
361
362
|
key = key_prefix + '/' + key
|
|
362
363
|
return key
|
|
363
364
|
|
|
365
|
+
def _create_digest_prefix(self, start_date, key_prefix):
|
|
366
|
+
"""Creates an S3 prefix to scope listing to trail's region.
|
|
367
|
+
|
|
368
|
+
:return: Returns a prefix string to limit S3 listing scope.
|
|
369
|
+
"""
|
|
370
|
+
template = 'AWSLogs/'
|
|
371
|
+
template_params = {
|
|
372
|
+
'account_id': self.account_id,
|
|
373
|
+
'source_region': self.trail_source_region
|
|
374
|
+
}
|
|
375
|
+
if self.organization_id:
|
|
376
|
+
template += '{organization_id}/'
|
|
377
|
+
template_params['organization_id'] = self.organization_id
|
|
378
|
+
template += '{account_id}/CloudTrail-Digest/{source_region}'
|
|
379
|
+
prefix = template.format(**template_params)
|
|
380
|
+
if key_prefix:
|
|
381
|
+
prefix = key_prefix + '/' + prefix
|
|
382
|
+
return prefix
|
|
383
|
+
|
|
364
384
|
def _create_digest_key_regex(self, key_prefix):
|
|
365
385
|
"""Creates a regular expression used to match against S3 keys"""
|
|
366
386
|
template = 'AWSLogs/'
|
|
@@ -77,6 +77,12 @@ class UpdateKubeconfigCommand(BasicCommand):
|
|
|
77
77
|
"connect to the cluster the first time."),
|
|
78
78
|
'required': False
|
|
79
79
|
},
|
|
80
|
+
{
|
|
81
|
+
'name': 'proxy-url',
|
|
82
|
+
'help_text': ("Optionally specify a proxy url to route "
|
|
83
|
+
"traffic via when connecting to a cluster."),
|
|
84
|
+
'required': False
|
|
85
|
+
},
|
|
80
86
|
{
|
|
81
87
|
'name': 'dry-run',
|
|
82
88
|
'action': 'store_true',
|
|
@@ -305,7 +311,7 @@ class EKSClient(object):
|
|
|
305
311
|
endpoint = self.cluster_description.get("endpoint")
|
|
306
312
|
arn = self.cluster_description.get("arn")
|
|
307
313
|
|
|
308
|
-
|
|
314
|
+
generated_cluster = OrderedDict([
|
|
309
315
|
("cluster", OrderedDict([
|
|
310
316
|
("certificate-authority-data", cert_data),
|
|
311
317
|
("server", endpoint)
|
|
@@ -313,6 +319,11 @@ class EKSClient(object):
|
|
|
313
319
|
("name", arn)
|
|
314
320
|
])
|
|
315
321
|
|
|
322
|
+
if self._parsed_args.proxy_url is not None:
|
|
323
|
+
generated_cluster["cluster"]["proxy-url"] = self._parsed_args.proxy_url
|
|
324
|
+
|
|
325
|
+
return generated_cluster
|
|
326
|
+
|
|
316
327
|
def get_user_entry(self, user_alias=None):
|
|
317
328
|
"""
|
|
318
329
|
Return a user entry generated using
|