diff -Nru awscli-1.11.13/awscli/alias.py awscli-1.18.69/awscli/alias.py
--- awscli-1.11.13/awscli/alias.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/alias.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,283 @@
+# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import logging
+import os
+import shlex
+import subprocess
+
+from botocore.configloader import raw_config_parse
+
+from awscli.compat import compat_shell_quote
+from awscli.commands import CLICommand
+from awscli.utils import emit_top_level_args_parsed_event
+
+
+LOG = logging.getLogger(__name__)
+
+
+class InvalidAliasException(Exception):
+ pass
+
+
+class AliasLoader(object):
+ def __init__(self,
+ alias_filename=os.path.expanduser(
+ os.path.join('~', '.aws', 'cli', 'alias'))):
+ """Interface for loading and interacting with alias file
+
+ :param alias_filename: The name of the file to load aliases from.
+ This file must be an INI file.
+ """
+ self._filename = alias_filename
+ self._aliases = None
+
+ def _build_aliases(self):
+ self._aliases = self._load_aliases()
+ self._cleanup_alias_values(self._aliases.get('toplevel', {}))
+
+ def _load_aliases(self):
+ if os.path.exists(self._filename):
+ return raw_config_parse(
+ self._filename, parse_subsections=False)
+ return {'toplevel': {}}
+
+ def _cleanup_alias_values(self, aliases):
+ for alias in aliases:
+ # Beginning and end line separators should not be included
+ # in the internal representation of the alias value.
+ aliases[alias] = aliases[alias].strip()
+
+ def get_aliases(self):
+ if self._aliases is None:
+ self._build_aliases()
+ return self._aliases.get('toplevel', {})
+
+
+class AliasCommandInjector(object):
+ def __init__(self, session, alias_loader):
+ """Injects alias commands for a command table
+
+ :type session: botocore.session.Session
+ :param session: The botocore session
+
+ :type alias_loader: awscli.alias.AliasLoader
+ :param alias_loader: The alias loader to use
+ """
+ self._session = session
+ self._alias_loader = alias_loader
+
+ def inject_aliases(self, command_table, parser):
+ for alias_name, alias_value in \
+ self._alias_loader.get_aliases().items():
+ if alias_value.startswith('!'):
+ alias_cmd = ExternalAliasCommand(alias_name, alias_value)
+ else:
+ service_alias_cmd_args = [
+ alias_name, alias_value, self._session, command_table,
+ parser
+ ]
+ # If the alias name matches something already in the
+ # command table provide the command it is about
+ # to clobber as a possible reference that it will
+ # need to proxy to.
+ if alias_name in command_table:
+ service_alias_cmd_args.append(
+ command_table[alias_name])
+ alias_cmd = ServiceAliasCommand(*service_alias_cmd_args)
+ command_table[alias_name] = alias_cmd
+
+
+class BaseAliasCommand(CLICommand):
+ _UNDOCUMENTED = True
+
+ def __init__(self, alias_name, alias_value):
+ """Base class for alias command
+
+ :type alias_name: string
+ :param alias_name: The name of the alias
+
+ :type alias_value: string
+ :param alias_value: The parsed value of the alias. This can be
+ retrieved from `AliasLoader.get_aliases()[alias_name]`
+ """
+ self._alias_name = alias_name
+ self._alias_value = alias_value
+
+ def __call__(self, args, parsed_args):
+ raise NotImplementedError('__call__')
+
+ @property
+ def name(self):
+ return self._alias_name
+
+ @name.setter
+ def name(self, value):
+ self._alias_name = value
+
+
+class ServiceAliasCommand(BaseAliasCommand):
+ UNSUPPORTED_GLOBAL_PARAMETERS = [
+ 'debug',
+ 'profile'
+ ]
+
+ def __init__(self, alias_name, alias_value, session, command_table,
+ parser, shadow_proxy_command=None):
+ """Command for a `toplevel` subcommand alias
+
+ :type alias_name: string
+ :param alias_name: The name of the alias
+
+ :type alias_value: string
+ :param alias_value: The parsed value of the alias. This can be
+ retrieved from `AliasLoader.get_aliases()[alias_name]`
+
+ :type session: botocore.session.Session
+ :param session: The botocore session
+
+ :type command_table: dict
+ :param command_table: The command table containing all of the
+ possible service command objects that a particular alias could
+ redirect to.
+
+ :type parser: awscli.argparser.MainArgParser
+ :param parser: The parser to parse commands provided at the top level
+ of a CLI command which includes service commands and global
+ parameters. This is used to parse the service commmand and any
+ global parameters from the alias's value.
+
+ :type shadow_proxy_command: CLICommand
+ :param shadow_proxy_command: A built-in command that
+ potentially shadows the alias in name. If the alias
+ references this command in its value, the alias should proxy
+ to this command as oppposed to proxy to itself in the command
+ table
+ """
+ super(ServiceAliasCommand, self).__init__(alias_name, alias_value)
+ self._session = session
+ self._command_table = command_table
+ self._parser = parser
+ self._shadow_proxy_command = shadow_proxy_command
+
+ def __call__(self, args, parsed_globals):
+ alias_args = self._get_alias_args()
+ parsed_alias_args, remaining = self._parser.parse_known_args(
+ alias_args)
+ self._update_parsed_globals(parsed_alias_args, parsed_globals)
+ # Take any of the remaining arguments that were not parsed out and
+ # prepend them to the remaining args provided to the alias.
+ remaining.extend(args)
+ LOG.debug(
+ 'Alias %r passing on arguments: %r to %r command',
+ self._alias_name, remaining, parsed_alias_args.command)
+ # Pass the update remaing args and global args to the service command
+ # the alias proxied to.
+ command = self._command_table[parsed_alias_args.command]
+ if self._shadow_proxy_command:
+ shadow_name = self._shadow_proxy_command.name
+ # Use the shadow command only if the aliases value
+ # uses that command indicating it needs to proxy over to
+ # a built-in command.
+ if shadow_name == parsed_alias_args.command:
+ LOG.debug(
+ 'Using shadowed command object: %s '
+ 'for alias: %s', self._shadow_proxy_command,
+ self._alias_name
+ )
+ command = self._shadow_proxy_command
+ return command(remaining, parsed_globals)
+
+ def _get_alias_args(self):
+ try:
+ alias_args = shlex.split(self._alias_value)
+ except ValueError as e:
+ raise InvalidAliasException(
+ 'Value of alias "%s" could not be parsed. '
+ 'Received error: %s when parsing:\n%s' % (
+ self._alias_name, e, self._alias_value)
+ )
+
+ alias_args = [arg.strip(os.linesep) for arg in alias_args]
+ LOG.debug(
+ 'Expanded subcommand alias %r with value: %r to: %r',
+ self._alias_name, self._alias_value, alias_args
+ )
+ return alias_args
+
+ def _update_parsed_globals(self, parsed_alias_args, parsed_globals):
+ global_params_to_update = self._get_global_parameters_to_update(
+ parsed_alias_args)
+ # Emit the top level args parsed event to ensure all possible
+ # customizations that typically get applied are applied to the
+ # global parameters provided in the alias before updating
+ # the original provided global parameter values
+ # and passing those onto subsequent commands.
+ emit_top_level_args_parsed_event(self._session, parsed_alias_args)
+ for param_name in global_params_to_update:
+ updated_param_value = getattr(parsed_alias_args, param_name)
+ setattr(parsed_globals, param_name, updated_param_value)
+
+ def _get_global_parameters_to_update(self, parsed_alias_args):
+ # Retrieve a list of global parameters that the newly parsed args
+ # from the alias will have to clobber from the originally provided
+ # parsed globals.
+ global_params_to_update = []
+ for parsed_param, value in vars(parsed_alias_args).items():
+ # To determine which parameters in the alias were global values
+ # compare the parsed alias parameters to the default as
+ # specified by the parser. If the parsed values from the alias
+ # differs from the default value in the parser,
+ # that global parameter must have been provided in the alias.
+ if self._parser.get_default(parsed_param) != value:
+ if parsed_param in self.UNSUPPORTED_GLOBAL_PARAMETERS:
+ raise InvalidAliasException(
+ 'Global parameter "--%s" detected in alias "%s" '
+ 'which is not support in subcommand aliases.' % (
+ parsed_param, self._alias_name))
+ else:
+ global_params_to_update.append(parsed_param)
+ return global_params_to_update
+
+
+class ExternalAliasCommand(BaseAliasCommand):
+ def __init__(self, alias_name, alias_value, invoker=subprocess.call):
+ """Command for external aliases
+
+ Executes command external of CLI as opposed to being a proxy
+ to another command.
+
+ :type alias_name: string
+ :param alias_name: The name of the alias
+
+ :type alias_value: string
+ :param alias_value: The parsed value of the alias. This can be
+ retrieved from `AliasLoader.get_aliases()[alias_name]`
+
+ :type invoker: callable
+ :param invoker: Callable to run arguments of external alias. The
+ signature should match that of ``subprocess.call``
+ """
+ self._alias_name = alias_name
+ self._alias_value = alias_value
+ self._invoker = invoker
+
+ def __call__(self, args, parsed_globals):
+ command_components = [
+ self._alias_value[1:]
+ ]
+ command_components.extend(compat_shell_quote(a) for a in args)
+ command = ' '.join(command_components)
+ LOG.debug(
+ 'Using external alias %r with value: %r to run: %r',
+ self._alias_name, self._alias_value, command)
+ return self._invoker(command, shell=True)
diff -Nru awscli-1.11.13/awscli/argparser.py awscli-1.18.69/awscli/argparser.py
--- awscli-1.11.13/awscli/argparser.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/argparser.py 2020-05-28 19:25:48.000000000 +0000
@@ -29,6 +29,35 @@
)
+class CommandAction(argparse.Action):
+ """Custom action for CLI command arguments
+
+ Allows the choices for the argument to be mutable. The choices
+ are dynamically retrieved from the keys of the referenced command
+ table
+ """
+ def __init__(self, option_strings, dest, command_table, **kwargs):
+ self.command_table = command_table
+ super(CommandAction, self).__init__(
+ option_strings, dest, choices=self.choices, **kwargs
+ )
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ setattr(namespace, self.dest, values)
+
+ @property
+ def choices(self):
+ return list(self.command_table.keys())
+
+ @choices.setter
+ def choices(self, val):
+ # argparse.Action will always try to set this value upon
+ # instantiation, but this value should be dynamically
+ # generated from the command table keys. So make this a
+ # NOOP if argparse.Action tries to set this value.
+ pass
+
+
class CLIArgParser(argparse.ArgumentParser):
Formatter = argparse.RawTextHelpFormatter
@@ -84,13 +113,14 @@
Formatter = argparse.RawTextHelpFormatter
def __init__(self, command_table, version_string,
- description, argument_table):
+ description, argument_table, prog=None):
super(MainArgParser, self).__init__(
formatter_class=self.Formatter,
add_help=False,
conflict_handler='resolve',
description=description,
- usage=USAGE)
+ usage=USAGE,
+ prog=prog)
self._build(command_table, version_string, argument_table)
def _create_choice_help(self, choices):
@@ -106,7 +136,8 @@
self.add_argument('--version', action="version",
version=version_string,
help='Display the version of this tool')
- self.add_argument('command', choices=list(command_table.keys()))
+ self.add_argument('command', action=CommandAction,
+ command_table=command_table)
class ServiceArgParser(CLIArgParser):
@@ -121,7 +152,8 @@
self._service_name = service_name
def _build(self, operations_table):
- self.add_argument('operation', choices=list(operations_table.keys()))
+ self.add_argument('operation', action=CommandAction,
+ command_table=operations_table)
class ArgTableArgParser(CLIArgParser):
@@ -145,8 +177,8 @@
argument = argument_table[arg_name]
argument.add_to_parser(self)
if command_table:
- self.add_argument('subcommand', choices=list(command_table.keys()),
- nargs='?')
+ self.add_argument('subcommand', action=CommandAction,
+ command_table=command_table, nargs='?')
def parse_known_args(self, args, namespace=None):
if len(args) == 1 and args[0] == 'help':
diff -Nru awscli-1.11.13/awscli/argprocess.py awscli-1.18.69/awscli/argprocess.py
--- awscli-1.11.13/awscli/argprocess.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/argprocess.py 2020-05-28 19:25:48.000000000 +0000
@@ -18,11 +18,9 @@
from botocore.compat import OrderedDict, json
from awscli import SCALAR_TYPES, COMPLEX_TYPES
-from awscli.paramfile import get_paramfile, ResourceLoadingError
-from awscli.paramfile import PARAMFILE_DISABLED
from awscli import shorthand
from awscli.utils import find_service_and_method_in_event_name
-
+from botocore.utils import is_json_value_header
LOG = logging.getLogger('awscli.argprocess')
@@ -88,27 +86,6 @@
return value
-def uri_param(event_name, param, value, **kwargs):
- """Handler that supports param values from URIs.
- """
- cli_argument = param
- qualified_param_name = '.'.join(event_name.split('.')[1:])
- if qualified_param_name in PARAMFILE_DISABLED or \
- getattr(cli_argument, 'no_paramfile', None):
- return
- else:
- return _check_for_uri_param(cli_argument, value)
-
-
-def _check_for_uri_param(param, value):
- if isinstance(value, list) and len(value) == 1:
- value = value[0]
- try:
- return get_paramfile(value)
- except ResourceLoadingError as e:
- raise ParamError(param.cli_name, six.text_type(e))
-
-
def detect_shape_structure(param):
stack = []
return _detect_shape_structure(param, stack)
@@ -166,8 +143,19 @@
cli_argument.cli_name)
+def _special_type(model):
+ # check if model is jsonvalue header and that value is serializable
+ if model.serialization.get('jsonvalue') and \
+ model.serialization.get('location') == 'header' and \
+ model.type_name == 'string':
+ return True
+ return False
+
+
def _unpack_cli_arg(argument_model, value, cli_name):
- if argument_model.type_name in SCALAR_TYPES:
+ if is_json_value_header(argument_model):
+ return _unpack_json_cli_arg(argument_model, value, cli_name)
+ elif argument_model.type_name in SCALAR_TYPES:
return unpack_scalar_cli_arg(
argument_model, value, cli_name)
elif argument_model.type_name in COMPLEX_TYPES:
@@ -177,6 +165,15 @@
return six.text_type(value)
+def _unpack_json_cli_arg(argument_model, value, cli_name):
+ try:
+ return json.loads(value, object_pairs_hook=OrderedDict)
+ except ValueError as e:
+ raise ParamError(
+ cli_name, "Invalid JSON: %s\nJSON received: %s"
+ % (e, value))
+
+
def _unpack_complex_cli_arg(argument_model, value, cli_name):
type_name = argument_model.type_name
if type_name == 'structure' or type_name == 'map':
@@ -248,7 +245,7 @@
class ParamShorthand(object):
- def _uses_old_list_case(self, service_name, operation_name, argument_name):
+ def _uses_old_list_case(self, service_id, operation_name, argument_name):
"""
Determines whether a given operation for a service needs to use the
deprecated shorthand parsing case for lists of structures that only have
@@ -263,14 +260,14 @@
'rebuild-workspaces': ['rebuild-workspace-requests'],
'terminate-workspaces': ['terminate-workspace-requests']
},
- 'elb': {
+ 'elastic-load-balancing': {
'remove-tags': ['tags'],
'describe-instance-health': ['instances'],
'deregister-instances-from-load-balancer': ['instances'],
'register-instances-with-load-balancer': ['instances']
}
}
- cases = cases.get(service_name, {}).get(operation_name, [])
+ cases = cases.get(service_id, {}).get(operation_name, [])
return argument_name in cases
@@ -311,18 +308,18 @@
if not self._should_parse_as_shorthand(cli_argument, value):
return
else:
- service_name, operation_name = \
+ service_id, operation_name = \
find_service_and_method_in_event_name(event_name)
return self._parse_as_shorthand(
- cli_argument, value, service_name, operation_name)
+ cli_argument, value, service_id, operation_name)
- def _parse_as_shorthand(self, cli_argument, value, service_name,
+ def _parse_as_shorthand(self, cli_argument, value, service_id,
operation_name):
try:
LOG.debug("Parsing param %s as shorthand",
cli_argument.cli_name)
handled_value = self._handle_special_cases(
- cli_argument, value, service_name, operation_name)
+ cli_argument, value, service_id, operation_name)
if handled_value is not None:
return handled_value
if isinstance(value, list):
@@ -341,13 +338,13 @@
raise ParamError(cli_argument.cli_name, str(e))
except (ParamError, ParamUnknownKeyError) as e:
# The shorthand parse methods don't have the cli_name,
- # so any ParamError won't have this value. To accomodate
+ # so any ParamError won't have this value. To accommodate
# this, ParamErrors are caught and reraised with the cli_name
# injected.
raise ParamError(cli_argument.cli_name, str(e))
return parsed
- def _handle_special_cases(self, cli_argument, value, service_name,
+ def _handle_special_cases(self, cli_argument, value, service_id,
operation_name):
# We need to handle a few special cases that the previous
# parser handled in order to stay backwards compatible.
@@ -355,7 +352,7 @@
if model.type_name == 'list' and \
model.member.type_name == 'structure' and \
len(model.member.members) == 1 and \
- self._uses_old_list_case(service_name, operation_name, cli_argument.name):
+ self._uses_old_list_case(service_id, operation_name, cli_argument.name):
# First special case is handling a list of structures
# of a single element such as:
#
@@ -414,7 +411,7 @@
return _is_complex_shape(argument_model)
return False
- def generate_shorthand_example(self, cli_argument, service_name,
+ def generate_shorthand_example(self, cli_argument, service_id,
operation_name):
"""Generate documentation for a CLI argument.
@@ -430,7 +427,7 @@
"""
docstring = self._handle_special_cases(
- cli_argument, service_name, operation_name)
+ cli_argument, service_id, operation_name)
if docstring is self._DONT_DOC:
return None
elif docstring:
@@ -448,14 +445,18 @@
except TooComplexError:
return ''
- def _handle_special_cases(self, cli_argument, service_name, operation_name):
+ def _handle_special_cases(self, cli_argument, service_id, operation_name):
model = cli_argument.argument_model
if model.type_name == 'list' and \
model.member.type_name == 'structure' and \
len(model.member.members) == 1 and \
self._uses_old_list_case(
- service_name, operation_name, cli_argument.name):
+ service_id, operation_name, cli_argument.name):
member_name = list(model.member.members)[0]
+ # Handle special case where the min/max is exactly one.
+ metadata = model.metadata
+ if metadata.get('min') == 1 and metadata.get('max') == 1:
+ return '%s %s1' % (cli_argument.cli_name, member_name)
return '%s %s1 %s2 %s3' % (cli_argument.cli_name, member_name,
member_name, member_name)
elif model.type_name == 'structure' and \
diff -Nru awscli-1.11.13/awscli/clidocs.py awscli-1.18.69/awscli/clidocs.py
--- awscli-1.11.13/awscli/clidocs.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/clidocs.py 2020-05-28 19:25:48.000000000 +0000
@@ -15,6 +15,7 @@
from botocore import xform_name
from botocore.docs.bcdoc.docevents import DOC_EVENTS
from botocore.model import StringShape
+from botocore.utils import is_json_value_header
from awscli import SCALAR_TYPES
from awscli.argprocess import ParamShorthandDocGen
@@ -29,7 +30,6 @@
def __init__(self, help_command):
self.help_command = help_command
self.register(help_command.session, help_command.event_class)
- self.help_command.doc.translation_map = self.build_translation_map()
self._arg_groups = self._build_arg_table_groups(help_command)
self._documented_arg_groups = []
@@ -40,8 +40,10 @@
arg_groups.setdefault(arg.group_name, []).append(arg)
return arg_groups
- def build_translation_map(self):
- return dict()
+ def _get_argument_type_name(self, shape, default):
+ if is_json_value_header(shape):
+ return 'JSON'
+ return default
def _map_handlers(self, session, event_class, mapfn):
for event in DOC_EVENTS:
@@ -160,7 +162,8 @@
self._documented_arg_groups.append(argument.group_name)
else:
name = '``%s``' % argument.cli_name
- doc.write('%s (%s)\n' % (name, argument.cli_type_name))
+ doc.write('%s (%s)\n' % (name, self._get_argument_type_name(
+ argument.argument_model, argument.cli_type_name)))
doc.style.indent()
doc.include_doc_string(argument.documentation)
self._document_enums(argument, doc)
@@ -242,13 +245,6 @@
class ServiceDocumentEventHandler(CLIDocumentEventHandler):
- def build_translation_map(self):
- d = {}
- service_model = self.help_command.obj
- for operation_name in service_model.operation_names:
- d[operation_name] = xform_name(operation_name, '-')
- return d
-
# A service document has no synopsis.
def doc_synopsis_start(self, help_command, **kwargs):
pass
@@ -300,36 +296,41 @@
class OperationDocumentEventHandler(CLIDocumentEventHandler):
- def build_translation_map(self):
- operation_model = self.help_command.obj
- d = {}
- for cli_name, cli_argument in self.help_command.arg_table.items():
- if cli_argument.argument_model is not None:
- argument_name = cli_argument.argument_model.name
- if argument_name in d:
- previous_mapping = d[argument_name]
- # If the argument name is a boolean argument, we want the
- # the translation to default to the one that does not start
- # with --no-. So we check if the cli parameter currently
- # being used starts with no- and if stripping off the no-
- # results in the new proposed cli argument name. If it
- # does, we assume we have the postive form of the argument
- # which is the name we want to use in doc translations.
- if cli_argument.cli_type_name == 'boolean' and \
- previous_mapping.startswith('no-') and \
- cli_name == previous_mapping[3:]:
- d[argument_name] = cli_name
- else:
- d[argument_name] = cli_name
- for operation_name in operation_model.service_model.operation_names:
- d[operation_name] = xform_name(operation_name, '-')
- return d
+ AWS_DOC_BASE = 'https://docs.aws.amazon.com/goto/WebAPI'
def doc_description(self, help_command, **kwargs):
doc = help_command.doc
operation_model = help_command.obj
doc.style.h2('Description')
doc.include_doc_string(operation_model.documentation)
+ self._add_webapi_crosslink(help_command)
+ self._add_top_level_args_reference(help_command)
+
+ def _add_top_level_args_reference(self, help_command):
+ help_command.doc.writeln('')
+ help_command.doc.write("See ")
+ help_command.doc.style.internal_link(
+ title="'aws help'",
+ page='/reference/index'
+ )
+ help_command.doc.writeln(' for descriptions of global parameters.')
+
+ def _add_webapi_crosslink(self, help_command):
+ doc = help_command.doc
+ operation_model = help_command.obj
+ service_model = operation_model.service_model
+ service_uid = service_model.metadata.get('uid')
+ if service_uid is None:
+ # If there's no service_uid in the model, we can't
+ # be certain if the generated cross link will work
+ # so we don't generate any crosslink info.
+ return
+ doc.style.new_paragraph()
+ doc.write("See also: ")
+ link = '%s/%s/%s' % (self.AWS_DOC_BASE, service_uid,
+ operation_model.name)
+ doc.style.external_link(title="AWS API Documentation", link=link)
+ doc.writeln('')
def _json_example_value_name(self, argument_model, include_enum_values=True):
# If include_enum_values is True, then the valid enum values
@@ -389,12 +390,12 @@
doc.style.dedent()
doc.write('}')
elif argument_model.type_name == 'structure':
- doc.write('{')
- doc.style.indent()
- doc.style.new_line()
self._doc_input_structure_members(doc, argument_model, stack)
def _doc_input_structure_members(self, doc, argument_model, stack):
+ doc.write('{')
+ doc.style.indent()
+ doc.style.new_line()
members = argument_model.members
for i, member_name in enumerate(members):
member_model = members[member_name]
@@ -414,13 +415,12 @@
if i < len(members) - 1:
doc.write(',')
doc.style.new_line()
- else:
- doc.style.dedent()
- doc.style.new_line()
+ doc.style.dedent()
+ doc.style.new_line()
doc.write('}')
def doc_option_example(self, arg_name, help_command, event_name, **kwargs):
- service_name, operation_name = \
+ service_id, operation_name = \
find_service_and_method_in_event_name(event_name)
doc = help_command.doc
cli_argument = help_command.arg_table[arg_name]
@@ -433,7 +433,7 @@
docgen = ParamShorthandDocGen()
if docgen.supports_shorthand(cli_argument.argument_model):
example_shorthand_syntax = docgen.generate_shorthand_example(
- cli_argument, service_name, operation_name)
+ cli_argument, service_id, operation_name)
if example_shorthand_syntax is None:
# If the shorthand syntax returns a value of None,
# this indicates to us that there is no example
@@ -487,7 +487,7 @@
doc.style.h2('Output')
operation_model = help_command.obj
output_shape = operation_model.output_shape
- if output_shape is None:
+ if output_shape is None or not output_shape.members:
doc.write('None')
else:
for member_name, member_shape in output_shape.members.items():
@@ -511,7 +511,8 @@
def _do_doc_member_for_output(self, doc, member_name, member_shape, stack):
docs = member_shape.documentation
if member_name:
- doc.write('%s -> (%s)' % (member_name, member_shape.type_name))
+ doc.write('%s -> (%s)' % (member_name, self._get_argument_type_name(
+ member_shape, member_shape.type_name)))
else:
doc.write('(%s)' % member_shape.type_name)
doc.style.indent()
@@ -534,6 +535,9 @@
doc.style.dedent()
doc.style.new_paragraph()
+ def doc_options_end(self, help_command, **kwargs):
+ self._add_top_level_args_reference(help_command)
+
class TopicListerDocumentEventHandler(CLIDocumentEventHandler):
DESCRIPTION = (
@@ -547,7 +551,6 @@
def __init__(self, help_command):
self.help_command = help_command
self.register(help_command.session, help_command.event_class)
- self.help_command.doc.translation_map = self.build_translation_map()
self._topic_tag_db = TopicTagDB()
self._topic_tag_db.load_json_index()
diff -Nru awscli-1.11.13/awscli/clidriver.py awscli-1.18.69/awscli/clidriver.py
--- awscli-1.11.13/awscli/clidriver.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/clidriver.py 2020-05-28 19:25:48.000000000 +0000
@@ -21,10 +21,14 @@
from botocore.compat import copy_kwargs, OrderedDict
from botocore.exceptions import NoCredentialsError
from botocore.exceptions import NoRegionError
+from botocore.history import get_global_history_recorder
from awscli import EnvironmentVariables, __version__
+from awscli.compat import get_stderr_text_writer
from awscli.formatter import get_formatter
from awscli.plugin import load_plugins
+from awscli.commands import CLICommand
+from awscli.compat import six
from awscli.argparser import MainArgParser
from awscli.argparser import ServiceArgParser
from awscli.argparser import ArgTableArgParser
@@ -38,24 +42,40 @@
from awscli.arguments import CLIArgument
from awscli.arguments import UnknownArgumentError
from awscli.argprocess import unpack_argument
+from awscli.alias import AliasLoader
+from awscli.alias import AliasCommandInjector
+from awscli.utils import emit_top_level_args_parsed_event
+from awscli.utils import write_exception
LOG = logging.getLogger('awscli.clidriver')
LOG_FORMAT = (
'%(asctime)s - %(threadName)s - %(name)s - %(levelname)s - %(message)s')
+HISTORY_RECORDER = get_global_history_recorder()
+# Don't remove this line. The idna encoding
+# is used by getaddrinfo when dealing with unicode hostnames,
+# and in some cases, there appears to be a race condition
+# where threads will get a LookupError on getaddrinfo() saying
+# that the encoding doesn't exist. Using the idna encoding before
+# running any CLI code (and any threads it may create) ensures that
+# the encodings.idna is imported and registered in the codecs registry,
+# which will stop the LookupErrors from happening.
+# See: https://bugs.python.org/issue29288
+u''.encode('idna')
def main():
driver = create_clidriver()
- return driver.main()
+ rc = driver.main()
+ HISTORY_RECORDER.record('CLI_RC', rc, 'CLI')
+ return rc
def create_clidriver():
- emitter = HierarchicalEmitter()
- session = botocore.session.Session(EnvironmentVariables, emitter)
+ session = botocore.session.Session(EnvironmentVariables)
_set_user_agent_for_session(session)
load_plugins(session.full_config.get('plugins', {}),
- event_hooks=emitter)
+ event_hooks=session.get_component('event_emitter'))
driver = CLIDriver(session=session)
return driver
@@ -77,6 +97,7 @@
self._cli_data = None
self._command_table = None
self._argument_table = None
+ self.alias_loader = AliasLoader()
def _get_cli_data(self):
# Not crazy about this but the data in here is needed in
@@ -120,6 +141,12 @@
service_name=service_name)
return commands
+ def _add_aliases(self, command_table, parser):
+ parser = self._create_parser(command_table)
+ injector = AliasCommandInjector(
+ self.session, self.alias_loader)
+ injector.inject_aliases(command_table, parser)
+
def _build_argument_table(self):
argument_table = OrderedDict()
cli_data = self._get_cli_data()
@@ -152,15 +179,15 @@
cli_data.get('synopsis', None),
cli_data.get('help_usage', None))
- def _create_parser(self):
+ def _create_parser(self, command_table):
# Also add a 'help' command.
- command_table = self._get_command_table()
command_table['help'] = self.create_help_command()
cli_data = self._get_cli_data()
parser = MainArgParser(
command_table, self.session.user_agent(),
cli_data.get('description', None),
- self._get_argument_table())
+ self._get_argument_table(),
+ prog="aws")
return parser
def main(self, args=None):
@@ -173,8 +200,9 @@
"""
if args is None:
args = sys.argv[1:]
- parser = self._create_parser()
command_table = self._get_command_table()
+ parser = self._create_parser(command_table)
+ self._add_aliases(command_table, parser)
parsed_args, remaining = parser.parse_known_args(args)
try:
# Because _handle_top_level_args emits events, it's possible
@@ -182,7 +210,10 @@
# general exception handling logic as calling into the
# command table. This is why it's in the try/except clause.
self._handle_top_level_args(parsed_args)
- self._emit_session_event()
+ self._emit_session_event(parsed_args)
+ HISTORY_RECORDER.record(
+ 'CLI_VERSION', self.session.user_agent(), 'CLI')
+ HISTORY_RECORDER.record('CLI_ARGUMENTS', args, 'CLI')
return command_table[parsed_args.command](remaining, parsed_args)
except UnknownArgumentError as e:
sys.stderr.write("usage: %s\n" % USAGE)
@@ -208,17 +239,18 @@
except Exception as e:
LOG.debug("Exception caught in main()", exc_info=True)
LOG.debug("Exiting with rc 255")
- sys.stderr.write("\n")
- sys.stderr.write("%s\n" % e)
+ write_exception(e, outfile=get_stderr_text_writer())
return 255
- def _emit_session_event(self):
+ def _emit_session_event(self, parsed_args):
# This event is guaranteed to run after the session has been
# initialized and a profile has been set. This was previously
# problematic because if something in CLIDriver caused the
# session components to be reset (such as session.profile = foo)
# then all the prior registered components would be removed.
- self.session.emit('session-initialized', session=self.session)
+ self.session.emit(
+ 'session-initialized', session=self.session,
+ parsed_args=parsed_args)
def _show_error(self, msg):
LOG.debug(msg, exc_info=True)
@@ -226,10 +258,11 @@
sys.stderr.write('\n')
def _handle_top_level_args(self, args):
- self.session.emit(
- 'top-level-args-parsed', parsed_args=args, session=self.session)
+ emit_top_level_args_parsed_event(self.session, args)
if args.profile:
self.session.set_config_variable('profile', args.profile)
+ if args.region:
+ self.session.set_config_variable('region', args.region)
if args.debug:
# TODO:
# Unfortunately, by setting debug mode here, we miss out
@@ -241,6 +274,8 @@
format_string=LOG_FORMAT)
self.session.set_stream_logger('s3transfer', logging.DEBUG,
format_string=LOG_FORMAT)
+ self.session.set_stream_logger('urllib3', logging.DEBUG,
+ format_string=LOG_FORMAT)
LOG.debug("CLI version: %s", self.session.user_agent())
LOG.debug("Arguments entered to CLI: %s", sys.argv[1:])
@@ -249,64 +284,6 @@
log_level=logging.ERROR)
-class CLICommand(object):
-
- """Interface for a CLI command.
-
- This class represents a top level CLI command
- (``aws ec2``, ``aws s3``, ``aws config``).
-
- """
-
- @property
- def name(self):
- # Subclasses must implement a name.
- raise NotImplementedError("name")
-
- @name.setter
- def name(self, value):
- # Subclasses must implement setting/changing the cmd name.
- raise NotImplementedError("name")
-
- @property
- def lineage(self):
- # Represents how to get to a specific command using the CLI.
- # It includes all commands that came before it and itself in
- # a list.
- return [self]
-
- @property
- def lineage_names(self):
- # Represents the lineage of a command in terms of command ``name``
- return [cmd.name for cmd in self.lineage]
-
- def __call__(self, args, parsed_globals):
- """Invoke CLI operation.
-
- :type args: str
- :param args: The remaining command line args.
-
- :type parsed_globals: ``argparse.Namespace``
- :param parsed_globals: The parsed arguments so far.
-
- :rtype: int
- :return: The return code of the operation. This will be used
- as the RC code for the ``aws`` process.
-
- """
- # Subclasses are expected to implement this method.
- pass
-
- def create_help_command(self):
- # Subclasses are expected to implement this method if they want
- # help docs.
- return None
-
- @property
- def arg_table(self):
- return {}
-
-
class ServiceCommand(CLICommand):
"""A service command for the CLI.
@@ -468,6 +445,8 @@
self._lineage = [self]
self._operation_model = operation_model
self._session = session
+ if operation_model.deprecated:
+ self._UNDOCUMENTED = True
@property
def name(self):
@@ -600,7 +579,8 @@
cli_arg_name = xform_name(arg_name, '-')
arg_class = self.ARG_TYPES.get(arg_shape.type_name,
self.DEFAULT_ARG_CLASS)
- is_required = arg_name in required_arguments
+ is_token = arg_shape.metadata.get('idempotencyToken', False)
+ is_required = arg_name in required_arguments and not is_token
event_emitter = self._session.get_component('event_emitter')
arg_object = arg_class(
name=cli_arg_name,
@@ -666,6 +646,13 @@
service_name, region_name=parsed_globals.region,
endpoint_url=parsed_globals.endpoint_url,
verify=parsed_globals.verify_ssl)
+ response = self._make_client_call(
+ client, operation_name, parameters, parsed_globals)
+ self._display_response(operation_name, response, parsed_globals)
+ return 0
+
+ def _make_client_call(self, client, operation_name, parameters,
+ parsed_globals):
py_operation_name = xform_name(operation_name)
if client.can_paginate(py_operation_name) and parsed_globals.paginate:
paginator = client.get_paginator(py_operation_name)
@@ -673,8 +660,7 @@
else:
response = getattr(client, xform_name(operation_name))(
**parameters)
- self._display_response(operation_name, response, parsed_globals)
- return 0
+ return response
def _display_response(self, command_name, response,
parsed_globals):
diff -Nru awscli-1.11.13/awscli/commands.py awscli-1.18.69/awscli/commands.py
--- awscli-1.11.13/awscli/commands.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/commands.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,70 @@
+# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+
+class CLICommand(object):
+
+ """Interface for a CLI command.
+
+ This class represents a top level CLI command
+ (``aws ec2``, ``aws s3``, ``aws config``).
+
+ """
+
+ @property
+ def name(self):
+ # Subclasses must implement a name.
+ raise NotImplementedError("name")
+
+ @name.setter
+ def name(self, value):
+ # Subclasses must implement setting/changing the cmd name.
+ raise NotImplementedError("name")
+
+ @property
+ def lineage(self):
+ # Represents how to get to a specific command using the CLI.
+ # It includes all commands that came before it and itself in
+ # a list.
+ return [self]
+
+ @property
+ def lineage_names(self):
+ # Represents the lineage of a command in terms of command ``name``
+ return [cmd.name for cmd in self.lineage]
+
+ def __call__(self, args, parsed_globals):
+ """Invoke CLI operation.
+
+ :type args: str
+ :param args: The remaining command line args.
+
+ :type parsed_globals: ``argparse.Namespace``
+ :param parsed_globals: The parsed arguments so far.
+
+ :rtype: int
+ :return: The return code of the operation. This will be used
+ as the RC code for the ``aws`` process.
+
+ """
+ # Subclasses are expected to implement this method.
+ pass
+
+ def create_help_command(self):
+ # Subclasses are expected to implement this method if they want
+ # help docs.
+ return None
+
+ @property
+ def arg_table(self):
+ return {}
diff -Nru awscli-1.11.13/awscli/compat.py awscli-1.18.69/awscli/compat.py
--- awscli-1.11.13/awscli/compat.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/compat.py 2020-05-28 19:25:48.000000000 +0000
@@ -11,12 +11,20 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import sys
+import re
+import shlex
import os
+import os.path
+import platform
import zipfile
+import signal
+import contextlib
from botocore.compat import six
#import botocore.compat
+from botocore.compat import OrderedDict
+
# If you ever want to import from the vendored six. Add it here and then
# import from awscli.compat. Also try to keep it in alphabetical order.
# This may get large.
@@ -25,7 +33,9 @@
queue = six.moves.queue
shlex_quote = six.moves.shlex_quote
StringIO = six.StringIO
+BytesIO = six.BytesIO
urlopen = six.moves.urllib.request.urlopen
+binary_type = six.binary_type
# Most, but not all, python installations will have zlib. This is required to
# compress any files we send via a push. If we can't compress, we can still
@@ -37,6 +47,29 @@
ZIP_COMPRESSION_MODE = zipfile.ZIP_STORED
+try:
+ import sqlite3
+except ImportError:
+ sqlite3 = None
+
+
+is_windows = sys.platform == 'win32'
+
+
+if is_windows:
+ default_pager = 'more'
+else:
+ default_pager = 'less -R'
+
+
+class StdinMissingError(Exception):
+ def __init__(self):
+ message = (
+ 'stdin is required for this operation, but is not available.'
+ )
+ super(StdinMissingError, self).__init__(message)
+
+
class NonTranslatedStdout(object):
""" This context manager sets the line-end translation mode for stdout.
@@ -58,7 +91,16 @@
msvcrt.setmode(sys.stdout.fileno(), self.previous_mode)
+def ensure_text_type(s):
+ if isinstance(s, six.text_type):
+ return s
+ if isinstance(s, six.binary_type):
+ return s.decode('utf-8')
+ raise ValueError("Expected str, unicode or bytes, received %s." % type(s))
+
+
if six.PY3:
+ import collections.abc as collections_abc
import locale
import urllib.parse as urlparse
@@ -66,10 +108,16 @@
raw_input = input
- binary_stdin = sys.stdin.buffer
+ def get_binary_stdin():
+ if sys.stdin is None:
+ raise StdinMissingError()
+ return sys.stdin.buffer
- def get_stdout_text_writer():
- return sys.stdout
+ def get_binary_stdout():
+ return sys.stdout.buffer
+
+ def _get_text_writer(stream, errors):
+ return stream
def compat_open(filename, mode='r', encoding=None):
"""Back-port open() that accepts an encoding argument.
@@ -102,6 +150,7 @@
else:
import codecs
+ import collections as collections_abc
import locale
import io
import urlparse
@@ -110,20 +159,38 @@
raw_input = raw_input
- binary_stdin = sys.stdin
+ def get_binary_stdin():
+ if sys.stdin is None:
+ raise StdinMissingError()
+ return sys.stdin
- def get_stdout_text_writer():
+ def get_binary_stdout():
+ return sys.stdout
+
+ def _get_text_writer(stream, errors):
# In python3, all the sys.stdout/sys.stderr streams are in text
# mode. This means they expect unicode, and will encode the
# unicode automatically before actually writing to stdout/stderr.
# In python2, that's not the case. In order to provide a consistent
# interface, we can create a wrapper around sys.stdout that will take
# unicode, and automatically encode it to the preferred encoding.
- # That way consumers can just call get_stdout_text_writer() and write
- # unicode to the returned stream. Note that get_stdout_text_writer
- # just returns sys.stdout in the PY3 section above because python3
+ # That way consumers can just call get_text_writer(stream) and write
+ # unicode to the returned stream. Note that get_text_writer
+ # just returns the stream in the PY3 section above because python3
# handles this.
- return codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
+
+ # We're going to use the preferred encoding, but in cases that there is
+ # no preferred encoding we're going to fall back to assuming ASCII is
+ # what we should use. This will currently break the use of
+ # PYTHONIOENCODING, which would require checking stream.encoding first,
+ # however, the existing behavior is to only use
+ # locale.getpreferredencoding() and so in the hope of not breaking what
+ # is currently working, we will continue to only use that.
+ encoding = locale.getpreferredencoding()
+ if encoding is None:
+ encoding = "ascii"
+
+ return codecs.getwriter(encoding)(stream, errors)
def compat_open(filename, mode='r', encoding=None):
# See docstring for compat_open in the PY3 section above.
@@ -138,6 +205,14 @@
stdout.write(statement)
+def get_stdout_text_writer():
+ return _get_text_writer(sys.stdout, errors="strict")
+
+
+def get_stderr_text_writer():
+ return _get_text_writer(sys.stderr, errors="replace")
+
+
def compat_input(prompt):
"""
Cygwin's pty's are based on pipes. Therefore, when it interacts with a Win32
@@ -153,3 +228,300 @@
sys.stdout.write(prompt)
sys.stdout.flush()
return raw_input()
+
+
+def compat_shell_quote(s, platform=None):
+ """Return a shell-escaped version of the string *s*
+
+ Unfortunately `shlex.quote` doesn't support Windows, so this method
+ provides that functionality.
+ """
+ if platform is None:
+ platform = sys.platform
+
+ if platform == "win32":
+ return _windows_shell_quote(s)
+ else:
+ return shlex_quote(s)
+
+
+def _windows_shell_quote(s):
+ """Return a Windows shell-escaped version of the string *s*
+
+ Windows has potentially bizarre rules depending on where you look. When
+ spawning a process via the Windows C runtime the rules are as follows:
+
+ https://docs.microsoft.com/en-us/cpp/cpp/parsing-cpp-command-line-arguments
+
+ To summarize the relevant bits:
+
+ * Only space and tab are valid delimiters
+ * Double quotes are the only valid quotes
+ * Backslash is interpreted literally unless it is part of a chain that
+ leads up to a double quote. Then the backslashes escape the backslashes,
+ and if there is an odd number the final backslash escapes the quote.
+
+ :param s: A string to escape
+ :return: An escaped string
+ """
+ if not s:
+ return '""'
+
+ buff = []
+ num_backspaces = 0
+ for character in s:
+ if character == '\\':
+ # We can't simply append backslashes because we don't know if
+ # they will need to be escaped. Instead we separately keep track
+ # of how many we've seen.
+ num_backspaces += 1
+ elif character == '"':
+ if num_backspaces > 0:
+ # The backslashes are part of a chain that lead up to a
+ # double quote, so they need to be escaped.
+ buff.append('\\' * (num_backspaces * 2))
+ num_backspaces = 0
+
+ # The double quote also needs to be escaped. The fact that we're
+ # seeing it at all means that it must have been escaped in the
+ # original source.
+ buff.append('\\"')
+ else:
+ if num_backspaces > 0:
+ # The backslashes aren't part of a chain leading up to a
+ # double quote, so they can be inserted directly without
+ # being escaped.
+ buff.append('\\' * num_backspaces)
+ num_backspaces = 0
+ buff.append(character)
+
+ # There may be some leftover backspaces if they were on the trailing
+ # end, so they're added back in here.
+ if num_backspaces > 0:
+ buff.append('\\' * num_backspaces)
+
+ new_s = ''.join(buff)
+ if ' ' in new_s or '\t' in new_s:
+ # If there are any spaces or tabs then the string needs to be double
+ # quoted.
+ return '"%s"' % new_s
+ return new_s
+
+
+def get_popen_kwargs_for_pager_cmd(pager_cmd=None):
+ """Returns the default pager to use dependent on platform
+
+ :rtype: str
+ :returns: A string represent the paging command to run based on the
+ platform being used.
+ """
+ popen_kwargs = {}
+ if pager_cmd is None:
+ pager_cmd = default_pager
+ # Similar to what we do with the help command, we need to specify
+ # shell as True to make it work in the pager for Windows
+ if is_windows:
+ popen_kwargs = {'shell': True}
+ else:
+ pager_cmd = shlex.split(pager_cmd)
+ popen_kwargs['args'] = pager_cmd
+ return popen_kwargs
+
+
+@contextlib.contextmanager
+def ignore_user_entered_signals():
+ """
+ Ignores user entered signals to avoid process getting killed.
+ """
+ if is_windows:
+ signal_list = [signal.SIGINT]
+ else:
+ signal_list = [signal.SIGINT, signal.SIGQUIT, signal.SIGTSTP]
+ actual_signals = []
+ for user_signal in signal_list:
+ actual_signals.append(signal.signal(user_signal, signal.SIG_IGN))
+ try:
+ yield
+ finally:
+ for sig, user_signal in enumerate(signal_list):
+ signal.signal(user_signal, actual_signals[sig])
+
+
+# linux_distribution is used by the CodeDeploy customization. Python 3.8
+# removed it from the stdlib, so it is vendored here in the case where the
+# import fails.
+try:
+ from platform import linux_distribution
+except ImportError:
+ _UNIXCONFDIR = '/etc'
+ def _dist_try_harder(distname, version, id):
+
+ """ Tries some special tricks to get the distribution
+ information in case the default method fails.
+ Currently supports older SuSE Linux, Caldera OpenLinux and
+ Slackware Linux distributions.
+ """
+ if os.path.exists('/var/adm/inst-log/info'):
+ # SuSE Linux stores distribution information in that file
+ distname = 'SuSE'
+ with open('/var/adm/inst-log/info') as f:
+ for line in f:
+ tv = line.split()
+ if len(tv) == 2:
+ tag, value = tv
+ else:
+ continue
+ if tag == 'MIN_DIST_VERSION':
+ version = value.strip()
+ elif tag == 'DIST_IDENT':
+ values = value.split('-')
+ id = values[2]
+ return distname, version, id
+
+ if os.path.exists('/etc/.installed'):
+ # Caldera OpenLinux has some infos in that file (thanks to Colin Kong)
+ with open('/etc/.installed') as f:
+ for line in f:
+ pkg = line.split('-')
+ if len(pkg) >= 2 and pkg[0] == 'OpenLinux':
+ # XXX does Caldera support non Intel platforms ? If yes,
+ # where can we find the needed id ?
+ return 'OpenLinux', pkg[1], id
+
+ if os.path.isdir('/usr/lib/setup'):
+ # Check for slackware version tag file (thanks to Greg Andruk)
+ verfiles = os.listdir('/usr/lib/setup')
+ for n in range(len(verfiles)-1, -1, -1):
+ if verfiles[n][:14] != 'slack-version-':
+ del verfiles[n]
+ if verfiles:
+ verfiles.sort()
+ distname = 'slackware'
+ version = verfiles[-1][14:]
+ return distname, version, id
+
+ return distname, version, id
+
+ _release_filename = re.compile(r'(\w+)[-_](release|version)', re.ASCII)
+ _lsb_release_version = re.compile(r'(.+)'
+ r' release '
+ r'([\d.]+)'
+ r'[^(]*(?:\((.+)\))?', re.ASCII)
+ _release_version = re.compile(r'([^0-9]+)'
+ r'(?: release )?'
+ r'([\d.]+)'
+ r'[^(]*(?:\((.+)\))?', re.ASCII)
+
+ # See also http://www.novell.com/coolsolutions/feature/11251.html
+ # and http://linuxmafia.com/faq/Admin/release-files.html
+ # and http://data.linux-ntfs.org/rpm/whichrpm
+ # and http://www.die.net/doc/linux/man/man1/lsb_release.1.html
+
+ _supported_dists = (
+ 'SuSE', 'debian', 'fedora', 'redhat', 'centos',
+ 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo',
+ 'UnitedLinux', 'turbolinux', 'arch', 'mageia')
+
+ def _parse_release_file(firstline):
+
+ # Default to empty 'version' and 'id' strings. Both defaults are used
+ # when 'firstline' is empty. 'id' defaults to empty when an id can not
+ # be deduced.
+ version = ''
+ id = ''
+
+ # Parse the first line
+ m = _lsb_release_version.match(firstline)
+ if m is not None:
+ # LSB format: "distro release x.x (codename)"
+ return tuple(m.groups())
+
+ # Pre-LSB format: "distro x.x (codename)"
+ m = _release_version.match(firstline)
+ if m is not None:
+ return tuple(m.groups())
+
+ # Unknown format... take the first two words
+ l = firstline.strip().split()
+ if l:
+ version = l[0]
+ if len(l) > 1:
+ id = l[1]
+ return '', version, id
+
+ _distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I)
+ _release_file_re = re.compile("(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I)
+ _codename_file_re = re.compile("(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I)
+
+ def linux_distribution(distname='', version='', id='',
+ supported_dists=_supported_dists,
+ full_distribution_name=1):
+ return _linux_distribution(distname, version, id, supported_dists,
+ full_distribution_name)
+
+ def _linux_distribution(distname, version, id, supported_dists,
+ full_distribution_name):
+
+ """ Tries to determine the name of the Linux OS distribution name.
+ The function first looks for a distribution release file in
+ /etc and then reverts to _dist_try_harder() in case no
+ suitable files are found.
+ supported_dists may be given to define the set of Linux
+ distributions to look for. It defaults to a list of currently
+ supported Linux distributions identified by their release file
+ name.
+ If full_distribution_name is true (default), the full
+ distribution read from the OS is returned. Otherwise the short
+ name taken from supported_dists is used.
+ Returns a tuple (distname, version, id) which default to the
+ args given as parameters.
+ """
+ # check for the Debian/Ubuntu /etc/lsb-release file first, needed so
+ # that the distribution doesn't get identified as Debian.
+ # https://bugs.python.org/issue9514
+ try:
+ with open("/etc/lsb-release", "r") as etclsbrel:
+ for line in etclsbrel:
+ m = _distributor_id_file_re.search(line)
+ if m:
+ _u_distname = m.group(1).strip()
+ m = _release_file_re.search(line)
+ if m:
+ _u_version = m.group(1).strip()
+ m = _codename_file_re.search(line)
+ if m:
+ _u_id = m.group(1).strip()
+ if _u_distname and _u_version:
+ return (_u_distname, _u_version, _u_id)
+ except (EnvironmentError, UnboundLocalError):
+ pass
+
+ try:
+ etc = os.listdir(_UNIXCONFDIR)
+ except OSError:
+ # Probably not a Unix system
+ return distname, version, id
+ etc.sort()
+ for file in etc:
+ m = _release_filename.match(file)
+ if m is not None:
+ _distname, dummy = m.groups()
+ if _distname in supported_dists:
+ distname = _distname
+ break
+ else:
+ return _dist_try_harder(distname, version, id)
+
+ # Read the first line
+ with open(os.path.join(_UNIXCONFDIR, file), 'r',
+ encoding='utf-8', errors='surrogateescape') as f:
+ firstline = f.readline()
+ _distname, _version, _id = _parse_release_file(firstline)
+
+ if _distname and full_distribution_name:
+ distname = _distname
+ if _version:
+ version = _version
+ if _id:
+ id = _id
+ return distname, version, id
diff -Nru awscli-1.11.13/awscli/customizations/argrename.py awscli-1.18.69/awscli/customizations/argrename.py
--- awscli-1.11.13/awscli/customizations/argrename.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/argrename.py 2020-05-28 19:25:48.000000000 +0000
@@ -43,13 +43,55 @@
'codepipeline.create-custom-action-type.version': 'action-version',
'codepipeline.delete-custom-action-type.version': 'action-version',
'kinesisanalytics.add-application-output.output': 'application-output',
+ 'kinesisanalyticsv2.add-application-output.output': 'application-output',
'route53.delete-traffic-policy.version': 'traffic-policy-version',
'route53.get-traffic-policy.version': 'traffic-policy-version',
'route53.update-traffic-policy-comment.version': 'traffic-policy-version',
'gamelift.create-build.version': 'build-version',
'gamelift.update-build.version': 'build-version',
+ 'gamelift.create-script.version': 'script-version',
+ 'gamelift.update-script.version': 'script-version',
'route53domains.view-billing.start': 'start-time',
'route53domains.view-billing.end': 'end-time',
+ 'apigateway.create-rest-api.version': 'api-version',
+ 'apigatewayv2.create-api.version': 'api-version',
+ 'apigatewayv2.update-api.version': 'api-version',
+ 'pinpoint.get-campaign-version.version': 'campaign-version',
+ 'pinpoint.get-segment-version.version': 'segment-version',
+ 'pinpoint.delete-email-template.version': 'template-version',
+ 'pinpoint.delete-push-template.version': 'template-version',
+ 'pinpoint.delete-sms-template.version': 'template-version',
+ 'pinpoint.delete-voice-template.version': 'template-version',
+ 'pinpoint.get-email-template.version': 'template-version',
+ 'pinpoint.get-push-template.version': 'template-version',
+ 'pinpoint.get-sms-template.version': 'template-version',
+ 'pinpoint.get-voice-template.version': 'template-version',
+ 'pinpoint.update-email-template.version': 'template-version',
+ 'pinpoint.update-push-template.version': 'template-version',
+ 'pinpoint.update-sms-template.version': 'template-version',
+ 'pinpoint.update-voice-template.version': 'template-version',
+ 'stepfunctions.send-task-success.output': 'task-output',
+ 'clouddirectory.publish-schema.version': 'schema-version',
+ 'mturk.list-qualification-types.query': 'types-query',
+ 'workdocs.create-notification-subscription.endpoint':
+ 'notification-endpoint',
+ 'workdocs.describe-users.query': 'user-query',
+ 'lex-models.delete-bot.version': 'bot-version',
+ 'lex-models.delete-intent.version': 'intent-version',
+ 'lex-models.delete-slot-type.version': 'slot-type-version',
+ 'lex-models.get-intent.version': 'intent-version',
+ 'lex-models.get-slot-type.version': 'slot-type-version',
+ 'lex-models.delete-bot-version.version': 'bot-version',
+ 'lex-models.delete-intent-version.version': 'intent-version',
+ 'lex-models.delete-slot-type-version.version': 'slot-type-version',
+ 'lex-models.get-export.version': 'resource-version',
+ 'mobile.create-project.region': 'project-region',
+ 'rekognition.create-stream-processor.output': 'stream-processor-output',
+ 'eks.create-cluster.version': 'kubernetes-version',
+ 'eks.update-cluster-version.version': 'kubernetes-version',
+ 'eks.create-nodegroup.version': 'kubernetes-version',
+ 'eks.update-nodegroup-version.version': 'kubernetes-version',
+ 'schemas.*.version': 'schema-version',
}
# Same format as ARGUMENT_RENAMES, but instead of renaming the arguments,
@@ -65,6 +107,22 @@
'storagegateway.describe-cached-iscsi-volumes.volume-arns': 'volume-ar-ns',
'storagegateway.describe-stored-iscsi-volumes.volume-arns': 'volume-ar-ns',
'route53domains.view-billing.start-time': 'start',
+ # These come from the xform_name() changes that no longer separates words
+ # by numbers.
+ 'deploy.create-deployment-group.ec2-tag-set': 'ec-2-tag-set',
+ 'deploy.list-application-revisions.s3-bucket': 's-3-bucket',
+ 'deploy.list-application-revisions.s3-key-prefix': 's-3-key-prefix',
+ 'deploy.update-deployment-group.ec2-tag-set': 'ec-2-tag-set',
+ 'iam.enable-mfa-device.authentication-code1': 'authentication-code-1',
+ 'iam.enable-mfa-device.authentication-code2': 'authentication-code-2',
+ 'iam.resync-mfa-device.authentication-code1': 'authentication-code-1',
+ 'iam.resync-mfa-device.authentication-code2': 'authentication-code-2',
+ 'importexport.get-shipping-label.street1': 'street-1',
+ 'importexport.get-shipping-label.street2': 'street-2',
+ 'importexport.get-shipping-label.street3': 'street-3',
+ 'lambda.publish-version.code-sha256': 'code-sha-256',
+ 'lightsail.import-key-pair.public-key-base64': 'public-key-base-64',
+ 'opsworks.register-volume.ec2-volume-id': 'ec-2-volume-id',
}
diff -Nru awscli-1.11.13/awscli/customizations/assumerole.py awscli-1.18.69/awscli/customizations/assumerole.py
--- awscli-1.11.13/awscli/customizations/assumerole.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/assumerole.py 2020-05-28 19:25:48.000000000 +0000
@@ -1,10 +1,11 @@
import os
-import json
import logging
from botocore.exceptions import ProfileNotFound
+from botocore.credentials import JSONFileCache
LOG = logging.getLogger(__name__)
+CACHE_DIR = os.path.expanduser(os.path.join('~', '.aws', 'cli', 'cache'))
def register_assume_role_provider(event_handlers):
@@ -36,53 +37,9 @@
"assume-role cred provider cache. Not configuring "
"JSONFileCache for assume-role.")
return
- provider = cred_chain.get_provider('assume-role')
- provider.cache = JSONFileCache()
-
-
-class JSONFileCache(object):
- """JSON file cache.
-
- This provides a dict like interface that stores JSON serializable
- objects.
-
- The objects are serialized to JSON and stored in a file. These
- values can be retrieved at a later time.
-
- """
-
- CACHE_DIR = os.path.expanduser(os.path.join('~', '.aws', 'cli', 'cache'))
-
- def __init__(self, working_dir=CACHE_DIR):
- self._working_dir = working_dir
-
- def __contains__(self, cache_key):
- actual_key = self._convert_cache_key(cache_key)
- return os.path.isfile(actual_key)
-
- def __getitem__(self, cache_key):
- """Retrieve value from a cache key."""
- actual_key = self._convert_cache_key(cache_key)
- try:
- with open(actual_key) as f:
- return json.load(f)
- except (OSError, ValueError, IOError):
- raise KeyError(cache_key)
-
- def __setitem__(self, cache_key, value):
- full_key = self._convert_cache_key(cache_key)
- try:
- file_content = json.dumps(value)
- except (TypeError, ValueError):
- raise ValueError("Value cannot be cached, must be "
- "JSON serializable: %s" % value)
- if not os.path.isdir(self._working_dir):
- os.makedirs(self._working_dir)
- with os.fdopen(os.open(full_key,
- os.O_WRONLY | os.O_CREAT, 0o600), 'w') as f:
- f.truncate()
- f.write(file_content)
-
- def _convert_cache_key(self, cache_key):
- full_path = os.path.join(self._working_dir, cache_key + '.json')
- return full_path
+ assume_role_provider = cred_chain.get_provider('assume-role')
+ assume_role_provider.cache = JSONFileCache(CACHE_DIR)
+ web_identity_provider = cred_chain.get_provider(
+ 'assume-role-with-web-identity'
+ )
+ web_identity_provider.cache = JSONFileCache(CACHE_DIR)
diff -Nru awscli-1.11.13/awscli/customizations/awslambda.py awscli-1.18.69/awscli/customizations/awslambda.py
--- awscli-1.11.13/awscli/customizations/awslambda.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/awslambda.py 2020-05-28 19:25:48.000000000 +0000
@@ -17,19 +17,24 @@
from botocore.vendored import six
from awscli.arguments import CustomArgument, CLIArgument
-from awscli.customizations import utils
+
ERROR_MSG = (
"--zip-file must be a zip file with the fileb:// prefix.\n"
"Example usage: --zip-file fileb://path/to/file.zip")
-ZIP_DOCSTRING = ('
The path to the zip file of the code you are uploading. '
- 'Example: fileb://code.zip
')
+ZIP_DOCSTRING = (
+ '
The path to the zip file of the {param_type} you are uploading. '
+ 'Specify --zip-file or --{param_type}, but not both. '
+ 'Example: fileb://{param_type}.zip
'
+)
def register_lambda_create_function(cli):
cli.register('building-argument-table.lambda.create-function',
- _extract_code_and_zip_file_arguments)
+ ZipFileArgumentHoister('Code').hoist)
+ cli.register('building-argument-table.lambda.publish-layer-version',
+ ZipFileArgumentHoister('Content').hoist)
cli.register('building-argument-table.lambda.update-function-code',
_modify_zipfile_docstring)
cli.register('process-cli-arg.lambda.update-function-code',
@@ -41,20 +46,36 @@
_should_contain_zip_content(value)
-def _extract_code_and_zip_file_arguments(session, argument_table, **kwargs):
- argument_table['zip-file'] = ZipFileArgument(
- 'zip-file', help_text=ZIP_DOCSTRING, cli_type_name='blob')
- code_argument = argument_table['code']
- code_model = copy.deepcopy(code_argument.argument_model)
- del code_model.members['ZipFile']
- argument_table['code'] = CodeArgument(
- name='code',
- argument_model=code_model,
- operation_model=code_argument._operation_model,
- is_required=False,
- event_emitter=session.get_component('event_emitter'),
- serialized_name='Code'
- )
+class ZipFileArgumentHoister(object):
+ """Hoists a ZipFile argument up to the top level.
+
+ Injects a top-level ZipFileArgument into the argument table which maps
+ a --zip-file parameter to the underlying ``serialized_name`` ZipFile
+ shape. Repalces the old ZipFile argument with an instance of
+ ReplacedZipFileArgument to prevent its usage and recommend the new
+ top-level injected parameter.
+ """
+ def __init__(self, serialized_name):
+ self._serialized_name = serialized_name
+ self._name = serialized_name.lower()
+
+ def hoist(self, session, argument_table, **kwargs):
+ help_text = ZIP_DOCSTRING.format(param_type=self._name)
+ argument_table['zip-file'] = ZipFileArgument(
+ 'zip-file', help_text=help_text, cli_type_name='blob',
+ serialized_name=self._serialized_name
+ )
+ argument = argument_table[self._name]
+ model = copy.deepcopy(argument.argument_model)
+ del model.members['ZipFile']
+ argument_table[self._name] = ReplacedZipFileArgument(
+ name=self._name,
+ argument_model=model,
+ operation_model=argument._operation_model,
+ is_required=False,
+ event_emitter=session.get_component('event_emitter'),
+ serialized_name=self._serialized_name,
+ )
def _modify_zipfile_docstring(session, argument_table, **kwargs):
@@ -78,28 +99,54 @@
class ZipFileArgument(CustomArgument):
+ """A new ZipFile argument to be injected at the top level.
+
+ This class injects a ZipFile argument under the specified serialized_name
+ parameter. This can be used to take a top level parameter like --zip-file
+ and inject it into a nested different parameter like Code so
+ --zip-file foo.zip winds up being serilized as
+ { 'Code': { 'ZipFile': } }.
+ """
+ def __init__(self, *args, **kwargs):
+ self._param_to_replace = kwargs.pop('serialized_name')
+ super(ZipFileArgument, self).__init__(*args, **kwargs)
+
def add_to_params(self, parameters, value):
if value is None:
return
_should_contain_zip_content(value)
zip_file_param = {'ZipFile': value}
- if parameters.get('Code'):
- parameters['Code'].update(zip_file_param)
+ if parameters.get(self._param_to_replace):
+ parameters[self._param_to_replace].update(zip_file_param)
else:
- parameters['Code'] = zip_file_param
+ parameters[self._param_to_replace] = zip_file_param
+
+
+class ReplacedZipFileArgument(CLIArgument):
+ """A replacement arugment for nested ZipFile argument.
+ This prevents the use of a non-working nested argument that expects binary.
+ Instead an instance of ZipFileArgument should be injected at the top level
+ and used instead. That way fileb:// can be used to load the binary
+ contents. And the argument class can inject those bytes into the correct
+ serialization name.
+ """
+ def __init__(self, *args, **kwargs):
+ super(ReplacedZipFileArgument, self).__init__(*args, **kwargs)
+ self._cli_name = '--%s' % kwargs['name']
+ self._param_to_replace = kwargs['serialized_name']
-class CodeArgument(CLIArgument):
def add_to_params(self, parameters, value):
if value is None:
return
unpacked = self._unpack_argument(value)
if 'ZipFile' in unpacked:
- raise ValueError("ZipFile cannot be provided "
- "as part of the --code argument. "
- "Please use the '--zip-file' "
- "option instead to specify a zip file.")
- if parameters.get('Code'):
- parameters['Code'].update(unpacked)
+ raise ValueError(
+ "ZipFile cannot be provided "
+ "as part of the %s argument. "
+ "Please use the '--zip-file' "
+ "option instead to specify a zip file." % self._cli_name)
+ if parameters.get(self._param_to_replace):
+ parameters[self._param_to_replace].update(unpacked)
else:
- parameters['Code'] = unpacked
+ parameters[self._param_to_replace] = unpacked
diff -Nru awscli-1.11.13/awscli/customizations/cliinputjson.py awscli-1.18.69/awscli/customizations/cliinputjson.py
--- awscli-1.11.13/awscli/customizations/cliinputjson.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cliinputjson.py 2020-05-28 19:25:48.000000000 +0000
@@ -12,7 +12,7 @@
# language governing permissions and limitations under the License.
import json
-from awscli.paramfile import get_paramfile
+from awscli.paramfile import get_paramfile, LOCAL_PREFIX_MAP
from awscli.argprocess import ParamError
from awscli.customizations.arguments import OverrideRequiredArgsArgument
@@ -42,7 +42,9 @@
'provided. The JSON string follows the format provided '
'by ``--generate-cli-skeleton``. If other arguments are '
'provided on the command line, the CLI values will override '
- 'the JSON-provided values.'
+ 'the JSON-provided values. It is not possible to pass '
+ 'arbitrary binary values using a JSON-provided value as '
+ 'the string will be taken literally.'
}
def __init__(self, session):
@@ -50,7 +52,7 @@
def _register_argument_action(self):
self._session.register(
- 'calling-command', self.add_to_call_parameters)
+ 'calling-command.*', self.add_to_call_parameters)
super(CliInputJSONArgument, self)._register_argument_action()
def add_to_call_parameters(self, call_parameters, parsed_args,
@@ -60,7 +62,7 @@
input_json = getattr(parsed_args, 'cli_input_json', None)
if input_json is not None:
# Retrieve the JSON from the file if needed.
- retrieved_json = get_paramfile(input_json)
+ retrieved_json = get_paramfile(input_json, LOCAL_PREFIX_MAP)
# Nothing was retrieved from the file. So assume the argument
# is already a JSON string.
if retrieved_json is None:
diff -Nru awscli-1.11.13/awscli/customizations/cloudformation/artifact_exporter.py awscli-1.18.69/awscli/customizations/cloudformation/artifact_exporter.py
--- awscli-1.11.13/awscli/customizations/cloudformation/artifact_exporter.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudformation/artifact_exporter.py 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,640 @@
+# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import logging
+import os
+import tempfile
+import zipfile
+import contextlib
+import uuid
+import shutil
+from awscli.compat import six
+from botocore.utils import set_value_from_jmespath
+
+from awscli.compat import urlparse
+from contextlib import contextmanager
+from awscli.customizations.cloudformation import exceptions
+from awscli.customizations.cloudformation.yamlhelper import yaml_dump, \
+ yaml_parse
+import jmespath
+
+
+LOG = logging.getLogger(__name__)
+
+
+def is_path_value_valid(path):
+ return isinstance(path, six.string_types)
+
+
+def make_abs_path(directory, path):
+ if is_path_value_valid(path) and not os.path.isabs(path):
+ return os.path.normpath(os.path.join(directory, path))
+ else:
+ return path
+
+
+def is_s3_url(url):
+ try:
+ parse_s3_url(url)
+ return True
+ except ValueError:
+ return False
+
+
+def is_local_folder(path):
+ return is_path_value_valid(path) and os.path.isdir(path)
+
+
+def is_local_file(path):
+ return is_path_value_valid(path) and os.path.isfile(path)
+
+
+def is_zip_file(path):
+ return (
+ is_path_value_valid(path) and
+ zipfile.is_zipfile(path))
+
+
+def parse_s3_url(url,
+ bucket_name_property="Bucket",
+ object_key_property="Key",
+ version_property=None):
+
+ if isinstance(url, six.string_types) \
+ and url.startswith("s3://"):
+
+ # Python < 2.7.10 don't parse query parameters from URI with custom
+ # scheme such as s3://blah/blah. As a workaround, remove scheme
+ # altogether to trigger the parser "s3://foo/bar?v=1" =>"//foo/bar?v=1"
+ parsed = urlparse.urlparse(url[3:])
+ query = urlparse.parse_qs(parsed.query)
+
+ if parsed.netloc and parsed.path:
+ result = dict()
+ result[bucket_name_property] = parsed.netloc
+ result[object_key_property] = parsed.path.lstrip('/')
+
+ # If there is a query string that has a single versionId field,
+ # set the object version and return
+ if version_property is not None \
+ and 'versionId' in query \
+ and len(query['versionId']) == 1:
+ result[version_property] = query['versionId'][0]
+
+ return result
+
+ raise ValueError("URL given to the parse method is not a valid S3 url "
+ "{0}".format(url))
+
+
+def upload_local_artifacts(resource_id, resource_dict, property_name,
+ parent_dir, uploader):
+ """
+ Upload local artifacts referenced by the property at given resource and
+ return S3 URL of the uploaded object. It is the responsibility of callers
+ to ensure property value is a valid string
+
+ If path refers to a file, this method will upload the file. If path refers
+ to a folder, this method will zip the folder and upload the zip to S3.
+ If path is omitted, this method will zip the current working folder and
+ upload.
+
+ If path is already a path to S3 object, this method does nothing.
+
+ :param resource_id: Id of the CloudFormation resource
+ :param resource_dict: Dictionary containing resource definition
+ :param property_name: Property name of CloudFormation resource where this
+ local path is present
+ :param parent_dir: Resolve all relative paths with respect to this
+ directory
+ :param uploader: Method to upload files to S3
+
+ :return: S3 URL of the uploaded object
+ :raise: ValueError if path is not a S3 URL or a local path
+ """
+
+ local_path = jmespath.search(property_name, resource_dict)
+
+ if local_path is None:
+ # Build the root directory and upload to S3
+ local_path = parent_dir
+
+ if is_s3_url(local_path):
+ # A valid CloudFormation template will specify artifacts as S3 URLs.
+ # This check is supporting the case where your resource does not
+ # refer to local artifacts
+ # Nothing to do if property value is an S3 URL
+ LOG.debug("Property {0} of {1} is already a S3 URL"
+ .format(property_name, resource_id))
+ return local_path
+
+ local_path = make_abs_path(parent_dir, local_path)
+
+ # Or, pointing to a folder. Zip the folder and upload
+ if is_local_folder(local_path):
+ return zip_and_upload(local_path, uploader)
+
+ # Path could be pointing to a file. Upload the file
+ elif is_local_file(local_path):
+ return uploader.upload_with_dedup(local_path)
+
+ raise exceptions.InvalidLocalPathError(
+ resource_id=resource_id,
+ property_name=property_name,
+ local_path=local_path)
+
+
+def zip_and_upload(local_path, uploader):
+ with zip_folder(local_path) as zipfile:
+ return uploader.upload_with_dedup(zipfile)
+
+
+@contextmanager
+def zip_folder(folder_path):
+ """
+ Zip the entire folder and return a file to the zip. Use this inside
+ a "with" statement to cleanup the zipfile after it is used.
+
+ :param folder_path:
+ :return: Name of the zipfile
+ """
+
+ filename = os.path.join(
+ tempfile.gettempdir(), "data-" + uuid.uuid4().hex)
+
+ zipfile_name = make_zip(filename, folder_path)
+ try:
+ yield zipfile_name
+ finally:
+ if os.path.exists(zipfile_name):
+ os.remove(zipfile_name)
+
+
+def make_zip(filename, source_root):
+ zipfile_name = "{0}.zip".format(filename)
+ source_root = os.path.abspath(source_root)
+ with open(zipfile_name, 'wb') as f:
+ zip_file = zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED)
+ with contextlib.closing(zip_file) as zf:
+ for root, dirs, files in os.walk(source_root, followlinks=True):
+ for filename in files:
+ full_path = os.path.join(root, filename)
+ relative_path = os.path.relpath(
+ full_path, source_root)
+ zf.write(full_path, relative_path)
+
+ return zipfile_name
+
+
+@contextmanager
+def mktempfile():
+ directory = tempfile.gettempdir()
+ filename = os.path.join(directory, uuid.uuid4().hex)
+
+ try:
+ with open(filename, "w+") as handle:
+ yield handle
+ finally:
+ if os.path.exists(filename):
+ os.remove(filename)
+
+
+def copy_to_temp_dir(filepath):
+ tmp_dir = tempfile.mkdtemp()
+ dst = os.path.join(tmp_dir, os.path.basename(filepath))
+ shutil.copyfile(filepath, dst)
+ return tmp_dir
+
+
+class Resource(object):
+ """
+ Base class representing a CloudFormation resource that can be exported
+ """
+
+ RESOURCE_TYPE = None
+ PROPERTY_NAME = None
+ PACKAGE_NULL_PROPERTY = True
+ # Set this property to True in base class if you want the exporter to zip
+ # up the file before uploading This is useful for Lambda functions.
+ FORCE_ZIP = False
+
+ def __init__(self, uploader):
+ self.uploader = uploader
+
+ def export(self, resource_id, resource_dict, parent_dir):
+ if resource_dict is None:
+ return
+
+ property_value = jmespath.search(self.PROPERTY_NAME, resource_dict)
+
+ if not property_value and not self.PACKAGE_NULL_PROPERTY:
+ return
+
+ if isinstance(property_value, dict):
+ LOG.debug("Property {0} of {1} resource is not a URL"
+ .format(self.PROPERTY_NAME, resource_id))
+ return
+
+ # If property is a file but not a zip file, place file in temp
+ # folder and send the temp folder to be zipped
+ temp_dir = None
+ if is_local_file(property_value) and not \
+ is_zip_file(property_value) and self.FORCE_ZIP:
+ temp_dir = copy_to_temp_dir(property_value)
+ set_value_from_jmespath(resource_dict, self.PROPERTY_NAME, temp_dir)
+
+ try:
+ self.do_export(resource_id, resource_dict, parent_dir)
+
+ except Exception as ex:
+ LOG.debug("Unable to export", exc_info=ex)
+ raise exceptions.ExportFailedError(
+ resource_id=resource_id,
+ property_name=self.PROPERTY_NAME,
+ property_value=property_value,
+ ex=ex)
+ finally:
+ if temp_dir:
+ shutil.rmtree(temp_dir)
+
+ def do_export(self, resource_id, resource_dict, parent_dir):
+ """
+ Default export action is to upload artifacts and set the property to
+ S3 URL of the uploaded object
+ """
+ uploaded_url = upload_local_artifacts(resource_id, resource_dict,
+ self.PROPERTY_NAME,
+ parent_dir, self.uploader)
+ set_value_from_jmespath(resource_dict, self.PROPERTY_NAME, uploaded_url)
+
+
+class ResourceWithS3UrlDict(Resource):
+ """
+ Represents CloudFormation resources that need the S3 URL to be specified as
+ an dict like {Bucket: "", Key: "", Version: ""}
+ """
+
+ BUCKET_NAME_PROPERTY = None
+ OBJECT_KEY_PROPERTY = None
+ VERSION_PROPERTY = None
+
+ def __init__(self, uploader):
+ super(ResourceWithS3UrlDict, self).__init__(uploader)
+
+ def do_export(self, resource_id, resource_dict, parent_dir):
+ """
+ Upload to S3 and set property to an dict representing the S3 url
+ of the uploaded object
+ """
+
+ artifact_s3_url = \
+ upload_local_artifacts(resource_id, resource_dict,
+ self.PROPERTY_NAME,
+ parent_dir, self.uploader)
+
+ parsed_url = parse_s3_url(
+ artifact_s3_url,
+ bucket_name_property=self.BUCKET_NAME_PROPERTY,
+ object_key_property=self.OBJECT_KEY_PROPERTY,
+ version_property=self.VERSION_PROPERTY)
+ set_value_from_jmespath(resource_dict, self.PROPERTY_NAME, parsed_url)
+
+
+class ServerlessFunctionResource(Resource):
+ RESOURCE_TYPE = "AWS::Serverless::Function"
+ PROPERTY_NAME = "CodeUri"
+ FORCE_ZIP = True
+
+
+class ServerlessApiResource(Resource):
+ RESOURCE_TYPE = "AWS::Serverless::Api"
+ PROPERTY_NAME = "DefinitionUri"
+ # Don't package the directory if DefinitionUri is omitted.
+ # Necessary to support DefinitionBody
+ PACKAGE_NULL_PROPERTY = False
+
+
+class GraphQLSchemaResource(Resource):
+ RESOURCE_TYPE = "AWS::AppSync::GraphQLSchema"
+ PROPERTY_NAME = "DefinitionS3Location"
+ # Don't package the directory if DefinitionS3Location is omitted.
+ # Necessary to support Definition
+ PACKAGE_NULL_PROPERTY = False
+
+
+class AppSyncResolverRequestTemplateResource(Resource):
+ RESOURCE_TYPE = "AWS::AppSync::Resolver"
+ PROPERTY_NAME = "RequestMappingTemplateS3Location"
+ # Don't package the directory if RequestMappingTemplateS3Location is omitted.
+ # Necessary to support RequestMappingTemplate
+ PACKAGE_NULL_PROPERTY = False
+
+
+class AppSyncResolverResponseTemplateResource(Resource):
+ RESOURCE_TYPE = "AWS::AppSync::Resolver"
+ PROPERTY_NAME = "ResponseMappingTemplateS3Location"
+ # Don't package the directory if ResponseMappingTemplateS3Location is omitted.
+ # Necessary to support ResponseMappingTemplate
+ PACKAGE_NULL_PROPERTY = False
+
+
+class AppSyncFunctionConfigurationRequestTemplateResource(Resource):
+ RESOURCE_TYPE = "AWS::AppSync::FunctionConfiguration"
+ PROPERTY_NAME = "RequestMappingTemplateS3Location"
+ # Don't package the directory if RequestMappingTemplateS3Location is omitted.
+ # Necessary to support RequestMappingTemplate
+ PACKAGE_NULL_PROPERTY = False
+
+
+class AppSyncFunctionConfigurationResponseTemplateResource(Resource):
+ RESOURCE_TYPE = "AWS::AppSync::FunctionConfiguration"
+ PROPERTY_NAME = "ResponseMappingTemplateS3Location"
+ # Don't package the directory if ResponseMappingTemplateS3Location is omitted.
+ # Necessary to support ResponseMappingTemplate
+ PACKAGE_NULL_PROPERTY = False
+
+
+class LambdaFunctionResource(ResourceWithS3UrlDict):
+ RESOURCE_TYPE = "AWS::Lambda::Function"
+ PROPERTY_NAME = "Code"
+ BUCKET_NAME_PROPERTY = "S3Bucket"
+ OBJECT_KEY_PROPERTY = "S3Key"
+ VERSION_PROPERTY = "S3ObjectVersion"
+ FORCE_ZIP = True
+
+
+class ApiGatewayRestApiResource(ResourceWithS3UrlDict):
+ RESOURCE_TYPE = "AWS::ApiGateway::RestApi"
+ PROPERTY_NAME = "BodyS3Location"
+ PACKAGE_NULL_PROPERTY = False
+ BUCKET_NAME_PROPERTY = "Bucket"
+ OBJECT_KEY_PROPERTY = "Key"
+ VERSION_PROPERTY = "Version"
+
+
+class ElasticBeanstalkApplicationVersion(ResourceWithS3UrlDict):
+ RESOURCE_TYPE = "AWS::ElasticBeanstalk::ApplicationVersion"
+ PROPERTY_NAME = "SourceBundle"
+ BUCKET_NAME_PROPERTY = "S3Bucket"
+ OBJECT_KEY_PROPERTY = "S3Key"
+ VERSION_PROPERTY = None
+
+
+class LambdaLayerVersionResource(ResourceWithS3UrlDict):
+ RESOURCE_TYPE = "AWS::Lambda::LayerVersion"
+ PROPERTY_NAME = "Content"
+ BUCKET_NAME_PROPERTY = "S3Bucket"
+ OBJECT_KEY_PROPERTY = "S3Key"
+ VERSION_PROPERTY = "S3ObjectVersion"
+ FORCE_ZIP = True
+
+
+class ServerlessLayerVersionResource(Resource):
+ RESOURCE_TYPE = "AWS::Serverless::LayerVersion"
+ PROPERTY_NAME = "ContentUri"
+ FORCE_ZIP = True
+
+
+class ServerlessRepoApplicationReadme(Resource):
+ RESOURCE_TYPE = "AWS::ServerlessRepo::Application"
+ PROPERTY_NAME = "ReadmeUrl"
+ PACKAGE_NULL_PROPERTY = False
+
+
+class ServerlessRepoApplicationLicense(Resource):
+ RESOURCE_TYPE = "AWS::ServerlessRepo::Application"
+ PROPERTY_NAME = "LicenseUrl"
+ PACKAGE_NULL_PROPERTY = False
+
+
+class CloudFormationStackResource(Resource):
+ """
+ Represents CloudFormation::Stack resource that can refer to a nested
+ stack template via TemplateURL property.
+ """
+ RESOURCE_TYPE = "AWS::CloudFormation::Stack"
+ PROPERTY_NAME = "TemplateURL"
+
+ def __init__(self, uploader):
+ super(CloudFormationStackResource, self).__init__(uploader)
+
+ def do_export(self, resource_id, resource_dict, parent_dir):
+ """
+ If the nested stack template is valid, this method will
+ export on the nested template, upload the exported template to S3
+ and set property to URL of the uploaded S3 template
+ """
+
+ template_path = resource_dict.get(self.PROPERTY_NAME, None)
+
+ if template_path is None or is_s3_url(template_path) or \
+ template_path.startswith("http://") or \
+ template_path.startswith("https://"):
+ # Nothing to do
+ return
+
+ abs_template_path = make_abs_path(parent_dir, template_path)
+ if not is_local_file(abs_template_path):
+ raise exceptions.InvalidTemplateUrlParameterError(
+ property_name=self.PROPERTY_NAME,
+ resource_id=resource_id,
+ template_path=abs_template_path)
+
+ exported_template_dict = \
+ Template(template_path, parent_dir, self.uploader).export()
+
+ exported_template_str = yaml_dump(exported_template_dict)
+
+ with mktempfile() as temporary_file:
+ temporary_file.write(exported_template_str)
+ temporary_file.flush()
+
+ url = self.uploader.upload_with_dedup(
+ temporary_file.name, "template")
+
+ # TemplateUrl property requires S3 URL to be in path-style format
+ parts = parse_s3_url(url, version_property="Version")
+ s3_path_url = self.uploader.to_path_style_s3_url(
+ parts["Key"], parts.get("Version", None))
+ set_value_from_jmespath(resource_dict, self.PROPERTY_NAME, s3_path_url)
+
+
+class ServerlessApplicationResource(CloudFormationStackResource):
+ """
+ Represents Serverless::Application resource that can refer to a nested
+ app template via Location property.
+ """
+ RESOURCE_TYPE = "AWS::Serverless::Application"
+ PROPERTY_NAME = "Location"
+
+
+
+class GlueJobCommandScriptLocationResource(Resource):
+ """
+ Represents Glue::Job resource.
+ """
+ RESOURCE_TYPE = "AWS::Glue::Job"
+ # Note the PROPERTY_NAME includes a '.' implying it's nested.
+ PROPERTY_NAME = "Command.ScriptLocation"
+
+
+RESOURCES_EXPORT_LIST = [
+ ServerlessFunctionResource,
+ ServerlessApiResource,
+ GraphQLSchemaResource,
+ AppSyncResolverRequestTemplateResource,
+ AppSyncResolverResponseTemplateResource,
+ AppSyncFunctionConfigurationRequestTemplateResource,
+ AppSyncFunctionConfigurationResponseTemplateResource,
+ ApiGatewayRestApiResource,
+ LambdaFunctionResource,
+ ElasticBeanstalkApplicationVersion,
+ CloudFormationStackResource,
+ ServerlessApplicationResource,
+ ServerlessLayerVersionResource,
+ LambdaLayerVersionResource,
+ GlueJobCommandScriptLocationResource,
+]
+
+METADATA_EXPORT_LIST = [
+ ServerlessRepoApplicationReadme,
+ ServerlessRepoApplicationLicense
+]
+
+
+def include_transform_export_handler(template_dict, uploader, parent_dir):
+ if template_dict.get("Name", None) != "AWS::Include":
+ return template_dict
+
+ include_location = template_dict.get("Parameters", {}).get("Location", None)
+ if not include_location \
+ or not is_path_value_valid(include_location) \
+ or is_s3_url(include_location):
+ # `include_location` is either empty, or not a string, or an S3 URI
+ return template_dict
+
+ # We are confident at this point that `include_location` is a string containing the local path
+ abs_include_location = os.path.join(parent_dir, include_location)
+ if is_local_file(abs_include_location):
+ template_dict["Parameters"]["Location"] = uploader.upload_with_dedup(abs_include_location)
+ else:
+ raise exceptions.InvalidLocalPathError(
+ resource_id="AWS::Include",
+ property_name="Location",
+ local_path=abs_include_location)
+
+ return template_dict
+
+
+GLOBAL_EXPORT_DICT = {
+ "Fn::Transform": include_transform_export_handler
+}
+
+
+class Template(object):
+ """
+ Class to export a CloudFormation template
+ """
+
+ def __init__(self, template_path, parent_dir, uploader,
+ resources_to_export=RESOURCES_EXPORT_LIST,
+ metadata_to_export=METADATA_EXPORT_LIST):
+ """
+ Reads the template and makes it ready for export
+ """
+
+ if not (is_local_folder(parent_dir) and os.path.isabs(parent_dir)):
+ raise ValueError("parent_dir parameter must be "
+ "an absolute path to a folder {0}"
+ .format(parent_dir))
+
+ abs_template_path = make_abs_path(parent_dir, template_path)
+ template_dir = os.path.dirname(abs_template_path)
+
+ with open(abs_template_path, "r") as handle:
+ template_str = handle.read()
+
+ self.template_dict = yaml_parse(template_str)
+ self.template_dir = template_dir
+ self.resources_to_export = resources_to_export
+ self.metadata_to_export = metadata_to_export
+ self.uploader = uploader
+
+ def export_global_artifacts(self, template_dict):
+ """
+ Template params such as AWS::Include transforms are not specific to
+ any resource type but contain artifacts that should be exported,
+ here we iterate through the template dict and export params with a
+ handler defined in GLOBAL_EXPORT_DICT
+ """
+ for key, val in template_dict.items():
+ if key in GLOBAL_EXPORT_DICT:
+ template_dict[key] = GLOBAL_EXPORT_DICT[key](val, self.uploader, self.template_dir)
+ elif isinstance(val, dict):
+ self.export_global_artifacts(val)
+ elif isinstance(val, list):
+ for item in val:
+ if isinstance(item, dict):
+ self.export_global_artifacts(item)
+ return template_dict
+
+ def export_metadata(self, template_dict):
+ """
+ Exports the local artifacts referenced by the metadata section in
+ the given template to an s3 bucket.
+
+ :return: The template with references to artifacts that have been
+ exported to s3.
+ """
+ if "Metadata" not in template_dict:
+ return template_dict
+
+ for metadata_type, metadata_dict in template_dict["Metadata"].items():
+ for exporter_class in self.metadata_to_export:
+ if exporter_class.RESOURCE_TYPE != metadata_type:
+ continue
+
+ exporter = exporter_class(self.uploader)
+ exporter.export(metadata_type, metadata_dict, self.template_dir)
+
+ return template_dict
+
+ def export(self):
+ """
+ Exports the local artifacts referenced by the given template to an
+ s3 bucket.
+
+ :return: The template with references to artifacts that have been
+ exported to s3.
+ """
+ self.template_dict = self.export_metadata(self.template_dict)
+
+ if "Resources" not in self.template_dict:
+ return self.template_dict
+
+ self.template_dict = self.export_global_artifacts(self.template_dict)
+
+ for resource_id, resource in self.template_dict["Resources"].items():
+
+ resource_type = resource.get("Type", None)
+ resource_dict = resource.get("Properties", None)
+
+ for exporter_class in self.resources_to_export:
+ if exporter_class.RESOURCE_TYPE != resource_type:
+ continue
+
+ # Export code resources
+ exporter = exporter_class(self.uploader)
+ exporter.export(resource_id, resource_dict, self.template_dir)
+
+ return self.template_dict
diff -Nru awscli-1.11.13/awscli/customizations/cloudformation/deployer.py awscli-1.18.69/awscli/customizations/cloudformation/deployer.py
--- awscli-1.11.13/awscli/customizations/cloudformation/deployer.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudformation/deployer.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,229 @@
+# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import sys
+import time
+import logging
+import botocore
+import collections
+
+from awscli.customizations.cloudformation import exceptions
+from awscli.customizations.cloudformation.artifact_exporter import mktempfile, parse_s3_url
+
+from datetime import datetime
+
+LOG = logging.getLogger(__name__)
+
+ChangeSetResult = collections.namedtuple(
+ "ChangeSetResult", ["changeset_id", "changeset_type"])
+
+
+class Deployer(object):
+
+ def __init__(self, cloudformation_client,
+ changeset_prefix="awscli-cloudformation-package-deploy-"):
+ self._client = cloudformation_client
+ self.changeset_prefix = changeset_prefix
+
+ def has_stack(self, stack_name):
+ """
+ Checks if a CloudFormation stack with given name exists
+
+ :param stack_name: Name or ID of the stack
+ :return: True if stack exists. False otherwise
+ """
+ try:
+ resp = self._client.describe_stacks(StackName=stack_name)
+ if len(resp["Stacks"]) != 1:
+ return False
+
+ # When you run CreateChangeSet on a a stack that does not exist,
+ # CloudFormation will create a stack and set it's status
+ # REVIEW_IN_PROGRESS. However this stack is cannot be manipulated
+ # by "update" commands. Under this circumstances, we treat like
+ # this stack does not exist and call CreateChangeSet will
+ # ChangeSetType set to CREATE and not UPDATE.
+ stack = resp["Stacks"][0]
+ return stack["StackStatus"] != "REVIEW_IN_PROGRESS"
+
+ except botocore.exceptions.ClientError as e:
+ # If a stack does not exist, describe_stacks will throw an
+ # exception. Unfortunately we don't have a better way than parsing
+ # the exception msg to understand the nature of this exception.
+ msg = str(e)
+
+ if "Stack with id {0} does not exist".format(stack_name) in msg:
+ LOG.debug("Stack with id {0} does not exist".format(
+ stack_name))
+ return False
+ else:
+ # We don't know anything about this exception. Don't handle
+ LOG.debug("Unable to get stack details.", exc_info=e)
+ raise e
+
+ def create_changeset(self, stack_name, cfn_template,
+ parameter_values, capabilities, role_arn,
+ notification_arns, s3_uploader, tags):
+ """
+ Call Cloudformation to create a changeset and wait for it to complete
+
+ :param stack_name: Name or ID of stack
+ :param cfn_template: CloudFormation template string
+ :param parameter_values: Template parameters object
+ :param capabilities: Array of capabilities passed to CloudFormation
+ :param tags: Array of tags passed to CloudFormation
+ :return:
+ """
+
+ now = datetime.utcnow().isoformat()
+ description = "Created by AWS CLI at {0} UTC".format(now)
+
+ # Each changeset will get a unique name based on time
+ changeset_name = self.changeset_prefix + str(int(time.time()))
+
+ if not self.has_stack(stack_name):
+ changeset_type = "CREATE"
+ # When creating a new stack, UsePreviousValue=True is invalid.
+ # For such parameters, users should either override with new value,
+ # or set a Default value in template to successfully create a stack.
+ parameter_values = [x for x in parameter_values
+ if not x.get("UsePreviousValue", False)]
+ else:
+ changeset_type = "UPDATE"
+ # UsePreviousValue not valid if parameter is new
+ summary = self._client.get_template_summary(StackName=stack_name)
+ existing_parameters = [parameter['ParameterKey'] for parameter in \
+ summary['Parameters']]
+ parameter_values = [x for x in parameter_values
+ if not (x.get("UsePreviousValue", False) and \
+ x["ParameterKey"] not in existing_parameters)]
+
+ kwargs = {
+ 'ChangeSetName': changeset_name,
+ 'StackName': stack_name,
+ 'TemplateBody': cfn_template,
+ 'ChangeSetType': changeset_type,
+ 'Parameters': parameter_values,
+ 'Capabilities': capabilities,
+ 'Description': description,
+ 'Tags': tags,
+ }
+
+ # If an S3 uploader is available, use TemplateURL to deploy rather than
+ # TemplateBody. This is required for large templates.
+ if s3_uploader:
+ with mktempfile() as temporary_file:
+ temporary_file.write(kwargs.pop('TemplateBody'))
+ temporary_file.flush()
+ url = s3_uploader.upload_with_dedup(
+ temporary_file.name, "template")
+ # TemplateUrl property requires S3 URL to be in path-style format
+ parts = parse_s3_url(url, version_property="Version")
+ kwargs['TemplateURL'] = s3_uploader.to_path_style_s3_url(parts["Key"], parts.get("Version", None))
+
+ # don't set these arguments if not specified to use existing values
+ if role_arn is not None:
+ kwargs['RoleARN'] = role_arn
+ if notification_arns is not None:
+ kwargs['NotificationARNs'] = notification_arns
+ try:
+ resp = self._client.create_change_set(**kwargs)
+ return ChangeSetResult(resp["Id"], changeset_type)
+ except Exception as ex:
+ LOG.debug("Unable to create changeset", exc_info=ex)
+ raise ex
+
+ def wait_for_changeset(self, changeset_id, stack_name):
+ """
+ Waits until the changeset creation completes
+
+ :param changeset_id: ID or name of the changeset
+ :param stack_name: Stack name
+ :return: Latest status of the create-change-set operation
+ """
+ sys.stdout.write("\nWaiting for changeset to be created..\n")
+ sys.stdout.flush()
+
+ # Wait for changeset to be created
+ waiter = self._client.get_waiter("change_set_create_complete")
+ # Poll every 5 seconds. Changeset creation should be fast
+ waiter_config = {'Delay': 5}
+ try:
+ waiter.wait(ChangeSetName=changeset_id, StackName=stack_name,
+ WaiterConfig=waiter_config)
+ except botocore.exceptions.WaiterError as ex:
+ LOG.debug("Create changeset waiter exception", exc_info=ex)
+
+ resp = ex.last_response
+ status = resp["Status"]
+ reason = resp["StatusReason"]
+
+ if status == "FAILED" and \
+ "The submitted information didn't contain changes." in reason or \
+ "No updates are to be performed" in reason:
+ raise exceptions.ChangeEmptyError(stack_name=stack_name)
+
+ raise RuntimeError("Failed to create the changeset: {0} "
+ "Status: {1}. Reason: {2}"
+ .format(ex, status, reason))
+
+ def execute_changeset(self, changeset_id, stack_name):
+ """
+ Calls CloudFormation to execute changeset
+
+ :param changeset_id: ID of the changeset
+ :param stack_name: Name or ID of the stack
+ :return: Response from execute-change-set call
+ """
+ return self._client.execute_change_set(
+ ChangeSetName=changeset_id,
+ StackName=stack_name)
+
+ def wait_for_execute(self, stack_name, changeset_type):
+
+ sys.stdout.write("Waiting for stack create/update to complete\n")
+ sys.stdout.flush()
+
+ # Pick the right waiter
+ if changeset_type == "CREATE":
+ waiter = self._client.get_waiter("stack_create_complete")
+ elif changeset_type == "UPDATE":
+ waiter = self._client.get_waiter("stack_update_complete")
+ else:
+ raise RuntimeError("Invalid changeset type {0}"
+ .format(changeset_type))
+
+ # Poll every 5 seconds. Optimizing for the case when the stack has only
+ # minimal changes, such the Code for Lambda Function
+ waiter_config = {
+ 'Delay': 5,
+ 'MaxAttempts': 720,
+ }
+
+ try:
+ waiter.wait(StackName=stack_name, WaiterConfig=waiter_config)
+ except botocore.exceptions.WaiterError as ex:
+ LOG.debug("Execute changeset waiter exception", exc_info=ex)
+
+ raise exceptions.DeployFailedError(stack_name=stack_name)
+
+ def create_and_wait_for_changeset(self, stack_name, cfn_template,
+ parameter_values, capabilities, role_arn,
+ notification_arns, s3_uploader, tags):
+
+ result = self.create_changeset(
+ stack_name, cfn_template, parameter_values, capabilities,
+ role_arn, notification_arns, s3_uploader, tags)
+ self.wait_for_changeset(result.changeset_id, stack_name)
+
+ return result
diff -Nru awscli-1.11.13/awscli/customizations/cloudformation/deploy.py awscli-1.18.69/awscli/customizations/cloudformation/deploy.py
--- awscli-1.11.13/awscli/customizations/cloudformation/deploy.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudformation/deploy.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,387 @@
+# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import os
+import sys
+import logging
+
+from botocore.client import Config
+
+from awscli.customizations.cloudformation import exceptions
+from awscli.customizations.cloudformation.deployer import Deployer
+from awscli.customizations.s3uploader import S3Uploader
+from awscli.customizations.cloudformation.yamlhelper import yaml_parse
+
+from awscli.customizations.commands import BasicCommand
+from awscli.compat import get_stdout_text_writer
+from awscli.utils import write_exception
+
+LOG = logging.getLogger(__name__)
+
+
+class DeployCommand(BasicCommand):
+
+ MSG_NO_EXECUTE_CHANGESET = \
+ ("Changeset created successfully. Run the following command to "
+ "review changes:"
+ "\n"
+ "aws cloudformation describe-change-set --change-set-name "
+ "{changeset_id}"
+ "\n")
+
+ MSG_EXECUTE_SUCCESS = "Successfully created/updated stack - {stack_name}\n"
+
+ PARAMETER_OVERRIDE_CMD = "parameter-overrides"
+ TAGS_CMD = "tags"
+
+ NAME = 'deploy'
+ DESCRIPTION = BasicCommand.FROM_FILE("cloudformation",
+ "_deploy_description.rst")
+
+ ARG_TABLE = [
+ {
+ 'name': 'template-file',
+ 'required': True,
+ 'help_text': (
+ 'The path where your AWS CloudFormation'
+ ' template is located.'
+ )
+ },
+ {
+ 'name': 'stack-name',
+ 'action': 'store',
+ 'required': True,
+ 'help_text': (
+ 'The name of the AWS CloudFormation stack you\'re deploying to.'
+ ' If you specify an existing stack, the command updates the'
+ ' stack. If you specify a new stack, the command creates it.'
+ )
+ },
+ {
+ 'name': 's3-bucket',
+ 'required': False,
+ 'help_text': (
+ 'The name of the S3 bucket where this command uploads your '
+ 'CloudFormation template. This is required the deployments of '
+ 'templates sized greater than 51,200 bytes'
+ )
+ },
+ {
+ "name": "force-upload",
+ "action": "store_true",
+ "help_text": (
+ 'Indicates whether to override existing files in the S3 bucket.'
+ ' Specify this flag to upload artifacts even if they '
+ ' match existing artifacts in the S3 bucket.'
+ )
+ },
+ {
+ 'name': 's3-prefix',
+ 'help_text': (
+ 'A prefix name that the command adds to the'
+ ' artifacts\' name when it uploads them to the S3 bucket.'
+ ' The prefix name is a path name (folder name) for'
+ ' the S3 bucket.'
+ )
+ },
+
+ {
+ 'name': 'kms-key-id',
+ 'help_text': (
+ 'The ID of an AWS KMS key that the command uses'
+ ' to encrypt artifacts that are at rest in the S3 bucket.'
+ )
+ },
+ {
+ 'name': PARAMETER_OVERRIDE_CMD,
+ 'action': 'store',
+ 'required': False,
+ 'schema': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'string'
+ }
+ },
+ 'default': [],
+ 'help_text': (
+ 'A list of parameter structures that specify input parameters'
+ ' for your stack template. If you\'re updating a stack and you'
+ ' don\'t specify a parameter, the command uses the stack\'s'
+ ' existing value. For new stacks, you must specify'
+ ' parameters that don\'t have a default value.'
+ ' Syntax: ParameterKey1=ParameterValue1'
+ ' ParameterKey2=ParameterValue2 ...'
+ )
+ },
+ {
+ 'name': 'capabilities',
+ 'action': 'store',
+ 'required': False,
+ 'schema': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'string',
+ 'enum': [
+ 'CAPABILITY_IAM',
+ 'CAPABILITY_NAMED_IAM'
+ ]
+ }
+ },
+ 'default': [],
+ 'help_text': (
+ 'A list of capabilities that you must specify before AWS'
+ ' Cloudformation can create certain stacks. Some stack'
+ ' templates might include resources that can affect'
+ ' permissions in your AWS account, for example, by creating'
+ ' new AWS Identity and Access Management (IAM) users. For'
+ ' those stacks, you must explicitly acknowledge their'
+ ' capabilities by specifying this parameter. '
+ ' The only valid values are CAPABILITY_IAM and'
+ ' CAPABILITY_NAMED_IAM. If you have IAM resources, you can'
+ ' specify either capability. If you have IAM resources with'
+ ' custom names, you must specify CAPABILITY_NAMED_IAM. If you'
+ ' don\'t specify this parameter, this action returns an'
+ ' InsufficientCapabilities error.'
+ )
+
+ },
+ {
+ 'name': 'no-execute-changeset',
+ 'action': 'store_false',
+ 'dest': 'execute_changeset',
+ 'required': False,
+ 'help_text': (
+ 'Indicates whether to execute the change set. Specify this'
+ ' flag if you want to view your stack changes before'
+ ' executing the change set. The command creates an'
+ ' AWS CloudFormation change set and then exits without'
+ ' executing the change set. After you view the change set,'
+ ' execute it to implement your changes.'
+ )
+ },
+ {
+ 'name': 'role-arn',
+ 'required': False,
+ 'help_text': (
+ 'The Amazon Resource Name (ARN) of an AWS Identity and Access '
+ 'Management (IAM) role that AWS CloudFormation assumes when '
+ 'executing the change set.'
+ )
+ },
+ {
+ 'name': 'notification-arns',
+ 'required': False,
+ 'schema': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'string'
+ }
+ },
+ 'help_text': (
+ 'Amazon Simple Notification Service topic Amazon Resource Names'
+ ' (ARNs) that AWS CloudFormation associates with the stack.'
+ )
+ },
+ {
+ 'name': 'fail-on-empty-changeset',
+ 'required': False,
+ 'action': 'store_true',
+ 'group_name': 'fail-on-empty-changeset',
+ 'dest': 'fail_on_empty_changeset',
+ 'default': True,
+ 'help_text': (
+ 'Specify if the CLI should return a non-zero exit code if '
+ 'there are no changes to be made to the stack. The default '
+ 'behavior is to return a non-zero exit code.'
+ )
+ },
+ {
+ 'name': 'no-fail-on-empty-changeset',
+ 'required': False,
+ 'action': 'store_false',
+ 'group_name': 'fail-on-empty-changeset',
+ 'dest': 'fail_on_empty_changeset',
+ 'default': True,
+ 'help_text': (
+ 'Causes the CLI to return an exit code of 0 if there are no '
+ 'changes to be made to the stack.'
+ )
+ },
+ {
+ 'name': TAGS_CMD,
+ 'action': 'store',
+ 'required': False,
+ 'schema': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'string'
+ }
+ },
+ 'default': [],
+ 'help_text': (
+ 'A list of tags to associate with the stack that is created'
+ ' or updated. AWS CloudFormation also propagates these tags'
+ ' to resources in the stack if the resource supports it.'
+ ' Syntax: TagKey1=TagValue1 TagKey2=TagValue2 ...'
+ )
+ }
+ ]
+
+ def _run_main(self, parsed_args, parsed_globals):
+ cloudformation_client = \
+ self._session.create_client(
+ 'cloudformation', region_name=parsed_globals.region,
+ endpoint_url=parsed_globals.endpoint_url,
+ verify=parsed_globals.verify_ssl)
+
+ template_path = parsed_args.template_file
+ if not os.path.isfile(template_path):
+ raise exceptions.InvalidTemplatePathError(
+ template_path=template_path)
+
+ # Parse parameters
+ with open(template_path, "r") as handle:
+ template_str = handle.read()
+
+ stack_name = parsed_args.stack_name
+ parameter_overrides = self.parse_key_value_arg(
+ parsed_args.parameter_overrides,
+ self.PARAMETER_OVERRIDE_CMD)
+
+ tags_dict = self.parse_key_value_arg(parsed_args.tags, self.TAGS_CMD)
+ tags = [{"Key": key, "Value": value}
+ for key, value in tags_dict.items()]
+
+ template_dict = yaml_parse(template_str)
+
+ parameters = self.merge_parameters(template_dict, parameter_overrides)
+
+ template_size = os.path.getsize(parsed_args.template_file)
+ if template_size > 51200 and not parsed_args.s3_bucket:
+ raise exceptions.DeployBucketRequiredError()
+
+ bucket = parsed_args.s3_bucket
+ if bucket:
+ s3_client = self._session.create_client(
+ "s3",
+ config=Config(signature_version='s3v4'),
+ region_name=parsed_globals.region,
+ verify=parsed_globals.verify_ssl)
+
+ s3_uploader = S3Uploader(s3_client,
+ bucket,
+ parsed_args.s3_prefix,
+ parsed_args.kms_key_id,
+ parsed_args.force_upload)
+ else:
+ s3_uploader = None
+
+ deployer = Deployer(cloudformation_client)
+ return self.deploy(deployer, stack_name, template_str,
+ parameters, parsed_args.capabilities,
+ parsed_args.execute_changeset, parsed_args.role_arn,
+ parsed_args.notification_arns, s3_uploader,
+ tags,
+ parsed_args.fail_on_empty_changeset)
+
+ def deploy(self, deployer, stack_name, template_str,
+ parameters, capabilities, execute_changeset, role_arn,
+ notification_arns, s3_uploader, tags,
+ fail_on_empty_changeset=True):
+ try:
+ result = deployer.create_and_wait_for_changeset(
+ stack_name=stack_name,
+ cfn_template=template_str,
+ parameter_values=parameters,
+ capabilities=capabilities,
+ role_arn=role_arn,
+ notification_arns=notification_arns,
+ s3_uploader=s3_uploader,
+ tags=tags
+ )
+ except exceptions.ChangeEmptyError as ex:
+ if fail_on_empty_changeset:
+ raise
+ write_exception(ex, outfile=get_stdout_text_writer())
+ return 0
+
+ if execute_changeset:
+ deployer.execute_changeset(result.changeset_id, stack_name)
+ deployer.wait_for_execute(stack_name, result.changeset_type)
+ sys.stdout.write(self.MSG_EXECUTE_SUCCESS.format(
+ stack_name=stack_name))
+ else:
+ sys.stdout.write(self.MSG_NO_EXECUTE_CHANGESET.format(
+ changeset_id=result.changeset_id))
+
+ sys.stdout.flush()
+ return 0
+
+ def merge_parameters(self, template_dict, parameter_overrides):
+ """
+ CloudFormation CreateChangeset requires a value for every parameter
+ from the template, either specifying a new value or use previous value.
+ For convenience, this method will accept new parameter values and
+ generates a dict of all parameters in a format that ChangeSet API
+ will accept
+
+ :param parameter_overrides:
+ :return:
+ """
+ parameter_values = []
+
+ if not isinstance(template_dict.get("Parameters", None), dict):
+ return parameter_values
+
+ for key, value in template_dict["Parameters"].items():
+
+ obj = {
+ "ParameterKey": key
+ }
+
+ if key in parameter_overrides:
+ obj["ParameterValue"] = parameter_overrides[key]
+ else:
+ obj["UsePreviousValue"] = True
+
+ parameter_values.append(obj)
+
+ return parameter_values
+
+ def parse_key_value_arg(self, arg_value, argname):
+ """
+ Converts arguments that are passed as list of "Key=Value" strings
+ into a real dictionary.
+
+ :param arg_value list: Array of strings, where each string is of
+ form Key=Value
+ :param argname string: Name of the argument that contains the value
+ :return dict: Dictionary representing the key/value pairs
+ """
+ result = {}
+ for data in arg_value:
+
+ # Split at first '=' from left
+ key_value_pair = data.split("=", 1)
+
+ if len(key_value_pair) != 2:
+ raise exceptions.InvalidKeyValuePairArgumentError(
+ argname=argname,
+ value=key_value_pair)
+
+ result[key_value_pair[0]] = key_value_pair[1]
+
+ return result
+
+
+
diff -Nru awscli-1.11.13/awscli/customizations/cloudformation/exceptions.py awscli-1.18.69/awscli/customizations/cloudformation/exceptions.py
--- awscli-1.11.13/awscli/customizations/cloudformation/exceptions.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudformation/exceptions.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,55 @@
+
+class CloudFormationCommandError(Exception):
+ fmt = 'An unspecified error occurred'
+
+ def __init__(self, **kwargs):
+ msg = self.fmt.format(**kwargs)
+ Exception.__init__(self, msg)
+ self.kwargs = kwargs
+
+
+class InvalidTemplatePathError(CloudFormationCommandError):
+ fmt = "Invalid template path {template_path}"
+
+
+class ChangeEmptyError(CloudFormationCommandError):
+ fmt = "No changes to deploy. Stack {stack_name} is up to date"
+
+
+class InvalidLocalPathError(CloudFormationCommandError):
+ fmt = ("Parameter {property_name} of resource {resource_id} refers "
+ "to a file or folder that does not exist {local_path}")
+
+
+class InvalidTemplateUrlParameterError(CloudFormationCommandError):
+ fmt = ("{property_name} parameter of {resource_id} resource is invalid. "
+ "It must be a S3 URL or path to CloudFormation "
+ "template file. Actual: {template_path}")
+
+
+class ExportFailedError(CloudFormationCommandError):
+ fmt = ("Unable to upload artifact {property_value} referenced "
+ "by {property_name} parameter of {resource_id} resource."
+ "\n"
+ "{ex}")
+
+
+class InvalidKeyValuePairArgumentError(CloudFormationCommandError):
+ fmt = ("{value} value passed to --{argname} must be of format "
+ "Key=Value")
+
+
+class DeployFailedError(CloudFormationCommandError):
+ fmt = \
+ ("Failed to create/update the stack. Run the following command"
+ "\n"
+ "to fetch the list of events leading up to the failure"
+ "\n"
+ "aws cloudformation describe-stack-events --stack-name {stack_name}")
+
+class DeployBucketRequiredError(CloudFormationCommandError):
+ fmt = \
+ ("Templates with a size greater than 51,200 bytes must be deployed "
+ "via an S3 Bucket. Please add the --s3-bucket parameter to your "
+ "command. The local template will be copied to that S3 bucket and "
+ "then deployed.")
diff -Nru awscli-1.11.13/awscli/customizations/cloudformation/__init__.py awscli-1.18.69/awscli/customizations/cloudformation/__init__.py
--- awscli-1.11.13/awscli/customizations/cloudformation/__init__.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudformation/__init__.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,31 @@
+# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+from awscli.customizations.cloudformation.package import PackageCommand
+from awscli.customizations.cloudformation.deploy import DeployCommand
+
+
+def initialize(cli):
+ """
+ The entry point for CloudFormation high level commands.
+ """
+ cli.register('building-command-table.cloudformation', inject_commands)
+
+
+def inject_commands(command_table, session, **kwargs):
+ """
+ Called when the CloudFormation command table is being built. Used to
+ inject new high level commands into the command list. These high level
+ commands must not collide with existing low-level API call names.
+ """
+ command_table['package'] = PackageCommand(session)
+ command_table['deploy'] = DeployCommand(session)
diff -Nru awscli-1.11.13/awscli/customizations/cloudformation/package.py awscli-1.18.69/awscli/customizations/cloudformation/package.py
--- awscli-1.11.13/awscli/customizations/cloudformation/package.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudformation/package.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,181 @@
+# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import os
+import logging
+import sys
+
+import json
+
+from botocore.client import Config
+
+from awscli.customizations.cloudformation.artifact_exporter import Template
+from awscli.customizations.cloudformation.yamlhelper import yaml_dump
+from awscli.customizations.cloudformation import exceptions
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.s3uploader import S3Uploader
+
+LOG = logging.getLogger(__name__)
+
+
+class PackageCommand(BasicCommand):
+
+ MSG_PACKAGED_TEMPLATE_WRITTEN = (
+ "Successfully packaged artifacts and wrote output template "
+ "to file {output_file_name}."
+ "\n"
+ "Execute the following command to deploy the packaged template"
+ "\n"
+ "aws cloudformation deploy --template-file {output_file_path} "
+ "--stack-name "
+ "\n")
+
+ NAME = "package"
+
+ DESCRIPTION = BasicCommand.FROM_FILE("cloudformation",
+ "_package_description.rst")
+
+ ARG_TABLE = [
+ {
+ 'name': 'template-file',
+ 'required': True,
+ 'help_text': (
+ 'The path where your AWS CloudFormation'
+ ' template is located.'
+ )
+ },
+
+ {
+ 'name': 's3-bucket',
+ 'required': True,
+ 'help_text': (
+ 'The name of the S3 bucket where this command uploads'
+ ' the artifacts that are referenced in your template.'
+ )
+ },
+
+ {
+ 'name': 's3-prefix',
+ 'help_text': (
+ 'A prefix name that the command adds to the'
+ ' artifacts\' name when it uploads them to the S3 bucket.'
+ ' The prefix name is a path name (folder name) for'
+ ' the S3 bucket.'
+ )
+ },
+
+ {
+ 'name': 'kms-key-id',
+ 'help_text': (
+ 'The ID of an AWS KMS key that the command uses'
+ ' to encrypt artifacts that are at rest in the S3 bucket.'
+ )
+ },
+
+ {
+ "name": "output-template-file",
+ "help_text": (
+ "The path to the file where the command writes the"
+ " output AWS CloudFormation template. If you don't specify"
+ " a path, the command writes the template to the standard"
+ " output."
+ )
+ },
+
+ {
+ "name": "use-json",
+ "action": "store_true",
+ "help_text": (
+ "Indicates whether to use JSON as the format for the output AWS"
+ " CloudFormation template. YAML is used by default."
+ )
+ },
+
+ {
+ "name": "force-upload",
+ "action": "store_true",
+ "help_text": (
+ 'Indicates whether to override existing files in the S3 bucket.'
+ ' Specify this flag to upload artifacts even if they '
+ ' match existing artifacts in the S3 bucket.'
+ )
+ },
+ {
+ "name": "metadata",
+ "cli_type_name": "map",
+ "schema": {
+ "type": "map",
+ "key": {"type": "string"},
+ "value": {"type": "string"}
+ },
+ "help_text": "A map of metadata to attach to *ALL* the artifacts that"
+ " are referenced in your template."
+ }
+ ]
+
+ def _run_main(self, parsed_args, parsed_globals):
+ s3_client = self._session.create_client(
+ "s3",
+ config=Config(signature_version='s3v4'),
+ region_name=parsed_globals.region,
+ verify=parsed_globals.verify_ssl)
+
+ template_path = parsed_args.template_file
+ if not os.path.isfile(template_path):
+ raise exceptions.InvalidTemplatePathError(
+ template_path=template_path)
+
+ bucket = parsed_args.s3_bucket
+
+ self.s3_uploader = S3Uploader(s3_client,
+ bucket,
+ parsed_args.s3_prefix,
+ parsed_args.kms_key_id,
+ parsed_args.force_upload)
+ # attach the given metadata to the artifacts to be uploaded
+ self.s3_uploader.artifact_metadata = parsed_args.metadata
+
+ output_file = parsed_args.output_template_file
+ use_json = parsed_args.use_json
+ exported_str = self._export(template_path, use_json)
+
+ sys.stdout.write("\n")
+ self.write_output(output_file, exported_str)
+
+ if output_file:
+ msg = self.MSG_PACKAGED_TEMPLATE_WRITTEN.format(
+ output_file_name=output_file,
+ output_file_path=os.path.abspath(output_file))
+ sys.stdout.write(msg)
+
+ sys.stdout.flush()
+ return 0
+
+ def _export(self, template_path, use_json):
+ template = Template(template_path, os.getcwd(), self.s3_uploader)
+ exported_template = template.export()
+
+ if use_json:
+ exported_str = json.dumps(exported_template, indent=4, ensure_ascii=False)
+ else:
+ exported_str = yaml_dump(exported_template)
+
+ return exported_str
+
+ def write_output(self, output_file_name, data):
+ if output_file_name is None:
+ sys.stdout.write(data)
+ return
+
+ with open(output_file_name, "w") as fp:
+ fp.write(data)
diff -Nru awscli-1.11.13/awscli/customizations/cloudformation/yamlhelper.py awscli-1.18.69/awscli/customizations/cloudformation/yamlhelper.py
--- awscli-1.11.13/awscli/customizations/cloudformation/yamlhelper.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudformation/yamlhelper.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,99 @@
+# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+from botocore.compat import json
+from botocore.compat import OrderedDict
+
+import yaml
+from yaml.resolver import ScalarNode, SequenceNode
+
+from awscli.compat import six
+
+
+def intrinsics_multi_constructor(loader, tag_prefix, node):
+ """
+ YAML constructor to parse CloudFormation intrinsics.
+ This will return a dictionary with key being the instrinsic name
+ """
+
+ # Get the actual tag name excluding the first exclamation
+ tag = node.tag[1:]
+
+ # Some intrinsic functions doesn't support prefix "Fn::"
+ prefix = "Fn::"
+ if tag in ["Ref", "Condition"]:
+ prefix = ""
+
+ cfntag = prefix + tag
+
+ if tag == "GetAtt" and isinstance(node.value, six.string_types):
+ # ShortHand notation for !GetAtt accepts Resource.Attribute format
+ # while the standard notation is to use an array
+ # [Resource, Attribute]. Convert shorthand to standard format
+ value = node.value.split(".", 1)
+
+ elif isinstance(node, ScalarNode):
+ # Value of this node is scalar
+ value = loader.construct_scalar(node)
+
+ elif isinstance(node, SequenceNode):
+ # Value of this node is an array (Ex: [1,2])
+ value = loader.construct_sequence(node)
+
+ else:
+ # Value of this node is an mapping (ex: {foo: bar})
+ value = loader.construct_mapping(node)
+
+ return {cfntag: value}
+
+
+def _dict_representer(dumper, data):
+ return dumper.represent_dict(data.items())
+
+
+def yaml_dump(dict_to_dump):
+ """
+ Dumps the dictionary as a YAML document
+ :param dict_to_dump:
+ :return:
+ """
+ FlattenAliasDumper.add_representer(OrderedDict, _dict_representer)
+ return yaml.dump(
+ dict_to_dump,
+ default_flow_style=False,
+ Dumper=FlattenAliasDumper,
+ )
+
+
+def _dict_constructor(loader, node):
+ # Necessary in order to make yaml merge tags work
+ loader.flatten_mapping(node)
+ return OrderedDict(loader.construct_pairs(node))
+
+
+def yaml_parse(yamlstr):
+ """Parse a yaml string"""
+ try:
+ # PyYAML doesn't support json as well as it should, so if the input
+ # is actually just json it is better to parse it with the standard
+ # json parser.
+ return json.loads(yamlstr, object_pairs_hook=OrderedDict)
+ except ValueError:
+ yaml.SafeLoader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, _dict_constructor)
+ yaml.SafeLoader.add_multi_constructor(
+ "!", intrinsics_multi_constructor)
+ return yaml.safe_load(yamlstr)
+
+
+class FlattenAliasDumper(yaml.SafeDumper):
+ def ignore_aliases(self, data):
+ return True
diff -Nru awscli-1.11.13/awscli/customizations/cloudfront.py awscli-1.18.69/awscli/customizations/cloudfront.py
--- awscli-1.11.13/awscli/customizations/cloudfront.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudfront.py 2020-05-28 19:25:48.000000000 +0000
@@ -48,7 +48,8 @@
'default-root-object', CreateDefaultRootObject(argument_table)))
context = {}
- event_handler.register('top-level-args-parsed', context.update)
+ event_handler.register(
+ 'top-level-args-parsed', context.update, unique_id='cloudfront')
event_handler.register(
'operation-args-parsed.cloudfront.update-distribution',
validate_mutually_exclusive_handler(
diff -Nru awscli-1.11.13/awscli/customizations/cloudtrail/subscribe.py awscli-1.18.69/awscli/customizations/cloudtrail/subscribe.py
--- awscli-1.11.13/awscli/customizations/cloudtrail/subscribe.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudtrail/subscribe.py 2020-05-28 19:25:48.000000000 +0000
@@ -58,8 +58,8 @@
{'name': 'sns-custom-policy',
'help_text': 'Custom SNS policy template or URL'}
]
-
UPDATE = False
+ _UNDOCUMENTED = True
def _run_main(self, args, parsed_globals):
self.setup_services(args, parsed_globals)
diff -Nru awscli-1.11.13/awscli/customizations/cloudtrail/validation.py awscli-1.18.69/awscli/customizations/cloudtrail/validation.py
--- awscli-1.11.13/awscli/customizations/cloudtrail/validation.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/cloudtrail/validation.py 2020-05-28 19:25:48.000000000 +0000
@@ -29,6 +29,7 @@
get_account_id_from_arn
from awscli.customizations.commands import BasicCommand
from botocore.exceptions import ClientError
+from awscli.schema import ParameterRequiredError
LOG = logging.getLogger(__name__)
@@ -77,14 +78,17 @@
raise ValueError('Invalid trail ARN provided: %s' % trail_arn)
-def create_digest_traverser(cloudtrail_client, s3_client_provider, trail_arn,
+def create_digest_traverser(cloudtrail_client, organization_client,
+ s3_client_provider, trail_arn,
trail_source_region=None, on_invalid=None,
on_gap=None, on_missing=None, bucket=None,
- prefix=None):
+ prefix=None, account_id=None):
"""Creates a CloudTrail DigestTraverser and its object graph.
:type cloudtrail_client: botocore.client.CloudTrail
:param cloudtrail_client: Client used to connect to CloudTrail
+ :type organization_client: botocore.client.organizations
+ :param organization_client: Client used to connect to Organizations
:type s3_client_provider: S3ClientProvider
:param s3_client_provider: Used to create Amazon S3 client per/region.
:param trail_arn: CloudTrail trail ARN
@@ -100,6 +104,9 @@
:param prefix: bucket: Key prefix prepended to each digest and log placed
in the Amazon S3 bucket if it is different than the prefix that is
currently associated with the trail.
+ :param account_id: The account id for which the digest files are
+ validated. For normal trails this is the caller account, for
+ organization trails it is the member accout.
``on_gap``, ``on_invalid``, and ``on_missing`` callbacks are invoked with
the following named arguments:
@@ -112,22 +119,36 @@
- ``message``: (optional) Message string about the notification.
"""
assert_cloudtrail_arn_is_valid(trail_arn)
- account_id = get_account_id_from_arn(trail_arn)
+ organization_id = None
if bucket is None:
# Determine the bucket and prefix based on the trail arn.
trail_info = get_trail_by_arn(cloudtrail_client, trail_arn)
LOG.debug('Loaded trail info: %s', trail_info)
bucket = trail_info['S3BucketName']
prefix = trail_info.get('S3KeyPrefix', None)
+ is_org_trail = trail_info['IsOrganizationTrail']
+ if is_org_trail:
+ if not account_id:
+ raise ParameterRequiredError(
+ "Missing required parameter for organization "
+ "trail: '--account-id'")
+ organization_id = organization_client.describe_organization()[
+ 'Organization']['Id']
+
# Determine the region from the ARN (e.g., arn:aws:cloudtrail:REGION:...)
trail_region = trail_arn.split(':')[3]
# Determine the name from the ARN (the last part after "/")
trail_name = trail_arn.split('/')[-1]
+ # If account id is not specified parse it from trail ARN
+ if not account_id:
+ account_id = get_account_id_from_arn(trail_arn)
+
digest_provider = DigestProvider(
account_id=account_id, trail_name=trail_name,
s3_client_provider=s3_client_provider,
trail_source_region=trail_source_region,
- trail_home_region=trail_region)
+ trail_home_region=trail_region,
+ organization_id=organization_id)
return DigestTraverser(
digest_provider=digest_provider, starting_bucket=bucket,
starting_prefix=prefix, on_invalid=on_invalid, on_gap=on_gap,
@@ -224,12 +245,14 @@
one digest to the next.
"""
def __init__(self, s3_client_provider, account_id, trail_name,
- trail_home_region, trail_source_region=None):
+ trail_home_region, trail_source_region=None,
+ organization_id=None):
self._client_provider = s3_client_provider
self.trail_name = trail_name
self.account_id = account_id
self.trail_home_region = trail_home_region
self.trail_source_region = trail_source_region or trail_home_region
+ self.organization_id = organization_id
def load_digest_keys_in_range(self, bucket, prefix, start_date, end_date):
"""Returns a list of digest keys in the date range.
@@ -300,28 +323,46 @@
"""
# Subtract one minute to ensure the dates are inclusive.
date = start_date - timedelta(minutes=1)
- template = ('AWSLogs/{account}/CloudTrail-Digest/{source_region}/'
- '{ymd}/{account}_CloudTrail-Digest_{source_region}_{name}_'
- '{home_region}_{date}.json.gz')
- key = template.format(account=self.account_id, date=format_date(date),
- ymd=date.strftime('%Y/%m/%d'),
- source_region=self.trail_source_region,
- home_region=self.trail_home_region,
- name=self.trail_name)
+ template = 'AWSLogs/'
+ template_params = {
+ 'account_id': self.account_id,
+ 'date': format_date(date),
+ 'ymd': date.strftime('%Y/%m/%d'),
+ 'source_region': self.trail_source_region,
+ 'home_region': self.trail_home_region,
+ 'name': self.trail_name
+ }
+ if self.organization_id:
+ template += '{organization_id}/'
+ template_params['organization_id'] = self.organization_id
+ template += (
+ '{account_id}/CloudTrail-Digest/{source_region}/'
+ '{ymd}/{account_id}_CloudTrail-Digest_{source_region}_{name}_'
+ '{home_region}_{date}.json.gz'
+ )
+ key = template.format(**template_params)
if key_prefix:
key = key_prefix + '/' + key
return key
def _create_digest_key_regex(self, key_prefix):
"""Creates a regular expression used to match against S3 keys"""
- template = ('AWSLogs/{account}/CloudTrail\\-Digest/{source_region}/'
- '\\d+/\\d+/\\d+/{account}_CloudTrail\\-Digest_'
- '{source_region}_{name}_{home_region}_.+\\.json\\.gz')
- key = template.format(
- account=re.escape(self.account_id),
- source_region=re.escape(self.trail_source_region),
- home_region=re.escape(self.trail_home_region),
- name=re.escape(self.trail_name))
+ template = 'AWSLogs/'
+ template_params = {
+ 'account_id': re.escape(self.account_id),
+ 'source_region': re.escape(self.trail_source_region),
+ 'home_region': re.escape(self.trail_home_region),
+ 'name': re.escape(self.trail_name)
+ }
+ if self.organization_id:
+ template += '{organization_id}/'
+ template_params['organization_id'] = self.organization_id
+ template += (
+ '{account_id}/CloudTrail\\-Digest/{source_region}/'
+ '\\d+/\\d+/\\d+/{account_id}_CloudTrail\\-Digest_'
+ '{source_region}_{name}_{home_region}_.+\\.json\\.gz'
+ )
+ key = template.format(**template_params)
if key_prefix:
key = re.escape(key_prefix) + '/' + key
return '^' + key + '$'
@@ -585,6 +626,8 @@
log files.
- The digest and log files must not have been moved from the original S3
location where CloudTrail delivered them.
+ - For organization trails you must have access to describe-organization to
+ validate digest files
When you disable Log File Validation, the chain of digest files is broken
after one hour. CloudTrail will not digest log files that were delivered
@@ -629,6 +672,11 @@
'digest files are stored. If not specified, the CLI '
'will determine the prefix automatically by calling '
'describe_trails.')},
+ {'name': 'account-id', 'cli_type_name': 'string',
+ 'help_text': ('Optionally specifies the account for validating logs. '
+ 'This parameter is needed for organization trails '
+ 'for validating logs for specific account inside an '
+ 'organization')},
{'name': 'verbose', 'cli_type_name': 'boolean',
'action': 'store_true',
'help_text': 'Display verbose log validation information'}
@@ -644,6 +692,7 @@
self.s3_prefix = None
self.s3_client_provider = None
self.cloudtrail_client = None
+ self.account_id = None
self._source_region = None
self._valid_digests = 0
self._invalid_digests = 0
@@ -666,6 +715,7 @@
self.is_verbose = args.verbose
self.s3_bucket = args.s3_bucket
self.s3_prefix = args.s3_prefix
+ self.account_id = args.account_id
self.start_time = normalize_date(parse_date(args.start_time))
if args.end_time:
self.end_time = normalize_date(parse_date(args.end_time))
@@ -688,6 +738,9 @@
self._session, self._source_region)
client_args = {'region_name': parsed_globals.region,
'verify': parsed_globals.verify_ssl}
+ self.organization_client = self._session.create_client(
+ 'organizations', **client_args)
+
if parsed_globals.endpoint_url is not None:
client_args['endpoint_url'] = parsed_globals.endpoint_url
self.cloudtrail_client = self._session.create_client(
@@ -696,10 +749,12 @@
def _call(self):
traverser = create_digest_traverser(
trail_arn=self.trail_arn, cloudtrail_client=self.cloudtrail_client,
+ organization_client=self.organization_client,
trail_source_region=self._source_region,
s3_client_provider=self.s3_client_provider, bucket=self.s3_bucket,
prefix=self.s3_prefix, on_missing=self._on_missing_digest,
- on_invalid=self._on_invalid_digest, on_gap=self._on_digest_gap)
+ on_invalid=self._on_invalid_digest, on_gap=self._on_digest_gap,
+ account_id=self.account_id)
self._write_startup_text()
digests = traverser.traverse(self.start_time, self.end_time)
for digest in digests:
diff -Nru awscli-1.11.13/awscli/customizations/codecommit.py awscli-1.18.69/awscli/customizations/codecommit.py
--- awscli-1.11.13/awscli/customizations/codecommit.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/codecommit.py 2020-05-28 19:25:48.000000000 +0000
@@ -122,8 +122,10 @@
def read_git_parameters(self):
parsed = {}
for line in sys.stdin:
- key, value = line.strip().split('=', 1)
- parsed[key] = value
+ line = line.strip()
+ if line:
+ key, value = line.split('=', 1)
+ parsed[key] = value
return parsed
def extract_url(self, parameters):
@@ -133,10 +135,10 @@
return url
def extract_region(self, parameters, parsed_globals):
- match = re.match(r'git-codecommit\.([^.]+)\.amazonaws\.com',
+ match = re.match(r'(vpce-.+\.)?git-codecommit(-fips)?\.([^.]+)\.(vpce\.)?amazonaws\.com',
parameters['host'])
if match is not None:
- return match.group(1)
+ return match.group(3)
elif parsed_globals.region is not None:
return parsed_globals.region
else:
diff -Nru awscli-1.11.13/awscli/customizations/codedeploy/utils.py awscli-1.18.69/awscli/customizations/codedeploy/utils.py
--- awscli-1.11.13/awscli/customizations/codedeploy/utils.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/codedeploy/utils.py 2020-05-28 19:25:48.000000000 +0000
@@ -14,10 +14,12 @@
import platform
import re
+import awscli.compat
from awscli.compat import urlopen, URLError
from awscli.customizations.codedeploy.systems import System, Ubuntu, Windows, RHEL
from socket import timeout
+
MAX_INSTANCE_NAME_LENGTH = 100
MAX_TAGS_PER_INSTANCE = 10
MAX_TAG_KEY_LENGTH = 128
@@ -83,7 +85,7 @@
MAX_TAG_KEY_LENGTH
)
)
- if len(tag['Value']) > MAX_TAG_KEY_LENGTH:
+ if len(tag['Value']) > MAX_TAG_VALUE_LENGTH:
raise ValueError(
'Tag Value cannot be longer than {0} characters.'.format(
MAX_TAG_VALUE_LENGTH
@@ -99,9 +101,10 @@
def validate_instance(params):
if platform.system() == 'Linux':
- if 'Ubuntu' in platform.linux_distribution()[0]:
+ distribution = awscli.compat.linux_distribution()[0]
+ if 'Ubuntu' in distribution:
params.system = Ubuntu(params)
- if 'Red Hat Enterprise Linux Server' in platform.linux_distribution()[0]:
+ if 'Red Hat Enterprise Linux Server' in distribution:
params.system = RHEL(params)
elif platform.system() == 'Windows':
params.system = Windows(params)
diff -Nru awscli-1.11.13/awscli/customizations/commands.py awscli-1.18.69/awscli/customizations/commands.py
--- awscli-1.11.13/awscli/customizations/commands.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/commands.py 2020-05-28 19:25:48.000000000 +0000
@@ -366,13 +366,11 @@
super(BasicDocHandler, self).__init__(help_command)
self.doc = help_command.doc
- def build_translation_map(self):
- return {}
-
def doc_description(self, help_command, **kwargs):
self.doc.style.h2('Description')
self.doc.write(help_command.description)
self.doc.style.new_paragraph()
+ self._add_top_level_args_reference(help_command)
def doc_synopsis_start(self, help_command, **kwargs):
if not help_command.synopsis:
@@ -440,3 +438,6 @@
def doc_output(self, help_command, event_name, **kwargs):
pass
+
+ def doc_options_end(self, help_command, **kwargs):
+ self._add_top_level_args_reference(help_command)
diff -Nru awscli-1.11.13/awscli/customizations/configure/addmodel.py awscli-1.18.69/awscli/customizations/configure/addmodel.py
--- awscli-1.11.13/awscli/customizations/configure/addmodel.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/configure/addmodel.py 2020-05-28 19:25:48.000000000 +0000
@@ -114,7 +114,7 @@
os.makedirs(model_directory)
# Write the model to the specified location
- with open(model_location, 'w') as f:
- f.write(parsed_args.service_model)
+ with open(model_location, 'wb') as f:
+ f.write(parsed_args.service_model.encode('utf-8'))
return 0
diff -Nru awscli-1.11.13/awscli/customizations/configure/configure.py awscli-1.18.69/awscli/customizations/configure/configure.py
--- awscli-1.11.13/awscli/customizations/configure/configure.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/configure/configure.py 2020-05-28 19:25:48.000000000 +0000
@@ -23,7 +23,7 @@
from awscli.customizations.configure.list import ConfigureListCommand
from awscli.customizations.configure.writer import ConfigFileWriter
-from . import mask_value
+from . import mask_value, profile_to_section
logger = logging.getLogger(__name__)
@@ -112,11 +112,11 @@
config_filename = os.path.expanduser(
self._session.get_config_variable('config_file'))
if new_values:
- self._write_out_creds_file_values(new_values,
- parsed_globals.profile)
- if parsed_globals.profile is not None:
- new_values['__section__'] = (
- 'profile %s' % parsed_globals.profile)
+ profile = self._session.profile
+ self._write_out_creds_file_values(new_values, profile)
+ if profile is not None:
+ section = profile_to_section(profile)
+ new_values['__section__'] = section
self._config_writer.update_config(new_values, config_filename)
def _write_out_creds_file_values(self, new_values, profile_name):
diff -Nru awscli-1.11.13/awscli/customizations/configure/get.py awscli-1.18.69/awscli/customizations/configure/get.py
--- awscli-1.11.13/awscli/customizations/configure/get.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/configure/get.py 2020-05-28 19:25:48.000000000 +0000
@@ -11,17 +11,21 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import sys
+import logging
from awscli.customizations.commands import BasicCommand
+from awscli.compat import six
from . import PREDEFINED_SECTION_NAMES
+LOG = logging.getLogger(__name__)
+
class ConfigureGetCommand(BasicCommand):
NAME = 'get'
DESCRIPTION = BasicCommand.FROM_FILE('configure', 'get',
'_description.rst')
- SYNOPSIS = ('aws configure get varname [--profile profile-name]')
+ SYNOPSIS = 'aws configure get varname [--profile profile-name]'
EXAMPLES = BasicCommand.FROM_FILE('configure', 'get', '_examples.rst')
ARG_TABLE = [
{'name': 'varname',
@@ -30,13 +34,14 @@
'cli_type_name': 'string', 'positional_arg': True},
]
- def __init__(self, session, stream=sys.stdout):
+ def __init__(self, session, stream=sys.stdout, error_stream=sys.stderr):
super(ConfigureGetCommand, self).__init__(session)
self._stream = stream
+ self._error_stream = error_stream
def _run_main(self, args, parsed_globals):
varname = args.varname
- value = None
+
if '.' not in varname:
# get_scoped_config() returns the config variables in the config
# file (not the logical_var names), which is what we want.
@@ -44,17 +49,30 @@
value = config.get(varname)
else:
value = self._get_dotted_config_value(varname)
- if value is not None:
+
+ LOG.debug(u'Config value retrieved: %s' % value)
+
+ if isinstance(value, six.string_types):
self._stream.write(value)
self._stream.write('\n')
return 0
+ elif isinstance(value, dict):
+ # TODO: add support for this. We would need to print it off in
+ # the same format as the config file.
+ self._error_stream.write(
+ 'varname (%s) must reference a value, not a section or '
+ 'sub-section.' % varname
+ )
+ return 1
else:
return 1
def _get_dotted_config_value(self, varname):
parts = varname.split('.')
num_dots = varname.count('.')
- # Logic to deal with predefined sections like [preview], [plugin] and etc.
+
+ # Logic to deal with predefined sections like [preview], [plugin] and
+ # etc.
if num_dots == 1 and parts[0] in PREDEFINED_SECTION_NAMES:
full_config = self._session.full_config
section, config_name = varname.split('.')
@@ -64,18 +82,23 @@
value = full_config['profiles'].get(
section, {}).get(config_name)
return value
+
if parts[0] == 'profile':
profile_name = parts[1]
config_name = parts[2]
remaining = parts[3:]
- # Check if varname starts with 'default' profile (e.g. default.emr-dev.emr.instance_profile)
- # If not, go further to check if varname starts with a known profile name
- elif parts[0] == 'default' or (parts[0] in self._session.full_config['profiles']):
+ # Check if varname starts with 'default' profile (e.g.
+ # default.emr-dev.emr.instance_profile) If not, go further to check
+ # if varname starts with a known profile name
+ elif parts[0] == 'default' or (
+ parts[0] in self._session.full_config['profiles']):
profile_name = parts[0]
config_name = parts[1]
remaining = parts[2:]
else:
profile_name = self._session.get_config_variable('profile')
+ if profile_name is None:
+ profile_name = 'default'
config_name = parts[0]
remaining = parts[1:]
diff -Nru awscli-1.11.13/awscli/customizations/configure/__init__.py awscli-1.18.69/awscli/customizations/configure/__init__.py
--- awscli-1.11.13/awscli/customizations/configure/__init__.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/configure/__init__.py 2020-05-28 19:25:48.000000000 +0000
@@ -10,8 +10,12 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
+import string
+from botocore.vendored.six.moves import shlex_quote
+
NOT_SET = ''
PREDEFINED_SECTION_NAMES = ('preview', 'plugins')
+_WHITESPACE = ' \t'
class ConfigValue(object):
@@ -36,3 +40,10 @@
return 'None'
else:
return ('*' * 16) + current_value[-4:]
+
+
+def profile_to_section(profile_name):
+ """Converts a profile name to a section header to be used in the config."""
+ if any(c in _WHITESPACE for c in profile_name):
+ profile_name = shlex_quote(profile_name)
+ return 'profile %s' % profile_name
diff -Nru awscli-1.11.13/awscli/customizations/configure/set.py awscli-1.18.69/awscli/customizations/configure/set.py
--- awscli-1.11.13/awscli/customizations/configure/set.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/configure/set.py 2020-05-28 19:25:48.000000000 +0000
@@ -15,7 +15,7 @@
from awscli.customizations.commands import BasicCommand
from awscli.customizations.configure.writer import ConfigFileWriter
-from . import PREDEFINED_SECTION_NAMES
+from . import PREDEFINED_SECTION_NAMES, profile_to_section
class ConfigureSetCommand(BasicCommand):
@@ -60,7 +60,7 @@
# profile (or leave it as the 'default' section if
# no profile is set).
if self._session.profile is not None:
- section = 'profile %s' % self._session.profile
+ section = profile_to_section(self._session.profile)
else:
# First figure out if it's been scoped to a profile.
parts = varname.split('.')
@@ -71,14 +71,14 @@
remaining = parts[1:]
else:
# [profile, profile_name, ...]
- section = "profile %s" % parts[1]
+ section = profile_to_section(parts[1])
remaining = parts[2:]
varname = remaining[0]
if len(remaining) == 2:
value = {remaining[1]: value}
elif parts[0] not in PREDEFINED_SECTION_NAMES:
if self._session.profile is not None:
- section = 'profile %s' % self._session.profile
+ section = profile_to_section(self._session.profile)
else:
profile_name = self._session.get_config_variable('profile')
if profile_name is not None:
diff -Nru awscli-1.11.13/awscli/customizations/datapipeline/__init__.py awscli-1.18.69/awscli/customizations/datapipeline/__init__.py
--- awscli-1.11.13/awscli/customizations/datapipeline/__init__.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/datapipeline/__init__.py 2020-05-28 19:25:48.000000000 +0000
@@ -50,6 +50,7 @@
you can use the same key name and specify each value as
a key value pair. e.g. arrayValue=value1 arrayValue=value2
"""
+MAX_ITEMS_PER_DESCRIBE = 100
class DocSectionNotFoundError(Exception):
@@ -305,7 +306,10 @@
key = argument_components[0]
value = argument_components[1]
if key in parameter_object:
- parameter_object[key] = [parameter_object[key], value]
+ if isinstance(parameter_object[key], list):
+ parameter_object[key].append(value)
+ else:
+ parameter_object[key] = [parameter_object[key], value]
else:
parameter_object[key] = value
except IndexError:
@@ -390,8 +394,7 @@
def _list_runs(self, parsed_args, parsed_globals):
query = QueryArgBuilder().build_query(parsed_args)
object_ids = self._query_objects(parsed_args.pipeline_id, query)
- objects = self._describe_objects(parsed_args.pipeline_id, object_ids)[
- 'pipelineObjects']
+ objects = self._describe_objects(parsed_args.pipeline_id, object_ids)
converted = convert_described_objects(
objects,
sort_key_func=lambda x: (x.get('@scheduledStartTime'),
@@ -400,9 +403,17 @@
formatter(self.NAME, converted)
def _describe_objects(self, pipeline_id, object_ids):
- parsed = self.client.describe_objects(
- pipelineId=pipeline_id, objectIds=object_ids)
- return parsed
+ # DescribeObjects will only accept 100 objectIds at a time,
+ # so we need to break up the list passed in into chunks that are at
+ # most that size. We then aggregate the results to return.
+ objects = []
+ for i in range(0, len(object_ids), MAX_ITEMS_PER_DESCRIBE):
+ current_object_ids = object_ids[i:i + MAX_ITEMS_PER_DESCRIBE]
+ result = self.client.describe_objects(
+ pipelineId=pipeline_id, objectIds=current_object_ids)
+ objects.extend(result['pipelineObjects'])
+
+ return objects
def _query_objects(self, pipeline_id, query):
paginator = self.client.get_paginator('query_objects').paginate(
diff -Nru awscli-1.11.13/awscli/customizations/dlm/constants.py awscli-1.18.69/awscli/customizations/dlm/constants.py
--- awscli-1.11.13/awscli/customizations/dlm/constants.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/dlm/constants.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,35 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+# Declare all the constants used by Lifecycle in this file
+
+# Lifecycle role names
+LIFECYCLE_DEFAULT_ROLE_NAME = "AWSDataLifecycleManagerDefaultRole"
+
+# Lifecycle role arn names
+LIFECYCLE_DEFAULT_MANAGED_POLICY_NAME = "AWSDataLifecycleManagerServiceRole"
+
+POLICY_ARN_PATTERN = "arn:{0}:iam::aws:policy/service-role/{1}"
+
+# Assume Role Policy definitions for roles
+LIFECYCLE_DEFAULT_ROLE_ASSUME_POLICY = {
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Sid": "",
+ "Effect": "Allow",
+ "Principal": {"Service": "dlm.amazonaws.com"},
+ "Action": "sts:AssumeRole"
+ }
+ ]
+}
diff -Nru awscli-1.11.13/awscli/customizations/dlm/createdefaultrole.py awscli-1.18.69/awscli/customizations/dlm/createdefaultrole.py
--- awscli-1.11.13/awscli/customizations/dlm/createdefaultrole.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/dlm/createdefaultrole.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,155 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+# Class to create default roles for lifecycle
+import logging
+from awscli.clidriver import CLIOperationCaller
+from awscli.customizations.utils import get_policy_arn_suffix
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.dlm.iam import IAM
+from awscli.customizations.dlm.constants \
+ import LIFECYCLE_DEFAULT_ROLE_NAME, \
+ LIFECYCLE_DEFAULT_ROLE_ASSUME_POLICY, \
+ LIFECYCLE_DEFAULT_MANAGED_POLICY_NAME, \
+ POLICY_ARN_PATTERN
+
+LOG = logging.getLogger(__name__)
+
+
+def _construct_result(create_role_response, get_policy_response):
+ get_policy_response.pop('ResponseMetadata', None)
+ create_role_response.pop('ResponseMetadata', None)
+ result = {'RolePolicy': get_policy_response}
+ result.update(create_role_response)
+ return result
+
+
+# Display the result as formatted json
+def display_response(session, operation_name, result, parsed_globals):
+ if result is not None:
+ cli_operation_caller = CLIOperationCaller(session)
+ # Calling a private method. Should be changed after the functionality
+ # is moved outside CliOperationCaller.
+ cli_operation_caller._display_response(
+ operation_name, result, parsed_globals)
+
+
+# Get policy arn from region and policy name
+def get_policy_arn(region, policy_name):
+ region_suffix = get_policy_arn_suffix(region)
+ role_arn = POLICY_ARN_PATTERN.format(region_suffix, policy_name)
+ return role_arn
+
+
+# Method to parse the arguments to get the region value
+def get_region(session, parsed_globals):
+ region = parsed_globals.region
+ if region is None:
+ region = session.get_config_variable('region')
+ return region
+
+
+class CreateDefaultRole(BasicCommand):
+ NAME = "create-default-role"
+ DESCRIPTION = ('Creates the default IAM role ' +
+ LIFECYCLE_DEFAULT_ROLE_NAME +
+ ' which will be used by Lifecycle service.\n'
+ 'If the role does not exist, create-default-role '
+ 'will automatically create it and set its policy.'
+ ' If the role has been already '
+ 'created, create-default-role'
+ ' will not update its policy.'
+ '\n')
+ ARG_TABLE = [
+ {'name': 'iam-endpoint',
+ 'no_paramfile': True,
+ 'help_text': '
The IAM endpoint to call for creating the roles.'
+ ' This is optional and should only be specified when a'
+ ' custom endpoint should be called for IAM operations'
+ '.
'}
+ ]
+
+ def __init__(self, session):
+ super(CreateDefaultRole, self).__init__(session)
+
+ def _run_main(self, parsed_args, parsed_globals):
+ """Call to run the commands"""
+
+ self._region = get_region(self._session, parsed_globals)
+ self._endpoint_url = parsed_args.iam_endpoint
+ self._iam_client = IAM(self._session.create_client(
+ 'iam',
+ region_name=self._region,
+ endpoint_url=self._endpoint_url,
+ verify=parsed_globals.verify_ssl
+ ))
+
+ result = self._create_default_role_if_not_exists(parsed_globals)
+
+ display_response(
+ self._session,
+ 'create_role',
+ result,
+ parsed_globals
+ )
+
+ return 0
+
+ def _create_default_role_if_not_exists(self, parsed_globals):
+ """Method to create default lifecycle role
+ if it doesn't exist already
+ """
+ role_name = LIFECYCLE_DEFAULT_ROLE_NAME
+ assume_role_policy = LIFECYCLE_DEFAULT_ROLE_ASSUME_POLICY
+
+ if self._iam_client.check_if_role_exists(role_name):
+ LOG.debug('Role %s exists', role_name)
+ return None
+
+ LOG.debug('Role %s does not exist. '
+ 'Creating default role for Lifecycle', role_name)
+
+ # Get Region
+ region = get_region(self._session, parsed_globals)
+
+ if region is None:
+ raise ValueError('You must specify a region. '
+ 'You can also configure your region '
+ 'by running "aws configure".')
+
+ managed_policy_arn = get_policy_arn(
+ region,
+ LIFECYCLE_DEFAULT_MANAGED_POLICY_NAME
+ )
+
+ # Don't proceed if managed policy does not exist
+ if not self._iam_client.check_if_policy_exists(managed_policy_arn):
+ LOG.debug('Managed Policy %s does not exist.', managed_policy_arn)
+ return None
+
+ LOG.debug('Managed Policy %s exists.', managed_policy_arn)
+ # Create default role
+ create_role_response = \
+ self._iam_client.create_role_with_trust_policy(
+ role_name,
+ assume_role_policy
+ )
+ # Attach policy to role
+ self._iam_client.attach_policy_to_role(
+ managed_policy_arn,
+ role_name
+ )
+
+ # Construct result
+ get_policy_response = self._iam_client.get_policy(managed_policy_arn)
+ return _construct_result(create_role_response, get_policy_response)
diff -Nru awscli-1.11.13/awscli/customizations/dlm/dlm.py awscli-1.18.69/awscli/customizations/dlm/dlm.py
--- awscli-1.11.13/awscli/customizations/dlm/dlm.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/dlm/dlm.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,30 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+from awscli.customizations.dlm.createdefaultrole import CreateDefaultRole
+
+
+def dlm_initialize(cli):
+ """
+ The entry point for Lifecycle high level commands.
+ """
+ cli.register('building-command-table.dlm', register_commands)
+
+
+def register_commands(command_table, session, **kwargs):
+ """
+ Called when the Lifecycle command table is being built. Used to inject new
+ high level commands into the command list. These high level commands
+ must not collide with existing low-level API call names.
+ """
+ command_table['create-default-role'] = CreateDefaultRole(session)
diff -Nru awscli-1.11.13/awscli/customizations/dlm/iam.py awscli-1.18.69/awscli/customizations/dlm/iam.py
--- awscli-1.11.13/awscli/customizations/dlm/iam.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/dlm/iam.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,51 @@
+import json
+
+
+class IAM(object):
+
+ def __init__(self, iam_client):
+ self.iam_client = iam_client
+
+ def check_if_role_exists(self, role_name):
+ """Method to verify if a particular role exists"""
+ try:
+ self.iam_client.get_role(RoleName=role_name)
+ except self.iam_client.exceptions.NoSuchEntityException:
+ return False
+ return True
+
+ def check_if_policy_exists(self, policy_arn):
+ """Method to verify if a particular policy exists"""
+ try:
+ self.iam_client.get_policy(PolicyArn=policy_arn)
+ except self.iam_client.exceptions.NoSuchEntityException:
+ return False
+ return True
+
+ def attach_policy_to_role(self, policy_arn, role_name):
+ """Method to attach LifecyclePolicy to role specified by role_name"""
+ return self.iam_client.attach_role_policy(
+ PolicyArn=policy_arn,
+ RoleName=role_name
+ )
+
+ def create_role_with_trust_policy(self, role_name, assume_role_policy):
+ """Method to create role with a given role name
+ and assume_role_policy
+ """
+ return self.iam_client.create_role(
+ RoleName=role_name,
+ AssumeRolePolicyDocument=json.dumps(assume_role_policy))
+
+ def get_policy(self, arn):
+ """Method to get the Policy for a particular ARN
+ This is used to display the policy contents to the user
+ """
+ pol_det = self.iam_client.get_policy(PolicyArn=arn)
+ policy_version_details = self.iam_client.get_policy_version(
+ PolicyArn=arn,
+ VersionId=pol_det.get("Policy", {}).get("DefaultVersionId", "")
+ )
+ return policy_version_details\
+ .get("PolicyVersion", {})\
+ .get("Document", {})
diff -Nru awscli-1.11.13/awscli/customizations/dlm/__init__.py awscli-1.18.69/awscli/customizations/dlm/__init__.py
--- awscli-1.11.13/awscli/customizations/dlm/__init__.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/dlm/__init__.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
diff -Nru awscli-1.11.13/awscli/customizations/dynamodb.py awscli-1.18.69/awscli/customizations/dynamodb.py
--- awscli-1.11.13/awscli/customizations/dynamodb.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/dynamodb.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,53 @@
+# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import base64
+import binascii
+import logging
+
+from awscli.compat import six
+
+logger = logging.getLogger(__name__)
+
+
+def register_dynamodb_paginator_fix(event_emitter):
+ DynamoDBPaginatorFix(event_emitter).register_events()
+
+
+def parse_last_evaluated_key_binary(parsed, **kwargs):
+ # Because we disable parsing blobs into a binary type and leave them as
+ # a base64 string if a binary field is present in the continuation token
+ # as is the case with dynamodb the binary will be double encoded. This
+ # ensures that the continuation token is properly converted to binary to
+ # avoid double encoding the contination token.
+ last_evaluated_key = parsed.get('LastEvaluatedKey', None)
+ if last_evaluated_key is None:
+ return
+ for key, val in last_evaluated_key.items():
+ if 'B' in val:
+ val['B'] = base64.b64decode(val['B'])
+
+
+class DynamoDBPaginatorFix(object):
+ def __init__(self, event_emitter):
+ self._event_emitter = event_emitter
+
+ def register_events(self):
+ self._event_emitter.register(
+ 'calling-command.dynamodb.*', self._maybe_register_pagination_fix
+ )
+
+ def _maybe_register_pagination_fix(self, parsed_globals, **kwargs):
+ if parsed_globals.paginate:
+ self._event_emitter.register(
+ 'after-call.dynamodb.*', parse_last_evaluated_key_binary
+ )
diff -Nru awscli-1.11.13/awscli/customizations/ec2/bundleinstance.py awscli-1.18.69/awscli/customizations/ec2/bundleinstance.py
--- awscli-1.11.13/awscli/customizations/ec2/bundleinstance.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/ec2/bundleinstance.py 2020-05-28 19:25:48.000000000 +0000
@@ -98,8 +98,8 @@
logger.debug(parsed_args)
arg_dict = vars(parsed_args)
if arg_dict['storage']:
- for key in ('bucket', 'prefix', 'owner-akid',
- 'owner-sak', 'policy'):
+ for key in ('bucket', 'prefix', 'owner_akid',
+ 'owner_sak', 'policy'):
if arg_dict[key]:
msg = ('Mixing the --storage option '
'with the simple, scalar options is '
diff -Nru awscli-1.11.13/awscli/customizations/ec2/runinstances.py awscli-1.18.69/awscli/customizations/ec2/runinstances.py
--- awscli-1.11.13/awscli/customizations/ec2/runinstances.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/ec2/runinstances.py 2020-05-28 19:25:48.000000000 +0000
@@ -42,6 +42,7 @@
'[EC2-VPC] If specified a public IP address will be assigned '
'to the new instance in a VPC.')
+
def _add_params(argument_table, **kwargs):
arg = SecondaryPrivateIpAddressesArgument(
name='secondary-private-ip-addresses',
@@ -97,28 +98,32 @@
'AssociatePublicIpAddress'
]
if 'NetworkInterfaces' in params:
- ni = params['NetworkInterfaces']
- for network_interface_param in network_interface_params:
- if network_interface_param in ni[0]:
- if 'SubnetId' in params:
- ni[0]['SubnetId'] = params['SubnetId']
- del params['SubnetId']
- if 'SecurityGroupIds' in params:
- ni[0]['Groups'] = params['SecurityGroupIds']
- del params['SecurityGroupIds']
- if 'PrivateIpAddress' in params:
- ip_addr = {'PrivateIpAddress': params['PrivateIpAddress'],
- 'Primary': True}
- ni[0]['PrivateIpAddresses'] = [ip_addr]
- del params['PrivateIpAddress']
- return
+ interface = params['NetworkInterfaces'][0]
+ if any(param in interface for param in network_interface_params):
+ if 'SubnetId' in params:
+ interface['SubnetId'] = params['SubnetId']
+ del params['SubnetId']
+ if 'SecurityGroupIds' in params:
+ interface['Groups'] = params['SecurityGroupIds']
+ del params['SecurityGroupIds']
+ if 'PrivateIpAddress' in params:
+ ip_addr = {'PrivateIpAddress': params['PrivateIpAddress'],
+ 'Primary': True}
+ interface['PrivateIpAddresses'] = [ip_addr]
+ del params['PrivateIpAddress']
+ if 'Ipv6AddressCount' in params:
+ interface['Ipv6AddressCount'] = params['Ipv6AddressCount']
+ del params['Ipv6AddressCount']
+ if 'Ipv6Addresses' in params:
+ interface['Ipv6Addresses'] = params['Ipv6Addresses']
+ del params['Ipv6Addresses']
EVENTS = [
('building-argument-table.ec2.run-instances', _add_params),
('operation-args-parsed.ec2.run-instances', _check_args),
('before-parameter-build.ec2.RunInstances', _fix_args),
- ]
+]
def register_runinstances(event_handler):
@@ -147,11 +152,9 @@
def add_to_params(self, parameters, value):
if value:
- value = [{'PrivateIpAddress': v, 'Primary': False} for
- v in value]
- _build_network_interfaces(parameters,
- 'PrivateIpAddresses',
- value)
+ value = [{'PrivateIpAddress': v, 'Primary': False} for v in value]
+ _build_network_interfaces(
+ parameters, 'PrivateIpAddresses', value)
class SecondaryPrivateIpAddressCountArgument(CustomArgument):
@@ -162,24 +165,21 @@
def add_to_params(self, parameters, value):
if value:
- _build_network_interfaces(parameters,
- 'SecondaryPrivateIpAddressCount',
- value)
+ _build_network_interfaces(
+ parameters, 'SecondaryPrivateIpAddressCount', value)
class AssociatePublicIpAddressArgument(CustomArgument):
def add_to_params(self, parameters, value):
if value is True:
- _build_network_interfaces(parameters,
- 'AssociatePublicIpAddress',
- value)
+ _build_network_interfaces(
+ parameters, 'AssociatePublicIpAddress', value)
class NoAssociatePublicIpAddressArgument(CustomArgument):
def add_to_params(self, parameters, value):
if value is False:
- _build_network_interfaces(parameters,
- 'AssociatePublicIpAddress',
- value)
+ _build_network_interfaces(
+ parameters, 'AssociatePublicIpAddress', value)
diff -Nru awscli-1.11.13/awscli/customizations/ec2/secgroupsimplify.py awscli-1.18.69/awscli/customizations/ec2/secgroupsimplify.py
--- awscli-1.11.13/awscli/customizations/ec2/secgroupsimplify.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/ec2/secgroupsimplify.py 2020-05-28 19:25:48.000000000 +0000
@@ -94,10 +94,9 @@
('doc-description.ec2.revoke-security-group-ingress', _add_docs),
('doc-description.ec2.revoke-security-groupdoc-ingress', _add_docs),
]
-PROTOCOL_DOCS = ('
If this argument is provided without also providing the '
'port argument, then it will be applied to all '
'ports for the specified protocol.
')
@@ -110,8 +109,7 @@
' all ICMP types. A value of -1 just for type'
' indicates all ICMP codes for the specified ICMP type.')
CIDR_DOCS = '
The CIDR IP range.
'
-SOURCEGROUP_DOCS = ('
The name or ID of the source security group. '
- 'Cannot be used when specifying a CIDR IP address.')
+SOURCEGROUP_DOCS = ('
The name or ID of the source security group.
')
GROUPOWNER_DOCS = ('
The AWS account ID that owns the source security '
'group. Cannot be used when specifying a CIDR IP '
'address.
')
diff -Nru awscli-1.11.13/awscli/customizations/ecr.py awscli-1.18.69/awscli/customizations/ecr.py
--- awscli-1.11.13/awscli/customizations/ecr.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/ecr.py 2020-05-28 19:25:48.000000000 +0000
@@ -18,15 +18,16 @@
def register_ecr_commands(cli):
- cli.register('building-command-table.ecr', _inject_get_login)
+ cli.register('building-command-table.ecr', _inject_commands)
-def _inject_get_login(command_table, session, **kwargs):
+def _inject_commands(command_table, session, **kwargs):
command_table['get-login'] = ECRLogin(session)
+ command_table['get-login-password'] = ECRGetLoginPassword(session)
class ECRLogin(BasicCommand):
- """Log in with docker login"""
+ """Log in with 'docker login'"""
NAME = 'get-login'
DESCRIPTION = BasicCommand.FROM_FILE('ecr/get-login_description.rst')
@@ -38,7 +39,31 @@
'Amazon ECR registries that you want to log in to.',
'required': False,
'nargs': '+'
- }
+ },
+ {
+ 'name': 'include-email',
+ 'action': 'store_true',
+ 'group_name': 'include-email',
+ 'dest': 'include_email',
+ 'default': True,
+ 'required': False,
+ 'help_text': (
+ "Specify if the '-e' flag should be included in the "
+ "'docker login' command. The '-e' option has been deprecated "
+ "and is removed in Docker version 17.06 and later. You must "
+ "specify --no-include-email if you're using Docker version "
+ "17.06 or later. The default behavior is to include the "
+ "'-e' flag in the 'docker login' output."),
+ },
+ {
+ 'name': 'no-include-email',
+ 'help_text': 'Include email arg',
+ 'action': 'store_false',
+ 'default': True,
+ 'group_name': 'include-email',
+ 'dest': 'include_email',
+ 'required': False,
+ },
]
def _run_main(self, parsed_args, parsed_globals):
@@ -52,6 +77,31 @@
for auth in result['authorizationData']:
auth_token = b64decode(auth['authorizationToken']).decode()
username, password = auth_token.split(':')
- sys.stdout.write('docker login -u %s -p %s -e none %s\n'
- % (username, password, auth['proxyEndpoint']))
+ command = ['docker', 'login', '-u', username, '-p', password]
+ if parsed_args.include_email:
+ command.extend(['-e', 'none'])
+ command.append(auth['proxyEndpoint'])
+ sys.stdout.write(' '.join(command))
+ sys.stdout.write('\n')
+ return 0
+
+
+class ECRGetLoginPassword(BasicCommand):
+ """Get a password to be used with container clients such as Docker"""
+ NAME = 'get-login-password'
+
+ DESCRIPTION = BasicCommand.FROM_FILE(
+ 'ecr/get-login-password_description.rst')
+
+ def _run_main(self, parsed_args, parsed_globals):
+ ecr_client = create_client_from_parsed_globals(
+ self._session,
+ 'ecr',
+ parsed_globals)
+ result = ecr_client.get_authorization_token()
+ auth = result['authorizationData'][0]
+ auth_token = b64decode(auth['authorizationToken']).decode()
+ _, password = auth_token.split(':')
+ sys.stdout.write(password)
+ sys.stdout.write('\n')
return 0
diff -Nru awscli-1.11.13/awscli/customizations/ecs/deploy.py awscli-1.18.69/awscli/customizations/ecs/deploy.py
--- awscli-1.11.13/awscli/customizations/ecs/deploy.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/ecs/deploy.py 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,453 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import hashlib
+import json
+import os
+import sys
+
+from botocore import compat, config
+from botocore.exceptions import ClientError
+from awscli.compat import compat_open
+from awscli.customizations.ecs import exceptions, filehelpers
+from awscli.customizations.commands import BasicCommand
+
+TIMEOUT_BUFFER_MIN = 10
+DEFAULT_DELAY_SEC = 15
+MAX_WAIT_MIN = 360 # 6 hours
+
+
+class ECSDeploy(BasicCommand):
+ NAME = 'deploy'
+
+ DESCRIPTION = (
+ "Deploys a new task definition to the specified ECS service. "
+ "Only services that use CodeDeploy for deployments are supported. "
+ "This command will register a new task definition, update the "
+ "CodeDeploy appspec with the new task definition revision, create a "
+ "CodeDeploy deployment, and wait for the deployment to successfully "
+ "complete. This command will exit with a return code of 255 if the "
+ "deployment does not succeed within 30 minutes by default or "
+ "up to 10 minutes more than your deployment group's configured wait "
+ "time (max of 6 hours)."
+ )
+
+ ARG_TABLE = [
+ {
+ 'name': 'service',
+ 'help_text': ("The short name or full Amazon Resource Name "
+ "(ARN) of the service to update"),
+ 'required': True
+ },
+ {
+ 'name': 'task-definition',
+ 'help_text': ("The file path where your task definition file is "
+ "located. The format of the file must be the same "
+ "as the JSON output of: aws ecs "
+ "register-task-definition "
+ "--generate-cli-skeleton"),
+ 'required': True
+ },
+ {
+ 'name': 'codedeploy-appspec',
+ 'help_text': ("The file path where your AWS CodeDeploy appspec "
+ "file is located. The appspec file may be in JSON "
+ "or YAML format. The TaskDefinition "
+ "property will be updated within the appspec with "
+ "the newly registered task definition ARN, "
+ "overwriting any placeholder values in the file."),
+ 'required': True
+ },
+ {
+ 'name': 'cluster',
+ 'help_text': ("The short name or full Amazon Resource Name "
+ "(ARN) of the cluster that your service is "
+ "running within. If you do not specify a "
+ "cluster, the \"default\" cluster is assumed."),
+ 'required': False
+ },
+ {
+ 'name': 'codedeploy-application',
+ 'help_text': ("The name of the AWS CodeDeploy application "
+ "to use for the deployment. The specified "
+ "application must use the 'ECS' compute "
+ "platform. If you do not specify an "
+ "application, the application name "
+ "AppECS-[CLUSTER_NAME]-[SERVICE_NAME] "
+ "is assumed."),
+ 'required': False
+ },
+ {
+ 'name': 'codedeploy-deployment-group',
+ 'help_text': ("The name of the AWS CodeDeploy deployment "
+ "group to use for the deployment. The "
+ "specified deployment group must be associated "
+ "with the specified ECS service and cluster. "
+ "If you do not specify a deployment group, "
+ "the deployment group name "
+ "DgpECS-[CLUSTER_NAME]-[SERVICE_NAME] "
+ "is assumed."),
+ 'required': False
+ }
+ ]
+
+ MSG_TASK_DEF_REGISTERED = \
+ "Successfully registered new ECS task definition {arn}\n"
+
+ MSG_CREATED_DEPLOYMENT = "Successfully created deployment {id}\n"
+
+ MSG_SUCCESS = ("Successfully deployed {task_def} to "
+ "service '{service}'\n")
+
+ USER_AGENT_EXTRA = 'customization/ecs-deploy'
+
+ def _run_main(self, parsed_args, parsed_globals):
+
+ register_task_def_kwargs, appspec_obj = \
+ self._load_file_args(parsed_args.task_definition,
+ parsed_args.codedeploy_appspec)
+
+ ecs_client_wrapper = ECSClient(
+ self._session, parsed_args, parsed_globals, self.USER_AGENT_EXTRA)
+
+ self.resources = self._get_resource_names(
+ parsed_args, ecs_client_wrapper)
+
+ codedeploy_client = self._session.create_client(
+ 'codedeploy',
+ region_name=parsed_globals.region,
+ verify=parsed_globals.verify_ssl,
+ config=config.Config(user_agent_extra=self.USER_AGENT_EXTRA))
+
+ self._validate_code_deploy_resources(codedeploy_client)
+
+ self.wait_time = self._cd_validator.get_deployment_wait_time()
+
+ self.task_def_arn = self._register_task_def(
+ register_task_def_kwargs, ecs_client_wrapper)
+
+ self._create_and_wait_for_deployment(codedeploy_client, appspec_obj)
+
+ def _create_and_wait_for_deployment(self, client, appspec):
+ deployer = CodeDeployer(client, appspec)
+ deployer.update_task_def_arn(self.task_def_arn)
+ deployment_id = deployer.create_deployment(
+ self.resources['app_name'],
+ self.resources['deployment_group_name'])
+
+ sys.stdout.write(self.MSG_CREATED_DEPLOYMENT.format(
+ id=deployment_id))
+
+ deployer.wait_for_deploy_success(deployment_id, self.wait_time)
+ service_name = self.resources['service']
+
+ sys.stdout.write(
+ self.MSG_SUCCESS.format(
+ task_def=self.task_def_arn, service=service_name))
+ sys.stdout.flush()
+
+ def _get_file_contents(self, file_path):
+ full_path = os.path.expandvars(os.path.expanduser(file_path))
+ try:
+ with compat_open(full_path) as f:
+ return f.read()
+ except (OSError, IOError, UnicodeDecodeError) as e:
+ raise exceptions.FileLoadError(
+ file_path=file_path, error=e)
+
+ def _get_resource_names(self, args, ecs_client):
+ service_details = ecs_client.get_service_details()
+ service_name = service_details['service_name']
+ cluster_name = service_details['cluster_name']
+
+ application_name = filehelpers.get_app_name(
+ service_name, cluster_name, args.codedeploy_application)
+ deployment_group_name = filehelpers.get_deploy_group_name(
+ service_name, cluster_name, args.codedeploy_deployment_group)
+
+ return {
+ 'service': service_name,
+ 'service_arn': service_details['service_arn'],
+ 'cluster': cluster_name,
+ 'cluster_arn': service_details['cluster_arn'],
+ 'app_name': application_name,
+ 'deployment_group_name': deployment_group_name
+ }
+
+ def _load_file_args(self, task_def_arg, appspec_arg):
+ task_def_string = self._get_file_contents(task_def_arg)
+ register_task_def_kwargs = json.loads(task_def_string)
+
+ appspec_string = self._get_file_contents(appspec_arg)
+ appspec_obj = filehelpers.parse_appspec(appspec_string)
+
+ return register_task_def_kwargs, appspec_obj
+
+ def _register_task_def(self, task_def_kwargs, ecs_client):
+ response = ecs_client.register_task_definition(task_def_kwargs)
+
+ task_def_arn = response['taskDefinition']['taskDefinitionArn']
+
+ sys.stdout.write(self.MSG_TASK_DEF_REGISTERED.format(
+ arn=task_def_arn))
+ sys.stdout.flush()
+
+ return task_def_arn
+
+ def _validate_code_deploy_resources(self, client):
+ validator = CodeDeployValidator(client, self.resources)
+ validator.describe_cd_resources()
+ validator.validate_all()
+ self._cd_validator = validator
+
+
+class CodeDeployer():
+
+ MSG_WAITING = ("Waiting for {deployment_id} to succeed "
+ "(will wait up to {wait} minutes)...\n")
+
+ def __init__(self, cd_client, appspec_dict):
+ self._client = cd_client
+ self._appspec_dict = appspec_dict
+
+ def create_deployment(self, app_name, deploy_grp_name):
+ request_obj = self._get_create_deploy_request(
+ app_name, deploy_grp_name)
+
+ try:
+ response = self._client.create_deployment(**request_obj)
+ except ClientError as e:
+ raise exceptions.ServiceClientError(
+ action='create deployment', error=e)
+
+ return response['deploymentId']
+
+ def _get_appspec_hash(self):
+ appspec_str = json.dumps(self._appspec_dict)
+ appspec_encoded = compat.ensure_bytes(appspec_str)
+ return hashlib.sha256(appspec_encoded).hexdigest()
+
+ def _get_create_deploy_request(self, app_name, deploy_grp_name):
+ return {
+ "applicationName": app_name,
+ "deploymentGroupName": deploy_grp_name,
+ "revision": {
+ "revisionType": "AppSpecContent",
+ "appSpecContent": {
+ "content": json.dumps(self._appspec_dict),
+ "sha256": self._get_appspec_hash()
+ }
+ }
+ }
+
+ def update_task_def_arn(self, new_arn):
+ """
+ Inserts the ARN of the previously created ECS task definition
+ into the provided appspec.
+
+ Expected format of ECS appspec (YAML) is:
+ version: 0.0
+ resources:
+ - :
+ type: AWS::ECS::Service
+ properties:
+ taskDefinition: # replace this
+ loadBalancerInfo:
+ containerName:
+ containerPort:
+ """
+ appspec_obj = self._appspec_dict
+
+ resources_key = filehelpers.find_required_key(
+ 'codedeploy-appspec', appspec_obj, 'resources')
+ updated_resources = []
+
+ # 'resources' is a list of string:obj dictionaries
+ for resource in appspec_obj[resources_key]:
+ for name in resource:
+ # get content of resource
+ resource_content = resource[name]
+ # get resource properties
+ properties_key = filehelpers.find_required_key(
+ name, resource_content, 'properties')
+ properties_content = resource_content[properties_key]
+ # find task definition property
+ task_def_key = filehelpers.find_required_key(
+ properties_key, properties_content, 'taskDefinition')
+
+ # insert new task def ARN into resource
+ properties_content[task_def_key] = new_arn
+
+ updated_resources.append(resource)
+
+ appspec_obj[resources_key] = updated_resources
+ self._appspec_dict = appspec_obj
+
+ def wait_for_deploy_success(self, id, wait_min):
+ waiter = self._client.get_waiter("deployment_successful")
+
+ if wait_min is not None and wait_min > MAX_WAIT_MIN:
+ wait_min = MAX_WAIT_MIN
+
+ elif wait_min is None or wait_min < 30:
+ wait_min = 30
+
+ delay_sec = DEFAULT_DELAY_SEC
+ max_attempts = (wait_min * 60) / delay_sec
+ config = {
+ 'Delay': delay_sec,
+ 'MaxAttempts': max_attempts
+ }
+
+ self._show_deploy_wait_msg(id, wait_min)
+ waiter.wait(deploymentId=id, WaiterConfig=config)
+
+ def _show_deploy_wait_msg(self, id, wait_min):
+ sys.stdout.write(
+ self.MSG_WAITING.format(deployment_id=id,
+ wait=wait_min))
+ sys.stdout.flush()
+
+
+class CodeDeployValidator():
+ def __init__(self, cd_client, resources):
+ self._client = cd_client
+ self._resource_names = resources
+
+ def describe_cd_resources(self):
+ try:
+ self.app_details = self._client.get_application(
+ applicationName=self._resource_names['app_name'])
+ except ClientError as e:
+ raise exceptions.ServiceClientError(
+ action='describe Code Deploy application', error=e)
+
+ try:
+ dgp = self._resource_names['deployment_group_name']
+ app = self._resource_names['app_name']
+ self.deployment_group_details = self._client.get_deployment_group(
+ applicationName=app, deploymentGroupName=dgp)
+ except ClientError as e:
+ raise exceptions.ServiceClientError(
+ action='describe Code Deploy deployment group', error=e)
+
+ def get_deployment_wait_time(self):
+
+ if (not hasattr(self, 'deployment_group_details') or
+ self.deployment_group_details is None):
+ return None
+ else:
+ dgp_info = self.deployment_group_details['deploymentGroupInfo']
+ blue_green_info = dgp_info['blueGreenDeploymentConfiguration']
+
+ deploy_ready_wait_min = \
+ blue_green_info['deploymentReadyOption']['waitTimeInMinutes']
+
+ terminate_key = 'terminateBlueInstancesOnDeploymentSuccess'
+ termination_wait_min = \
+ blue_green_info[terminate_key]['terminationWaitTimeInMinutes']
+
+ configured_wait = deploy_ready_wait_min + termination_wait_min
+
+ return configured_wait + TIMEOUT_BUFFER_MIN
+
+ def validate_all(self):
+ self.validate_application()
+ self.validate_deployment_group()
+
+ def validate_application(self):
+ app_name = self._resource_names['app_name']
+ if self.app_details['application']['computePlatform'] != 'ECS':
+ raise exceptions.InvalidPlatformError(
+ resource='Application', name=app_name)
+
+ def validate_deployment_group(self):
+ dgp = self._resource_names['deployment_group_name']
+ service = self._resource_names['service']
+ service_arn = self._resource_names['service_arn']
+ cluster = self._resource_names['cluster']
+ cluster_arn = self._resource_names['cluster_arn']
+
+ grp_info = self.deployment_group_details['deploymentGroupInfo']
+ compute_platform = grp_info['computePlatform']
+
+ if compute_platform != 'ECS':
+ raise exceptions.InvalidPlatformError(
+ resource='Deployment Group', name=dgp)
+
+ target_services = \
+ self.deployment_group_details['deploymentGroupInfo']['ecsServices']
+
+ # either ECS resource names or ARNs can be stored, so check both
+ for target in target_services:
+ target_serv = target['serviceName']
+ if target_serv != service and target_serv != service_arn:
+ raise exceptions.InvalidProperyError(
+ dg_name=dgp, resource='service', resource_name=service)
+
+ target_cluster = target['clusterName']
+ if target_cluster != cluster and target_cluster != cluster_arn:
+ raise exceptions.InvalidProperyError(
+ dg_name=dgp, resource='cluster', resource_name=cluster)
+
+
+class ECSClient():
+
+ def __init__(self, session, parsed_args, parsed_globals, user_agent_extra):
+ self._args = parsed_args
+ self._custom_config = config.Config(user_agent_extra=user_agent_extra)
+ self._client = session.create_client(
+ 'ecs',
+ region_name=parsed_globals.region,
+ endpoint_url=parsed_globals.endpoint_url,
+ verify=parsed_globals.verify_ssl,
+ config=self._custom_config)
+
+ def get_service_details(self):
+ cluster = self._args.cluster
+
+ if cluster is None or '':
+ cluster = 'default'
+
+ try:
+ service_response = self._client.describe_services(
+ cluster=cluster, services=[self._args.service])
+ except ClientError as e:
+ raise exceptions.ServiceClientError(
+ action='describe ECS service', error=e)
+
+ if len(service_response['services']) == 0:
+ raise exceptions.InvalidServiceError(
+ service=self._args.service, cluster=cluster)
+
+ service_details = service_response['services'][0]
+ cluster_name = \
+ filehelpers.get_cluster_name_from_arn(
+ service_details['clusterArn'])
+
+ return {
+ 'service_arn': service_details['serviceArn'],
+ 'service_name': service_details['serviceName'],
+ 'cluster_arn': service_details['clusterArn'],
+ 'cluster_name': cluster_name
+ }
+
+ def register_task_definition(self, kwargs):
+ try:
+ response = \
+ self._client.register_task_definition(**kwargs)
+ except ClientError as e:
+ raise exceptions.ServiceClientError(
+ action='register ECS task definition', error=e)
+
+ return response
diff -Nru awscli-1.11.13/awscli/customizations/ecs/exceptions.py awscli-1.18.69/awscli/customizations/ecs/exceptions.py
--- awscli-1.11.13/awscli/customizations/ecs/exceptions.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/ecs/exceptions.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,48 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+
+class ECSError(Exception):
+ """ Base class for all ECSErrors."""
+ fmt = 'An unspecified error occurred'
+
+ def __init__(self, **kwargs):
+ msg = self.fmt.format(**kwargs)
+ super(ECSError, self).__init__(msg)
+ self.kwargs = kwargs
+
+
+class MissingPropertyError(ECSError):
+ fmt = \
+ "Error: Resource '{resource}' must include property '{prop_name}'"
+
+
+class FileLoadError(ECSError):
+ fmt = "Error: Unable to load file at {file_path}: {error}"
+
+
+class InvalidPlatformError(ECSError):
+ fmt = "Error: {resource} '{name}' must support 'ECS' compute platform"
+
+
+class InvalidProperyError(ECSError):
+ fmt = ("Error: deployment group '{dg_name}' does not target "
+ "ECS {resource} '{resource_name}'")
+
+
+class InvalidServiceError(ECSError):
+ fmt = "Error: Service '{service}' not found in cluster '{cluster}'"
+
+
+class ServiceClientError(ECSError):
+ fmt = "Failed to {action}:\n{error}"
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/customizations/ecs/filehelpers.py awscli-1.18.69/awscli/customizations/ecs/filehelpers.py
--- awscli-1.11.13/awscli/customizations/ecs/filehelpers.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/ecs/filehelpers.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,81 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import json
+import yaml
+
+from awscli.customizations.ecs import exceptions
+
+MAX_CHAR_LENGTH = 46
+APP_PREFIX = 'AppECS-'
+DGP_PREFIX = 'DgpECS-'
+
+
+def find_required_key(resource_name, obj, key):
+
+ if obj is None:
+ raise exceptions.MissingPropertyError(
+ resource=resource_name, prop_name=key)
+
+ result = _get_case_insensitive_key(obj, key)
+
+ if result is None:
+ raise exceptions.MissingPropertyError(
+ resource=resource_name, prop_name=key)
+ else:
+ return result
+
+
+def _get_case_insensitive_key(target_obj, target_key):
+ key_to_match = target_key.lower()
+ key_list = target_obj.keys()
+
+ for key in key_list:
+ if key.lower() == key_to_match:
+ return key
+
+
+def get_app_name(service, cluster, app_value):
+ if app_value is not None:
+ return app_value
+ else:
+ suffix = _get_ecs_suffix(service, cluster)
+ return APP_PREFIX + suffix
+
+
+def get_cluster_name_from_arn(arn):
+ return arn.split('/')[1]
+
+
+def get_deploy_group_name(service, cluster, dg_value):
+ if dg_value is not None:
+ return dg_value
+ else:
+ suffix = _get_ecs_suffix(service, cluster)
+ return DGP_PREFIX + suffix
+
+
+def _get_ecs_suffix(service, cluster):
+ if cluster is None:
+ cluster_name = 'default'
+ else:
+ cluster_name = cluster[:MAX_CHAR_LENGTH]
+
+ return cluster_name + '-' + service[:MAX_CHAR_LENGTH]
+
+
+def parse_appspec(appspec_str):
+ try:
+ return json.loads(appspec_str)
+ except ValueError:
+ return yaml.safe_load(appspec_str)
diff -Nru awscli-1.11.13/awscli/customizations/ecs/__init__.py awscli-1.18.69/awscli/customizations/ecs/__init__.py
--- awscli-1.11.13/awscli/customizations/ecs/__init__.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/ecs/__init__.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,27 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+from awscli.customizations.ecs.deploy import ECSDeploy
+
+def initialize(cli):
+ """
+ The entry point for ECS high level commands.
+ """
+ cli.register('building-command-table.ecs', inject_commands)
+
+def inject_commands(command_table, session, **kwargs):
+ """
+ Called when the ECS command table is being built. Used to inject new
+ high level commands into the command list.
+ """
+ command_table['deploy'] = ECSDeploy(session)
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/customizations/eks/exceptions.py awscli-1.18.69/awscli/customizations/eks/exceptions.py
--- awscli-1.11.13/awscli/customizations/eks/exceptions.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/eks/exceptions.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,20 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+
+class EKSError(Exception):
+ """ Base class for all EKSErrors."""
+
+
+class EKSClusterError(EKSError):
+ """ Raised when a cluster is not in the correct state."""
diff -Nru awscli-1.11.13/awscli/customizations/eks/get_token.py awscli-1.18.69/awscli/customizations/eks/get_token.py
--- awscli-1.11.13/awscli/customizations/eks/get_token.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/eks/get_token.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,151 @@
+# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import base64
+import botocore
+import json
+
+from datetime import datetime, timedelta
+from botocore.signers import RequestSigner
+from botocore.model import ServiceId
+
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.utils import uni_print
+
+AUTH_SERVICE = "sts"
+AUTH_COMMAND = "GetCallerIdentity"
+AUTH_API_VERSION = "2011-06-15"
+AUTH_SIGNING_VERSION = "v4"
+
+# Presigned url timeout in seconds
+URL_TIMEOUT = 60
+
+TOKEN_EXPIRATION_MINS = 14
+
+TOKEN_PREFIX = 'k8s-aws-v1.'
+
+CLUSTER_NAME_HEADER = 'x-k8s-aws-id'
+
+
+class GetTokenCommand(BasicCommand):
+ NAME = 'get-token'
+
+ DESCRIPTION = ("Get a token for authentication with an Amazon EKS cluster. "
+ "This can be used as an alternative to the "
+ "aws-iam-authenticator.")
+
+ ARG_TABLE = [
+ {
+ 'name': 'cluster-name',
+ 'help_text': ("Specify the name of the Amazon EKS cluster to create a token for."),
+ 'required': True
+ },
+ {
+ 'name': 'role-arn',
+ 'help_text': ("Assume this role for credentials when signing the token."),
+ 'required': False
+ }
+ ]
+
+ def get_expiration_time(self):
+ token_expiration = datetime.utcnow() + timedelta(minutes=TOKEN_EXPIRATION_MINS)
+ return token_expiration.strftime('%Y-%m-%dT%H:%M:%SZ')
+
+ def _run_main(self, parsed_args, parsed_globals):
+ client_factory = STSClientFactory(self._session)
+ sts_client = client_factory.get_sts_client(
+ region_name=parsed_globals.region,
+ role_arn=parsed_args.role_arn)
+ token = TokenGenerator(sts_client).get_token(parsed_args.cluster_name)
+
+ # By default STS signs the url for 15 minutes so we are creating a
+ # rfc3339 timestamp with expiration in 14 minutes as part of the token, which
+ # is used by some clients (client-go) who will refresh the token after 14 mins
+ token_expiration = self.get_expiration_time()
+
+ full_object = {
+ "kind": "ExecCredential",
+ "apiVersion": "client.authentication.k8s.io/v1alpha1",
+ "spec": {},
+ "status": {
+ "expirationTimestamp": token_expiration,
+ "token": token
+ }
+ }
+
+ uni_print(json.dumps(full_object))
+ uni_print('\n')
+ return 0
+
+
+class TokenGenerator(object):
+ def __init__(self, sts_client):
+ self._sts_client = sts_client
+
+ def get_token(self, cluster_name):
+ """ Generate a presigned url token to pass to kubectl. """
+ url = self._get_presigned_url(cluster_name)
+ token = TOKEN_PREFIX + base64.urlsafe_b64encode(
+ url.encode('utf-8')).decode('utf-8').rstrip('=')
+ return token
+
+ def _get_presigned_url(self, cluster_name):
+ return self._sts_client.generate_presigned_url(
+ 'get_caller_identity',
+ Params={'ClusterName': cluster_name},
+ ExpiresIn=URL_TIMEOUT,
+ HttpMethod='GET',
+ )
+
+
+class STSClientFactory(object):
+ def __init__(self, session):
+ self._session = session
+
+ def get_sts_client(self, region_name=None, role_arn=None):
+ client_kwargs = {
+ 'region_name': region_name
+ }
+ if role_arn is not None:
+ creds = self._get_role_credentials(region_name, role_arn)
+ client_kwargs['aws_access_key_id'] = creds['AccessKeyId']
+ client_kwargs['aws_secret_access_key'] = creds['SecretAccessKey']
+ client_kwargs['aws_session_token'] = creds['SessionToken']
+ sts = self._session.create_client('sts', **client_kwargs)
+ self._register_cluster_name_handlers(sts)
+ return sts
+
+ def _get_role_credentials(self, region_name, role_arn):
+ sts = self._session.create_client('sts', region_name)
+ return sts.assume_role(
+ RoleArn=role_arn,
+ RoleSessionName='EKSGetTokenAuth'
+ )['Credentials']
+
+ def _register_cluster_name_handlers(self, sts_client):
+ sts_client.meta.events.register(
+ 'provide-client-params.sts.GetCallerIdentity',
+ self._retrieve_cluster_name
+ )
+ sts_client.meta.events.register(
+ 'before-sign.sts.GetCallerIdentity',
+ self._inject_cluster_name_header
+ )
+
+ def _retrieve_cluster_name(self, params, context, **kwargs):
+ if 'ClusterName' in params:
+ context['eks_cluster'] = params.pop('ClusterName')
+
+ def _inject_cluster_name_header(self, request, **kwargs):
+ if 'eks_cluster' in request.context:
+ request.headers[
+ CLUSTER_NAME_HEADER] = request.context['eks_cluster']
diff -Nru awscli-1.11.13/awscli/customizations/eks/__init__.py awscli-1.18.69/awscli/customizations/eks/__init__.py
--- awscli-1.11.13/awscli/customizations/eks/__init__.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/eks/__init__.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,31 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+from awscli.customizations.eks.update_kubeconfig import UpdateKubeconfigCommand
+from awscli.customizations.eks.get_token import GetTokenCommand
+
+
+def initialize(cli):
+ """
+ The entry point for EKS high level commands.
+ """
+ cli.register('building-command-table.eks', inject_commands)
+
+
+def inject_commands(command_table, session, **kwargs):
+ """
+ Called when the EKS command table is being built.
+ Used to inject new high level commands into the command list.
+ """
+ command_table['update-kubeconfig'] = UpdateKubeconfigCommand(session)
+ command_table['get-token'] = GetTokenCommand(session)
diff -Nru awscli-1.11.13/awscli/customizations/eks/kubeconfig.py awscli-1.18.69/awscli/customizations/eks/kubeconfig.py
--- awscli-1.11.13/awscli/customizations/eks/kubeconfig.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/eks/kubeconfig.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,271 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import os
+import yaml
+import logging
+import errno
+from botocore.compat import OrderedDict
+
+from awscli.customizations.eks.exceptions import EKSError
+from awscli.customizations.eks.ordered_yaml import (ordered_yaml_load,
+ ordered_yaml_dump)
+
+
+class KubeconfigError(EKSError):
+ """ Base class for all kubeconfig errors."""
+
+
+class KubeconfigCorruptedError(KubeconfigError):
+ """ Raised when a kubeconfig cannot be parsed."""
+
+
+class KubeconfigInaccessableError(KubeconfigError):
+ """ Raised when a kubeconfig cannot be opened for read/writing."""
+
+
+def _get_new_kubeconfig_content():
+ return OrderedDict([
+ ("apiVersion", "v1"),
+ ("clusters", []),
+ ("contexts", []),
+ ("current-context", ""),
+ ("kind", "Config"),
+ ("preferences", OrderedDict()),
+ ("users", [])
+ ])
+
+
+class Kubeconfig(object):
+ def __init__(self, path, content=None):
+ self.path = path
+ if content is None:
+ content = _get_new_kubeconfig_content()
+ self.content = content
+
+ def dump_content(self):
+ """ Return the stored content in yaml format. """
+ return ordered_yaml_dump(self.content)
+
+ def has_cluster(self, name):
+ """
+ Return true if this kubeconfig contains an entry
+ For the passed cluster name.
+ """
+ if 'clusters' not in self.content:
+ return False
+ return name in [cluster['name']
+ for cluster in self.content['clusters']]
+
+
+class KubeconfigValidator(object):
+ def __init__(self):
+ # Validation_content is an empty Kubeconfig
+ # It is used as a way to know what types different entries should be
+ self._validation_content = Kubeconfig(None, None).content
+
+ def validate_config(self, config):
+ """
+ Raises KubeconfigCorruptedError if the passed content is invalid
+
+ :param config: The config to validate
+ :type config: Kubeconfig
+ """
+ if not isinstance(config, Kubeconfig):
+ raise KubeconfigCorruptedError("Internal error: "
+ "Not a Kubeconfig object.")
+ self._validate_config_types(config)
+ self._validate_list_entry_types(config)
+
+ def _validate_config_types(self, config):
+ """
+ Raises KubeconfigCorruptedError if any of the entries in config
+ are the wrong type
+
+ :param config: The config to validate
+ :type config: Kubeconfig
+ """
+ if not isinstance(config.content, dict):
+ raise KubeconfigCorruptedError("Content not a dictionary.")
+ for key, value in self._validation_content.items():
+ if (key in config.content and
+ config.content[key] is not None and
+ not isinstance(config.content[key], type(value))):
+ raise KubeconfigCorruptedError(
+ "{0} is wrong type:{1} "
+ "(Should be {2})".format(
+ key,
+ type(config.content[key]),
+ type(value)
+ )
+ )
+
+ def _validate_list_entry_types(self, config):
+ """
+ Raises KubeconfigCorruptedError if any lists in config contain objects
+ which are not dictionaries
+
+ :param config: The config to validate
+ :type config: Kubeconfig
+ """
+ for key, value in self._validation_content.items():
+ if (key in config.content and
+ type(config.content[key]) == list):
+ for element in config.content[key]:
+ if not isinstance(element, OrderedDict):
+ raise KubeconfigCorruptedError(
+ "Entry in {0} not a dictionary.".format(key))
+
+
+class KubeconfigLoader(object):
+ def __init__(self, validator=None):
+ if validator is None:
+ validator = KubeconfigValidator()
+ self._validator = validator
+
+ def load_kubeconfig(self, path):
+ """
+ Loads the kubeconfig found at the given path.
+ If no file is found at the given path,
+ Generate a new kubeconfig to write back.
+ If the kubeconfig is valid, loads the content from it.
+ If the kubeconfig is invalid, throw the relevant exception.
+
+ :param path: The path to load a kubeconfig from
+ :type path: string
+
+ :raises KubeconfigInaccessableError: if the kubeconfig can't be opened
+ :raises KubeconfigCorruptedError: if the kubeconfig is invalid
+
+ :return: The loaded kubeconfig
+ :rtype: Kubeconfig
+ """
+ try:
+ with open(path, "r") as stream:
+ loaded_content = ordered_yaml_load(stream)
+ except IOError as e:
+ if e.errno == errno.ENOENT:
+ loaded_content = None
+ else:
+ raise KubeconfigInaccessableError(
+ "Can't open kubeconfig for reading: {0}".format(e))
+ except yaml.YAMLError as e:
+ raise KubeconfigCorruptedError(
+ "YamlError while loading kubeconfig: {0}".format(e))
+
+ loaded_config = Kubeconfig(path, loaded_content)
+ self._validator.validate_config(loaded_config)
+
+ return loaded_config
+
+
+class KubeconfigWriter(object):
+ def write_kubeconfig(self, config):
+ """
+ Write config to disk.
+ OK if the file doesn't exist.
+
+ :param config: The kubeconfig to write
+ :type config: Kubeconfig
+
+ :raises KubeconfigInaccessableError: if the kubeconfig
+ can't be opened for writing
+ """
+ directory = os.path.dirname(config.path)
+
+ try:
+ os.makedirs(directory)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise KubeconfigInaccessableError(
+ "Can't create directory for writing: {0}".format(e))
+ try:
+ with open(config.path, "w+") as stream:
+ ordered_yaml_dump(config.content, stream)
+ except IOError as e:
+ raise KubeconfigInaccessableError(
+ "Can't open kubeconfig for writing: {0}".format(e))
+
+
+class KubeconfigAppender(object):
+ def insert_entry(self, config, key, entry):
+ """
+ Insert entry into the array at content[key]
+ Overwrite an existing entry if they share the same name
+
+ :param config: The kubeconfig to insert an entry into
+ :type config: Kubeconfig
+ """
+ if key not in config.content:
+ config.content[key] = []
+ array = config.content[key]
+ if not isinstance(array, list):
+ raise KubeconfigError("Tried to insert into {0},"
+ "which is a {1} "
+ "not a {2}".format(key,
+ type(array),
+ list))
+ found = False
+ for counter, existing_entry in enumerate(array):
+ if "name" in existing_entry and\
+ "name" in entry and\
+ existing_entry["name"] == entry["name"]:
+ array[counter] = entry
+ found = True
+
+ if not found:
+ array.append(entry)
+
+ config.content[key] = array
+ return config
+
+ def _make_context(self, cluster, user, alias=None):
+ """ Generate a context to associate cluster and user with a given alias."""
+ return OrderedDict([
+ ("context", OrderedDict([
+ ("cluster", cluster["name"]),
+ ("user", user["name"])
+ ])),
+ ("name", alias or user["name"])
+ ])
+
+ def insert_cluster_user_pair(self, config, cluster, user, alias=None):
+ """
+ Insert the passed cluster entry and user entry,
+ then make a context to associate them
+ and set current-context to be the new context.
+ Returns the new context
+
+ :param config: the Kubeconfig to insert the pair into
+ :type config: Kubeconfig
+
+ :param cluster: the cluster entry
+ :type cluster: OrderedDict
+
+ :param user: the user entry
+ :type user: OrderedDict
+
+ :param alias: the alias for the context; defaults top user entry name
+ :type context: str
+
+ :return: The generated context
+ :rtype: OrderedDict
+ """
+ context = self._make_context(cluster, user, alias=alias)
+ self.insert_entry(config, "clusters", cluster)
+ self.insert_entry(config, "users", user)
+ self.insert_entry(config, "contexts", context)
+
+ config.content["current-context"] = context["name"]
+
+ return context
diff -Nru awscli-1.11.13/awscli/customizations/eks/ordered_yaml.py awscli-1.18.69/awscli/customizations/eks/ordered_yaml.py
--- awscli-1.11.13/awscli/customizations/eks/ordered_yaml.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/eks/ordered_yaml.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,62 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import yaml
+from botocore.compat import OrderedDict
+
+
+class SafeOrderedLoader(yaml.SafeLoader):
+ """ Safely load a yaml file into an OrderedDict."""
+
+
+class SafeOrderedDumper(yaml.SafeDumper):
+ """ Safely dump an OrderedDict as yaml."""
+
+
+def _ordered_constructor(loader, node):
+ loader.flatten_mapping(node)
+ return OrderedDict(loader.construct_pairs(node))
+
+
+SafeOrderedLoader.add_constructor(
+ yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
+ _ordered_constructor)
+
+
+def _ordered_representer(dumper, data):
+ return dumper.represent_mapping(
+ yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
+ data.items())
+
+
+SafeOrderedDumper.add_representer(OrderedDict, _ordered_representer)
+
+
+def ordered_yaml_load(stream):
+ """ Load an OrderedDict object from a yaml stream."""
+ return yaml.load(stream, SafeOrderedLoader)
+
+
+def ordered_yaml_dump(to_dump, stream=None):
+ """
+ Dump an OrderedDict object to yaml.
+
+ :param to_dump: The OrderedDict to dump
+ :type to_dump: OrderedDict
+
+ :param stream: The file to dump to
+ If not given or if None, only return the value
+ :type stream: file
+ """
+ return yaml.dump(to_dump, stream,
+ SafeOrderedDumper, default_flow_style=False)
diff -Nru awscli-1.11.13/awscli/customizations/eks/update_kubeconfig.py awscli-1.18.69/awscli/customizations/eks/update_kubeconfig.py
--- awscli-1.11.13/awscli/customizations/eks/update_kubeconfig.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/eks/update_kubeconfig.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,324 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import os
+import logging
+
+from botocore.compat import OrderedDict
+
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.utils import uni_print
+from awscli.customizations.eks.exceptions import EKSClusterError
+from awscli.customizations.eks.kubeconfig import (Kubeconfig,
+ KubeconfigError,
+ KubeconfigLoader,
+ KubeconfigWriter,
+ KubeconfigValidator,
+ KubeconfigAppender)
+from awscli.customizations.eks.ordered_yaml import ordered_yaml_dump
+
+LOG = logging.getLogger(__name__)
+
+DEFAULT_PATH = os.path.expanduser("~/.kube/config")
+
+# Use the endpoint for kubernetes 1.10
+# To get the most recent endpoint we will need to
+# Do a check on the cluster's version number
+API_VERSION = "client.authentication.k8s.io/v1alpha1"
+
+class UpdateKubeconfigCommand(BasicCommand):
+ NAME = 'update-kubeconfig'
+
+ DESCRIPTION = BasicCommand.FROM_FILE(
+ 'eks',
+ 'update-kubeconfig',
+ '_description.rst'
+ )
+
+ ARG_TABLE = [
+ {
+ 'name': 'name',
+ 'help_text': ("The name of the cluster for which "
+ "to create a kubeconfig entry. "
+ "This cluster must exist in your account and in the "
+ "specified or configured default Region "
+ "for your AWS CLI installation."),
+ 'required': True
+ },
+ {
+ 'name': 'kubeconfig',
+ 'help_text': ("Optionally specify a kubeconfig file to append "
+ "with your configuration. "
+ "By default, the configuration is written to the "
+ "first file path in the KUBECONFIG "
+ "environment variable (if it is set) "
+ "or the default kubeconfig path (.kube/config) "
+ "in your home directory."),
+ 'required': False
+ },
+ {
+ 'name': 'role-arn',
+ 'help_text': ("To assume a role for cluster authentication, "
+ "specify an IAM role ARN with this option. "
+ "For example, if you created a cluster "
+ "while assuming an IAM role, "
+ "then you must also assume that role to "
+ "connect to the cluster the first time."),
+ 'required': False
+ },
+ {
+ 'name': 'dry-run',
+ 'action': 'store_true',
+ 'default': False,
+ 'help_text': ("Print the merged kubeconfig to stdout instead of "
+ "writing it to the specified file."),
+ 'required': False
+ },
+ {
+ 'name': 'verbose',
+ 'action': 'store_true',
+ 'default': False,
+ 'help_text': ("Print more detailed output "
+ "when writing to the kubeconfig file, "
+ "including the appended entries.")
+ },
+ {
+ 'name': 'alias',
+ 'help_text': ("Alias for the cluster context name. "
+ "Defaults to match cluster ARN."),
+ 'required': False
+ }
+ ]
+
+ def _display_entries(self, entries):
+ """
+ Display entries in yaml format
+
+ :param entries: a list of OrderedDicts to be printed
+ :type entries: list
+ """
+ uni_print("Entries:\n\n")
+ for entry in entries:
+ uni_print(ordered_yaml_dump(entry))
+ uni_print("\n")
+
+ def _run_main(self, parsed_args, parsed_globals):
+ client = EKSClient(self._session,
+ parsed_args.name,
+ parsed_args.role_arn,
+ parsed_globals)
+ new_cluster_dict = client.get_cluster_entry()
+ new_user_dict = client.get_user_entry()
+
+ config_selector = KubeconfigSelector(
+ os.environ.get("KUBECONFIG", ""),
+ parsed_args.kubeconfig
+ )
+ config = config_selector.choose_kubeconfig(
+ new_cluster_dict["name"]
+ )
+ updating_existing = config.has_cluster(new_cluster_dict["name"])
+ appender = KubeconfigAppender()
+ new_context_dict = appender.insert_cluster_user_pair(config,
+ new_cluster_dict,
+ new_user_dict,
+ parsed_args.alias)
+
+ if parsed_args.dry_run:
+ uni_print(config.dump_content())
+ else:
+ writer = KubeconfigWriter()
+ writer.write_kubeconfig(config)
+
+ if updating_existing:
+ uni_print("Updated context {0} in {1}\n".format(
+ new_context_dict["name"], config.path
+ ))
+ else:
+ uni_print("Added new context {0} to {1}\n".format(
+ new_context_dict["name"], config.path
+ ))
+
+ if parsed_args.verbose:
+ self._display_entries([
+ new_context_dict,
+ new_user_dict,
+ new_cluster_dict
+ ])
+
+
+
+class KubeconfigSelector(object):
+
+ def __init__(self, env_variable, path_in, validator=None,
+ loader=None):
+ """
+ Parse KUBECONFIG into a list of absolute paths.
+ Also replace the empty list with DEFAULT_PATH
+
+ :param env_variable: KUBECONFIG as a long string
+ :type env_variable: string
+
+ :param path_in: The path passed in through the CLI
+ :type path_in: string or None
+ """
+ if validator is None:
+ validator = KubeconfigValidator()
+ self._validator = validator
+
+ if loader is None:
+ loader = KubeconfigLoader(validator)
+ self._loader = loader
+
+ if path_in is not None:
+ # Override environment variable
+ self._paths = [self._expand_path(path_in)]
+ else:
+ # Get the list of paths from the environment variable
+ if env_variable == "":
+ env_variable = DEFAULT_PATH
+ self._paths = [self._expand_path(element)
+ for element in env_variable.split(os.pathsep)
+ if len(element.strip()) > 0]
+ if len(self._paths) == 0:
+ self._paths = [DEFAULT_PATH]
+
+ def choose_kubeconfig(self, cluster_name):
+ """
+ Choose which kubeconfig file to read from.
+ If name is already an entry in one of the $KUBECONFIG files,
+ choose that one.
+ Otherwise choose the first file.
+
+ :param cluster_name: The name of the cluster which is going to be added
+ :type cluster_name: String
+
+ :return: a chosen Kubeconfig based on above rules
+ :rtype: Kubeconfig
+ """
+ # Search for an existing entry to update
+ for candidate_path in self._paths:
+ try:
+ loaded_config = self._loader.load_kubeconfig(candidate_path)
+
+ if loaded_config.has_cluster(cluster_name):
+ LOG.debug("Found entry to update at {0}".format(
+ candidate_path
+ ))
+ return loaded_config
+ except KubeconfigError as e:
+ LOG.warning("Passing {0}:{1}".format(candidate_path, e))
+
+ # No entry was found, use the first file in KUBECONFIG
+ #
+ # Note: This could raise KubeconfigErrors if paths[0] is corrupted
+ return self._loader.load_kubeconfig(self._paths[0])
+
+ def _expand_path(self, path):
+ """ A helper to expand a path to a full absolute path. """
+ return os.path.abspath(os.path.expanduser(path))
+
+
+class EKSClient(object):
+ def __init__(self, session, cluster_name, role_arn, parsed_globals=None):
+ self._session = session
+ self._cluster_name = cluster_name
+ self._role_arn = role_arn
+ self._cluster_description = None
+ self._globals = parsed_globals
+
+ def _get_cluster_description(self):
+ """
+ Use an eks describe-cluster call to get the cluster description
+ Cache the response in self._cluster_description.
+ describe-cluster will only be called once.
+ """
+ if self._cluster_description is None:
+ if self._globals is None:
+ client = self._session.create_client("eks")
+ else:
+ client = self._session.create_client(
+ "eks",
+ region_name=self._globals.region,
+ endpoint_url=self._globals.endpoint_url,
+ verify=self._globals.verify_ssl
+ )
+ full_description = client.describe_cluster(name=self._cluster_name)
+ self._cluster_description = full_description["cluster"]
+
+ if "status" not in self._cluster_description:
+ raise EKSClusterError("Cluster not found")
+ if self._cluster_description["status"] != "ACTIVE":
+ raise EKSClusterError("Cluster status not active")
+
+ return self._cluster_description
+
+ def get_cluster_entry(self):
+ """
+ Return a cluster entry generated using
+ the previously obtained description.
+ """
+
+ cert_data = self._get_cluster_description().get("certificateAuthority",
+ {"data": ""})["data"]
+ endpoint = self._get_cluster_description().get("endpoint")
+ arn = self._get_cluster_description().get("arn")
+
+ return OrderedDict([
+ ("cluster", OrderedDict([
+ ("certificate-authority-data", cert_data),
+ ("server", endpoint)
+ ])),
+ ("name", arn)
+ ])
+
+ def get_user_entry(self):
+ """
+ Return a user entry generated using
+ the previously obtained description.
+ """
+
+ region = self._get_cluster_description().get("arn").split(":")[3]
+
+ generated_user = OrderedDict([
+ ("name", self._get_cluster_description().get("arn", "")),
+ ("user", OrderedDict([
+ ("exec", OrderedDict([
+ ("apiVersion", API_VERSION),
+ ("args",
+ [
+ "--region",
+ region,
+ "eks",
+ "get-token",
+ "--cluster-name",
+ self._cluster_name,
+ ]),
+ ("command", "aws")
+ ]))
+ ]))
+ ])
+
+ if self._role_arn is not None:
+ generated_user["user"]["exec"]["args"].extend([
+ "--role",
+ self._role_arn
+ ])
+
+ if self._session.profile:
+ generated_user["user"]["exec"]["env"] = [OrderedDict([
+ ("name", "AWS_PROFILE"),
+ ("value", self._session.profile)
+ ])]
+
+ return generated_user
diff -Nru awscli-1.11.13/awscli/customizations/emr/addinstancegroups.py awscli-1.18.69/awscli/customizations/emr/addinstancegroups.py
--- awscli-1.11.13/awscli/customizations/emr/addinstancegroups.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/addinstancegroups.py 2020-05-28 19:25:48.000000000 +0000
@@ -51,13 +51,16 @@
def _construct_result(self, add_instance_groups_result):
jobFlowId = None
instanceGroupIds = None
+ clusterArn = None
if add_instance_groups_result is not None:
jobFlowId = add_instance_groups_result.get('JobFlowId')
instanceGroupIds = add_instance_groups_result.get(
'InstanceGroupIds')
+ clusterArn = add_instance_groups_result.get('ClusterArn')
if jobFlowId is not None and instanceGroupIds is not None:
return {'ClusterId': jobFlowId,
- 'InstanceGroupIds': instanceGroupIds}
+ 'InstanceGroupIds': instanceGroupIds,
+ 'ClusterArn': clusterArn}
else:
return {}
diff -Nru awscli-1.11.13/awscli/customizations/emr/argumentschema.py awscli-1.18.69/awscli/customizations/emr/argumentschema.py
--- awscli-1.11.13/awscli/customizations/emr/argumentschema.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/argumentschema.py 2020-05-28 19:26:18.000000000 +0000
@@ -14,6 +14,48 @@
from awscli.customizations.emr import helptext
from awscli.customizations.emr.createdefaultroles import EC2_ROLE_NAME
+CONFIGURATIONS_PROPERTIES_SCHEMA = {
+ "type": "map",
+ "key": {
+ "type": "string",
+ "description": "Configuration key"
+ },
+ "value": {
+ "type": "string",
+ "description": "Configuration value"
+ },
+ "description": "Application configuration properties"
+}
+
+CONFIGURATIONS_CLASSIFICATION_SCHEMA = {
+ "type": "string",
+ "description": "Application configuration classification name",
+}
+
+INNER_CONFIGURATIONS_SCHEMA = {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "Classification": CONFIGURATIONS_CLASSIFICATION_SCHEMA,
+ "Properties": CONFIGURATIONS_PROPERTIES_SCHEMA
+ }
+ },
+ "description": "Instance group application configurations."
+}
+
+OUTER_CONFIGURATIONS_SCHEMA = {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "Classification": CONFIGURATIONS_CLASSIFICATION_SCHEMA,
+ "Properties": CONFIGURATIONS_PROPERTIES_SCHEMA,
+ "Configurations": INNER_CONFIGURATIONS_SCHEMA
+ }
+ },
+ "description": "Instance group application configurations."
+}
INSTANCE_GROUPS_SCHEMA = {
"type": "array",
@@ -93,11 +135,283 @@
}
}
}
- }
+ },
+ "AutoScalingPolicy": {
+ "type": "object",
+ "description": "Auto Scaling policy that will be associated with the instance group.",
+ "properties": {
+ "Constraints": {
+ "type": "object",
+ "description": "The Constraints that will be associated to an Auto Scaling policy.",
+ "properties": {
+ "MinCapacity": {
+ "type": "integer",
+ "description": "The minimum value for the instances to scale in"
+ " to in response to scaling activities."
+ },
+ "MaxCapacity": {
+ "type": "integer",
+ "description": "The maximum value for the instances to scale out to in response"
+ " to scaling activities"
+ }
+ }
+ },
+ "Rules": {
+ "type": "array",
+ "description": "The Rules associated to an Auto Scaling policy.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "Name": {
+ "type": "string",
+ "description": "Name of the Auto Scaling rule."
+ },
+ "Description": {
+ "type": "string",
+ "description": "Description of the Auto Scaling rule."
+ },
+ "Action": {
+ "type": "object",
+ "description": "The Action associated to an Auto Scaling rule.",
+ "properties": {
+ "Market": { # Required for Instance Fleets
+ "type": "string",
+ "description": "Market type of the Amazon EC2 instances used to create a "
+ "cluster node by Auto Scaling action.",
+ "enum": ["ON_DEMAND", "SPOT"]
+ },
+ "SimpleScalingPolicyConfiguration": {
+ "type": "object",
+ "description": "The Simple scaling configuration that will be associated"
+ "to Auto Scaling action.",
+ "properties": {
+ "AdjustmentType": {
+ "type": "string",
+ "description": "Specifies how the ScalingAdjustment parameter is "
+ "interpreted.",
+ "enum": ["CHANGE_IN_CAPACITY", "PERCENT_CHANGE_IN_CAPACITY",
+ "EXACT_CAPACITY"]
+ },
+ "ScalingAdjustment": {
+ "type": "integer",
+ "description": "The amount by which to scale, based on the "
+ "specified adjustment type."
+ },
+ "CoolDown": {
+ "type": "integer",
+ "description": "The amount of time, in seconds, after a scaling "
+ "activity completes and before the next scaling "
+ "activity can start."
+ }
+ }
+ }
+ }
+ },
+ "Trigger": {
+ "type": "object",
+ "description": "The Trigger associated to an Auto Scaling rule.",
+ "properties": {
+ "CloudWatchAlarmDefinition": {
+ "type": "object",
+ "description": "The Alarm to be registered with CloudWatch, to trigger"
+ " scaling activities.",
+ "properties": {
+ "ComparisonOperator": {
+ "type": "string",
+ "description": "The arithmetic operation to use when comparing the"
+ " specified Statistic and Threshold."
+ },
+ "EvaluationPeriods": {
+ "type": "integer",
+ "description": "The number of periods over which data is compared"
+ " to the specified threshold."
+ },
+ "MetricName": {
+ "type": "string",
+ "description": "The name for the alarm's associated metric."
+ },
+ "Namespace": {
+ "type": "string",
+ "description": "The namespace for the alarm's associated metric."
+ },
+ "Period": {
+ "type": "integer",
+ "description": "The period in seconds over which the specified "
+ "statistic is applied."
+ },
+ "Statistic": {
+ "type": "string",
+ "description": "The statistic to apply to the alarm's associated "
+ "metric."
+ },
+ "Threshold": {
+ "type": "double",
+ "description": "The value against which the specified statistic is "
+ "compared."
+ },
+ "Unit": {
+ "type": "string",
+ "description": "The statistic's unit of measure."
+ },
+ "Dimensions": {
+ "type": "array",
+ "description": "The dimensions for the alarm's associated metric.",
+ "items": {
+ "type": "object",
+ "properties": {
+ "Key": {
+ "type": "string",
+ "description": "Dimension Key."
+ },
+ "Value": {
+ "type": "string",
+ "description": "Dimension Value."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "Configurations": OUTER_CONFIGURATIONS_SCHEMA
}
}
}
+INSTANCE_FLEETS_SCHEMA = {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "Name": {
+ "type": "string",
+ "description": "Friendly name given to the instance fleet."
+ },
+ "InstanceFleetType": {
+ "type": "string",
+ "description": "The type of the instance fleet in the cluster.",
+ "enum": ["MASTER", "CORE", "TASK"],
+ "required": True
+ },
+ "TargetOnDemandCapacity": {
+ "type": "integer",
+ "description": "Target on-demand capacity for the instance fleet."
+ },
+ "TargetSpotCapacity": {
+ "type": "integer",
+ "description": "Target spot capacity for the instance fleet."
+ },
+ "InstanceTypeConfigs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "InstanceType": {
+ "type": "string",
+ "description": "The Amazon EC2 instance type for the instance fleet.",
+ "required": True
+ },
+ "WeightedCapacity": {
+ "type": "integer",
+ "description": "The weight assigned to an instance type, which will impact the overall fulfillment of the capacity."
+ },
+ "BidPrice": {
+ "type": "string",
+ "description": "Bid price for each Amazon EC2 instance in the "
+ "instance fleet when launching nodes as Spot Instances, "
+ "expressed in USD."
+ },
+ "BidPriceAsPercentageOfOnDemandPrice": {
+ "type": "double",
+ "description": "Bid price as percentage of on-demand price."
+ },
+ "EbsConfiguration": {
+ "type": "object",
+ "description": "EBS configuration that is associated with the instance group.",
+ "properties": {
+ "EbsOptimized": {
+ "type": "boolean",
+ "description": "Boolean flag used to tag EBS-optimized instances.",
+ },
+ "EbsBlockDeviceConfigs": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "VolumeSpecification" : {
+ "type": "object",
+ "description": "The EBS volume specification that is created "
+ "and attached to each instance in the instance group.",
+ "properties": {
+ "VolumeType": {
+ "type": "string",
+ "description": "The EBS volume type that is attached to all "
+ "the instances in the instance group. Valid types are: "
+ "gp2, io1, and standard.",
+ "required": True
+ },
+ "SizeInGB": {
+ "type": "integer",
+ "description": "The EBS volume size, in GB, that is attached "
+ "to all the instances in the instance group.",
+ "required": True
+ },
+ "Iops": {
+ "type": "integer",
+ "description": "The IOPS of the EBS volume that is attached to "
+ "all the instances in the instance group.",
+ }
+ }
+ },
+ "VolumesPerInstance": {
+ "type": "integer",
+ "description": "The number of EBS volumes that will be created and "
+ "attached to each instance in the instance group.",
+ }
+ }
+ }
+ }
+ }
+ },
+ "Configurations": OUTER_CONFIGURATIONS_SCHEMA
+ }
+ }
+ },
+ "LaunchSpecifications": {
+ "type": "object",
+ "properties" : {
+ "SpotSpecification": {
+ "type": "object",
+ "properties": {
+ "TimeoutDurationMinutes": {
+ "type": "integer",
+ "description": "The time, in minutes, after which the action specified in TimeoutAction field will be performed if requested resources are unavailable."
+ },
+ "TimeoutAction": {
+ "type": "string",
+ "description": "The action that is performed after TimeoutDurationMinutes.",
+ "enum": [
+ "TERMINATE_CLUSTER",
+ "SWITCH_TO_ONDEMAND"
+ ]
+ },
+ "BlockDurationMinutes": {
+ "type": "integer",
+ "description": "Block duration in minutes."
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
EC2_ATTRIBUTES_SCHEMA = {
"type": "object",
@@ -118,10 +432,25 @@
"the cluster is launched in the normal Amazon Web Services "
"cloud, outside of an Amazon VPC. "
},
+ "SubnetIds": {
+ "type": "array",
+ "description":
+ "List of SubnetIds.",
+ "items": {
+ "type": "string"
+ }
+ },
"AvailabilityZone": {
"type": "string",
"description": "The Availability Zone the cluster will run in."
},
+ "AvailabilityZones": {
+ "type": "array",
+ "description": "List of AvailabilityZones.",
+ "items": {
+ "type": "string"
+ }
+ },
"InstanceProfile": {
"type": "string",
"description":
@@ -344,3 +673,78 @@
"type": "string"
}
}
+
+KERBEROS_ATTRIBUTES_SCHEMA = {
+ "type": "object",
+ "properties": {
+ "Realm": {
+ "type": "string",
+ "description": "The name of Kerberos realm."
+ },
+ "KdcAdminPassword": {
+ "type": "string",
+ "description": "The password of Kerberos administrator."
+ },
+ "CrossRealmTrustPrincipalPassword": {
+ "type": "string",
+ "description": "The password to establish cross-realm trusts."
+ },
+ "ADDomainJoinUser": {
+ "type": "string",
+ "description": "The name of the user with privileges to join instances to Active Directory."
+ },
+ "ADDomainJoinPassword": {
+ "type": "string",
+ "description": "The password of the user with privileges to join instances to Active Directory."
+ }
+ }
+}
+
+MANAGED_SCALING_POLICY_SCHEMA = {
+ "type": "object",
+ "properties": {
+ "ComputeLimits": {
+ "type": "object",
+ "description":
+ "The EC2 unit limits for a managed scaling policy. "
+ "The managed scaling activity of a cluster is not allowed to go above "
+ "or below these limits. The limits apply to CORE and TASK groups "
+ "and exclude the capacity of the MASTER group.",
+ "properties": {
+ "MinimumCapacityUnits": {
+ "type": "integer",
+ "description":
+ "The lower boundary of EC2 units. It is measured through "
+ "VCPU cores or instances for instance groups and measured "
+ "through units for instance fleets. Managed scaling "
+ "activities are not allowed beyond this boundary.",
+ "required": True
+ },
+ "MaximumCapacityUnits": {
+ "type": "integer",
+ "description":
+ "The upper boundary of EC2 units. It is measured through "
+ "VCPU cores or instances for instance groups and measured "
+ "through units for instance fleets. Managed scaling "
+ "activities are not allowed beyond this boundary.",
+ "required": True
+ },
+ "MaximumOnDemandCapacityUnits": {
+ "type": "integer",
+ "description":
+ "The upper boundary of on-demand EC2 units. It is measured through "
+ "VCPU cores or instances for instance groups and measured "
+ "through units for instance fleets. The on-demand units are not "
+ "allowed to scale beyond this boundary. "
+ "This value must be lower than MaximumCapacityUnits."
+ },
+ "UnitType": {
+ "type": "string",
+ "description": "The unit type used for specifying a managed scaling policy.",
+ "enum": ["VCPU", "Instances", "InstanceFleetUnits"],
+ "required": True
+ }
+ }
+ }
+ }
+}
diff -Nru awscli-1.11.13/awscli/customizations/emr/constants.py awscli-1.18.69/awscli/customizations/emr/constants.py
--- awscli-1.11.13/awscli/customizations/emr/constants.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/constants.py 2020-05-28 19:25:48.000000000 +0000
@@ -15,10 +15,13 @@
EC2_ROLE_NAME = "EMR_EC2_DefaultRole"
EMR_ROLE_NAME = "EMR_DefaultRole"
-EC2_ROLE_ARN_PATTERN = ("arn:{{region_suffix}}:iam::aws:policy/service-role/"
- "AmazonElasticMapReduceforEC2Role")
-EMR_ROLE_ARN_PATTERN = ("arn:{{region_suffix}}:iam::aws:policy/service-role/"
- "AmazonElasticMapReduceRole")
+EMR_AUTOSCALING_ROLE_NAME = "EMR_AutoScaling_DefaultRole"
+ROLE_ARN_PATTERN = "arn:{{region_suffix}}:iam::aws:policy/service-role/{{policy_name}}"
+EC2_ROLE_POLICY_NAME = "AmazonElasticMapReduceforEC2Role"
+EMR_ROLE_POLICY_NAME = "AmazonElasticMapReduceRole"
+EMR_AUTOSCALING_ROLE_POLICY_NAME = "AmazonElasticMapReduceforAutoScalingRole"
+EMR_AUTOSCALING_SERVICE_NAME = "application-autoscaling"
+EMR_AUTOSCALING_SERVICE_PRINCIPAL = "application-autoscaling.amazonaws.com"
# Action on failure
CONTINUE = 'CONTINUE'
@@ -174,7 +177,7 @@
EC2 = 'ec2'
EMR = 'elasticmapreduce'
-
+APPLICATION_AUTOSCALING = 'application-autoscaling'
LATEST = 'latest'
APPLICATIONS = ["HIVE", "PIG", "HBASE", "GANGLIA", "IMPALA", "SPARK", "MAPR",
@@ -189,3 +192,5 @@
'WAITING', 'TERMINATING']
LIST_CLUSTERS_TERMINATED_STATES = ['TERMINATED']
LIST_CLUSTERS_FAILED_STATES = ['TERMINATED_WITH_ERRORS']
+
+INSTANCE_FLEET_TYPE = 'INSTANCE_FLEET'
diff -Nru awscli-1.11.13/awscli/customizations/emr/createcluster.py awscli-1.18.69/awscli/customizations/emr/createcluster.py
--- awscli-1.11.13/awscli/customizations/emr/createcluster.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/createcluster.py 2020-05-28 19:26:18.000000000 +0000
@@ -23,6 +23,7 @@
from awscli.customizations.emr import hbaseutils
from awscli.customizations.emr import helptext
from awscli.customizations.emr import instancegroupsutils
+from awscli.customizations.emr import instancefleetsutils
from awscli.customizations.emr import steputils
from awscli.customizations.emr.command import Command
from awscli.customizations.emr.constants import EC2_ROLE_NAME
@@ -50,6 +51,9 @@
'help_text': helptext.AUTO_TERMINATE},
{'name': 'no-auto-terminate', 'action': 'store_true',
'group_name': 'auto_terminate'},
+ {'name': 'instance-fleets',
+ 'schema': argumentschema.INSTANCE_FLEETS_SCHEMA,
+ 'help_text': helptext.INSTANCE_FLEETS},
{'name': 'name',
'default': 'Development Cluster',
'help_text': helptext.CLUSTER_NAME},
@@ -57,6 +61,8 @@
'help_text': helptext.LOG_URI},
{'name': 'service-role',
'help_text': helptext.SERVICE_ROLE},
+ {'name': 'auto-scaling-role',
+ 'help_text': helptext.AUTOSCALING_ROLE},
{'name': 'use-default-roles', 'action': 'store_true',
'help_text': helptext.USE_DEFAULT_ROLES},
{'name': 'configurations',
@@ -69,6 +75,8 @@
'help_text': helptext.TERMINATION_PROTECTED},
{'name': 'no-termination-protected', 'action': 'store_true',
'group_name': 'termination_protected'},
+ {'name': 'scale-down-behavior',
+ 'help_text': helptext.SCALE_DOWN_BEHAVIOR},
{'name': 'visible-to-all-users', 'action': 'store_true',
'group_name': 'visibility',
'help_text': helptext.VISIBILITY},
@@ -100,9 +108,24 @@
'schema': argumentschema.HBASE_RESTORE_FROM_BACKUP_SCHEMA,
'help_text': helptext.RESTORE_FROM_HBASE},
{'name': 'security-configuration',
- 'help_text': helptext.SECURITY_CONFIG}
+ 'help_text': helptext.SECURITY_CONFIG},
+ {'name': 'custom-ami-id',
+ 'help_text' : helptext.CUSTOM_AMI_ID},
+ {'name': 'ebs-root-volume-size',
+ 'help_text' : helptext.EBS_ROOT_VOLUME_SIZE},
+ {'name': 'repo-upgrade-on-boot',
+ 'help_text' : helptext.REPO_UPGRADE_ON_BOOT},
+ {'name': 'kerberos-attributes',
+ 'schema': argumentschema.KERBEROS_ATTRIBUTES_SCHEMA,
+ 'help_text': helptext.KERBEROS_ATTRIBUTES},
+ {'name': 'step-concurrency-level',
+ 'cli_type_name': 'integer',
+ 'help_text': helptext.STEP_CONCURRENCY_LEVEL},
+ {'name': 'managed-scaling-policy',
+ 'schema': argumentschema.MANAGED_SCALING_POLICY_SCHEMA,
+ 'help_text': helptext.MANAGED_SCALING_POLICY}
]
- SYNOPSIS = BasicCommand.FROM_FILE('emr', 'create-cluster-synopsis.rst')
+ SYNOPSIS = BasicCommand.FROM_FILE('emr', 'create-cluster-synopsis.txt')
EXAMPLES = BasicCommand.FROM_FILE('emr', 'create-cluster-examples.rst')
def _run_main_command(self, parsed_args, parsed_globals):
@@ -130,12 +153,23 @@
option2="--ec2-attributes InstanceProfile",
message=service_role_validation_message)
+ if parsed_args.instance_groups is not None and \
+ parsed_args.instance_fleets is not None:
+ raise exceptions.MutualExclusiveOptionError(
+ option1="--instance-groups",
+ option2="--instance-fleets")
+
instances_config = {}
- instances_config['InstanceGroups'] = \
- instancegroupsutils.validate_and_build_instance_groups(
- instance_groups=parsed_args.instance_groups,
- instance_type=parsed_args.instance_type,
- instance_count=parsed_args.instance_count)
+ if parsed_args.instance_fleets is not None:
+ instances_config['InstanceFleets'] = \
+ instancefleetsutils.validate_and_build_instance_fleets(
+ parsed_args.instance_fleets)
+ else:
+ instances_config['InstanceGroups'] = \
+ instancegroupsutils.validate_and_build_instance_groups(
+ instance_groups=parsed_args.instance_groups,
+ instance_type=parsed_args.instance_type,
+ instance_count=parsed_args.instance_count)
if parsed_args.release_label is not None:
params["ReleaseLabel"] = parsed_args.release_label
@@ -166,6 +200,17 @@
emrutils.apply_dict(params, 'ServiceRole', parsed_args.service_role)
+ if parsed_args.instance_groups is not None:
+ for instance_group in instances_config['InstanceGroups']:
+ if 'AutoScalingPolicy' in instance_group.keys():
+ if parsed_args.auto_scaling_role is None:
+ raise exceptions.MissingAutoScalingRoleError()
+
+ emrutils.apply_dict(params, 'AutoScalingRole', parsed_args.auto_scaling_role)
+
+ if parsed_args.scale_down_behavior is not None:
+ emrutils.apply_dict(params, 'ScaleDownBehavior', parsed_args.scale_down_behavior)
+
if (
parsed_args.no_auto_terminate is False and
parsed_args.auto_terminate is False):
@@ -273,6 +318,31 @@
emrutils.apply_dict(
params, 'SecurityConfiguration', parsed_args.security_configuration)
+ if parsed_args.custom_ami_id is not None:
+ emrutils.apply_dict(
+ params, 'CustomAmiId', parsed_args.custom_ami_id
+ )
+ if parsed_args.ebs_root_volume_size is not None:
+ emrutils.apply_dict(
+ params, 'EbsRootVolumeSize', int(parsed_args.ebs_root_volume_size)
+ )
+
+ if parsed_args.repo_upgrade_on_boot is not None:
+ emrutils.apply_dict(
+ params, 'RepoUpgradeOnBoot', parsed_args.repo_upgrade_on_boot
+ )
+
+ if parsed_args.kerberos_attributes is not None:
+ emrutils.apply_dict(
+ params, 'KerberosAttributes', parsed_args.kerberos_attributes)
+
+ if parsed_args.step_concurrency_level is not None:
+ params['StepConcurrencyLevel'] = parsed_args.step_concurrency_level
+
+ if parsed_args.managed_scaling_policy is not None:
+ emrutils.apply_dict(
+ params, 'ManagedScalingPolicy', parsed_args.managed_scaling_policy)
+
self._validate_required_applications(parsed_args)
run_job_flow_response = emrutils.call(
@@ -287,18 +357,33 @@
def _construct_result(self, run_job_flow_result):
jobFlowId = None
+ clusterArn = None
if run_job_flow_result is not None:
jobFlowId = run_job_flow_result.get('JobFlowId')
+ clusterArn = run_job_flow_result.get('ClusterArn')
if jobFlowId is not None:
- return {'ClusterId': jobFlowId}
+ return {'ClusterId': jobFlowId,
+ 'ClusterArn': clusterArn }
else:
return {}
def _build_ec2_attributes(self, cluster, parsed_attrs):
keys = parsed_attrs.keys()
instances = cluster['Instances']
- if 'AvailabilityZone' in keys and 'SubnetId' in keys:
+
+ if ('SubnetId' in keys and 'SubnetIds' in keys):
+ raise exceptions.MutualExclusiveOptionError(
+ option1="SubnetId",
+ option2="SubnetIds")
+
+ if ('AvailabilityZone' in keys and 'AvailabilityZones' in keys):
+ raise exceptions.MutualExclusiveOptionError(
+ option1="AvailabilityZone",
+ option2="AvailabilityZones")
+
+ if ('SubnetId' in keys or 'SubnetIds' in keys) \
+ and ('AvailabilityZone' in keys or 'AvailabilityZones' in keys):
raise exceptions.SubnetAndAzValidationError
emrutils.apply_params(
@@ -307,6 +392,9 @@
emrutils.apply_params(
src_params=parsed_attrs, src_key='SubnetId',
dest_params=instances, dest_key='Ec2SubnetId')
+ emrutils.apply_params(
+ src_params=parsed_attrs, src_key='SubnetIds',
+ dest_params=instances, dest_key='Ec2SubnetIds')
if 'AvailabilityZone' in keys:
instances['Placement'] = dict()
@@ -315,6 +403,13 @@
dest_params=instances['Placement'],
dest_key='AvailabilityZone')
+ if 'AvailabilityZones' in keys:
+ instances['Placement'] = dict()
+ emrutils.apply_params(
+ src_params=parsed_attrs, src_key='AvailabilityZones',
+ dest_params=instances['Placement'],
+ dest_key='AvailabilityZones')
+
emrutils.apply_params(
src_params=parsed_attrs, src_key='InstanceProfile',
dest_params=cluster, dest_key='JobFlowRole')
@@ -457,8 +552,8 @@
parsed_args, parsed_configs):
if parsed_args.use_default_roles:
configurations = [x for x in configurations
- if x.name is not 'service_role' and
- x.name is not 'instance_profile']
+ if x.name != 'service_role' and
+ x.name != 'instance_profile']
return configurations
def _handle_emrfs_parameters(self, cluster, emrfs_args, release_label):
diff -Nru awscli-1.11.13/awscli/customizations/emr/createdefaultroles.py awscli-1.18.69/awscli/customizations/emr/createdefaultroles.py
--- awscli-1.11.13/awscli/customizations/emr/createdefaultroles.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/createdefaultroles.py 2020-05-28 19:25:48.000000000 +0000
@@ -13,21 +13,29 @@
import logging
import re
-
-
import botocore.exceptions
+import botocore.session
from botocore import xform_name
+from awscli.customizations.utils import get_policy_arn_suffix
from awscli.customizations.emr import configutils
from awscli.customizations.emr import emrutils
from awscli.customizations.emr import exceptions
from awscli.customizations.emr.command import Command
from awscli.customizations.emr.constants import EC2
from awscli.customizations.emr.constants import EC2_ROLE_NAME
-from awscli.customizations.emr.constants import EC2_ROLE_ARN_PATTERN
+from awscli.customizations.emr.constants import ROLE_ARN_PATTERN
from awscli.customizations.emr.constants import EMR
from awscli.customizations.emr.constants import EMR_ROLE_NAME
-from awscli.customizations.emr.constants import EMR_ROLE_ARN_PATTERN
+from awscli.customizations.emr.constants import EMR_AUTOSCALING_ROLE_NAME
+from awscli.customizations.emr.constants import APPLICATION_AUTOSCALING
+from awscli.customizations.emr.constants import EC2_ROLE_POLICY_NAME
+from awscli.customizations.emr.constants import EMR_ROLE_POLICY_NAME
+from awscli.customizations.emr.constants \
+ import EMR_AUTOSCALING_ROLE_POLICY_NAME
+from awscli.customizations.emr.constants import EMR_AUTOSCALING_SERVICE_NAME
+from awscli.customizations.emr.constants \
+ import EMR_AUTOSCALING_SERVICE_PRINCIPAL
from awscli.customizations.emr.exceptions import ResolveServicePrincipalError
@@ -48,43 +56,35 @@
}
-def get_service_role_policy_arn(region):
- region_suffix = _get_policy_arn_suffix(region)
- return EMR_ROLE_ARN_PATTERN.replace("{{region_suffix}}", region_suffix)
-
-
-def get_ec2_role_policy_arn(region):
- region_suffix = _get_policy_arn_suffix(region)
- return EC2_ROLE_ARN_PATTERN.replace("{{region_suffix}}", region_suffix)
-
-
-def _get_policy_arn_suffix(region):
- region_string = region.lower()
- if region_string.startswith("cn-"):
- return "aws-cn"
- elif region_string.startswith("us-gov"):
- return "aws-us-gov"
- else:
- return "aws"
+def get_role_policy_arn(region, policy_name):
+ region_suffix = get_policy_arn_suffix(region)
+ role_arn = ROLE_ARN_PATTERN.replace("{{region_suffix}}", region_suffix)
+ role_arn = role_arn.replace("{{policy_name}}", policy_name)
+ return role_arn
-def get_service_principal(service, endpoint_host):
- return service + '.' + _get_suffix(endpoint_host)
+def get_service_principal(service, endpoint_host, session=None):
+ suffix, region = _get_suffix_and_region_from_endpoint_host(endpoint_host)
+ if session is None:
+ session = botocore.session.Session()
+ if service == EMR_AUTOSCALING_SERVICE_NAME:
+ if region not in session.get_available_regions('emr', 'aws-cn'):
+ return EMR_AUTOSCALING_SERVICE_PRINCIPAL
-def _get_suffix(endpoint_host):
- return _get_suffix_from_endpoint_host(endpoint_host)
+ return service + '.' + suffix
-def _get_suffix_from_endpoint_host(endpoint_host):
+def _get_suffix_and_region_from_endpoint_host(endpoint_host):
suffix_match = _get_regex_match_from_endpoint_host(endpoint_host)
if suffix_match is not None and suffix_match.lastindex >= 3:
suffix = suffix_match.group(3)
+ region = suffix_match.group(2)
else:
raise ResolveServicePrincipalError
- return suffix
+ return suffix, region
def _get_regex_match_from_endpoint_host(endpoint_host):
@@ -128,10 +128,6 @@
]
def _run_main_command(self, parsed_args, parsed_globals):
- ec2_result = None
- ec2_policy = None
- emr_result = None
- emr_policy = None
self.iam_endpoint_url = parsed_args.iam_endpoint
@@ -146,19 +142,11 @@
LOG.debug('elasticmapreduce endpoint used for resolving'
' service principal: ' + self.emr_endpoint_url)
- # Check if the default EC2 Role for EMR exists.
- role_name = EC2_ROLE_NAME
- if self.check_if_role_exists(role_name, parsed_globals):
- LOG.debug('Role ' + role_name + ' exists.')
- else:
- LOG.debug('Role ' + role_name + ' does not exist.'
- ' Creating default role for EC2: ' + role_name)
- role_arn = get_ec2_role_policy_arn(self.region)
- ec2_result = self._create_role_with_role_policy(
- role_name, EC2, role_arn, parsed_globals)
- ec2_policy = self._get_role_policy(role_arn, parsed_globals)
+ # Create default EC2 Role for EMR if it does not exist.
+ ec2_result, ec2_policy = self._create_role_if_not_exists(parsed_globals, EC2_ROLE_NAME,
+ EC2_ROLE_POLICY_NAME, [EC2])
- # Check if the default EC2 Instance Profile for EMR exists.
+ # Create default EC2 Instance Profile for EMR if it does not exist.
instance_profile_name = EC2_ROLE_NAME
if self.check_if_instance_profile_exists(instance_profile_name,
parsed_globals):
@@ -171,28 +159,41 @@
instance_profile_name,
parsed_globals)
- # Check if the default EMR Role exists.
- role_name = EMR_ROLE_NAME
- if self.check_if_role_exists(role_name, parsed_globals):
- LOG.debug('Role ' + role_name + ' exists.')
- else:
- LOG.debug('Role ' + role_name + ' does not exist.'
- ' Creating default role for EMR: ' + role_name)
- role_arn = get_service_role_policy_arn(self.region)
- emr_result = self._create_role_with_role_policy(
- role_name, EMR, role_arn, parsed_globals)
- emr_policy = self._get_role_policy(role_arn, parsed_globals)
+ # Create default EMR Role if it does not exist.
+ emr_result, emr_policy = self._create_role_if_not_exists(parsed_globals, EMR_ROLE_NAME,
+ EMR_ROLE_POLICY_NAME, [EMR])
+
+ # Create default EMR AutoScaling Role if it does not exist.
+ emr_autoscaling_result, emr_autoscaling_policy = \
+ self._create_role_if_not_exists(parsed_globals, EMR_AUTOSCALING_ROLE_NAME,
+ EMR_AUTOSCALING_ROLE_POLICY_NAME, [EMR, APPLICATION_AUTOSCALING])
configutils.update_roles(self._session)
emrutils.display_response(
self._session,
'create_role',
self._construct_result(ec2_result, ec2_policy,
- emr_result, emr_policy),
+ emr_result, emr_policy,
+ emr_autoscaling_result, emr_autoscaling_policy),
parsed_globals)
return 0
+ def _create_role_if_not_exists(self, parsed_globals, role_name, policy_name, service_names):
+ result = None
+ policy = None
+
+ if self.check_if_role_exists(role_name, parsed_globals):
+ LOG.debug('Role ' + role_name + ' exists.')
+ else:
+ LOG.debug('Role ' + role_name + ' does not exist.'
+ ' Creating default role: ' + role_name)
+ role_arn = get_role_policy_arn(self.region, policy_name)
+ result = self._create_role_with_role_policy(
+ role_name, service_names, role_arn, parsed_globals)
+ policy = self._get_role_policy(role_arn, parsed_globals)
+ return result, policy
+
def _check_for_iam_endpoint(self, region, iam_endpoint):
try:
self._session.create_client('emr', region)
@@ -201,12 +202,15 @@
raise exceptions.UnknownIamEndpointError(region=region)
def _construct_result(self, ec2_response, ec2_policy,
- emr_response, emr_policy):
+ emr_response, emr_policy,
+ emr_autoscaling_response, emr_autoscaling_policy):
result = []
self._construct_role_and_role_policy_structure(
result, ec2_response, ec2_policy)
self._construct_role_and_role_policy_structure(
result, emr_response, emr_policy)
+ self._construct_role_and_role_policy_structure(
+ result, emr_autoscaling_response, emr_autoscaling_policy)
return result
def _construct_role_and_role_policy_structure(
@@ -217,13 +221,13 @@
def check_if_role_exists(self, role_name, parsed_globals):
parameters = {'RoleName': role_name}
+
try:
self._call_iam_operation('GetRole', parameters, parsed_globals)
except botocore.exceptions.ClientError as e:
- role_not_found_msg = \
- 'The role with name %s cannot be found.' % role_name
- error_message = e.response.get('Error', {}).get('Message', '')
- if role_not_found_msg in error_message:
+ role_not_found_code = "NoSuchEntity"
+ error_code = e.response.get('Error', {}).get('Code', '')
+ if role_not_found_code == error_code:
# No role error.
return False
else:
@@ -239,10 +243,9 @@
self._call_iam_operation('GetInstanceProfile', parameters,
parsed_globals)
except botocore.exceptions.ClientError as e:
- profile_not_found_msg = \
- 'Instance Profile %s cannot be found.' % instance_profile_name
- error_message = e.response.get('Error', {}).get('Message')
- if profile_not_found_msg in error_message:
+ profile_not_found_code = 'NoSuchEntity'
+ error_code = e.response.get('Error', {}).get('Code')
+ if profile_not_found_code == error_code:
# No instance profile error.
return False
else:
@@ -263,9 +266,17 @@
return policy_version_details["PolicyVersion"]["Document"]
def _create_role_with_role_policy(
- self, role_name, service_name, role_arn, parsed_globals):
- service_principal = get_service_principal(service_name,
- self.emr_endpoint_url)
+ self, role_name, service_names, role_arn, parsed_globals):
+
+ if len(service_names) == 1:
+ service_principal = get_service_principal(
+ service_names[0], self.emr_endpoint_url, self._session)
+ else:
+ service_principal = []
+ for service in service_names:
+ service_principal.append(get_service_principal(
+ service, self.emr_endpoint_url, self._session))
+
LOG.debug(service_principal)
parameters = {'RoleName': role_name}
diff -Nru awscli-1.11.13/awscli/customizations/emr/describecluster.py awscli-1.18.69/awscli/customizations/emr/describecluster.py
--- awscli-1.11.13/awscli/customizations/emr/describecluster.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/describecluster.py 2020-05-28 19:25:48.000000000 +0000
@@ -32,12 +32,35 @@
def _run_main_command(self, parsed_args, parsed_globals):
parameters = {'ClusterId': parsed_args.cluster_id}
+ list_instance_fleets_result = None
+ list_instance_groups_result = None
+ is_fleet_based_cluster = False
describe_cluster_result = self._call(
self._session, 'describe_cluster', parameters, parsed_globals)
- list_instance_groups_result = self._call(
- self._session, 'list_instance_groups', parameters, parsed_globals)
+
+ if 'Cluster' in describe_cluster_result:
+ describe_cluster = describe_cluster_result['Cluster']
+ if describe_cluster.get('InstanceCollectionType') == constants.INSTANCE_FLEET_TYPE:
+ is_fleet_based_cluster = True
+
+ if 'Ec2InstanceAttributes' in describe_cluster:
+ ec2_instance_attr_keys = \
+ describe_cluster['Ec2InstanceAttributes'].keys()
+ ec2_instance_attr = \
+ describe_cluster['Ec2InstanceAttributes']
+ else:
+ ec2_instance_attr_keys = {}
+
+ if is_fleet_based_cluster:
+ list_instance_fleets_result = self._call(
+ self._session, 'list_instance_fleets', parameters,
+ parsed_globals)
+ else:
+ list_instance_groups_result = self._call(
+ self._session, 'list_instance_groups', parameters,
+ parsed_globals)
list_bootstrap_actions_result = self._call(
self._session, 'list_bootstrap_actions',
@@ -45,6 +68,7 @@
constructed_result = self._construct_result(
describe_cluster_result,
+ list_instance_fleets_result,
list_instance_groups_result,
list_bootstrap_actions_result)
@@ -67,12 +91,15 @@
return key
def _construct_result(
- self, describe_cluster_result, list_instance_groups_result,
- list_bootstrap_actions_result):
+ self, describe_cluster_result, list_instance_fleets_result,
+ list_instance_groups_result, list_bootstrap_actions_result):
result = describe_cluster_result
- result['Cluster']['InstanceGroups'] = []
result['Cluster']['BootstrapActions'] = []
+ if (list_instance_fleets_result is not None and
+ list_instance_fleets_result.get('InstanceFleets') is not None):
+ result['Cluster']['InstanceFleets'] = \
+ list_instance_fleets_result.get('InstanceFleets')
if (list_instance_groups_result is not None and
list_instance_groups_result.get('InstanceGroups') is not None):
result['Cluster']['InstanceGroups'] = \
diff -Nru awscli-1.11.13/awscli/customizations/emr/emrutils.py awscli-1.18.69/awscli/customizations/emr/emrutils.py
--- awscli-1.11.13/awscli/customizations/emr/emrutils.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/emrutils.py 2020-05-28 19:25:48.000000000 +0000
@@ -240,7 +240,7 @@
values = [str(x) for x in values]
if len(values) < 1:
return ""
- elif len(values) is 1:
+ elif len(values) == 1:
return values[0]
else:
separator = '%s ' % separator
diff -Nru awscli-1.11.13/awscli/customizations/emr/exceptions.py awscli-1.18.69/awscli/customizations/emr/exceptions.py
--- awscli-1.11.13/awscli/customizations/emr/exceptions.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/exceptions.py 2020-05-28 19:25:48.000000000 +0000
@@ -19,7 +19,7 @@
:ivar msg: The descriptive message associated with the error.
"""
- fmt = 'An unspecified error occured'
+ fmt = 'An unspecified error occurred'
def __init__(self, **kwargs):
msg = self.fmt.format(**kwargs)
@@ -334,3 +334,9 @@
fmt = ("aws: error: {command} is not supported with "
"'{release_label}' release.")
+
+class MissingAutoScalingRoleError(EmrError):
+
+ fmt = ("aws: error: Must specify --auto-scaling-role when configuring an "
+ "AutoScaling policy for an instance group.")
+
diff -Nru awscli-1.11.13/awscli/customizations/emr/helptext.py awscli-1.18.69/awscli/customizations/emr/helptext.py
--- awscli-1.11.13/awscli/customizations/emr/helptext.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/helptext.py 2020-05-28 19:26:18.000000000 +0000
@@ -15,158 +15,210 @@
from awscli.customizations.emr.createdefaultroles import EC2_ROLE_NAME
TERMINATE_CLUSTERS = (
- 'Shuts down a list of clusters. When a cluster is shut'
- ' down, any step not yet completed is canceled and the '
+ 'Shuts down one or more clusters, each specified by cluster ID. '
+ 'Use this command only on clusters that do not have termination '
+ 'protection enabled. Clusters with termination protection enabled '
+ 'are not terminated. When a cluster is shut '
+ 'down, any step not yet completed is canceled and the '
'Amazon EC2 instances in the cluster are terminated. '
- 'Any log files not already saved are uploaded to'
- ' Amazon S3 if a LogUri was specified when the cluster was created.'
- " 'terminate-clusters' is asynchronous. Depending on the"
- ' configuration of the cluster, it may take from 5 to 20 minutes for the'
- ' cluster to completely terminate and release allocated resources such as'
- ' Amazon EC2 instances.')
+ 'Any log files not already saved are uploaded to '
+ 'Amazon S3 if a --log-uri was specified when the cluster was created. '
+ 'The maximum number of clusters allowed in the list is 10. '
+ 'The command is asynchronous. Depending on the '
+ 'configuration of the cluster, it may take from 5 to 20 minutes for the '
+ 'cluster to terminate completely and release allocated resources such as '
+ 'Amazon EC2 instances.')
CLUSTER_ID = (
- '
A unique string that identifies the cluster. This'
- ' identifier is returned by create-cluster and can also be'
- ' obtained from list-clusters.
')
+ '
A unique string that identifies a cluster. The '
+ 'create-cluster command returns this identifier. You can '
+ 'use the list-clusters command to get cluster IDs.
')
HBASE_BACKUP_DIR = (
- '
Amazon S3 location of the Hbase backup.
Example:
'
- 's3://mybucket/mybackup
where mybucket is the'
- ' specified Amazon S3 bucket and mybackup is the specified backup'
- ' location. The path argument must begin with s3:// in order to denote'
- ' that the path argument refers to an Amazon S3 folder.
')
+ '
The Amazon S3 location of the Hbase backup. Example: '
+ 's3://mybucket/mybackup, where mybucket is the '
+ 'specified Amazon S3 bucket and mybackup is the specified backup '
+ 'location. The path argument must begin with s3://, which '
+ 'refers to an Amazon S3 bucket.
')
HBASE_BACKUP_VERSION = (
- '
Backup version to restore from. If not specified the latest backup '
- 'in the specified location will be used.
')
+ '
The backup version to restore from. If not specified, the latest backup '
+ 'in the specified location is used.
')
# create-cluster options help text
+
+CREATE_CLUSTER_DESCRIPTION = (
+ 'Creates an Amazon EMR cluster with the specified configurations.\n'
+ '\nQuick start:\n'
+ '\naws emr create-cluster --release-label '
+ ' --instance-type --instance-count \n'
+ '\nValues for the following can be set in the AWS CLI'
+ ' config file using the "aws configure set" command: --service-role, --log-uri,'
+ ' and InstanceProfile and KeyName arguments under --ec2-attributes.')
+
CLUSTER_NAME = (
- '
The name of the cluster. The default is "Development Cluster".
')
+ '
The name of the cluster. If not provided, the default is "Development Cluster".
')
LOG_URI = (
- '
The location in Amazon S3 to write the log files '
- 'of the cluster. If a value is not provided, '
- 'logs are not created.
')
+ '
Specifies the location in Amazon S3 to which log files '
+ 'are periodically written. If a value is not provided, '
+ 'logs files are not written to Amazon S3 from the master node '
+ 'and are lost if the master node terminates.
')
SERVICE_ROLE = (
- '
Allows EMR to call other AWS Services such as EC2 on your behalf.
'
- 'To create the default Service Role ' + EMR_ROLE_NAME + ','
- ' use aws emr create-default-roles command. '
- 'This command will also create the default EC2 instance profile '
- '' + EC2_ROLE_NAME + '.')
+ '
Specifies an IAM service role, which Amazon EMR requires to call other AWS services '
+ 'on your behalf during cluster operation. This parameter '
+ 'is usually specified when a customized service role is used. '
+ 'To specify the default service role, as well as the default instance '
+ 'profile, use the --use-default-roles parameter. '
+ 'If the role and instance profile do not already exist, use the '
+ 'aws emr create-default-roles command to create them.
')
+
+AUTOSCALING_ROLE = (
+ '
Specify --auto-scaling-role EMR_AutoScaling_DefaultRole'
+ ' if an automatic scaling policy is specified for an instance group'
+ ' using the --instance-groups parameter. This default'
+ ' IAM role allows the automatic scaling feature'
+ ' to launch and terminate Amazon EC2 instances during scaling operations.
')
USE_DEFAULT_ROLES = (
- '
Uses --service-role=' + EMR_ROLE_NAME + ', and '
- '--ec2-attributes InstanceProfile=' + EC2_ROLE_NAME + ''
- 'To create the default service role and instance profile'
- ' use aws emr create-default-roles command.
')
+ '
Specifies that the cluster should use the default'
+ ' service role (EMR_DefaultRole) and instance profile (EMR_EC2_DefaultRole)'
+ ' for permissions to access other AWS services.
'
+ '
Make sure that the role and instance profile exist first. To create them,'
+ ' use the create-default-roles command.
')
AMI_VERSION = (
- '
The version number of the Amazon Machine Image (AMI) '
- 'to use for Amazon EC2 instances in the cluster. '
- 'For example,--ami-version 3.1.0 You cannot specify both a release label'
- ' (emr-4.0.0 and later) and an AMI version (3.x or 2.x) on a cluster
'
- '
For details about the AMIs currently supported by Amazon '
- 'Elastic MapReduce, go to AMI Versions Supported in Amazon Elastic '
- 'MapReduce in the Amazon Elastic MapReduce Developer\'s Guide.
Applies only to Amazon EMR release versions earlier than 4.0. Use'
+ ' --release-label for 4.0 and later. Specifies'
+ ' the version of Amazon Linux Amazon Machine Image (AMI)'
+ ' to use when launching Amazon EC2 instances in the cluster.'
+ ' For example, --ami-version 3.1.0.')
RELEASE_LABEL = (
- '
The identifier for the EMR release, which includes a set of software,'
- ' to use with Amazon EC2 instances that are part of an Amazon EMR cluster.'
- ' For example, --release-label emr-4.0.0 You cannot specify both a'
- ' release label (emr-4.0.0 and later) and AMI version (3.x or 2.x) on a'
- ' cluster.
'
- '
For details about the releases available in Amazon Elastic MapReduce,'
- ' go to Releases Available in Amazon Elastic MapReduce in the'
- ' Amazon Elastic MapReduce Documentation.
Please use ami-version if you want to specify AMI'
- ' Versions for your Amazon EMR cluster (3.x and 2.x)
')
+ '
Specifies the Amazon EMR release version, which determines'
+ ' the versions of application software that are installed on the cluster.'
+ ' For example, --release-label emr-5.15.0 installs'
+ ' the application versions and features available in that version.'
+ ' For details about application versions and features available'
+ ' in each release, see the Amazon EMR Release Guide:
'
+ '
https://docs.aws.amazon.com/emr/ReleaseGuide
'
+ '
Use --release-label only for Amazon EMR release version 4.0'
+ ' and later. Use --ami-version for earlier versions.'
+ ' You cannot specify both a release label and AMI version.
')
CONFIGURATIONS = (
- '
Specifies new configuration values for applications installed on your'
- ' cluster when using an EMR release (emr-4.0.0 and later). The'
- ' configuration files available for editing in each application (for'
- ' example: yarn-site for YARN) can be found in the Amazon EMR Developer\'s'
- ' Guide in the respective application\'s section. Currently on the CLI,'
- ' you can only specify these values in a JSON file stored locally or in'
- ' Amazon S3, and you supply the path to this file to this parameter.
'
- '
For example:
'
- '
To specify configurations from a local file --configurations'
- ' file://configurations.json
'
- '
To specify configurations from a file in Amazon S3 '
- '--configurations https://s3.amazonaws.com/myBucket/configurations.json'
- '
'
- '
For more information about configuring applications in EMR release,'
- ' go to the Amazon EMR Documentation:
Specifies a JSON file that contains configuration classifications,'
+ ' which you can use to customize applications that Amazon EMR installs'
+ ' when cluster instances launch. Applies only to Amazon EMR 4.0 and later.'
+ ' The file referenced can either be stored locally (for example,'
+ ' --configurations file://configurations.json)'
+ ' or stored in Amazon S3 (for example, --configurations'
+ ' https://s3.amazonaws.com/myBucket/configurations.json).'
+ ' Each classification usually corresponds to the xml configuration'
+ ' file for an application, such as yarn-site for YARN. For a list of'
+ ' available configuration classifications and example JSON, see'
+ ' the following topic in the Amazon EMR Release Guide:
A specification of the number and type'
- ' of Amazon EC2 instances to create instance groups in a cluster.
'
- '
Each instance group takes the following parameters: '
- '[Name], InstanceGroupType, InstanceType, InstanceCount,'
- ' [BidPrice], [EbsConfiguration]. [EbsConfiguration] is optional.'
- ' EbsConfiguration takes the following parameters: EbsOptimized'
- ' and EbsBlockDeviceConfigs. EbsBlockDeviceConfigs is an array of EBS volume'
- ' specifications, which takes the following parameters : ([VolumeType], '
- ' [SizeInGB], Iops) and VolumesPerInstance which is the count of EBS volumes'
- ' per instance with this specification.
')
+ '
Specifies the number and type of Amazon EC2 instances'
+ ' to create for each node type in a cluster, using uniform instance groups.'
+ ' You can specify either --instance-groups or'
+ ' --instance-fleets but not both.'
+ ' For more information, see the following topic in the EMR Management Guide:
You can specify arguments individually using multiple'
+ ' InstanceGroupType argument blocks, one for the MASTER'
+ ' instance group, one for a CORE instance group,'
+ ' and optional, multiple TASK instance groups.
'
+ '
If you specify inline JSON structures, enclose the entire'
+ ' InstanceGroupType argument block in single quotation marks.'
+ '
Each InstanceGroupType block takes the following inline arguments.'
+ ' Optional arguments are shown in [square brackets].
'
+ '
[Name] - An optional friendly name for the instance group.
'
+ '
InstanceGroupType - MASTER, CORE, or TASK.
'
+ '
InstanceType - The type of EC2 instance, for'
+ ' example m4.large,'
+ ' to use for all nodes in the instance group.
'
+ '
InstanceCount - The number of EC2 instances to provision in the instance group.
'
+ '
[BidPrice] - If specified, indicates that the instance group uses Spot Instances.'
+ ' This is the maximum price you are willing to pay for Spot Instances. Specify OnDemandPrice'
+ ' to set the amount equal to the On-Demand price, or specify an amount in USD.
'
+ '
[EbsConfiguration] - Specifies additional Amazon EBS storage volumes attached'
+ ' to EC2 instances using an inline JSON structure.
'
+ '
[AutoScalingPolicy] - Specifies an automatic scaling policy for the'
+ ' instance group using an inline JSON structure.
')
+
+INSTANCE_FLEETS = (
+ '
Applies only to Amazon EMR release version 5.0 and later. Specifies'
+ ' the number and type of Amazon EC2 instances to create'
+ ' for each node type in a cluster, using instance fleets.'
+ ' You can specify either --instance-fleets or'
+ ' --instance-groups but not both.'
+ ' For more information and examples, see the following topic in the Amazon EMR Management Guide:
You can specify arguments individually using multiple'
+ ' InstanceFleetType argument blocks, one for the MASTER'
+ ' instance fleet, one for a CORE instance fleet,'
+ ' and an optional TASK instance fleet.
'
+ '
The following arguments can be specified for each instance fleet. Optional arguments are shown in [square brackets].
'
+ '
[Name] - An optional friendly name for the instance fleet.
'
+ '
InstanceFleetType - MASTER, CORE, or TASK.
'
+ '
TargetOnDemandCapacity - The target capacity of On-Demand units'
+ ' for the instance fleet, which determines how many On-Demand Instances to provision.'
+ ' The WeightedCapacity specified for an instance type within'
+ ' InstanceTypeConfigs counts toward this total when an instance type'
+ ' with the On-Demand purchasing option launches.
'
+ '
TargetSpotCapacity - The target capacity of Spot units'
+ ' for the instance fleet, which determines how many Spot Instances to provision.'
+ ' The WeightedCapacity specified for an instance type within'
+ ' InstanceTypeConfigs counts toward this total when an instance'
+ ' type with the Spot purchasing option launches.
'
+ '
[LaunchSpecifications] - When TargetSpotCapacity is specified,'
+ ' specifies the block duration and timeout action for Spot Instances.'
+ '
InstanceTypeConfigs - Specifies up to five EC2 instance types to'
+ ' use in the instance fleet, including details such as Spot price and Amazon EBS configuration.
')
INSTANCE_TYPE = (
- '
Shortcut option for --instance-groups. A specification of the '
- 'type of Amazon EC2 instances used together with --instance-count '
- '(optional) to create instance groups in a cluster. '
- 'Specifying the --instance-type argument without '
- 'also specifying --instance-count launches a single-node cluster.
')
+ '
Shortcut parameter as an alternative to --instance-groups.'
+ ' Specifies the type of Amazon EC2 instance to use in a cluster.'
+ ' If used without the --instance-count parameter,'
+ ' the cluster consists of a single master node running on the EC2 instance type'
+ ' specified. When used together with --instance-count,'
+ ' one instance is used for the master node, and the remainder'
+ ' are used for the core node type.
')
INSTANCE_COUNT = (
- '
Shortcut option for --instance-groups. '
- 'A specification of the number of Amazon EC2 instances used together with'
- ' --instance-type to create instance groups in a cluster. EMR will use one'
- ' node as the cluster\'s master node and use the remainder of the nodes as'
- ' core nodes. Specifying the --instance-type argument without '
- 'also specifying --instance-count launches a single-node cluster.
')
+ '
Shortcut parameter as an alternative to --instance-groups'
+ ' when used together with --instance-type. Specifies the'
+ ' number of Amazon EC2 instances to create for a cluster.'
+ ' One instance is used for the master node, and the remainder'
+ ' are used for the core node type.
')
ADDITIONAL_INFO = (
- '
Specifies additional information during cluster creation
')
+ '
Specifies additional information during cluster creation.
')
EC2_ATTRIBUTES = (
- '
Specifies the following Amazon EC2 attributes: KeyName,'
- ' AvailabilityZone, SubnetId, InstanceProfile,'
- ' EmrManagedMasterSecurityGroup, EmrManagedSlaveSecurityGroup,'
- ' AdditionalMasterSecurityGroups and AdditionalSlaveSecurityGroups.'
- ' AvailabilityZone and Subnet cannot be specified together.'
- ' To create the default instance profile ' +
- EC2_ROLE_NAME + ','
- ' use aws emr create-default-roles command.
'
- 'This command will also create the default EMR service role '
- '' + EMR_ROLE_NAME + '.'
- '
KeyName - the name of the AWS EC2 key pair you are using '
- 'to launch the cluster.
'
- '
AvailabilityZone - An isolated resource '
- 'location within a region.
'
- '
SubnetId - Assign the EMR cluster to this Amazon VPC Subnet.
'
- '
InstanceProfile - Provides access to other AWS services such as S3,'
- ' DynamoDB from EC2 instances that are launched by EMR..
'
- '
EmrManagedMasterSecurityGroup - The identifier of the Amazon EC2'
- ' security group'
- ' for the master node.
'
- '
EmrManagedSlaveSecurityGroup - The identifier of the Amazon EC2'
- ' security group'
- ' for the slave nodes.
'
- '
ServiceAccessSecurityGroup - The identifier of the Amazon EC2 '
- 'security group for the Amazon EMR service '
- 'to access clusters in VPC private subnets
'
- '
AdditionalMasterSecurityGroups - A list of additional Amazon EC2'
- ' security group IDs for the master node
'
- '
AdditionalSlaveSecurityGroups - A list of additional Amazon EC2'
+ '
Configures cluster and Amazon EC2 instance configurations. Accepts'
+ ' the following arguments:
'
+ '
KeyName - Specifies the name of the AWS EC2 key pair that will be used for'
+ ' SSH connections to the master node and other instances on the cluster.
'
+ '
AvailabilityZone - Specifies the availability zone in which to launch'
+ ' the cluster. For example, us-west-1b.
'
+ '
SubnetId - Specifies the VPC subnet in which to create the cluster.
'
+ '
InstanceProfile - An IAM role that allows EC2 instances to'
+ ' access other AWS services, such as Amazon S3, that'
+ ' are required for operations.
'
+ '
EmrManagedMasterSecurityGroup - The security group ID of the Amazon EC2'
+ ' security group for the master node.
'
+ '
EmrManagedSlaveSecurityGroup - The security group ID of the Amazon EC2'
+ ' security group for the slave nodes.
'
+ '
ServiceAccessSecurityGroup - The security group ID of the Amazon EC2 '
+ 'security group for Amazon EMR access to clusters in VPC private subnets.
'
+ '
AdditionalMasterSecurityGroups - A list of additional Amazon EC2'
+ ' security group IDs for the master node.
'
+ '
AdditionalSlaveSecurityGroups - A list of additional Amazon EC2'
' security group IDs for the slave nodes.
Specifies whether to lock the cluster to prevent the'
- ' Amazon EC2 instances from being terminated by API call, '
- 'user intervention, or in the event of an error. Termination protection '
- 'is off by default.
')
+ ' Amazon EC2 instances from being terminated by API call,'
+ ' user intervention, or an error.')
+SCALE_DOWN_BEHAVIOR = (
+ '
Specifies the way that individual Amazon EC2 instances terminate'
+ ' when an automatic scale-in activity occurs or an instance group is resized.
'
+ '
Accepted values:
'
+ '
TERMINATE_AT_TASK_COMPLETION - Specifies that Amazon EMR'
+ ' blacklists and drains tasks from nodes before terminating the instance.
'
+ '
TERMINATE_AT_INSTANCE_HOUR - Specifies that Amazon EMR'
+ ' terminate EC2 instances at the instance-hour boundary, regardless of when'
+ ' the request to terminate was submitted.
'
+)
VISIBILITY = (
'
Specifies whether the cluster is visible to all IAM users of'
- ' the AWS account associated with the cluster. If set to '
- '--visible-to-all-users, all IAM users of that AWS account'
- ' can view and (if they have the proper policy permisions set) manage'
- ' the cluster. If it is set to --no-visible-to-all-users,'
+ ' the AWS account associated with the cluster. If set to'
+ ' --visible-to-all-users, all IAM users of that AWS account'
+ ' can view it. If they have the proper policy permissions set, they can '
+ ' also manage the cluster. If it is set to --no-visible-to-all-users,'
' only the IAM user that created the cluster can view and manage it. '
- ' Clusters are visible by default.
')
+ ' Clusters are visible by default.')
DEBUGGING = (
- '
Enables debugging for the cluster. The debugging tool is a'
- ' graphical user interface that you can use to browse the log files from'
- ' the console (https://console.aws.amazon.com/elasticmapreduce/'
- ' ). When you enable debugging on a cluster, Amazon EMR archives'
- ' the log files to Amazon S3 and then indexes those files. You can then'
- ' use the graphical interface to browse the step, job, task, and task'
- ' attempt logs for the cluster in an intuitive way.
Requires'
- ' --log-uri to be specified
')
+ '
Specifies that the debugging tool is enabled for the cluster,'
+ ' which allows you to browse log files using the Amazon EMR console.'
+ ' Turning debugging on requires that you specify --log-uri'
+ ' because log files must be stored in Amazon S3 so that'
+ ' Amazon EMR can index them for viewing in the console.
')
TAGS = (
- '
A list of tags to associate with a cluster and propagate to'
- ' each Amazon EC2 instance in the cluster. '
- 'They are user-defined key/value pairs that'
- ' consist of a required key string with a maximum of 128 characters'
- ' and an optional value string with a maximum of 256 characters.
'
- '
You can specify tags in key=value format or to add a'
- ' tag without value just write key name, key.
'
- '
Syntax:
Multiple tags separated by a space.
'
- '
--tags key1=value1 key2=value2
')
+ '
A list of tags to associate with a cluster, which apply to'
+ ' each Amazon EC2 instance in the cluster. Tags are key-value pairs that'
+ ' consist of a required key string'
+ ' with a maximum of 128 characters, and an optional value string'
+ ' with a maximum of 256 characters.
'
+ '
You can specify tags in key=value format or you can add a'
+ ' tag without a value using only the key name, for example key.'
+ ' Use a space to separate multiple tags.
')
BOOTSTRAP_ACTIONS = (
- '
Specifies a list of bootstrap actions to run when creating a'
- ' cluster. You can use bootstrap actions to install additional software'
- ' and to change the configuration of applications on the cluster.'
- ' Bootstrap actions are scripts that are run on the cluster nodes when'
- ' Amazon EMR launches the cluster. They run before Hadoop starts and'
- ' before the node begins processing data.
'
- '
Each bootstrap action takes the following parameters: '
- 'Path, [Name] and [Args]. '
- 'Note: Args should either be a comma-separated list of values '
- '(e.g. Args=arg1,arg2,arg3) or a bracket-enclosed list of values '
- 'and/or key-value pairs (e.g. Args=[arg1,arg2=arg3,arg4]).
')
+ '
Specifies a list of bootstrap actions to run on each EC2 instance when'
+ ' a cluster is created. Bootstrap actions run on each instance'
+ ' immediately after Amazon EMR provisions the EC2 instance and'
+ ' before Amazon EMR installs specified applications.
'
+ '
You can specify a bootstrap action as an inline JSON structure'
+ ' enclosed in single quotation marks, or you can use a shorthand'
+ ' syntax, specifying multiple bootstrap actions, each separated'
+ ' by a space. When using the shorthand syntax, each bootstrap'
+ ' action takes the following parameters, separated by'
+ ' commas with no trailing space. Optional parameters'
+ ' are shown in [square brackets].
'
+ '
Path - The path and file name of the script'
+ ' to run, which must be accessible to each instance in the cluster.'
+ ' For example, Path=s3://mybucket/myscript.sh.
'
+ '
[Name] - A friendly name to help you identify'
+ ' the bootstrap action. For example, Name=BootstrapAction1
'
+ '
[Args] - A comma-separated list of arguments'
+ ' to pass to the bootstrap action script. Arguments can be'
+ ' either a list of values (Args=arg1,arg2,arg3)'
+ ' or a list of key-value pairs, as well as optional values,'
+ ' enclosed in square brackets (Args=[arg1,arg2=arg2value,arg3])
.')
APPLICATIONS = (
- '
Installs applications such as Hadoop, Spark, Hue, Hive, Pig, HBase,'
- ' Ganglia and Impala or the MapR distribution when creating a cluster.'
- ' Available applications vary by EMR release, and the set of components'
- ' installed when specifying an Application Name can be found in the Amazon'
- ' EMR Developer\'s Guide. Note: If you are using an AMI version instead of'
- ' an EMR release, some applications take optional Args for configuration.'
- ' Args should either be a comma-separated list of values'
- ' (e.g. Args=arg1,arg2,arg3) or a bracket-enclosed list of values'
- ' and/or key-value pairs (e.g. Args=[arg1,arg2=arg3,arg4]).
')
+ '
Specifies the applications to install on the cluster.'
+ ' Available applications and their respective versions vary'
+ ' by Amazon EMR release. For more information, see the'
+ ' Amazon EMR Release Guide:
When using versions of Amazon EMR earlier than 4.0,'
+ ' some applications take optional arguments for configuration.'
+ ' Arguments should either be a comma-separated list of values'
+ ' (Args=arg1,arg2,arg3) or a bracket-enclosed list of values'
+ ' and key-value pairs (Args=[arg1,arg2=arg3,arg4]).
')
EMR_FS = (
- '
Configures certain features in EMRFS like consistent'
- ' view, Amazon S3 client-side and server-side encryption.
'
- '
Encryption - enables Amazon S3 server-side encryption or'
- ' Amazon S3 client-side encryption and takes the mutually exclusive'
- ' values, ServerSide or ClientSide.
'
- '
ProviderType - the encryption ProviderType, which is either Custom'
- ' or KMS
'
- '
KMSKeyId - the AWS KMS KeyId, the alias'
- ' you mapped to the KeyId, or the full ARN of the key that'
- ' includes the region, account ID, and the KeyId.
'
- '
CustomProviderLocation - the S3 URI of'
- ' the custom EncryptionMaterialsProvider class.
'
- '
CustomProviderClass - the name of the'
- ' custom EncryptionMaterialsProvider class you are using.
'
- '
Consistent - setting to true enables consistent view.
'
- '
RetryCount - the number of times EMRFS consistent view will check'
- ' for list consistency before returning an error.
'
- '
RetryPeriod - the interval at which EMRFS consistent view will'
- ' recheck for consistency of objects it tracks.
'
- '
SSE - deprecated in favor of Encryption=ServerSide
'
- '
Args - optional arguments you can supply in configuring EMRFS.
')
+ '
Specifies EMRFS configuration options, such as consistent view'
+ ' and Amazon S3 encryption parameters.
'
+ '
When you use Amazon EMR release version 4.8.0 or later, we recommend'
+ ' that you use the --configurations option together'
+ ' with the emrfs-site configuration classification'
+ ' to configure EMRFS, and use security configurations'
+ ' to configure encryption for EMRFS data in Amazon S3 instead.'
+ ' For more information, see the following topic in the Amazon EMR Management Guide:
Launches a new HBase cluster and populates it with'
- ' data from a previous backup of an HBase cluster. You must install HBase'
- ' using the --applications option.'
- ' Note: this is only supported by AMI versions (3.x and 2.x).
')
-
+ '
Applies only when using Amazon EMR release versions earlier than 4.0.'
+ ' Launches a new HBase cluster and populates it with'
+ ' data from a previous backup of an HBase cluster. HBase'
+ ' must be installed using the --applications option.
')
STEPS = (
- '
A list of steps to be executed by the cluster. A step can be'
- ' specified either using the shorthand syntax, JSON file or as a JSON'
- ' string. Note: [Args] supplied with steps should either be a'
- ' comma-separated list of values (e.g. Args=arg1,arg2,arg3) or'
- ' a bracket-enclosed list of values and/or key-value pairs'
- ' (e.g. Args=[arg1,arg2=arg3,arg4]).
')
+ '
Specifies a list of steps to be executed by the cluster. Steps run'
+ ' only on the master node after applications are installed'
+ ' and are used to submit work to a cluster. A step can be'
+ ' specified using the shorthand syntax, by referencing a JSON file'
+ ' or by specifying an inline JSON structure. Args supplied with steps'
+ ' should be a comma-separated list of values (Args=arg1,arg2,arg3) or'
+ ' a bracket-enclosed list of values and key-value'
+ ' pairs (Args=[arg1,arg2=value,arg4).
')
INSTALL_APPLICATIONS = (
'
The applications to be installed.'
' Takes the following parameters: '
- 'Name and Args.')
+ 'Name and Args.
')
+
+EBS_ROOT_VOLUME_SIZE = (
+ '
Applies only to Amazon EMR release version 4.0 and earlier. Specifies the size,'
+ ' in GiB, of the EBS root device volume of the Amazon Linux AMI'
+ ' that is used for each EC2 instance in the cluster.
')
+
+SECURITY_CONFIG = (
+ '
Specifies the name of a security configuration to use for the cluster.'
+ ' A security configuration defines data encryption settings and'
+ ' other security options. For more information, see'
+ ' the following topic in the Amazon EMR Management Guide:
Use list-security-configurations to get a list of available'
+ ' security configurations in the active account.
')
+
+CUSTOM_AMI_ID = (
+ '
Applies only to Amazon EMR release version 5.7.0 and later.'
+ ' Specifies the AMI ID of a custom AMI to use'
+ ' when Amazon EMR provisions EC2 instances. A custom'
+ ' AMI can be used to encrypt the Amazon EBS root volume. It'
+ ' can also be used instead of bootstrap actions to customize'
+ ' cluster node configurations. For more information, see'
+ ' the following topic in the Amazon EMR Management Guide:
Applies only when a --custom-ami-id is'
+ ' specified. On first boot, by default, Amazon Linux AMIs'
+ ' connect to package repositories to install security updates'
+ ' before other services start. You can set this parameter'
+ ' using --rep-upgrade-on-boot NONE to'
+ ' disable these updates. CAUTION: This creates additional'
+ ' security risks.
')
+
+KERBEROS_ATTRIBUTES = (
+ '
Specifies required cluster attributes for Kerberos when Kerberos authentication'
+ ' is enabled in the specified --security-configuration.'
+ ' Takes the following arguments:
'
+ '
Realm - Specifies the name of the Kerberos'
+ ' realm to which all nodes in a cluster belong. For example,'
+ ' Realm=EC2.INTERNAL.
'
+ '
KdcAdminPassword - Specifies the password used within the cluster'
+ ' for the kadmin service, which maintains Kerberos principals, password'
+ ' policies, and keytabs for the cluster.
'
+ '
CrossRealmTrustPrincipalPassword - Required when establishing a cross-realm trust'
+ ' with a KDC in a different realm. This is the cross-realm principal password,'
+ ' which must be identical across realms.
'
+ '
ADDomainJoinUser - Required when establishing trust with an Active Directory'
+ ' domain. This is the User logon name of an AD account with sufficient privileges to join resouces to the domain.
'
+ '
ADDomainJoinPassword - The AD password for ADDomainJoinUser.
')
+
+# end create-cluster options help descriptions
LIST_CLUSTERS_CLUSTER_STATES = (
- '
The cluster state filters to apply when listing clusters.
'
- '
Syntax:'
- '"string" "string" ...
'
- '
Where valid values are:
'
- '
STARTING
'
- '
BOOTSTRAPPING
'
- '
RUNNING
'
- '
WAITING
'
- '
TERMINATING
'
- '
TERMINATED
'
- '
TERMINATED_WITH_ERRORS
')
+ '
Specifies that only clusters in the states specified are'
+ ' listed. Alternatively, you can use the shorthand'
+ ' form for single states or a group of states.
'
+ '
Takes the following state values:
'
+ '
STARTING
'
+ '
BOOTSTRAPPING
'
+ '
RUNNING
'
+ '
WAITING
'
+ '
TERMINATING
'
+ '
TERMINATED
'
+ '
TERMINATED_WITH_ERRORS
')
LIST_CLUSTERS_STATE_FILTERS = (
- '
Shortcut option for --cluster-states.
'
- '
--active filters clusters in \'STARTING\','
- '\'BOOTSTRAPPING\',\'RUNNING\','
- '\'WAITING\', or \'TERMINATING\' states.
'
- '
--terminated filters clusters in \'TERMINATED\' state.
'
- '
--failed filters clusters in \'TERMINATED_WITH_ERRORS\' state.
')
+ '
Shortcut options for --cluster-states. The'
+ ' following shortcut options can be specified:
'
+ '
--active - list only clusters that'
+ ' are STARTING,BOOTSTRAPPING,'
+ ' RUNNING, WAITING, or TERMINATING.
'
+ '
--terminated - list only clusters that are TERMINATED.
'
+ '
--failed - list only clusters that are TERMINATED_WITH_ERRORS.
')
LIST_CLUSTERS_CREATED_AFTER = (
- '
The creation date and time beginning value filter for '
- 'listing clusters. For example, 2014-07-15T00:01:30.
')
+ '
List only those clusters created after the date and time'
+ ' specified in the format yyyy-mm-ddThh:mm:ss. For example,'
+ ' --created-after 2017-07-04T00:01:30.
')
LIST_CLUSTERS_CREATED_BEFORE = (
- '
The creation date and time end value filter for '
- 'listing clusters. For example, 2014-07-15T00:01:30.
')
+ '
List only those clusters created after the date and time'
+ ' specified in the format yyyy-mm-ddThh:mm:ss. For example,'
+ ' --created-after 2017-07-04T00:01:30.
')
EMR_MANAGED_MASTER_SECURITY_GROUP = (
'
The identifier of the Amazon EC2 security group '
@@ -315,8 +427,7 @@
SERVICE_ACCESS_SECURITY_GROUP = (
'
The identifier of the Amazon EC2 security group '
- 'for the Amazon EMR service to access '
- 'clusters in VPC private subnets.
')
+ 'for Amazon EMR to access clusters in VPC private subnets.')
ADDITIONAL_MASTER_SECURITY_GROUPS = (
'
A list of additional Amazon EC2 security group IDs for '
@@ -327,17 +438,20 @@
'the slave nodes.
')
AVAILABLE_ONLY_FOR_AMI_VERSIONS = (
- 'This command is only available for AMI Versions (3.x and 2.x).')
+ 'This command is only available when using Amazon EMR versions'
+ 'earlier than 4.0.')
-CREATE_CLUSTER_DESCRIPTION = (
- 'Creates an Amazon EMR cluster with specified software.\n'
- '\nQuick start:\n\naws emr create-cluster --release-label '
- ' --instance-type [--instance-count ]\n\n'
- 'Values for variables Instance Profile (under EC2 Attributes),'
- ' Service Role, Log URI, and Key Name (under EC2 Attributes) can be set in'
- ' the AWS CLI config file using the "aws configure set" command.\n')
+STEP_CONCURRENCY_LEVEL = (
+ 'This command specifies the step concurrency level of the cluster.'
+ 'Default is 1 which is non-concurrent.'
+)
-SECURITY_CONFIG = (
- '
The name of a security configuration in the AWS account. '
- 'Use list-security-configurations to get a list of available '
- 'security configurations.
')
\ No newline at end of file
+MANAGED_SCALING_POLICY = (
+ '
Managed scaling policy for an Amazon EMR cluster. The policy '
+ 'specifies the limits for resources that can be added or terminated '
+ 'from a cluster. You can specify the ComputeLimits which include '
+ 'the MaximumCapacityUnits, MinimumCapacityUnits, '
+ 'MaximumOnDemandCapacityUnits and UnitType. For an '
+ 'InstanceFleet cluster, the UnitType must be InstanceFleetUnits. For '
+ 'InstanceGroup clusters, the UnitType can be either VCPU or Instances.
'
+)
diff -Nru awscli-1.11.13/awscli/customizations/emr/instancefleetsutils.py awscli-1.18.69/awscli/customizations/emr/instancefleetsutils.py
--- awscli-1.11.13/awscli/customizations/emr/instancefleetsutils.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/instancefleetsutils.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,57 @@
+# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+from awscli.customizations.emr import constants
+from awscli.customizations.emr import exceptions
+
+
+def validate_and_build_instance_fleets(parsed_instance_fleets):
+ """
+ Helper method that converts --instance-fleets option value in
+ create-cluster to Amazon Elastic MapReduce InstanceFleetConfig
+ data type.
+ """
+ instance_fleets = []
+ for instance_fleet in parsed_instance_fleets:
+ instance_fleet_config = {}
+
+ keys = instance_fleet.keys()
+
+ if 'Name' in keys:
+ instance_fleet_config['Name'] = instance_fleet['Name']
+ else:
+ instance_fleet_config['Name'] = instance_fleet['InstanceFleetType']
+ instance_fleet_config['InstanceFleetType'] = instance_fleet['InstanceFleetType']
+
+ if 'TargetOnDemandCapacity' in keys:
+ instance_fleet_config['TargetOnDemandCapacity'] = instance_fleet['TargetOnDemandCapacity']
+
+ if 'TargetSpotCapacity' in keys:
+ instance_fleet_config['TargetSpotCapacity'] = instance_fleet['TargetSpotCapacity']
+
+ if 'InstanceTypeConfigs' in keys:
+ if 'TargetSpotCapacity' in keys:
+ for instance_type_config in instance_fleet['InstanceTypeConfigs']:
+ instance_type_config_keys = instance_type_config.keys()
+ instance_fleet_config['InstanceTypeConfigs'] = instance_fleet['InstanceTypeConfigs']
+
+ if 'LaunchSpecifications' in keys:
+ instanceFleetProvisioningSpecifications = instance_fleet['LaunchSpecifications']
+ instance_fleet_config['LaunchSpecifications'] = {}
+
+ if 'SpotSpecification' in instanceFleetProvisioningSpecifications:
+ instance_fleet_config['LaunchSpecifications']['SpotSpecification'] = \
+ instanceFleetProvisioningSpecifications['SpotSpecification']
+
+ instance_fleets.append(instance_fleet_config)
+ return instance_fleets
diff -Nru awscli-1.11.13/awscli/customizations/emr/instancegroupsutils.py awscli-1.18.69/awscli/customizations/emr/instancegroupsutils.py
--- awscli-1.11.13/awscli/customizations/emr/instancegroupsutils.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/emr/instancegroupsutils.py 2020-05-28 19:25:48.000000000 +0000
@@ -35,12 +35,20 @@
ig_config['InstanceRole'] = instance_group['InstanceGroupType'].upper()
if 'BidPrice' in keys:
- ig_config['BidPrice'] = instance_group['BidPrice']
+ if instance_group['BidPrice'] != 'OnDemandPrice':
+ ig_config['BidPrice'] = instance_group['BidPrice']
ig_config['Market'] = constants.SPOT
else:
ig_config['Market'] = constants.ON_DEMAND
if 'EbsConfiguration' in keys:
ig_config['EbsConfiguration'] = instance_group['EbsConfiguration']
+
+ if 'AutoScalingPolicy' in keys:
+ ig_config['AutoScalingPolicy'] = instance_group['AutoScalingPolicy']
+
+ if 'Configurations' in keys:
+ ig_config['Configurations'] = instance_group['Configurations']
+
instance_groups.append(ig_config)
return instance_groups
diff -Nru awscli-1.11.13/awscli/customizations/generatecliskeleton.py awscli-1.18.69/awscli/customizations/generatecliskeleton.py
--- awscli-1.11.13/awscli/customizations/generatecliskeleton.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/generatecliskeleton.py 2020-05-28 19:25:48.000000000 +0000
@@ -13,9 +13,13 @@
import json
import sys
+from botocore import xform_name
+from botocore.stub import Stubber
from botocore.utils import ArgumentGenerator
+from awscli.clidriver import CLIOperationCaller
from awscli.customizations.arguments import OverrideRequiredArgsArgument
+from awscli.utils import json_encoder
def register_generate_cli_skeleton(cli):
@@ -36,18 +40,21 @@
The argument, if present in the command line, will prevent the intended
command from taking place. Instead, it will generate a JSON skeleton and
- print it to standard output. This JSON skeleton then can be filled out
- and can be used as input to ``--input-cli-json`` in order to run the
- command with the filled out JSON skeleton.
+ print it to standard output.
"""
ARG_DATA = {
'name': 'generate-cli-skeleton',
- 'help_text': 'Prints a sample input JSON to standard output. Note the '
- 'specified operation is not run if this argument is '
- 'specified. The sample input can be used as an argument '
- 'for ``--cli-input-json``.',
- 'action': 'store_true',
- 'group_name': 'generate_cli_skeleton'
+ 'help_text': (
+ 'Prints a JSON skeleton to standard output without sending '
+ 'an API request. If provided with no value or the value '
+ '``input``, prints a sample input JSON that can be used as an '
+ 'argument for ``--cli-input-json``. If provided with the value '
+ '``output``, it validates the command inputs and returns a '
+ 'sample output JSON for that command.'
+ ),
+ 'nargs': '?',
+ 'const': 'input',
+ 'choices': ['input', 'output'],
}
def __init__(self, session, operation_model):
@@ -59,29 +66,70 @@
'calling-command.*', self.generate_json_skeleton)
super(GenerateCliSkeletonArgument, self)._register_argument_action()
+ def override_required_args(self, argument_table, args, **kwargs):
+ arg_name = '--' + self.name
+ if arg_name in args:
+ arg_location = args.index(arg_name)
+ try:
+ # If the value of --generate-cli-skeleton is ``output``,
+ # do not force required arguments to be optional as
+ # ``--generate-cli-skeleton output`` validates commands
+ # as well as print out the sample output.
+ if args[arg_location + 1] == 'output':
+ return
+ except IndexError:
+ pass
+ super(GenerateCliSkeletonArgument, self).override_required_args(
+ argument_table, args, **kwargs)
+
def generate_json_skeleton(self, call_parameters, parsed_args,
parsed_globals, **kwargs):
-
- # Only perform the method if the ``--generate-cli-skeleton`` was
- # included in the command line.
- if getattr(parsed_args, 'generate_cli_skeleton', False):
-
- # Obtain the model of the operation
+ if getattr(parsed_args, 'generate_cli_skeleton', None):
+ for_output = parsed_args.generate_cli_skeleton == 'output'
operation_model = self._operation_model
- # Generate the skeleton based on the ``input_shape``.
- argument_generator = ArgumentGenerator()
- operation_input_shape = operation_model.input_shape
- # If the ``input_shape`` is ``None``, generate an empty
- # dictionary.
- if operation_input_shape is None:
- skeleton = {}
+ if for_output:
+ service_name = operation_model.service_model.service_name
+ operation_name = operation_model.name
+ # TODO: It would be better to abstract this logic into
+ # classes for both the input and output option such that
+ # a similar set of inputs are taken in and output
+ # similar functionality.
+ return StubbedCLIOperationCaller(self._session).invoke(
+ service_name, operation_name, call_parameters,
+ parsed_globals)
else:
- skeleton = argument_generator.generate_skeleton(
- operation_input_shape)
+ argument_generator = ArgumentGenerator()
+ operation_input_shape = operation_model.input_shape
+ if operation_input_shape is None:
+ skeleton = {}
+ else:
+ skeleton = argument_generator.generate_skeleton(
+ operation_input_shape)
+
+ sys.stdout.write(
+ json.dumps(skeleton, indent=4, default=json_encoder)
+ )
+ sys.stdout.write('\n')
+ return 0
- # Write the generated skeleton to standard output.
- sys.stdout.write(json.dumps(skeleton, indent=4))
- sys.stdout.write('\n')
- # This is the return code
- return 0
+
+class StubbedCLIOperationCaller(CLIOperationCaller):
+ """A stubbed CLIOperationCaller
+
+ It generates a fake response and uses the response and provided parameters
+ to make a stubbed client call for an operation command.
+ """
+ def _make_client_call(self, client, operation_name, parameters,
+ parsed_globals):
+ method_name = xform_name(operation_name)
+ operation_model = client.meta.service_model.operation_model(
+ operation_name)
+ fake_response = {}
+ if operation_model.output_shape:
+ argument_generator = ArgumentGenerator(use_member_names=True)
+ fake_response = argument_generator.generate_skeleton(
+ operation_model.output_shape)
+ with Stubber(client) as stubber:
+ stubber.add_response(method_name, fake_response)
+ return getattr(client, method_name)(**parameters)
diff -Nru awscli-1.11.13/awscli/customizations/globalargs.py awscli-1.18.69/awscli/customizations/globalargs.py
--- awscli-1.11.13/awscli/customizations/globalargs.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/globalargs.py 2020-05-28 19:25:48.000000000 +0000
@@ -22,11 +22,16 @@
def register_parse_global_args(cli):
- cli.register('top-level-args-parsed', resolve_types)
- cli.register('top-level-args-parsed', no_sign_request)
- cli.register('top-level-args-parsed', resolve_verify_ssl)
- cli.register('top-level-args-parsed', resolve_cli_read_timeout)
- cli.register('top-level-args-parsed', resolve_cli_connect_timeout)
+ cli.register('top-level-args-parsed', resolve_types,
+ unique_id='resolve-types')
+ cli.register('top-level-args-parsed', no_sign_request,
+ unique_id='no-sign')
+ cli.register('top-level-args-parsed', resolve_verify_ssl,
+ unique_id='resolve-verify-ssl')
+ cli.register('top-level-args-parsed', resolve_cli_read_timeout,
+ unique_id='resolve-cli-read-timeout')
+ cli.register('top-level-args-parsed', resolve_cli_connect_timeout,
+ unique_id='resolve-cli-connect-timeout')
def resolve_types(parsed_args, **kwargs):
@@ -80,7 +85,8 @@
if not parsed_args.sign_request:
# In order to make signing disabled for all requests
# we need to use botocore's ``disable_signing()`` handler.
- session.register('choose-signer', disable_signing)
+ session.register(
+ 'choose-signer', disable_signing, unique_id='disable-signing')
def resolve_cli_connect_timeout(parsed_args, session, **kwargs):
diff -Nru awscli-1.11.13/awscli/customizations/history/commands.py awscli-1.18.69/awscli/customizations/history/commands.py
--- awscli-1.11.13/awscli/customizations/history/commands.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/history/commands.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,63 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import os
+
+from awscli.compat import is_windows
+from awscli.utils import is_a_tty
+from awscli.utils import OutputStreamFactory
+
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.history.db import DatabaseConnection
+from awscli.customizations.history.constants import HISTORY_FILENAME_ENV_VAR
+from awscli.customizations.history.constants import DEFAULT_HISTORY_FILENAME
+from awscli.customizations.history.db import DatabaseRecordReader
+
+
+class HistorySubcommand(BasicCommand):
+ def __init__(self, session, db_reader=None, output_stream_factory=None):
+ super(HistorySubcommand, self).__init__(session)
+ self._db_reader = db_reader
+ self._output_stream_factory = output_stream_factory
+ if output_stream_factory is None:
+ self._output_stream_factory = OutputStreamFactory()
+
+ def _connect_to_history_db(self):
+ if self._db_reader is None:
+ connection = DatabaseConnection(self._get_history_db_filename())
+ self._db_reader = DatabaseRecordReader(connection)
+
+ def _close_history_db(self):
+ self._db_reader.close()
+
+ def _get_history_db_filename(self):
+ filename = os.environ.get(
+ HISTORY_FILENAME_ENV_VAR, DEFAULT_HISTORY_FILENAME)
+ if not os.path.exists(filename):
+ raise RuntimeError(
+ 'Could not locate history. Make sure cli_history is set to '
+ 'enabled in the ~/.aws/config file'
+ )
+ return filename
+
+ def _should_use_color(self, parsed_globals):
+ if parsed_globals.color == 'on':
+ return True
+ elif parsed_globals.color == 'off':
+ return False
+ return is_a_tty() and not is_windows
+
+ def _get_output_stream(self, preferred_pager=None):
+ if is_a_tty():
+ return self._output_stream_factory.get_pager_stream(
+ preferred_pager)
+ return self._output_stream_factory.get_stdout_stream()
diff -Nru awscli-1.11.13/awscli/customizations/history/constants.py awscli-1.18.69/awscli/customizations/history/constants.py
--- awscli-1.11.13/awscli/customizations/history/constants.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/history/constants.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import os
+
+
+HISTORY_FILENAME_ENV_VAR = 'AWS_CLI_HISTORY_FILE'
+DEFAULT_HISTORY_FILENAME = os.path.expanduser(
+ os.path.join('~', '.aws', 'cli', 'history', 'history.db'))
diff -Nru awscli-1.11.13/awscli/customizations/history/db.py awscli-1.18.69/awscli/customizations/history/db.py
--- awscli-1.11.13/awscli/customizations/history/db.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/history/db.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,272 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import uuid
+import time
+import json
+import datetime
+import threading
+import logging
+from awscli.compat import collections_abc
+
+from botocore.history import BaseHistoryHandler
+
+from awscli.compat import sqlite3
+from awscli.compat import binary_type
+
+
+LOG = logging.getLogger(__name__)
+
+
+class DatabaseConnection(object):
+ _CREATE_TABLE = """
+ CREATE TABLE IF NOT EXISTS records (
+ id TEXT,
+ request_id TEXT,
+ source TEXT,
+ event_type TEXT,
+ timestamp INTEGER,
+ payload TEXT
+ )"""
+ _ENABLE_WAL = 'PRAGMA journal_mode=WAL'
+
+ def __init__(self, db_filename):
+ self._connection = sqlite3.connect(
+ db_filename, check_same_thread=False, isolation_level=None)
+ self._ensure_database_setup()
+
+ def close(self):
+ self._connection.close()
+
+ def execute(self, query, *parameters):
+ return self._connection.execute(query, *parameters)
+
+ def _ensure_database_setup(self):
+ self._create_record_table()
+ self._try_to_enable_wal()
+
+ def _create_record_table(self):
+ self.execute(self._CREATE_TABLE)
+
+ def _try_to_enable_wal(self):
+ try:
+ self.execute(self._ENABLE_WAL)
+ except sqlite3.Error:
+ # This is just a performance enhancement so it is optional. Not all
+ # systems will have a sqlite compiled with the WAL enabled.
+ LOG.debug('Failed to enable sqlite WAL.')
+
+ @property
+ def row_factory(self):
+ return self._connection.row_factory
+
+ @row_factory.setter
+ def row_factory(self, row_factory):
+ self._connection.row_factory = row_factory
+
+
+class PayloadSerializer(json.JSONEncoder):
+ def _encode_mutable_mapping(self, obj):
+ return dict(obj)
+
+ def _encode_datetime(self, obj):
+ return obj.isoformat()
+
+ def _try_decode_bytes(self, obj):
+ try:
+ obj = obj.decode('utf-8')
+ except UnicodeDecodeError:
+ obj = ''
+ return obj
+
+ def _remove_non_unicode_stings(self, obj):
+ if isinstance(obj, str):
+ obj = self._try_decode_bytes(obj)
+ elif isinstance(obj, dict):
+ obj = dict((k, self._remove_non_unicode_stings(v)) for k, v
+ in obj.items())
+ elif isinstance(obj, (list, tuple)):
+ obj = [self._remove_non_unicode_stings(o) for o in obj]
+ return obj
+
+ def encode(self, obj):
+ try:
+ return super(PayloadSerializer, self).encode(obj)
+ except UnicodeDecodeError:
+ # This happens in PY2 in the case where a record payload has some
+ # binary data in it that is not utf-8 encodable. PY2 will not call
+ # the default method on the individual field with bytes in it since
+ # it thinks it can handle it with the normal string serialization
+ # method. Since it cannot tell the difference between a utf-8 str
+ # and a str with raw bytes in it we will get a UnicodeDecodeError
+ # here at the top level. There are no hooks into the serialization
+ # process in PY2 that allow us to fix this behavior, so instead
+ # when we encounter the unicode error we climb the structure
+ # ourselves and replace all strings that are not utf-8 decodable
+ # and try to encode again.
+ scrubbed_obj = self._remove_non_unicode_stings(obj)
+ return super(PayloadSerializer, self).encode(scrubbed_obj)
+
+ def default(self, obj):
+ if isinstance(obj, datetime.datetime):
+ return self._encode_datetime(obj)
+ elif isinstance(obj, collections_abc.MutableMapping):
+ return self._encode_mutable_mapping(obj)
+ elif isinstance(obj, binary_type):
+ # In PY3 the bytes type differs from the str type so the default
+ # method will be called when a bytes object is encountered.
+ # We call the same _try_decode_bytes method that either decodes it
+ # to a utf-8 string and continues serialization, or removes the
+ # value if it is not valid utf-8 string.
+ return self._try_decode_bytes(obj)
+ else:
+ return repr(obj)
+
+
+class DatabaseRecordWriter(object):
+ _WRITE_RECORD = """
+ INSERT INTO records(
+ id, request_id, source, event_type, timestamp, payload)
+ VALUES (?,?,?,?,?,?) """
+
+ def __init__(self, connection):
+ self._connection = connection
+ self._lock = threading.Lock()
+
+ def close(self):
+ self._connection.close()
+
+ def write_record(self, record):
+ db_record = self._create_db_record(record)
+ with self._lock:
+ self._connection.execute(self._WRITE_RECORD, db_record)
+
+ def _create_db_record(self, record):
+ event_type = record['event_type']
+ json_serialized_payload = json.dumps(record['payload'],
+ cls=PayloadSerializer)
+ db_record = (
+ record['command_id'],
+ record.get('request_id'),
+ record['source'],
+ event_type,
+ record['timestamp'],
+ json_serialized_payload
+ )
+ return db_record
+
+
+class DatabaseRecordReader(object):
+ _ORDERING = 'ORDER BY timestamp'
+ _GET_LAST_ID_RECORDS = """
+ SELECT * FROM records
+ WHERE id =
+ (SELECT id FROM records WHERE timestamp =
+ (SELECT max(timestamp) FROM records)) %s;""" % _ORDERING
+ _GET_RECORDS_BY_ID = 'SELECT * from records where id = ? %s' % _ORDERING
+ _GET_ALL_RECORDS = (
+ 'SELECT a.id AS id_a, '
+ ' b.id AS id_b, '
+ ' a.timestamp as timestamp, '
+ ' a.payload AS args, '
+ ' b.payload AS rc '
+ 'FROM records a, records b '
+ 'where a.event_type == "CLI_ARGUMENTS" AND '
+ ' b.event_type = "CLI_RC" AND '
+ ' id_a == id_b '
+ '%s DESC' % _ORDERING
+ )
+
+ def __init__(self, connection):
+ self._connection = connection
+ self._connection.row_factory = self._row_factory
+
+ def close(self):
+ self._connection.close()
+
+ def _row_factory(self, cursor, row):
+ d = {}
+ for idx, col in enumerate(cursor.description):
+ val = row[idx]
+ if col[0] == 'payload':
+ val = json.loads(val)
+ d[col[0]] = val
+ return d
+
+ def iter_latest_records(self):
+ cursor = self._connection.execute(self._GET_LAST_ID_RECORDS)
+ for row in cursor:
+ yield row
+
+ def iter_records(self, record_id):
+ cursor = self._connection.execute(self._GET_RECORDS_BY_ID, [record_id])
+ for row in cursor:
+ yield row
+
+ def iter_all_records(self):
+ cursor = self._connection.execute(self._GET_ALL_RECORDS)
+ for row in cursor:
+ yield row
+
+
+class RecordBuilder(object):
+ _REQUEST_LIFECYCLE_EVENTS = set(
+ ['API_CALL', 'HTTP_REQUEST', 'HTTP_RESPONSE', 'PARSED_RESPONSE'])
+ _START_OF_REQUEST_LIFECYCLE_EVENT = 'API_CALL'
+
+ def __init__(self):
+ self._identifier = None
+ self._locals = threading.local()
+
+ def _get_current_thread_request_id(self):
+ request_id = getattr(self._locals, 'request_id', None)
+ return request_id
+
+ def _start_http_lifecycle(self):
+ setattr(self._locals, 'request_id', str(uuid.uuid4()))
+
+ def _get_request_id(self, event_type):
+ if event_type == self._START_OF_REQUEST_LIFECYCLE_EVENT:
+ self._start_http_lifecycle()
+ if event_type in self._REQUEST_LIFECYCLE_EVENTS:
+ request_id = self._get_current_thread_request_id()
+ return request_id
+ return None
+
+ def _get_identifier(self):
+ if self._identifier is None:
+ self._identifier = str(uuid.uuid4())
+ return self._identifier
+
+ def build_record(self, event_type, payload, source):
+ uid = self._get_identifier()
+ record = {
+ 'command_id': uid,
+ 'event_type': event_type,
+ 'payload': payload,
+ 'source': source,
+ 'timestamp': int(time.time() * 1000)
+ }
+ request_id = self._get_request_id(event_type)
+ if request_id:
+ record['request_id'] = request_id
+ return record
+
+
+class DatabaseHistoryHandler(BaseHistoryHandler):
+ def __init__(self, writer, record_builder):
+ self._writer = writer
+ self._record_builder = record_builder
+
+ def emit(self, event_type, payload, source):
+ record = self._record_builder.build_record(event_type, payload, source)
+ self._writer.write_record(record)
diff -Nru awscli-1.11.13/awscli/customizations/history/filters.py awscli-1.18.69/awscli/customizations/history/filters.py
--- awscli-1.11.13/awscli/customizations/history/filters.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/history/filters.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+import re
+
+
+class RegexFilter(object):
+ def __init__(self, pattern, replacement):
+ self._pattern = pattern
+ self._replacement = replacement
+ self._regex = None
+
+ def filter_text(self, text):
+ regex = self._get_regex()
+ filtered_text = regex.subn(self._replacement, text)
+ return filtered_text[0]
+
+ def _get_regex(self):
+ if self._regex is None:
+ self._regex = re.compile(self._pattern)
+ return self._regex
diff -Nru awscli-1.11.13/awscli/customizations/history/__init__.py awscli-1.18.69/awscli/customizations/history/__init__.py
--- awscli-1.11.13/awscli/customizations/history/__init__.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/history/__init__.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,107 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import os
+import sys
+import logging
+
+from botocore.history import get_global_history_recorder
+from botocore.exceptions import ProfileNotFound
+
+from awscli.compat import sqlite3
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.history.constants import HISTORY_FILENAME_ENV_VAR
+from awscli.customizations.history.constants import DEFAULT_HISTORY_FILENAME
+from awscli.customizations.history.db import DatabaseConnection
+from awscli.customizations.history.db import DatabaseRecordWriter
+from awscli.customizations.history.db import RecordBuilder
+from awscli.customizations.history.db import DatabaseHistoryHandler
+from awscli.customizations.history.show import ShowCommand
+from awscli.customizations.history.list import ListCommand
+
+
+LOG = logging.getLogger(__name__)
+HISTORY_RECORDER = get_global_history_recorder()
+
+
+def register_history_mode(event_handlers):
+ event_handlers.register(
+ 'session-initialized', attach_history_handler)
+
+
+def register_history_commands(event_handlers):
+ event_handlers.register(
+ "building-command-table.main", add_history_commands)
+
+
+def attach_history_handler(session, parsed_args, **kwargs):
+ if _should_enable_cli_history(session, parsed_args):
+ LOG.debug('Enabling CLI history')
+
+ history_filename = os.environ.get(
+ HISTORY_FILENAME_ENV_VAR, DEFAULT_HISTORY_FILENAME)
+ if not os.path.isdir(os.path.dirname(history_filename)):
+ os.makedirs(os.path.dirname(history_filename))
+
+ connection = DatabaseConnection(history_filename)
+ writer = DatabaseRecordWriter(connection)
+ record_builder = RecordBuilder()
+ db_handler = DatabaseHistoryHandler(writer, record_builder)
+
+ HISTORY_RECORDER.add_handler(db_handler)
+ HISTORY_RECORDER.enable()
+
+
+def _should_enable_cli_history(session, parsed_args):
+ if parsed_args.command == 'history':
+ return False
+ try:
+ scoped_config = session.get_scoped_config()
+ except ProfileNotFound:
+ # If the profile does not exist, cli history is definitely not
+ # enabled, but don't let the error get propogated as commands down
+ # the road may handle this such as the configure set command with
+ # a --profile flag set.
+ return False
+ has_history_enabled = scoped_config.get('cli_history') == 'enabled'
+ if has_history_enabled and sqlite3 is None:
+ if has_history_enabled:
+ sys.stderr.write(
+ 'cli_history is enabled but sqlite3 is unavailable. '
+ 'Unable to collect CLI history.\n'
+ )
+ return False
+ return has_history_enabled
+
+
+def add_history_commands(command_table, session, **kwargs):
+ command_table['history'] = HistoryCommand(session)
+
+
+class HistoryCommand(BasicCommand):
+ NAME = 'history'
+ DESCRIPTION = (
+ 'Commands to interact with the history of AWS CLI commands ran '
+ 'over time. To record the history of AWS CLI commands set '
+ '``cli_history`` to ``enabled`` in the ``~/.aws/config`` file. '
+ 'This can be done by running:\n\n'
+ '``$ aws configure set cli_history enabled``'
+ )
+ SUBCOMMANDS = [
+ {'name': 'show', 'command_class': ShowCommand},
+ {'name': 'list', 'command_class': ListCommand}
+ ]
+
+ def _run_main(self, parsed_args, parsed_globals):
+ if parsed_args.subcommand is None:
+ raise ValueError("usage: aws [options] "
+ "[parameters]\naws: error: too few arguments")
diff -Nru awscli-1.11.13/awscli/customizations/history/list.py awscli-1.18.69/awscli/customizations/history/list.py
--- awscli-1.11.13/awscli/customizations/history/list.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/history/list.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,122 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import json
+import datetime
+
+from awscli.compat import default_pager
+from awscli.customizations.history.commands import HistorySubcommand
+
+
+class ListCommand(HistorySubcommand):
+ NAME = 'list'
+ DESCRIPTION = (
+ 'Shows a list of previously run commands and their command_ids. '
+ 'Each row shows only a bare minimum of details including the '
+ 'command_id, date, arguments and return code. You can use the '
+ '``history show`` with the command_id to see more details about '
+ 'a particular entry.'
+ )
+ _COL_WIDTHS = {
+ 'id_a': 38,
+ 'timestamp': 24,
+ 'args': 50,
+ 'rc': 0
+ }
+
+ def _run_main(self, parsed_args, parsed_globals):
+ self._connect_to_history_db()
+ try:
+ raw_records = self._db_reader.iter_all_records()
+ records = RecordAdapter(raw_records)
+ if not records.has_next():
+ raise RuntimeError(
+ 'No commands were found in your history. Make sure you have '
+ 'enabled history mode by adding "cli_history = enabled" '
+ 'to the config file.')
+
+ preferred_pager = self._get_preferred_pager()
+ with self._get_output_stream(preferred_pager) as output_stream:
+ formatter = TextFormatter(self._COL_WIDTHS, output_stream)
+ formatter(records)
+ finally:
+ self._close_history_db()
+ return 0
+
+ def _get_preferred_pager(self):
+ preferred_pager = default_pager
+ if preferred_pager.startswith('less'):
+ preferred_pager = 'less -SR'
+ return preferred_pager
+
+
+class RecordAdapter(object):
+ """This class is just to read one ahead to make sure there are records
+
+ If there are no records we can just exit early.
+ """
+ def __init__(self, records):
+ self._records = records
+ self._next = None
+ self._advance()
+
+ def has_next(self):
+ return self._next is not None
+
+ def _advance(self):
+ try:
+ self._next = next(self._records)
+ except StopIteration:
+ self._next = None
+
+ def __iter__(self):
+ while self.has_next():
+ yield self._next
+ self._advance()
+
+
+class TextFormatter(object):
+ def __init__(self, col_widths, output_stream):
+ self._col_widths = col_widths
+ self._output_stream = output_stream
+
+ def _format_time(self, timestamp):
+ command_time = datetime.datetime.fromtimestamp(timestamp / 1000)
+ formatted = datetime.datetime.strftime(
+ command_time, '%Y-%m-%d %I:%M:%S %p')
+ return formatted
+
+ def _format_args(self, args, arg_width):
+ json_value = json.loads(args)
+ formatted = ' '.join(json_value[:2])
+ if len(formatted) >= arg_width:
+ formatted = '%s...' % formatted[:arg_width-4]
+ return formatted
+
+ def _format_record(self, record):
+ fmt_string = "{0:<%s}{1:<%s}{2:<%s}{3}\n" % (
+ self._col_widths['id_a'],
+ self._col_widths['timestamp'],
+ self._col_widths['args']
+ )
+ record_line = fmt_string.format(
+ record['id_a'],
+ self._format_time(record['timestamp']),
+ self._format_args(record['args'], self._col_widths['args']),
+ record['rc']
+ )
+ return record_line
+
+ def __call__(self, record_adapter):
+ for record in record_adapter:
+ formatted_record = self._format_record(record)
+ self._output_stream.write(formatted_record.encode('utf-8'))
diff -Nru awscli-1.11.13/awscli/customizations/history/show.py awscli-1.18.69/awscli/customizations/history/show.py
--- awscli-1.11.13/awscli/customizations/history/show.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/history/show.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,411 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import datetime
+import json
+import sys
+import xml.parsers.expat
+import xml.dom.minidom
+
+import colorama
+
+from awscli.table import COLORAMA_KWARGS
+from awscli.compat import six
+from awscli.customizations.history.commands import HistorySubcommand
+from awscli.customizations.history.filters import RegexFilter
+
+
+class Formatter(object):
+ def __init__(self, output=None, include=None, exclude=None):
+ """Formats and outputs CLI history events
+
+ :type output: File-like obj
+ :param output: The stream to write the formatted event to. By default
+ sys.stdout is used.
+
+ :type include: list
+ :param include: A filter specifying which event to only be displayed.
+ This parameter is mutually exclusive with exclude.
+
+ :type exclude: list
+ :param exclude: A filter specifying which events to exclude from being
+ displayed. This parameter is mutually exclusive with include.
+
+ """
+ self._output = output
+ if self._output is None:
+ self._output = sys.stdout
+ if include and exclude:
+ raise ValueError(
+ 'Either input or exclude can be provided but not both')
+ self._include = include
+ self._exclude = exclude
+
+ def display(self, event_record):
+ """Displays a formatted version of the event record
+
+ :type event_record: dict
+ :param event_record: The event record to format and display.
+ """
+ if self._should_display(event_record):
+ self._display(event_record)
+
+ def _display(self, event_record):
+ raise NotImplementedError('_display()')
+
+ def _should_display(self, event_record):
+ if self._include:
+ return event_record['event_type'] in self._include
+ elif self._exclude:
+ return event_record['event_type'] not in self._exclude
+ else:
+ return True
+
+
+class DetailedFormatter(Formatter):
+ _SIG_FILTER = RegexFilter(
+ 'Signature=([a-z0-9]{4})[a-z0-9]{60}',
+ r'Signature=\1...',
+ )
+
+ _SECTIONS = {
+ 'CLI_VERSION': {
+ 'title': 'AWS CLI command entered',
+ 'values': [
+ {'description': 'with AWS CLI version'}
+ ]
+ },
+ 'CLI_ARGUMENTS': {
+ 'values': [
+ {'description': 'with arguments'}
+ ]
+ },
+ 'API_CALL': {
+ 'title': 'API call made',
+ 'values': [
+ {
+ 'description': 'to service',
+ 'payload_key': 'service'
+ },
+ {
+ 'description': 'using operation',
+ 'payload_key': 'operation'
+ },
+ {
+ 'description': 'with parameters',
+ 'payload_key': 'params',
+ 'value_format': 'dictionary'
+ }
+ ]
+ },
+ 'HTTP_REQUEST': {
+ 'title': 'HTTP request sent',
+ 'values': [
+ {
+ 'description': 'to URL',
+ 'payload_key': 'url'
+ },
+ {
+ 'description': 'with method',
+ 'payload_key': 'method'
+ },
+ {
+ 'description': 'with headers',
+ 'payload_key': 'headers',
+ 'value_format': 'dictionary',
+ 'filters': [_SIG_FILTER]
+ },
+ {
+ 'description': 'with body',
+ 'payload_key': 'body',
+ 'value_format': 'http_body'
+ }
+
+ ]
+ },
+ 'HTTP_RESPONSE': {
+ 'title': 'HTTP response received',
+ 'values': [
+ {
+ 'description': 'with status code',
+ 'payload_key': 'status_code'
+ },
+ {
+ 'description': 'with headers',
+ 'payload_key': 'headers',
+ 'value_format': 'dictionary'
+ },
+ {
+ 'description': 'with body',
+ 'payload_key': 'body',
+ 'value_format': 'http_body'
+ }
+ ]
+ },
+ 'PARSED_RESPONSE': {
+ 'title': 'HTTP response parsed',
+ 'values': [
+ {
+ 'description': 'parsed to',
+ 'value_format': 'dictionary'
+ }
+ ]
+ },
+ 'CLI_RC': {
+ 'title': 'AWS CLI command exited',
+ 'values': [
+ {'description': 'with return code'}
+ ]
+ },
+ }
+
+ _COMPONENT_COLORS = {
+ 'title': colorama.Style.BRIGHT,
+ 'description': colorama.Fore.CYAN
+ }
+
+ def __init__(self, output=None, include=None, exclude=None, colorize=True):
+ super(DetailedFormatter, self).__init__(output, include, exclude)
+ self._request_id_to_api_num = {}
+ self._num_api_calls = 0
+ self._colorize = colorize
+ self._value_pformatter = SectionValuePrettyFormatter()
+ if self._colorize:
+ colorama.init(**COLORAMA_KWARGS)
+
+ def _display(self, event_record):
+ section_definition = self._SECTIONS.get(event_record['event_type'])
+ if section_definition is not None:
+ self._display_section(event_record, section_definition)
+
+ def _display_section(self, event_record, section_definition):
+ if 'title' in section_definition:
+ self._display_title(section_definition['title'], event_record)
+ for value_definition in section_definition['values']:
+ self._display_value(value_definition, event_record)
+
+ def _display_title(self, title, event_record):
+ formatted_title = self._format_section_title(title, event_record)
+ self._write_output(formatted_title)
+
+ def _display_value(self, value_definition, event_record):
+ value_description = value_definition['description']
+ event_record_payload = event_record['payload']
+ value = event_record_payload
+ if 'payload_key' in value_definition:
+ value = event_record_payload[value_definition['payload_key']]
+ formatted_value = self._format_description(value_description)
+ formatted_value += self._format_value(
+ value, event_record, value_definition.get('value_format')
+ )
+ if 'filters' in value_definition:
+ for text_filter in value_definition['filters']:
+ formatted_value = text_filter.filter_text(formatted_value)
+ self._write_output(formatted_value)
+
+ def _write_output(self, content):
+ if isinstance(content, six.text_type):
+ content = content.encode('utf-8')
+ self._output.write(content)
+
+ def _format_section_title(self, title, event_record):
+ formatted_title = title
+ api_num = self._get_api_num(event_record)
+ if api_num is not None:
+ formatted_title = ('[%s] ' % api_num) + formatted_title
+ formatted_title = self._color_if_configured(formatted_title, 'title')
+ formatted_title += '\n'
+
+ formatted_timestamp = self._format_description('at time')
+ formatted_timestamp += self._format_value(
+ event_record['timestamp'], event_record, value_format='timestamp')
+
+ return '\n' + formatted_title + formatted_timestamp
+
+ def _get_api_num(self, event_record):
+ request_id = event_record['request_id']
+ if request_id:
+ if request_id not in self._request_id_to_api_num:
+ self._request_id_to_api_num[
+ request_id] = self._num_api_calls
+ self._num_api_calls += 1
+ return self._request_id_to_api_num[request_id]
+
+ def _format_description(self, value_description):
+ return self._color_if_configured(
+ value_description + ': ', 'description')
+
+ def _format_value(self, value, event_record, value_format=None):
+ if value_format:
+ formatted_value = self._value_pformatter.pformat(
+ value, value_format, event_record)
+ else:
+ formatted_value = str(value)
+ return formatted_value + '\n'
+
+ def _color_if_configured(self, text, component):
+ if self._colorize:
+ color = self._COMPONENT_COLORS[component]
+ return color + text + colorama.Style.RESET_ALL
+ return text
+
+
+class SectionValuePrettyFormatter(object):
+ def pformat(self, value, value_format, event_record):
+ return getattr(self, '_pformat_' + value_format)(value, event_record)
+
+ def _pformat_timestamp(self, event_timestamp, event_record=None):
+ return datetime.datetime.fromtimestamp(
+ event_timestamp/1000.0).strftime('%Y-%m-%d %H:%M:%S.%f')[:-3]
+
+ def _pformat_dictionary(self, obj, event_record=None):
+ return json.dumps(obj=obj, sort_keys=True, indent=4)
+
+ def _pformat_http_body(self, body, event_record):
+ if not body:
+ return 'There is no associated body'
+ elif event_record['payload'].get('streaming', False):
+ return 'The body is a stream and will not be displayed'
+ elif self._is_xml(body):
+ # TODO: Figure out a way to minimize the number of times we have
+ # to parse the XML. Currently at worst, it will take three times.
+ # One to determine if it is XML, another to stip whitespace, and
+ # a third to convert to make it pretty. This is an issue as it
+ # can cause issues when there are large XML payloads such as
+ # an s3 ListObjects call.
+ return self._get_pretty_xml(body)
+ elif self._is_json_structure(body):
+ return self._get_pretty_json(body)
+ else:
+ return body
+
+ def _get_pretty_xml(self, body):
+ # The body is parsed and whitespace is stripped because some services
+ # like ec2 already return pretty XML and if toprettyxml() was applied
+ # to it, it will add even more newlines and spaces on top of it.
+ # So this just removes all whitespace from the start to prevent the
+ # chance of adding to much newlines and spaces when toprettyxml()
+ # is called.
+ stripped_body = self._strip_whitespace(body)
+ xml_dom = xml.dom.minidom.parseString(stripped_body)
+ return xml_dom.toprettyxml(indent=' '*4, newl='\n')
+
+ def _get_pretty_json(self, body):
+ # The json body is loaded so it can be dumped in a format that
+ # is desired.
+ obj = json.loads(body)
+ return self._pformat_dictionary(obj)
+
+ def _is_xml(self, body):
+ try:
+ xml.dom.minidom.parseString(body)
+ except xml.parsers.expat.ExpatError:
+ return False
+ return True
+
+ def _strip_whitespace(self, xml_string):
+ xml_dom = xml.dom.minidom.parseString(xml_string)
+ return ''.join(
+ [line.strip() for line in xml_dom.toxml().splitlines()]
+ )
+
+ def _is_json_structure(self, body):
+ if body.startswith('{'):
+ try:
+ json.loads(body)
+ return True
+ except json.decoder.JSONDecodeError:
+ return False
+ return False
+
+
+class ShowCommand(HistorySubcommand):
+ NAME = 'show'
+ DESCRIPTION = (
+ 'Shows the various events related to running a specific CLI command. '
+ 'If this command is ran without any positional arguments, it will '
+ 'display the events for the last CLI command ran.'
+ )
+ FORMATTERS = {
+ 'detailed': DetailedFormatter
+ }
+ ARG_TABLE = [
+ {'name': 'command_id', 'nargs': '?', 'default': 'latest',
+ 'positional_arg': True,
+ 'help_text': (
+ 'The ID of the CLI command to show. If this positional argument '
+ 'is omitted, it will show the last the CLI command ran.')},
+ {'name': 'include', 'nargs': '+',
+ 'help_text': (
+ 'Specifies which events to **only** include when showing the '
+ 'CLI command. This argument is mutually exclusive with '
+ '``--exclude``.')},
+ {'name': 'exclude', 'nargs': '+',
+ 'help_text': (
+ 'Specifies which events to exclude when showing the '
+ 'CLI command. This argument is mutually exclusive with '
+ '``--include``.')},
+ {'name': 'format', 'choices': FORMATTERS.keys(),
+ 'default': 'detailed', 'help_text': (
+ 'Specifies which format to use in showing the events for '
+ 'the specified CLI command. The following formats are '
+ 'supported:\n\n'
+ '
'
+ '
detailed - This the default format. It prints out a '
+ 'detailed overview of the CLI command ran. It displays all '
+ 'of the key events in the command lifecycle where each '
+ 'important event has a title and its important values '
+ 'underneath. The events are ordered by timestamp and events of '
+ 'the same API call are associated together with the '
+ '[``api_id``] notation where events that share the same '
+ '``api_id`` belong to the lifecycle of the same API call.'
+ '
'
+ '
'
+ )
+ }
+ ]
+
+ def _run_main(self, parsed_args, parsed_globals):
+ self._connect_to_history_db()
+ try:
+ self._validate_args(parsed_args)
+ with self._get_output_stream() as output_stream:
+ formatter = self._get_formatter(
+ parsed_args, parsed_globals, output_stream)
+ for record in self._get_record_iterator(parsed_args):
+ formatter.display(record)
+ finally:
+ self._close_history_db()
+ return 0
+
+ def _validate_args(self, parsed_args):
+ if parsed_args.exclude and parsed_args.include:
+ raise ValueError(
+ 'Either --exclude or --include can be provided but not both')
+
+ def _get_formatter(self, parsed_args, parsed_globals, output_stream):
+ format_type = parsed_args.format
+ formatter_kwargs = {
+ 'include': parsed_args.include,
+ 'exclude': parsed_args.exclude,
+ 'output': output_stream
+ }
+ if format_type == 'detailed':
+ formatter_kwargs['colorize'] = self._should_use_color(
+ parsed_globals)
+ return self.FORMATTERS[format_type](**formatter_kwargs)
+
+ def _get_record_iterator(self, parsed_args):
+ if parsed_args.command_id == 'latest':
+ return self._db_reader.iter_latest_records()
+ else:
+ return self._db_reader.iter_records(parsed_args.command_id)
diff -Nru awscli-1.11.13/awscli/customizations/mturk.py awscli-1.18.69/awscli/customizations/mturk.py
--- awscli-1.11.13/awscli/customizations/mturk.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/mturk.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+from awscli.customizations.utils import make_hidden_command_alias
+
+
+def register_alias_mturk_command(event_emitter):
+ event_emitter.register(
+ 'building-command-table.mturk',
+ alias_mturk_command
+ )
+
+
+def alias_mturk_command(command_table, **kwargs):
+ make_hidden_command_alias(
+ command_table,
+ existing_name='list-hits-for-qualification-type',
+ alias_name='list-hi-ts-for-qualification-type',
+ )
diff -Nru awscli-1.11.13/awscli/customizations/opsworkscm.py awscli-1.18.69/awscli/customizations/opsworkscm.py
--- awscli-1.11.13/awscli/customizations/opsworkscm.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/opsworkscm.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,21 @@
+# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+from awscli.customizations.utils import alias_command
+
+
+def register_alias_opsworks_cm(event_emitter):
+ event_emitter.register('building-command-table.main', alias_opsworks_cm)
+
+
+def alias_opsworks_cm(command_table, **kwargs):
+ alias_command(command_table, 'opsworkscm', 'opsworks-cm')
diff -Nru awscli-1.11.13/awscli/customizations/opsworks.py awscli-1.18.69/awscli/customizations/opsworks.py
--- awscli-1.11.13/awscli/customizations/opsworks.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/opsworks.py 2020-05-28 19:25:48.000000000 +0000
@@ -24,7 +24,7 @@
from botocore.exceptions import ClientError
-from awscli.compat import shlex_quote, urlopen
+from awscli.compat import shlex_quote, urlopen, ensure_text_type
from awscli.customizations.commands import BasicCommand
from awscli.customizations.utils import create_client_from_parsed_globals
@@ -34,6 +34,7 @@
IAM_USER_POLICY_NAME = "OpsWorks-Instance"
IAM_USER_POLICY_TIMEOUT = datetime.timedelta(minutes=15)
IAM_PATH = '/AWS/OpsWorks/'
+IAM_POLICY_ARN = 'arn:aws:iam::aws:policy/AWSOpsWorksInstanceRegistration'
HOSTNAME_RE = re.compile(r"^(?!-)[a-z0-9-]{1,63}(?A token to specify where to start paginating. This is the
NextToken from a previously truncated response.
+
For usage examples, see Pagination in the AWS Command Line Interface User
+Guide.
"""
MAX_ITEMS_HELP = """
-
The total number of items to return. If the total number
-of items available is more than the value specified in
-max-items then a NextToken will
-be provided in the output that you can use to resume pagination.
-This NextToken response element should not be
-used directly outside of the AWS CLI.
+
The total number of items to return in the command's output.
+If the total number of items available is more than the value
+specified, a NextToken is provided in the command's
+output. To resume pagination, provide the
+NextToken value in the starting-token
+argument of a subsequent command. Do not use the
+NextToken response element directly outside of the
+AWS CLI.
+
For usage examples, see Pagination in the AWS Command Line Interface User
+Guide.
"""
PAGE_SIZE_HELP = """
-
The size of each page.
+
The size of each page to get in the AWS service call. This
+does not affect the number of items returned in the command's
+output. Setting a smaller page size results in more calls to
+the AWS service, retrieving fewer items in each call. This can
+help prevent the AWS service calls from timing out.
+
For usage examples, see Pagination in the AWS Command Line Interface User
+Guide.
"""
@@ -237,6 +255,7 @@
type_map = {
'string': str,
'integer': int,
+ 'long': int,
}
def __init__(self, name, documentation, parse_type, serialized_name):
diff -Nru awscli-1.11.13/awscli/customizations/preview.py awscli-1.18.69/awscli/customizations/preview.py
--- awscli-1.11.13/awscli/customizations/preview.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/preview.py 2020-05-28 19:25:48.000000000 +0000
@@ -38,7 +38,6 @@
PREVIEW_SERVICES = [
- 'cloudfront',
'sdb',
]
diff -Nru awscli-1.11.13/awscli/customizations/putmetricdata.py awscli-1.18.69/awscli/customizations/putmetricdata.py
--- awscli-1.11.13/awscli/customizations/putmetricdata.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/putmetricdata.py 2020-05-28 19:25:48.000000000 +0000
@@ -20,6 +20,7 @@
* --value
* --statistic-values
* --unit
+* --storage-resolution
"""
import decimal
@@ -30,8 +31,8 @@
def register_put_metric_data(event_handler):
- event_handler.register('building-argument-table.cloudwatch.put-metric-data',
- _promote_args)
+ event_handler.register(
+ 'building-argument-table.cloudwatch.put-metric-data', _promote_args)
event_handler.register(
'operation-args-parsed.cloudwatch.put-metric-data',
validate_mutually_exclusive_handler(
@@ -39,7 +40,7 @@
'dimensions', 'statistic_values']))
-def _promote_args(argument_table, **kwargs):
+def _promote_args(argument_table, operation_model, **kwargs):
# We're providing top level params for metric-data. This means
# that metric-data is now longer a required arg. We do need
# to check that either metric-data or the complex args we've added
@@ -66,14 +67,27 @@
argument_table['dimensions'] = PutMetricArgument(
'dimensions', help_text=(
- 'The --dimension argument further expands '
- 'on the identity of a metric using a Name=Value'
+ 'The --dimensions argument further expands '
+ 'on the identity of a metric using a Name=Value '
'pair, separated by commas, for example: '
- '--dimensions User=SomeUser,Stack=Test'))
+ '--dimensions InstanceID=1-23456789,InstanceType=m1.small'
+ '. Note that the --dimensions argument has a '
+ 'different format when used in get-metric-data, '
+ 'where for the same example you would use the format '
+ '--dimensions Name=InstanceID,Value=i-aaba32d4 '
+ 'Name=InstanceType,value=m1.small .'
+ )
+ )
argument_table['statistic-values'] = PutMetricArgument(
'statistic-values', help_text='A set of statistical values describing '
'the metric.')
+ metric_data = operation_model.input_shape.members['MetricData'].member
+ storage_resolution = metric_data.members['StorageResolution']
+ argument_table['storage-resolution'] = PutMetricArgument(
+ 'storage-resolution', help_text=storage_resolution.documentation
+ )
+
def insert_first_element(name):
def _wrap_add_to_params(func):
@@ -138,3 +152,7 @@
# convert these to a decimal value to preserve precision.
statistics[key] = decimal.Decimal(value)
first_element['StatisticValues'] = statistics
+
+ @insert_first_element('MetricData')
+ def _add_param_storage_resolution(self, first_element, value):
+ first_element['StorageResolution'] = int(value)
diff -Nru awscli-1.11.13/awscli/customizations/rds.py awscli-1.18.69/awscli/customizations/rds.py
--- awscli-1.11.13/awscli/customizations/rds.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/rds.py 2020-05-28 19:25:48.000000000 +0000
@@ -27,6 +27,8 @@
from awscli.clidriver import ServiceOperation
from awscli.clidriver import CLIOperationCaller
from awscli.customizations import utils
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.utils import uni_print
def register_rds_modify_split(cli):
@@ -37,6 +39,15 @@
_rename_remove_option)
+def register_add_generate_db_auth_token(cli):
+ cli.register('building-command-table.rds', _add_generate_db_auth_token)
+
+
+def _add_generate_db_auth_token(command_table, session, **kwargs):
+ command = GenerateDBAuthTokenCommand(session)
+ command_table['generate-db-auth-token'] = command
+
+
def _rename_add_option(argument_table, **kwargs):
utils.rename_argument(argument_table, 'options-to-include',
new_name='options')
@@ -67,3 +78,32 @@
session=session,
operation_model=modify_operation_model,
operation_caller=CLIOperationCaller(session))
+
+
+class GenerateDBAuthTokenCommand(BasicCommand):
+ NAME = 'generate-db-auth-token'
+ DESCRIPTION = (
+ 'Generates an auth token used to connect to a db with IAM credentials.'
+ )
+ ARG_TABLE = [
+ {'name': 'hostname', 'required': True,
+ 'help_text': 'The hostname of the database to connect to.'},
+ {'name': 'port', 'cli_type_name': 'integer', 'required': True,
+ 'help_text': 'The port number the database is listening on.'},
+ {'name': 'username', 'required': True,
+ 'help_text': 'The username to log in as.'}
+ ]
+
+ def _run_main(self, parsed_args, parsed_globals):
+ rds = self._session.create_client(
+ 'rds', parsed_globals.region, parsed_globals.endpoint_url,
+ parsed_globals.verify_ssl
+ )
+ token = rds.generate_db_auth_token(
+ DBHostname=parsed_args.hostname,
+ Port=parsed_args.port,
+ DBUsername=parsed_args.username
+ )
+ uni_print(token)
+ uni_print('\n')
+ return 0
diff -Nru awscli-1.11.13/awscli/customizations/rekognition.py awscli-1.18.69/awscli/customizations/rekognition.py
--- awscli-1.11.13/awscli/customizations/rekognition.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/rekognition.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,92 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import re
+
+from awscli.arguments import CustomArgument
+
+
+IMAGE_FILE_DOCSTRING = ('
The content of the image to be uploaded. '
+ 'To specify the content of a local file use the '
+ 'fileb:// prefix. '
+ 'Example: fileb://image.png
')
+IMAGE_DOCSTRING_ADDENDUM = ('
To specify a local file use --%s '
+ 'instead.
')
+
+
+FILE_PARAMETER_UPDATES = {
+ 'compare-faces.source-image': 'source-image-bytes',
+ 'compare-faces.target-image': 'target-image-bytes',
+ '*.image': 'image-bytes',
+}
+
+
+def register_rekognition_detect_labels(cli):
+ for target, new_param in FILE_PARAMETER_UPDATES.items():
+ operation, old_param = target.rsplit('.', 1)
+ cli.register('building-argument-table.rekognition.%s' % operation,
+ ImageArgUpdater(old_param, new_param))
+
+
+class ImageArgUpdater(object):
+ def __init__(self, source_param, new_param):
+ self._source_param = source_param
+ self._new_param = new_param
+
+ def __call__(self, session, argument_table, **kwargs):
+ if not self._valid_target(argument_table):
+ return
+ self._update_param(
+ argument_table, self._source_param, self._new_param)
+
+ def _valid_target(self, argument_table):
+ # We need to ensure that the target parameter is a shape that
+ # looks like it is the Image shape. This means checking that it
+ # has a member named Bytes of the blob type.
+ if self._source_param in argument_table:
+ param = argument_table[self._source_param]
+ input_model = param.argument_model
+ bytes_member = input_model.members.get('Bytes')
+ if bytes_member is not None and bytes_member.type_name == 'blob':
+ return True
+ return False
+
+ def _update_param(self, argument_table, source_param, new_param):
+ argument_table[new_param] = ImageArgument(
+ new_param, source_param,
+ help_text=IMAGE_FILE_DOCSTRING, cli_type_name='blob')
+ argument_table[source_param].required = False
+ doc_addendum = IMAGE_DOCSTRING_ADDENDUM % new_param
+ argument_table[source_param].documentation += doc_addendum
+
+
+class ImageArgument(CustomArgument):
+ def __init__(self, name, source_param, **kwargs):
+ super(ImageArgument, self).__init__(name, **kwargs)
+ self._parameter_to_overwrite = reverse_xform_name(source_param)
+
+ def add_to_params(self, parameters, value):
+ if value is None:
+ return
+ image_file_param = {'Bytes': value}
+ if parameters.get(self._parameter_to_overwrite):
+ parameters[self._parameter_to_overwrite].update(image_file_param)
+ else:
+ parameters[self._parameter_to_overwrite] = image_file_param
+
+
+def _upper(match):
+ return match.group(1).lstrip('-').upper()
+
+
+def reverse_xform_name(name):
+ return re.sub(r'(^.|-.)', _upper, name)
diff -Nru awscli-1.11.13/awscli/customizations/removals.py awscli-1.18.69/awscli/customizations/removals.py
--- awscli-1.11.13/awscli/customizations/removals.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/removals.py 2020-05-28 19:25:48.000000000 +0000
@@ -40,6 +40,8 @@
'list-instance-groups',
'set-termination-protection',
'set-visible-to-all-users'])
+ cmd_remover.remove(on_event='building-command-table.kinesis',
+ remove_commands=['subscribe-to-shard'])
class CommandRemover(object):
diff -Nru awscli-1.11.13/awscli/customizations/s3/filegenerator.py awscli-1.18.69/awscli/customizations/s3/filegenerator.py
--- awscli-1.11.13/awscli/customizations/s3/filegenerator.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3/filegenerator.py 2020-05-28 19:25:48.000000000 +0000
@@ -31,7 +31,7 @@
"""
This function checks to see if a special file. It checks if the
file is a character special device, block special device, FIFO, or
- socket.
+ socket.
"""
mode = os.stat(path).st_mode
# Character special device.
@@ -172,10 +172,9 @@
error, listdir = os.error, os.listdir
if not self.should_ignore_file(path):
if not dir_op:
- size, last_update = get_file_stat(path)
- last_update = self._validate_update_time(last_update, path)
- yield path, {'Size': size, 'LastModified': last_update}
-
+ stats = self._safely_get_file_stats(path)
+ if stats:
+ yield stats
else:
# We need to list files in byte order based on the full
# expanded path of the key: 'test/1/2/3.txt' However,
@@ -208,13 +207,18 @@
for x in self.list_files(file_path, dir_op):
yield x
else:
- size, last_update = get_file_stat(file_path)
- last_update = self._validate_update_time(
- last_update, path)
- yield (
- file_path,
- {'Size': size, 'LastModified': last_update}
- )
+ stats = self._safely_get_file_stats(file_path)
+ if stats:
+ yield stats
+
+ def _safely_get_file_stats(self, file_path):
+ try:
+ size, last_update = get_file_stat(file_path)
+ except (OSError, ValueError):
+ self.triggers_warning(file_path)
+ else:
+ last_update = self._validate_update_time(last_update, file_path)
+ return file_path, {'Size': size, 'LastModified': last_update}
def _validate_update_time(self, update_time, path):
# If the update time is None we know we ran into an invalid tiemstamp.
@@ -314,8 +318,10 @@
yield self._list_single_object(s3_path)
else:
lister = BucketLister(self._client)
+ extra_args = self.request_parameters.get('ListObjectsV2', {})
for key in lister.list_objects(bucket=bucket, prefix=prefix,
- page_size=self.page_size):
+ page_size=self.page_size,
+ extra_args=extra_args):
source_path, response_data = key
if response_data['Size'] == 0 and source_path.endswith('/'):
if self.operation_name == 'delete':
@@ -336,6 +342,12 @@
# a ListObjects operation (which causes concern for anyone setting
# IAM policies with the smallest set of permissions needed) and
# instead use a HeadObject request.
+ if self.operation_name == 'delete':
+ # If the operation is just a single remote delete, there is
+ # no need to run HeadObject on the S3 object as none of the
+ # information gained from HeadObject is required to delete the
+ # object.
+ return s3_path, {'Size': None, 'LastModified': None}
bucket, key = find_bucket_key(s3_path)
try:
params = {'Bucket': bucket, 'Key': key}
diff -Nru awscli-1.11.13/awscli/customizations/s3/fileinfo.py awscli-1.18.69/awscli/customizations/s3/fileinfo.py
--- awscli-1.11.13/awscli/customizations/s3/fileinfo.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3/fileinfo.py 2020-05-28 19:26:18.000000000 +0000
@@ -80,9 +80,10 @@
return True
def _is_glacier_object(self, response_data):
+ glacier_storage_classes = ['GLACIER', 'DEEP_ARCHIVE']
if response_data:
- if response_data.get('StorageClass') == 'GLACIER' and \
- not self._is_restored(response_data):
+ if response_data.get('StorageClass') in glacier_storage_classes \
+ and not self._is_restored(response_data):
return True
return False
diff -Nru awscli-1.11.13/awscli/customizations/s3/filters.py awscli-1.18.69/awscli/customizations/s3/filters.py
--- awscli-1.11.13/awscli/customizations/s3/filters.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3/filters.py 2020-05-28 19:25:48.000000000 +0000
@@ -149,5 +149,5 @@
file_path, path_pattern)
else:
LOG.debug("%s did not match %s filter: %s",
- file_path, pattern_type[2:], path_pattern)
+ file_path, pattern_type, path_pattern)
return file_status
diff -Nru awscli-1.11.13/awscli/customizations/s3/results.py awscli-1.18.69/awscli/customizations/s3/results.py
--- awscli-1.11.13/awscli/customizations/s3/results.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3/results.py 2020-05-28 19:25:48.000000000 +0000
@@ -10,9 +10,11 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
+from __future__ import division
import logging
import sys
import threading
+import time
from collections import namedtuple
from collections import defaultdict
@@ -20,10 +22,10 @@
from s3transfer.exceptions import FatalError
from s3transfer.subscribers import BaseSubscriber
-from awscli.compat import queue
+from awscli.compat import queue, ensure_text_type
from awscli.customizations.s3.utils import relative_path
from awscli.customizations.s3.utils import human_readable_size
-from awscli.customizations.s3.utils import uni_print
+from awscli.customizations.utils import uni_print
from awscli.customizations.s3.utils import WarningResult
from awscli.customizations.s3.utils import OnDoneFilteredSubscriber
@@ -50,7 +52,8 @@
QueuedResult = _create_new_result_cls('QueuedResult', ['total_transfer_size'])
ProgressResult = _create_new_result_cls(
- 'ProgressResult', ['bytes_transferred', 'total_transfer_size'])
+ 'ProgressResult', ['bytes_transferred', 'total_transfer_size',
+ 'timestamp'])
SuccessResult = _create_new_result_cls('SuccessResult')
@@ -97,7 +100,8 @@
def on_progress(self, future, bytes_transferred, **kwargs):
result_kwargs = self._result_kwargs_cache[future.meta.transfer_id]
progress_result = ProgressResult(
- bytes_transferred=bytes_transferred, **result_kwargs)
+ bytes_transferred=bytes_transferred, timestamp=time.time(),
+ **result_kwargs)
self._result_queue.put(progress_result)
def _on_success(self, future):
@@ -208,6 +212,9 @@
self.expected_files_transferred = 0
self.final_expected_files_transferred = None
+ self.start_time = None
+ self.bytes_transfer_speed = 0
+
self._ongoing_progress = defaultdict(int)
self._ongoing_total_sizes = {}
@@ -239,8 +246,11 @@
'Any result using _get_ongoing_dict_key must subclass from '
'BaseResult. Provided result is of type: %s' % type(result)
)
- return ':'.join(
- str(el) for el in [result.transfer_type, result.src, result.dest])
+ key_parts = []
+ for result_property in [result.transfer_type, result.src, result.dest]:
+ if result_property is not None:
+ key_parts.append(ensure_text_type(result_property))
+ return u':'.join(key_parts)
def _pop_result_from_ongoing_dicts(self, result):
ongoing_key = self._get_ongoing_dict_key(result)
@@ -253,6 +263,8 @@
pass
def _record_queued_result(self, result, **kwargs):
+ if self.start_time is None:
+ self.start_time = time.time()
total_transfer_size = result.total_transfer_size
self._ongoing_total_sizes[
self._get_ongoing_dict_key(result)] = total_transfer_size
@@ -268,6 +280,16 @@
self._ongoing_progress[
self._get_ongoing_dict_key(result)] += bytes_transferred
self.bytes_transferred += bytes_transferred
+ # Since the start time is captured in the result recorder and
+ # capture timestamps in the subscriber, there is a chance that if
+ # a progress result gets created right after the queued result
+ # gets created that the timestamp on the progress result is less
+ # than the timestamp of when the result processor actually
+ # processes that initial queued result. So this will avoid
+ # negative progress being displayed or zero divison occuring.
+ if result.timestamp > self.start_time:
+ self.bytes_transfer_speed = self.bytes_transferred / (
+ result.timestamp - self.start_time)
def _update_ongoing_transfer_size_if_unknown(self, result):
# This is a special case when the transfer size was previous not
@@ -327,31 +349,31 @@
_ESTIMATED_EXPECTED_TOTAL = "~{expected_total}"
_STILL_CALCULATING_TOTALS = " (calculating...)"
BYTE_PROGRESS_FORMAT = (
- 'Completed {bytes_completed}/{expected_bytes_completed} with '
- + _FILES_REMAINING
+ 'Completed {bytes_completed}/{expected_bytes_completed} '
+ '({transfer_speed}) with ' + _FILES_REMAINING
)
FILE_PROGRESS_FORMAT = (
'Completed {files_completed} file(s) with ' + _FILES_REMAINING
)
SUCCESS_FORMAT = (
- '{transfer_type}: {transfer_location}'
+ u'{transfer_type}: {transfer_location}'
)
- DRY_RUN_FORMAT = '(dryrun) ' + SUCCESS_FORMAT
+ DRY_RUN_FORMAT = u'(dryrun) ' + SUCCESS_FORMAT
FAILURE_FORMAT = (
- '{transfer_type} failed: {transfer_location} {exception}'
+ u'{transfer_type} failed: {transfer_location} {exception}'
)
# TODO: Add "warning: " prefix once all commands are converted to using
# result printer and remove "warning: " prefix from ``create_warning``.
WARNING_FORMAT = (
- '{message}'
+ u'{message}'
)
ERROR_FORMAT = (
- 'fatal error: {exception}'
+ u'fatal error: {exception}'
)
CTRL_C_MSG = 'cancelled: ctrl-c received'
- SRC_DEST_TRANSFER_LOCATION_FORMAT = '{src} to {dest}'
- SRC_TRANSFER_LOCATION_FORMAT = '{src}'
+ SRC_DEST_TRANSFER_LOCATION_FORMAT = u'{src} to {dest}'
+ SRC_TRANSFER_LOCATION_FORMAT = u'{src}'
def __init__(self, result_recorder, out_file=None, error_file=None):
"""Prints status of ongoing transfer
@@ -474,9 +496,12 @@
human_readable_size(
self._result_recorder.expected_bytes_transferred))
+ transfer_speed = human_readable_size(
+ self._result_recorder.bytes_transfer_speed) + '/s'
progress_statement = self.BYTE_PROGRESS_FORMAT.format(
bytes_completed=bytes_completed,
expected_bytes_completed=expected_bytes_completed,
+ transfer_speed=transfer_speed,
remaining_files=remaining_files
)
else:
@@ -529,6 +554,12 @@
uni_print(self._adjust_statement_padding(''), self._out_file)
+class NoProgressResultPrinter(ResultPrinter):
+ """A result printer that doesn't print progress"""
+ def _print_progress(self, **kwargs):
+ pass
+
+
class OnlyShowErrorsResultPrinter(ResultPrinter):
"""A result printer that only prints out errors"""
def _print_progress(self, **kwargs):
diff -Nru awscli-1.11.13/awscli/customizations/s3/s3handler.py awscli-1.18.69/awscli/customizations/s3/s3handler.py
--- awscli-1.11.13/awscli/customizations/s3/s3handler.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3/s3handler.py 2020-05-28 19:25:48.000000000 +0000
@@ -33,6 +33,7 @@
from awscli.customizations.s3.results import ResultRecorder
from awscli.customizations.s3.results import ResultPrinter
from awscli.customizations.s3.results import OnlyShowErrorsResultPrinter
+from awscli.customizations.s3.results import NoProgressResultPrinter
from awscli.customizations.s3.results import ResultProcessor
from awscli.customizations.s3.results import CommandResultRecorder
from awscli.customizations.s3.utils import RequestParamsMapper
@@ -45,7 +46,7 @@
from awscli.customizations.s3.utils import DeleteSourceFileSubscriber
from awscli.customizations.s3.utils import DeleteSourceObjectSubscriber
from awscli.customizations.s3.utils import DeleteCopySourceObjectSubscriber
-from awscli.compat import binary_stdin
+from awscli.compat import get_binary_stdin
LOGGER = logging.getLogger(__name__)
@@ -110,6 +111,8 @@
result_printer = OnlyShowErrorsResultPrinter(result_recorder)
elif self._cli_params.get('is_stream'):
result_printer = OnlyShowErrorsResultPrinter(result_recorder)
+ elif not self._cli_params.get('progress'):
+ result_printer = NoProgressResultPrinter(result_recorder)
else:
result_printer = ResultPrinter(result_recorder)
result_processor_handlers.append(result_printer)
@@ -303,14 +306,29 @@
's3://'+fileinfo.src,
'Object is of storage class GLACIER. Unable to '
'perform %s operations on GLACIER objects. You must '
- 'restore the object to be able to the perform '
- 'operation.' %
- fileinfo.operation_name
+ 'restore the object to be able to perform the '
+ 'operation. See aws s3 %s help for additional '
+ 'parameter options to ignore or force these '
+ 'transfers.' %
+ (fileinfo.operation_name, fileinfo.operation_name)
)
self._result_queue.put(warning)
return True
return False
+ def _warn_parent_reference(self, fileinfo):
+ # normpath() will use the OS path separator so we
+ # need to take that into account when checking for a parent prefix.
+ parent_prefix = '..' + os.path.sep
+ escapes_cwd = os.path.normpath(fileinfo.compare_key).startswith(
+ parent_prefix)
+ if escapes_cwd:
+ warning = create_warning(
+ fileinfo.compare_key, "File references a parent directory.")
+ self._result_queue.put(warning)
+ return True
+ return False
+
def _format_src_dest(self, fileinfo):
"""Returns formatted versions of a fileinfos source and destination."""
raise NotImplementedError('_format_src_dest')
@@ -396,7 +414,7 @@
return fileinfo.dest
def _get_warning_handlers(self):
- return [self._warn_glacier]
+ return [self._warn_glacier, self._warn_parent_reference]
def _format_src_dest(self, fileinfo):
src = self._format_s3_path(fileinfo.src)
@@ -453,6 +471,7 @@
subscribers.append(ProvideSizeSubscriber(int(expected_size)))
def _get_filein(self, fileinfo):
+ binary_stdin = get_binary_stdin()
return NonSeekableStream(binary_stdin)
def _format_local_path(self, path):
@@ -479,7 +498,7 @@
class DeleteRequestSubmitter(BaseTransferRequestSubmitter):
- REQUEST_MAPPER_METHOD = None
+ REQUEST_MAPPER_METHOD = RequestParamsMapper.map_delete_object_params
RESULT_SUBSCRIBER_CLASS = DeleteResultSubscriber
def can_submit(self, fileinfo):
@@ -513,7 +532,7 @@
# the burden of this functionality should live in the CLI.
# The main downsides in doing this is that delete and the result
- # creation happens in the main thread as opposed to a seperate thread
+ # creation happens in the main thread as opposed to a separate thread
# in s3transfer. However, this is not too big of a downside because
# deleting a local file only happens for sync --delete downloads and
# is very fast compared to all of the other types of transfers.
diff -Nru awscli-1.11.13/awscli/customizations/s3/subcommands.py awscli-1.18.69/awscli/customizations/s3/subcommands.py
--- awscli-1.11.13/awscli/customizations/s3/subcommands.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3/subcommands.py 2020-05-28 19:25:48.000000000 +0000
@@ -28,9 +28,10 @@
from awscli.customizations.s3.fileinfo import FileInfo
from awscli.customizations.s3.filters import create_filter
from awscli.customizations.s3.s3handler import S3TransferHandlerFactory
-from awscli.customizations.s3.utils import find_bucket_key, uni_print, \
- AppendFilter, find_dest_path_comp_key, human_readable_size, \
+from awscli.customizations.s3.utils import find_bucket_key, AppendFilter, \
+ find_dest_path_comp_key, human_readable_size, \
RequestParamsMapper, split_s3_bucket_key
+from awscli.customizations.utils import uni_print
from awscli.customizations.s3.syncstrategy.base import MissingFileSync, \
SizeAndLastModifiedSync, NeverSync
from awscli.customizations.s3 import transferconfig
@@ -85,7 +86,7 @@
"Note that S3 does not support symbolic links, so the "
"contents of the link target are uploaded under the "
"name of the link. When neither ``--follow-symlinks`` "
- "nor ``--no-follow-symlinks`` is specifed, the default "
+ "nor ``--no-follow-symlinks`` is specified, the default "
"is to follow symlinks.")}
@@ -157,14 +158,13 @@
'the granted permissions, and can be set to read, readacl, '
'writeacl, or full.
Grantee_Type - '
'Specifies how the grantee is to be identified, and can be set '
- 'to uri, emailaddress, or id.
Grantee_ID - '
+ 'to uri or id.
Grantee_ID - '
'Specifies the grantee based on Grantee_Type. The '
'Grantee_ID value can be one of:
'
'For more information on Amazon S3 access control, see '
@@ -190,17 +190,17 @@
'of the the object in S3. ``AES256`` is the only valid value. '
'If the parameter is specified but no value is provided, '
'``AES256`` is used. If you provide this value, ``--sse-c-key`` '
- 'must be specfied as well.'
+ 'must be specified as well.'
)
}
SSE_C_KEY = {
- 'name': 'sse-c-key',
+ 'name': 'sse-c-key', 'cli_type_name': 'blob',
'help_text': (
'The customer-provided encryption key to use to server-side '
'encrypt the object in S3. If you provide this value, '
- '``--sse-c`` must be specfied as well. The key provided should '
+ '``--sse-c`` must be specified as well. The key provided should '
'**not** be base64 encoded.'
)
}
@@ -209,10 +209,10 @@
SSE_KMS_KEY_ID = {
'name': 'sse-kms-key-id',
'help_text': (
- 'The AWS KMS key ID that should be used to server-side '
- 'encrypt the object in S3. Note that you should only '
- 'provide this parameter if KMS key ID is different the '
- 'default S3 master KMS key.'
+ 'The customer-managed AWS Key Management Service (KMS) key ID that '
+ 'should be used to server-side encrypt the object in S3. You should '
+ 'only provide this parameter if you are using a customer managed '
+ 'customer master key (CMK) and not the AWS managed KMS CMK.'
)
}
@@ -227,31 +227,34 @@
'object. ``AES256`` is the only valid '
'value. If the parameter is specified but no value is provided, '
'``AES256`` is used. If you provide this value, '
- '``--sse-c-copy-source-key`` must be specfied as well. '
+ '``--sse-c-copy-source-key`` must be specified as well. '
)
}
SSE_C_COPY_SOURCE_KEY = {
- 'name': 'sse-c-copy-source-key',
+ 'name': 'sse-c-copy-source-key', 'cli_type_name': 'blob',
'help_text': (
'This parameter should only be specified when copying an S3 object '
'that was encrypted server-side with a customer-provided '
'key. Specifies the customer-provided encryption key for Amazon S3 '
'to use to decrypt the source object. The encryption key provided '
'must be one that was used when the source object was created. '
- 'If you provide this value, ``--sse-c-copy-source`` be specfied as '
+ 'If you provide this value, ``--sse-c-copy-source`` be specified as '
'well. The key provided should **not** be base64 encoded.'
)
}
STORAGE_CLASS = {'name': 'storage-class',
- 'choices': ['STANDARD', 'REDUCED_REDUNDANCY', 'STANDARD_IA'],
+ 'choices': ['STANDARD', 'REDUCED_REDUNDANCY', 'STANDARD_IA',
+ 'ONEZONE_IA', 'INTELLIGENT_TIERING', 'GLACIER',
+ 'DEEP_ARCHIVE'],
'help_text': (
"The type of storage to use for the object. "
"Valid choices are: STANDARD | REDUCED_REDUNDANCY "
- "| STANDARD_IA. "
+ "| STANDARD_IA | ONEZONE_IA | INTELLIGENT_TIERING "
+ "| GLACIER | DEEP_ARCHIVE. "
"Defaults to 'STANDARD'")}
@@ -368,12 +371,21 @@
'output is suppressed.')}
+NO_PROGRESS = {'name': 'no-progress',
+ 'action': 'store_false',
+ 'dest': 'progress',
+ 'help_text': (
+ 'File transfer progress is not displayed. This flag '
+ 'is only applied when the quiet and only-show-errors '
+ 'flags are not provided.')}
+
+
EXPECTED_SIZE = {'name': 'expected-size',
'help_text': (
'This argument specifies the expected size of a stream '
'in terms of bytes. Note that this argument is needed '
'only when a stream is being uploaded to s3 and the size '
- 'is larger than 5GB. Failure to include this argument '
+ 'is larger than 50GB. Failure to include this argument '
'under these conditions may result in a failed upload '
'due to too many parts in upload.')}
@@ -423,8 +435,9 @@
SSE_C_COPY_SOURCE_KEY, STORAGE_CLASS, GRANTS,
WEBSITE_REDIRECT, CONTENT_TYPE, CACHE_CONTROL,
CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LANGUAGE,
- EXPIRES, SOURCE_REGION, ONLY_SHOW_ERRORS,
- PAGE_SIZE, IGNORE_GLACIER_WARNINGS, FORCE_GLACIER_TRANSFER]
+ EXPIRES, SOURCE_REGION, ONLY_SHOW_ERRORS, NO_PROGRESS,
+ PAGE_SIZE, IGNORE_GLACIER_WARNINGS, FORCE_GLACIER_TRANSFER,
+ REQUEST_PAYER]
def get_client(session, region, endpoint_url, verify, config=None):
@@ -488,7 +501,7 @@
def _list_all_objects(self, bucket, key, page_size=None,
request_payer=None):
- paginator = self.client.get_paginator('list_objects')
+ paginator = self.client.get_paginator('list_objects_v2')
paging_args = {
'Bucket': bucket, 'Prefix': key, 'Delimiter': '/',
'PaginationConfig': {'PageSize': page_size}
@@ -536,7 +549,7 @@
def _list_all_objects_recursive(self, bucket, key, page_size=None,
request_payer=None):
- paginator = self.client.get_paginator('list_objects')
+ paginator = self.client.get_paginator('list_objects_v2')
paging_args = {
'Bucket': bucket, 'Prefix': key,
'PaginationConfig': {'PageSize': page_size}
@@ -633,9 +646,12 @@
class PresignCommand(S3Command):
NAME = 'presign'
- DESCRIPTION = ("Generate a pre-signed URL for an Amazon S3 object. "
- "This allows anyone who receives the pre-signed URL "
- "to retrieve the S3 object with an HTTP GET request.")
+ DESCRIPTION = (
+ "Generate a pre-signed URL for an Amazon S3 object. This allows "
+ "anyone who receives the pre-signed URL to retrieve the S3 object "
+ "with an HTTP GET request. For sigv4 requests the region needs to be "
+ "configured explicitly."
+ )
USAGE = ""
ARG_TABLE = [{'name': 'path',
'positional_arg': True, 'synopsis': USAGE},
@@ -730,8 +746,8 @@
DESCRIPTION = "Deletes an S3 object."
USAGE = ""
ARG_TABLE = [{'name': 'paths', 'nargs': 1, 'positional_arg': True,
- 'synopsis': USAGE}, DRYRUN, QUIET, RECURSIVE, INCLUDE,
- EXCLUDE, ONLY_SHOW_ERRORS, PAGE_SIZE]
+ 'synopsis': USAGE}, DRYRUN, QUIET, RECURSIVE, REQUEST_PAYER,
+ INCLUDE, EXCLUDE, ONLY_SHOW_ERRORS, PAGE_SIZE]
class SyncCommand(S3TransferCommand):
@@ -833,7 +849,7 @@
instructions identifies which type of components are required based on the
name of the command and the parameters passed to the command line. After
the instructions are generated the second step involves using the
- lsit of instructions to wire together an assortment of generators to
+ list of instructions to wire together an assortment of generators to
perform the command.
"""
def __init__(self, session, cmd, parameters, runtime_config=None):
@@ -899,7 +915,7 @@
"""Determines the sync strategy for the command.
It defaults to the default sync strategies but a customizable sync
- strategy can overide the default strategy if it returns the instance
+ strategy can override the default strategy if it returns the instance
of its self when the event is emitted.
"""
sync_strategies = {}
@@ -909,7 +925,7 @@
sync_strategies['file_not_at_dest_sync_strategy'] = MissingFileSync()
sync_strategies['file_not_at_src_sync_strategy'] = NeverSync()
- # Determine what strategies to overide if any.
+ # Determine what strategies to override if any.
responses = self.session.emit(
'choosing-s3-sync-strategy', params=self.parameters)
if responses is not None:
@@ -972,26 +988,16 @@
'result_queue': result_queue,
}
- fgen_request_parameters = {}
- fgen_head_object_params = {}
- fgen_request_parameters['HeadObject'] = fgen_head_object_params
+ fgen_request_parameters = \
+ self._get_file_generator_request_parameters_skeleton()
+ self._map_request_payer_params(fgen_request_parameters)
+ self._map_sse_c_params(fgen_request_parameters, paths_type)
fgen_kwargs['request_parameters'] = fgen_request_parameters
- # SSE-C may be neaded for HeadObject for copies/downloads/deletes
- # If the operation is s3 to s3, the FileGenerator should use the
- # copy source key and algorithm. Otherwise, use the regular
- # SSE-C key and algorithm. Note the reverse FileGenerator does
- # not need any of these because it is used only for sync operations
- # which only use ListObjects which does not require HeadObject.
- RequestParamsMapper.map_head_object_params(
- fgen_head_object_params, self.parameters)
- if paths_type == 's3s3':
- RequestParamsMapper.map_head_object_params(
- fgen_head_object_params, {
- 'sse_c': self.parameters.get('sse_c_copy_source'),
- 'sse_c_key': self.parameters.get('sse_c_copy_source_key')
- }
- )
+ rgen_request_parameters = \
+ self._get_file_generator_request_parameters_skeleton()
+ self._map_request_payer_params(rgen_request_parameters)
+ rgen_kwargs['request_parameters'] = rgen_request_parameters
file_generator = FileGenerator(**fgen_kwargs)
rev_generator = FileGenerator(**rgen_kwargs)
@@ -1069,10 +1075,46 @@
rc = 0
if files[0].num_tasks_failed > 0:
rc = 1
- if files[0].num_tasks_warned > 0:
+ elif files[0].num_tasks_warned > 0:
rc = 2
return rc
+ def _get_file_generator_request_parameters_skeleton(self):
+ return {
+ 'HeadObject': {},
+ 'ListObjects': {},
+ 'ListObjectsV2': {}
+ }
+
+ def _map_request_payer_params(self, request_parameters):
+ RequestParamsMapper.map_head_object_params(
+ request_parameters['HeadObject'], {
+ 'request_payer': self.parameters.get('request_payer')
+ }
+ )
+ RequestParamsMapper.map_list_objects_v2_params(
+ request_parameters['ListObjectsV2'], {
+ 'request_payer': self.parameters.get('request_payer')
+ }
+ )
+
+ def _map_sse_c_params(self, request_parameters, paths_type):
+ # SSE-C may be neaded for HeadObject for copies/downloads/deletes
+ # If the operation is s3 to s3, the FileGenerator should use the
+ # copy source key and algorithm. Otherwise, use the regular
+ # SSE-C key and algorithm. Note the reverse FileGenerator does
+ # not need any of these because it is used only for sync operations
+ # which only use ListObjects which does not require HeadObject.
+ RequestParamsMapper.map_head_object_params(
+ request_parameters['HeadObject'], self.parameters)
+ if paths_type == 's3s3':
+ RequestParamsMapper.map_head_object_params(
+ request_parameters['HeadObject'], {
+ 'sse_c': self.parameters.get('sse_c_copy_source'),
+ 'sse_c_key': self.parameters.get('sse_c_copy_source_key')
+ }
+ )
+
class CommandParameters(object):
"""
diff -Nru awscli-1.11.13/awscli/customizations/s3/transferconfig.py awscli-1.18.69/awscli/customizations/s3/transferconfig.py
--- awscli-1.11.13/awscli/customizations/s3/transferconfig.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3/transferconfig.py 2020-05-28 19:25:48.000000000 +0000
@@ -22,6 +22,7 @@
'multipart_chunksize': 8 * (1024 ** 2),
'max_concurrent_requests': 10,
'max_queue_size': 1000,
+ 'max_bandwidth': None
}
@@ -32,8 +33,10 @@
class RuntimeConfig(object):
POSITIVE_INTEGERS = ['multipart_chunksize', 'multipart_threshold',
- 'max_concurrent_requests', 'max_queue_size']
+ 'max_concurrent_requests', 'max_queue_size',
+ 'max_bandwidth']
HUMAN_READABLE_SIZES = ['multipart_chunksize', 'multipart_threshold']
+ HUMAN_READABLE_RATES = ['max_bandwidth']
@staticmethod
def defaults():
@@ -54,6 +57,7 @@
if kwargs:
runtime_config.update(kwargs)
self._convert_human_readable_sizes(runtime_config)
+ self._convert_human_readable_rates(runtime_config)
self._validate_config(runtime_config)
return runtime_config
@@ -63,6 +67,17 @@
if value is not None and not isinstance(value, six.integer_types):
runtime_config[attr] = human_readable_to_bytes(value)
+ def _convert_human_readable_rates(self, runtime_config):
+ for attr in self.HUMAN_READABLE_RATES:
+ value = runtime_config.get(attr)
+ if value is not None and not isinstance(value, six.integer_types):
+ if not value.endswith('B/s'):
+ raise InvalidConfigError(
+ 'Invalid rate: %s. The value must be expressed '
+ 'as a rate in terms of bytes per seconds '
+ '(e.g. 10MB/s or 800KB/s)' % value)
+ runtime_config[attr] = human_readable_to_bytes(value[:-2])
+
def _validate_config(self, runtime_config):
for attr in self.POSITIVE_INTEGERS:
value = runtime_config.get(attr)
@@ -94,6 +109,7 @@
'max_queue_size': 'max_request_queue_size',
'multipart_threshold': 'multipart_threshold',
'multipart_chunksize': 'multipart_chunksize',
+ 'max_bandwidth': 'max_bandwidth',
}
kwargs = {}
for key, value in runtime_config.items():
diff -Nru awscli-1.11.13/awscli/customizations/s3/utils.py awscli-1.18.69/awscli/customizations/s3/utils.py
--- awscli-1.11.13/awscli/customizations/s3/utils.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3/utils.py 2020-05-28 19:26:18.000000000 +0000
@@ -16,7 +16,7 @@
import mimetypes
import errno
import os
-import sys
+import re
import time
from collections import namedtuple, deque
@@ -43,10 +43,14 @@
'gib': 1024 ** 3,
'tib': 1024 ** 4,
}
+_S3_ACCESSPOINT_TO_BUCKET_KEY_REGEX = re.compile(
+ r'^(?Parn:(aws).*:s3:[a-z\-0-9]+:[0-9]{12}:accesspoint[:/][^/]+)/?'
+ r'(?P.*)$'
+)
def human_readable_size(value):
- """Convert an size in bytes into a human readable format.
+ """Convert a size in bytes into a human readable format.
For example::
@@ -59,11 +63,10 @@
>>> human_readable_size(1024 * 1024)
'1.0 MiB'
- :param value: The size in bytes
+ :param value: The size in bytes.
:return: The size in a human readable format based on base-2 units.
"""
- one_decimal_point = '%.1f'
base = 1024
bytes_int = float(value)
@@ -182,11 +185,14 @@
the form: bucket/key
It will return the bucket and the key represented by the s3 path
"""
- s3_components = s3_path.split('/')
+ match = _S3_ACCESSPOINT_TO_BUCKET_KEY_REGEX.match(s3_path)
+ if match:
+ return match.group('bucket'), match.group('key')
+ s3_components = s3_path.split('/', 1)
bucket = s3_components[0]
- s3_key = ""
+ s3_key = ''
if len(s3_components) > 1:
- s3_key = '/'.join(s3_components[1:])
+ s3_key = s3_components[1]
return bucket, s3_key
@@ -216,13 +222,13 @@
try:
update_time = datetime.fromtimestamp(stats.st_mtime, tzlocal())
- except (ValueError, OSError):
+ except (ValueError, OSError, OverflowError):
# Python's fromtimestamp raises value errors when the timestamp is out
# of range of the platform's C localtime() function. This can cause
- # issues when syncing from systems with a wide range of valid timestamps
- # to systems with a lower range. Some systems support 64-bit timestamps,
- # for instance, while others only support 32-bit. We don't want to fail
- # in these cases, so instead we pass along none.
+ # issues when syncing from systems with a wide range of valid
+ # timestamps to systems with a lower range. Some systems support
+ # 64-bit timestamps, for instance, while others only support 32-bit.
+ # We don't want to fail in these cases, so instead we pass along none.
update_time = None
return stats.st_size, update_time
@@ -269,49 +275,6 @@
return warning_message
-def uni_print(statement, out_file=None):
- """
- This function is used to properly write unicode to a file, usually
- stdout or stdderr. It ensures that the proper encoding is used if the
- statement is not a string type.
- """
- if out_file is None:
- out_file = sys.stdout
- try:
- # Otherwise we assume that out_file is a
- # text writer type that accepts str/unicode instead
- # of bytes.
- out_file.write(statement)
- except UnicodeEncodeError:
- # Some file like objects like cStringIO will
- # try to decode as ascii on python2.
- #
- # This can also fail if our encoding associated
- # with the text writer cannot encode the unicode
- # ``statement`` we've been given. This commonly
- # happens on windows where we have some S3 key
- # previously encoded with utf-8 that can't be
- # encoded using whatever codepage the user has
- # configured in their console.
- #
- # At this point we've already failed to do what's
- # been requested. We now try to make a best effort
- # attempt at printing the statement to the outfile.
- # We're using 'ascii' as the default because if the
- # stream doesn't give us any encoding information
- # we want to pick an encoding that has the highest
- # chance of printing successfully.
- new_encoding = getattr(out_file, 'encoding', 'ascii')
- # When the output of the aws command is being piped,
- # ``sys.stdout.encoding`` is ``None``.
- if new_encoding is None:
- new_encoding = 'ascii'
- new_statement = statement.encode(
- new_encoding, 'replace').decode(new_encoding)
- out_file.write(new_statement)
- out_file.flush()
-
-
class StdoutBytesWriter(object):
"""
This class acts as a file-like object that performs the bytes_print
@@ -401,12 +364,15 @@
self._client = client
self._date_parser = date_parser
- def list_objects(self, bucket, prefix=None, page_size=None):
+ def list_objects(self, bucket, prefix=None, page_size=None,
+ extra_args=None):
kwargs = {'Bucket': bucket, 'PaginationConfig': {'PageSize': page_size}}
if prefix is not None:
kwargs['Prefix'] = prefix
+ if extra_args is not None:
+ kwargs.update(extra_args)
- paginator = self._client.get_paginator('list_objects')
+ paginator = self._client.get_paginator('list_objects_v2')
pages = paginator.paginate(**kwargs)
for page in pages:
contents = page.get('Contents', [])
@@ -468,11 +434,13 @@
cls._set_metadata_params(request_params, cli_params)
cls._set_sse_request_params(request_params, cli_params)
cls._set_sse_c_request_params(request_params, cli_params)
+ cls._set_request_payer_param(request_params, cli_params)
@classmethod
def map_get_object_params(cls, request_params, cli_params):
"""Map CLI params to GetObject request params"""
cls._set_sse_c_request_params(request_params, cli_params)
+ cls._set_request_payer_param(request_params, cli_params)
@classmethod
def map_copy_object_params(cls, request_params, cli_params):
@@ -484,11 +452,13 @@
cls._set_sse_request_params(request_params, cli_params)
cls._set_sse_c_and_copy_source_request_params(
request_params, cli_params)
+ cls._set_request_payer_param(request_params, cli_params)
@classmethod
def map_head_object_params(cls, request_params, cli_params):
"""Map CLI params to HeadObject request params"""
cls._set_sse_c_request_params(request_params, cli_params)
+ cls._set_request_payer_param(request_params, cli_params)
@classmethod
def map_create_multipart_upload_params(cls, request_params, cli_params):
@@ -497,21 +467,37 @@
cls._set_sse_request_params(request_params, cli_params)
cls._set_sse_c_request_params(request_params, cli_params)
cls._set_metadata_params(request_params, cli_params)
+ cls._set_request_payer_param(request_params, cli_params)
@classmethod
def map_upload_part_params(cls, request_params, cli_params):
"""Map CLI params to UploadPart request params"""
cls._set_sse_c_request_params(request_params, cli_params)
+ cls._set_request_payer_param(request_params, cli_params)
@classmethod
def map_upload_part_copy_params(cls, request_params, cli_params):
"""Map CLI params to UploadPartCopy request params"""
cls._set_sse_c_and_copy_source_request_params(
request_params, cli_params)
+ cls._set_request_payer_param(request_params, cli_params)
+
+ @classmethod
+ def map_delete_object_params(cls, request_params, cli_params):
+ cls._set_request_payer_param(request_params, cli_params)
+
+ @classmethod
+ def map_list_objects_v2_params(cls, request_params, cli_params):
+ cls._set_request_payer_param(request_params, cli_params)
+
+ @classmethod
+ def _set_request_payer_param(cls, request_params, cli_params):
+ if cli_params.get('request_payer'):
+ request_params['RequestPayer'] = cli_params['request_payer']
@classmethod
def _set_general_object_params(cls, request_params, cli_params):
- # Paramters set in this method should be applicable to the following
+ # Parameters set in this method should be applicable to the following
# operations involving objects: PutObject, CopyObject, and
# CreateMultipartUpload.
general_param_translation = {
@@ -666,10 +652,14 @@
def _delete_source(self, future):
call_args = future.meta.call_args
- self._client.delete_object(
- Bucket=self._get_bucket(call_args),
- Key=self._get_key(call_args)
- )
+ delete_object_kwargs = {
+ 'Bucket': self._get_bucket(call_args),
+ 'Key': self._get_key(call_args)
+ }
+ if call_args.extra_args.get('RequestPayer'):
+ delete_object_kwargs['RequestPayer'] = call_args.extra_args[
+ 'RequestPayer']
+ self._client.delete_object(**delete_object_kwargs)
class DeleteCopySourceObjectSubscriber(DeleteSourceObjectSubscriber):
diff -Nru awscli-1.11.13/awscli/customizations/s3endpoint.py awscli-1.18.69/awscli/customizations/s3endpoint.py
--- awscli-1.11.13/awscli/customizations/s3endpoint.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3endpoint.py 1970-01-01 00:00:00.000000000 +0000
@@ -1,45 +0,0 @@
-# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"). You
-# may not use this file except in compliance with the License. A copy of
-# the License is located at
-#
-# http://aws.amazon.com/apache2.0/
-#
-# or in the "license" file accompanying this file. This file is
-# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
-# ANY KIND, either express or implied. See the License for the specific
-# language governing permissions and limitations under the License.
-"""Disable endpoint url customizations for s3.
-
-There's a customization in botocore such that for S3 operations
-we try to fix the S3 endpoint url based on whether a bucket is
-dns compatible. We also try to map the endpoint url to the
-standard S3 region (s3.amazonaws.com). This normally happens
-even if a user provides an --endpoint-url (if the bucket is
-DNS compatible).
-
-This customization ensures that if a user specifies
-an --endpoint-url, then we turn off the botocore customization
-that messes with endpoint url.
-
-"""
-from functools import partial
-
-from botocore.utils import fix_s3_host
-
-
-def register_s3_endpoint(cli):
- handler = partial(on_top_level_args_parsed, event_handler=cli)
- cli.register('top-level-args-parsed', handler)
-
-
-def on_top_level_args_parsed(parsed_args, event_handler, **kwargs):
- # The fix_s3_host has logic to set the endpoint to the
- # standard region endpoint for s3 (s3.amazonaws.com) under
- # certain conditions. We're making sure that if
- # the user provides an --endpoint-url, that entire handler
- # is disabled.
- if parsed_args.command in ['s3', 's3api'] and \
- parsed_args.endpoint_url is not None:
- event_handler.unregister('before-sign.s3', fix_s3_host)
diff -Nru awscli-1.11.13/awscli/customizations/s3events.py awscli-1.18.69/awscli/customizations/s3events.py
--- awscli-1.11.13/awscli/customizations/s3events.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3events.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,91 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+"""Add S3 specific event streaming output arg."""
+from awscli.arguments import CustomArgument
+
+
+STREAM_HELP_TEXT = 'Filename where the records will be saved'
+
+
+class DocSectionNotFoundError(Exception):
+ pass
+
+
+def register_event_stream_arg(event_handlers):
+ event_handlers.register(
+ 'building-argument-table.s3api.select-object-content',
+ add_event_stream_output_arg)
+ event_handlers.register_last(
+ 'doc-output.s3api.select-object-content',
+ replace_event_stream_docs
+ )
+
+
+def add_event_stream_output_arg(argument_table, operation_model,
+ session, **kwargs):
+ argument_table['outfile'] = S3SelectStreamOutputArgument(
+ name='outfile', help_text=STREAM_HELP_TEXT,
+ cli_type_name='string', positional_arg=True,
+ stream_key=operation_model.output_shape.serialization['payload'],
+ session=session)
+
+
+def replace_event_stream_docs(help_command, **kwargs):
+ doc = help_command.doc
+ current = ''
+ while current != '======\nOutput\n======':
+ try:
+ current = doc.pop_write()
+ except IndexError:
+ # This should never happen, but in the rare case that it does
+ # we should be raising something with a helpful error message.
+ raise DocSectionNotFoundError(
+ 'Could not find the "output" section for the command: %s'
+ % help_command)
+ doc.write('======\nOutput\n======\n')
+ doc.write("This command generates no output. The selected "
+ "object content is written to the specified outfile.\n")
+
+
+class S3SelectStreamOutputArgument(CustomArgument):
+ _DOCUMENT_AS_REQUIRED = True
+
+ def __init__(self, stream_key, session, **kwargs):
+ super(S3SelectStreamOutputArgument, self).__init__(**kwargs)
+ # This is the key in the response body where we can find the
+ # streamed contents.
+ self._stream_key = stream_key
+ self._output_file = None
+ self._session = session
+
+ def add_to_params(self, parameters, value):
+ self._output_file = value
+ self._session.register('after-call.s3.SelectObjectContent',
+ self.save_file)
+
+ def save_file(self, parsed, **kwargs):
+ # This method is hooked into after-call which fires
+ # before the error checking happens in the client.
+ # Therefore if the stream_key is not in the parsed
+ # response we immediately return and let the default
+ # error handling happen.
+ if self._stream_key not in parsed:
+ return
+ event_stream = parsed[self._stream_key]
+ with open(self._output_file, 'wb') as fp:
+ for event in event_stream:
+ if 'Records' in event:
+ fp.write(event['Records']['Payload'])
+ # We don't want to include the streaming param in
+ # the returned response, it's not JSON serializable.
+ del parsed[self._stream_key]
diff -Nru awscli-1.11.13/awscli/customizations/s3uploader.py awscli-1.18.69/awscli/customizations/s3uploader.py
--- awscli-1.11.13/awscli/customizations/s3uploader.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/s3uploader.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,227 @@
+# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import hashlib
+import logging
+import threading
+import os
+import sys
+
+import botocore
+import botocore.exceptions
+from s3transfer.manager import TransferManager
+from s3transfer.subscribers import BaseSubscriber
+
+from awscli.compat import collections_abc
+
+LOG = logging.getLogger(__name__)
+
+
+class NoSuchBucketError(Exception):
+ def __init__(self, **kwargs):
+ msg = self.fmt.format(**kwargs)
+ Exception.__init__(self, msg)
+ self.kwargs = kwargs
+
+
+ fmt = ("S3 Bucket does not exist. "
+ "Execute the command to create a new bucket"
+ "\n"
+ "aws s3 mb s3://{bucket_name}")
+
+
+class S3Uploader(object):
+ """
+ Class to upload objects to S3 bucket that use versioning. If bucket
+ does not already use versioning, this class will turn on versioning.
+ """
+
+ @property
+ def artifact_metadata(self):
+ """
+ Metadata to attach to the object(s) uploaded by the uploader.
+ """
+ return self._artifact_metadata
+
+ @artifact_metadata.setter
+ def artifact_metadata(self, val):
+ if val is not None and not isinstance(val, collections_abc.Mapping):
+ raise TypeError("Artifact metadata should be in dict type")
+ self._artifact_metadata = val
+
+ def __init__(self, s3_client,
+ bucket_name,
+ prefix=None,
+ kms_key_id=None,
+ force_upload=False,
+ transfer_manager=None):
+ self.bucket_name = bucket_name
+ self.prefix = prefix
+ self.kms_key_id = kms_key_id or None
+ self.force_upload = force_upload
+ self.s3 = s3_client
+
+ self.transfer_manager = transfer_manager
+ if not transfer_manager:
+ self.transfer_manager = TransferManager(self.s3)
+
+ self._artifact_metadata = None
+
+ def upload(self, file_name, remote_path):
+ """
+ Uploads given file to S3
+ :param file_name: Path to the file that will be uploaded
+ :param remote_path: be uploaded
+ :return: VersionId of the latest upload
+ """
+
+ if self.prefix and len(self.prefix) > 0:
+ remote_path = "{0}/{1}".format(self.prefix, remote_path)
+
+ # Check if a file with same data exists
+ if not self.force_upload and self.file_exists(remote_path):
+ LOG.debug("File with same data already exists at {0}. "
+ "Skipping upload".format(remote_path))
+ return self.make_url(remote_path)
+
+ try:
+
+ # Default to regular server-side encryption unless customer has
+ # specified their own KMS keys
+ additional_args = {
+ "ServerSideEncryption": "AES256"
+ }
+
+ if self.kms_key_id:
+ additional_args["ServerSideEncryption"] = "aws:kms"
+ additional_args["SSEKMSKeyId"] = self.kms_key_id
+
+ if self.artifact_metadata:
+ additional_args["Metadata"] = self.artifact_metadata
+
+ print_progress_callback = \
+ ProgressPercentage(file_name, remote_path)
+ future = self.transfer_manager.upload(file_name,
+ self.bucket_name,
+ remote_path,
+ additional_args,
+ [print_progress_callback])
+ future.result()
+
+ return self.make_url(remote_path)
+
+ except botocore.exceptions.ClientError as ex:
+ error_code = ex.response["Error"]["Code"]
+ if error_code == "NoSuchBucket":
+ raise NoSuchBucketError(bucket_name=self.bucket_name)
+ raise ex
+
+ def upload_with_dedup(self, file_name, extension=None):
+ """
+ Makes and returns name of the S3 object based on the file's MD5 sum
+
+ :param file_name: file to upload
+ :param extension: String of file extension to append to the object
+ :return: S3 URL of the uploaded object
+ """
+
+ # This construction of remote_path is critical to preventing duplicate
+ # uploads of same object. Uploader will check if the file exists in S3
+ # and re-upload only if necessary. So the template points to same file
+ # in multiple places, this will upload only once
+
+ filemd5 = self.file_checksum(file_name)
+ remote_path = filemd5
+ if extension:
+ remote_path = remote_path + "." + extension
+
+ return self.upload(file_name, remote_path)
+
+ def file_exists(self, remote_path):
+ """
+ Check if the file we are trying to upload already exists in S3
+
+ :param remote_path:
+ :return: True, if file exists. False, otherwise
+ """
+
+ try:
+ # Find the object that matches this ETag
+ self.s3.head_object(
+ Bucket=self.bucket_name, Key=remote_path)
+ return True
+ except botocore.exceptions.ClientError:
+ # Either File does not exist or we are unable to get
+ # this information.
+ return False
+
+ def make_url(self, obj_path):
+ return "s3://{0}/{1}".format(
+ self.bucket_name, obj_path)
+
+ def file_checksum(self, file_name):
+
+ with open(file_name, "rb") as file_handle:
+ md5 = hashlib.md5()
+ # Read file in chunks of 4096 bytes
+ block_size = 4096
+
+ # Save current cursor position and reset cursor to start of file
+ curpos = file_handle.tell()
+ file_handle.seek(0)
+
+ buf = file_handle.read(block_size)
+ while len(buf) > 0:
+ md5.update(buf)
+ buf = file_handle.read(block_size)
+
+ # Restore file cursor's position
+ file_handle.seek(curpos)
+
+ return md5.hexdigest()
+
+ def to_path_style_s3_url(self, key, version=None):
+ """
+ This link describes the format of Path Style URLs
+ http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro
+ """
+ base = self.s3.meta.endpoint_url
+ result = "{0}/{1}/{2}".format(base, self.bucket_name, key)
+ if version:
+ result = "{0}?versionId={1}".format(result, version)
+
+ return result
+
+
+class ProgressPercentage(BaseSubscriber):
+ # This class was copied directly from S3Transfer docs
+
+ def __init__(self, filename, remote_path):
+ self._filename = filename
+ self._remote_path = remote_path
+ self._size = float(os.path.getsize(filename))
+ self._seen_so_far = 0
+ self._lock = threading.Lock()
+
+ def on_progress(self, future, bytes_transferred, **kwargs):
+
+ # To simplify we'll assume this is hooked up
+ # to a single filename.
+ with self._lock:
+ self._seen_so_far += bytes_transferred
+ percentage = (self._seen_so_far / self._size) * 100
+ sys.stdout.write(
+ "\rUploading to %s %s / %s (%.2f%%)" %
+ (self._remote_path, self._seen_so_far,
+ self._size, percentage))
+ sys.stdout.flush()
diff -Nru awscli-1.11.13/awscli/customizations/sagemaker.py awscli-1.18.69/awscli/customizations/sagemaker.py
--- awscli-1.11.13/awscli/customizations/sagemaker.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/sagemaker.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+from awscli.customizations.utils import make_hidden_command_alias
+
+
+def register_alias_sagemaker_runtime_command(event_emitter):
+ event_emitter.register(
+ 'building-command-table.main',
+ alias_sagemaker_runtime_command
+ )
+
+
+def alias_sagemaker_runtime_command(command_table, **kwargs):
+ make_hidden_command_alias(
+ command_table,
+ existing_name='sagemaker-runtime',
+ alias_name='runtime.sagemaker',
+ )
diff -Nru awscli-1.11.13/awscli/customizations/scalarparse.py awscli-1.18.69/awscli/customizations/scalarparse.py
--- awscli-1.11.13/awscli/customizations/scalarparse.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/scalarparse.py 2020-05-28 19:25:48.000000000 +0000
@@ -27,6 +27,10 @@
in the future.
"""
+from botocore.utils import parse_timestamp
+from botocore.exceptions import ProfileNotFound
+
+
def register_scalar_parser(event_handlers):
event_handlers.register_first(
'session-initialized', add_scalar_parsers)
@@ -36,13 +40,40 @@
return x
+def iso_format(value):
+ return parse_timestamp(value).isoformat()
+
+
+def add_timestamp_parser(session):
+ factory = session.get_component('response_parser_factory')
+ try:
+ timestamp_format = session.get_scoped_config().get(
+ 'cli_timestamp_format',
+ 'none')
+ except ProfileNotFound:
+ # If a --profile is provided that does not exist, loading
+ # a value from get_scoped_config will crash the CLI.
+ # This function can be called as the first handler for
+ # the session-initialized event, which happens before a
+ # profile can be created, even if the command would have
+ # successfully created a profile. Instead of crashing here
+ # on a ProfileNotFound the CLI should just use 'none'.
+ timestamp_format = 'none'
+ if timestamp_format == 'none':
+ # For backwards compatibility reasons, we replace botocore's timestamp
+ # parser (which parses to a datetime.datetime object) with the
+ # identity function which prints the date exactly the same as it comes
+ # across the wire.
+ timestamp_parser = identity
+ elif timestamp_format == 'iso8601':
+ timestamp_parser = iso_format
+ else:
+ raise ValueError('Unknown cli_timestamp_format value: %s, valid values'
+ ' are "none" or "iso8601"' % timestamp_format)
+ factory.set_parser_defaults(timestamp_parser=timestamp_parser)
+
+
def add_scalar_parsers(session, **kwargs):
factory = session.get_component('response_parser_factory')
- # For backwards compatibility reasons, we replace botocore's timestamp
- # parser (which parsers to a datetime.datetime object) with the identity
- # function which prints the date exactly the same as it comes across the
- # wire. We will eventually add a config option that allows for a user to
- # have normalized datetime representation, but we can't change the default.
- factory.set_parser_defaults(
- blob_parser=identity,
- timestamp_parser=identity)
+ factory.set_parser_defaults(blob_parser=identity)
+ add_timestamp_parser(session)
diff -Nru awscli-1.11.13/awscli/customizations/servicecatalog/exceptions.py awscli-1.18.69/awscli/customizations/servicecatalog/exceptions.py
--- awscli-1.11.13/awscli/customizations/servicecatalog/exceptions.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/servicecatalog/exceptions.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+# Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+
+class ServiceCatalogCommandError(Exception):
+ fmt = 'An unspecified error occurred'
+
+ def __init__(self, **kwargs):
+ msg = self.fmt.format(**kwargs)
+ Exception.__init__(self, msg)
+ self.kwargs = kwargs
+
+
+class InvalidParametersException(ServiceCatalogCommandError):
+ fmt = "An error occurred (InvalidParametersException) : {message}"
diff -Nru awscli-1.11.13/awscli/customizations/servicecatalog/generatebase.py awscli-1.18.69/awscli/customizations/servicecatalog/generatebase.py
--- awscli-1.11.13/awscli/customizations/servicecatalog/generatebase.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/servicecatalog/generatebase.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,53 @@
+# Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.servicecatalog.utils \
+ import make_url, get_s3_path
+from awscli.customizations.s3uploader import S3Uploader
+from awscli.customizations.servicecatalog import exceptions
+
+
+class GenerateBaseCommand(BasicCommand):
+
+ def _run_main(self, parsed_args, parsed_globals):
+ self.region = self.get_and_validate_region(parsed_globals)
+ self.s3_client = self._session.create_client(
+ 's3',
+ region_name=self.region,
+ endpoint_url=parsed_globals.endpoint_url,
+ verify=parsed_globals.verify_ssl
+ )
+ self.s3_uploader = S3Uploader(self.s3_client,
+ parsed_args.bucket_name,
+ force_upload=True)
+ try:
+ self.s3_uploader.upload(parsed_args.file_path,
+ get_s3_path(parsed_args.file_path))
+ except OSError as ex:
+ raise RuntimeError("%s cannot be found" % parsed_args.file_path)
+
+ def get_and_validate_region(self, parsed_globals):
+ region = parsed_globals.region
+ if region is None:
+ region = self._session.get_config_variable('region')
+ if region not in self._session.get_available_regions('servicecatalog'):
+ raise exceptions.InvalidParametersException(
+ message="Region {0} is not supported".format(
+ parsed_globals.region))
+ return region
+
+ def create_s3_url(self, bucket_name, file_path):
+ return make_url(self.region,
+ bucket_name,
+ get_s3_path(file_path))
diff -Nru awscli-1.11.13/awscli/customizations/servicecatalog/generateproduct.py awscli-1.18.69/awscli/customizations/servicecatalog/generateproduct.py
--- awscli-1.11.13/awscli/customizations/servicecatalog/generateproduct.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/servicecatalog/generateproduct.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,165 @@
+# Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import sys
+
+from awscli.customizations.servicecatalog import helptext
+from awscli.customizations.servicecatalog.generatebase \
+ import GenerateBaseCommand
+from botocore.compat import json
+
+
+class GenerateProductCommand(GenerateBaseCommand):
+ NAME = "product"
+ DESCRIPTION = helptext.PRODUCT_COMMAND_DESCRIPTION
+ ARG_TABLE = [
+ {
+ 'name': 'product-name',
+ 'required': True,
+ 'help_text': helptext.PRODUCT_NAME
+ },
+ {
+ 'name': 'product-owner',
+ 'required': True,
+ 'help_text': helptext.OWNER
+ },
+ {
+ 'name': 'product-type',
+ 'required': True,
+ 'help_text': helptext.PRODUCT_TYPE,
+ 'choices': ['CLOUD_FORMATION_TEMPLATE', 'MARKETPLACE']
+ },
+ {
+ 'name': 'product-description',
+ 'required': False,
+ 'help_text': helptext.PRODUCT_DESCRIPTION
+ },
+ {
+ 'name': 'product-distributor',
+ 'required': False,
+ 'help_text': helptext.DISTRIBUTOR
+ },
+ {
+ 'name': 'tags',
+ 'required': False,
+ 'schema': {
+ 'type': 'array',
+ 'items': {
+ 'type': 'string'
+ }
+ },
+ 'default': [],
+ 'synopsis': '--tags Key=key1,Value=value1 Key=key2,Value=value2',
+ 'help_text': helptext.TAGS
+ },
+ {
+ 'name': 'file-path',
+ 'required': True,
+ 'help_text': helptext.FILE_PATH
+ },
+ {
+ 'name': 'bucket-name',
+ 'required': True,
+ 'help_text': helptext.BUCKET_NAME
+ },
+ {
+ 'name': 'support-description',
+ 'required': False,
+ 'help_text': helptext.SUPPORT_DESCRIPTION
+ },
+ {
+ 'name': 'support-email',
+ 'required': False,
+ 'help_text': helptext.SUPPORT_EMAIL
+ },
+ {
+ 'name': 'provisioning-artifact-name',
+ 'required': True,
+ 'help_text': helptext.PA_NAME
+ },
+ {
+ 'name': 'provisioning-artifact-description',
+ 'required': True,
+ 'help_text': helptext.PA_DESCRIPTION
+ },
+ {
+ 'name': 'provisioning-artifact-type',
+ 'required': True,
+ 'help_text': helptext.PA_TYPE,
+ 'choices': [
+ 'CLOUD_FORMATION_TEMPLATE',
+ 'MARKETPLACE_AMI',
+ 'MARKETPLACE_CAR'
+ ]
+ }
+ ]
+
+ def _run_main(self, parsed_args, parsed_globals):
+ super(GenerateProductCommand, self)._run_main(parsed_args,
+ parsed_globals)
+ self.region = self.get_and_validate_region(parsed_globals)
+
+ self.s3_url = self.create_s3_url(parsed_args.bucket_name,
+ parsed_args.file_path)
+ self.scs_client = self._session.create_client(
+ 'servicecatalog', region_name=self.region,
+ endpoint_url=parsed_globals.endpoint_url,
+ verify=parsed_globals.verify_ssl
+ )
+
+ response = self.create_product(self.build_args(parsed_args,
+ self.s3_url),
+ parsed_globals)
+ sys.stdout.write(json.dumps(response, indent=2, ensure_ascii=False))
+
+ return 0
+
+ def create_product(self, args, parsed_globals):
+ response = self.scs_client.create_product(**args)
+ if 'ResponseMetadata' in response:
+ del response['ResponseMetadata']
+ return response
+
+ def _extract_tags(self, args_tags):
+ tags = []
+ for tag in args_tags:
+ tags.append(dict(t.split('=') for t in tag.split(',')))
+ return tags
+
+ def build_args(self, parsed_args, s3_url):
+ args = {
+ "Name": parsed_args.product_name,
+ "Owner": parsed_args.product_owner,
+ "ProductType": parsed_args.product_type,
+ "Tags": self._extract_tags(parsed_args.tags),
+ "ProvisioningArtifactParameters": {
+ 'Name': parsed_args.provisioning_artifact_name,
+ 'Description': parsed_args.provisioning_artifact_description,
+ 'Info': {
+ 'LoadTemplateFromURL': s3_url
+ },
+ 'Type': parsed_args.provisioning_artifact_type
+ }
+ }
+
+ # Non-required args
+ if parsed_args.support_description:
+ args["SupportDescription"] = parsed_args.support_description
+ if parsed_args.product_description:
+ args["Description"] = parsed_args.product_description
+ if parsed_args.support_email:
+ args["SupportEmail"] = parsed_args.support_email
+ if parsed_args.product_distributor:
+ args["Distributor"] = parsed_args.product_distributor
+
+ return args
diff -Nru awscli-1.11.13/awscli/customizations/servicecatalog/generateprovisioningartifact.py awscli-1.18.69/awscli/customizations/servicecatalog/generateprovisioningartifact.py
--- awscli-1.11.13/awscli/customizations/servicecatalog/generateprovisioningartifact.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/servicecatalog/generateprovisioningartifact.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,98 @@
+# Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import sys
+
+from awscli.customizations.servicecatalog import helptext
+from awscli.customizations.servicecatalog.generatebase \
+ import GenerateBaseCommand
+from botocore.compat import json
+
+
+class GenerateProvisioningArtifactCommand(GenerateBaseCommand):
+ NAME = 'provisioning-artifact'
+ DESCRIPTION = helptext.PA_COMMAND_DESCRIPTION
+ ARG_TABLE = [
+ {
+ 'name': 'file-path',
+ 'required': True,
+ 'help_text': helptext.FILE_PATH
+ },
+ {
+ 'name': 'bucket-name',
+ 'required': True,
+ 'help_text': helptext.BUCKET_NAME
+ },
+ {
+ 'name': 'provisioning-artifact-name',
+ 'required': True,
+ 'help_text': helptext.PA_NAME
+ },
+ {
+ 'name': 'provisioning-artifact-description',
+ 'required': True,
+ 'help_text': helptext.PA_DESCRIPTION
+ },
+ {
+ 'name': 'provisioning-artifact-type',
+ 'required': True,
+ 'help_text': helptext.PA_TYPE,
+ 'choices': [
+ 'CLOUD_FORMATION_TEMPLATE',
+ 'MARKETPLACE_AMI',
+ 'MARKETPLACE_CAR'
+ ]
+ },
+ {
+ 'name': 'product-id',
+ 'required': True,
+ 'help_text': helptext.PRODUCT_ID
+ }
+ ]
+
+ def _run_main(self, parsed_args, parsed_globals):
+ super(GenerateProvisioningArtifactCommand, self)._run_main(
+ parsed_args, parsed_globals)
+ self.region = self.get_and_validate_region(parsed_globals)
+
+ self.s3_url = self.create_s3_url(parsed_args.bucket_name,
+ parsed_args.file_path)
+ self.scs_client = self._session.create_client(
+ 'servicecatalog', region_name=self.region,
+ endpoint_url=parsed_globals.endpoint_url,
+ verify=parsed_globals.verify_ssl
+ )
+
+ response = self.create_provisioning_artifact(parsed_args,
+ self.s3_url)
+
+ sys.stdout.write(json.dumps(response, indent=2, ensure_ascii=False))
+
+ return 0
+
+ def create_provisioning_artifact(self, parsed_args, s3_url):
+ response = self.scs_client.create_provisioning_artifact(
+ ProductId=parsed_args.product_id,
+ Parameters={
+ 'Name': parsed_args.provisioning_artifact_name,
+ 'Description': parsed_args.provisioning_artifact_description,
+ 'Info': {
+ 'LoadTemplateFromURL': s3_url
+ },
+ 'Type': parsed_args.provisioning_artifact_type
+ }
+ )
+
+ if 'ResponseMetadata' in response:
+ del response['ResponseMetadata']
+ return response
diff -Nru awscli-1.11.13/awscli/customizations/servicecatalog/generate.py awscli-1.18.69/awscli/customizations/servicecatalog/generate.py
--- awscli-1.11.13/awscli/customizations/servicecatalog/generate.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/servicecatalog/generate.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,35 @@
+# Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+from awscli.customizations.commands import BasicCommand
+from awscli.customizations.servicecatalog import helptext
+from awscli.customizations.servicecatalog.generateproduct \
+ import GenerateProductCommand
+from awscli.customizations.servicecatalog.generateprovisioningartifact \
+ import GenerateProvisioningArtifactCommand
+
+
+class GenerateCommand(BasicCommand):
+ NAME = "generate"
+ DESCRIPTION = helptext.GENERATE_COMMAND
+ SUBCOMMANDS = [
+ {'name': 'product',
+ 'command_class': GenerateProductCommand},
+ {'name': 'provisioning-artifact',
+ 'command_class': GenerateProvisioningArtifactCommand}
+ ]
+
+ def _run_main(self, parsed_args, parsed_globals):
+ if parsed_args.subcommand is None:
+ raise ValueError("usage: aws [options] "
+ "[parameters]\naws: error: too few arguments")
diff -Nru awscli-1.11.13/awscli/customizations/servicecatalog/helptext.py awscli-1.18.69/awscli/customizations/servicecatalog/helptext.py
--- awscli-1.11.13/awscli/customizations/servicecatalog/helptext.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/servicecatalog/helptext.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,53 @@
+# Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+
+TAGS = "Tags to associate with the new product."
+
+BUCKET_NAME = ("Name of the S3 bucket name where the CloudFormation "
+ "template will be uploaded to")
+
+SUPPORT_DESCRIPTION = "Support information about the product"
+
+SUPPORT_EMAIL = "Contact email for product support"
+
+PA_NAME = "The name assigned to the provisioning artifact"
+
+PA_DESCRIPTION = "The text description of the provisioning artifact"
+
+PA_TYPE = "The type of the provisioning artifact"
+
+DISTRIBUTOR = "The distributor of the product"
+
+PRODUCT_ID = "The product identifier"
+
+PRODUCT_NAME = "The name of the product"
+
+OWNER = "The owner of the product"
+
+PRODUCT_TYPE = "The type of the product to create"
+
+PRODUCT_DESCRIPTION = "The text description of the product"
+
+PRODUCT_COMMAND_DESCRIPTION = ("Create a new product using a CloudFormation "
+ "template specified as a local file path")
+
+PA_COMMAND_DESCRIPTION = ("Create a new provisioning artifact for the "
+ "specified product using a CloudFormation template "
+ "specified as a local file path")
+
+GENERATE_COMMAND = ("Generate a Service Catalog product or provisioning "
+ "artifact using a CloudFormation template specified "
+ "as a local file path")
+
+FILE_PATH = "A local file path that references the CloudFormation template"
diff -Nru awscli-1.11.13/awscli/customizations/servicecatalog/__init__.py awscli-1.18.69/awscli/customizations/servicecatalog/__init__.py
--- awscli-1.11.13/awscli/customizations/servicecatalog/__init__.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/servicecatalog/__init__.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+# Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+from awscli.customizations.servicecatalog.generate \
+ import GenerateCommand
+
+
+def register_servicecatalog_commands(event_emitter):
+ event_emitter.register('building-command-table.servicecatalog',
+ inject_commands)
+
+
+def inject_commands(command_table, session, **kwargs):
+ command_table['generate'] = GenerateCommand(session)
diff -Nru awscli-1.11.13/awscli/customizations/servicecatalog/utils.py awscli-1.18.69/awscli/customizations/servicecatalog/utils.py
--- awscli-1.11.13/awscli/customizations/servicecatalog/utils.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/servicecatalog/utils.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,34 @@
+# Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+import os
+
+
+def make_url(region, bucket_name, obj_path, version=None):
+ """
+ This link describes the format of Path Style URLs
+ http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro
+ """
+ base = "https://s3.amazonaws.com"
+ if region and region != "us-east-1":
+ base = "https://s3-{0}.amazonaws.com".format(region)
+
+ result = "{0}/{1}/{2}".format(base, bucket_name, obj_path)
+ if version:
+ result = "{0}?versionId={1}".format(result, version)
+
+ return result
+
+
+def get_s3_path(file_path):
+ return os.path.basename(file_path)
diff -Nru awscli-1.11.13/awscli/customizations/sessionmanager.py awscli-1.18.69/awscli/customizations/sessionmanager.py
--- awscli-1.11.13/awscli/customizations/sessionmanager.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/sessionmanager.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,102 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import logging
+import json
+import errno
+
+from subprocess import check_call
+from awscli.compat import ignore_user_entered_signals
+from awscli.clidriver import ServiceOperation, CLIOperationCaller
+
+logger = logging.getLogger(__name__)
+
+ERROR_MESSAGE = (
+ 'SessionManagerPlugin is not found. ',
+ 'Please refer to SessionManager Documentation here: ',
+ 'http://docs.aws.amazon.com/console/systems-manager/',
+ 'session-manager-plugin-not-found'
+)
+
+
+def register_ssm_session(event_handlers):
+ event_handlers.register('building-command-table.ssm',
+ add_custom_start_session)
+
+
+def add_custom_start_session(session, command_table, **kwargs):
+ command_table['start-session'] = StartSessionCommand(
+ name='start-session',
+ parent_name='ssm',
+ session=session,
+ operation_model=session.get_service_model(
+ 'ssm').operation_model('StartSession'),
+ operation_caller=StartSessionCaller(session),
+ )
+
+
+class StartSessionCommand(ServiceOperation):
+
+ def create_help_command(self):
+ help_command = super(
+ StartSessionCommand, self).create_help_command()
+ # Change the output shape because the command provides no output.
+ self._operation_model.output_shape = None
+ return help_command
+
+
+class StartSessionCaller(CLIOperationCaller):
+ def invoke(self, service_name, operation_name, parameters,
+ parsed_globals):
+ client = self._session.create_client(
+ service_name, region_name=parsed_globals.region,
+ endpoint_url=parsed_globals.endpoint_url,
+ verify=parsed_globals.verify_ssl)
+ response = client.start_session(**parameters)
+ session_id = response['SessionId']
+ region_name = client.meta.region_name
+ # profile_name is used to passed on to session manager plugin
+ # to fetch same profile credentials to make an api call in the plugin.
+ # If no profile is passed then pass on empty string
+ profile_name = self._session.profile \
+ if self._session.profile is not None else ''
+ endpoint_url = client.meta.endpoint_url
+
+ try:
+ # ignore_user_entered_signals ignores these signals
+ # because if signals which kills the process are not
+ # captured would kill the foreground process but not the
+ # background one. Capturing these would prevents process
+ # from getting killed and these signals are input to plugin
+ # and handling in there
+ with ignore_user_entered_signals():
+ # call executable with necessary input
+ check_call(["session-manager-plugin",
+ json.dumps(response),
+ region_name,
+ "StartSession",
+ profile_name,
+ json.dumps(parameters),
+ endpoint_url])
+ return 0
+ except OSError as ex:
+ if ex.errno == errno.ENOENT:
+ logger.debug('SessionManagerPlugin is not present',
+ exc_info=True)
+ # start-session api call returns response and starts the
+ # session on ssm-agent and response is forwarded to
+ # session-manager-plugin. If plugin is not present, terminate
+ # is called so that service and ssm-agent terminates the
+ # session to avoid zombie session active on ssm-agent for
+ # default self terminate time
+ client.terminate_session(SessionId=session_id)
+ raise ValueError(''.join(ERROR_MESSAGE))
diff -Nru awscli-1.11.13/awscli/customizations/sms_voice.py awscli-1.18.69/awscli/customizations/sms_voice.py
--- awscli-1.11.13/awscli/customizations/sms_voice.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/sms_voice.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,21 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+
+
+def register_sms_voice_hide(event_emitter):
+ event_emitter.register('building-command-table.main',
+ hide_sms_voice)
+
+
+def hide_sms_voice(command_table, session, **kwargs):
+ command_table['sms-voice']._UNDOCUMENTED = True
diff -Nru awscli-1.11.13/awscli/customizations/streamingoutputarg.py awscli-1.18.69/awscli/customizations/streamingoutputarg.py
--- awscli-1.11.13/awscli/customizations/streamingoutputarg.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/streamingoutputarg.py 2020-05-28 19:25:48.000000000 +0000
@@ -86,10 +86,10 @@
def add_to_params(self, parameters, value):
self._output_file = value
- service_name = self._operation_model.service_model.endpoint_prefix
+ service_id = self._operation_model.service_model.service_id.hyphenize()
operation_name = self._operation_model.name
self._session.register('after-call.%s.%s' % (
- service_name, operation_name), self.save_file)
+ service_id, operation_name), self.save_file)
def save_file(self, parsed, **kwargs):
if self._response_key not in parsed:
diff -Nru awscli-1.11.13/awscli/customizations/translate.py awscli-1.18.69/awscli/customizations/translate.py
--- awscli-1.11.13/awscli/customizations/translate.py 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/translate.py 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,67 @@
+# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"). You
+# may not use this file except in compliance with the License. A copy of
+# the License is located at
+#
+# http://aws.amazon.com/apache2.0/
+#
+# or in the "license" file accompanying this file. This file is
+# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific
+# language governing permissions and limitations under the License.
+import copy
+
+from awscli.arguments import CustomArgument, CLIArgument
+
+FILE_DOCSTRING = ('
The path to the file of the code you are uploading. '
+ 'Example: fileb://data.csv
')
+
+
+def register_translate_import_terminology(cli):
+ cli.register('building-argument-table.translate.import-terminology',
+ _hoist_file_parameter)
+
+
+def _hoist_file_parameter(session, argument_table, **kwargs):
+ argument_table['data-file'] = FileArgument(
+ 'data-file', help_text=FILE_DOCSTRING, cli_type_name='blob',
+ required=True)
+ file_argument = argument_table['terminology-data']
+ file_model = copy.deepcopy(file_argument.argument_model)
+ del file_model.members['File']
+ argument_table['terminology-data'] = TerminologyDataArgument(
+ name='terminology-data',
+ argument_model=file_model,
+ operation_model=file_argument._operation_model,
+ is_required=False,
+ event_emitter=session.get_component('event_emitter'),
+ serialized_name='TerminologyData'
+ )
+
+
+class FileArgument(CustomArgument):
+ def add_to_params(self, parameters, value):
+ if value is None:
+ return
+ file_param = {'File': value}
+ if parameters.get('TerminologyData'):
+ parameters['TerminologyData'].update(file_param)
+ else:
+ parameters['TerminologyData'] = file_param
+
+
+class TerminologyDataArgument(CLIArgument):
+ def add_to_params(self, parameters, value):
+ if value is None:
+ return
+ unpacked = self._unpack_argument(value)
+ if 'File' in unpacked:
+ raise ValueError("File cannot be provided as part of the "
+ "'--terminology-data' argument. Please use the "
+ "'--data-file' option instead to specify a "
+ "file.")
+ if parameters.get('TerminologyData'):
+ parameters['TerminologyData'].update(unpacked)
+ else:
+ parameters['TerminologyData'] = unpacked
diff -Nru awscli-1.11.13/awscli/customizations/utils.py awscli-1.18.69/awscli/customizations/utils.py
--- awscli-1.11.13/awscli/customizations/utils.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/utils.py 2020-05-28 19:25:48.000000000 +0000
@@ -15,6 +15,7 @@
"""
import copy
+import sys
from botocore.exceptions import ClientError
@@ -26,6 +27,14 @@
del argument_table[existing_name]
+def _copy_argument(argument_table, current_name, copy_name):
+ current = argument_table[current_name]
+ copy_arg = copy.copy(current)
+ copy_arg.name = copy_name
+ argument_table[copy_name] = copy_arg
+ return copy_arg
+
+
def make_hidden_alias(argument_table, existing_name, alias_name):
"""Create a hidden alias for an existing argument.
@@ -39,9 +48,8 @@
"""
current = argument_table[existing_name]
- copy_arg = copy.copy(current)
+ copy_arg = _copy_argument(argument_table, existing_name, alias_name)
copy_arg._UNDOCUMENTED = True
- copy_arg.name = alias_name
if current.required:
# If the current argument is required, then
# we'll mark both as not required, but
@@ -50,7 +58,6 @@
copy_arg.required = False
current.required = False
current._DOCUMENT_AS_REQUIRED = True
- argument_table[alias_name] = copy_arg
def rename_command(command_table, existing_name, new_name):
@@ -60,6 +67,46 @@
del command_table[existing_name]
+def alias_command(command_table, existing_name, new_name):
+ """Moves an argument to a new name, keeping the old as a hidden alias.
+
+ :type command_table: dict
+ :param command_table: The full command table for the CLI or a service.
+
+ :type existing_name: str
+ :param existing_name: The current name of the command.
+
+ :type new_name: str
+ :param new_name: The new name for the command.
+ """
+ current = command_table[existing_name]
+ _copy_argument(command_table, existing_name, new_name)
+ current._UNDOCUMENTED = True
+
+
+def make_hidden_command_alias(command_table, existing_name, alias_name):
+ """Create a hidden alias for an exiting command.
+
+ This will copy an existing command object in a command table and add a new
+ entry to the command table with a different name. The new command will
+ be undocumented.
+
+ This is needed if you want to change an existing command, but you still
+ need the old name to work for backwards compatibility reasons.
+
+ :type command_table: dict
+ :param command_table: The full command table for the CLI or a service.
+
+ :type existing_name: str
+ :param existing_name: The current name of the command.
+
+ :type alias_name: str
+ :param alias_name: The new name for the command.
+ """
+ new = _copy_argument(command_table, existing_name, alias_name)
+ new._UNDOCUMENTED = True
+
+
def validate_mutually_exclusive_handler(*groups):
def _handler(parsed_args, **kwargs):
return validate_mutually_exclusive(parsed_args, *groups)
@@ -126,3 +173,57 @@
if overrides:
client_args.update(overrides)
return session.create_client(service_name, **client_args)
+
+
+def uni_print(statement, out_file=None):
+ """
+ This function is used to properly write unicode to a file, usually
+ stdout or stdderr. It ensures that the proper encoding is used if the
+ statement is not a string type.
+ """
+ if out_file is None:
+ out_file = sys.stdout
+ try:
+ # Otherwise we assume that out_file is a
+ # text writer type that accepts str/unicode instead
+ # of bytes.
+ out_file.write(statement)
+ except UnicodeEncodeError:
+ # Some file like objects like cStringIO will
+ # try to decode as ascii on python2.
+ #
+ # This can also fail if our encoding associated
+ # with the text writer cannot encode the unicode
+ # ``statement`` we've been given. This commonly
+ # happens on windows where we have some S3 key
+ # previously encoded with utf-8 that can't be
+ # encoded using whatever codepage the user has
+ # configured in their console.
+ #
+ # At this point we've already failed to do what's
+ # been requested. We now try to make a best effort
+ # attempt at printing the statement to the outfile.
+ # We're using 'ascii' as the default because if the
+ # stream doesn't give us any encoding information
+ # we want to pick an encoding that has the highest
+ # chance of printing successfully.
+ new_encoding = getattr(out_file, 'encoding', 'ascii')
+ # When the output of the aws command is being piped,
+ # ``sys.stdout.encoding`` is ``None``.
+ if new_encoding is None:
+ new_encoding = 'ascii'
+ new_statement = statement.encode(
+ new_encoding, 'replace').decode(new_encoding)
+ out_file.write(new_statement)
+ out_file.flush()
+
+
+def get_policy_arn_suffix(region):
+ """Method to return region value as expected by policy arn"""
+ region_string = region.lower()
+ if region_string.startswith("cn-"):
+ return "aws-cn"
+ elif region_string.startswith("us-gov"):
+ return "aws-us-gov"
+ else:
+ return "aws"
diff -Nru awscli-1.11.13/awscli/customizations/waiters.py awscli-1.18.69/awscli/customizations/waiters.py
--- awscli-1.11.13/awscli/customizations/waiters.py 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/customizations/waiters.py 2020-05-28 19:25:48.000000000 +0000
@@ -51,7 +51,9 @@
class WaitCommand(BasicCommand):
NAME = 'wait'
- DESCRIPTION = 'Wait until a particular condition is satisfied.'
+ DESCRIPTION = ('Wait until a particular condition is satisfied. Each '
+ 'subcommand polls an API until the listed requirement '
+ 'is met.')
def __init__(self, session, waiter_model, service_model):
self._model = waiter_model
diff -Nru awscli-1.11.13/awscli/examples/acm/list-certificates.rst awscli-1.18.69/awscli/examples/acm/list-certificates.rst
--- awscli-1.11.13/awscli/examples/acm/list-certificates.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm/list-certificates.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,7 +4,7 @@
aws acm list-certificates
-The preceding command produces the following output::
+The preceding command produces output similar to the following::
{
"CertificateSummaryList": [
@@ -19,30 +19,40 @@
]
}
-You can also filter your output by using the "certificate-statuses" argument. The following command displays certificates that have a PENDING_VALIDATION status::
-
- aws acm list-certificates --certificate-statuses PENDING_VALIDATION
-
-Finally, you can decide how many certificates you want to display each time you call ``list-certificates``. For example, to display no more than two certificates at a time, set the ``max-items`` argument to 2 as in the following example::
+You can decide how many certificates you want to display each time you call ``list-certificates``. For example, if you have four certificates and you want to display no more than two at a time, set the ``max-items`` argument to 2 as in the following example::
aws acm list-certificates --max-items 2
Two certificate ARNs and a ``NextToken`` value will be displayed::
- {
- "CertificateSummaryList": [
- {
- "CertificateArn": "arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012",
- "DomainName": "www.example.com"
- },
- {
- "CertificateArn": "arn:aws:acm:us-east-1:493619779192:certificate/87654321-4321-4321-4321-210987654321",
- "DomainName": "www.example.net"
- }
- ],
+ "CertificateSummaryList": [
+ {
+ "CertificateArn": "arn:aws:acm:us-east-1:123456789012: \
+ certificate/12345678-1234-1234-1234-123456789012",
+ "DomainName": "www.example.com"
+ },
+ {
+ "CertificateArn": "arn:aws:acm:us-east-1:123456789012: \
+ certificate/87654321-4321-4321-4321-210987654321",
+ "DomainName": "www.example.net"
+ }
+ ],
"NextToken": "9f4d9f69-275a-41fe-b58e-2b837bd9ba48"
- }
-
+
To display the next two certificates in your account, set this ``NextToken`` value in your next call::
aws acm list-certificates --max-items 2 --next-token 9f4d9f69-275a-41fe-b58e-2b837bd9ba48
+
+
+You can filter your output by using the ``certificate-statuses`` argument. The following command displays certificates that have a PENDING_VALIDATION status::
+
+ aws acm list-certificates --certificate-statuses PENDING_VALIDATION
+
+You can also filter your output by using the ``includes`` argument. The following command displays certificates filtered on the following properties. The certificates to be displayed::
+
+ - Specify that the RSA algorithm and a 2048 bit key are used to generate key pairs.
+ - Contain a Key Usage extension that specifies that the certificates can be used to create digital signatures.
+ - Contain an Extended Key Usage extension that specifies that the certificates can be used for code signing.
+
+ aws acm list-certificates --max-items 10 --includes extendedKeyUsage=CODE_SIGNING,keyUsage=DIGITAL_SIGNATURE,keyTypes=RSA_2048
+
diff -Nru awscli-1.11.13/awscli/examples/acm/request-certificate.rst awscli-1.18.69/awscli/examples/acm/request-certificate.rst
--- awscli-1.11.13/awscli/examples/acm/request-certificate.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm/request-certificate.rst 2020-05-28 19:26:18.000000000 +0000
@@ -1,21 +1,33 @@
**To request a new ACM certificate**
-The following ``request-certificate`` command requests a new certificate for the www.example.com domain::
+The following ``request-certificate`` command requests a new certificate for the www.example.com domain using DNS validation::
- aws acm request-certificate --domain-name www.example.com
+ aws acm request-certificate --domain-name www.example.com --validation-method DNS
You can enter an idempotency token to distinguish between calls to ``request-certificate``::
- aws acm request-certificate --domain-name www.example.com --idempotency-token 91adc45q
+ aws acm request-certificate --domain-name www.example.com --validation-method DNS --idempotency-token 91adc45q
-You can enter an alternative name that can be used to reach your website::
+You can enter one or more subject alternative names to request a certificate that will protect more than one apex domain::
- aws acm request-certificate --domain-name www.example.com --idempotency-token 91adc45q --subject-alternative-names www.example.net
+ aws acm request-certificate --domain-name example.com --validation-method DNS --idempotency-token 91adc45q --subject-alternative-names www.example.net
+
+You can enter an alternative name that can also be used to reach your website::
+
+ aws acm request-certificate --domain-name example.com --validation-method DNS --idempotency-token 91adc45q --subject-alternative-names www.example.com
+
+You can use an asterisk (*) as a wildcard to create a certificate for several subdomains in the same domain::
+
+ aws acm request-certificate --domain-name example.com --validation-method DNS --idempotency-token 91adc45q --subject-alternative-names *.example.com
You can also enter multiple alternative names::
- aws acm request-certificate --domain-name a.example.com --subject-alternative-names b.example.com c.example.com d.example.com *.e.example.com *.f.example.com
+ aws acm request-certificate --domain-name example.com --validation-method DNS --subject-alternative-names b.example.com c.example.com d.example.com
+
+If you are using email for validation, you can enter domain validation options to specify the domain to which the validation email will be sent::
-You can also enter domain validation options to specify the domain to which validation email will be sent::
+ aws acm request-certificate --domain-name example.com --validation-method EMAIL --subject-alternative-names www.example.com --domain-validation-options DomainName=example.com,ValidationDomain=example.com
+
+The following command opts out of certificate transparency logging when you request a new certificate::
- aws acm request-certificate --domain-name example.com --subject-alternative-names www.example.com --domain-validation-options DomainName=www.example.com,ValidationDomain=example.com
+ aws acm request-certificate --domain-name www.example.com --validation-method DNS --certificate-options CertificateTransparencyLoggingPreference=DISABLED --idempotency-token 184627
diff -Nru awscli-1.11.13/awscli/examples/acm/update-certificate-options.rst awscli-1.18.69/awscli/examples/acm/update-certificate-options.rst
--- awscli-1.11.13/awscli/examples/acm/update-certificate-options.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm/update-certificate-options.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,6 @@
+**To update the certificate options**
+
+The following ``update-certificate-options`` command opts out of certificate transparency logging::
+
+ aws acm update-certificate-options --certificate-arn arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012 --options CertificateTransparencyLoggingPreference=DISABLED
+
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/create-certificate-authority-audit-report.rst awscli-1.18.69/awscli/examples/acm-pca/create-certificate-authority-audit-report.rst
--- awscli-1.11.13/awscli/examples/acm-pca/create-certificate-authority-audit-report.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/create-certificate-authority-audit-report.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To create a certificate authority audit report**
+
+The following ``create-certificate-authority-audit-report`` command creates an audit report for the private CA identified by the ARN. ::
+
+ aws acm-pca create-certificate-authority-audit-report --certificate-authority-arn arn:aws:acm-pca:us-east-1:accountid:certificate-authority/12345678-1234-1234-1234-123456789012 --s3-bucket-name your-bucket-name --audit-report-response-format JSON
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/create-certificate-authority.rst awscli-1.18.69/awscli/examples/acm-pca/create-certificate-authority.rst
--- awscli-1.11.13/awscli/examples/acm-pca/create-certificate-authority.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/create-certificate-authority.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To create a private certificate authority**
+
+The following ``create-certificate-authority`` command creates a private certificate authority in your AWS account. ::
+
+ aws acm-pca create-certificate-authority --certificate-authority-configuration file://C:\ca_config.txt --revocation-configuration file://C:\revoke_config.txt --certificate-authority-type "SUBORDINATE" --idempotency-token 98256344
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/delete-certificate-authority.rst awscli-1.18.69/awscli/examples/acm-pca/delete-certificate-authority.rst
--- awscli-1.11.13/awscli/examples/acm-pca/delete-certificate-authority.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/delete-certificate-authority.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To delete a private certificate authority**
+
+The following ``delete-certificate-authority`` command deletes the certificate authority identified by the ARN. ::
+
+ aws acm-pca delete-certificate-authority --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/describe-certificate-authority-audit-report.rst awscli-1.18.69/awscli/examples/acm-pca/describe-certificate-authority-audit-report.rst
--- awscli-1.11.13/awscli/examples/acm-pca/describe-certificate-authority-audit-report.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/describe-certificate-authority-audit-report.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To describe an audit report for a certificate authority**
+
+The following ``describe-certificate-authority-audit-report`` command lists information about the specified audit report for the CA identified by the ARN. ::
+
+ aws acm-pca describe-certificate-authority-audit-report --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/99999999-8888-7777-6666-555555555555 --audit-report-id 11111111-2222-3333-4444-555555555555
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/describe-certificate-authority.rst awscli-1.18.69/awscli/examples/acm-pca/describe-certificate-authority.rst
--- awscli-1.11.13/awscli/examples/acm-pca/describe-certificate-authority.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/describe-certificate-authority.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To describe a private certificate authority**
+
+The following ``describe-certificate-authority`` command lists information about the private CA identified by the ARN. ::
+
+ aws acm-pca describe-certificate-authority --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/get-certificate-authority-certificate.rst awscli-1.18.69/awscli/examples/acm-pca/get-certificate-authority-certificate.rst
--- awscli-1.11.13/awscli/examples/acm-pca/get-certificate-authority-certificate.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/get-certificate-authority-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To retrieve a certificate authority (CA) certificate**
+
+The following ``get-certificate-authority-certificate`` command retrieves the certificate and certificate chain for the private CA specified by the ARN. ::
+
+ aws acm-pca get-certificate-authority-certificate --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012 --output text
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/get-certificate-authority-csr.rst awscli-1.18.69/awscli/examples/acm-pca/get-certificate-authority-csr.rst
--- awscli-1.11.13/awscli/examples/acm-pca/get-certificate-authority-csr.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/get-certificate-authority-csr.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To retrieve the certificate signing request for a certificate authority**
+
+The following ``get-certificate-authority-csr`` command retrieves the CSR for the private CA specified by the ARN. ::
+
+ aws acm-pca get-certificate-authority-csr --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012 --output text
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/get-certificate.rst awscli-1.18.69/awscli/examples/acm-pca/get-certificate.rst
--- awscli-1.11.13/awscli/examples/acm-pca/get-certificate.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/get-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+**To retrieve an issued certificate**
+
+The following ``get-certificate`` example retrieves a certificate from the specified private CA. ::
+
+ aws acm-pca get-certificate \
+ --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012 \
+ --certificate-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012/certificate/6707447683a9b7f4055627ffd55cebcc \
+ --output text
+
+Output:
+
+The first part of the output is the certificate itself. The second part is the certificate chain that chains to the root CA certificate. Note that when you use the ``--output text`` option, a ``TAB`` character is inserted between the two certificate pieces (that is the cause of the indented text). If you intend to take this output and parse the certificates with other tools, you might need to remove the ``TAB`` character so it is processed correctly. ::
+
+ -----BEGIN CERTIFICATE-----
+ MIIEDzCCAvegAwIBAgIRAJuJ8f6ZVYL7gG/rS3qvrZMwDQYJKoZIhvcNAQELBQAw
+ cTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
+ ....certificate body truncated for brevity....
+ tKCSglgZZrd4FdLw1EkGm+UVXnodwMtJEQyy3oTfZjURPIyyaqskTu/KSS7YDjK0
+ KQNy73D6LtmdOEbAyq10XiDxqY41lvKHJ1eZrPaBmYNABxU=
+ -----END CERTIFICATE-----
+ -----BEGIN CERTIFICATE-----
+ MIIDrzCCApegAwIBAgIRAOskdzLvcj1eShkoyEE693AwDQYJKoZIhvcNAQELBQAw
+ cTELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1Nl
+ ...certificate body truncated for brevity....
+ kdRGB6P2hpxstDOUIwAoCbhoaWwfA4ybJznf+jOQhAziNlRdKQRR8nODWpKt7H9w
+ dJ5nxsTk/fniJz86Ddtp6n8s82wYdkN3cVffeK72A9aTCOU=
+ -----END CERTIFICATE-----
+
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/import-certificate-authority-certificate.rst awscli-1.18.69/awscli/examples/acm-pca/import-certificate-authority-certificate.rst
--- awscli-1.11.13/awscli/examples/acm-pca/import-certificate-authority-certificate.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/import-certificate-authority-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To import your certificate authority certificate into ACM PCA**
+
+The following ``import-certificate-authority-certificate`` command imports the signed private CA certificate for the CA specified by the ARN into ACM PCA. ::
+
+ aws acm-pca import-certificate-authority-certificate --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012 --certificate file://C:\ca_cert.pem --certificate-chain file://C:\ca_cert_chain.pem
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/issue-certificate.rst awscli-1.18.69/awscli/examples/acm-pca/issue-certificate.rst
--- awscli-1.11.13/awscli/examples/acm-pca/issue-certificate.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/issue-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To issue a private certificate**
+
+The following ``issue-certificate`` command uses the private CA specified by the ARN to issue a private certificate. ::
+
+ aws acm-pca issue-certificate --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012 --csr file://C:\cert_1.csr --signing-algorithm "SHA256WITHRSA" --validity Value=365,Type="DAYS" --idempotency-token 1234
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/list-certificate-authorities.rst awscli-1.18.69/awscli/examples/acm-pca/list-certificate-authorities.rst
--- awscli-1.11.13/awscli/examples/acm-pca/list-certificate-authorities.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/list-certificate-authorities.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To list your private certificate authorities**
+
+The following ``list-certificate-authorities`` command lists information about all of the private CAs in your account. ::
+
+ aws acm-pca list-certificate-authorities --max-results 10
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/list-tags.rst awscli-1.18.69/awscli/examples/acm-pca/list-tags.rst
--- awscli-1.11.13/awscli/examples/acm-pca/list-tags.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/list-tags.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To list the tags for your certificate authority**
+
+The following ``list-tags`` command lists the tags associated with the private CA specified by the ARN. ::
+
+ aws acm-pca list-tags --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/123455678-1234-1234-1234-123456789012 --max-results 10
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/revoke-certificate.rst awscli-1.18.69/awscli/examples/acm-pca/revoke-certificate.rst
--- awscli-1.11.13/awscli/examples/acm-pca/revoke-certificate.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/revoke-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To revoke a private certificate**
+
+The following ``revoke-certificate`` command revokes a private certificate from the CA identified by the ARN. ::
+
+ aws acm-pca revoke-certificate --certificate-authority-arn arn:aws:acm-pca:us-west-2:1234567890:certificate-authority/12345678-1234-1234-1234-123456789012 --certificate-serial 67:07:44:76:83:a9:b7:f4:05:56:27:ff:d5:5c:eb:cc --revocation-reason "KEY_COMPROMISE"
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/tag-certificate-authority.rst awscli-1.18.69/awscli/examples/acm-pca/tag-certificate-authority.rst
--- awscli-1.11.13/awscli/examples/acm-pca/tag-certificate-authority.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/tag-certificate-authority.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To attach tags to a private certificate authority**
+
+The following ``tag-certificate-authority`` command attaches one or more tags to your private CA. ::
+
+ aws acm-pca tag-certificate-authority --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012 --tags Key=Admin,Value=Alice
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/untag-certificate-authority.rst awscli-1.18.69/awscli/examples/acm-pca/untag-certificate-authority.rst
--- awscli-1.11.13/awscli/examples/acm-pca/untag-certificate-authority.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/untag-certificate-authority.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To remove one or more tags from your private certificate authority**
+
+The following ``untag-certificate-authority`` command removes tags from the private CA identified by the ARN. ::
+
+ aws acm-pca untag-certificate-authority --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012 --tags Key=Purpose,Value=Website
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/acm-pca/update-certificate-authority.rst awscli-1.18.69/awscli/examples/acm-pca/update-certificate-authority.rst
--- awscli-1.11.13/awscli/examples/acm-pca/update-certificate-authority.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/acm-pca/update-certificate-authority.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,5 @@
+**To update the configuration of your private certificate authority**
+
+The following ``update-certificate-authority`` command updates the status and configuration of the private CA identified by the ARN. ::
+
+ aws acm-pca update-certificate-authority --certificate-authority-arn arn:aws:acm-pca:us-west-2:123456789012:certificate-authority/12345678-1234-1234-1234-1232456789012 --revocation-configuration file://C:\revoke_config.txt --status "DISABLED"
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/alexaforbusiness/create-network-profile.rst awscli-1.18.69/awscli/examples/alexaforbusiness/create-network-profile.rst
--- awscli-1.11.13/awscli/examples/alexaforbusiness/create-network-profile.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/alexaforbusiness/create-network-profile.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To create a network profile**
+
+The following ``create-network-profile`` example creates a network profile with the specified details. ::
+
+ aws alexaforbusiness create-network-profile \
+ --network-profile-name Network123 \
+ --ssid Janenetwork \
+ --security-type WPA2_PSK \
+ --current-password 12345
+
+Output::
+
+ {
+ "NetworkProfileArn": "arn:aws:a4b:us-east-1:123456789012:network-profile/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222"
+ }
+
+For more information, see `Managing Network Profiles `__ in the *Alexa for Business Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/alexaforbusiness/delete-network-profile.rst awscli-1.18.69/awscli/examples/alexaforbusiness/delete-network-profile.rst
--- awscli-1.11.13/awscli/examples/alexaforbusiness/delete-network-profile.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/alexaforbusiness/delete-network-profile.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete a network profile**
+
+The following ``delete-network-profile`` example deletes the specified network profile. ::
+
+ aws alexaforbusiness delete-network-profile \
+ --network-profile-arn arn:aws:a4b:us-east-1:123456789012:network-profile/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222
+
+This command produces no output.
+
+For more information, see `Managing Network Profiles `__ in the *Alexa for Business Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/alexaforbusiness/get-network-profile.rst awscli-1.18.69/awscli/examples/alexaforbusiness/get-network-profile.rst
--- awscli-1.11.13/awscli/examples/alexaforbusiness/get-network-profile.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/alexaforbusiness/get-network-profile.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,20 @@
+**To get network profile details**
+
+The following ``get-network-profile`` example retrieves details of the specified network profile. ::
+
+ aws alexaforbusiness get-network-profile \
+ --network-profile-arn arn:aws:a4b:us-east-1:123456789012:network-profile/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
+
+Output::
+
+ {
+ "NetworkProfile": {
+ "NetworkProfileArn": "arn:aws:a4b:us-east-1:123456789012:network-profile/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
+ "NetworkProfileName": "Networkprofile",
+ "Ssid": "Janenetwork",
+ "SecurityType": "WPA2_PSK",
+ "CurrentPassword": "12345"
+ }
+ }
+
+For more information, see `Managing Network Profiles `__ in the *Alexa for Business Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/alexaforbusiness/search-network-profiles.rst awscli-1.18.69/awscli/examples/alexaforbusiness/search-network-profiles.rst
--- awscli-1.11.13/awscli/examples/alexaforbusiness/search-network-profiles.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/alexaforbusiness/search-network-profiles.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,34 @@
+**To search network profiles**
+
+The following ``search-network-profiles`` example lists network profiles that meet a set of filter and sort criteria. In this example, all profiles are listed. ::
+
+ aws alexaforbusiness search-network-profiles
+
+Output::
+
+ {
+ "NetworkProfiles": [
+ {
+ "NetworkProfileArn": "arn:aws:a4b:us-east-1:123456789111:network-profile/a1b2c3d4-5678-90ab-cdef-EXAMPLE22222/a1b2c3d4-5678-90ab-cdef-EXAMPLE33333",
+ "NetworkProfileName": "Networkprofile1",
+ "Description": "Personal network",
+ "Ssid": "Janenetwork",
+ "SecurityType": "WPA2_PSK"
+ },
+ {
+ "NetworkProfileArn": "arn:aws:a4b:us-east-1:123456789222:network-profile/a1b2c3d4-5678-90ab-cdef-EXAMPLE44444/a1b2c3d4-5678-90ab-cdef-EXAMPLE55555",
+ "NetworkProfileName": "Networkprofile2",
+ "Ssid": "Johnnetwork",
+ "SecurityType": "WPA2_PSK"
+ },
+ {
+ "NetworkProfileArn": "arn:aws:a4b:us-east-1:123456789333:network-profile/a1b2c3d4-5678-90ab-cdef-EXAMPLE66666/a1b2c3d4-5678-90ab-cdef-EXAMPLE77777",
+ "NetworkProfileName": "Networkprofile3",
+ "Ssid": "Carlosnetwork",
+ "SecurityType": "WPA2_PSK"
+ }
+ ],
+ "TotalCount": 3
+ }
+
+For more information, see `Managing Network Profiles `__ in the *Alexa for Business Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/alexaforbusiness/update-network-profile.rst awscli-1.18.69/awscli/examples/alexaforbusiness/update-network-profile.rst
--- awscli-1.11.13/awscli/examples/alexaforbusiness/update-network-profile.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/alexaforbusiness/update-network-profile.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To update a network profile**
+
+The following ``update-network-profile`` example updates the specified network profile by using the network profile ARN. ::
+
+ aws alexaforbusiness update-network-profile \
+ --network-profile-arn arn:aws:a4b:us-east-1:123456789012:network-profile/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \
+ --network-profile-name Networkprofile
+
+This command produces no output.
+
+For more information, see `Managing Network Profiles `__ in the *Alexa for Business Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-api-key.rst awscli-1.18.69/awscli/examples/apigateway/create-api-key.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-api-key.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-api-key.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To create an API key that is enabled for an existing API and Stage in the specified region**
+**To create an API key that is enabled for an existing API and Stage**
Command::
- aws apigateway create-api-key --name 'Dev API Key' --description 'Used for development' --enabled --stage-keys restApiId='a1b2c3d4e5',stageName='dev' --region us-west-2
-
+ aws apigateway create-api-key --name 'Dev API Key' --description 'Used for development' --enabled --stage-keys restApiId='a1b2c3d4e5',stageName='dev'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-authorizer.rst awscli-1.18.69/awscli/examples/apigateway/create-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-authorizer.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-authorizer.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To create a token based API Gateway Custom Authorizer for the API in the specified region**
+**To create a token based API Gateway Custom Authorizer for the API**
Command::
- aws apigateway create-authorizer --rest-api-id 1234123412 --name 'First_Token_Custom_Authorizer' --type TOKEN --authorizer-uri 'arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthFunction/invocations' --identity-source 'method.request.header.Authorization' --authorizer-result-ttl-in-seconds 300 --region us-west-2
+ aws apigateway create-authorizer --rest-api-id 1234123412 --name 'First_Token_Custom_Authorizer' --type TOKEN --authorizer-uri 'arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthFunction/invocations' --identity-source 'method.request.header.Authorization' --authorizer-result-ttl-in-seconds 300
Output::
@@ -16,11 +16,11 @@
"id": "z40xj0"
}
-**To create a Cognito User Pools based API Gateway Custom Authorizer for the API in the specified region**
+**To create a Cognito User Pools based API Gateway Custom Authorizer for the API**
Command::
- aws apigateway create-authorizer --rest-api-id 1234123412 --name 'First_Cognito_Custom_Authorizer' --type COGNITO_USER_POOLS --provider-arns 'arn:aws:cognito-idp:us-east-1:123412341234:userpool/us-east-1_aWcZeQbuD' --identity-source 'method.request.header.Authorization' --region us-west-2
+ aws apigateway create-authorizer --rest-api-id 1234123412 --name 'First_Cognito_Custom_Authorizer' --type COGNITO_USER_POOLS --provider-arns 'arn:aws:cognito-idp:us-east-1:123412341234:userpool/us-east-1_aWcZeQbuD' --identity-source 'method.request.header.Authorization'
Output::
@@ -34,4 +34,3 @@
"type": "COGNITO_USER_POOLS",
"id": "5yid1t"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-base-path-mapping.rst awscli-1.18.69/awscli/examples/apigateway/create-base-path-mapping.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-base-path-mapping.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-base-path-mapping.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To create the per-region base path mapping for a custom domain name**
+**To create the base path mapping for a custom domain name**
Command::
- aws apigateway create-base-path-mapping --domain-name subdomain.domain.tld --rest-api-id 1234123412 --stage prod --base-path v1 --region us-west-2
-
+ aws apigateway create-base-path-mapping --domain-name subdomain.domain.tld --rest-api-id 1234123412 --stage prod --base-path v1
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-domain-name.rst awscli-1.18.69/awscli/examples/apigateway/create-domain-name.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-domain-name.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-domain-name.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To create the per-region custom domain name**
+**To create the custom domain name**
Command::
- aws apigateway create-domain-name --domain-name 'my.domain.tld' --certificate-name 'my.domain.tld cert' --certificate-body '' --certificate-private-key '' --certificate-chain '' --region us-west-2
-
+ aws apigateway create-domain-name --domain-name 'my.domain.tld' --certificate-name 'my.domain.tld cert' --certificate-arn 'arn:aws:acm:us-east-1:012345678910:certificate/fb1b9770-a305-495d-aefb-27e5e101ff3'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-model.rst awscli-1.18.69/awscli/examples/apigateway/create-model.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-model.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-model.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To create a model for an API in the specified region**
+**To create a model for an API**
Command::
- aws apigateway create-model --rest-api-id 1234123412 --name 'firstModel' --description 'The First Model' --content-type 'application/json' --schema '{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "firstModel", "type": "object", "properties": { "firstProperty" : { "type": "object", "properties": { "key": { "type": "string" } } } } }' --region us-west-2
+ aws apigateway create-model --rest-api-id 1234123412 --name 'firstModel' --description 'The First Model' --content-type 'application/json' --schema '{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "firstModel", "type": "object", "properties": { "firstProperty" : { "type": "object", "properties": { "key": { "type": "string" } } } } }'
Output::
@@ -13,4 +13,3 @@
"id": "2rzg0l",
"schema": "{ \"$schema\": \"http://json-schema.org/draft-04/schema#\", \"title\": \"firstModel\", \"type\": \"object\", \"properties\": { \"firstProperty\" : { \"type\": \"object\", \"properties\": { \"key\": { \"type\": \"string\" } } } } }"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-resource.rst awscli-1.18.69/awscli/examples/apigateway/create-resource.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-resource.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To create a resource in an API for the specified region**
+**To create a resource in an API**
Command::
- aws apigateway create-resource --rest-api-id 1234123412 --parent-id a1b2c3 --path-part 'new-resource' --region us-west-2
-
+ aws apigateway create-resource --rest-api-id 1234123412 --parent-id a1b2c3 --path-part 'new-resource'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-rest-api.rst awscli-1.18.69/awscli/examples/apigateway/create-rest-api.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-rest-api.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-rest-api.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,12 +1,11 @@
-**To create an API in the specified region**
+**To create an API**
Command::
- aws apigateway create-rest-api --name 'My First API' --description 'This is my first API' --region us-west-2
+ aws apigateway create-rest-api --name 'My First API' --description 'This is my first API'
-**To create a duplicate API in the specified region from an existing API in the same region**
+**To create a duplicate API from an existing API**
Command::
- aws apigateway create-rest-api --name 'Copy of My First API' --description 'This is a copy of my first API' --clone-from 1234123412 --region us-west-2
-
+ aws apigateway create-rest-api --name 'Copy of My First API' --description 'This is a copy of my first API' --clone-from 1234123412
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-stage.rst awscli-1.18.69/awscli/examples/apigateway/create-stage.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-stage.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-stage.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,12 +1,11 @@
-**To create a stage in an API which will contain an existing deployment in the specified region**
+**To create a stage in an API which will contain an existing deployment**
Command::
- aws apigateway create-stage --rest-api-id 1234123412 --stage-name 'dev' --description 'Development stage' --deployment-id a1b2c3 --region us-west-2
+ aws apigateway create-stage --rest-api-id 1234123412 --stage-name 'dev' --description 'Development stage' --deployment-id a1b2c3
-**To create a stage in an API which will contain an existing deployment and custom Stage Variables in the specified region**
+**To create a stage in an API which will contain an existing deployment and custom Stage Variables**
Command::
- aws apigateway create-stage --rest-api-id 1234123412 --stage-name 'dev' --description 'Development stage' --deployment-id a1b2c3 --variables key='value',otherKey='otherValue' --region us-west-2
-
+ aws apigateway create-stage --rest-api-id 1234123412 --stage-name 'dev' --description 'Development stage' --deployment-id a1b2c3 --variables key='value',otherKey='otherValue'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-usage-plan-key.rst awscli-1.18.69/awscli/examples/apigateway/create-usage-plan-key.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-usage-plan-key.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-usage-plan-key.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway create-usage-plan-key --usage-plan-id a1b2c3 --key-type "API_KEY" --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu --region us-west-2
-
+ aws apigateway create-usage-plan-key --usage-plan-id a1b2c3 --key-type "API_KEY" --key-id 4vq3yryqm5
diff -Nru awscli-1.11.13/awscli/examples/apigateway/create-usage-plan.rst awscli-1.18.69/awscli/examples/apigateway/create-usage-plan.rst
--- awscli-1.11.13/awscli/examples/apigateway/create-usage-plan.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/create-usage-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway create-usage-plan --name "New Usage Plan" --description "A new usage plan" --throttle burstLimit=10,rateLimit=5 --quota limit=500,offset=0,period=MONTH --region us-west-2
-
+ aws apigateway create-usage-plan --name "New Usage Plan" --description "A new usage plan" --throttle burstLimit=10,rateLimit=5 --quota limit=500,offset=0,period=MONTH
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-api-key.rst awscli-1.18.69/awscli/examples/apigateway/delete-api-key.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-api-key.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-api-key.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete an API key in the specified region**
+**To delete an API key**
Command::
- aws apigateway delete-api-key --api-key 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk --region us-west-2
-
+ aws apigateway delete-api-key --api-key 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-authorizer.rst awscli-1.18.69/awscli/examples/apigateway/delete-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-authorizer.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-authorizer.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a Custom Authorizer in an API within the specified region**
+**To delete a Custom Authorizer in an API**
Command::
- aws apigateway delete-authorizer --rest-api-id 1234123412 --authorizer-id 7gkfbo --region us-west-2
-
+ aws apigateway delete-authorizer --rest-api-id 1234123412 --authorizer-id 7gkfbo
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-base-path-mapping.rst awscli-1.18.69/awscli/examples/apigateway/delete-base-path-mapping.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-base-path-mapping.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-base-path-mapping.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a base path mapping for a custom domain name in the specified region**
+**To delete a base path mapping for a custom domain name**
Command::
- aws apigateway delete-base-path-mapping --domain-name 'api.domain.tld' --base-path 'dev' --region us-west-2
-
+ aws apigateway delete-base-path-mapping --domain-name 'api.domain.tld' --base-path 'dev'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-client-certificate.rst awscli-1.18.69/awscli/examples/apigateway/delete-client-certificate.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-client-certificate.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-client-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a client certificate in the specified region**
+**To delete a client certificate**
Command::
- aws apigateway delete-client-certificate --client-certificate-id a1b2c3 --region us-west-2
-
+ aws apigateway delete-client-certificate --client-certificate-id a1b2c3
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-deployment.rst awscli-1.18.69/awscli/examples/apigateway/delete-deployment.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-deployment.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-deployment.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a deployment in an API within the specified region**
+**To delete a deployment in an API**
Command::
- aws apigateway delete-deployment --rest-api-id 1234123412 --deployment-id a1b2c3 --region us-west-2
-
+ aws apigateway delete-deployment --rest-api-id 1234123412 --deployment-id a1b2c3
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-domain-name.rst awscli-1.18.69/awscli/examples/apigateway/delete-domain-name.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-domain-name.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-domain-name.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a custom domain name in the specified region**
+**To delete a custom domain name**
Command::
- aws apigateway delete-domain-name --domain-name 'api.domain.tld' --region us-west-2
-
+ aws apigateway delete-domain-name --domain-name 'api.domain.tld'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-integration-response.rst awscli-1.18.69/awscli/examples/apigateway/delete-integration-response.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-integration-response.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-integration-response.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete an integration response for a given resource, method, and status code in an API within the specified region**
+**To delete an integration response for a given resource, method, and status code in an API**
Command::
- aws apigateway delete-integration-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200 --region us-west-2
-
+ aws apigateway delete-integration-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-integration.rst awscli-1.18.69/awscli/examples/apigateway/delete-integration.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-integration.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-integration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete an integration for a given resource and method in an API within the specified region**
+**To delete an integration for a given resource and method in an API**
Command::
- aws apigateway delete-integration --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --region us-west-2
-
+ aws apigateway delete-integration --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-method-response.rst awscli-1.18.69/awscli/examples/apigateway/delete-method-response.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-method-response.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-method-response.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a method response for the given resource, method, and status code in an API within the specified region**
+**To delete a method response for the given resource, method, and status code in an API**
Command::
- aws apigateway delete-method-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200 --region us-west-2
-
+ aws apigateway delete-method-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-method.rst awscli-1.18.69/awscli/examples/apigateway/delete-method.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-method.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-method.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a method for the given resource in an API within the specified region**
+**To delete a method for the given resource in an API**
Command::
- aws apigateway delete-method --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --region us-west-2
-
+ aws apigateway delete-method --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-model.rst awscli-1.18.69/awscli/examples/apigateway/delete-model.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-model.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-model.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a model in the given API within the specified region**
+**To delete a model in the given API**
Command::
- aws apigateway delete-model --rest-api-id 1234123412 --model-name 'customModel' --region us-west-2
-
+ aws apigateway delete-model --rest-api-id 1234123412 --model-name 'customModel'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-resource.rst awscli-1.18.69/awscli/examples/apigateway/delete-resource.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-resource.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a resource in an API within the specified region**
+**To delete a resource in an API**
Command::
- aws apigateway delete-resource --rest-api-id 1234123412 --resource-id a1b2c3 --region us-west-2
-
+ aws apigateway delete-resource --rest-api-id 1234123412 --resource-id a1b2c3
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-rest-api.rst awscli-1.18.69/awscli/examples/apigateway/delete-rest-api.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-rest-api.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-rest-api.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete an API within the specified region**
+**To delete an API**
Command::
- aws apigateway delete-rest-api --rest-api-id 1234123412 --region us-west-2
-
+ aws apigateway delete-rest-api --rest-api-id 1234123412
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-stage.rst awscli-1.18.69/awscli/examples/apigateway/delete-stage.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-stage.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-stage.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To delete a stage in an API within the given region**
+**To delete a stage in an API**
Command::
- aws apigateway delete-stage --rest-api-id 1234123412 --stage-name 'dev' --region us-west-2
-
+ aws apigateway delete-stage --rest-api-id 1234123412 --stage-name 'dev'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-usage-plan-key.rst awscli-1.18.69/awscli/examples/apigateway/delete-usage-plan-key.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-usage-plan-key.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-usage-plan-key.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway delete-usage-plan-key --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu --region us-west-2
-
+ aws apigateway delete-usage-plan-key --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu
diff -Nru awscli-1.11.13/awscli/examples/apigateway/delete-usage-plan.rst awscli-1.18.69/awscli/examples/apigateway/delete-usage-plan.rst
--- awscli-1.11.13/awscli/examples/apigateway/delete-usage-plan.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/delete-usage-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway delete-usage-plan --usage-plan-id a1b2c3 --region us-west-2
-
+ aws apigateway delete-usage-plan --usage-plan-id a1b2c3
diff -Nru awscli-1.11.13/awscli/examples/apigateway/flush-stage-authorizers-cache.rst awscli-1.18.69/awscli/examples/apigateway/flush-stage-authorizers-cache.rst
--- awscli-1.11.13/awscli/examples/apigateway/flush-stage-authorizers-cache.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/flush-stage-authorizers-cache.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway flush-stage-authorizers-cache --rest-api-id 1234123412 --stage-name dev --region us-west-2
-
+ aws apigateway flush-stage-authorizers-cache --rest-api-id 1234123412 --stage-name dev
diff -Nru awscli-1.11.13/awscli/examples/apigateway/flush-stage-cache.rst awscli-1.18.69/awscli/examples/apigateway/flush-stage-cache.rst
--- awscli-1.11.13/awscli/examples/apigateway/flush-stage-cache.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/flush-stage-cache.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway flush-stage-cache --rest-api-id 1234123412 --stage-name dev --region us-west-2
-
+ aws apigateway flush-stage-cache --rest-api-id 1234123412 --stage-name dev
diff -Nru awscli-1.11.13/awscli/examples/apigateway/generate-client-certificate.rst awscli-1.18.69/awscli/examples/apigateway/generate-client-certificate.rst
--- awscli-1.11.13/awscli/examples/apigateway/generate-client-certificate.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/generate-client-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To create a Client-Side SSL Certificate in the specified region**
+**To create a Client-Side SSL Certificate**
Command::
- aws apigateway generate-client-certificate --description 'My First Client Certificate' --region us-west-2
-
+ aws apigateway generate-client-certificate --description 'My First Client Certificate'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-account.rst awscli-1.18.69/awscli/examples/apigateway/get-account.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-account.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-account.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the API Gateway per-region account settings**
+**To get API Gateway account settings**
Command::
- aws apigateway get-account --region us-west-2
+ aws apigateway get-account
Output::
@@ -13,4 +13,3 @@
"burstLimit": 1000
}
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-api-key.rst awscli-1.18.69/awscli/examples/apigateway/get-api-key.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-api-key.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-api-key.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region information about a specific API key**
+**To get the information about a specific API key**
Command::
- aws apigateway get-api-key --api-key 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk --region us-west-2
+ aws apigateway get-api-key --api-key 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk
Output::
@@ -18,4 +18,3 @@
"id": "8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk",
"name": "My key"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-api-keys.rst awscli-1.18.69/awscli/examples/apigateway/get-api-keys.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-api-keys.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-api-keys.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of API keys**
+**To get the list of API keys**
Command::
- aws apigateway get-api-keys --region us-west-2
+ aws apigateway get-api-keys
Output::
@@ -22,4 +22,3 @@
}
]
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-authorizer.rst awscli-1.18.69/awscli/examples/apigateway/get-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-authorizer.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-authorizer.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway get-authorizer --rest-api-id 1234123412 --authorizer-id gfi4n3 --region us-west-2
+ aws apigateway get-authorizer --rest-api-id 1234123412 --authorizer-id gfi4n3
Output::
@@ -14,4 +14,3 @@
"authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:authorizer_function/invocations",
"id": "gfi4n3"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-authorizers.rst awscli-1.18.69/awscli/examples/apigateway/get-authorizers.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-authorizers.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-authorizers.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of authorizers for a REST API**
+**To get the list of authorizers for a REST API**
Command::
- aws apigateway get-authorizers --rest-api-id 1234123412 --region us-west-2
+ aws apigateway get-authorizers --rest-api-id 1234123412
Output::
@@ -18,4 +18,3 @@
}
]
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-base-path-mapping.rst awscli-1.18.69/awscli/examples/apigateway/get-base-path-mapping.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-base-path-mapping.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-base-path-mapping.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region base path mapping for a custom domain name**
+**To get the base path mapping for a custom domain name**
Command::
- aws apigateway get-base-path-mapping --domain-name subdomain.domain.tld --base-path v1 --region us-west-2
+ aws apigateway get-base-path-mapping --domain-name subdomain.domain.tld --base-path v1
Output::
@@ -11,4 +11,3 @@
"restApiId": "1234w4321e",
"stage": "api"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-base-path-mappings.rst awscli-1.18.69/awscli/examples/apigateway/get-base-path-mappings.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-base-path-mappings.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-base-path-mappings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region base path mappings for a custom domain name**
+**To get the base path mappings for a custom domain name**
Command::
- aws apigateway get-base-path-mappings --domain-name subdomain.domain.tld --region us-west-2
+ aws apigateway get-base-path-mappings --domain-name subdomain.domain.tld
Output::
@@ -20,4 +20,3 @@
}
]
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-client-certificate.rst awscli-1.18.69/awscli/examples/apigateway/get-client-certificate.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-client-certificate.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-client-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To get a client certificate in the specified region**
+**To get a client certificate**
Command::
- aws apigateway get-client-certificate --client-certificate-id a1b2c3 --region us-west-2
-
+ aws apigateway get-client-certificate --client-certificate-id a1b2c3
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-client-certificates.rst awscli-1.18.69/awscli/examples/apigateway/get-client-certificates.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-client-certificates.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-client-certificates.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of client certificates**
+**To get a list of client certificates**
Command::
- aws apigateway get-client-certificates --region us-west-2
+ aws apigateway get-client-certificates
Output::
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-deployment.rst awscli-1.18.69/awscli/examples/apigateway/get-deployment.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-deployment.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-deployment.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway get-deployment --rest-api-id 1234123412 --deployment-id ztt4m2 --region us-west-2
+ aws apigateway get-deployment --rest-api-id 1234123412 --deployment-id ztt4m2
Output::
@@ -11,4 +11,3 @@
"id": "ztt4m2",
"createdDate": 1455218022
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-deployments.rst awscli-1.18.69/awscli/examples/apigateway/get-deployments.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-deployments.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-deployments.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of deployments for a REST API**
+**To get a list of deployments for a REST API**
Command::
- aws apigateway get-deployments --rest-api-id 1234123412 --region us-west-2
+ aws apigateway get-deployments --rest-api-id 1234123412
Output::
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-domain-name.rst awscli-1.18.69/awscli/examples/apigateway/get-domain-name.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-domain-name.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-domain-name.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway get-domain-name --domain-name api.domain.tld --region us-west-2
+ aws apigateway get-domain-name --domain-name api.domain.tld
Output::
@@ -12,4 +12,3 @@
"certificateName": "uploadedCertificate",
"certificateUploadDate": 1462565487
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-domain-names.rst awscli-1.18.69/awscli/examples/apigateway/get-domain-names.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-domain-names.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-domain-names.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of custom domain names**
+**To get a list of custom domain names**
Command::
- aws apigateway get-domain-names --region us-west-2
+ aws apigateway get-domain-names
Output::
@@ -16,4 +16,3 @@
}
]
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-models.rst awscli-1.18.69/awscli/examples/apigateway/get-models.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-models.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-models.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of models for a REST API**
+**To get a list of models for a REST API**
Command::
- aws apigateway get-models --rest-api-id 1234123412 --region us-west-2
+ aws apigateway get-models --rest-api-id 1234123412
Output::
@@ -24,4 +24,3 @@
}
]
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-resource.rst awscli-1.18.69/awscli/examples/apigateway/get-resource.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-resource.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway get-resource --rest-api-id 1234123412 --resource-id zwo0y3 --region us-west-2
+ aws apigateway get-resource --rest-api-id 1234123412 --resource-id zwo0y3
Output::
@@ -12,4 +12,3 @@
"id": "zwo0y3",
"parentId": "uyokt6ij2g"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-resources.rst awscli-1.18.69/awscli/examples/apigateway/get-resources.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-resources.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-resources.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of resources for a REST API**
+**To get a list of resources for a REST API**
Command::
- aws apigateway get-resources --rest-api-id 1234123412 --region us-west-2
+ aws apigateway get-resources --rest-api-id 1234123412
Output::
@@ -19,4 +19,3 @@
}
]
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-rest-api.rst awscli-1.18.69/awscli/examples/apigateway/get-rest-api.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-rest-api.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-rest-api.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway get-rest-api --rest-api-id 1234123412 --region us-west-2
+ aws apigateway get-rest-api --rest-api-id 1234123412
Output::
@@ -11,4 +11,3 @@
"id": "o1y243m4f5",
"createdDate": 1453416433
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-rest-apis.rst awscli-1.18.69/awscli/examples/apigateway/get-rest-apis.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-rest-apis.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-rest-apis.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of REST APIs**
+**To get a list of REST APIs**
Command::
- aws apigateway get-rest-apis --region us-west-2
+ aws apigateway get-rest-apis
Output::
@@ -15,4 +15,3 @@
}
]
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-stage.rst awscli-1.18.69/awscli/examples/apigateway/get-stage.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-stage.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-stage.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway get-stage --rest-api-id 1234123412 --stage-name dev --region us-west-2
+ aws apigateway get-stage --rest-api-id 1234123412 --stage-name dev
Output::
@@ -41,4 +41,3 @@
}
}
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-stages.rst awscli-1.18.69/awscli/examples/apigateway/get-stages.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-stages.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-stages.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To get the per-region list of stages for a REST API**
+**To get the list of stages for a REST API**
Command::
- aws apigateway get-stages --rest-api-id 1234123412 --region us-west-2
+ aws apigateway get-stages --rest-api-id 1234123412
Output::
@@ -31,4 +31,3 @@
}
]
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-usage-plan-key.rst awscli-1.18.69/awscli/examples/apigateway/get-usage-plan-key.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-usage-plan-key.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-usage-plan-key.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway get-usage-plan-key --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu --region us-west-2
-
+ aws apigateway get-usage-plan-key --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-usage-plan-keys.rst awscli-1.18.69/awscli/examples/apigateway/get-usage-plan-keys.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-usage-plan-keys.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-usage-plan-keys.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway get-usage-plan-keys --usage-plan-id a1b2c3 --region us-west-2
-
+ aws apigateway get-usage-plan-keys --usage-plan-id a1b2c3
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-usage-plan.rst awscli-1.18.69/awscli/examples/apigateway/get-usage-plan.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-usage-plan.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-usage-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway get-usage-plan --usage-plan-id a1b2c3 --region us-west-2
-
+ aws apigateway get-usage-plan --usage-plan-id a1b2c3
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-usage-plans.rst awscli-1.18.69/awscli/examples/apigateway/get-usage-plans.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-usage-plans.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-usage-plans.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To get the details of all Usage Plans in a region**
+**To get the details of all Usage Plans**
Command::
- aws apigateway get-usage-plans --region us-west-2
-
+ aws apigateway get-usage-plans
diff -Nru awscli-1.11.13/awscli/examples/apigateway/get-usage.rst awscli-1.18.69/awscli/examples/apigateway/get-usage.rst
--- awscli-1.11.13/awscli/examples/apigateway/get-usage.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/get-usage.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway get-usage --usage-plan-id a1b2c3 --start-date "2016-08-16" --end-date "2016-08-17" --region us-west-2
-
+ aws apigateway get-usage --usage-plan-id a1b2c3 --start-date "2016-08-16" --end-date "2016-08-17"
diff -Nru awscli-1.11.13/awscli/examples/apigateway/import-rest-api.rst awscli-1.18.69/awscli/examples/apigateway/import-rest-api.rst
--- awscli-1.11.13/awscli/examples/apigateway/import-rest-api.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/import-rest-api.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To import a Swagger template and create an API in the specified region**
+**To import a Swagger template and create an API**
Command::
- aws apigateway import-rest-api --body 'file:///path/to/API_Swagger_template.json' --region us-west-2
-
+ aws apigateway import-rest-api --body 'file:///path/to/API_Swagger_template.json'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/put-integration-response.rst awscli-1.18.69/awscli/examples/apigateway/put-integration-response.rst
--- awscli-1.11.13/awscli/examples/apigateway/put-integration-response.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/put-integration-response.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,11 +2,10 @@
Command::
- aws apigateway put-integration-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200 --selection-pattern "" --response-templates '{"application/json": "{\"json\": \"template\"}"}' --region us-west-2
+ aws apigateway put-integration-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200 --selection-pattern "" --response-templates '{"application/json": "{\"json\": \"template\"}"}'
**To create an integration response with a regex of 400 and a statically defined header value**
Command::
- aws apigateway put-integration-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 400 --selection-pattern 400 --response-parameters '{"method.response.header.custom-header": "'"'"'custom-value'"'"'"}' --region us-west-2
-
+ aws apigateway put-integration-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 400 --selection-pattern 400 --response-parameters '{"method.response.header.custom-header": "'"'"'custom-value'"'"'"}'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/put-integration.rst awscli-1.18.69/awscli/examples/apigateway/put-integration.rst
--- awscli-1.11.13/awscli/examples/apigateway/put-integration.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/put-integration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,17 +2,16 @@
Command::
- aws apigateway put-integration --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --type MOCK --request-templates '{ "application/json": "{\"statusCode\": 200}" }' --region us-west-2
+ aws apigateway put-integration --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --type MOCK --request-templates '{ "application/json": "{\"statusCode\": 200}" }'
**To create a HTTP integration request**
Command::
- aws apigateway put-integration --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --type HTTP --integration-http-method GET --uri 'https://domain.tld/path' --region us-west-2
+ aws apigateway put-integration --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --type HTTP --integration-http-method GET --uri 'https://domain.tld/path'
**To create an AWS integration request with a Lambda Function endpoint**
Command::
- aws apigateway put-integration --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --type AWS --integration-http-method POST --uri 'arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:function_name/invocations' --region us-west-2
-
+ aws apigateway put-integration --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --type AWS --integration-http-method POST --uri 'arn:aws:apigateway:us-west-2:lambda:path//2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:function_name/invocations'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/put-method-response.rst awscli-1.18.69/awscli/examples/apigateway/put-method-response.rst
--- awscli-1.11.13/awscli/examples/apigateway/put-method-response.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/put-method-response.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway put-method-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 400 --response-parameters "method.response.header.custom-header=false" --region us-west-2
-
+ aws apigateway put-method-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 400 --response-parameters "method.response.header.custom-header=false"
diff -Nru awscli-1.11.13/awscli/examples/apigateway/put-method.rst awscli-1.18.69/awscli/examples/apigateway/put-method.rst
--- awscli-1.11.13/awscli/examples/apigateway/put-method.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/put-method.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway put-method --rest-api-id 1234123412 --resource-id a1b2c3 --http-method PUT --authorization-type "NONE" --no-api-key-required --request-parameters "method.request.header.custom-header=false" --region us-west-2
-
+ aws apigateway put-method --rest-api-id 1234123412 --resource-id a1b2c3 --http-method PUT --authorization-type "NONE" --no-api-key-required --request-parameters "method.request.header.custom-header=false"
diff -Nru awscli-1.11.13/awscli/examples/apigateway/put-rest-api.rst awscli-1.18.69/awscli/examples/apigateway/put-rest-api.rst
--- awscli-1.11.13/awscli/examples/apigateway/put-rest-api.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/put-rest-api.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,12 +1,11 @@
-**To overwrite an existing API in the specified region using a Swagger template**
+**To overwrite an existing API using a Swagger template**
Command::
- aws apigateway put-rest-api --rest-api-id 1234123412 --mode overwrite --body 'file:///path/to/API_Swagger_template.json' --region us-west-2
+ aws apigateway put-rest-api --rest-api-id 1234123412 --mode overwrite --body 'file:///path/to/API_Swagger_template.json'
-**To merge a Swagger template into an existing API in the specified region**
+**To merge a Swagger template into an existing API**
Command::
- aws apigateway put-rest-api --rest-api-id 1234123412 --mode merge --body 'file:///path/to/API_Swagger_template.json' --region us-west-2
-
+ aws apigateway put-rest-api --rest-api-id 1234123412 --mode merge --body 'file:///path/to/API_Swagger_template.json'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/test-invoke-authorizer.rst awscli-1.18.69/awscli/examples/apigateway/test-invoke-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigateway/test-invoke-authorizer.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/test-invoke-authorizer.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway test-invoke-authorizer --rest-api-id 1234123412 --authorizer-id 5yid1t --headers Authorization='Value' --region us-west-2
-
+ aws apigateway test-invoke-authorizer --rest-api-id 1234123412 --authorizer-id 5yid1t --headers Authorization='Value'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/test-invoke-method.rst awscli-1.18.69/awscli/examples/apigateway/test-invoke-method.rst
--- awscli-1.11.13/awscli/examples/apigateway/test-invoke-method.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/test-invoke-method.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,11 +2,10 @@
Command::
- aws apigateway test-invoke-method --rest-api-id 1234123412 --resource-id avl5sg8fw8 --http-method GET --path-with-query-string '/' --region us-west-2
+ aws apigateway test-invoke-method --rest-api-id 1234123412 --resource-id avl5sg8fw8 --http-method GET --path-with-query-string '/'
**To test invoke a sub-resource in an API by making a GET request with a path parameter value specified**
Command::
- aws apigateway test-invoke-method --rest-api-id 1234123412 --resource-id 3gapai --http-method GET --path-with-query-string '/pets/1' --region us-west-2
-
+ aws apigateway test-invoke-method --rest-api-id 1234123412 --resource-id 3gapai --http-method GET --path-with-query-string '/pets/1'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-account.rst awscli-1.18.69/awscli/examples/apigateway/update-account.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-account.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-account.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,8 +1,8 @@
-**To change the IAM Role ARN for logging to CloudWatch Logs for a region**
+**To change the IAM Role ARN for logging to CloudWatch Logs**
Command::
- aws apigateway update-account --patch-operations op='replace',path='/cloudwatchRoleArn',value='arn:aws:iam::123412341234:role/APIGatewayToCloudWatchLogs' --region us-west-2
+ aws apigateway update-account --patch-operations op='replace',path='/cloudwatchRoleArn',value='arn:aws:iam::123412341234:role/APIGatewayToCloudWatchLogs'
Output::
@@ -13,4 +13,3 @@
"burstLimit": 2000
}
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-api-key.rst awscli-1.18.69/awscli/examples/apigateway/update-api-key.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-api-key.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-api-key.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway update-api-key --api-key sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu --patch-operations op='replace',path='/description',value='newName' --region us-west-2
+ aws apigateway update-api-key --api-key sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu --patch-operations op='replace',path='/description',value='newName'
Output::
@@ -22,7 +22,7 @@
Command::
- aws apigateway update-api-key --api-key sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu --patch-operations op='replace',path='/enabled',value='false' --region us-west-2
+ aws apigateway update-api-key --api-key sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu --patch-operations op='replace',path='/enabled',value='false'
Output::
@@ -37,4 +37,3 @@
"id": "sNvjQDMReA1vEQPNzW8r3dXsU2rrD7fcjm2SiMnu",
"name": "newName"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-authorizer.rst awscli-1.18.69/awscli/examples/apigateway/update-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-authorizer.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-authorizer.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway update-authorizer --rest-api-id 1234123412 --authorizer-id gfi4n3 --patch-operations op='replace',path='/name',value='testAuthorizer' --region us-west-2
+ aws apigateway update-authorizer --rest-api-id 1234123412 --authorizer-id gfi4n3 --patch-operations op='replace',path='/name',value='testAuthorizer'
Output::
@@ -20,7 +20,7 @@
Command::
- aws apigateway update-authorizer --rest-api-id 1234123412 --authorizer-id gfi4n3 --patch-operations op='replace',path='/authorizerUri',value='arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:newAuthorizer/invocations' --region us-west-2
+ aws apigateway update-authorizer --rest-api-id 1234123412 --authorizer-id gfi4n3 --patch-operations op='replace',path='/authorizerUri',value='arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:newAuthorizer/invocations'
Output::
@@ -33,4 +33,3 @@
"type": "TOKEN",
"id": "gfi4n3"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-base-path-mapping.rst awscli-1.18.69/awscli/examples/apigateway/update-base-path-mapping.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-base-path-mapping.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-base-path-mapping.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
Command::
- aws apigateway update-base-path-mapping --domain-name api.domain.tld --base-path prod --patch-operations op='replace',path='/basePath',value='v1' --region us-west-2
+ aws apigateway update-base-path-mapping --domain-name api.domain.tld --base-path prod --patch-operations op='replace',path='/basePath',value='v1'
Output::
@@ -11,4 +11,3 @@
"restApiId": "1234123412",
"stage": "api"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-client-certificate.rst awscli-1.18.69/awscli/examples/apigateway/update-client-certificate.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-client-certificate.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-client-certificate.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,5 @@
-**To update the description of a client certificate in the specified region**
+**To update the description of a client certificate**
Command::
- aws apigateway update-client-certificate --client-certificate-id a1b2c3 --patch-operations op='replace',path='/description',value='My new description' --region us-west-2
-
+ aws apigateway update-client-certificate --client-certificate-id a1b2c3 --patch-operations op='replace',path='/description',value='My new description'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-domain-name.rst awscli-1.18.69/awscli/examples/apigateway/update-domain-name.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-domain-name.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-domain-name.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,15 +1,18 @@
**To change the certificate name for a custom domain name**
-Command::
+The following ``update-domain-name`` example changes the certificate name for a custom domain. ::
- aws apigateway update-domain-name --domain-name api.domain.tld --patch-operations op='replace',path='/certificateName',value='newDomainCertName'
+ aws apigateway update-domain-name \
+ --domain-name api.domain.tld \
+ --patch-operations op='replace',path='/certificateArn',value='arn:aws:acm:us-west-2:111122223333:certificate/CERTEXAMPLE123EXAMPLE'
Output::
- {
- "domainName": "api.domain.tld",
- "distributionDomainName": "d123456789012.cloudfront.net",
- "certificateName": "newDomainCertName",
- "certificateUploadDate": 1462565487
- }
+ {
+ "domainName": "api.domain.tld",
+ "distributionDomainName": "d123456789012.cloudfront.net",
+ "certificateArn": "arn:aws:acm:us-west-2:111122223333:certificate/CERTEXAMPLE123EXAMPLE",
+ "certificateUploadDate": 1462565487
+ }
+For more information, see `Set up Custom Domain Name for an API in API Gateway `_ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-integration.rst awscli-1.18.69/awscli/examples/apigateway/update-integration.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-integration.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-integration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,23 +2,38 @@
Command::
- aws apigateway update-integration --rest-api-id a1b2c3d4e5 --resource-id a1b2c3 --http-method POST --patch-operations op='add',path='/requestTemplates/application~1json'
+ aws apigateway update-integration \
+ --rest-api-id a1b2c3d4e5 \
+ --resource-id a1b2c3 \
+ --http-method POST \
+ --patch-operations "op='add',path='/requestTemplates/application~1json'"
**To update (replace) the 'Content-Type: application/json' Mapping Template configured with a custom template**
Command::
- aws apigateway update-integration --rest-api-id a1b2c3d4e5 --resource-id a1b2c3 --http-method POST --patch-operations op='replace',path='/requestTemplates/application~1json',value='{"example": "json"}'
+ aws apigateway update-integration \
+ --rest-api-id a1b2c3d4e5 \
+ --resource-id a1b2c3 \
+ --http-method POST \
+ --patch-operations "op='replace',path='/requestTemplates/application~1json',value='{"example": "json"}'"
**To update (replace) a custom template associated with 'Content-Type: application/json' with Input Passthrough**
Command::
- aws apigateway update-integration --rest-api-id a1b2c3d4e5 --resource-id a1b2c3 --http-method POST --patch-operations op='replace',path='requestTemplates/application~1json'
+ aws apigateway update-integration \
+ --rest-api-id a1b2c3d4e5 \
+ --resource-id a1b2c3 \
+ --http-method POST \
+ --patch-operations "op='replace',path='requestTemplates/application~1json'"
**To remove the 'Content-Type: application/json' Mapping Template**
Command::
- aws apigateway update-integration --rest-api-id a1b2c3d4e5 --resource-id a1b2c3 --http-method POST --patch-operations op='remove',path='/requestTemplates/application~1json'
-
+ aws apigateway update-integration \
+ --rest-api-id a1b2c3d4e5 \
+ --resource-id a1b2c3 \
+ --http-method POST \
+ --patch-operations "op='remove',path='/requestTemplates/application~1json'"
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-method-response.rst awscli-1.18.69/awscli/examples/apigateway/update-method-response.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-method-response.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-method-response.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,11 +2,10 @@
Command::
- aws apigateway update-method-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200 --patch-operations op="add",path="/responseParameters/method.response.header.custom-header",value="false" --region us-west-2
+ aws apigateway update-method-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200 --patch-operations op="add",path="/responseParameters/method.response.header.custom-header",value="false"
**To delete a response model for the 200 response in a method**
Command::
- aws apigateway update-method-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200 --patch-operations op="remove",path="/responseModels/application~1json" --region us-west-2
-
+ aws apigateway update-method-response --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --status-code 200 --patch-operations op="remove",path="/responseModels/application~1json"
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-method.rst awscli-1.18.69/awscli/examples/apigateway/update-method.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-method.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-method.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,11 +2,10 @@
Command::
- aws apigateway update-method --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --patch-operations op="replace",path="/apiKeyRequired",value="true" --region us-west-2
+ aws apigateway update-method --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --patch-operations op="replace",path="/apiKeyRequired",value="true"
**To modify a method to require IAM Authorization**
Command::
- aws apigateway update-method --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --patch-operations op="replace",path="/authorizationType",value="AWS_IAM" --region us-west-2
-
+ aws apigateway update-method --rest-api-id 1234123412 --resource-id a1b2c3 --http-method GET --patch-operations op="replace",path="/authorizationType",value="AWS_IAM"
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-model.rst awscli-1.18.69/awscli/examples/apigateway/update-model.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-model.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-model.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,12 +1,11 @@
-**To change the description of a model in an API within the specified region**
+**To change the description of a model in an API**
Command::
- aws apigateway update-model --rest-api-id 1234123412 --model-name 'Empty' --patch-operations op=replace,path=/description,value='New Description' --region us-west-2
+ aws apigateway update-model --rest-api-id 1234123412 --model-name 'Empty' --patch-operations op=replace,path=/description,value='New Description'
-**To change the schema of a model in an API within the specified region**
+**To change the schema of a model in an API**
Command::
- aws apigateway update-model --rest-api-id 1234123412 --model-name 'Empty' --patch-operations op=replace,path=/schema,value='"{ \"$schema\": \"http://json-schema.org/draft-04/schema#\", \"title\" : \"Empty Schema\", \"type\" : \"object\" }"' --region us-west-2
-
+ aws apigateway update-model --rest-api-id 1234123412 --model-name 'Empty' --patch-operations op=replace,path=/schema,value='"{ \"$schema\": \"http://json-schema.org/draft-04/schema#\", \"title\" : \"Empty Schema\", \"type\" : \"object\" }"'
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-resource.rst awscli-1.18.69/awscli/examples/apigateway/update-resource.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-resource.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,4 +1,4 @@
-**To move a resource and place it under a different parent resource in an API within the specified region**
+**To move a resource and place it under a different parent resource in an API**
Command::
@@ -13,7 +13,7 @@
"parentId": "3c2b1a"
}
-**To rename a resource (pathPart) in an API within the specified region**
+**To rename a resource (pathPart) in an API**
Command::
@@ -27,4 +27,3 @@
"id": "1a2b3c",
"parentId": "3c2b1a"
}
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-rest-api.rst awscli-1.18.69/awscli/examples/apigateway/update-rest-api.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-rest-api.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-rest-api.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,12 +1,11 @@
-**To change the name of an API in the specified region**
+**To change the name of an API**
Command::
- aws apigateway update-rest-api --rest-api-id 1234123412 --patch-operations op=replace,path=/name,value='New Name' --region us-west-2
+ aws apigateway update-rest-api --rest-api-id 1234123412 --patch-operations op=replace,path=/name,value='New Name'
-**To change the description of an API in the specified region**
+**To change the description of an API**
Command::
aws apigateway update-rest-api --rest-api-id 1234123412 --patch-operations op=replace,path=/description,value='New Description'
-
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-stage.rst awscli-1.18.69/awscli/examples/apigateway/update-stage.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-stage.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-stage.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,12 +1,11 @@
-**To override the stage settings and disable full request/response logging for a specific resource and method in an API's stage within the specified region**
+**To override the stage settings and disable full request/response logging for a specific resource and method in an API's stage**
Command::
- aws apigateway update-stage --rest-api-id 1234123412 --stage-name 'dev' --patch-operations op=replace,path=/~1resourceName/GET/logging/dataTrace,value=false --region us-west-2
+ aws apigateway update-stage --rest-api-id 1234123412 --stage-name 'dev' --patch-operations op=replace,path=/~1resourceName/GET/logging/dataTrace,value=false
-**To enable full request/response logging for all resources/methods in an API's stage within the specified region**
+**To enable full request/response logging for all resources/methods in an API's stage**
Command::
- aws apigateway update-stage --rest-api-id 1234123412 --stage-name 'dev' --patch-operations op=replace,path=/*/*/logging/dataTrace,value=true --region us-west-2
-
+ aws apigateway update-stage --rest-api-id 1234123412 --stage-name 'dev' --patch-operations op=replace,path=/*/*/logging/dataTrace,value=true
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-usage-plan.rst awscli-1.18.69/awscli/examples/apigateway/update-usage-plan.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-usage-plan.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-usage-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,23 +2,22 @@
Command::
- aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/quota/period",value="MONTH" --region us-west-2
+ aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/quota/period",value="MONTH"
**To change the quota limit defined in a Usage Plan**
Command::
- aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/quota/limit",value="500" --region us-west-2
+ aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/quota/limit",value="500"
**To change the throttle rate limit defined in a Usage Plan**
Command::
- aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/throttle/rateLimit",value="10" --region us-west-2
+ aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/throttle/rateLimit",value="10"
**To change the throttle burst limit defined in a Usage Plan**
Command::
- aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/throttle/burstLimit",value="20" --region us-west-2
-
+ aws apigateway update-usage-plan --usage-plan-id a1b2c3 --patch-operations op="replace",path="/throttle/burstLimit",value="20"
diff -Nru awscli-1.11.13/awscli/examples/apigateway/update-usage.rst awscli-1.18.69/awscli/examples/apigateway/update-usage.rst
--- awscli-1.11.13/awscli/examples/apigateway/update-usage.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigateway/update-usage.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,5 +2,4 @@
Command::
- aws apigateway update-usage --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu --patch-operations op="replace",path="/remaining",value="50" --region us-west-2
-
+ aws apigateway update-usage --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu --patch-operations op="replace",path="/remaining",value="50"
diff -Nru awscli-1.11.13/awscli/examples/apigatewaymanagementapi/delete-connection.rst awscli-1.18.69/awscli/examples/apigatewaymanagementapi/delete-connection.rst
--- awscli-1.11.13/awscli/examples/apigatewaymanagementapi/delete-connection.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewaymanagementapi/delete-connection.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete a WebSocket connection**
+
+The following ``delete-connection`` example disconnects a client from the specified WebSocket API. ::
+
+ aws apigatewaymanagementapi delete-connection \
+ --connection-id L0SM9cOFvHcCIhw= \
+ --endpoint-url https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod
+
+This command produces no output.
+
+For more information, see `Use @connections commands in your backend service `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewaymanagementapi/get-connection.rst awscli-1.18.69/awscli/examples/apigatewaymanagementapi/get-connection.rst
--- awscli-1.11.13/awscli/examples/apigatewaymanagementapi/get-connection.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewaymanagementapi/get-connection.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,19 @@
+**To get information about a WebSocket connection**
+
+The following ``get-connection`` example describes a connection to the specified WebSocket API. ::
+
+ aws apigatewaymanagementapi get-connection \
+ --connection-id L0SM9cOFvHcCIhw= \
+ --endpoint-url https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod
+
+Output::
+
+ {
+ "ConnectedAt": "2020-04-30T20:10:33.236Z",
+ "Identity": {
+ "SourceIp": "192.0.2.1"
+ },
+ "LastActiveAt": "2020-04-30T20:10:42.997Z"
+ }
+
+For more information, see `Use @connections commands in your backend service `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewaymanagementapi/post-to-connection.rst awscli-1.18.69/awscli/examples/apigatewaymanagementapi/post-to-connection.rst
--- awscli-1.11.13/awscli/examples/apigatewaymanagementapi/post-to-connection.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewaymanagementapi/post-to-connection.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,12 @@
+**To send data to a WebSocket connection**
+
+The following ``post-to-connection`` example sends a message to a client that's connected to the specified WebSocket API. ::
+
+ aws apigatewaymanagementapi post-to-connection \
+ --connection-id L0SM9cOFvHcCIhw= \
+ --data "Hello from API Gateway!" \
+ --endpoint-url https://aabbccddee.execute-api.us-west-2.amazonaws.com/prod
+
+This command produces no output.
+
+For more information, see `Use @connections commands in your backend service `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-api-mapping.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-api-mapping.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-api-mapping.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-api-mapping.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,20 @@
+**To create an API mapping for an API**
+
+The following ``create-api-mapping`` example maps the ``test`` stage of an API to the ``/myApi`` path of the ``regional.example.com`` custom domain name. ::
+
+ aws apigatewayv2 create-api-mapping \
+ --domain-name regional.example.com \
+ --api-mapping-key myApi \
+ --api-id a1b2c3d4 \
+ --stage test
+
+Output::
+
+ {
+ "ApiId": "a1b2c3d4",
+ "ApiMappingId": "0qzs2sy7bh",
+ "ApiMappingKey": "myApi"
+ "Stage": "test"
+ }
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-api.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-api.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-api.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-api.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,44 @@
+**To create an HTTP API**
+
+The following ``create-api`` example creates an HTTP API by using quick create. You can use quick create to create an API with an AWS Lambda or HTTP integration, a default catch-all route, and a default stage that is configured to automatically deploy changes. The following command uses quick create to create an HTTP API that integrates with a Lambda function. ::
+
+ aws apigatewayv2 create-api \
+ --name my-http-api \
+ --protocol-type HTTP \
+ --target arn:aws:lambda:us-west-2:123456789012:function:my-lambda-function
+
+Output::
+
+ {
+ "ApiEndpoint": "https://a1b2c3d4.execute-api.us-west-2.amazonaws.com",
+ "ApiId": "a1b2c3d4",
+ "ApiKeySelectionExpression": "$request.header.x-api-key",
+ "CreatedDate": "2020-04-08T19:05:45+00:00",
+ "Name": "my-http-api",
+ "ProtocolType": "HTTP",
+ "RouteSelectionExpression": "$request.method $request.path"
+ }
+
+For more information, see `Developing an HTTP API in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
+
+**To create a WebSocket API**
+
+The following ``create-api`` example creates a WebSocket API with the specified name. ::
+
+ aws apigatewayv2 create-api \
+ --name "myWebSocketApi" \
+ --protocol-type WEBSOCKET \
+ --route-selection-expression '$request.body.action'
+
+Output::
+
+ {
+ "ApiKeySelectionExpression": "$request.header.x-api-key",
+ "Name": "myWebSocketApi",
+ "CreatedDate": "2018-11-15T06:23:51Z",
+ "ProtocolType": "WEBSOCKET",
+ "RouteSelectionExpression": "'$request.body.action'",
+ "ApiId": "aabbccddee"
+ }
+
+For more information, see `Create a WebSocket API in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-authorizer.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-authorizer.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-authorizer.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,29 @@
+**To create a JWT authorizer for an HTTP API**
+
+The following ``create-authorizer`` example creates a JWT authorizer that uses Amazon Cognito as an identity provider. ::
+
+ aws apigatewayv2 create-authorizer \
+ --name my-jwt-authorizer \
+ --api-id a1b2c3d4 \
+ --authorizer-type JWT \
+ --identity-source '$request.header.Authorization' \
+ --jwt-configuration Audience=123456abc,Issuer=https://cognito-idp.us-west-2.amazonaws.com/us-west-2_abc123
+
+Output::
+
+ {
+ "AuthorizerId": "a1b2c3",
+ "AuthorizerType": "JWT",
+ "IdentitySource": [
+ "$request.header.Authorization"
+ ],
+ "JwtConfiguration": {
+ "Audience": [
+ "123456abc"
+ ],
+ "Issuer": "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_abc123"
+ },
+ "Name": "my-jwt-authorizer"
+ }
+
+For more information, see `Controlling access to HTTP APIs with JWT authorizers `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-deployment.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-deployment.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-deployment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-deployment.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,18 @@
+**To create a deployment for an API**
+
+The following ``create-deployment`` example creates a deployment for an API and associates that deployment with the ``dev`` stage of the API. ::
+
+ aws apigatewayv2 create-deployment \
+ --api-id a1b2c3d4 \
+ --stage-name dev
+
+Output::
+
+ {
+ "AutoDeployed": false,
+ "CreatedDate": "2020-04-06T23:38:08Z",
+ "DeploymentId": "53lz9l",
+ "DeploymentStatus": "DEPLOYED"
+ }
+
+For more information, see `API deployment `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-domain-name.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-domain-name.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-domain-name.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-domain-name.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,26 @@
+**To create a custom domain name**
+
+The following ``create-domain-name`` example creates a regional custom domain name for an API. ::
+
+ aws apigatewayv2 create-domain-name \
+ --domain-name regional.example.com \
+ --domain-name-configurations CertificateArn=arn:aws:acm:us-west-2:123456789012:certificate/123456789012-1234-1234-1234-12345678
+
+Output::
+
+ {
+ "ApiMappingSelectionExpression": "$request.basepath",
+ "DomainName": "regional.example.com",
+ "DomainNameConfigurations": [
+ {
+ "ApiGatewayDomainName": "d-id.execute-api.us-west-2.amazonaws.com",
+ "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/123456789012-1234-1234-1234-12345678",
+ "EndpointType": "REGIONAL",
+ "HostedZoneId": "123456789111",
+ "SecurityPolicy": "TLS_1_2",
+ "DomainNameStatus": "AVAILABLE"
+ }
+ ]
+ }
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-integration.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-integration.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-integration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-integration.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,48 @@
+**To create a WebSocket API integration**
+
+The following ``create-integration`` example creates a mock integration for a WebSocket API. ::
+
+ aws apigatewayv2 create-integration \
+ --api-id aabbccddee \
+ --passthrough-behavior WHEN_NO_MATCH \
+ --timeout-in-millis 29000 \
+ --connection-type INTERNET \
+ --integration-type MOCK
+
+Output::
+
+ {
+ "ConnectionType": "INTERNET",
+ "IntegrationId": "0abcdef",
+ "IntegrationResponseSelectionExpression": "${integration.response.statuscode}",
+ "IntegrationType": "MOCK",
+ "PassthroughBehavior": "WHEN_NO_MATCH",
+ "PayloadFormatVersion": "1.0",
+ "TimeoutInMillis": 29000
+ }
+
+For more information, see `Set up a WebSocket API integration request in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
+
+**To create an HTTP API integration**
+
+The following ``create-integration`` example creates an AWS Lambda integration for an HTTP API. ::
+
+ aws apigatewayv2 create-integration \
+ --api-id a1b2c3d4 \
+ --integration-type AWS_PROXY \
+ --integration-uri arn:aws:lambda:us-west-2:123456789012:function:my-function \
+ --payload-format-version 2.0
+
+Output::
+
+ {
+ "ConnectionType": "INTERNET",
+ "IntegrationId": "0abcdef",
+ "IntegrationMethod": "POST",
+ "IntegrationType": "AWS_PROXY",
+ "IntegrationUri": "arn:aws:lambda:us-west-2:123456789012:function:my-function",
+ "PayloadFormatVersion": "2.0",
+ "TimeoutInMillis": 30000
+ }
+
+For more information, see `Configuring integrations for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-route.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-route.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-route.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-route.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,37 @@
+**To create a $default route for a WebSocket or HTTP API**
+
+The following ``create-route`` example creates a ``$default`` route for a WebSocket or HTTP API. ::
+
+ aws apigatewayv2 create-route \
+ --api-id aabbccddee \
+ --route-key '$default'
+
+Output::
+
+ {
+ "ApiKeyRequired": false,
+ "AuthorizationType": "NONE",
+ "RouteKey": "$default",
+ "RouteId": "1122334"
+ }
+
+For more information, see `Working with routes for WebSocket APIs `__ in the *Amazon API Gateway Developer Guide*
+
+**To create a route for an HTTP API**
+
+The following ``create-route`` example creates a route named ``signup`` that accepts POST requests. ::
+
+ aws apigatewayv2 create-route \
+ --api-id aabbccddee \
+ --route-key 'POST /signup'
+
+Output::
+
+ {
+ "ApiKeyRequired": false,
+ "AuthorizationType": "NONE",
+ "RouteKey": "POST /signup",
+ "RouteId": "1122334"
+ }
+
+For more information, see `Working with routes for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-stage.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-stage.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-stage.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-stage.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,23 @@
+**To create a stage**
+
+The following ``create-stage`` example creates a stage named `dev` for an API. ::
+
+ aws apigatewayv2 create-stage \
+ --api-id a1b2c3d4 \
+ --stage-name dev
+
+Output::
+
+ {
+ "CreatedDate": "2020-04-06T23:23:46Z",
+ "DefaultRouteSettings": {
+ "DetailedMetricsEnabled": false
+ },
+ "LastUpdatedDate": "2020-04-06T23:23:46Z",
+ "RouteSettings": {},
+ "StageName": "dev",
+ "StageVariables": {},
+ "Tags": {}
+ }
+
+For more information, see `Working with stages for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/create-vpc-link.rst awscli-1.18.69/awscli/examples/apigatewayv2/create-vpc-link.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/create-vpc-link.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/create-vpc-link.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,30 @@
+**To create a VPC link for an HTTP API**
+
+The following ``create-vpc-link`` example creates a VPC link for HTTP APIs. ::
+
+ aws apigatewayv2 create-vpc-link \
+ --name MyVpcLink \
+ --subnet-ids subnet-aaaa subnet-bbbb \
+ --security-group-ids sg1234 sg5678
+
+Output::
+
+ {
+ "CreatedDate": "2020-04-07T00:11:46Z",
+ "Name": "MyVpcLink",
+ "SecurityGroupIds": [
+ "sg1234",
+ "sg5678"
+ ],
+ "SubnetIds": [
+ "subnet-aaaa",
+ "subnet-bbbb"
+ ],
+ "Tags": {},
+ "VpcLinkId": "abcd123",
+ "VpcLinkStatus": "PENDING",
+ "VpcLinkStatusMessage": "VPC link is provisioning ENIs",
+ "VpcLinkVersion": "V2"
+ }
+
+For more information, see `Working with VPC links for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-access-log-settings.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-access-log-settings.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-access-log-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-access-log-settings.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To disable access logging for an API**
+
+The following ``delete-access-log-settings`` example deletes the access log settings for the ``$default`` stage of an API. To disable access logging for a stage, delete its access log settings. ::
+
+ aws apigatewayv2 delete-access-log-settings \
+ --api-id a1b2c3d4 \
+ --stage-name '$default'
+
+This command produces no output.
+
+For more information, see `Configuring logging for an HTTP API `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-api-mapping.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-api-mapping.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-api-mapping.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-api-mapping.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete an API mapping**
+
+The following ``delete-api-mapping`` example deletes an API mapping for the ``api.example.com`` custom domain name. ::
+
+ aws apigatewayv2 delete-api-mapping \
+ --api-mapping-id a1b2c3 \
+ --domain-name api.example.com
+
+This command produces no output.
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-api.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-api.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-api.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-api.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete an API**
+
+The following ``delete-api`` example deletes an API. ::
+
+ aws apigatewayv2 delete-api \
+ --api-id a1b2c3d4
+
+This command produces no output.
+
+For more information, see `Working with HTTP APIs `__ and `Working with WebSocket APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-authorizer.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-authorizer.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-authorizer.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete an authorizer**
+
+The following ``delete-authorizer`` example deletes an authorizer. ::
+
+ aws apigatewayv2 delete-authorizer \
+ --api-id a1b2c3d4 \
+ --authorizer-id a1b2c3
+
+This command produces no output.
+
+For more information, see `Controlling access to HTTP APIs with JWT authorizers `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-cors-configuration.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-cors-configuration.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-cors-configuration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-cors-configuration.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete the CORS configuration for an HTTP API**
+
+The following ``delete-cors-configuration`` example disables CORS for an HTTP API by deleting its CORS configuration. ::
+
+ aws apigatewayv2 delete-cors-configuration \
+ --api-id a1b2c3d4
+
+This command produces no output.
+
+For more information, see `Configuring CORS for an HTTP API `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-deployment.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-deployment.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-deployment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-deployment.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete a deployment**
+
+The following ``delete-deployment`` example deletes a deployment of an API. ::
+
+ aws apigatewayv2 delete-deployment \
+ --api-id a1b2c3d4 \
+ --deployment-id a1b2c3
+
+This command produces no output.
+
+For more information, see `API deployment `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-domain-name.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-domain-name.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-domain-name.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-domain-name.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete a custom domain name**
+
+The following ``delete-domain-name`` example deletes a custom domain name. ::
+
+ aws apigatewayv2 delete-domain-name \
+ --domain-name api.example.com
+
+This command produces no output.
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-integration.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-integration.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-integration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-integration.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete an integration**
+
+The following ``delete-integration`` example deletes an API integration. ::
+
+ aws apigatewayv2 delete-integration \
+ --api-id a1b2c3d4 \
+ --integration-id a1b2c3
+
+This command produces no output.
+
+For more information, see `Configuring integrations for HTTP APIs `__ and `Setting up WebSocket API integrations `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-route.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-route.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-route.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-route.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete a route**
+
+The following ``delete-route`` example deletes an API route. ::
+
+ aws apigatewayv2 delete-route \
+ --api-id a1b2c3d4 \
+ --route-id a1b2c3
+
+This command produces no output.
+
+For more information, see `Working with routes for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-route-settings.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-route-settings.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-route-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-route-settings.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,12 @@
+**To delete route settings**
+
+The following ``delete-route-settings`` example deletes the route settings for the specified route. ::
+
+ aws apigatewayv2 delete-route-settings \
+ --api-id a1b2c3d4 \
+ --stage-name dev \
+ --route-key 'GET /pets'
+
+This command produces no output.
+
+For more information, see `Working with routes for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-stage.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-stage.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-stage.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-stage.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete a stage**
+
+The following ``delete-stage`` example deletes the ``test`` stage of an API. ::
+
+ aws apigatewayv2 delete-stage \
+ --api-id a1b2c3d4 \
+ --stage-name test
+
+This command produces no output.
+
+For more information, see `Working with stages for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/delete-vpc-link.rst awscli-1.18.69/awscli/examples/apigatewayv2/delete-vpc-link.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/delete-vpc-link.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/delete-vpc-link.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete a VPC link for an HTTP API**
+
+The following ``delete-vpc-link`` example deletes a VPC link. ::
+
+ aws apigatewayv2 delete-vpc-link \
+ --vpc-link-id abcd123
+
+This command produces no output.
+
+For more information, see `Working with VPC links for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/export-api.rst awscli-1.18.69/awscli/examples/apigatewayv2/export-api.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/export-api.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/export-api.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,14 @@
+**To export an OpenAPI definition of an HTTP API**
+
+The following ``export-api`` example exports an OpenAPI 3.0 definition of an API stage named ``prod`` to a YAML file named ``stage-definition.yaml``. The exported definition file includes API Gateway extensions by default. ::
+
+ aws apigatewayv2 export-api \
+ --api-id a1b2c3d4 \
+ --output-type YAML \
+ --specification OAS30 \
+ --stage-name prod \
+ stage-definition.yaml
+
+This command produces no output.
+
+For more information, see `Exporting an HTTP API from API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-api-mapping.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-api-mapping.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-api-mapping.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-api-mapping.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,18 @@
+**To get information about an API mapping for a custom domain name**
+
+The following ``get-api-mapping`` example displays infomation about an API mapping for the ``api.example.com`` custom domain name. ::
+
+ aws apigatewayv2 get-api-mapping \
+ --api-mapping-id a1b2c3 \
+ --domain-name api.example.com
+
+Output::
+
+ {
+ "ApiId": "a1b2c3d4",
+ "ApiMappingId": "a1b2c3d5",
+ "ApiMappingKey": "myTestApi"
+ "Stage": "test"
+ }
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-api-mappings.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-api-mappings.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-api-mappings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-api-mappings.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,27 @@
+**To get API mappings for a custom domain name**
+
+The following ``get-api-mappings`` example displays a list of all of the API mappings for the ``api.example.com`` custom domain name. ::
+
+ aws apigatewayv2 get-api-mappings \
+ --domain-name api.example.com
+
+Output::
+
+ {
+ "Items": [
+ {
+ "ApiId": "a1b2c3d4",
+ "ApiMappingId": "a1b2c3d5",
+ "ApiMappingKey": "myTestApi"
+ "Stage": "test"
+ },
+ {
+ "ApiId": "a5b6c7d8",
+ "ApiMappingId": "a1b2c3d6",
+ "ApiMappingKey": "myDevApi"
+ "Stage": "dev"
+ },
+ ]
+ }
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-api.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-api.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-api.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-api.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,21 @@
+**To retrieve information about an API**
+
+The following ``get-api`` example displays information about an API. ::
+
+ aws apigatewayv2 get-api \
+ --api-id a1b2c3d4
+
+Output::
+
+ {
+ "ApiEndpoint": "https://a1b2c3d4.execute-api.us-west-2.amazonaws.com",
+ "ApiId": "a1b2c3d4",
+ "ApiKeySelectionExpression": "$request.header.x-api-key",
+ "CreatedDate": "2020-03-28T00:32:37Z",
+ "Name": "my-api",
+ "ProtocolType": "HTTP",
+ "RouteSelectionExpression": "$request.method $request.path",
+ "Tags": {
+ "department": "finance"
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-apis.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-apis.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-apis.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-apis.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,34 @@
+**To retrieve a list of APIs**
+
+The following ``get-apis`` example lists all of the APIs for the current user. ::
+
+ aws apigatewayv2 get-apis
+
+Output::
+
+ {
+ "Items": [
+ {
+ "ApiEndpoint": "wss://a1b2c3d4.execute-api.us-west-2.amazonaws.com",
+ "ApiId": "a1b2c3d4",
+ "ApiKeySelectionExpression": "$request.header.x-api-key",
+ "CreatedDate": "2020-04-07T20:21:59Z",
+ "Name": "my-websocket-api",
+ "ProtocolType": "WEBSOCKET",
+ "RouteSelectionExpression": "$request.body.message",
+ "Tags": {}
+ },
+ {
+ "ApiEndpoint": "https://a1b2c3d5.execute-api.us-west-2.amazonaws.com",
+ "ApiId": "a1b2c3d5",
+ "ApiKeySelectionExpression": "$request.header.x-api-key",
+ "CreatedDate": "2020-04-07T20:23:50Z",
+ "Name": "my-http-api",
+ "ProtocolType": "HTTP",
+ "RouteSelectionExpression": "$request.method $request.path",
+ "Tags": {}
+ }
+ ]
+ }
+
+For more information, see `Working with HTTP APIs `__ and `Working with WebSocket APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-authorizer.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-authorizer.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-authorizer.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,26 @@
+**To retrieve information about an authorizer**
+
+The following ``get-authorizer`` example displays information about an authorizer. ::
+
+ aws apigatewayv2 get-authorizer \
+ --api-id a1b2c3d4 \
+ --authorizer-id a1b2c3
+
+Output::
+
+ {
+ "AuthorizerId": "a1b2c3",
+ "AuthorizerType": "JWT",
+ "IdentitySource": [
+ "$request.header.Authorization"
+ ],
+ "JwtConfiguration": {
+ "Audience": [
+ "123456abc"
+ ],
+ "Issuer": "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_abc123"
+ },
+ "Name": "my-jwt-authorizer"
+ }
+
+For more information, see `Controlling access to HTTP APIs with JWT authorizers `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-authorizers.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-authorizers.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-authorizers.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-authorizers.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,43 @@
+**To retrieve a list of authorizers for an API**
+
+The following ``get-authorizers`` example displays a list of all of the authorizers for an API. ::
+
+ aws apigatewayv2 get-authorizers \
+ --api-id a1b2c3d4
+
+Output::
+
+ {
+ "Items": [
+ {
+ "AuthorizerId": "a1b2c3",
+ "AuthorizerType": "JWT",
+ "IdentitySource": [
+ "$request.header.Authorization"
+ ],
+ "JwtConfiguration": {
+ "Audience": [
+ "123456abc"
+ ],
+ "Issuer": "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_abc123"
+ },
+ "Name": "my-jwt-authorizer"
+ },
+ {
+ "AuthorizerId": "a1b2c4",
+ "AuthorizerType": "JWT",
+ "IdentitySource": [
+ "$request.header.Authorization"
+ ],
+ "JwtConfiguration": {
+ "Audience": [
+ "6789abcde"
+ ],
+ "Issuer": "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_abc234"
+ },
+ "Name": "new-jwt-authorizer"
+ }
+ ]
+ }
+
+For more information, see `Controlling access to HTTP APIs with JWT authorizers `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-deployment.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-deployment.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-deployment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-deployment.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,19 @@
+**To retrieve information about a deployment**
+
+The following ``get-deployment`` example displays information about a deployment. ::
+
+ aws apigatewayv2 get-deployment \
+ --api-id a1b2c3d4 \
+ --deployment-id abcdef
+
+Output::
+
+ {
+ "AutoDeployed": true,
+ "CreatedDate": "2020-04-07T23:58:40Z",
+ "DeploymentId": "abcdef",
+ "DeploymentStatus": "DEPLOYED",
+ "Description": "Automatic deployment triggered by changes to the Api configuration"
+ }
+
+For more information, see `API deployment `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-deployments.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-deployments.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-deployments.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-deployments.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,29 @@
+**To retrieve a list of deployments**
+
+The following ``get-deployments`` example displays a list of all of an API's deployments. ::
+
+ aws apigatewayv2 get-deployments \
+ --api-id a1b2c3d4
+
+Output::
+
+ {
+ "Items": [
+ {
+ "AutoDeployed": true,
+ "CreatedDate": "2020-04-07T23:58:40Z",
+ "DeploymentId": "abcdef",
+ "DeploymentStatus": "DEPLOYED",
+ "Description": "Automatic deployment triggered by changes to the Api configuration"
+ },
+ {
+ "AutoDeployed": true,
+ "CreatedDate": "2020-04-06T00:33:00Z",
+ "DeploymentId": "bcdefg",
+ "DeploymentStatus": "DEPLOYED",
+ "Description": "Automatic deployment triggered by changes to the Api configuration"
+ }
+ ]
+ }
+
+For more information, see `API deployment `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-domain-name.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-domain-name.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-domain-name.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-domain-name.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,26 @@
+**To retrieve information about a custom domain name**
+
+The following ``get-domain-name`` example displays information about a custom domain name. ::
+
+ aws apigatewayv2 get-domain-name \
+ --domain-name api.example.com
+
+Output::
+
+ {
+ "ApiMappingSelectionExpression": "$request.basepath",
+ "DomainName": "api.example.com",
+ "DomainNameConfigurations": [
+ {
+ "ApiGatewayDomainName": "d-1234.execute-api.us-west-2.amazonaws.com",
+ "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/123456789012-1234-1234-1234-12345678",
+ "EndpointType": "REGIONAL",
+ "HostedZoneId": "123456789111",
+ "SecurityPolicy": "TLS_1_2",
+ "DomainNameStatus": "AVAILABLE"
+ }
+ ],
+ "Tags": {}
+ }
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-domain-names.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-domain-names.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-domain-names.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-domain-names.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,42 @@
+**To retrieve a list of custom domain names**
+
+The following ``get-domain-names`` example displays a list of all of the custom domain names for the current user. ::
+
+ aws apigatewayv2 get-domain-names
+
+Output::
+
+ {
+ "Items": [
+ {
+ "ApiMappingSelectionExpression": "$request.basepath",
+ "DomainName": "api.example.com",
+ "DomainNameConfigurations": [
+ {
+ "ApiGatewayDomainName": "d-1234.execute-api.us-west-2.amazonaws.com",
+ "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/123456789012-1234-1234-1234-12345678",
+ "EndpointType": "REGIONAL",
+ "HostedZoneId": "123456789111",
+ "SecurityPolicy": "TLS_1_2",
+ "DomainNameStatus": "AVAILABLE"
+ }
+ ]
+ },
+ {
+ "ApiMappingSelectionExpression": "$request.basepath",
+ "DomainName": "newApi.example.com",
+ "DomainNameConfigurations": [
+ {
+ "ApiGatewayDomainName": "d-5678.execute-api.us-west-2.amazonaws.com",
+ "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/123456789012-1234-1234-1234-12345678",
+ "EndpointType": "REGIONAL",
+ "HostedZoneId": "123456789222",
+ "SecurityPolicy": "TLS_1_2",
+ "DomainNameStatus": "AVAILABLE"
+ }
+ ]
+ }
+ ]
+ }
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-integration.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-integration.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-integration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-integration.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,22 @@
+**To retrieve information about an integration**
+
+The following ``get-integration`` example displays information about an integration. ::
+
+ aws apigatewayv2 get-integration \
+ --api-id a1b2c3d4 \
+ --integration-id a1b2c3
+
+Output::
+
+ {
+ "ApiGatewayManaged": true,
+ "ConnectionType": "INTERNET",
+ "IntegrationId": "a1b2c3",
+ "IntegrationMethod": "POST",
+ "IntegrationType": "AWS_PROXY",
+ "IntegrationUri": "arn:aws:lambda:us-west-2:12356789012:function:hello12",
+ "PayloadFormatVersion": "2.0",
+ "TimeoutInMillis": 30000
+ }
+
+For more information, see `Configuring integrations for HTTP APIs `__ and `Setting up WebSocket API integrations `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-integrations.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-integrations.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-integrations.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-integrations.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,34 @@
+**To retrieve a list of integrations**
+
+The following ``get-integrations`` example displays a list of all of an API's integrations. ::
+
+ aws apigatewayv2 get-integrations \
+ --api-id a1b2c3d4
+
+Output::
+
+ {
+ "Items": [
+ {
+ "ApiGatewayManaged": true,
+ "ConnectionType": "INTERNET",
+ "IntegrationId": "a1b2c3",
+ "IntegrationMethod": "POST",
+ "IntegrationType": "AWS_PROXY",
+ "IntegrationUri": "arn:aws:lambda:us-west-2:123456789012:function:my-function",
+ "PayloadFormatVersion": "2.0",
+ "TimeoutInMillis": 30000
+ },
+ {
+ "ConnectionType": "INTERNET",
+ "IntegrationId": "a1b2c4",
+ "IntegrationMethod": "ANY",
+ "IntegrationType": "HTTP_PROXY",
+ "IntegrationUri": "https://www.example.com",
+ "PayloadFormatVersion": "1.0",
+ "TimeoutInMillis": 30000
+ }
+ ]
+ }
+
+For more information, see `Configuring integrations for HTTP APIs `__ and `Setting up WebSocket API integrations `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-route.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-route.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-route.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-route.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,19 @@
+**To retrieve information about a route**
+
+The following ``get-route`` example displays information about a route. ::
+
+ aws apigatewayv2 get-route \
+ --api-id a1b2c3d4 \
+ --route-id 72jz1wk
+
+Output::
+
+ {
+ "ApiKeyRequired": false,
+ "AuthorizationType": "NONE",
+ "RouteId": "72jz1wk",
+ "RouteKey": "ANY /pets",
+ "Target": "integrations/a1b2c3"
+ }
+
+For more information, see `Working with routes for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-routes.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-routes.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-routes.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-routes.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,30 @@
+**To retrieve a list of routes**
+
+The following ``get-routes`` example displays a list of all of an API's routes. ::
+
+ aws apigatewayv2 get-routes \
+ --api-id a1b2c3d4
+
+Output::
+
+ {
+ "Items": [
+ {
+ "ApiKeyRequired": false,
+ "AuthorizationType": "NONE",
+ "RouteId": "72jz1wk",
+ "RouteKey": "ANY /admin",
+ "Target": "integrations/a1b2c3"
+ },
+ {
+ "ApiGatewayManaged": true,
+ "ApiKeyRequired": false,
+ "AuthorizationType": "NONE",
+ "RouteId": "go65gqi",
+ "RouteKey": "$default",
+ "Target": "integrations/a1b2c4"
+ }
+ ]
+ }
+
+For more information, see `Working with routes for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-stage.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-stage.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-stage.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-stage.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,26 @@
+**To retrieve information about a stage**
+
+The following ``get-stage`` example displays information about the ``prod`` stage of an API. ::
+
+ aws apigatewayv2 get-stage \
+ --api-id a1b2c3d4 \
+ --stage-name prod
+
+Output::
+
+ {
+ "CreatedDate": "2020-04-08T00:36:05Z",
+ "DefaultRouteSettings": {
+ "DetailedMetricsEnabled": false
+ },
+ "DeploymentId": "x1zwyv",
+ "LastUpdatedDate": "2020-04-08T00:36:13Z",
+ "RouteSettings": {},
+ "StageName": "prod",
+ "StageVariables": {
+ "function": "my-prod-function"
+ },
+ "Tags": {}
+ }
+
+For more information, see `Working with stages for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-stages.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-stages.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-stages.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-stages.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,58 @@
+**To retrieve a list of stages**
+
+The following ``get-stages`` example lists all of an API's stages. ::
+
+ aws apigatewayv2 get-stages \
+ --api-id a1b2c3d4
+
+Output::
+
+ {
+ "Items": [
+ {
+ "ApiGatewayManaged": true,
+ "AutoDeploy": true,
+ "CreatedDate": "2020-04-08T00:08:44Z",
+ "DefaultRouteSettings": {
+ "DetailedMetricsEnabled": false
+ },
+ "DeploymentId": "dty748",
+ "LastDeploymentStatusMessage": "Successfully deployed stage with deployment ID 'dty748'",
+ "LastUpdatedDate": "2020-04-08T00:09:49Z",
+ "RouteSettings": {},
+ "StageName": "$default",
+ "StageVariables": {},
+ "Tags": {}
+ },
+ {
+ "AutoDeploy": true,
+ "CreatedDate": "2020-04-08T00:35:06Z",
+ "DefaultRouteSettings": {
+ "DetailedMetricsEnabled": false
+ },
+ "LastUpdatedDate": "2020-04-08T00:35:48Z",
+ "RouteSettings": {},
+ "StageName": "dev",
+ "StageVariables": {
+ "function": "my-dev-function"
+ },
+ "Tags": {}
+ },
+ {
+ "CreatedDate": "2020-04-08T00:36:05Z",
+ "DefaultRouteSettings": {
+ "DetailedMetricsEnabled": false
+ },
+ "DeploymentId": "x1zwyv",
+ "LastUpdatedDate": "2020-04-08T00:36:13Z",
+ "RouteSettings": {},
+ "StageName": "prod",
+ "StageVariables": {
+ "function": "my-prod-function"
+ },
+ "Tags": {}
+ }
+ ]
+ }
+
+For more information, see `Working with stages for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-tags.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-tags.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-tags.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-tags.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,17 @@
+**To retrieve a list of tags for a resource**
+
+The following ``get-tags`` example lists all of an API's tags. ::
+
+ aws apigatewayv2 get-tags \
+ --resource-arn arn:aws:apigateway:us-west-2::/apis/a1b2c3d4
+
+Output::
+
+ {
+ "Tags": {
+ "owner": "dev-team",
+ "environment": "prod"
+ }
+ }
+
+For more information, see `Tagging your API Gateway resources `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-vpc-link.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-vpc-link.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-vpc-link.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-vpc-link.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,28 @@
+**To retrieve information about a VPC link**
+
+The following ``get-vpc-link`` example displays information about a VPC link. ::
+
+ aws apigatewayv2 get-vpc-link \
+ --vpc-link-id abcd123
+
+Output::
+
+ {
+ "CreatedDate": "2020-04-07T00:27:47Z",
+ "Name": "MyVpcLink",
+ "SecurityGroupIds": [
+ "sg1234",
+ "sg5678"
+ ],
+ "SubnetIds": [
+ "subnet-aaaa",
+ "subnet-bbbb"
+ ],
+ "Tags": {},
+ "VpcLinkId": "abcd123",
+ "VpcLinkStatus": "AVAILABLE",
+ "VpcLinkStatusMessage": "VPC link is ready to route traffic",
+ "VpcLinkVersion": "V2"
+ }
+
+For more information, see `Working with VPC links for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/get-vpc-links.rst awscli-1.18.69/awscli/examples/apigatewayv2/get-vpc-links.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/get-vpc-links.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/get-vpc-links.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,48 @@
+**To retrieve a list of VPC links**
+
+The following ``get-vpc-links`` example displays a list of all of the VPC links for the current user. ::
+
+ aws apigatewayv2 get-vpc-links
+
+Output::
+
+ {
+ "Items": [
+ {
+ "CreatedDate": "2020-04-07T00:27:47Z",
+ "Name": "MyVpcLink",
+ "SecurityGroupIds": [
+ "sg1234",
+ "sg5678"
+ ],
+ "SubnetIds": [
+ "subnet-aaaa",
+ "subnet-bbbb"
+ ],
+ "Tags": {},
+ "VpcLinkId": "abcd123",
+ "VpcLinkStatus": "AVAILABLE",
+ "VpcLinkStatusMessage": "VPC link is ready to route traffic",
+ "VpcLinkVersion": "V2"
+ }
+ {
+ "CreatedDate": "2020-04-07T00:27:47Z",
+ "Name": "MyOtherVpcLink",
+ "SecurityGroupIds": [
+ "sg1234",
+ "sg5678"
+ ],
+ "SubnetIds": [
+ "subnet-aaaa",
+ "subnet-bbbb"
+ ],
+ "Tags": {},
+ "VpcLinkId": "abcd456",
+ "VpcLinkStatus": "AVAILABLE",
+ "VpcLinkStatusMessage": "VPC link is ready to route traffic",
+ "VpcLinkVersion": "V2"
+ }
+ ]
+ }
+
+For more information, see `Working with VPC links for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/import-api.rst awscli-1.18.69/awscli/examples/apigatewayv2/import-api.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/import-api.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/import-api.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,38 @@
+**To import an HTTP API**
+
+The following ``import-api`` example creates an HTTP API from an OpenAPI 3.0 definition file named ``api-definition.yaml``. ::
+
+ aws apigatewayv2 import-api \
+ --body file://api-definition.yaml
+
+Contents of ``api-definition.yaml``::
+
+ openapi: 3.0.1
+ info:
+ title: My Lambda API
+ version: v1.0
+ paths:
+ /hello:
+ x-amazon-apigateway-any-method:
+ x-amazon-apigateway-integration:
+ payloadFormatVersion: 2.0
+ type: aws_proxy
+ httpMethod: POST
+ uri: arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:hello/invocations
+ connectionType: INTERNET
+
+Output::
+
+ {
+ "ApiEndpoint": "https://a1b2c3d4.execute-api.us-west-2.amazonaws.com",
+ "ApiId": "a1b2c3d4",
+ "ApiKeySelectionExpression": "$request.header.x-api-key",
+ "CreatedDate": "2020-04-08T17:19:38+00:00",
+ "Name": "My Lambda API",
+ "ProtocolType": "HTTP",
+ "RouteSelectionExpression": "$request.method $request.path",
+ "Tags": {},
+ "Version": "v1.0"
+ }
+
+For more information, see `Working with OpenAPI definitions for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/reimport-api.rst awscli-1.18.69/awscli/examples/apigatewayv2/reimport-api.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/reimport-api.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/reimport-api.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,39 @@
+**To reimport an HTTP API**
+
+The following ``reimport-api`` example updates an existing HTTP API to use the OpenAPI 3.0 definition specified in ``api-definition.yaml``. ::
+
+ aws apigatewayv2 reimport-api \
+ --body file://api-definition.yaml \
+ --api-id a1b2c3d4
+
+Contents of ``api-definition.yaml``::
+
+ openapi: 3.0.1
+ info:
+ title: My Lambda API
+ version: v1.0
+ paths:
+ /hello:
+ x-amazon-apigateway-any-method:
+ x-amazon-apigateway-integration:
+ payloadFormatVersion: 2.0
+ type: aws_proxy
+ httpMethod: POST
+ uri: arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:12356789012:function:hello/invocations
+ connectionType: INTERNET
+
+Output::
+
+ {
+ "ApiEndpoint": "https://a1b2c3d4.execute-api.us-west-2.amazonaws.com",
+ "ApiId": "a1b2c3d4",
+ "ApiKeySelectionExpression": "$request.header.x-api-key",
+ "CreatedDate": "2020-04-08T17:19:38+00:00",
+ "Name": "My Lambda API",
+ "ProtocolType": "HTTP",
+ "RouteSelectionExpression": "$request.method $request.path",
+ "Tags": {},
+ "Version": "v1.0"
+ }
+
+For more information, see `Working with OpenAPI definitions for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/tag-resource.rst awscli-1.18.69/awscli/examples/apigatewayv2/tag-resource.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/tag-resource.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/tag-resource.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To tag a resource**
+
+The following ``tag-resource`` example adds a tag with the key name ``Department`` and a value of ``Accounting`` to the specified API. ::
+
+ aws apigatewayv2 tag-resource \
+ --resource-arn arn:aws:apigateway:us-west-2::/apis/a1b2c3d4 \
+ --tags Department=Accounting
+
+This command produces no output.
+
+For more information, see `Tagging your API Gateway resources `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/untag-resource.rst awscli-1.18.69/awscli/examples/apigatewayv2/untag-resource.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/untag-resource.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/untag-resource.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To remove tags from a resource**
+
+The following ``untag-resource`` example removes tags with the key names ``Project`` and ``Owner`` from the specified API. ::
+
+ aws apigatewayv2 untag-resource \
+ --resource-arn arn:aws:apigateway:us-west-2::/apis/a1b2c3d4 \
+ --tag-keys Project Owner
+
+This command produces no output.
+
+For more information, see `Tagging your API Gateway resources `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-api-mapping.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-api-mapping.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-api-mapping.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-api-mapping.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,21 @@
+**To update an API mapping**
+
+The following ``update-api-mapping`` example changes an API mapping for a custom domain name. As a result, the base URL using the custom domain name for the specified API and stage becomes ``https://api.example.com/dev``. ::
+
+ aws apigatewayv2 update-api-mapping \
+ --api-id a1b2c3d4 \
+ --stage dev \
+ --domain-name api.example.com \
+ --api-mapping-id 0qzs2sy7bh \
+ --api-mapping-key dev
+
+Output::
+
+ {
+ "ApiId": "a1b2c3d4",
+ "ApiMappingId": "0qzs2sy7bh",
+ "ApiMappingKey": "dev"
+ "Stage": "dev"
+ }
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-api.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-api.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-api.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-api.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,37 @@
+**To enable CORS for an HTTP API**
+
+The following ``update-api`` example updates the specified API's CORS configuration to allow requests from ``https://www.example.com``. ::
+
+ aws apigatewayv2 update-api \
+ --api-id a1b2c3d4 \
+ --cors-configuration AllowOrigins=https://www.example.com
+
+Output::
+
+ {
+ "ApiEndpoint": "https://a1b2c3d4.execute-api.us-west-2.amazonaws.com",
+ "ApiId": "a1b2c3d4",
+ "ApiKeySelectionExpression": "$request.header.x-api-key",
+ "CorsConfiguration": {
+ "AllowCredentials": false,
+ "AllowHeaders": [
+ "header1",
+ "header2"
+ ],
+ "AllowMethods": [
+ "GET",
+ "OPTIONS"
+ ],
+ "AllowOrigins": [
+ "https://www.example.com"
+ ]
+ },
+ "CreatedDate": "2020-04-08T18:39:37+00:00",
+ "Name": "my-http-api",
+ "ProtocolType": "HTTP",
+ "RouteSelectionExpression": "$request.method $request.path",
+ "Tags": {},
+ "Version": "v1.0"
+ }
+
+For more information, see `Configuring CORS for an HTTP API `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-authorizer.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-authorizer.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-authorizer.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-authorizer.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,27 @@
+**To update an authorizer**
+
+The following ``update-authorizer`` example changes a JWT authorizer's identity source to a header named ``Authorization``. ::
+
+ aws apigatewayv2 update-authorizer \
+ --api-id a1b2c3d4 \
+ --authorizer-id a1b2c3 \
+ --identity-source '$request.header.Authorization'
+
+Output::
+
+ {
+ "AuthorizerId": "a1b2c3",
+ "AuthorizerType": "JWT",
+ "IdentitySource": [
+ "$request.header.Authorization"
+ ],
+ "JwtConfiguration": {
+ "Audience": [
+ "123456abc"
+ ],
+ "Issuer": "https://cognito-idp.us-west-2.amazonaws.com/us-west-2_abc123"
+ },
+ "Name": "my-jwt-authorizer"
+ }
+
+For more information, see `Controlling access to HTTP APIs with JWT authorizers `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-deployment.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-deployment.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-deployment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-deployment.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,20 @@
+**To change a deployment's description**
+
+The following ``update-deployment`` example updates a deployment's description. ::
+
+ aws apigatewayv2 update-deployment \
+ --api-id a1b2c3d4 \
+ --deployment-id abcdef \
+ --description 'Manual deployment to fix integration test failures.'
+
+Output::
+
+ {
+ "AutoDeployed": false,
+ "CreatedDate": "2020-02-05T16:21:48+00:00",
+ "DeploymentId": "abcdef",
+ "DeploymentStatus": "DEPLOYED",
+ "Description": "Manual deployment to fix integration test failures."
+ }
+
+For more information, see `Developing an HTTP API in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-domain-name.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-domain-name.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-domain-name.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-domain-name.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,26 @@
+**To update a custom domain name**
+
+The following ``update-domain-name`` example specifies a new ACM certificate for the ``api.example.com`` custom domain name. ::
+
+ aws apigatewayv2 update-domain-name \
+ --domain-name api.example.com \
+ --domain-name-configurations CertificateArn=arn:aws:acm:us-west-2:123456789012:certificate/123456789012-1234-1234-1234-12345678
+
+Output::
+
+ {
+ "ApiMappingSelectionExpression": "$request.basepath",
+ "DomainName": "regional.example.com",
+ "DomainNameConfigurations": [
+ {
+ "ApiGatewayDomainName": "d-id.execute-api.us-west-2.amazonaws.com",
+ "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/123456789012-1234-1234-1234-12345678",
+ "EndpointType": "REGIONAL",
+ "HostedZoneId": "123456789111",
+ "SecurityPolicy": "TLS_1_2",
+ "DomainNameStatus": "AVAILABLE"
+ }
+ ]
+ }
+
+For more information, see `Setting up a regional custom domain name in API Gateway `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-integration.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-integration.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-integration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-integration.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,22 @@
+**To update a Lambda integration**
+
+The following ``update-integration`` example updates an existing AWS Lambda integration to use the specified Lambda function. ::
+
+ aws apigatewayv2 update-integration \
+ --api-id a1b2c3d4 \
+ --integration-id a1b2c3 \
+ --integration-uri arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:my-new-function/invocations
+
+Output::
+
+ {
+ "ConnectionType": "INTERNET",
+ "IntegrationId": "a1b2c3",
+ "IntegrationMethod": "POST",
+ "IntegrationType": "AWS_PROXY",
+ "IntegrationUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123456789012:function:my-new-function/invocations",
+ "PayloadFormatVersion": "2.0",
+ "TimeoutInMillis": 5000
+ }
+
+For more information, see `Configuring integrations for HTTP APIs `__ and `Setting up WebSocket API integrations `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-route.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-route.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-route.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-route.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,29 @@
+**To add an authorizer to a route**
+
+The following ``update-route`` example updates the specified route to use a JWT authorizer. ::
+
+ aws apigatewayv2 update-route \
+ --api-id a1b2c3d4 \
+ --route-id a1b2c3 \
+ --authorization-type JWT \
+ --authorizer-id a1b2c5 \
+ --authorization-scopes user.id user.email
+
+Output::
+
+ {
+ "ApiKeyRequired": false,
+ "AuthorizationScopes": [
+ "user.id",
+ "user.email"
+ ],
+ "AuthorizationType": "JWT",
+ "AuthorizerId": "a1b2c5",
+ "OperationName": "GET HTTP",
+ "RequestParameters": {},
+ "RouteId": "a1b2c3",
+ "RouteKey": "GET /pets",
+ "Target": "integrations/a1b2c6"
+ }
+
+For more information, see `Controlling access to HTTP APIs with JWT authorizers `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-stage.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-stage.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-stage.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-stage.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,30 @@
+**To configure custom throttling**
+
+The following ``update-stage`` example configures custom throttling for the specified stage and route of an API. ::
+
+ aws apigatewayv2 update-stage \
+ --api-id a1b2c3d4 \
+ --stage-name dev \
+ --route-settings '{"GET /pets":{"ThrottlingBurstLimit":100,"ThrottlingRateLimit":2000}}'
+
+Output::
+
+ {
+ "CreatedDate": "2020-04-05T16:21:16+00:00",
+ "DefaultRouteSettings": {
+ "DetailedMetricsEnabled": false
+ },
+ "DeploymentId": "shktxb",
+ "LastUpdatedDate": "2020-04-08T22:23:17+00:00",
+ "RouteSettings": {
+ "GET /pets": {
+ "ThrottlingBurstLimit": 100,
+ "ThrottlingRateLimit": 2000.0
+ }
+ },
+ "StageName": "dev",
+ "StageVariables": {},
+ "Tags": {}
+ }
+
+For more information, see `Protecting your HTTP API `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/apigatewayv2/update-vpc-link.rst awscli-1.18.69/awscli/examples/apigatewayv2/update-vpc-link.rst
--- awscli-1.11.13/awscli/examples/apigatewayv2/update-vpc-link.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/apigatewayv2/update-vpc-link.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,29 @@
+**To update a VPC link**
+
+The following ``update-vpc-link`` example updates the name of a VPC link. After you've created a VPC link, you can't change its security groups or subnets. ::
+
+ aws apigatewayv2 update-vpc-link \
+ --vpc-link-id abcd123 \
+ --name MyUpdatedVpcLink
+
+Output::
+
+ {
+ "CreatedDate": "2020-04-07T00:27:47Z",
+ "Name": "MyUpdatedVpcLink",
+ "SecurityGroupIds": [
+ "sg1234",
+ "sg5678"
+ ],
+ "SubnetIds": [
+ "subnet-aaaa",
+ "subnet-bbbb"
+ ],
+ "Tags": {},
+ "VpcLinkId": "abcd123",
+ "VpcLinkStatus": "AVAILABLE",
+ "VpcLinkStatusMessage": "VPC link is ready to route traffic",
+ "VpcLinkVersion": "V2"
+ }
+
+For more information, see `Working with VPC links for HTTP APIs `__ in the *Amazon API Gateway Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appconfig/get-configuration.rst awscli-1.18.69/awscli/examples/appconfig/get-configuration.rst
--- awscli-1.11.13/awscli/examples/appconfig/get-configuration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appconfig/get-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,19 @@
+**To list the AppConfig applications in your AWS account**
+
+This ``get-configuration`` example lists the applications in your account in the current Region. ::
+
+ aws appconfig get-configuration \
+ --application abc1234 \
+ --environment 9x8y7z6 \
+ --configuration 9sd1ukd \
+ --client-id any-id \
+ outfile > my-file-name
+
+Output::
+
+ {
+ "ConfigurationVersion": "2",
+ "ContentType": "application/octet-stream"
+ }
+
+For more information, see `Retrieving the Configuration `__ in the *AWS Systems Manager User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appconfig/list-applications.rst awscli-1.18.69/awscli/examples/appconfig/list-applications.rst
--- awscli-1.11.13/awscli/examples/appconfig/list-applications.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appconfig/list-applications.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,19 @@
+**To list the AppConfig applications in your AWS account**
+
+This ``list-applications`` example lists the applications in your account in the current Region. ::
+
+ aws appconfig list-applications
+
+Output::
+
+ {
+ "Items": [
+ {
+ "Description": "My first AppConfig application",
+ "Id": "abc1234",
+ "Name": "MyTestApp"
+ }
+ ]
+ }
+
+For more information, see `Create an AppConfig Application `__ in the *AWS Systems Manager User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appconfig/list-configuration-profiles.rst awscli-1.18.69/awscli/examples/appconfig/list-configuration-profiles.rst
--- awscli-1.11.13/awscli/examples/appconfig/list-configuration-profiles.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appconfig/list-configuration-profiles.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,33 @@
+**To list the configuration profiles for an AppConfig application**
+
+This ``list-configuration-profiles`` example lists the configuration profiles for an application. ::
+
+ aws appconfig list-configuration-profiles \
+ --application-id abc1234
+
+Output::
+
+ {
+ "Items": [
+ {
+ "ValidatorTypes": [
+ "JSON_SCHEMA"
+ ],
+ "ApplicationId": "abc1234",
+ "Id": "9x8y7z6",
+ "LocationUri": "ssm-parameter:///blogapp/featureX_switch",
+ "Name": "TestConfigurationProfile"
+ },
+ {
+ "ValidatorTypes": [
+ "JSON_SCHEMA"
+ ],
+ "ApplicationId": "abc1234",
+ "Id": "hijklmn",
+ "LocationUri": "ssm-parameter:///testapp/featureX_switch",
+ "Name": "TestAppConfigurationProfile"
+ }
+ ]
+ }
+
+For more information, see `Create a Configuration and a Configuration Profile `__ in the *AWS Systems Manager User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appconfig/list-environments.rst awscli-1.18.69/awscli/examples/appconfig/list-environments.rst
--- awscli-1.11.13/awscli/examples/appconfig/list-environments.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appconfig/list-environments.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,23 @@
+**To list environments for an AppConfig application**
+
+This ``list-environments`` example lists the environments that exist for an application. ::
+
+ aws appconfig list-environments \
+ --application-id abc1234
+
+Output::
+
+ {
+ "Items": [
+ {
+ "Description": "My AppConfig environment",
+ "Id": "2d4e6f8",
+ "State": "ReadyForDeployment",
+ "ApplicationId": "abc1234",
+ "Monitors": [],
+ "Name": "TestEnvironment"
+ }
+ ]
+ }
+
+For more information, see `Create an Environment `__ in the *AWS Systems Manager User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/application-autoscaling/delete-scheduled-action.rst awscli-1.18.69/awscli/examples/application-autoscaling/delete-scheduled-action.rst
--- awscli-1.11.13/awscli/examples/application-autoscaling/delete-scheduled-action.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/application-autoscaling/delete-scheduled-action.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,13 @@
+**To delete a scheduled action**
+
+The follwing ``delete-scheduled-action`` example deletes the specified scheduled action from the specified Amazon AppStream 2.0 fleet::
+
+ aws application-autoscaling delete-scheduled-action \
+ --service-namespace appstream \
+ --scalable-dimension appstream:fleet:DesiredCapacity \
+ --resource-id fleet/sample-fleet \
+ --scheduled-action-name my-recurring-action
+
+This command produces no output.
+
+For more information, see `Scheduled Scaling `__ in the *Application Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/application-autoscaling/deregister-scalable-target.rst awscli-1.18.69/awscli/examples/application-autoscaling/deregister-scalable-target.rst
--- awscli-1.11.13/awscli/examples/application-autoscaling/deregister-scalable-target.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/application-autoscaling/deregister-scalable-target.rst 2020-05-28 19:25:48.000000000 +0000
@@ -5,3 +5,13 @@
Command::
aws application-autoscaling deregister-scalable-target --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --resource-id service/default/web-app
+
+This example deregisters a scalable target for a custom resource. The custom-resource-id.txt file contains a string that identifies the Resource ID, which, for a custom resource, is the path to the custom resource through your Amazon API Gateway endpoint.
+
+Command::
+
+ aws application-autoscaling deregister-scalable-target --service-namespace custom-resource --scalable-dimension custom-resource:ResourceType:Property --resource-id file://~/custom-resource-id.txt
+
+Contents of custom-resource-id.txt file::
+
+ https://example.execute-api.us-west-2.amazonaws.com/prod/scalableTargetDimensions/1-23456789
diff -Nru awscli-1.11.13/awscli/examples/application-autoscaling/describe-scalable-targets.rst awscli-1.18.69/awscli/examples/application-autoscaling/describe-scalable-targets.rst
--- awscli-1.11.13/awscli/examples/application-autoscaling/describe-scalable-targets.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/application-autoscaling/describe-scalable-targets.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,23 +1,29 @@
**To describe scalable targets**
-This example command describes the scalable targets for the `ecs` service namespace.
+The following ``describe-scalable-targets`` example command displays details for the the scalable targets for the ``ecs`` service namespace::
-Command::
-
- aws application-autoscaling describe-scalable-targets --service-namespace ecs
+ aws application-autoscaling describe-scalable-targets \
+ --service-namespace ecs
Output::
- {
- "ScalableTargets": [
- {
- "ScalableDimension": "ecs:service:DesiredCount",
- "ResourceId": "service/default/web-app",
- "RoleARN": "arn:aws:iam::012345678910:role/ApplicationAutoscalingECSRole",
- "CreationTime": 1462558906.199,
- "MinCapacity": 1,
- "ServiceNamespace": "ecs",
- "MaxCapacity": 10
- }
- ]
- }
+ {
+ "ScalableTargets": [
+ {
+ "ScalableDimension": "ecs:service:DesiredCount",
+ "ResourceId": "service/default/web-app",
+ "RoleARN": "arn:aws:iam::123456789012:role/ApplicationAutoscalingECSRole",
+ "SuspendedState": {
+ "DynamicScalingOutSuspended": false,
+ "ScheduledScalingSuspended": false,
+ "DynamicScalingInSuspended": false
+ },
+ "CreationTime": 1462558906.199,
+ "MinCapacity": 1,
+ "ServiceNamespace": "ecs",
+ "MaxCapacity": 10
+ }
+ ]
+ }
+
+For more information, see `What Is Application Auto Scaling? `__ in the *Application Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/application-autoscaling/describe-scaling-activities.rst awscli-1.18.69/awscli/examples/application-autoscaling/describe-scaling-activities.rst
--- awscli-1.11.13/awscli/examples/application-autoscaling/describe-scaling-activities.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/application-autoscaling/describe-scaling-activities.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,26 +1,91 @@
-**To describe scaling activities for a scalable target**
+**Example 1: To describe scaling activities for a scalable target**
-This example describes the scaling activities for an Amazon ECS service called `web-app` that is running in the `default` cluster.
+The following ``describe-scaling-activities`` example displays details for th the scaling activities for an Amazon ECS service called `web-app` that is running in the `default` cluster. ::
-Command::
+ aws application-autoscaling describe-scaling-activities \
+ --service-namespace ecs \
+ --scalable-dimension ecs:service:DesiredCount \
+ --resource-id service/default/web-app
- aws application-autoscaling describe-scaling-activities --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --resource-id service/default/web-app
+Output::
+
+ {
+ "ScalingActivities": [
+ {
+ "ScalableDimension": "ecs:service:DesiredCount",
+ "Description": "Setting desired count to 1.",
+ "ResourceId": "service/default/web-app",
+ "ActivityId": "e6c5f7d1-dbbb-4a3f-89b2-51f33e766399",
+ "StartTime": 1462575838.171,
+ "ServiceNamespace": "ecs",
+ "EndTime": 1462575872.111,
+ "Cause": "monitor alarm web-app-cpu-lt-25 in state ALARM triggered policy web-app-cpu-lt-25",
+ "StatusMessage": "Successfully set desired count to 1. Change successfully fulfilled by ecs.",
+ "StatusCode": "Successful"
+ }
+ ]
+ }
+
+**Example 2: To describe scaling activities triggered by scheduled actions**
+
+The following ``describe-scaling-activities`` example describes the scaling activities for the specified DynamoDB table. The output shows scaling activities triggered by two different scheduled actions::
+
+ aws application-autoscaling describe-scaling-activities \
+ --service-namespace dynamodb \
+ --scalable-dimension dynamodb:table:WriteCapacityUnits \
+ --resource-id table/my-table
Output::
- {
- "ScalingActivities": [
- {
- "ScalableDimension": "ecs:service:DesiredCount",
- "Description": "Setting desired count to 1.",
- "ResourceId": "service/default/web-app",
- "ActivityId": "e6c5f7d1-dbbb-4a3f-89b2-51f33e766399",
- "StartTime": 1462575838.171,
- "ServiceNamespace": "ecs",
- "EndTime": 1462575872.111,
- "Cause": "monitor alarm web-app-cpu-lt-25 in state ALARM triggered policy web-app-cpu-lt-25",
- "StatusMessage": "Successfully set desired count to 1. Change successfully fulfilled by ecs.",
- "StatusCode": "Successful"
- }
- ]
- }
\ No newline at end of file
+ {
+ "ScalingActivities": [
+ {
+ "ScalableDimension": "dynamodb:table:WriteCapacityUnits",
+ "Description": "Setting write capacity units to 10.",
+ "ResourceId": "table/my-table",
+ "ActivityId": "4d1308c0-bbcf-4514-a673-b0220ae38547",
+ "StartTime": 1561574415.086,
+ "ServiceNamespace": "dynamodb",
+ "EndTime": 1561574449.51,
+ "Cause": "maximum capacity was set to 10",
+ "StatusMessage": "Successfully set write capacity units to 10. Change successfully fulfilled by dynamodb.",
+ "StatusCode": "Successful"
+ },
+ {
+ "ScalableDimension": "dynamodb:table:WriteCapacityUnits",
+ "Description": "Setting min capacity to 5 and max capacity to 10",
+ "ResourceId": "table/my-table",
+ "ActivityId": "f2b7847b-721d-4e01-8ef0-0c8d3bacc1c7",
+ "StartTime": 1561574414.644,
+ "ServiceNamespace": "dynamodb",
+ "Cause": "scheduled action name my-second-scheduled-action was triggered",
+ "StatusMessage": "Successfully set min capacity to 5 and max capacity to 10",
+ "StatusCode": "Successful"
+ },
+ {
+ "ScalableDimension": "dynamodb:table:WriteCapacityUnits",
+ "Description": "Setting write capacity units to 15.",
+ "ResourceId": "table/my-table",
+ "ActivityId": "d8ea4de6-9eaa-499f-b466-2cc5e681ba8b",
+ "StartTime": 1561574108.904,
+ "ServiceNamespace": "dynamodb",
+ "EndTime": 1561574140.255,
+ "Cause": "minimum capacity was set to 15",
+ "StatusMessage": "Successfully set write capacity units to 15. Change successfully fulfilled by dynamodb.",
+ "StatusCode": "Successful"
+ },
+ {
+ "ScalableDimension": "dynamodb:table:WriteCapacityUnits",
+ "Description": "Setting min capacity to 15 and max capacity to 20",
+ "ResourceId": "table/my-table",
+ "ActivityId": "3250fd06-6940-4e8e-bb1f-d494db7554d2",
+ "StartTime": 1561574108.512,
+ "ServiceNamespace": "dynamodb",
+ "Cause": "scheduled action name my-first-scheduled-action was triggered",
+ "StatusMessage": "Successfully set min capacity to 15 and max capacity to 20",
+ "StatusCode": "Successful"
+ }
+ ]
+ }
+
+For more information, see `Scheduled Scaling `__ in the *Application Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/application-autoscaling/describe-scheduled-actions.rst awscli-1.18.69/awscli/examples/application-autoscaling/describe-scheduled-actions.rst
--- awscli-1.11.13/awscli/examples/application-autoscaling/describe-scheduled-actions.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/application-autoscaling/describe-scheduled-actions.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,41 @@
+**To describe scheduled actions**
+
+The following ``describe-scheduled-actions`` example displays details for the scheduled actions for the specified service namespace::
+
+ aws application-autoscaling describe-scheduled-actions \
+ --service-namespace dynamodb
+
+Output::
+
+ {
+ "ScheduledActions": [
+ {
+ "ScalableDimension": "dynamodb:table:WriteCapacityUnits",
+ "Schedule": "at(2019-05-20T18:35:00)",
+ "ResourceId": "table/my-table",
+ "CreationTime": 1561571888.361,
+ "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledAction:2d36aa3b-cdf9-4565-b290-81db519b227d:resource/dynamodb/table/my-table:scheduledActionName/my-first-scheduled-action",
+ "ScalableTargetAction": {
+ "MinCapacity": 15,
+ "MaxCapacity": 20
+ },
+ "ScheduledActionName": "my-first-scheduled-action",
+ "ServiceNamespace": "dynamodb"
+ },
+ {
+ "ScalableDimension": "dynamodb:table:WriteCapacityUnits",
+ "Schedule": "at(2019-05-20T18:40:00)",
+ "ResourceId": "table/my-table",
+ "CreationTime": 1561571946.021,
+ "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledAction:2d36aa3b-cdf9-4565-b290-81db519b227d:resource/dynamodb/table/my-table:scheduledActionName/my-second-scheduled-action",
+ "ScalableTargetAction": {
+ "MinCapacity": 5,
+ "MaxCapacity": 10
+ },
+ "ScheduledActionName": "my-second-scheduled-action",
+ "ServiceNamespace": "dynamodb"
+ }
+ ]
+ }
+
+For more information, see `Scheduled Scaling `__ in the *Application Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/application-autoscaling/put-scaling-policy.rst awscli-1.18.69/awscli/examples/application-autoscaling/put-scaling-policy.rst
--- awscli-1.11.13/awscli/examples/application-autoscaling/put-scaling-policy.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/application-autoscaling/put-scaling-policy.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,33 +1,122 @@
-**To apply a scaling policy to an Amazon ECS service**
+**Example 1: To apply a target tracking scaling policy with a predefined metric specification**
-This example command applies a scaling policy to an Amazon ECS service called `web-app` in the `default` cluster. The policy increases the desired count of the service by 200%, with a cool down period of 60 seconds.
+The following ``put-scaling-policy`` example applies a target tracking scaling policy with a predefined metric specification to an Amazon ECS service called web-app in the default cluster. The policy keeps the average CPU utilization of the service at 75 percent, with scale-out and scale-in cooldown periods of 60 seconds. The output contains the ARNs and names of the two CloudWatch alarms created on your behalf. ::
-Command::
+ aws application-autoscaling put-scaling-policy --service-namespace ecs \
+ --scalable-dimension ecs:service:DesiredCount \
+ --resource-id service/default/web-app \
+ --policy-name cpu75-target-tracking-scaling-policy --policy-type TargetTrackingScaling \
+ --target-tracking-scaling-policy-configuration file://config.json
+
+This example assumes that you have a `config.json` file in the current directory with the following contents::
+
+ {
+ "TargetValue": 75.0,
+ "PredefinedMetricSpecification": {
+ "PredefinedMetricType": "ECSServiceAverageCPUUtilization"
+ },
+ "ScaleOutCooldown": 60,
+ "ScaleInCooldown": 60
+ }
- aws application-autoscaling put-scaling-policy --cli-input-json file://scale-out.json
+Output::
-Contents of `scale-out.json` file::
-
- {
- "PolicyName": "web-app-cpu-gt-75",
- "ServiceNamespace": "ecs",
- "ResourceId": "service/default/web-app",
- "ScalableDimension": "ecs:service:DesiredCount",
- "PolicyType": "StepScaling",
- "StepScalingPolicyConfiguration": {
- "AdjustmentType": "PercentChangeInCapacity",
- "StepAdjustments": [
- {
- "MetricIntervalLowerBound": 0,
- "ScalingAdjustment": 200
- }
- ],
- "Cooldown": 60
- }
- }
+ {
+ "PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/cpu75-target-tracking-scaling-policy",
+ "Alarms": [
+ {
+ "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca",
+ "AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca"
+ },
+ {
+ "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d",
+ "AlarmName": "TargetTracking-service/default/web-app-AlarmLow-1b437334-d19b-4a63-a812-6c67aaf2910d"
+ }
+ ]
+ }
+
+**Example 2: To apply a target tracking scaling policy with a customized metric specification**
+
+The following ``put-scaling-policy`` example applies a target tracking scaling policy with a customized metric specification to an Amazon ECS service called web-app in the default cluster. The policy keeps the average utilization of the service at 75 percent, with scale-out and scale-in cooldown periods of 60 seconds. The output contains the ARNs and names of the two CloudWatch alarms created on your behalf. ::
+
+ aws application-autoscaling put-scaling-policy --service-namespace ecs \
+ --scalable-dimension ecs:service:DesiredCount \
+ --resource-id service/default/web-app \
+ --policy-name cms75-target-tracking-scaling-policy
+ --policy-type TargetTrackingScaling \
+ --target-tracking-scaling-policy-configuration file://config.json
+
+This example assumes that you have a `config.json` file in the current directory with the following contents::
+
+ {
+ "TargetValue":75.0,
+ "CustomizedMetricSpecification":{
+ "MetricName":"MyUtilizationMetric",
+ "Namespace":"MyNamespace",
+ "Dimensions": [
+ {
+ "Name":"MyOptionalMetricDimensionName",
+ "Value":"MyOptionalMetricDimensionValue"
+ }
+ ],
+ "Statistic":"Average",
+ "Unit":"Percent"
+ },
+ "ScaleOutCooldown": 60,
+ "ScaleInCooldown": 60
+ }
Output::
- {
- "PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/web-app-cpu-gt-75"
- }
+ {
+ "PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy: 8784a896-b2ba-47a1-b08c-27301cc499a1:resource/ecs/service/default/web-app:policyName/cms75-target-tracking-scaling-policy",
+ "Alarms": [
+ {
+ "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmHigh-9bc77b56-0571-4276-ba0f-d4178882e0a0",
+ "AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-9bc77b56-0571-4276-ba0f-d4178882e0a0"
+ },
+ {
+ "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:TargetTracking-service/default/web-app-AlarmLow-9b6ad934-6d37-438e-9e05-02836ddcbdc4",
+ "AlarmName": "TargetTracking-service/default/web-app-AlarmLow-9b6ad934-6d37-438e-9e05-02836ddcbdc4"
+ }
+ ]
+ }
+
+**Example 3: To apply a target tracking scaling policy for scale out only**
+
+The following ``put-scaling-policy`` example applies a target tracking scaling policy to an Amazon ECS service called ``web-app`` in the default cluster. The policy is used to scale out the ECS service when the ``RequestCountPerTarget`` metric from the Application Load Balancer exceeds the threshold. The output contains the ARN and name of the CloudWatch alarm created on your behalf. ::
+
+ aws application-autoscaling put-scaling-policy \
+ --service-namespace ecs \
+ --scalable-dimension ecs:service:DesiredCount \
+ --resource-id service/default/web-app \
+ --policy-name alb-scale-out-target-tracking-scaling-policy \
+ --policy-type TargetTrackingScaling \
+ --target-tracking-scaling-policy-configuration file://config.json
+
+Contents of ``config.json``::
+
+ {
+ "TargetValue": 1000.0,
+ "PredefinedMetricSpecification": {
+ "PredefinedMetricType": "ALBRequestCountPerTarget",
+ "ResourceLabel": "app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d"
+ },
+ "ScaleOutCooldown": 60,
+ "ScaleInCooldown": 60,
+ "DisableScaleIn": true
+ }
+
+Output::
+
+ {
+ "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/alb-scale-out-target-tracking-scaling-policy",
+ "Alarms": [
+ {
+ "AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca",
+ "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca"
+ }
+ ]
+ }
+
+For more information, see `Target Tracking Scaling Policies for Application Auto Scaling `_ in the *AWS Application Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/application-autoscaling/put-scheduled-action.rst awscli-1.18.69/awscli/examples/application-autoscaling/put-scheduled-action.rst
--- awscli-1.11.13/awscli/examples/application-autoscaling/put-scheduled-action.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/application-autoscaling/put-scheduled-action.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To add a scheduled action to a DynamoDB table**
+
+This example adds a scheduled action to a DynamoDB table called `TestTable` to scale out on a recurring schedule. On the specified schedule (every day at 12:15pm UTC), if the current capacity is below the value specified for MinCapacity, Application Auto Scaling scales out to the value specified by MinCapacity.
+
+Command::
+
+ aws application-autoscaling put-scheduled-action --service-namespace dynamodb --scheduled-action-name my-recurring-action --schedule "cron(15 12 * * ? *)" --resource-id table/TestTable --scalable-dimension dynamodb:table:WriteCapacityUnits --scalable-target-action MinCapacity=6
+
+For more information, see `Scheduled Scaling`_ in the *Application Auto Scaling User Guide*.
+
+.. _`Scheduled Scaling`: https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html
diff -Nru awscli-1.11.13/awscli/examples/application-autoscaling/register-scalable-target.rst awscli-1.18.69/awscli/examples/application-autoscaling/register-scalable-target.rst
--- awscli-1.11.13/awscli/examples/application-autoscaling/register-scalable-target.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/application-autoscaling/register-scalable-target.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,21 +1,115 @@
-**To register a new scalable target**
+**Example 1: To register a new scalable target for Amazon ECS**
-This example command registers a scalable target from an Amazon ECS service called `web-app` that is running on the `default` cluster, with a minimum desired count of 1 task and a maximum desired count of 10 tasks.
+The following ``register-scalable-target`` example registers a scalable target for an Amazon ECS service called web-app, running on the default cluster, with a minimum desired count of 1 task and a maximum desired count of 10 tasks. ::
-Command::
+ aws application-autoscaling register-scalable-target \
+ --service-namespace ecs \
+ --scalable-dimension ecs:service:DesiredCount \
+ --resource-id service/default/web-app \
+ --min-capacity 1 \
+ --max-capacity 10
- aws application-autoscaling register-scalable-target --resource-id service/default/web-app --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --min-capacity 1 --max-capacity 10 --role-arn arn:aws:iam::012345678910:role/ApplicationAutoscalingECSRole
+**Example 2: To register a new scalable target for a Spot Fleet**
-Output::
-
- {
- "cluster": {
- "status": "ACTIVE",
- "clusterName": "my_cluster",
- "registeredContainerInstancesCount": 0,
- "pendingTasksCount": 0,
- "runningTasksCount": 0,
- "activeServicesCount": 0,
- "clusterArn": "arn:aws:ecs:::cluster/my_cluster"
- }
- }
+The following ``register-scalable-target`` example registers the target capacity of an Amazon EC2 Spot Fleet request using its request ID, with a minimum capacity of 2 instances and a maximum capacity of 10 instances. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace ec2 \
+ --scalable-dimension ec2:spot-fleet-request:TargetCapacity \
+ --resource-id spot-fleet-request/sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE \
+ --min-capacity 2 \
+ --max-capacity 10
+
+**Example 3: To register a new scalable target for AppStream 2.0**
+
+The following ``register-scalable-target`` example registers the desired capacity of an AppStream 2.0 fleet called sample-fleet, with a minimum capacity of 1 fleet instance and a maximum capacity of 5 fleet instances. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace appstream \
+ --scalable-dimension appstream:fleet:DesiredCapacity \
+ --resource-id fleet/sample-fleet \
+ --min-capacity 1 \
+ --max-capacity 5
+
+**Example 4: To register a new scalable target for a DynamoDB table**
+
+The following ``register-scalable-target`` example registers the provisioned write capacity of a DynamoDB table called my-table, with a minimum capacity of 5 write capacity units and a maximum capacity of 10 write capacity units. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace dynamodb \
+ --scalable-dimension dynamodb:table:WriteCapacityUnits \
+ --resource-id table/my-table \
+ --min-capacity 5 \
+ --max-capacity 10
+
+**Example 5: To register a new scalable target for a DynamoDB global secondary index**
+
+The following ``register-scalable-target`` example registers the provisioned write capacity of a DynamoDB global secondary index called my-table-index, with a minimum capacity of 5 write capacity units and a maximum capacity of 10 write capacity units. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace dynamodb \
+ --scalable-dimension dynamodb:index:WriteCapacityUnits \
+ --resource-id table/my-table/index/my-table-index \
+ --min-capacity 5 \
+ --max-capacity 10
+
+**Example 6: To register a new scalable target for Aurora DB**
+
+The following ``register-scalable-target`` example registers the count of Aurora Replicas in an Aurora DB cluster called my-db-cluster, with a minimum capacity of 1 Aurora Replica and a maximum capacity of 8 Aurora Replicas. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace rds \
+ --scalable-dimension rds:cluster:ReadReplicaCount \
+ --resource-id cluster:my-db-cluster \
+ --min-capacity 1 \
+ --max-capacity 8
+
+**Example 7: To register a new scalable target for Amazon Sagemaker**
+
+The following ``register-scalable-target`` example registers the desired EC2 instance count for an Amazon Sagemaker product variant called my-variant, running on the my-endpoint endpoint, with a minimum capacity of 1 instance and a maximum capacity of 8 instances. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace sagemaker \
+ --scalable-dimension sagemaker:variant:DesiredInstanceCount \
+ --resource-id endpoint/my-endpoint/variant/my-variant \
+ --min-capacity 1 \
+ --max-capacity 8
+
+**Example 8: To register a new scalable target for a custom resource**
+
+The following ``register-scalable-target`` example registers a custom resource as a scalable target, with a minimum desired count of 1 capacity unit and a maximum desired count of 10 capacity units. The ``custom-resource-id.txt`` file contains a string that identifies the Resource ID, which for a custom resource is the path to the custom resource through your Amazon API Gateway endpoint. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace custom-resource \
+ --scalable-dimension custom-resource:ResourceType:Property \
+ --resource-id file://~/custom-resource-id.txt \
+ --min-capacity 1 \
+ --max-capacity 10
+
+Contents of ``custom-resource-id.txt``::
+
+ https://example.execute-api.us-west-2.amazonaws.com/prod/scalableTargetDimensions/1-23456789
+
+**Example 9: To register a new scalable target for Amazon Comprehend**
+
+The following ``register-scalable-target`` example registers the desired number of inference units to be used by the model for an Amazon Comprehend document classifier endpoint using the endpoint's ARN, with a minimum capacity of 1 inference unit and a maximum capacity of 3 inference units. Each inference unit represents a throughput of 100 characters per second. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace comprehend \
+ --scalable-dimension comprehend:document-classifier-endpoint:DesiredInferenceUnits \
+ --resource-id arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE \
+ --min-capacity 1 \
+ --max-capacity 3
+
+**Example 10: To register a new scalable target for AWS Lambda**
+
+The following ``register-scalable-target`` example registers the provisioned concurrency for an alias called ``BLUE`` for the Lambda function called ``my-function``, with a minimum capacity of 0 and a maximum capacity of 100. ::
+
+ aws application-autoscaling register-scalable-target \
+ --service-namespace lambda \
+ --scalable-dimension lambda:function:ProvisionedConcurrency \
+ --resource-id function:my-function:BLUE \
+ --min-capacity 0 \
+ --max-capacity 100
+
+For more information, see the `Application Auto Scaling User Guide `__.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/create-mesh.rst awscli-1.18.69/awscli/examples/appmesh/create-mesh.rst
--- awscli-1.11.13/awscli/examples/appmesh/create-mesh.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/create-mesh.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,54 @@
+**Example 1: To create a new service mesh**
+
+The following ``create-mesh`` example creates a service mesh. ::
+
+ aws appmesh create-mesh \
+ --mesh-name app1
+
+Output::
+
+ {
+ "mesh":{
+ "meshName":"app1",
+ "metadata":{
+ "arn":"arn:aws:appmesh:us-east-1:123456789012:mesh/app1",
+ "createdAt":1563809909.282,
+ "lastUpdatedAt":1563809909.282,
+ "uid":"a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version":1
+ },
+ "spec":{},
+ "status":{
+ "status":"ACTIVE"
+ }
+ }
+ }
+
+**Example 2: To create a new service mesh with multiple tags**
+
+The following ``create-mesh`` example creates a service mesh with multiple tags. ::
+
+ aws appmesh create-mesh \
+ --mesh-name app2 \
+ --tags key=key1,value=value1 key=key2,value=value2 key=key3,value=value3
+
+Output::
+
+ {
+ "mesh":{
+ "meshName":"app2",
+ "metadata":{
+ "arn":"arn:aws:appmesh:us-east-1:123456789012:mesh/app2",
+ "createdAt":1563822121.877,
+ "lastUpdatedAt":1563822121.877,
+ "uid":"a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version":1
+ },
+ "spec":{},
+ "status":{
+ "status":"ACTIVE"
+ }
+ }
+ }
+
+For more information, see `Service Meshes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/create-route.rst awscli-1.18.69/awscli/examples/appmesh/create-route.rst
--- awscli-1.11.13/awscli/examples/appmesh/create-route.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/create-route.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,301 @@
+**To create a new gRPC route**
+
+The following ``create-route`` example uses a JSON input file to create a gRPC route. GRPC traffic that has metadata that starts with 123 is routed to a virtual node named serviceBgrpc. If there are specific gRPC, HTTP, or TCP failures when attempting to communicate with the target of the route, the route is retried three times. There is a 15 second delay between each retry attempt. ::
+
+ aws appmesh create-route \
+ --cli-input-json file://create-route-grpc.json
+
+Contents of ``create-route-grpc.json``::
+
+ {
+ "meshName" : "apps",
+ "routeName" : "grpcRoute",
+ "spec" : {
+ "grpcRoute" : {
+ "action" : {
+ "weightedTargets" : [
+ {
+ "virtualNode" : "serviceBgrpc",
+ "weight" : 100
+ }
+ ]
+ },
+ "match" : {
+ "metadata" : [
+ {
+ "invert" : false,
+ "match" : {
+ "prefix" : "123"
+ },
+ "name" : "myMetadata"
+ }
+ ],
+ "methodName" : "GetColor",
+ "serviceName" : "com.amazonaws.services.ColorService"
+ },
+ "retryPolicy" : {
+ "grpcRetryEvents" : [ "deadline-exceeded" ],
+ "httpRetryEvents" : [ "server-error", "gateway-error" ],
+ "maxRetries" : 3,
+ "perRetryTimeout" : {
+ "unit" : "s",
+ "value" : 15
+ },
+ "tcpRetryEvents" : [ "connection-error" ]
+ }
+ },
+ "priority" : 100
+ },
+ "virtualRouterName" : "serviceBgrpc"
+ }
+
+Output::
+
+ {
+ "route": {
+ "meshName": "apps",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-west-2:123456789012:mesh/apps/virtualRouter/serviceBgrpc/route/grpcRoute",
+ "createdAt": 1572010806.008,
+ "lastUpdatedAt": 1572010806.008,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "routeName": "grpcRoute",
+ "spec": {
+ "grpcRoute": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "serviceBgrpc",
+ "weight": 100
+ }
+ ]
+ },
+ "match": {
+ "metadata": [
+ {
+ "invert": false,
+ "match": {
+ "prefix": "123"
+ },
+ "name": "mymetadata"
+ }
+ ],
+ "methodName": "GetColor",
+ "serviceName": "com.amazonaws.services.ColorService"
+ },
+ "retryPolicy": {
+ "grpcRetryEvents": [
+ "deadline-exceeded"
+ ],
+ "httpRetryEvents": [
+ "server-error",
+ "gateway-error"
+ ],
+ "maxRetries": 3,
+ "perRetryTimeout": {
+ "unit": "s",
+ "value": 15
+ },
+ "tcpRetryEvents": [
+ "connection-error"
+ ]
+ }
+ },
+ "priority": 100
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualRouterName": "serviceBgrpc"
+ }
+ }
+
+**To create a new HTTP or HTTP/2 route**
+
+The following ``create-route`` example uses a JSON input file to create an HTTP/2 route. To create an HTTP route, replace http2Route with httpRoute under spec. All HTTP/2 traffic addressed to any URL prefix that has a header value that starts with 123 is routed to a virtual node named serviceBhttp2. If there are specific HTTP or TCP failures when attempting to communicate with the target of the route, the route is retried three times. There is a 15 second delay between each retry attempt. ::
+
+ aws appmesh create-route \
+ --cli-input-json file://create-route-http2.json
+
+Contents of ``create-route-http2.json``::
+
+ {
+ "meshName": "apps",
+ "routeName": "http2Route",
+ "spec": {
+ "http2Route": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "serviceBhttp2",
+ "weight": 100
+ }
+ ]
+ },
+ "match": {
+ "headers": [
+ {
+ "invert": false,
+ "match": {
+ "prefix": "123"
+ },
+ "name": "clientRequestId"
+ }
+ ],
+ "method": "POST",
+ "prefix": "/",
+ "scheme": "http"
+ },
+ "retryPolicy": {
+ "httpRetryEvents": [
+ "server-error",
+ "gateway-error"
+ ],
+ "maxRetries": 3,
+ "perRetryTimeout": {
+ "unit": "s",
+ "value": 15
+ },
+ "tcpRetryEvents": [
+ "connection-error"
+ ]
+ }
+ },
+ "priority": 200
+ },
+ "virtualRouterName": "serviceBhttp2"
+ }
+
+Output::
+
+ {
+ "route": {
+ "meshName": "apps",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-west-2:123456789012:mesh/apps/virtualRouter/serviceBhttp2/route/http2Route",
+ "createdAt": 1572011008.352,
+ "lastUpdatedAt": 1572011008.352,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "routeName": "http2Route",
+ "spec": {
+ "http2Route": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "serviceBhttp2",
+ "weight": 100
+ }
+ ]
+ },
+ "match": {
+ "headers": [
+ {
+ "invert": false,
+ "match": {
+ "prefix": "123"
+ },
+ "name": "clientRequestId"
+ }
+ ],
+ "method": "POST",
+ "prefix": "/",
+ "scheme": "http"
+ },
+ "retryPolicy": {
+ "httpRetryEvents": [
+ "server-error",
+ "gateway-error"
+ ],
+ "maxRetries": 3,
+ "perRetryTimeout": {
+ "unit": "s",
+ "value": 15
+ },
+ "tcpRetryEvents": [
+ "connection-error"
+ ]
+ }
+ },
+ "priority": 200
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualRouterName": "serviceBhttp2"
+ }
+ }
+
+**To create a new TCP route**
+
+The following ``create-route`` example uses a JSON input file to create a TCP route. 75 percent of traffic is routed to a virtual node named serviceBtcp, and 25 percent of traffic is routed to a virtual node named serviceBv2tcp. Specifying different weightings for different targets is an effective way to do a deployment of a new version of an application. You can adjust the weights so that eventually, 100 percent of all traffic is routed to a target that has the new version of an application. ::
+
+ aws appmesh create-route \
+ --cli-input-json file://create-route-tcp.json
+
+Contents of create-route-tcp.json::
+
+ {
+ "meshName": "apps",
+ "routeName": "tcpRoute",
+ "spec": {
+ "priority": 300,
+ "tcpRoute": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "serviceBtcp",
+ "weight": 75
+ },
+ {
+ "virtualNode": "serviceBv2tcp",
+ "weight": 25
+ }
+ ]
+ }
+ }
+ },
+ "virtualRouterName": "serviceBtcp"
+ }
+
+Output::
+
+ {
+ "route": {
+ "meshName": "apps",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-west-2:123456789012:mesh/apps/virtualRouter/serviceBtcp/route/tcpRoute",
+ "createdAt": 1572011436.26,
+ "lastUpdatedAt": 1572011436.26,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "routeName": "tcpRoute",
+ "spec": {
+ "priority": 300,
+ "tcpRoute": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "serviceBtcp",
+ "weight": 75
+ },
+ {
+ "virtualNode": "serviceBv2tcp",
+ "weight": 25
+ }
+ ]
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualRouterName": "serviceBtcp"
+ }
+ }
+
+For more information, see `Routes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/create-virtual-node.rst awscli-1.18.69/awscli/examples/appmesh/create-virtual-node.rst
--- awscli-1.11.13/awscli/examples/appmesh/create-virtual-node.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/create-virtual-node.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,155 @@
+**Example 1: To create a new virtual node that uses DNS for discovery**
+
+The following ``create-virtual-node`` example uses a JSON input file to create a virtual node that uses DNS for service discovery. ::
+
+ aws appmesh create-virtual-node \
+ --cli-input-json file://create-virtual-node-dns.json
+
+Contents of ``create-virtual-node-dns.json``::
+
+ {
+ "meshName": "app1",
+ "spec": {
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ],
+ "serviceDiscovery": {
+ "dns": {
+ "hostname": "serviceBv1.svc.cluster.local"
+ }
+ }
+ },
+ "virtualNodeName": "vnServiceBv1"
+ }
+
+Output::
+
+ {
+ "virtualNode": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualNode/vnServiceBv1",
+ "createdAt": 1563810019.874,
+ "lastUpdatedAt": 1563810019.874,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "spec": {
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ],
+ "serviceDiscovery": {
+ "dns": {
+ "hostname": "serviceBv1.svc.cluster.local"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualNodeName": "vnServiceBv1"
+ }
+ }
+
+**Example 2: To create a new virtual node that uses AWS Cloud Map for discovery**
+
+The following ``create-virtual-node`` example uses a JSON input file to create a virtual node that uses AWS Cloud Map for service discovery. ::
+
+ aws appmesh create-virtual-node \
+ --cli-input-json file://create-virtual-node-cloud-map.json
+
+Contents of ``create-virtual-node-cloud-map.json``::
+
+ {
+ "meshName": "app1",
+ "spec": {
+ "backends": [
+ {
+ "virtualService": {
+ "virtualServiceName": "serviceA.svc.cluster.local"
+ }
+ }
+ ],
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ],
+ "serviceDiscovery": {
+ "awsCloudMap": {
+ "attributes": [
+ {
+ "key": "Environment",
+ "value": "Testing"
+ }
+ ],
+ "namespaceName": "namespace1",
+ "serviceName": "serviceA"
+ }
+ }
+ },
+ "virtualNodeName": "vnServiceA"
+ }
+
+Output::
+
+ {
+ "virtualNode": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualNode/vnServiceA",
+ "createdAt": 1563810859.465,
+ "lastUpdatedAt": 1563810859.465,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "spec": {
+ "backends": [
+ {
+ "virtualService": {
+ "virtualServiceName": "serviceA.svc.cluster.local"
+ }
+ }
+ ],
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ],
+ "serviceDiscovery": {
+ "awsCloudMap": {
+ "attributes": [
+ {
+ "key": "Environment",
+ "value": "Testing"
+ }
+ ],
+ "namespaceName": "namespace1",
+ "serviceName": "serviceA"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualNodeName": "vnServiceA"
+ }
+ }
+
+For more information, see `Virtual Nodes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/create-virtual-router.rst awscli-1.18.69/awscli/examples/appmesh/create-virtual-router.rst
--- awscli-1.11.13/awscli/examples/appmesh/create-virtual-router.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/create-virtual-router.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,54 @@
+**To create a new virtual router**
+
+The following ``create-virtual-router`` example uses a JSON input file to create a virtual router with a listener for HTTP using port 80. ::
+
+ aws appmesh create-virtual-router \
+ --cli-input-json file://create-virtual-router.json
+
+Contents of ``create-virtual-router.json``::
+
+ {
+ "meshName": "app1",
+ "spec": {
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ]
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+
+Output::
+
+ {
+ "virtualRouter": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB",
+ "createdAt": 1563810546.59,
+ "lastUpdatedAt": 1563810546.59,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "spec": {
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ]
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+
+For more information, see `Virtual Routers `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/create-virtual-service.rst awscli-1.18.69/awscli/examples/appmesh/create-virtual-service.rst
--- awscli-1.11.13/awscli/examples/appmesh/create-virtual-service.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/create-virtual-service.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,97 @@
+**Example 1: To create a new virtual service with a virtual node provider**
+
+The following ``create-virtual-service`` example uses a JSON input file to create a virtual service with a virtual node provider. ::
+
+ aws appmesh create-virtual-service \
+ --cli-input-json file://create-virtual-service-virtual-node.json
+
+Contents of ``create-virtual-service-virtual-node.json``::
+
+ {
+ "meshName": "app1",
+ "spec": {
+ "provider": {
+ "virtualNode": {
+ "virtualNodeName": "vnServiceA"
+ }
+ }
+ },
+ "virtualServiceName": "serviceA.svc.cluster.local"
+ }
+
+Output::
+
+ {
+ "virtualService": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualService/serviceA.svc.cluster.local",
+ "createdAt": 1563810859.474,
+ "lastUpdatedAt": 1563810967.179,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 2
+ },
+ "spec": {
+ "provider": {
+ "virtualNode": {
+ "virtualNodeName": "vnServiceA"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualServiceName": "serviceA.svc.cluster.local"
+ }
+ }
+
+For more information, see `Virtual Node `__ in the *AWS App Mesh User Guide*.
+
+**Example 2: To create a new virtual service with a virtual router provider**
+
+The following ``create-virtual-service`` example uses a JSON input file to create a virtual service with a virtual router provider. ::
+
+ aws appmesh create-virtual-service \
+ --cli-input-json file://create-virtual-service-virtual-router.json
+
+Contents of ``create-virtual-service-virtual-router.json``::
+
+ {
+ "meshName": "app1",
+ "spec": {
+ "provider": {
+ "virtualRouter": {
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+ },
+ "virtualServiceName": "serviceB.svc.cluster.local"
+ }
+
+Output::
+
+ {
+ "virtualService": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualService/serviceB.svc.cluster.local",
+ "createdAt": 1563908363.999,
+ "lastUpdatedAt": 1563908363.999,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "spec": {
+ "provider": {
+ "virtualRouter": {
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualServiceName": "serviceB.svc.cluster.local"
+ }
+ }
+
+For more information, see `Virtual Services`__ in the *AWS App Mesh User Guide*
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/appmesh/delete-mesh.rst awscli-1.18.69/awscli/examples/appmesh/delete-mesh.rst
--- awscli-1.11.13/awscli/examples/appmesh/delete-mesh.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/delete-mesh.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,31 @@
+**To delete a service mesh**
+
+The following ``delete-mesh`` example deletes the specified service mesh. ::
+
+ aws appmesh delete-mesh \
+ --mesh-name app1
+
+Output::
+
+ {
+ "mesh": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1",
+ "createdAt": 1563809909.282,
+ "lastUpdatedAt": 1563824981.248,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 2
+ },
+ "spec": {
+ "egressFilter": {
+ "type": "ALLOW_ALL"
+ }
+ },
+ "status": {
+ "status": "DELETED"
+ }
+ }
+ }
+
+For more information, see `Service Meshes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/delete-route.rst awscli-1.18.69/awscli/examples/appmesh/delete-route.rst
--- awscli-1.11.13/awscli/examples/appmesh/delete-route.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/delete-route.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,49 @@
+**To delete a route**
+
+The following ``delete-route`` example deletes the specified route. ::
+
+ aws appmesh delete-route \
+ --mesh-name app1 \
+ --virtual-router-name vrServiceB \
+ --route-name toVnServiceB-weighted
+
+Output::
+
+ {
+ "route": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB/route/toVnServiceB-weighted",
+ "createdAt": 1563811384.015,
+ "lastUpdatedAt": 1563823915.936,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 3
+ },
+ "routeName": "toVnServiceB-weighted",
+ "spec": {
+ "httpRoute": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "vnServiceBv1",
+ "weight": 80
+ },
+ {
+ "virtualNode": "vnServiceBv2",
+ "weight": 20
+ }
+ ]
+ },
+ "match": {
+ "prefix": "/"
+ }
+ }
+ },
+ "status": {
+ "status": "DELETED"
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+
+For more information, see `Routes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/delete-virtual-node.rst awscli-1.18.69/awscli/examples/appmesh/delete-virtual-node.rst
--- awscli-1.11.13/awscli/examples/appmesh/delete-virtual-node.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/delete-virtual-node.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,44 @@
+**To delete a virtual node**
+
+The following ``delete-virtual-node`` example deletes the specified virtual node. ::
+
+ aws appmesh delete-virtual-node \
+ --mesh-name app1 \
+ --virtual-node-name vnServiceBv2
+
+Output::
+
+ {
+ "virtualNode": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualNode/vnServiceBv2",
+ "createdAt": 1563810117.297,
+ "lastUpdatedAt": 1563824700.678,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 2
+ },
+ "spec": {
+ "backends": [],
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ],
+ "serviceDiscovery": {
+ "dns": {
+ "hostname": "serviceBv2.svc.cluster.local"
+ }
+ }
+ },
+ "status": {
+ "status": "DELETED"
+ },
+ "virtualNodeName": "vnServiceBv2"
+ }
+ }
+
+For more information, see `Virtual Nodes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/delete-virtual-router.rst awscli-1.18.69/awscli/examples/appmesh/delete-virtual-router.rst
--- awscli-1.11.13/awscli/examples/appmesh/delete-virtual-router.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/delete-virtual-router.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,38 @@
+**To delete a virtual router**
+
+The following ``delete-virtual-router`` example deletes the specified virtual router. ::
+
+ aws appmesh delete-virtual-router \
+ --mesh-name app1 \
+ --virtual-router-name vrServiceB
+
+Output::
+
+ {
+ "virtualRouter": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB",
+ "createdAt": 1563810546.59,
+ "lastUpdatedAt": 1563824253.467,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 3
+ },
+ "spec": {
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ]
+ },
+ "status": {
+ "status": "DELETED"
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+
+For more information, see `Virtual Routers `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/delete-virtual-service.rst awscli-1.18.69/awscli/examples/appmesh/delete-virtual-service.rst
--- awscli-1.11.13/awscli/examples/appmesh/delete-virtual-service.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/delete-virtual-service.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,29 @@
+**To delete a virtual service**
+
+The following ``delete-virtual-service`` example deletes the specified virtual service. ::
+
+ aws appmesh delete-virtual-service \
+ --mesh-name app1 \
+ --virtual-service-name serviceB.svc.cluster.local
+
+Output::
+
+ {
+ "virtualService": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualService/serviceB.svc.cluster.local",
+ "createdAt": 1563908363.999,
+ "lastUpdatedAt": 1563913940.866,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 3
+ },
+ "spec": {},
+ "status": {
+ "status": "DELETED"
+ },
+ "virtualServiceName": "serviceB.svc.cluster.local"
+ }
+ }
+
+For more information, see `Virtual Service `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/describe-mesh.rst awscli-1.18.69/awscli/examples/appmesh/describe-mesh.rst
--- awscli-1.11.13/awscli/examples/appmesh/describe-mesh.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/describe-mesh.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,27 @@
+**To describe a service mesh**
+
+The following ``describe-mesh`` example returns details about the specified service mesh. ::
+
+ aws appmesh describe-mesh \
+ --mesh-name app1
+
+Output::
+
+ {
+ "mesh": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1",
+ "createdAt": 1563809909.282,
+ "lastUpdatedAt": 1563809909.282,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "spec": {},
+ "status": {
+ "status": "ACTIVE"
+ }
+ }
+ }
+
+For more information, see `Service Meshes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/describe-route.rst awscli-1.18.69/awscli/examples/appmesh/describe-route.rst
--- awscli-1.11.13/awscli/examples/appmesh/describe-route.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/describe-route.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,49 @@
+**To describe a route**
+
+The following ``describe-route`` example returns details about the specified route. ::
+
+ aws appmesh describe-route \
+ --mesh-name app1 \
+ --virtual-router-name vrServiceB \
+ --route-name toVnServiceB-weighted
+
+Output::
+
+ {
+ "route": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB/route/toVnServiceB-weighted",
+ "createdAt": 1563811384.015,
+ "lastUpdatedAt": 1563811384.015,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "routeName": "toVnServiceB-weighted",
+ "spec": {
+ "httpRoute": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "vnServiceBv1",
+ "weight": 90
+ },
+ {
+ "virtualNode": "vnServiceBv2",
+ "weight": 10
+ }
+ ]
+ },
+ "match": {
+ "prefix": "/"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+
+For more information, see `Routes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/describe-virtual-node.rst awscli-1.18.69/awscli/examples/appmesh/describe-virtual-node.rst
--- awscli-1.11.13/awscli/examples/appmesh/describe-virtual-node.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/describe-virtual-node.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,44 @@
+**To describe a virtual node**
+
+The following ``describe-virtual-node`` example returns details about the specified virtual node. ::
+
+ aws appmesh describe-virtual-node \
+ --mesh-name app1 \
+ --virtual-node-name vnServiceBv1
+
+Output::
+
+ {
+ "virtualNode": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualNode/vnServiceBv1",
+ "createdAt": 1563810019.874,
+ "lastUpdatedAt": 1563810019.874,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "spec": {
+ "backends": [],
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ],
+ "serviceDiscovery": {
+ "dns": {
+ "hostname": "serviceBv1.svc.cluster.local"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualNodeName": "vnServiceBv1"
+ }
+ }
+
+For more information, see `Virtual Nodes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/describe-virtual-router.rst awscli-1.18.69/awscli/examples/appmesh/describe-virtual-router.rst
--- awscli-1.11.13/awscli/examples/appmesh/describe-virtual-router.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/describe-virtual-router.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,38 @@
+**To describe a virtual router**
+
+The following ``describe-virtual-router`` example returns details about the specified virtual router. ::
+
+ aws appmesh describe-virtual-router \
+ --mesh-name app1 \
+ --virtual-router-name vrServiceB
+
+Output::
+
+ {
+ "virtualRouter": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB",
+ "createdAt": 1563810546.59,
+ "lastUpdatedAt": 1563810546.59,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "spec": {
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ]
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+
+For more information, see `Virtual Routers `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/describe-virtual-service.rst awscli-1.18.69/awscli/examples/appmesh/describe-virtual-service.rst
--- awscli-1.11.13/awscli/examples/appmesh/describe-virtual-service.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/describe-virtual-service.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,35 @@
+**To describe a virtual service**
+
+The following ``describe-virtual-service`` example returns details about the specified virtual service. ::
+
+ aws appmesh describe-virtual-service \
+ --mesh-name app1 \
+ --virtual-service-name serviceB.svc.cluster.local
+
+Output::
+
+ {
+ "virtualService": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualService/serviceB.svc.cluster.local",
+ "createdAt": 1563908363.999,
+ "lastUpdatedAt": 1563908363.999,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 1
+ },
+ "spec": {
+ "provider": {
+ "virtualRouter": {
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualServiceName": "serviceB.svc.cluster.local"
+ }
+ }
+
+For more information, see `Virtual Services `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/list-meshes.rst awscli-1.18.69/awscli/examples/appmesh/list-meshes.rst
--- awscli-1.11.13/awscli/examples/appmesh/list-meshes.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/list-meshes.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+**To list service meshes**
+
+The following ``list-meshes`` example lists all of the service meshes in the current AWS Region. ::
+
+ aws appmesh list-meshes
+
+Output::
+
+ {
+ "meshes": [
+ {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1",
+ "meshName": "app1"
+ }
+ ]
+ }
+
+For more information, see `Service Meshes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/list-routes.rst awscli-1.18.69/awscli/examples/appmesh/list-routes.rst
--- awscli-1.11.13/awscli/examples/appmesh/list-routes.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/list-routes.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,22 @@
+**To list routes**
+
+The following ``list-routes`` example lists all of the routes for the specified virtual router. ::
+
+ aws appmesh list-routes \
+ --mesh-name app1 \
+ --virtual-router-name vrServiceB
+
+Output::
+
+ {
+ "routes": [
+ {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB/route/toVnServiceB",
+ "meshName": "app1",
+ "routeName": "toVnServiceB-weighted",
+ "virtualRouterName": "vrServiceB"
+ }
+ ]
+ }
+
+For more information, see `Routes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/list-tags-for-resource.rst awscli-1.18.69/awscli/examples/appmesh/list-tags-for-resource.rst
--- awscli-1.11.13/awscli/examples/appmesh/list-tags-for-resource.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/list-tags-for-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To list tags for a resource**
+
+The following ``list-tags-for-resource`` example lists all of the tags assigned to the specified resource. ::
+
+ aws appmesh list-tags-for-resource \
+ --resource-arn arn:aws:appmesh:us-east-1:123456789012:mesh/app1
+
+Output::
+
+ {
+ "tags": [
+ {
+ "key": "key1",
+ "value": "value1"
+ },
+ {
+ "key": "key2",
+ "value": "value2"
+ },
+ {
+ "key": "key3",
+ "value": "value3"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/appmesh/list-virtual-nodes.rst awscli-1.18.69/awscli/examples/appmesh/list-virtual-nodes.rst
--- awscli-1.11.13/awscli/examples/appmesh/list-virtual-nodes.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/list-virtual-nodes.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To list virtual nodes**
+
+The following ``list-virtual-nodes`` example lists all of the virtual nodes in the specified service mesh. ::
+
+ aws appmesh list-virtual-nodes \
+ --mesh-name app1
+
+Output::
+
+ {
+ "virtualNodes": [
+ {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualNode/vnServiceBv1",
+ "meshName": "app1",
+ "virtualNodeName": "vnServiceBv1"
+ },
+ {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualNode/vnServiceBv2",
+ "meshName": "app1",
+ "virtualNodeName": "vnServiceBv2"
+ }
+ ]
+ }
+
+For more information, see `Virtual Nodes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/list-virtual-routers.rst awscli-1.18.69/awscli/examples/appmesh/list-virtual-routers.rst
--- awscli-1.11.13/awscli/examples/appmesh/list-virtual-routers.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/list-virtual-routers.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,20 @@
+**To list virtual routers**
+
+The following ``list-virtual-routers`` example lists all of the virtual routers in the specified service mesh. ::
+
+ aws appmesh list-virtual-routers \
+ --mesh-name app1
+
+Output::
+
+ {
+ "virtualRouters": [
+ {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB",
+ "meshName": "app1",
+ "virtualRouterName": "vrServiceB"
+ }
+ ]
+ }
+
+For more information, see `Virtual Routers `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/list-virtual-services.rst awscli-1.18.69/awscli/examples/appmesh/list-virtual-services.rst
--- awscli-1.11.13/awscli/examples/appmesh/list-virtual-services.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/list-virtual-services.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To list virtual services**
+
+The following ``list-virtual-services`` example lists all of the virtual services in the specified service mesh. ::
+
+ aws appmesh list-virtual-services \
+ --mesh-name app1
+
+Output::
+
+ {
+ "virtualServices": [
+ {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualService/serviceA.svc.cluster.local",
+ "meshName": "app1",
+ "virtualServiceName": "serviceA.svc.cluster.local"
+ },
+ {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualService/serviceB.svc.cluster.local",
+ "meshName": "app1",
+ "virtualServiceName": "serviceB.svc.cluster.local"
+ }
+ ]
+ }
+
+For more information, see `Virtual Services `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/tag-resource.rst awscli-1.18.69/awscli/examples/appmesh/tag-resource.rst
--- awscli-1.11.13/awscli/examples/appmesh/tag-resource.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/tag-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,9 @@
+**To tag a resource**
+
+The following ``tag-resource`` example adds the tag ``key1`` with the value ``value1`` to the specified resource. ::
+
+ aws appmesh tag-resource \
+ --resource-arn arn:aws:appmesh:us-east-1:123456789012:mesh/app1 \
+ --tags key=key1,value=value1
+
+This command produces no output.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/untag-resource.rst awscli-1.18.69/awscli/examples/appmesh/untag-resource.rst
--- awscli-1.11.13/awscli/examples/appmesh/untag-resource.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/untag-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,9 @@
+**To untag a resource**
+
+The following ``untag-resource`` example removes a tag with the key ``key1`` from the specified resource. ::
+
+ aws appmesh untag-resource \
+ --resource-arn arn:aws:appmesh:us-east-1:123456789012:mesh/app1 \
+ --tag-keys key1
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/appmesh/update-mesh.rst awscli-1.18.69/awscli/examples/appmesh/update-mesh.rst
--- awscli-1.11.13/awscli/examples/appmesh/update-mesh.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/update-mesh.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,42 @@
+**To update a service mesh**
+
+The following ``update-mesh`` example uses a JSON input file to update a service mesh to allow all external egress traffic to be forwarded through the Envoy proxy untouched. ::
+
+ aws appmesh update-mesh \
+ --cli-input-json file://update-mesh.json
+
+Contents of ``update-mesh.json``::
+
+ {
+ "meshName": "app1",
+ "spec": {
+ "egressFilter": {
+ "type": "ALLOW_ALL"
+ }
+ }
+ }
+
+Output::
+
+ {
+ "mesh": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1",
+ "createdAt": 1563809909.282,
+ "lastUpdatedAt": 1563812829.687,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 2
+ },
+ "spec": {
+ "egressFilter": {
+ "type": "ALLOW_ALL"
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ }
+ }
+ }
+
+For more information, see `Service Meshes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/update-route.rst awscli-1.18.69/awscli/examples/appmesh/update-route.rst
--- awscli-1.11.13/awscli/examples/appmesh/update-route.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/update-route.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,74 @@
+**To update a route**
+
+The following ``update-route`` example uses a JSON input file to update the weights for a route. ::
+
+ aws appmesh update-route \
+ --cli-input-json file://update-route-weighted.json
+
+Contents of ``update-route-weighted.json``::
+
+ {
+ "meshName": "app1",
+ "routeName": "toVnServiceB-weighted",
+ "spec": {
+ "httpRoute": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "vnServiceBv1",
+ "weight": 80
+ },
+ {
+ "virtualNode": "vnServiceBv2",
+ "weight": 20
+ }
+ ]
+ },
+ "match": {
+ "prefix": "/"
+ }
+ }
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+
+Output::
+
+ {
+ "route": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB/route/toVnServiceB-weighted",
+ "createdAt": 1563811384.015,
+ "lastUpdatedAt": 1563819600.022,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 2
+ },
+ "routeName": "toVnServiceB-weighted",
+ "spec": {
+ "httpRoute": {
+ "action": {
+ "weightedTargets": [
+ {
+ "virtualNode": "vnServiceBv1",
+ "weight": 80
+ },
+ {
+ "virtualNode": "vnServiceBv2",
+ "weight": 20
+ }
+ ]
+ },
+ "match": {
+ "prefix": "/"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+
+For more information, see `Routes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/update-virtual-node.rst awscli-1.18.69/awscli/examples/appmesh/update-virtual-node.rst
--- awscli-1.11.13/awscli/examples/appmesh/update-virtual-node.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/update-virtual-node.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,83 @@
+**To update a virtual node**
+
+The following ``update-virtual-node`` example uses a JSON input file to add a health check to a virtual node. ::
+
+ aws appmesh update-virtual-node \
+ --cli-input-json file://update-virtual-node.json
+
+Contents of ``update-virtual-node.json``::
+
+ {
+ "clientToken": "500",
+ "meshName": "app1",
+ "spec": {
+ "listeners": [
+ {
+ "healthCheck": {
+ "healthyThreshold": 5,
+ "intervalMillis": 10000,
+ "path": "/",
+ "port": 80,
+ "protocol": "http",
+ "timeoutMillis": 3000,
+ "unhealthyThreshold": 3
+ },
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ],
+ "serviceDiscovery": {
+ "dns": {
+ "hostname": "serviceBv1.svc.cluster.local"
+ }
+ }
+ },
+ "virtualNodeName": "vnServiceBv1"
+ }
+
+Output::
+
+ {
+ "virtualNode": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualNode/vnServiceBv1",
+ "createdAt": 1563810019.874,
+ "lastUpdatedAt": 1563819234.825,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 2
+ },
+ "spec": {
+ "listeners": [
+ {
+ "healthCheck": {
+ "healthyThreshold": 5,
+ "intervalMillis": 10000,
+ "path": "/",
+ "port": 80,
+ "protocol": "http",
+ "timeoutMillis": 3000,
+ "unhealthyThreshold": 3
+ },
+ "portMapping": {
+ "port": 80,
+ "protocol": "http"
+ }
+ }
+ ],
+ "serviceDiscovery": {
+ "dns": {
+ "hostname": "serviceBv1.svc.cluster.local"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualNodeName": "vnServiceBv1"
+ }
+ }
+
+For more information, see `Virtual Nodes `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/update-virtual-router.rst awscli-1.18.69/awscli/examples/appmesh/update-virtual-router.rst
--- awscli-1.11.13/awscli/examples/appmesh/update-virtual-router.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/update-virtual-router.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,54 @@
+**To update a virtual router**
+
+The following ``update-virtual-router`` example uses a JSON input file to update a virtual router listener port. ::
+
+ aws appmesh update-virtual-router \
+ --cli-input-json file://update-virtual-router.json
+
+Contents of ``update-virtual-router.json``::
+
+ {
+ "meshName": "app1",
+ "spec": {
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 8080,
+ "protocol": "http"
+ }
+ }
+ ]
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+
+Output::
+
+ {
+ "virtualRouter": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/vrServiceB",
+ "createdAt": 1563810546.59,
+ "lastUpdatedAt": 1563819431.352,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 2
+ },
+ "spec": {
+ "listeners": [
+ {
+ "portMapping": {
+ "port": 8080,
+ "protocol": "http"
+ }
+ }
+ ]
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualRouterName": "vrServiceB"
+ }
+ }
+
+For more information, see `Virtual Routers `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/appmesh/update-virtual-service.rst awscli-1.18.69/awscli/examples/appmesh/update-virtual-service.rst
--- awscli-1.11.13/awscli/examples/appmesh/update-virtual-service.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/appmesh/update-virtual-service.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,48 @@
+**To update a virtual service**
+
+The following ``update-virtual-service`` example uses a JSON input file to update a virtual service to use a virtual router provider. ::
+
+ aws appmesh update-virtual-service \
+ --cli-input-json file://update-virtual-service.json
+
+Contents of ``update-virtual-service.json``::
+
+ {
+ "meshName": "app1",
+ "spec": {
+ "provider": {
+ "virtualRouter": {
+ "virtualRouterName": "vrServiceA"
+ }
+ }
+ },
+ "virtualServiceName": "serviceA.svc.cluster.local"
+ }
+
+Output::
+
+ {
+ "virtualService": {
+ "meshName": "app1",
+ "metadata": {
+ "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualService/serviceA.svc.cluster.local",
+ "createdAt": 1563810859.474,
+ "lastUpdatedAt": 1563820257.411,
+ "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "version": 3
+ },
+ "spec": {
+ "provider": {
+ "virtualRouter": {
+ "virtualRouterName": "vrServiceA"
+ }
+ }
+ },
+ "status": {
+ "status": "ACTIVE"
+ },
+ "virtualServiceName": "serviceA.svc.cluster.local"
+ }
+ }
+
+For more information, see `Virtual Services `__ in the *AWS App Mesh User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/create-auto-scaling-group.rst awscli-1.18.69/awscli/examples/autoscaling/create-auto-scaling-group.rst
--- awscli-1.11.13/awscli/examples/autoscaling/create-auto-scaling-group.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/create-auto-scaling-group.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,17 +1,68 @@
-**To create an Auto Scaling group**
+**To create an Auto Scaling group using a launch configuration**
-This example creates an Auto Scaling group in a VPC::
+This example creates an Auto Scaling group in a VPC using a launch configuration to specify the type of EC2 instance that Amazon EC2 Auto Scaling creates::
- aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --launch-configuration-name my-launch-config --min-size 1 --max-size 3 --vpc-zone-identifier subnet-41767929c
+ aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-configuration-name my-launch-config --min-size 1 --max-size 3 --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"
This example creates an Auto Scaling group and configures it to use an Elastic Load Balancing load balancer::
- aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --launch-configuration-name my-launch-config --load-balancer-names my-load-balancer --health-check-type ELB --health-check-grace-period 120
+ aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-configuration-name my-launch-config --load-balancer-names my-load-balancer --health-check-type ELB --health-check-grace-period 120 --min-size 1 --max-size 3 --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"
-This example creates an Auto Scaling group. It specifies Availability Zones instead of subnets. It also launches instances into a placement group and sets the termination policy to terminate the oldest instances first::
+This example specifies a desired capacity as well as a minimum and maximum capacity. It also launches instances into a placement group and sets the termination policy to terminate the oldest instances first::
- aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --launch-configuration-name my-launch-config --min-size 1 --max-size 3 --desired-capacity 2 --default-cooldown 600 --placement-group my-placement-group --termination-policies "OldestInstance" --availability-zones us-west-2c
+ aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-configuration-name my-launch-config --min-size 1 --max-size 3 --desired-capacity 1 --placement-group my-placement-group --termination-policies "OldestInstance" --availability-zones us-west-2c
+
+**To create an Auto Scaling group using an EC2 instance**
This example creates an Auto Scaling group from the specified EC2 instance and assigns a tag to instances in the group::
- aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --instance-id i-22c99e2a --min-size 1 --max-size 3 --vpc-zone-identifier subnet-41767929 --tags ResourceId=my-auto-scaling-group,ResourceType=auto-scaling-group,Key=Role,Value=WebServer
+ aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --instance-id i-22c99e2a --min-size 1 --max-size 3 --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" --tags "ResourceId=my-asg,ResourceType=auto-scaling-group,Key=Role,Value=WebServer,PropagateAtLaunch=true"
+
+**To create an Auto Scaling group using a launch template**
+
+This example creates an Auto Scaling group in a VPC using a launch template to specify the type of EC2 instance that Amazon EC2 Auto Scaling creates::
+
+ aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-template "LaunchTemplateName=my-template-for-auto-scaling,Version=1" --min-size 1 --max-size 3 --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782"
+
+This example uses the default version of the specified launch template. It specifies Availability Zones and subnets and enables the instance protection setting::
+
+ aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-template LaunchTemplateId=lt-0a4872e2c396d941c --min-size 1 --max-size 3 --desired-capacity 2 --availability-zones us-west-2a us-west-2b us-west-2c --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" --new-instances-protected-from-scale-in
+
+This example creates an Auto Scaling group that launches a single instance using a launch template to optionally specify the ID of an existing network interface (ENI ID) to use. It specifies an Availability Zone that matches the specified network interface::
+
+ aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg-single-instance --launch-template "LaunchTemplateName=my-single-instance-asg-template,Version=2" --min-size 1 --max-size 1 --availability-zones us-west-2a
+
+This example creates an Auto Scaling group with a lifecycle hook that supports a custom action at instance termination::
+
+ aws autoscaling create-auto-scaling-group --cli-input-json file://~/config.json
+
+Contents of config.json file::
+
+ {
+ "AutoScalingGroupName": "my-asg",
+ "LaunchTemplate": {
+ "LaunchTemplateId": "lt-0a4872e2c396d941c"
+ },
+ "LifecycleHookSpecificationList": [{
+ "LifecycleHookName": "my-hook",
+ "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING",
+ "NotificationTargetARN": "arn:aws:sqs:us-west-2:123456789012:my-sqs-queue",
+ "RoleARN": "arn:aws:iam::123456789012:role/my-notification-role",
+ "HeartbeatTimeout": 300,
+ "DefaultResult": "CONTINUE"
+ }],
+ "MinSize": 1,
+ "MaxSize": 5,
+ "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782",
+ "Tags": [{
+ "ResourceType": "auto-scaling-group",
+ "ResourceId": "my-asg",
+ "PropagateAtLaunch": true,
+ "Value": "test",
+ "Key": "environment"
+ }]
+ }
+
+For more information, see the `Amazon EC2 Auto Scaling User Guide`_.
+
+.. _`Amazon EC2 Auto Scaling User Guide`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/create-launch-configuration.rst awscli-1.18.69/awscli/examples/autoscaling/create-launch-configuration.rst
--- awscli-1.11.13/awscli/examples/autoscaling/create-launch-configuration.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/create-launch-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,10 +4,6 @@
aws autoscaling create-launch-configuration --launch-configuration-name my-launch-config --image-id ami-c6169af6 --instance-type m1.medium
-This example creates a launch configuration that uses Spot Instances::
-
- aws autoscaling create-launch-configuration --launch-configuration-name my-launch-config --image-id ami-c6169af6 --instance-type m1.medium --spot-price "0.50"
-
This example creates a launch configuration with a key pair and a bootstrapping script::
aws autoscaling create-launch-configuration --launch-configuration-name my-launch-config --key-name my-key-pair --image-id ami-c6169af6 --instance-type m1.small --user-data file://myuserdata.txt
@@ -33,3 +29,15 @@
Parameter::
--block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"NoDevice\":\"\"}]"
+
+For more information about quoting JSON-formatted parameters, see `Quoting Strings`_ in the *AWS Command Line Interface User Guide*.
+
+This example creates a launch configuration that uses Spot Instances::
+
+ aws autoscaling create-launch-configuration --launch-configuration-name my-launch-config --image-id ami-01e24be29428c15b2 --instance-type c5.large --spot-price "0.50"
+
+For more information, see `Launching Spot Instances in Your Auto Scaling Group`_ in the *Amazon EC2 Auto Scaling User Guide*.
+
+.. _`Quoting Strings`: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html#quoting-strings
+
+.. _`Launching Spot Instances in Your Auto Scaling Group`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/delete-auto-scaling-group.rst awscli-1.18.69/awscli/examples/autoscaling/delete-auto-scaling-group.rst
--- awscli-1.11.13/awscli/examples/autoscaling/delete-auto-scaling-group.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/delete-auto-scaling-group.rst 2020-05-28 19:25:48.000000000 +0000
@@ -8,6 +8,6 @@
aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --force-delete
-For more information, see `Shut Down Auto Scaling Processes`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Deleting Your Auto Scaling Infrastructure`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Shut Down Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-process-shutdown.html
+.. _`Deleting Your Auto Scaling Infrastructure`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-process-shutdown.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/delete-launch-configuration.rst awscli-1.18.69/awscli/examples/autoscaling/delete-launch-configuration.rst
--- awscli-1.11.13/awscli/examples/autoscaling/delete-launch-configuration.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/delete-launch-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling delete-launch-configuration --launch-configuration-name my-launch-config
-For more information, see `Shut Down Auto Scaling Processes`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Deleting Your Auto Scaling Infrastructure`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Shut Down Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-process-shutdown.html
+.. _`Deleting Your Auto Scaling Infrastructure`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-process-shutdown.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/delete-notification-configuration.rst awscli-1.18.69/awscli/examples/autoscaling/delete-notification-configuration.rst
--- awscli-1.11.13/awscli/examples/autoscaling/delete-notification-configuration.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/delete-notification-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling delete-notification-configuration --auto-scaling-group-name my-auto-scaling-group --topic-arn arn:aws:sns:us-west-2:123456789012:my-sns-topic
-For more information, see `Delete the Notification Configuration`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Delete the Notification Configuration`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Delete the Notification Configuration`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html#delete-settingupnotifications
+.. _`Delete the Notification Configuration`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html#delete-settingupnotifications
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/delete-tags.rst awscli-1.18.69/awscli/examples/autoscaling/delete-tags.rst
--- awscli-1.11.13/awscli/examples/autoscaling/delete-tags.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/delete-tags.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling delete-tags --tags ResourceId=my-auto-scaling-group,ResourceType=auto-scaling-group,Key=Dept,Value=Research
-For more information, see `Tagging Auto Scaling Groups and Instances`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Tagging Auto Scaling Groups and Instances`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Tagging Auto Scaling Groups and Instances`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html
+.. _`Tagging Auto Scaling Groups and Instances`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-account-limits.rst awscli-1.18.69/awscli/examples/autoscaling/describe-account-limits.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-account-limits.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-account-limits.rst 2020-05-28 19:25:48.000000000 +0000
@@ -13,6 +13,6 @@
"MaxNumberOfAutoScalingGroups": 20
}
-For more information, see `Auto Scaling Limits`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Amazon EC2 Auto Scaling Limits`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Auto Scaling Limits`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-account-limits.html
+.. _`Amazon EC2 Auto Scaling Limits`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-adjustment-types.rst awscli-1.18.69/awscli/examples/autoscaling/describe-adjustment-types.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-adjustment-types.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-adjustment-types.rst 2020-05-28 19:25:48.000000000 +0000
@@ -20,6 +20,6 @@
]
}
-For more information, see `Scaling Adjustment Types`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Scaling Adjustment Types`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Scaling Adjustment Types`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html#as-scaling-adjustment
+.. _`Scaling Adjustment Types`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-auto-scaling-groups.rst awscli-1.18.69/awscli/examples/autoscaling/describe-auto-scaling-groups.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-auto-scaling-groups.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-auto-scaling-groups.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,14 @@
aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name my-auto-scaling-group
+This example describes the specified Auto Scaling groups. It allows you to specify up to 100 group names::
+
+ aws autoscaling describe-auto-scaling-groups --max-items 100 --auto-scaling-group-name "group1" "group2" "group3" "group4"
+
+This example describes the Auto Scaling groups in the specified region, up to a maximum of 75 groups::
+
+ aws autoscaling describe-auto-scaling-groups --max-items 75 --region us-east-1
+
The following is example output::
{
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-auto-scaling-notification-types.rst awscli-1.18.69/awscli/examples/autoscaling/describe-auto-scaling-notification-types.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-auto-scaling-notification-types.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-auto-scaling-notification-types.rst 2020-05-28 19:25:48.000000000 +0000
@@ -16,6 +16,6 @@
]
}
-For more information, see `Configure Your Auto Scaling Group to Send Notifications`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Configure Your Auto Scaling Group to Send Notifications`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html#as-configure-asg-for-sns
+.. _`Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-metric-collection-types.rst awscli-1.18.69/awscli/examples/autoscaling/describe-metric-collection-types.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-metric-collection-types.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-metric-collection-types.rst 2020-05-28 19:25:48.000000000 +0000
@@ -40,6 +40,6 @@
]
}
-For more information, see `Enable Auto Scaling Group Metrics`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Auto Scaling Group Metrics`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Enable Auto Scaling Group Metrics`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-instance-monitoring.html#as-group-metrics
+.. _`Auto Scaling Group Metrics`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html#as-group-metrics
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-notification-configurations.rst awscli-1.18.69/awscli/examples/autoscaling/describe-notification-configurations.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-notification-configurations.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-notification-configurations.rst 2020-05-28 19:25:48.000000000 +0000
@@ -42,6 +42,6 @@
aws autoscaling describe-notification-configurations --auto-scaling-group-name my-auto-scaling-group --starting-token Z3M3LMPEXAMPLE
-For more information, see `Getting Notifications When Your Auto Scaling Group Changes`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Getting Notifications When Your Auto Scaling Group Changes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html
+.. _`Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-policies.rst awscli-1.18.69/awscli/examples/autoscaling/describe-policies.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-policies.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-policies.rst 2020-05-28 19:25:48.000000000 +0000
@@ -57,6 +57,6 @@
aws autoscaling describe-policies --auto-scaling-group-name my-auto-scaling-group --starting-token Z3M3LMPEXAMPLE
-For more information, see `Dynamic Scaling`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Dynamic Scaling`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Dynamic Scaling`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html
+.. _`Dynamic Scaling`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-scaling-process-types.rst awscli-1.18.69/awscli/examples/autoscaling/describe-scaling-process-types.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-scaling-process-types.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-scaling-process-types.rst 2020-05-28 19:25:48.000000000 +0000
@@ -35,6 +35,6 @@
]
}
-For more information, see `Suspend and Resume Auto Scaling Processes`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Suspending and Resuming Scaling Processes`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Suspend and Resume Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html
+.. _`Suspending and Resuming Scaling Processes`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-scheduled-actions.rst awscli-1.18.69/awscli/examples/autoscaling/describe-scheduled-actions.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-scheduled-actions.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-scheduled-actions.rst 2020-05-28 19:25:48.000000000 +0000
@@ -13,7 +13,7 @@
"DesiredCapacity": 4,
"AutoScalingGroupName": "my-auto-scaling-group",
"MaxSize": 6,
- "Recurrence": "30 0 1 12 0",
+ "Recurrence": "30 0 1 12 *",
"ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-auto-scaling-group:scheduledActionName/my-scheduled-action",
"ScheduledActionName": "my-scheduled-action",
"StartTime": "2019-12-01T00:30:00Z",
@@ -52,7 +52,7 @@
"DesiredCapacity": 4,
"AutoScalingGroupName": "my-auto-scaling-group",
"MaxSize": 6,
- "Recurrence": "30 0 1 12 0",
+ "Recurrence": "30 0 1 12 *",
"ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-auto-scaling-group:scheduledActionName/my-scheduled-action",
"ScheduledActionName": "my-scheduled-action",
"StartTime": "2019-12-01T00:30:00Z",
@@ -65,6 +65,6 @@
aws autoscaling describe-scheduled-actions --auto-scaling-group-name my-auto-scaling-group --starting-token Z3M3LMPEXAMPLE
-For more information, see `Scheduled Scaling`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Scheduled Scaling`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Scheduled Scaling`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/schedule_time.html
+.. _`Scheduled Scaling`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-tags.rst awscli-1.18.69/awscli/examples/autoscaling/describe-tags.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-tags.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-tags.rst 2020-05-28 19:25:48.000000000 +0000
@@ -52,6 +52,6 @@
aws autoscaling describe-tags --filters Name=auto-scaling-group,Values=my-auto-scaling-group --starting-token Z3M3LMPEXAMPLE
-For more information, see `Tagging Auto Scaling Groups and Instances`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Tagging Auto Scaling Groups and Instances`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Tagging Auto Scaling Groups and Instances`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html
+.. _`Tagging Auto Scaling Groups and Instances`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/describe-termination-policy-types.rst awscli-1.18.69/awscli/examples/autoscaling/describe-termination-policy-types.rst
--- awscli-1.11.13/awscli/examples/autoscaling/describe-termination-policy-types.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/describe-termination-policy-types.rst 2020-05-28 19:25:48.000000000 +0000
@@ -8,14 +8,16 @@
{
"TerminationPolicyTypes": [
+ "AllocationStrategy",
"ClosestToNextInstanceHour",
"Default",
"NewestInstance",
"OldestInstance",
- "OldestLaunchConfiguration"
+ "OldestLaunchConfiguration",
+ "OldestLaunchTemplate"
]
}
-For more information, see `Controlling Which Instances Auto Scaling Terminates During Scale In`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Controlling Which Instances Auto Scaling Terminates During Scale In`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Controlling Which Instances Auto Scaling Terminates During Scale In`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/AutoScalingBehavior.InstanceTermination.html#your-termination-policy
+.. _`Controlling Which Instances Auto Scaling Terminates During Scale In`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/disable-metrics-collection.rst awscli-1.18.69/awscli/examples/autoscaling/disable-metrics-collection.rst
--- awscli-1.11.13/awscli/examples/autoscaling/disable-metrics-collection.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/disable-metrics-collection.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling disable-metrics-collection --auto-scaling-group-name my-auto-scaling-group --metrics GroupDesiredCapacity
-For more information, see `Monitoring Your Auto Scaling Instances and Groups`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Monitoring Your Auto Scaling Instances and Groups`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-instance-monitoring.html
+.. _`Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/enable-metrics-collection.rst awscli-1.18.69/awscli/examples/autoscaling/enable-metrics-collection.rst
--- awscli-1.11.13/awscli/examples/autoscaling/enable-metrics-collection.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/enable-metrics-collection.rst 2020-05-28 19:25:48.000000000 +0000
@@ -8,6 +8,6 @@
aws autoscaling enable-metrics-collection --auto-scaling-group-name my-auto-scaling-group --metrics GroupDesiredCapacity --granularity "1Minute"
-For more information, see `Monitoring Your Auto Scaling Instances and Groups`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Monitoring Your Auto Scaling Instances and Groups`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-instance-monitoring.html
+.. _`Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/execute-policy.rst awscli-1.18.69/awscli/examples/autoscaling/execute-policy.rst
--- awscli-1.11.13/awscli/examples/autoscaling/execute-policy.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/execute-policy.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling execute-policy --auto-scaling-group-name my-auto-scaling-group --policy-name ScaleIn --honor-cooldown
-For more information, see `Dynamic Scaling`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Dynamic Scaling`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Dynamic Scaling`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html
+.. _`Dynamic Scaling`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/put-lifecycle-hook.rst awscli-1.18.69/awscli/examples/autoscaling/put-lifecycle-hook.rst
--- awscli-1.11.13/awscli/examples/autoscaling/put-lifecycle-hook.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/put-lifecycle-hook.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling put-lifecycle-hook --lifecycle-hook-name my-lifecycle-hook --auto-scaling-group-name my-auto-scaling-group --lifecycle-transition autoscaling:EC2_INSTANCE_LAUNCHING --notification-target-arn arn:aws:sns:us-west-2:123456789012:my-sns-topic --role-arn arn:aws:iam::123456789012:role/my-auto-scaling-role
-For more information, see `Adding Lifecycle Hooks`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Add Lifecycle Hooks`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Adding Lifecycle Hooks`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/adding-lifecycle-hooks.html
+.. _`Add Lifecycle Hooks`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html#adding-lifecycle-hooks
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/put-notification-configuration.rst awscli-1.18.69/awscli/examples/autoscaling/put-notification-configuration.rst
--- awscli-1.11.13/awscli/examples/autoscaling/put-notification-configuration.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/put-notification-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling put-notification-configuration --auto-scaling-group-name my-auto-scaling-group --topic-arn arn:aws:sns:us-west-2:123456789012:my-sns-topic --notification-type autoscaling:TEST_NOTIFICATION
-For more information, see `Configure Your Auto Scaling Group to Send Notifications`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Configure Your Auto Scaling Group to Send Notifications`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html#as-configure-asg-for-sns
+.. _`Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html#as-configure-asg-for-sns
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/put-scaling-policy.rst awscli-1.18.69/awscli/examples/autoscaling/put-scaling-policy.rst
--- awscli-1.11.13/awscli/examples/autoscaling/put-scaling-policy.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/put-scaling-policy.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,6 +1,6 @@
**To add a scaling policy to an Auto Scaling group**
-This example adds the specified policy to the specified Auto Scaling group::
+This example adds a simple scaling policy to the specified Auto Scaling group::
aws autoscaling put-scaling-policy --auto-scaling-group-name my-auto-scaling-group --policy-name ScaleIn --scaling-adjustment -1 --adjustment-type ChangeInCapacity
@@ -15,6 +15,6 @@
"PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn"
}
-For more information, see `Dynamic Scaling`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Dynamic Scaling`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Dynamic Scaling`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html
+.. _`Dynamic Scaling`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/put-scheduled-update-group-action.rst awscli-1.18.69/awscli/examples/autoscaling/put-scheduled-update-group-action.rst
--- awscli-1.11.13/awscli/examples/autoscaling/put-scheduled-update-group-action.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/put-scheduled-update-group-action.rst 2020-05-28 19:25:48.000000000 +0000
@@ -6,8 +6,8 @@
This example creates a scheduled action to scale on a recurring schedule that is scheduled to execute at 00:30 hours on the first of January, June, and December every year::
- aws autoscaling put-scheduled-update-group-action --auto-scaling-group-name my-auto-scaling-group --scheduled-action-name my-scheduled-action --recurrence "30 0 1 1,6,12 0" --min-size 2 --max-size 6 --desired-capacity 4
+ aws autoscaling put-scheduled-update-group-action --auto-scaling-group-name my-auto-scaling-group --scheduled-action-name my-scheduled-action --recurrence "30 0 1 1,6,12 *" --min-size 2 --max-size 6 --desired-capacity 4
-For more information, see `Scheduled Scaling`__ in the *Auto Scaling Developer Guide*.
+For more information, see `Scheduled Scaling`__ in the *Amazon EC2 Auto Scaling User Guide*.
-.. __: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/schedule_time.html
+.. __: https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/resume-processes.rst awscli-1.18.69/awscli/examples/autoscaling/resume-processes.rst
--- awscli-1.11.13/awscli/examples/autoscaling/resume-processes.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/resume-processes.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling resume-processes --auto-scaling-group-name my-auto-scaling-group --scaling-processes AlarmNotification
-For more information, see `Suspend and Resume Auto Scaling Processes`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Suspending and Resuming Scaling Processes`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Suspend and Resume Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html
+.. _`Suspending and Resuming Scaling Processes`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling/suspend-processes.rst awscli-1.18.69/awscli/examples/autoscaling/suspend-processes.rst
--- awscli-1.11.13/awscli/examples/autoscaling/suspend-processes.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling/suspend-processes.rst 2020-05-28 19:25:48.000000000 +0000
@@ -4,6 +4,6 @@
aws autoscaling suspend-processes --auto-scaling-group-name my-auto-scaling-group --scaling-processes AlarmNotification
-For more information, see `Suspend and Resume Auto Scaling Processes`_ in the *Auto Scaling Developer Guide*.
+For more information, see `Suspending and Resuming Scaling Processes`_ in the *Amazon EC2 Auto Scaling User Guide*.
-.. _`Suspend and Resume Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html
+.. _`Suspending and Resuming Scaling Processes`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html
diff -Nru awscli-1.11.13/awscli/examples/autoscaling-plans/create-scaling-plan.rst awscli-1.18.69/awscli/examples/autoscaling-plans/create-scaling-plan.rst
--- awscli-1.11.13/awscli/examples/autoscaling-plans/create-scaling-plan.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling-plans/create-scaling-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,54 @@
+**To create a scaling plan**
+
+The following ``create-scaling-plan`` example creates a scaling plan named ``my-scaling-plan`` using an already-created JSON file (named config.json). The structure of the scaling plan includes a scaling instruction for an Auto Scaling group named ``my-asg``. It specifies the ``TagFilters`` property as the application source and enables predictive scaling and dynamic scaling. ::
+
+ aws autoscaling-plans create-scaling-plan \
+ --scaling-plan-name my-scaling-plan \
+ --cli-input-json file://~/config.json
+
+Contents of ``config.json`` file::
+
+ {
+ "ApplicationSource": {
+ "TagFilters": [
+ {
+ "Key": "purpose",
+ "Values": [
+ "my-application"
+ ]
+ }
+ ]
+ },
+ "ScalingInstructions": [
+ {
+ "ServiceNamespace": "autoscaling",
+ "ResourceId": "autoScalingGroup/my-asg",
+ "ScalableDimension": "autoscaling:autoScalingGroup:DesiredCapacity",
+ "ScheduledActionBufferTime": 300,
+ "PredictiveScalingMaxCapacityBehavior": "SetForecastCapacityToMaxCapacity",
+ "PredictiveScalingMode": "ForecastAndScale",
+ "PredefinedLoadMetricSpecification": {
+ "PredefinedLoadMetricType": "ASGTotalCPUUtilization"
+ },
+ "ScalingPolicyUpdateBehavior": "ReplaceExternalPolicies",
+ "MinCapacity": 1,
+ "MaxCapacity": 4,
+ "TargetTrackingConfigurations": [
+ {
+ "PredefinedScalingMetricSpecification": {
+ "PredefinedScalingMetricType": "ASGAverageCPUUtilization"
+ },
+ "TargetValue": 50
+ }
+ ]
+ }
+ ]
+ }
+
+Output::
+
+ {
+ "ScalingPlanVersion": 1
+ }
+
+For more information, see the `AWS Auto Scaling User Guide `__.
diff -Nru awscli-1.11.13/awscli/examples/autoscaling-plans/delete-scaling-plan.rst awscli-1.18.69/awscli/examples/autoscaling-plans/delete-scaling-plan.rst
--- awscli-1.11.13/awscli/examples/autoscaling-plans/delete-scaling-plan.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling-plans/delete-scaling-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete a scaling plan**
+
+The following ``delete-scaling-plan`` example deletes the specified scaling plan. ::
+
+ aws autoscaling-plans delete-scaling-plan \
+ --scaling-plan-name my-scaling-plan \
+ --scaling-plan-version 1
+
+This command produces no output.
+
+For more information, see the `AWS Auto Scaling User Guide `__.
diff -Nru awscli-1.11.13/awscli/examples/autoscaling-plans/describe-scaling-plan-resources.rst awscli-1.18.69/awscli/examples/autoscaling-plans/describe-scaling-plan-resources.rst
--- awscli-1.11.13/awscli/examples/autoscaling-plans/describe-scaling-plan-resources.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling-plans/describe-scaling-plan-resources.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,38 @@
+**To describe the scalable resources for a scaling plan**
+
+The following ``describe-scaling-plan-resources`` example displays details about the single scalable resource (an Auto Scaling group) that is associated with the specified scaling plan. ::
+
+ aws autoscaling-plans describe-scaling-plan-resources \
+ --scaling-plan-name my-scaling-plan \
+ --scaling-plan-version 1
+
+Output::
+
+ {
+ "ScalingPlanResources": [
+ {
+ "ScalableDimension": "autoscaling:autoScalingGroup:DesiredCapacity",
+ "ScalingPlanVersion": 1,
+ "ResourceId": "autoScalingGroup/my-asg",
+ "ScalingStatusCode": "Active",
+ "ScalingStatusMessage": "Target tracking scaling policies have been applied to the resource.",
+ "ScalingPolicies": [
+ {
+ "PolicyName": "AutoScaling-my-asg-b1ab65ae-4be3-4634-bd64-c7471662b251",
+ "PolicyType": "TargetTrackingScaling",
+ "TargetTrackingConfiguration": {
+ "PredefinedScalingMetricSpecification": {
+ "PredefinedScalingMetricType": "ALBRequestCountPerTarget",
+ "ResourceLabel": "app/my-alb/f37c06a68c1748aa/targetgroup/my-target-group/6d4ea56ca2d6a18d"
+ },
+ "TargetValue": 40.0
+ }
+ }
+ ],
+ "ServiceNamespace": "autoscaling",
+ "ScalingPlanName": "my-scaling-plan"
+ }
+ ]
+ }
+
+For more information, see `What Is AWS Auto Scaling? `__ in the *AWS Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/autoscaling-plans/describe-scaling-plans.rst awscli-1.18.69/awscli/examples/autoscaling-plans/describe-scaling-plans.rst
--- awscli-1.11.13/awscli/examples/autoscaling-plans/describe-scaling-plans.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling-plans/describe-scaling-plans.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,95 @@
+**To describe a scaling plan**
+
+The following ``describe-scaling-plans`` example displays the details of the specified scaling plan. ::
+
+ aws autoscaling-plans describe-scaling-plans \
+ --scaling-plan-names scaling-plan-with-asg-and-ddb
+
+Output::
+
+ {
+ "ScalingPlans": [
+ {
+ "LastMutatingRequestTime": 1565388443.963,
+ "ScalingPlanVersion": 1,
+ "CreationTime": 1565388443.963,
+ "ScalingInstructions": [
+ {
+ "ScalingPolicyUpdateBehavior": "ReplaceExternalPolicies",
+ "ScalableDimension": "autoscaling:autoScalingGroup:DesiredCapacity",
+ "TargetTrackingConfigurations": [
+ {
+ "PredefinedScalingMetricSpecification": {
+ "PredefinedScalingMetricType": "ASGAverageCPUUtilization"
+ },
+ "TargetValue": 50.0,
+ "EstimatedInstanceWarmup": 300,
+ "DisableScaleIn": false
+ }
+ ],
+ "ResourceId": "autoScalingGroup/my-asg",
+ "DisableDynamicScaling": false,
+ "MinCapacity": 1,
+ "ServiceNamespace": "autoscaling",
+ "MaxCapacity": 10
+ },
+ {
+ "ScalingPolicyUpdateBehavior": "ReplaceExternalPolicies",
+ "ScalableDimension": "dynamodb:table:ReadCapacityUnits",
+ "TargetTrackingConfigurations": [
+ {
+ "PredefinedScalingMetricSpecification": {
+ "PredefinedScalingMetricType": "DynamoDBReadCapacityUtilization"
+ },
+ "TargetValue": 50.0,
+ "ScaleInCooldown": 60,
+ "DisableScaleIn": false,
+ "ScaleOutCooldown": 60
+ }
+ ],
+ "ResourceId": "table/my-table",
+ "DisableDynamicScaling": false,
+ "MinCapacity": 5,
+ "ServiceNamespace": "dynamodb",
+ "MaxCapacity": 10000
+ },
+ {
+ "ScalingPolicyUpdateBehavior": "ReplaceExternalPolicies",
+ "ScalableDimension": "dynamodb:table:WriteCapacityUnits",
+ "TargetTrackingConfigurations": [
+ {
+ "PredefinedScalingMetricSpecification": {
+ "PredefinedScalingMetricType": "DynamoDBWriteCapacityUtilization"
+ },
+ "TargetValue": 50.0,
+ "ScaleInCooldown": 60,
+ "DisableScaleIn": false,
+ "ScaleOutCooldown": 60
+ }
+ ],
+ "ResourceId": "table/my-table",
+ "DisableDynamicScaling": false,
+ "MinCapacity": 5,
+ "ServiceNamespace": "dynamodb",
+ "MaxCapacity": 10000
+ }
+ ],
+ "ApplicationSource": {
+ "TagFilters": [
+ {
+ "Values": [
+ "my-application-id"
+ ],
+ "Key": "application"
+ }
+ ]
+ },
+ "StatusStartTime": 1565388455.836,
+ "ScalingPlanName": "scaling-plan-with-asg-and-ddb",
+ "StatusMessage": "Scaling plan has been created and applied to all resources.",
+ "StatusCode": "Active"
+ }
+ ]
+ }
+
+For more information, see `What Is AWS Auto Scaling? `__ in the *AWS Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/autoscaling-plans/get-scaling-plan-resource-forecast-data.rst awscli-1.18.69/awscli/examples/autoscaling-plans/get-scaling-plan-resource-forecast-data.rst
--- awscli-1.11.13/awscli/examples/autoscaling-plans/get-scaling-plan-resource-forecast-data.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling-plans/get-scaling-plan-resource-forecast-data.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,21 @@
+**To retrieve load forecast data**
+
+This example retrieves load forecast data for a scalable resource (an Auto Scaling group) that is associated with the specified scaling plan. ::
+
+ aws autoscaling-plans get-scaling-plan-resource-forecast-data \
+ --scaling-plan-name my-scaling-plan \
+ --scaling-plan-version 1 \
+ --service-namespace "autoscaling" \
+ --resource-id autoScalingGroup/my-asg \
+ --scalable-dimension "autoscaling:autoScalingGroup:DesiredCapacity" \
+ --forecast-data-type "LoadForecast" \
+ --start-time "2019-08-30T00:00:00Z" \
+ --end-time "2019-09-06T00:00:00Z"
+
+Output::
+
+ {
+ "Datapoints": [...]
+ }
+
+For more information, see `What Is AWS Auto Scaling `__ in the *AWS Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/autoscaling-plans/update-scaling-plan.rst awscli-1.18.69/awscli/examples/autoscaling-plans/update-scaling-plan.rst
--- awscli-1.11.13/awscli/examples/autoscaling-plans/update-scaling-plan.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/autoscaling-plans/update-scaling-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To update a scaling plan**
+
+The following ``update-scaling-plan`` example modifies the scaling metric for an Auto Scaling group in the specified scaling plan. ::
+
+ aws autoscaling-plans update-scaling-plan \
+ --scaling-plan-name my-scaling-plan \
+ --scaling-plan-version 1 \
+ --scaling-instructions '{"ScalableDimension":"autoscaling:autoScalingGroup:DesiredCapacity","ResourceId":"autoScalingGroup/my-asg","ServiceNamespace":"autoscaling","TargetTrackingConfigurations":[{"PredefinedScalingMetricSpecification": {"PredefinedScalingMetricType":"ALBRequestCountPerTarget","ResourceLabel":"app/my-alb/f37c06a68c1748aa/targetgroup/my-target-group/6d4ea56ca2d6a18d"},"TargetValue":40.0}],"MinCapacity": 1,"MaxCapacity": 10}'
+
+This command produces no output.
+
+For more information, see `What Is AWS Auto Scaling? `__ in the *AWS Auto Scaling User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/backup/create-backup-plan.rst awscli-1.18.69/awscli/examples/backup/create-backup-plan.rst
--- awscli-1.11.13/awscli/examples/backup/create-backup-plan.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/backup/create-backup-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To create a backup plan**
+
+The following ``create-backup-plan`` example creates the specified backup plan with a 35 day retention. ::
+
+ aws backup create-backup-plan \
+ --backup-plan "{\"BackupPlanName\":\"Example-Backup-Plan\",\"Rules\":[{\"RuleName\":\"DailyBackups\",\"ScheduleExpression\":\"cron(0 5 ? * * *)\",\"StartWindowMinutes\":480,\"TargetBackupVaultName\":\"Default\",\"Lifecycle\":{\"DeleteAfterDays\":35}}]}"
+
+Output::
+
+ {
+ "BackupPlanId": "1fa3895c-a7f5-484a-a371-2dd6a1a9f729",
+ "BackupPlanArn": "arn:aws:backup:us-west-2:123456789012:backup-plan:1fa3895c-a7f5-484a-a371-2dd6a1a9f729",
+ "CreationDate": 1568928754.747,
+ "VersionId": "ZjQ2ZTI5YWQtZDg5Yi00MzYzLWJmZTAtMDI1MzhlMDhjYjEz"
+ }
+
+For more information, see `Creating a Backup Plan `__ in the *AWS Backup Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/backup/create-backup-vault.rst awscli-1.18.69/awscli/examples/backup/create-backup-vault.rst
--- awscli-1.11.13/awscli/examples/backup/create-backup-vault.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/backup/create-backup-vault.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To create a backup vault**
+
+The following ``create-backup-vault`` example creates a backup vault with the specified name. ::
+
+ aws backup create-backup-vault
+ --backup-vault-name sample-vault
+
+This command produces no output.
+Output::
+
+ {
+ "BackupVaultName": "sample-vault",
+ "BackupVaultArn": "arn:aws:backup:us-west-2:123456789012:backup-vault:sample-vault",
+ "CreationDate": 1568928338.385
+ }
+
+For more information, see `Creating a Backup Vault `__ in the *AWS Backup Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/backup/get-backup-plan-from-template.rst awscli-1.18.69/awscli/examples/backup/get-backup-plan-from-template.rst
--- awscli-1.11.13/awscli/examples/backup/get-backup-plan-from-template.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/backup/get-backup-plan-from-template.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To get an existing backup plan from a template**
+
+The following ``get-backup-plan-from-template`` example gets an existing backup plan from a template that specifies a daily backup with a 35 day retention. ::
+
+ aws backup get-backup-plan-from-template \
+ --backup-plan-template-id "87c0c1ef-254d-4180-8fef-2e76a2c38aaa"
+
+Output::
+
+ {
+ "BackupPlanDocument": {
+ "Rules": [
+ {
+ "RuleName": "DailyBackups",
+ "ScheduleExpression": "cron(0 5 ? * * *)",
+ "StartWindowMinutes": 480,
+ "Lifecycle": {
+ "DeleteAfterDays": 35
+ }
+ }
+ ]
+ }
+ }
+
+For more information, see `Creating a Backup Plan `__ in the *AWS Backup Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/backup/get-backup-plan.rst awscli-1.18.69/awscli/examples/backup/get-backup-plan.rst
--- awscli-1.11.13/awscli/examples/backup/get-backup-plan.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/backup/get-backup-plan.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,33 @@
+**To get the details of a backup plan**
+
+The following ``get-backup-plan`` example displays the details of the specified backup plan. ::
+
+ aws backup get-backup-plan \
+ --backup-plan-id "fcbf5d8f-bd77-4f3a-9c97-f24fb3d373a5"
+
+Output::
+
+ {
+ "BackupPlan": {
+ "BackupPlanName": "Example-Backup-Plan",
+ "Rules": [
+ {
+ "RuleName": "DailyBackups",
+ "TargetBackupVaultName": "Default",
+ "ScheduleExpression": "cron(0 5 ? * * *)",
+ "StartWindowMinutes": 480,
+ "CompletionWindowMinutes": 10080,
+ "Lifecycle": {
+ "DeleteAfterDays": 35
+ },
+ "RuleId": "70e0ccdc-e9df-4e83-82ad-c1e5a9471cc3"
+ }
+ ]
+ },
+ "BackupPlanId": "fcbf5d8f-bd77-4f3a-9c97-f24fb3d373a5",
+ "BackupPlanArn": "arn:aws:backup:us-west-2:123456789012:backup-plan:fcbf5d8f-bd77-4f3a-9c97-f24fb3d373a5",
+ "VersionId": "NjQ2ZTZkODktMGVhNy00MmQ0LWE4YjktZTkwNTQ3OTkyYTcw",
+ "CreationDate": 1568926091.57
+ }
+
+For more information, see `Creating a Backup Plan `__ in the *AWS Backup Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/batch/cancel-job.rst awscli-1.18.69/awscli/examples/batch/cancel-job.rst
--- awscli-1.11.13/awscli/examples/batch/cancel-job.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/cancel-job.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,7 @@
+**To cancel a job**
+
+This example cancels a job with the specified job ID.
+
+Command::
+
+ aws batch cancel-job --job-id bcf0b186-a532-4122-842e-2ccab8d54efb --reason "Cancelling job."
diff -Nru awscli-1.11.13/awscli/examples/batch/create-compute-environment.rst awscli-1.18.69/awscli/examples/batch/create-compute-environment.rst
--- awscli-1.11.13/awscli/examples/batch/create-compute-environment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/create-compute-environment.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,97 @@
+**To create a managed compute environment with On-Demand instances**
+
+This example creates a managed compute environment with specific C4 instance types that are launched on demand. The compute environment is called `C4OnDemand`.
+
+Command::
+
+ aws batch create-compute-environment --cli-input-json file:///C4OnDemand.json
+
+JSON file format::
+
+ {
+ "computeEnvironmentName": "C4OnDemand",
+ "type": "MANAGED",
+ "state": "ENABLED",
+ "computeResources": {
+ "type": "EC2",
+ "minvCpus": 0,
+ "maxvCpus": 128,
+ "desiredvCpus": 48,
+ "instanceTypes": [
+ "c4.large",
+ "c4.xlarge",
+ "c4.2xlarge",
+ "c4.4xlarge",
+ "c4.8xlarge"
+ ],
+ "subnets": [
+ "subnet-220c0e0a",
+ "subnet-1a95556d",
+ "subnet-978f6dce"
+ ],
+ "securityGroupIds": [
+ "sg-cf5093b2"
+ ],
+ "ec2KeyPair": "id_rsa",
+ "instanceRole": "ecsInstanceRole",
+ "tags": {
+ "Name": "Batch Instance - C4OnDemand"
+ }
+ },
+ "serviceRole": "arn:aws:iam::012345678910:role/AWSBatchServiceRole"
+ }
+
+Output::
+
+ {
+ "computeEnvironmentName": "C4OnDemand",
+ "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand"
+ }
+
+**To create a managed compute environment with Spot Instances**
+
+This example creates a managed compute environment with the M4 instance type that is launched when the Spot bid price is at or below 20% of the On-Demand price for the instance type. The compute environment is called `M4Spot`.
+
+Command::
+
+ aws batch create-compute-environment --cli-input-json file:///M4Spot.json
+
+JSON file format::
+
+ {
+ "computeEnvironmentName": "M4Spot",
+ "type": "MANAGED",
+ "state": "ENABLED",
+ "computeResources": {
+ "type": "SPOT",
+ "spotIamFleetRole": "arn:aws:iam::012345678910:role/aws-ec2-spot-fleet-role",
+ "minvCpus": 0,
+ "maxvCpus": 128,
+ "desiredvCpus": 4,
+ "instanceTypes": [
+ "m4"
+ ],
+ "bidPercentage": 20,
+ "subnets": [
+ "subnet-220c0e0a",
+ "subnet-1a95556d",
+ "subnet-978f6dce"
+ ],
+ "securityGroupIds": [
+ "sg-cf5093b2"
+ ],
+ "ec2KeyPair": "id_rsa",
+ "instanceRole": "ecsInstanceRole",
+ "tags": {
+ "Name": "Batch Instance - M4Spot"
+ }
+ },
+ "serviceRole": "arn:aws:iam::012345678910:role/AWSBatchServiceRole"
+ }
+
+Output::
+
+ {
+ "computeEnvironmentName": "M4Spot",
+ "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/M4Spot"
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/create-job-queue.rst awscli-1.18.69/awscli/examples/batch/create-job-queue.rst
--- awscli-1.11.13/awscli/examples/batch/create-job-queue.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/create-job-queue.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,61 @@
+**To create a low priority job queue with a single compute environment**
+
+This example creates a job queue called `LowPriority` that uses the `M4Spot` compute environment.
+
+Command::
+
+ aws batch create-job-queue --cli-input-json file:///LowPriority.json
+
+JSON file format::
+
+ {
+ "jobQueueName": "LowPriority",
+ "state": "ENABLED",
+ "priority": 10,
+ "computeEnvironmentOrder": [
+ {
+ "order": 1,
+ "computeEnvironment": "M4Spot"
+ }
+ ]
+ }
+
+Output::
+
+ {
+ "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/LowPriority",
+ "jobQueueName": "LowPriority"
+ }
+
+**To create a high priority job queue with two compute environments**
+
+This example creates a job queue called `HighPriority` that uses the `C4OnDemand` compute environment with an order of 1 and the `M4Spot` compute environment with an order of 2. The scheduler will attempt to place jobs on the `C4OnDemand` compute environment first.
+
+Command::
+
+ aws batch create-job-queue --cli-input-json file:///HighPriority.json
+
+JSON file format::
+
+ {
+ "jobQueueName": "HighPriority",
+ "state": "ENABLED",
+ "priority": 1,
+ "computeEnvironmentOrder": [
+ {
+ "order": 1,
+ "computeEnvironment": "C4OnDemand"
+ },
+ {
+ "order": 2,
+ "computeEnvironment": "M4Spot"
+ }
+ ]
+ }
+
+Output::
+
+ {
+ "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority",
+ "jobQueueName": "HighPriority"
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/delete-compute-environment.rst awscli-1.18.69/awscli/examples/batch/delete-compute-environment.rst
--- awscli-1.11.13/awscli/examples/batch/delete-compute-environment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/delete-compute-environment.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,7 @@
+**To delete a compute environment**
+
+This example deletes the `P2OnDemand` compute environment.
+
+Command::
+
+ aws batch delete-compute-environment --compute-environment P2OnDemand
diff -Nru awscli-1.11.13/awscli/examples/batch/delete-job-queue.rst awscli-1.18.69/awscli/examples/batch/delete-job-queue.rst
--- awscli-1.11.13/awscli/examples/batch/delete-job-queue.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/delete-job-queue.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,7 @@
+**To delete a job queue**
+
+This example deletes the GPGPU job queue.
+
+Command::
+
+ aws batch delete-job-queue --job-queue GPGPU
diff -Nru awscli-1.11.13/awscli/examples/batch/deregister-job-definition.rst awscli-1.18.69/awscli/examples/batch/deregister-job-definition.rst
--- awscli-1.11.13/awscli/examples/batch/deregister-job-definition.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/deregister-job-definition.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To deregister a job definition**
+
+This example deregisters a job definition called sleep10.
+
+Command::
+
+ aws batch deregister-job-definition --job-definition sleep10
+
diff -Nru awscli-1.11.13/awscli/examples/batch/describe-compute-environments.rst awscli-1.18.69/awscli/examples/batch/describe-compute-environments.rst
--- awscli-1.11.13/awscli/examples/batch/describe-compute-environments.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/describe-compute-environments.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,46 @@
+**To describe a compute environment**
+
+This example describes the `P2OnDemand` compute environment.
+
+Command::
+
+ aws batch describe-compute-environments --compute-environments P2OnDemand
+
+Output::
+
+ {
+ "computeEnvironments": [
+ {
+ "status": "VALID",
+ "serviceRole": "arn:aws:iam::012345678910:role/AWSBatchServiceRole",
+ "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand",
+ "computeResources": {
+ "subnets": [
+ "subnet-220c0e0a",
+ "subnet-1a95556d",
+ "subnet-978f6dce"
+ ],
+ "tags": {
+ "Name": "Batch Instance - P2OnDemand"
+ },
+ "desiredvCpus": 48,
+ "minvCpus": 0,
+ "instanceTypes": [
+ "p2"
+ ],
+ "securityGroupIds": [
+ "sg-cf5093b2"
+ ],
+ "instanceRole": "ecsInstanceRole",
+ "maxvCpus": 128,
+ "type": "EC2",
+ "ec2KeyPair": "id_rsa"
+ },
+ "statusReason": "ComputeEnvironment Healthy",
+ "ecsClusterArn": "arn:aws:ecs:us-east-1:012345678910:cluster/P2OnDemand_Batch_2c06f29d-d1fe-3a49-879d-42394c86effc",
+ "state": "ENABLED",
+ "computeEnvironmentName": "P2OnDemand",
+ "type": "MANAGED"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/describe-job-definitions.rst awscli-1.18.69/awscli/examples/batch/describe-job-definitions.rst
--- awscli-1.11.13/awscli/examples/batch/describe-job-definitions.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/describe-job-definitions.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,35 @@
+**To describe active job definitions**
+
+This example describes all of your active job definitions.
+
+Command::
+
+ aws batch describe-job-definitions --status ACTIVE
+
+Output::
+
+ {
+ "jobDefinitions": [
+ {
+ "status": "ACTIVE",
+ "jobDefinitionArn": "arn:aws:batch:us-east-1:012345678910:job-definition/sleep60:1",
+ "containerProperties": {
+ "mountPoints": [],
+ "parameters": {},
+ "image": "busybox",
+ "environment": {},
+ "vcpus": 1,
+ "command": [
+ "sleep",
+ "60"
+ ],
+ "volumes": [],
+ "memory": 128,
+ "ulimits": []
+ },
+ "type": "container",
+ "jobDefinitionName": "sleep60",
+ "revision": 1
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/describe-job-queues.rst awscli-1.18.69/awscli/examples/batch/describe-job-queues.rst
--- awscli-1.11.13/awscli/examples/batch/describe-job-queues.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/describe-job-queues.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+**To describe a job queue**
+
+This example describes the `HighPriority` job queue.
+
+Command::
+
+ aws batch describe-job-queues --job-queues HighPriority
+
+Output::
+
+ {
+ "jobQueues": [
+ {
+ "status": "VALID",
+ "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority",
+ "computeEnvironmentOrder": [
+ {
+ "computeEnvironment": "arn:aws:batch:us-east-1:012345678910:compute-environment/C4OnDemand",
+ "order": 1
+ }
+ ],
+ "statusReason": "JobQueue Healthy",
+ "priority": 1,
+ "state": "ENABLED",
+ "jobQueueName": "HighPriority"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/describe-jobs.rst awscli-1.18.69/awscli/examples/batch/describe-jobs.rst
--- awscli-1.11.13/awscli/examples/batch/describe-jobs.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/describe-jobs.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,37 @@
+**To describe a job**
+
+This example describes a job with the specified job ID.
+
+Command::
+
+ aws batch describe-jobs --jobs bcf0b186-a532-4122-842e-2ccab8d54efb
+
+Output::
+
+ {
+ "jobs": [
+ {
+ "status": "SUBMITTED",
+ "container": {
+ "mountPoints": [],
+ "image": "busybox",
+ "environment": [],
+ "vcpus": 1,
+ "command": [
+ "sleep",
+ "60"
+ ],
+ "volumes": [],
+ "memory": 128,
+ "ulimits": []
+ },
+ "parameters": {},
+ "jobDefinition": "sleep60",
+ "jobQueue": "arn:aws:batch:us-east-1:012345678910:job-queue/HighPriority",
+ "jobId": "bcf0b186-a532-4122-842e-2ccab8d54efb",
+ "dependsOn": [],
+ "jobName": "example",
+ "createdAt": 1480483387803
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/list-jobs.rst awscli-1.18.69/awscli/examples/batch/list-jobs.rst
--- awscli-1.11.13/awscli/examples/batch/list-jobs.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/list-jobs.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,39 @@
+**To list running jobs**
+
+This example lists the running jobs in the `HighPriority` job queue.
+
+Command::
+
+ aws batch list-jobs --job-queue HighPriority
+
+Output::
+
+ {
+ "jobSummaryList": [
+ {
+ "jobName": "example",
+ "jobId": "e66ff5fd-a1ff-4640-b1a2-0b0a142f49bb"
+ }
+ ]
+ }
+
+
+**To list submitted jobs**
+
+This example lists jobs in the `HighPriority` job queue that are in the `SUBMITTED` job status.
+
+Command::
+
+ aws batch list-jobs --job-queue HighPriority --job-status SUBMITTED
+
+Output::
+
+ {
+ "jobSummaryList": [
+ {
+ "jobName": "example",
+ "jobId": "68f0c163-fbd4-44e6-9fd1-25b14a434786"
+ }
+ ]
+ }
+
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/batch/register-job-definition.rst awscli-1.18.69/awscli/examples/batch/register-job-definition.rst
--- awscli-1.11.13/awscli/examples/batch/register-job-definition.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/register-job-definition.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,15 @@
+**To register a job definition**
+
+This example registers a job definition for a simple container job.
+
+Command::
+
+ aws batch register-job-definition --job-definition-name sleep30 --type container --container-properties '{ "image": "busybox", "vcpus": 1, "memory": 128, "command": [ "sleep", "30"]}'
+
+Output::
+
+ {
+ "jobDefinitionArn": "arn:aws:batch:us-east-1:012345678910:job-definition/sleep30:1",
+ "jobDefinitionName": "sleep30",
+ "revision": 1
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/submit-job.rst awscli-1.18.69/awscli/examples/batch/submit-job.rst
--- awscli-1.11.13/awscli/examples/batch/submit-job.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/submit-job.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To submit a job**
+
+This example submits a simple container job called `example` to the `HighPriority` job queue.
+
+Command::
+
+ aws batch submit-job --job-name example --job-queue HighPriority --job-definition sleep60
+
+Output::
+
+ {
+ "jobName": "example",
+ "jobId": "876da822-4198-45f2-a252-6cea32512ea8"
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/terminate-job.rst awscli-1.18.69/awscli/examples/batch/terminate-job.rst
--- awscli-1.11.13/awscli/examples/batch/terminate-job.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/terminate-job.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,7 @@
+**To terminate a job**
+
+This example terminates a job with the specified job ID.
+
+Command::
+
+ aws batch terminate-job --job-id 61e743ed-35e4-48da-b2de-5c8333821c84 --reason "Terminating job."
diff -Nru awscli-1.11.13/awscli/examples/batch/update-compute-environment.rst awscli-1.18.69/awscli/examples/batch/update-compute-environment.rst
--- awscli-1.11.13/awscli/examples/batch/update-compute-environment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/update-compute-environment.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To update a compute environment**
+
+This example disables the `P2OnDemand` compute environment so it can be deleted.
+
+Command::
+
+ aws batch update-compute-environment --compute-environment P2OnDemand --state DISABLED
+
+Output::
+
+ {
+ "computeEnvironmentName": "P2OnDemand",
+ "computeEnvironmentArn": "arn:aws:batch:us-east-1:012345678910:compute-environment/P2OnDemand"
+ }
diff -Nru awscli-1.11.13/awscli/examples/batch/update-job-queue.rst awscli-1.18.69/awscli/examples/batch/update-job-queue.rst
--- awscli-1.11.13/awscli/examples/batch/update-job-queue.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/batch/update-job-queue.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To update a job queue**
+
+This example disables a job queue so that it can be deleted.
+
+Command::
+
+ aws batch update-job-queue --job-queue GPGPU --state DISABLED
+
+Output::
+
+ {
+ "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/GPGPU",
+ "jobQueueName": "GPGPU"
+ }
diff -Nru awscli-1.11.13/awscli/examples/budgets/create-budget.rst awscli-1.18.69/awscli/examples/budgets/create-budget.rst
--- awscli-1.11.13/awscli/examples/budgets/create-budget.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/create-budget.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,61 @@
+**To create a Cost and Usage budget**
+
+The following ``create-budget`` command creates a Cost and Usage budget. ::
+
+ aws budgets create-budget \
+ --account-id 111122223333 \
+ --budget file://budget.json \
+ --notifications-with-subscribers file://notifications-with-subscribers.json
+
+Contents of ``budget.json``::
+
+ {
+ "BudgetLimit": {
+ "Amount": "100",
+ "Unit": "USD"
+ },
+ "BudgetName": "Example Tag Budget",
+ "BudgetType": "COST",
+ "CostFilters": {
+ "TagKeyValue": [
+ "user:Key$value1",
+ "user:Key$value2"
+ ]
+ },
+ "CostTypes": {
+ "IncludeCredit": true,
+ "IncludeDiscount": true,
+ "IncludeOtherSubscription": true,
+ "IncludeRecurring": true,
+ "IncludeRefund": true,
+ "IncludeSubscription": true,
+ "IncludeSupport": true,
+ "IncludeTax": true,
+ "IncludeUpfront": true,
+ "UseBlended": false
+ },
+ "TimePeriod": {
+ "Start": 1477958399,
+ "End": 3706473600
+ },
+ "TimeUnit": "MONTHLY"
+ }
+
+Contents of ``notifications-with-subscribers.json``::
+
+ [
+ {
+ "Notification": {
+ "ComparisonOperator": "GREATER_THAN",
+ "NotificationType": "ACTUAL",
+ "Threshold": 80,
+ "ThresholdType": "PERCENTAGE"
+ },
+ "Subscribers": [
+ {
+ "Address": "example@example.com",
+ "SubscriptionType": "EMAIL"
+ }
+ ]
+ }
+ ]
diff -Nru awscli-1.11.13/awscli/examples/budgets/create-notification.rst awscli-1.18.69/awscli/examples/budgets/create-notification.rst
--- awscli-1.11.13/awscli/examples/budgets/create-notification.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/create-notification.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To create a notification for the specified Cost and Usage budget**
+
+This example creates a notification for the specified Cost and Usage budget.
+
+Command::
+
+ aws budgets create-notification --account-id 111122223333 --budget-name "Example Budget" --notification NotificationType=ACTUAL,ComparisonOperator=GREATER_THAN,Threshold=80,ThresholdType=PERCENTAGE --subscriber SubscriptionType=EMAIL,Address=example@example.com
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/create-subscriber.rst awscli-1.18.69/awscli/examples/budgets/create-subscriber.rst
--- awscli-1.11.13/awscli/examples/budgets/create-subscriber.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/create-subscriber.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To create a subscriber for a notification associated with a Cost and Usage budget**
+
+This example creates a subscriber for the specified notification.
+
+Command::
+
+ aws budgets create-subscriber --account-id 111122223333 --budget-name "Example Budget" --notification NotificationType=ACTUAL,ComparisonOperator=GREATER_THAN,Threshold=80,ThresholdType=PERCENTAGE --subscriber SubscriptionType=EMAIL,Address=example@example.com
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/delete-budget.rst awscli-1.18.69/awscli/examples/budgets/delete-budget.rst
--- awscli-1.11.13/awscli/examples/budgets/delete-budget.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/delete-budget.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To delete a Cost and Usage budget**
+
+This example deletes the specified Cost and Usage budget.
+
+Command::
+
+ aws budgets delete-budget --account-id 111122223333 --budget-name "Example Budget"
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/delete-notification.rst awscli-1.18.69/awscli/examples/budgets/delete-notification.rst
--- awscli-1.11.13/awscli/examples/budgets/delete-notification.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/delete-notification.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To delete a notification from a budget**
+
+This example deletes the specified notification from the specified budget.
+
+Command::
+
+ aws budgets delete-notification --account-id 111122223333 --budget-name "Example Budget" --notification NotificationType=ACTUAL,ComparisonOperator=GREATER_THAN,Threshold=80,ThresholdType=PERCENTAGE
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/delete-subscriber.rst awscli-1.18.69/awscli/examples/budgets/delete-subscriber.rst
--- awscli-1.11.13/awscli/examples/budgets/delete-subscriber.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/delete-subscriber.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To delete a subscriber from a notification**
+
+This example deletes the specified subscriber from the specified notification.
+
+Command::
+
+ aws budgets delete-subscriber --account-id 111122223333 --budget-name "Example Budget" --notification NotificationType=ACTUAL,ComparisonOperator=GREATER_THAN,Threshold=80,ThresholdType=PERCENTAGE --subscriber SubscriptionType=EMAIL,Address=example@example.com
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/describe-budget.rst awscli-1.18.69/awscli/examples/budgets/describe-budget.rst
--- awscli-1.11.13/awscli/examples/budgets/describe-budget.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/describe-budget.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,54 @@
+**To retrieve a budget associated with an account**
+
+This example retrieves the specified Cost and Usage budget.
+
+Command::
+
+ aws budgets describe-budget --account-id 111122223333 --budget-name "Example Budget"
+
+Output::
+
+ {
+ "Budget": {
+ "CalculatedSpend": {
+ "ForecastedSpend": {
+ "Amount": "2641.54800000000022919266484677791595458984375",
+ "Unit": "USD"
+ },
+ "ActualSpend": {
+ "Amount": "604.4560000000000172803993336856365203857421875",
+ "Unit": "USD"
+ }
+ },
+ "BudgetType": "COST",
+ "BudgetLimit": {
+ "Amount": "100",
+ "Unit": "USD"
+ },
+ "BudgetName": "Example Budget",
+ "CostTypes": {
+ "IncludeOtherSubscription": true,
+ "IncludeUpfront": true,
+ "IncludeRefund": true,
+ "UseBlended": false,
+ "IncludeDiscount": true,
+ "UseAmortized": false,
+ "IncludeTax": true,
+ "IncludeCredit": true,
+ "IncludeSupport": true,
+ "IncludeRecurring": true,
+ "IncludeSubscription": true
+ },
+ "TimeUnit": "MONTHLY",
+ "TimePeriod": {
+ "Start": 1477958399.0,
+ "End": 3706473600.0
+ },
+ "CostFilters": {
+ "AZ": [
+ "us-east-1"
+ ]
+ }
+ }
+ }
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/describe-budgets.rst awscli-1.18.69/awscli/examples/budgets/describe-budgets.rst
--- awscli-1.11.13/awscli/examples/budgets/describe-budgets.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/describe-budgets.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,56 @@
+**To retrieve the budgets associated with an account**
+
+This example retrieves the Cost and Usage budgets for an account.
+
+Command::
+
+ aws budgets describe-budgets --account-id 111122223333 --max-results 20
+
+Output::
+
+ {
+ "Budgets": [
+ {
+ "CalculatedSpend": {
+ "ForecastedSpend": {
+ "Amount": "2641.54800000000022919266484677791595458984375",
+ "Unit": "USD"
+ },
+ "ActualSpend": {
+ "Amount": "604.4560000000000172803993336856365203857421875",
+ "Unit": "USD"
+ }
+ },
+ "BudgetType": "COST",
+ "BudgetLimit": {
+ "Amount": "100",
+ "Unit": "USD"
+ },
+ "BudgetName": "Example Budget",
+ "CostTypes": {
+ "IncludeOtherSubscription": true,
+ "IncludeUpfront": true,
+ "IncludeRefund": true,
+ "UseBlended": false,
+ "IncludeDiscount": true,
+ "UseAmortized": false,
+ "IncludeTax": true,
+ "IncludeCredit": true,
+ "IncludeSupport": true,
+ "IncludeRecurring": true,
+ "IncludeSubscription": true
+ },
+ "TimeUnit": "MONTHLY",
+ "TimePeriod": {
+ "Start": 1477958399.0,
+ "End": 3706473600.0
+ },
+ "CostFilters": {
+ "AZ": [
+ "us-east-1"
+ ]
+ }
+ }
+ ]
+ }
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/describe-notifications-for-budget.rst awscli-1.18.69/awscli/examples/budgets/describe-notifications-for-budget.rst
--- awscli-1.11.13/awscli/examples/budgets/describe-notifications-for-budget.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/describe-notifications-for-budget.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,19 @@
+**To retrieve the notifications for a budget**
+
+This example retrieves the notifications for a Cost and Usage budget.
+
+Command::
+
+ aws budgets describe-notifications-for-budget --account-id 111122223333 --budget-name "Example Budget" --max-results 5
+
+Output::
+
+ {
+ "Notifications": [
+ {
+ "Threshold": 80.0,
+ "ComparisonOperator": "GREATER_THAN",
+ "NotificationType": "ACTUAL"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/budgets/describe-subscribers-for-notification.rst awscli-1.18.69/awscli/examples/budgets/describe-subscribers-for-notification.rst
--- awscli-1.11.13/awscli/examples/budgets/describe-subscribers-for-notification.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/describe-subscribers-for-notification.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,22 @@
+**To retrieve the subscribers for a budget notification**
+
+This example retrieves the subscribers for a Cost and Usage budget notification.
+
+Command::
+
+ aws budgets describe-subscribers-for-notification --account-id 111122223333 --budget-name "Example Budget" --notification NotificationType=ACTUAL,ComparisonOperator=GREATER_THAN,Threshold=80,ThresholdType=PERCENTAGE --max-results 5
+
+Output::
+
+ {
+ "Subscribers": [
+ {
+ "SubscriptionType": "EMAIL",
+ "Address": "example2@example.com"
+ },
+ {
+ "SubscriptionType": "EMAIL",
+ "Address": "example@example.com"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/budgets/update-budget.rst awscli-1.18.69/awscli/examples/budgets/update-budget.rst
--- awscli-1.11.13/awscli/examples/budgets/update-budget.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/update-budget.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,40 @@
+**To replace a budget for a Cost and Usage budget**
+
+This example replaces a Cost and Usage budget with a new budget.
+
+Command::
+
+ aws budgets update-budget --account-id 111122223333 --new-budget file://new-budget.json
+
+new-budget.json::
+
+ {
+ "BudgetLimit": {
+ "Amount": "100",
+ "Unit": "USD"
+ },
+ "BudgetName": "Example Budget",
+ "BudgetType": "COST",
+ "CostFilters": {
+ "AZ" : [ "us-east-1" ]
+ },
+ "CostTypes": {
+ "IncludeCredit": false,
+ "IncludeDiscount": true,
+ "IncludeOtherSubscription": true,
+ "IncludeRecurring": true,
+ "IncludeRefund": true,
+ "IncludeSubscription": true,
+ "IncludeSupport": true,
+ "IncludeTax": true,
+ "IncludeUpfront": true,
+ "UseBlended": false,
+ "UseAmortized": true
+ },
+ "TimePeriod": {
+ "Start": 1477958399,
+ "End": 3706473600
+ },
+ "TimeUnit": "MONTHLY"
+ }
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/update-notification.rst awscli-1.18.69/awscli/examples/budgets/update-notification.rst
--- awscli-1.11.13/awscli/examples/budgets/update-notification.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/update-notification.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To replace a notification for a Cost and Usage budget**
+
+This example replaces an 80% notification for a Cost and Usage budget with a 90% notification.
+
+Command::
+
+ aws budgets update-notification --account-id 111122223333 --budget-name "Example Budget" --old-notification NotificationType=ACTUAL,ComparisonOperator=GREATER_THAN,Threshold=80,ThresholdType=PERCENTAGE --new-notification NotificationType=ACTUAL,ComparisonOperator=GREATER_THAN,Threshold=90,ThresholdType=PERCENTAGE
+
diff -Nru awscli-1.11.13/awscli/examples/budgets/update-subscriber.rst awscli-1.18.69/awscli/examples/budgets/update-subscriber.rst
--- awscli-1.11.13/awscli/examples/budgets/update-subscriber.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/budgets/update-subscriber.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,7 @@
+**To replace a subscriber for a Cost and Usage budget**
+
+This example replaces the subscriber for a Cost and Usage budget.
+
+Command::
+
+ aws budgets update-subscriber --account-id 111122223333 --budget-name "Example Budget" --notification NotificationType=ACTUAL,ComparisonOperator=GREATER_THAN,Threshold=80,ThresholdType=PERCENTAGE --old-subscriber SubscriptionType=EMAIL,Address=example@example.com --new-subscriber SubscriptionType=EMAIL,Address=example2@example.com
diff -Nru awscli-1.11.13/awscli/examples/ce/get-cost-and-usage.rst awscli-1.18.69/awscli/examples/ce/get-cost-and-usage.rst
--- awscli-1.11.13/awscli/examples/ce/get-cost-and-usage.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/ce/get-cost-and-usage.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,88 @@
+**To retrieve the S3 usage of an account for the month of September 2017**
+
+The following ``get-cost-and-usage`` example retrieves the S3 usage of an account for the month of September 2017. ::
+
+ aws ce get-cost-and-usage \
+ --time-period Start=2017-09-01,End=2017-10-01 \
+ --granularity MONTHLY \
+ --metrics "BlendedCost" "UnblendedCost" "UsageQuantity" \
+ --group-by Type=DIMENSION,Key=SERVICE Type=TAG,Key=Environment \
+ --filter file://filters.json
+
+Contents of ``filters.json``::
+
+ {
+ "Dimensions": {
+ "Key": "SERVICE",
+ "Values": [
+ "Amazon Simple Storage Service"
+ ]
+ }
+ }
+
+Output::
+
+ {
+ "GroupDefinitions": [
+ {
+ "Type": "DIMENSION",
+ "Key": "SERVICE"
+ },
+ {
+ "Type": "TAG",
+ "Key": "Environment"
+ }
+ ],
+ "ResultsByTime": [
+ {
+ "Estimated": false,
+ "TimePeriod": {
+ "Start": "2017-09-01",
+ "End": "2017-10-01"
+ },
+ "Total": {},
+ "Groups": [
+ {
+ "Keys": [
+ "Amazon Simple Storage Service",
+ "Environment$"
+ ],
+ "Metrics": {
+ "BlendedCost": {
+ "Amount": "40.3527508453",
+ "Unit": "USD"
+ },
+ "UnblendedCost": {
+ "Amount": "40.3543773134",
+ "Unit": "USD"
+ },
+ "UsageQuantity": {
+ "Amount": "9312771.098461578",
+ "Unit": "N/A"
+ }
+ }
+ },
+ {
+ "Keys": [
+ "Amazon Simple Storage Service",
+ "Environment$Dev"
+ ],
+ "Metrics": {
+ "BlendedCost": {
+ "Amount": "0.2682364644",
+ "Unit": "USD"
+ },
+ "UnblendedCost": {
+ "Amount": "0.2682364644",
+ "Unit": "USD"
+ },
+ "UsageQuantity": {
+ "Amount": "22403.4395271182",
+ "Unit": "N/A"
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/ce/get-dimension-values.rst awscli-1.18.69/awscli/examples/ce/get-dimension-values.rst
--- awscli-1.11.13/awscli/examples/ce/get-dimension-values.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/ce/get-dimension-values.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,40 @@
+**To retrieve the tags for the dimension SERVICE, with a value of "Elastic"**
+
+This example retrieves the tags for the dimension SERVICE, with a value of "Elastic" for January 01 2017 through May 18 2017.
+
+Command::
+
+ aws ce get-dimension-values --search-string Elastic --time-period Start=2017-01-01,End=2017-05-18 --dimension SERVICE
+
+Output::
+
+ {
+ "TotalSize": 6,
+ "DimensionValues": [
+ {
+ "Attributes": {},
+ "Value": "Amazon ElastiCache"
+ },
+ {
+ "Attributes": {},
+ "Value": "EC2 - Other"
+ },
+ {
+ "Attributes": {},
+ "Value": "Amazon Elastic Compute Cloud - Compute"
+ },
+ {
+ "Attributes": {},
+ "Value": "Amazon Elastic Load Balancing"
+ },
+ {
+ "Attributes": {},
+ "Value": "Amazon Elastic MapReduce"
+ },
+ {
+ "Attributes": {},
+ "Value": "Amazon Elasticsearch Service"
+ }
+ ],
+ "ReturnSize": 6
+ }
diff -Nru awscli-1.11.13/awscli/examples/ce/get-reservation-coverage.rst awscli-1.18.69/awscli/examples/ce/get-reservation-coverage.rst
--- awscli-1.11.13/awscli/examples/ce/get-reservation-coverage.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/ce/get-reservation-coverage.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,62 @@
+**To retrieve the reservation coverage for EC2 t2.nano instances in the us-east-1 region**
+
+This example retrieves the reservation coverage for EC2 t2.nano instances in the us-east-1 region for July-September of 2017.
+
+Command::
+
+ aws ce get-reservation-coverage --time-period Start=2017-07-01,End=2017-10-01 --group-by Type=Dimension,Key=REGION --filter file://filters.json
+
+filters.json::
+
+ {
+ "And": [
+ {
+ "Dimensions": {
+ "Key": "INSTANCE_TYPE",
+ "Values": [
+ "t2.nano"
+ ]
+ },
+ "Dimensions": {
+ "Key": "REGION",
+ "Values": [
+ "us-east-1"
+ ]
+ }
+ }
+ ]
+ }
+
+Output::
+
+ {
+ "TotalSize": 6,
+ "DimensionValues": [
+ {
+ "Attributes": {},
+ "Value": "Amazon ElastiCache"
+ },
+ {
+ "Attributes": {},
+ "Value": "EC2 - Other"
+ },
+ {
+ "Attributes": {},
+ "Value": "Amazon Elastic Compute Cloud - Compute"
+ },
+ {
+ "Attributes": {},
+ "Value": "Amazon Elastic Load Balancing"
+ },
+ {
+ "Attributes": {},
+ "Value": "Amazon Elastic MapReduce"
+ },
+ {
+ "Attributes": {},
+ "Value": "Amazon Elasticsearch Service"
+ }
+ ],
+ "ReturnSize": 6
+ }
+
diff -Nru awscli-1.11.13/awscli/examples/ce/get-reservation-purchase-recommendation.rst awscli-1.18.69/awscli/examples/ce/get-reservation-purchase-recommendation.rst
--- awscli-1.11.13/awscli/examples/ce/get-reservation-purchase-recommendation.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/ce/get-reservation-purchase-recommendation.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,19 @@
+**To retrieve the reservation recommendations for Partial Upfront EC2 RIs with a three year term**
+
+The following ``get-reservation-purchase-recommendation`` example retrieves recommendations for Partial Upfront EC2 instances with a three-year term, based on the last 60 days of EC2 usage. ::
+
+ aws ce get-reservation-purchase-recommendation \
+ --service "Amazon Redshift" \
+ --lookback-period-in-days SIXTY_DAYS \
+ --term-in-years THREE_YEARS \
+ --payment-option PARTIAL_UPFRONT
+
+Output::
+
+ {
+ "Recommendations": [],
+ "Metadata": {
+ "GenerationTimestamp": "2018-08-08T15:20:57Z",
+ "RecommendationId": "00d59dde-a1ad-473f-8ff2-iexample3330b"
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/ce/get-reservation-utilization.rst awscli-1.18.69/awscli/examples/ce/get-reservation-utilization.rst
--- awscli-1.11.13/awscli/examples/ce/get-reservation-utilization.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/ce/get-reservation-utilization.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,36 @@
+**To retrieve the reservation utilization for your account**
+
+The following ``get-reservation-utilization`` example retrieves the RI utilization for all t2.nano instance types from 2018-03-01 to 2018-08-01 for the account. ::
+
+ aws ce get-reservation-utilization \
+ --time-period Start=2018-03-01,End=2018-08-01 \
+ --filter file://filters.json
+
+Contents of ``filters.json``::
+
+ {
+ "Dimensions": {
+ "Key": "INSTANCE_TYPE",
+ "Values": [
+ "t2.nano"
+ ]
+ }
+ }
+
+Output::
+
+ {
+ "Total": {
+ "TotalAmortizedFee": "0",
+ "UtilizationPercentage": "0",
+ "PurchasedHours": "0",
+ "NetRISavings": "0",
+ "TotalActualHours": "0",
+ "AmortizedRecurringFee": "0",
+ "UnusedHours": "0",
+ "TotalPotentialRISavings": "0",
+ "OnDemandCostOfRIHoursUsed": "0",
+ "AmortizedUpfrontFee": "0"
+ },
+ "UtilizationsByTime": []
+ }
diff -Nru awscli-1.11.13/awscli/examples/ce/get-tags.rst awscli-1.18.69/awscli/examples/ce/get-tags.rst
--- awscli-1.11.13/awscli/examples/ce/get-tags.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/ce/get-tags.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+**To retrieve keys and values for a cost allocation tag**
+
+This example retrieves all cost allocation tags with a key of "Project" and a value that contains "secretProject".
+
+Command::
+
+ aws ce get-tags --search-string secretProject --time-period Start=2017-01-01,End=2017-05-18 --tag-key Project
+
+Output::
+
+ {
+ "ReturnSize": 2,
+ "Tags": [
+ "secretProject1",
+ "secretProject2"
+ ],
+ "TotalSize": 2
+ }
diff -Nru awscli-1.11.13/awscli/examples/chime/associate-phone-numbers-with-voice-connector-group.rst awscli-1.18.69/awscli/examples/chime/associate-phone-numbers-with-voice-connector-group.rst
--- awscli-1.11.13/awscli/examples/chime/associate-phone-numbers-with-voice-connector-group.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/associate-phone-numbers-with-voice-connector-group.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,16 @@
+**To associate phone numbers with an Amazon Chime Voice Connector group**
+
+The following ``associate-phone-numbers-with-voice-connector-group`` example associates the specified phone numbers with an Amazon Chime Voice Connector group. ::
+
+ aws chime associate-phone-numbers-with-voice-connector-group \
+ --voice-connector-group-id 123a456b-c7d8-90e1-fg23-4h567jkl8901 \
+ --e164-phone-numbers "+12065550100" "+12065550101" \
+ --force-associate
+
+Output::
+
+ {
+ "PhoneNumberErrors": []
+ }
+
+For more information, see `Working with Amazon Chime Voice Connector groups `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/associate-phone-numbers-with-voice-connector.rst awscli-1.18.69/awscli/examples/chime/associate-phone-numbers-with-voice-connector.rst
--- awscli-1.11.13/awscli/examples/chime/associate-phone-numbers-with-voice-connector.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/associate-phone-numbers-with-voice-connector.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,16 @@
+**To associate phone numbers with an Amazon Chime Voice Connector**
+
+The following ``associate-phone-numbers-with-voice-connector`` example associates the specified phone numbers with an Amazon Chime Voice Connector. ::
+
+ aws chime associate-phone-numbers-with-voice-connector \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --e164-phone-numbers "+12065550100" "+12065550101"
+ --force-associate
+
+Output::
+
+ {
+ "PhoneNumberErrors": []
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/associate-phone-number-with-user.rst awscli-1.18.69/awscli/examples/chime/associate-phone-number-with-user.rst
--- awscli-1.11.13/awscli/examples/chime/associate-phone-number-with-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/associate-phone-number-with-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To associate a phone number with a user**
+
+The following ``associate-phone-number-with-user`` example associates the specified phone number with a user. ::
+
+ aws chime associate-phone-number-with-user \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --user-id 1ab2345c-67de-8901-f23g-45h678901j2k \
+ --e164-phone-number "+12065550100"
+
+This command produces no output.
+
+For more information, see `Managing User Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/associate-signin-delegate-groups-with-account.rst awscli-1.18.69/awscli/examples/chime/associate-signin-delegate-groups-with-account.rst
--- awscli-1.11.13/awscli/examples/chime/associate-signin-delegate-groups-with-account.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/associate-signin-delegate-groups-with-account.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To associate sign-in delegate groups**
+
+The following ``associate-signin-delegate-groups-with-account`` example associates the specified sign-in delegate group with the specified Amazon Chime account. ::
+
+ aws chime associate-signin-delegate-groups-with-account \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --signin-delegate-groups GroupName=my_users
+
+This command produces no output.
+
+For more information, see `Managing User Access and Permissions `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/batch-create-room-membership.rst awscli-1.18.69/awscli/examples/chime/batch-create-room-membership.rst
--- awscli-1.11.13/awscli/examples/chime/batch-create-room-membership.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/batch-create-room-membership.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+**To create multiple room memberships**
+
+The following ``batch-create-room-membership`` example adds multiple users to a chat room as chat room members. It also assigns administrator and member roles to the users. ::
+
+ aws chime batch-create-room-membership \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
+ --membership-item-list "MemberId=1ab2345c-67de-8901-f23g-45h678901j2k,Role=Administrator" "MemberId=2ab2345c-67de-8901-f23g-45h678901j2k,Role=Member"
+
+Output::
+
+ {
+ "ResponseMetadata": {
+ "RequestId": "169ba401-d886-475f-8b3f-e01eac6fadfb",
+ "HTTPStatusCode": 201,
+ "HTTPHeaders": {
+ "x-amzn-requestid": "169ba401-d886-475f-8b3f-e01eac6fadfb",
+ "content-type": "application/json",
+ "content-length": "13",
+ "date": "Mon, 02 Dec 2019 22:46:58 GMT",
+ "connection": "keep-alive"
+ },
+ "RetryAttempts": 0
+ },
+ "Errors": []
+ }
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/batch-delete-phone-number.rst awscli-1.18.69/awscli/examples/chime/batch-delete-phone-number.rst
--- awscli-1.11.13/awscli/examples/chime/batch-delete-phone-number.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/batch-delete-phone-number.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,15 @@
+**To delete multiple phone numbers**
+
+The following ``batch-delete-phone-number`` example deletes all of the specified phone numbers. ::
+
+ aws chime batch-delete-phone-number \
+ --phone-number-ids "%2B12065550100" "%2B12065550101"
+
+This command produces no output.
+Output::
+
+ {
+ "PhoneNumberErrors": []
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/batch-suspend-user.rst awscli-1.18.69/awscli/examples/chime/batch-suspend-user.rst
--- awscli-1.11.13/awscli/examples/chime/batch-suspend-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/batch-suspend-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,13 @@
+**To suspend multiple users**
+
+The following ``batch-suspend-user`` example suspends the listed users from the specified Amazon Chime account. ::
+
+ aws chime batch-suspend-user \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
+ --user-id-list "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE" "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE" "a1b2c3d4-5678-90ab-cdef-44444EXAMPLE"
+
+Output::
+
+ {
+ "UserErrors": []
+ }
diff -Nru awscli-1.11.13/awscli/examples/chime/batch-unsuspend-user.rst awscli-1.18.69/awscli/examples/chime/batch-unsuspend-user.rst
--- awscli-1.11.13/awscli/examples/chime/batch-unsuspend-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/batch-unsuspend-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To unsuspend multiple users**
+
+The following ``batch-unsuspend-user`` example removes any previous suspension for the listed users on the specified Amazon Chime account. ::
+
+ aws chime batch-unsuspend-user \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
+ --user-id-list "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE" "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE" "a1b2c3d4-5678-90ab-cdef-44444EXAMPLE"
+
+Output::
+
+ {
+ "UserErrors": []
+ }
+
diff -Nru awscli-1.11.13/awscli/examples/chime/batch-update-phone-number.rst awscli-1.18.69/awscli/examples/chime/batch-update-phone-number.rst
--- awscli-1.11.13/awscli/examples/chime/batch-update-phone-number.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/batch-update-phone-number.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+**To update several phone number product types at the same time**
+
+The following ``batch-update-phone-number`` example updates the product types for all of the specified phone numbers. ::
+
+ aws chime batch-update-phone-number \
+ --update-phone-number-request-items PhoneNumberId=%2B12065550100,ProductType=BusinessCalling PhoneNumberId=%2B12065550101,ProductType=BusinessCalling
+
+Output::
+
+ {
+ "PhoneNumberErrors": []
+ }
+
+**To update several phone number calling names at the same time**
+
+The following ``batch-update-phone-number`` example updates the calling names for all of the specified phone numbers. ::
+
+ aws chime batch-update-phone-number \
+ --update-phone-number-request-items PhoneNumberId=%2B14013143874,CallingName=phonenumber1 PhoneNumberId=%2B14013144061,CallingName=phonenumber2
+
+Output::
+
+ {
+ "PhoneNumberErrors": []
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
+
diff -Nru awscli-1.11.13/awscli/examples/chime/batch-update-user.rst awscli-1.18.69/awscli/examples/chime/batch-update-user.rst
--- awscli-1.11.13/awscli/examples/chime/batch-update-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/batch-update-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,13 @@
+**To update multiple users in a single command**
+
+The following ``batch-update-user`` example updates the ``LicenseType`` for each of the listed users in the specified Amazon Chime account. ::
+
+ aws chime batch-update-user \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
+ --update-user-request-items "UserId=a1b2c3d4-5678-90ab-cdef-22222EXAMPLE,LicenseType=Basic" "UserId=a1b2c3d4-5678-90ab-cdef-33333EXAMPLE,LicenseType=Basic"
+
+Output::
+
+ {
+ "UserErrors": []
+ }
diff -Nru awscli-1.11.13/awscli/examples/chime/create-account.rst awscli-1.18.69/awscli/examples/chime/create-account.rst
--- awscli-1.11.13/awscli/examples/chime/create-account.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-account.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,30 @@
+**To create an account**
+
+The following ``create-account`` example creates an Amazon Chime account under the administrator's AWS account. ::
+
+ aws chime create-account \
+ --name MyChimeAccount
+
+Output::
+
+ {
+ "Account": {
+ "AwsAccountId": "111122223333",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "Name": "MyChimeAccount",
+ "AccountType": "Team",
+ "CreatedTimestamp": "2019-01-04T17:11:22.003Z",
+ "DefaultLicense": "Pro",
+ "SupportedLicenses": [
+ "Basic",
+ "Pro"
+ ],
+ "SigninDelegateGroups": [
+ {
+ "GroupName": "myGroup"
+ },
+ ]
+ }
+ }
+
+For more information, see `Getting Started `_ in the *Amazon Chime Administration Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/create-bot.rst awscli-1.18.69/awscli/examples/chime/create-bot.rst
--- awscli-1.11.13/awscli/examples/chime/create-bot.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-bot.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,26 @@
+**To create an Amazon Chime bot**
+
+The following ``create-bot`` example creates a bot for the specified Amazon Chime Enterprise account. ::
+
+ aws chime create-bot \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --display-name "myBot" \
+ --domain "example.com"
+
+Output::
+
+ {
+ "Bot": {
+ "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "DisplayName": "myBot (Bot)",
+ "BotType": "ChatBot",
+ "Disabled": false,
+ "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "BotEmail": "myBot-chimebot@example.com",
+ "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
+ }
+ }
+
+For more information, see `Integrate a Chat Bot with Amazon Chime `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/create-phone-number-order.rst awscli-1.18.69/awscli/examples/chime/create-phone-number-order.rst
--- awscli-1.11.13/awscli/examples/chime/create-phone-number-order.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-phone-number-order.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,35 @@
+**To create a phone number order**
+
+The following ``create-phone-number-order`` example creates a phone number order for the specified phone numbers. ::
+
+ aws chime create-phone-number-order \
+ --product-type VoiceConnector \
+ --e164-phone-numbers "+12065550100" "+12065550101" "+12065550102"
+
+Output::
+
+ {
+ "PhoneNumberOrder": {
+ "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012",
+ "ProductType": "VoiceConnector",
+ "Status": "Processing",
+ "OrderedPhoneNumbers": [
+ {
+ "E164PhoneNumber": "+12065550100",
+ "Status": "Processing"
+ },
+ {
+ "E164PhoneNumber": "+12065550101",
+ "Status": "Processing"
+ },
+ {
+ "E164PhoneNumber": "+12065550102",
+ "Status": "Processing"
+ }
+ ],
+ "CreatedTimestamp": "2019-08-09T21:35:21.427Z",
+ "UpdatedTimestamp": "2019-08-09T21:35:22.408Z"
+ }
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/create-proxy-session.rst awscli-1.18.69/awscli/examples/chime/create-proxy-session.rst
--- awscli-1.11.13/awscli/examples/chime/create-proxy-session.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-proxy-session.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,37 @@
+**To create a proxy session**
+
+The following ``create-proxy-session`` example creates a proxy session with voice and SMS capabilities. ::
+
+ aws chime create-proxy-session \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --participant-phone-numbers "+14015550101" "+12065550100" \
+ --capabilities "Voice" "SMS"
+
+Output::
+
+ {
+ "ProxySession": {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "ProxySessionId": "123a4bc5-67d8-901e-2f3g-h4ghjk56789l",
+ "Status": "Open",
+ "ExpiryMinutes": 60,
+ "Capabilities": [
+ "SMS",
+ "Voice"
+ ],
+ "CreatedTimestamp": "2020-04-15T16:10:10.288Z",
+ "UpdatedTimestamp": "2020-04-15T16:10:10.288Z",
+ "Participants": [
+ {
+ "PhoneNumber": "+12065550100",
+ "ProxyPhoneNumber": "+19135550199"
+ },
+ {
+ "PhoneNumber": "+14015550101",
+ "ProxyPhoneNumber": "+19135550199"
+ }
+ ]
+ }
+ }
+
+For more information, see `Proxy Phone Sessions `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/create-room-membership.rst awscli-1.18.69/awscli/examples/chime/create-room-membership.rst
--- awscli-1.11.13/awscli/examples/chime/create-room-membership.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-room-membership.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+**To create a room membership**
+
+The following ``create-room-membership`` example adds the specified user to the chat room as a chat room member. ::
+
+ aws chime create-room-membership \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
+ --member-id 1ab2345c-67de-8901-f23g-45h678901j2k
+
+Output::
+
+ {
+ "RoomMembership": {
+ "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
+ "Member": {
+ "MemberId": "1ab2345c-67de-8901-f23g-45h678901j2k",
+ "MemberType": "User",
+ "Email": "janed@example.com",
+ "FullName": "Jane Doe",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45"
+ },
+ "Role": "Member",
+ "InvitedBy": "arn:aws:iam::111122223333:user/alejandro",
+ "UpdatedTimestamp": "2019-12-02T22:36:41.969Z"
+ }
+ }
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/create-room.rst awscli-1.18.69/awscli/examples/chime/create-room.rst
--- awscli-1.11.13/awscli/examples/chime/create-room.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-room.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,22 @@
+**To create a chat room**
+
+The following ``create-room`` example creates a chat room for the specified Amazon Chime account. ::
+
+ aws chime create-room \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --name chatRoom
+
+Output::
+
+ {
+ "Room": {
+ "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
+ "Name": "chatRoom",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
+ "CreatedBy": "arn:aws:iam::111122223333:user/alejandro",
+ "CreatedTimestamp": "2019-12-02T22:29:31.549Z",
+ "UpdatedTimestamp": "2019-12-02T22:29:31.549Z"
+ }
+ }
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/create-user.rst awscli-1.18.69/awscli/examples/chime/create-user.rst
--- awscli-1.11.13/awscli/examples/chime/create-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+**To create a user profile for a shared device**
+
+The following ``create-user`` example creates a shared device profile for the specified email address. ::
+
+ aws chime create-user \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --email roomdevice@example.com \
+ --user-type SharedDevice
+
+Output::
+
+ {
+ "User": {
+ "UserId": "1ab2345c-67de-8901-f23g-45h678901j2k",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
+ "PrimaryEmail": "roomdevice@example.com",
+ "DisplayName": "Room Device",
+ "LicenseType": "Pro",
+ "UserType": "SharedDevice",
+ "UserRegistrationStatus": "Registered",
+ "RegisteredOn": "2020-01-15T22:38:09.806Z",
+ "AlexaForBusinessMetadata": {
+ "IsAlexaForBusinessEnabled": false
+ }
+ }
+ }
+
+For more information, see `Preparing for Setup `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/create-voice-connector-group.rst awscli-1.18.69/awscli/examples/chime/create-voice-connector-group.rst
--- awscli-1.11.13/awscli/examples/chime/create-voice-connector-group.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-voice-connector-group.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,21 @@
+**To create an Amazon Chime Voice Connector group**
+
+The following ``create-voice-connector-group`` example creates an Amazon Chime Voice Connector group that includes the specified Amazon Chime Voice Connector. ::
+
+ aws chime create-voice-connector-group \
+ --name myGroup \
+ --voice-connector-items VoiceConnectorId=abcdef1ghij2klmno3pqr4,Priority=2
+
+Output::
+
+ {
+ "VoiceConnectorGroup": {
+ "VoiceConnectorGroupId": "123a456b-c7d8-90e1-fg23-4h567jkl8901",
+ "Name": "myGroup",
+ "VoiceConnectorItems": [],
+ "CreatedTimestamp": "2019-09-18T16:38:34.734Z",
+ "UpdatedTimestamp": "2019-09-18T16:38:34.734Z"
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connector Groups `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/create-voice-connector.rst awscli-1.18.69/awscli/examples/chime/create-voice-connector.rst
--- awscli-1.11.13/awscli/examples/chime/create-voice-connector.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/create-voice-connector.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+**To create an Amazon Chime Voice Connector**
+
+The following ``create-voice-connector`` example creates an Amazon Chime Voice Connector in the specified AWS Region, with encryption enabled. ::
+
+ aws chime create-voice-connector \
+ --name newVoiceConnector \
+ --aws-region us-west-2 \
+ --require-encryption
+
+Output::
+
+ {
+ "VoiceConnector": {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "AwsRegion": "us-west-2",
+ "Name": "newVoiceConnector",
+ "OutboundHostName": "abcdef1ghij2klmno3pqr4.voiceconnector.chime.aws",
+ "RequireEncryption": true,
+ "CreatedTimestamp": "2019-09-18T20:34:01.352Z",
+ "UpdatedTimestamp": "2019-09-18T20:34:01.352Z"
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-account.rst awscli-1.18.69/awscli/examples/chime/delete-account.rst
--- awscli-1.11.13/awscli/examples/chime/delete-account.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-account.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,9 @@
+**To delete an account**
+
+The following ``delete-account`` example deletes the specified account. ::
+
+ aws chime delete-account --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
+
+This command produces no output.
+
+For more information, see `Deleting Your Account `_ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-phone-number.rst awscli-1.18.69/awscli/examples/chime/delete-phone-number.rst
--- awscli-1.11.13/awscli/examples/chime/delete-phone-number.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-phone-number.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete a phone number**
+
+The following ``delete-phone-number`` example moves the specified phone number into the deletion queue. ::
+
+ aws chime delete-phone-number \
+ --phone-number-id "+12065550100"
+
+This command produces no output.
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-proxy-session.rst awscli-1.18.69/awscli/examples/chime/delete-proxy-session.rst
--- awscli-1.11.13/awscli/examples/chime/delete-proxy-session.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-proxy-session.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete a proxy session**
+
+The following ``delete-proxy-session`` example deletes the specified proxy session. ::
+
+ aws chime delete-proxy-session \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --proxy-session-id 123a4bc5-67d8-901e-2f3g-h4ghjk56789l
+
+This command produces no output.
+
+For more information, see `Proxy Phone Sessions `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-room-membership.rst awscli-1.18.69/awscli/examples/chime/delete-room-membership.rst
--- awscli-1.11.13/awscli/examples/chime/delete-room-membership.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-room-membership.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To remove a user as a member of a chat room**
+
+The following ``delete-room-membership`` example removes the specified member from the specified chat room. ::
+
+ aws chime delete-room-membership \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
+ --member-id 1ab2345c-67de-8901-f23g-45h678901j2k
+
+This command produces no output.
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-room.rst awscli-1.18.69/awscli/examples/chime/delete-room.rst
--- awscli-1.11.13/awscli/examples/chime/delete-room.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-room.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete a chat room**
+
+The following ``delete-room`` example deletes the specified chat room and removes the chat room memberships. ::
+
+ aws chime delete-room \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j
+
+This command produces no output.
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-voice-connector-group.rst awscli-1.18.69/awscli/examples/chime/delete-voice-connector-group.rst
--- awscli-1.11.13/awscli/examples/chime/delete-voice-connector-group.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-voice-connector-group.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**title**
+
+The following ``delete-voice-connector-group`` example deletes the specified Amazon Chime Voice Connector group. ::
+
+ aws chime delete-voice-connector-group \
+ --voice-connector-group-id 123a456b-c7d8-90e1-fg23-4h567jkl8901
+
+This command produces no output.
+
+For more information, see `Working with Amazon Chime Voice Connector Groups `__ in the *Amazon Chime Administration Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-voice-connector-origination.rst awscli-1.18.69/awscli/examples/chime/delete-voice-connector-origination.rst
--- awscli-1.11.13/awscli/examples/chime/delete-voice-connector-origination.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-voice-connector-origination.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete origination settings**
+
+The following ``delete-voice-connector-origination`` example deletes the origination host, port, protocol, priority, and weight from the specified Amazon Chime Voice Connector. ::
+
+ aws chime delete-voice-connector-origination \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+This command produces no output.
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-voice-connector-proxy.rst awscli-1.18.69/awscli/examples/chime/delete-voice-connector-proxy.rst
--- awscli-1.11.13/awscli/examples/chime/delete-voice-connector-proxy.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-voice-connector-proxy.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete a proxy configuration**
+
+The following ``delete-voice-connector-proxy`` example deletes the proxy configuration from your Amazon Chime Voice Connector. ::
+
+ aws chime delete-voice-connector-proxy \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+This command produces no output.
+
+For more information, see `Proxy Phone Sessions `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-voice-connector.rst awscli-1.18.69/awscli/examples/chime/delete-voice-connector.rst
--- awscli-1.11.13/awscli/examples/chime/delete-voice-connector.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-voice-connector.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete an Amazon Chime Voice Connector**
+
+The following ``delete-voice-connector`` example doesthis ::
+
+ aws chime delete-voice-connector \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+This command produces no output.
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-voice-connector-streaming-configuration.rst awscli-1.18.69/awscli/examples/chime/delete-voice-connector-streaming-configuration.rst
--- awscli-1.11.13/awscli/examples/chime/delete-voice-connector-streaming-configuration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-voice-connector-streaming-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete a streaming configuration**
+
+The following ``delete-voice-connector-streaming-configuration`` example deletes the streaming configuration for the specified Amazon Chime Voice Connector. ::
+
+ aws chime delete-voice-connector-streaming-configuration \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+This command produces no output.
+
+For more information, see `Streaming Amazon Chime Voice Connector Data to Kinesis `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-voice-connector-termination-credentials.rst awscli-1.18.69/awscli/examples/chime/delete-voice-connector-termination-credentials.rst
--- awscli-1.11.13/awscli/examples/chime/delete-voice-connector-termination-credentials.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-voice-connector-termination-credentials.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete termination credentials**
+
+The following ``delete-voice-connector-termination-credentials`` example deletes the termination credentials for the specified user name and Amazon Chime Voice Connector. ::
+
+ aws chime delete-voice-connector-termination-credentials \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --usernames "jdoe"
+
+This command produces no output.
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/delete-voice-connector-termination.rst awscli-1.18.69/awscli/examples/chime/delete-voice-connector-termination.rst
--- awscli-1.11.13/awscli/examples/chime/delete-voice-connector-termination.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/delete-voice-connector-termination.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete termination settings**
+
+The following ``delete-voice-connector-termination`` example deletes the termination settings for the specified Amazon Chime Voice Connector. ::
+
+ aws chime delete-voice-connector-termination \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+This command produces no output.
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/disassociate-phone-number-from-user.rst awscli-1.18.69/awscli/examples/chime/disassociate-phone-number-from-user.rst
--- awscli-1.11.13/awscli/examples/chime/disassociate-phone-number-from-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/disassociate-phone-number-from-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To disassociate a phone number from a user**
+
+The following ``disassociate-phone-number-from-user`` example disassociates a phone number from the specified user. ::
+
+ aws chime disassociate-phone-number-from-user \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --user-id 1ab2345c-67de-8901-f23g-45h678901j2k
+
+This command produces no output.
+
+For more information, see `Managing User Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/disassociate-phone-numbers-from-voice-connector-group.rst awscli-1.18.69/awscli/examples/chime/disassociate-phone-numbers-from-voice-connector-group.rst
--- awscli-1.11.13/awscli/examples/chime/disassociate-phone-numbers-from-voice-connector-group.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/disassociate-phone-numbers-from-voice-connector-group.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,15 @@
+**To disassociate phone numbers from an Amazon Chime Voice Connector group**
+
+The following ``disassociate-phone-numbers-from-voice-connector-group`` example disassociates the specified phone numbers from an Amazon Chime Voice Connector group. ::
+
+ aws chime disassociate-phone-numbers-from-voice-connector-group \
+ --voice-connector-group-id 123a456b-c7d8-90e1-fg23-4h567jkl8901 \
+ --e164-phone-numbers "+12065550100" "+12065550101"
+
+Output::
+
+ {
+ "PhoneNumberErrors": []
+ }
+
+For more information, see `Working with Amazon Chime Voice Connector Groups `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/disassociate-phone-numbers-from-voice-connector.rst awscli-1.18.69/awscli/examples/chime/disassociate-phone-numbers-from-voice-connector.rst
--- awscli-1.11.13/awscli/examples/chime/disassociate-phone-numbers-from-voice-connector.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/disassociate-phone-numbers-from-voice-connector.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,15 @@
+**To disassociate phone numbers from an Amazon Chime Voice Connector**
+
+The following ``disassociate-phone-numbers-from-voice-connector`` example disassociates the specified phone numbers from an Amazon Chime Voice Connector. ::
+
+ aws chime disassociate-phone-numbers-from-voice-connector \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --e164-phone-numbers "+12065550100" "+12065550101"
+
+Output::
+
+ {
+ "PhoneNumberErrors": []
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/disassociate-signin-delegate-groups-from-account.rst awscli-1.18.69/awscli/examples/chime/disassociate-signin-delegate-groups-from-account.rst
--- awscli-1.11.13/awscli/examples/chime/disassociate-signin-delegate-groups-from-account.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/disassociate-signin-delegate-groups-from-account.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To disassociate sign-in delegate groups**
+
+The following ``disassociate-signin-delegate-groups-from-account`` example disassociates the specified sign-in delegate group from the specified Amazon Chime account. ::
+
+ aws chime disassociate-signin-delegate-groups-from-account \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --group-names "my_users"
+
+This command produces no output.
+
+For more information, see `Managing User Access and Permissions `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-account.rst awscli-1.18.69/awscli/examples/chime/get-account.rst
--- awscli-1.11.13/awscli/examples/chime/get-account.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-account.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,30 @@
+**To retrieve the details for an account**
+
+The following ``get-account`` example retrieves the details for the specified Amazon Chime account. ::
+
+ aws chime get-account \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
+
+Output::
+
+ {
+ "Account": {
+ "AwsAccountId": "111122223333",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "Name": "EnterpriseDirectory",
+ "AccountType": "EnterpriseDirectory",
+ "CreatedTimestamp": "2018-12-20T18:38:02.181Z",
+ "DefaultLicense": "Pro",
+ "SupportedLicenses": [
+ "Basic",
+ "Pro"
+ ],
+ "SigninDelegateGroups": [
+ {
+ "GroupName": "myGroup"
+ },
+ ]
+ }
+ }
+
+For more information, see `Managing Your Amazon Chime Accounts `_ in the *Amazon Chime Administration Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/get-account-settings.rst awscli-1.18.69/awscli/examples/chime/get-account-settings.rst
--- awscli-1.11.13/awscli/examples/chime/get-account-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-account-settings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,16 @@
+**To retrieve settings for an account**
+
+The following ``get-account-settings`` example retrieves the account settings for the specified account. ::
+
+ aws chime get-account-settings --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
+
+Output::
+
+ {
+ "AccountSettings": {
+ "DisableRemoteControl": false,
+ "EnableDialOut": false
+ }
+ }
+
+For more information, see `Managing Your Amazon Chime Accounts `_ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-bot.rst awscli-1.18.69/awscli/examples/chime/get-bot.rst
--- awscli-1.11.13/awscli/examples/chime/get-bot.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-bot.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To retrieve details about a bot**
+
+The following ``get-bot`` example displays the details for the specified bot. ::
+
+ aws chime get-bot \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k
+
+Output::
+
+ {
+ "Bot": {
+ "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "DisplayName": "myBot (Bot)",
+ "BotType": "ChatBot",
+ "Disabled": false,
+ "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "BotEmail": "myBot-chimebot@example.com",
+ "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
+ }
+ }
+
+For more information, see `Update Chat Bots `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-global-settings.rst awscli-1.18.69/awscli/examples/chime/get-global-settings.rst
--- awscli-1.11.13/awscli/examples/chime/get-global-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-global-settings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+**To get global settings**
+
+The following ``get-global-settings`` example retrieves the S3 bucket names used to store call detail records for Amazon Chime Business Calling and Amazon Chime Voice Connectors associated with the administrator's AWS account. ::
+
+ aws chime get-global-settings
+
+Output::
+
+ {
+ "BusinessCalling": {
+ "CdrBucket": "s3bucket"
+ },
+ "VoiceConnector": {
+ "CdrBucket": "s3bucket"
+ }
+ }
+
+For more information, see `Managing Global Settings `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-phone-number-order.rst awscli-1.18.69/awscli/examples/chime/get-phone-number-order.rst
--- awscli-1.11.13/awscli/examples/chime/get-phone-number-order.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-phone-number-order.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,34 @@
+**To get details for a phone number order**
+
+The following ``get-phone-number-order`` example displays the details of the specified phone number order. ::
+
+ aws chime get-phone-number-order \
+ --phone-number-order-id abc12345-de67-89f0-123g-h45i678j9012
+
+Output::
+
+ {
+ "PhoneNumberOrder": {
+ "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012",
+ "ProductType": "VoiceConnector",
+ "Status": "Partial",
+ "OrderedPhoneNumbers": [
+ {
+ "E164PhoneNumber": "+12065550100",
+ "Status": "Acquired"
+ },
+ {
+ "E164PhoneNumber": "+12065550101",
+ "Status": "Acquired"
+ },
+ {
+ "E164PhoneNumber": "+12065550102",
+ "Status": "Failed"
+ }
+ ],
+ "CreatedTimestamp": "2019-08-09T21:35:21.427Z",
+ "UpdatedTimestamp": "2019-08-09T21:35:31.926Z"
+ }
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-phone-number.rst awscli-1.18.69/awscli/examples/chime/get-phone-number.rst
--- awscli-1.11.13/awscli/examples/chime/get-phone-number.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-phone-number.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,38 @@
+**To get phone number details**
+
+The following ``get-phone-number`` example displays the details of the specified phone number. ::
+
+ aws chime get-phone-number \
+ --phone-number-id +12065550100
+
+Output::
+
+ {
+ "PhoneNumber": {
+ "PhoneNumberId": "%2B12065550100",
+ "E164PhoneNumber": "+12065550100",
+ "Type": "Local",
+ "ProductType": "VoiceConnector",
+ "Status": "Unassigned",
+ "Capabilities": {
+ "InboundCall": true,
+ "OutboundCall": true,
+ "InboundSMS": true,
+ "OutboundSMS": true,
+ "InboundMMS": true,
+ "OutboundMMS": true
+ },
+ "Associations": [
+ {
+ "Value": "abcdef1ghij2klmno3pqr4",
+ "Name": "VoiceConnectorId",
+ "AssociatedTimestamp": "2019-10-28T18:40:37.453Z"
+ }
+ ],
+ "CallingNameStatus": "UpdateInProgress",
+ "CreatedTimestamp": "2019-08-09T21:35:21.445Z",
+ "UpdatedTimestamp": "2019-08-09T21:35:31.745Z"
+ }
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-phone-number-settings.rst awscli-1.18.69/awscli/examples/chime/get-phone-number-settings.rst
--- awscli-1.11.13/awscli/examples/chime/get-phone-number-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-phone-number-settings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,16 @@
+**To retrieve an outbound calling name**
+
+The following ``get-phone-number-settings`` example retrieves the default outbound calling name for the calling user's AWS account. ::
+
+ aws chime get-phone-number-settings
+
+This command produces no output.
+Output::
+
+ {
+ "CallingName": "myName",
+ "CallingNameUpdatedTimestamp": "2019-10-28T18:56:42.911Z"
+ }
+
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-proxy-session.rst awscli-1.18.69/awscli/examples/chime/get-proxy-session.rst
--- awscli-1.11.13/awscli/examples/chime/get-proxy-session.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-proxy-session.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,36 @@
+**To get proxy session details**
+
+The following ``get-proxy-session`` example lists the details of the specified proxy session. ::
+
+ aws chime get-proxy-session \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --proxy-session-id 123a4bc5-67d8-901e-2f3g-h4ghjk56789l
+
+Output::
+
+ {
+ "ProxySession": {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "ProxySessionId": "123a4bc5-67d8-901e-2f3g-h4ghjk56789l",
+ "Status": "Open",
+ "ExpiryMinutes": 60,
+ "Capabilities": [
+ "SMS",
+ "Voice"
+ ],
+ "CreatedTimestamp": "2020-04-15T16:10:10.288Z",
+ "UpdatedTimestamp": "2020-04-15T16:10:10.288Z",
+ "Participants": [
+ {
+ "PhoneNumber": "+12065550100",
+ "ProxyPhoneNumber": "+19135550199"
+ },
+ {
+ "PhoneNumber": "+14015550101",
+ "ProxyPhoneNumber": "+19135550199"
+ }
+ ]
+ }
+ }
+
+For more information, see `Proxy Phone Sessions `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-room.rst awscli-1.18.69/awscli/examples/chime/get-room.rst
--- awscli-1.11.13/awscli/examples/chime/get-room.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-room.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,22 @@
+**To get the details about a chat room**
+
+The following ``get-room`` example displays details about the specified chat room. ::
+
+ aws chime get-room \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j
+
+Output::
+
+ {
+ "Room": {
+ "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
+ "Name": "chatRoom",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
+ "CreatedBy": "arn:aws:iam::111122223333:user/alejandro",
+ "CreatedTimestamp": "2019-12-02T22:29:31.549Z",
+ "UpdatedTimestamp": "2019-12-02T22:29:31.549Z"
+ }
+ }
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-user.rst awscli-1.18.69/awscli/examples/chime/get-user.rst
--- awscli-1.11.13/awscli/examples/chime/get-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,29 @@
+**To get details about a user**
+
+The following ``get-user`` example retrieves the details for the specified user. ::
+
+ aws chime get-user \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
+ --user-id a1b2c3d4-5678-90ab-cdef-22222EXAMPLE
+
+Output::
+
+ {
+ "User": {
+ "UserId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "PrimaryEmail": "marthar@example.com",
+ "DisplayName": "Martha Rivera",
+ "LicenseType": "Pro",
+ "UserRegistrationStatus": "Registered",
+ "RegisteredOn": "2018-12-20T18:45:25.231Z",
+ "InvitedOn": "2018-12-20T18:45:25.231Z",
+ "AlexaForBusinessMetadata": {
+ "IsAlexaForBusinessEnabled": False,
+ "AlexaForBusinessRoomArn": "null"
+ },
+ "PersonalPIN": "XXXXXXXXXX"
+ }
+ }
+
+For more information, see `Managing Users `_ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-user-settings.rst awscli-1.18.69/awscli/examples/chime/get-user-settings.rst
--- awscli-1.11.13/awscli/examples/chime/get-user-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-user-settings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,21 @@
+**To retrieve user settings**
+
+The following ``get-user-settings`` example displays the specified user settings. ::
+
+ aws chime get-user-settings \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --user-id 1ab2345c-67de-8901-f23g-45h678901j2k
+
+Output::
+
+ {
+ "UserSettings": {
+ "Telephony": {
+ "InboundCalling": true,
+ "OutboundCalling": true,
+ "SMS": true
+ }
+ }
+ }
+
+For more information, see `Managing User Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-voice-connector-group.rst awscli-1.18.69/awscli/examples/chime/get-voice-connector-group.rst
--- awscli-1.11.13/awscli/examples/chime/get-voice-connector-group.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-voice-connector-group.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,20 @@
+**To get details for an Amazon Chime Voice Connector group**
+
+The following ``get-voice-connector-group`` example displays details for the specified Amazon Chime Voice Connector group. ::
+
+ aws chime get-voice-connector-group \
+ --voice-connector-group-id 123a456b-c7d8-90e1-fg23-4h567jkl8901
+
+Output::
+
+ {
+ "VoiceConnectorGroup": {
+ "VoiceConnectorGroupId": "123a456b-c7d8-90e1-fg23-4h567jkl8901",
+ "Name": "myGroup",
+ "VoiceConnectorItems": [],
+ "CreatedTimestamp": "2019-09-18T16:38:34.734Z",
+ "UpdatedTimestamp": "2019-09-18T16:38:34.734Z"
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connector Groups `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-voice-connector-logging-configuration.rst awscli-1.18.69/awscli/examples/chime/get-voice-connector-logging-configuration.rst
--- awscli-1.11.13/awscli/examples/chime/get-voice-connector-logging-configuration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-voice-connector-logging-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To get logging configuration details**
+
+The following ``get-voice-connector-logging-configuration`` example retreives the logging configuration details for the specified Amazon Chime Voice Connector. ::
+
+ aws chime get-voice-connector-logging-configuration \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+Output::
+
+ {
+ "LoggingConfiguration": {
+ "EnableSIPLogs": true
+ }
+ }
+
+
+For more information, see `Streaming Amazon Chime Voice Connector Media to Kinesis `__ in the *Amazon Chime Administration Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/get-voice-connector-origination.rst awscli-1.18.69/awscli/examples/chime/get-voice-connector-origination.rst
--- awscli-1.11.13/awscli/examples/chime/get-voice-connector-origination.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-voice-connector-origination.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To retrieve origination settings**
+
+The following ``get-voice-connector-origination`` example retrieves the origination host, port, protocol, priority, and weight for the specified Amazon Chime Voice Connector. ::
+
+ aws chime get-voice-connector-origination \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+Output::
+
+ {
+ "Origination": {
+ "Routes": [
+ {
+ "Host": "10.24.34.0",
+ "Port": 1234,
+ "Protocol": "TCP",
+ "Priority": 1,
+ "Weight": 5
+ }
+ ],
+ "Disabled": false
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-voice-connector-proxy.rst awscli-1.18.69/awscli/examples/chime/get-voice-connector-proxy.rst
--- awscli-1.11.13/awscli/examples/chime/get-voice-connector-proxy.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-voice-connector-proxy.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,20 @@
+**To get proxy configuration details**
+
+The following ``get-voice-connector-proxy`` example gets the proxy configuration details for your Amazon Chime Voice Connector. ::
+
+ aws chime get-voice-connector-proxy \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+Output::
+
+ {
+ "Proxy": {
+ "DefaultSessionExpiryMinutes": 60,
+ "Disabled": false,
+ "PhoneNumberCountries": [
+ "US"
+ ]
+ }
+ }
+
+For more information, see `Proxy Phone Sessions `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-voice-connector.rst awscli-1.18.69/awscli/examples/chime/get-voice-connector.rst
--- awscli-1.11.13/awscli/examples/chime/get-voice-connector.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-voice-connector.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,22 @@
+**To get details for an Amazon Chime Voice Connector**
+
+The following ``get-voice-connector`` example displays the details of the specified Amazon Chime Voice Connector. ::
+
+ aws chime get-voice-connector \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+Output::
+
+ {
+ "VoiceConnector": {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "AwsRegion": "us-west-2",
+ "Name": "newVoiceConnector",
+ "OutboundHostName": "abcdef1ghij2klmno3pqr4.voiceconnector.chime.aws",
+ "RequireEncryption": true,
+ "CreatedTimestamp": "2019-09-18T20:34:01.352Z",
+ "UpdatedTimestamp": "2019-09-18T20:34:01.352Z"
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-voice-connector-streaming-configuration.rst awscli-1.18.69/awscli/examples/chime/get-voice-connector-streaming-configuration.rst
--- awscli-1.11.13/awscli/examples/chime/get-voice-connector-streaming-configuration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-voice-connector-streaming-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To get streaming configuration details**
+
+The following ``get-voice-connector-streaming-configuration`` example gets the streaming configuration details for the specified Amazon Chime Voice Connector. ::
+
+ aws chime get-voice-connector-streaming-configuration \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+Output::
+
+ {
+ "StreamingConfiguration": {
+ "DataRetentionInHours": 24,
+ "Disabled": false
+ }
+ }
+
+For more information, see `Streaming Amazon Chime Voice Connector Data to Kinesis `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-voice-connector-termination-health.rst awscli-1.18.69/awscli/examples/chime/get-voice-connector-termination-health.rst
--- awscli-1.11.13/awscli/examples/chime/get-voice-connector-termination-health.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-voice-connector-termination-health.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To retrieve termination health details**
+
+The following ``get-voice-connector-termination-health`` example retrieves the termination health details for the specified Amazon Chime Voice Connector. ::
+
+ aws chime get-voice-connector-termination-health \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+Output::
+
+ {
+ "TerminationHealth": {
+ "Timestamp": "Fri Aug 23 16:45:55 UTC 2019",
+ "Source": "10.24.34.0"
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/get-voice-connector-termination.rst awscli-1.18.69/awscli/examples/chime/get-voice-connector-termination.rst
--- awscli-1.11.13/awscli/examples/chime/get-voice-connector-termination.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/get-voice-connector-termination.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To retrieve termination settings**
+
+The following ``get-voice-connector-termination`` example retrieves the termination settings for the specified Amazon Chime Voice Connector. ::
+
+ aws chime get-voice-connector-termination \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+This command produces no output.
+Output::
+
+ {
+ "Termination": {
+ "CpsLimit": 1,
+ "DefaultPhoneNumber": "+12065550100",
+ "CallingRegions": [
+ "US"
+ ],
+ "CidrAllowedList": [
+ "10.24.34.0/23"
+ ],
+ "Disabled": false
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/invite-users.rst awscli-1.18.69/awscli/examples/chime/invite-users.rst
--- awscli-1.11.13/awscli/examples/chime/invite-users.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/invite-users.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+**To invite users to join Amazon Chime**
+
+The following ``invite-users`` example sends an email to invite a user to the specified Amazon Chime account. ::
+
+ aws chime invite-users \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
+ --user-email-list "alejandror@example.com" "janed@example.com"
+
+Output::
+
+ {
+ "Invites": [
+ {
+ "InviteId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
+ "Status": "Pending",
+ "EmailAddress": "alejandror@example.com",
+ "EmailStatus": "Sent"
+ }
+ {
+ "InviteId": "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE",
+ "Status": "Pending",
+ "EmailAddress": "janed@example.com",
+ "EmailStatus": "Sent"
+ }
+ ]
+ }
+
+For more information, see `Inviting and Suspending Users `_ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-accounts.rst awscli-1.18.69/awscli/examples/chime/list-accounts.rst
--- awscli-1.11.13/awscli/examples/chime/list-accounts.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-accounts.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,48 @@
+**To get a list of accounts**
+
+The following ``list-accounts`` example retrieves a list of the Amazon Chime accounts in the administrator's AWS account. ::
+
+ aws chime list-accounts
+
+Output::
+
+ {
+ "Accounts": [
+ {
+ "AwsAccountId": "111122223333",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "Name": "First Chime Account",
+ "AccountType": "EnterpriseDirectory",
+ "CreatedTimestamp": "2018-12-20T18:38:02.181Z",
+ "DefaultLicense": "Pro",
+ "SupportedLicenses": [
+ "Basic",
+ "Pro"
+ ],
+ "SigninDelegateGroups": [
+ {
+ "GroupName": "myGroup"
+ },
+ ]
+ },
+ {
+ "AwsAccountId": "111122223333",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
+ "Name": "Second Chime Account",
+ "AccountType": "Team",
+ "CreatedTimestamp": "2018-09-04T21:44:22.292Z",
+ "DefaultLicense": "Pro",
+ "SupportedLicenses": [
+ "Basic",
+ "Pro"
+ ],
+ "SigninDelegateGroups": [
+ {
+ "GroupName": "myGroup"
+ },
+ ]
+ }
+ ]
+ }
+
+For more information, see `Managing Your Amazon Chime Accounts `_ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-bots.rst awscli-1.18.69/awscli/examples/chime/list-bots.rst
--- awscli-1.11.13/awscli/examples/chime/list-bots.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-bots.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+**To retrieve a list of bots**
+
+The following ``list-bots`` example lists the bots associated with the specified Amazon Chime Enterprise account. ::
+
+ aws chime list-bots \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45
+
+Output::
+
+ {
+ "Bot": {
+ "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "DisplayName": "myBot (Bot)",
+ "BotType": "ChatBot",
+ "Disabled": false,
+ "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "BotEmail": "myBot-chimebot@example.com",
+ "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
+ }
+ }
+
+For more information, see `Use Chat Bots with Amazon Chime `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-phone-number-orders.rst awscli-1.18.69/awscli/examples/chime/list-phone-number-orders.rst
--- awscli-1.11.13/awscli/examples/chime/list-phone-number-orders.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-phone-number-orders.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,56 @@
+**To list phone number orders**
+
+The following ``list-phone-number-orders`` example lists the phone number orders associated with the Amazon Chime administrator's account. ::
+
+ aws chime list-phone-number-orders
+
+Output::
+
+ {
+ "PhoneNumberOrders": [
+ {
+ "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012",
+ "ProductType": "VoiceConnector",
+ "Status": "Partial",
+ "OrderedPhoneNumbers": [
+ {
+ "E164PhoneNumber": "+12065550100",
+ "Status": "Acquired"
+ },
+ {
+ "E164PhoneNumber": "+12065550101",
+ "Status": "Acquired"
+ },
+ {
+ "E164PhoneNumber": "+12065550102",
+ "Status": "Failed"
+ }
+ ],
+ "CreatedTimestamp": "2019-08-09T21:35:21.427Z",
+ "UpdatedTimestamp": "2019-08-09T21:35:31.926Z"
+ }
+ {
+ "PhoneNumberOrderId": "cba54321-ed76-09f5-321g-h54i876j2109",
+ "ProductType": "BusinessCalling",
+ "Status": "Partial",
+ "OrderedPhoneNumbers": [
+ {
+ "E164PhoneNumber": "+12065550103",
+ "Status": "Acquired"
+ },
+ {
+ "E164PhoneNumber": "+12065550104",
+ "Status": "Acquired"
+ },
+ {
+ "E164PhoneNumber": "+12065550105",
+ "Status": "Failed"
+ }
+ ],
+ "CreatedTimestamp": "2019-08-09T21:35:21.427Z",
+ "UpdatedTimestamp": "2019-08-09T21:35:31.926Z"
+ }
+ ]
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-phone-numbers.rst awscli-1.18.69/awscli/examples/chime/list-phone-numbers.rst
--- awscli-1.11.13/awscli/examples/chime/list-phone-numbers.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-phone-numbers.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,65 @@
+**To list phone numbers for an Amazon Chime account**
+
+The following ``list-phone-numbers`` example lists the phone numbers associated with the administrator's Amazon Chime account. ::
+
+ aws chime list-phone-numbers
+
+This command produces no output.
+Output::
+
+ {
+ "PhoneNumbers": [
+ {
+ "PhoneNumberId": "%2B12065550100",
+ "E164PhoneNumber": "+12065550100",
+ "Type": "Local",
+ "ProductType": "VoiceConnector",
+ "Status": "Assigned",
+ "Capabilities": {
+ "InboundCall": true,
+ "OutboundCall": true,
+ "InboundSMS": true,
+ "OutboundSMS": true,
+ "InboundMMS": true,
+ "OutboundMMS": true
+ },
+ "Associations": [
+ {
+ "Value": "abcdef1ghij2klmno3pqr4",
+ "Name": "VoiceConnectorId",
+ "AssociatedTimestamp": "2019-10-28T18:40:37.453Z"
+ }
+ ],
+ "CallingNameStatus": "UpdateInProgress",
+ "CreatedTimestamp": "2019-08-12T22:10:20.521Z",
+ "UpdatedTimestamp": "2019-10-28T18:42:07.964Z"
+ },
+ {
+ "PhoneNumberId": "%2B12065550101",
+ "E164PhoneNumber": "+12065550101",
+ "Type": "Local",
+ "ProductType": "VoiceConnector",
+ "Status": "Assigned",
+ "Capabilities": {
+ "InboundCall": true,
+ "OutboundCall": true,
+ "InboundSMS": true,
+ "OutboundSMS": true,
+ "InboundMMS": true,
+ "OutboundMMS": true
+ },
+ "Associations": [
+ {
+ "Value": "abcdef1ghij2klmno3pqr4",
+ "Name": "VoiceConnectorId",
+ "AssociatedTimestamp": "2019-10-28T18:40:37.511Z"
+ }
+ ],
+ "CallingNameStatus": "UpdateInProgress",
+ "CreatedTimestamp": "2019-08-12T22:10:20.521Z",
+ "UpdatedTimestamp": "2019-10-28T18:42:07.960Z"
+ }
+ ]
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-proxy-sessions.rst awscli-1.18.69/awscli/examples/chime/list-proxy-sessions.rst
--- awscli-1.11.13/awscli/examples/chime/list-proxy-sessions.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-proxy-sessions.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,35 @@
+**To list proxy sessions**
+
+The following ``list-proxy-sessions`` example lists the proxy sessions for your Amazon Chime Voice Connector. ::
+
+ aws chime list-proxy-sessions \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+Output::
+
+ {
+ "ProxySession": {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "ProxySessionId": "123a4bc5-67d8-901e-2f3g-h4ghjk56789l",
+ "Status": "Open",
+ "ExpiryMinutes": 60,
+ "Capabilities": [
+ "SMS",
+ "Voice"
+ ],
+ "CreatedTimestamp": "2020-04-15T16:10:10.288Z",
+ "UpdatedTimestamp": "2020-04-15T16:10:10.288Z",
+ "Participants": [
+ {
+ "PhoneNumber": "+12065550100",
+ "ProxyPhoneNumber": "+19135550199"
+ },
+ {
+ "PhoneNumber": "+14015550101",
+ "ProxyPhoneNumber": "+19135550199"
+ }
+ ]
+ }
+ }
+
+For more information, see `Proxy Phone Sessions `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-room-memberships.rst awscli-1.18.69/awscli/examples/chime/list-room-memberships.rst
--- awscli-1.11.13/awscli/examples/chime/list-room-memberships.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-room-memberships.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,42 @@
+**To list room memberships**
+
+The following ``list-room-memberships`` example displays a list of the membership details for the specified chat room. ::
+
+ aws chime list-room-memberships \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j
+
+Output::
+
+ {
+ "RoomMemberships": [
+ {
+ "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
+ "Member": {
+ "MemberId": "2ab2345c-67de-8901-f23g-45h678901j2k",
+ "MemberType": "User",
+ "Email": "zhangw@example.com",
+ "FullName": "Zhang Wei",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45"
+ },
+ "Role": "Member",
+ "InvitedBy": "arn:aws:iam::111122223333:user/alejandro",
+ "UpdatedTimestamp": "2019-12-02T22:46:58.532Z"
+ },
+ {
+ "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
+ "Member": {
+ "MemberId": "1ab2345c-67de-8901-f23g-45h678901j2k",
+ "MemberType": "User",
+ "Email": "janed@example.com",
+ "FullName": "Jane Doe",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45"
+ },
+ "Role": "Administrator",
+ "InvitedBy": "arn:aws:iam::111122223333:user/alejandro",
+ "UpdatedTimestamp": "2019-12-02T22:46:58.532Z"
+ }
+ ]
+ }
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/list-rooms.rst awscli-1.18.69/awscli/examples/chime/list-rooms.rst
--- awscli-1.11.13/awscli/examples/chime/list-rooms.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-rooms.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,22 @@
+**To list chat rooms**
+
+The following ``list-rooms`` example displays a list of chat rooms in the specified account. The list is filtered to only those chat rooms that the specified member belongs to. ::
+
+ aws chime list-rooms \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --member-id 1ab2345c-67de-8901-f23g-45h678901j2k
+
+Output::
+
+ {
+ "Room": {
+ "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
+ "Name": "teamRoom",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
+ "CreatedBy": "arn:aws:iam::111122223333:user/alejandro",
+ "CreatedTimestamp": "2019-12-02T22:29:31.549Z",
+ "UpdatedTimestamp": "2019-12-02T22:33:19.310Z"
+ }
+ }
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/list-users.rst awscli-1.18.69/awscli/examples/chime/list-users.rst
--- awscli-1.11.13/awscli/examples/chime/list-users.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-users.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,66 @@
+**To list the users in an account**
+
+The following ``list-users`` example lists the users for the specified Amazon Chime account. ::
+
+ aws chime list-users --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
+
+Output::
+
+ {
+ "Users": [
+ {
+ "UserId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "PrimaryEmail": "mariag@example.com",
+ "DisplayName": "Maria Garcia",
+ "LicenseType": "Pro",
+ "UserType": "PrivateUser",
+ "UserRegistrationStatus": "Registered",
+ "RegisteredOn": "2018-12-20T18:45:25.231Z"
+ "AlexaForBusinessMetadata": {
+ "IsAlexaForBusinessEnabled": false
+ }
+ },
+ {
+ "UserId": "a1b2c3d4-5678-90ab-cdef-33333EXAMPLE",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "PrimaryEmail": "richardr@example.com",
+ "DisplayName": "Richard Roe",
+ "LicenseType": "Pro",
+ "UserType": "PrivateUser",
+ "UserRegistrationStatus": "Registered",
+ "RegisteredOn": "2018-12-20T18:45:45.415Z"
+ "AlexaForBusinessMetadata": {
+ "IsAlexaForBusinessEnabled": false
+ }
+ },
+ {
+ "UserId": "a1b2c3d4-5678-90ab-cdef-44444EXAMPLE",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "PrimaryEmail": "saanvis@example.com",
+ "DisplayName": "Saanvi Sarkar",
+ "LicenseType": "Basic",
+ "UserType": "PrivateUser",
+ "UserRegistrationStatus": "Registered",
+ "RegisteredOn": "2018-12-20T18:46:57.747Z"
+ "AlexaForBusinessMetadata": {
+ "IsAlexaForBusinessEnabled": false
+ }
+ },
+ {
+ "UserId": "a1b2c3d4-5678-90ab-cdef-55555EXAMPLE",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "PrimaryEmail": "wxiulan@example.com",
+ "DisplayName": "Wang Xiulan",
+ "LicenseType": "Basic",
+ "UserType": "PrivateUser",
+ "UserRegistrationStatus": "Registered",
+ "RegisteredOn": "2018-12-20T18:47:15.390Z"
+ "AlexaForBusinessMetadata": {
+ "IsAlexaForBusinessEnabled": false
+ }
+ }
+ ]
+ }
+
+For more information, see `Managing Users `_ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-voice-connector-groups.rst awscli-1.18.69/awscli/examples/chime/list-voice-connector-groups.rst
--- awscli-1.11.13/awscli/examples/chime/list-voice-connector-groups.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-voice-connector-groups.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,21 @@
+**To list Amazon Chime Voice Connector groups for an Amazon Chime account**
+
+The following ``list-voice-connector-groups`` example lists the Amazon Chime Voice Connector groups associated with the administrator's Amazon Chime account. ::
+
+ aws chime list-voice-connector-groups
+
+Output::
+
+ {
+ "VoiceConnectorGroups": [
+ {
+ "VoiceConnectorGroupId": "123a456b-c7d8-90e1-fg23-4h567jkl8901",
+ "Name": "myGroup",
+ "VoiceConnectorItems": [],
+ "CreatedTimestamp": "2019-09-18T16:38:34.734Z",
+ "UpdatedTimestamp": "2019-09-18T16:38:34.734Z"
+ }
+ ]
+ }
+
+For more information, see `Working with Amazon Chime Voice Connector groups `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-voice-connectors.rst awscli-1.18.69/awscli/examples/chime/list-voice-connectors.rst
--- awscli-1.11.13/awscli/examples/chime/list-voice-connectors.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-voice-connectors.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,32 @@
+**To list Amazon Chime Voice Connectors for an account**
+
+The following ``list-voice-connectors`` example lists the Amazon Chime Voice Connectors associated with the caller's account. ::
+
+ aws chime list-voice-connectors
+
+Output::
+
+ {
+ "VoiceConnectors": [
+ {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "AwsRegion": "us-east-1",
+ "Name": "MyVoiceConnector",
+ "OutboundHostName": "abcdef1ghij2klmno3pqr4.voiceconnector.chime.aws",
+ "RequireEncryption": true,
+ "CreatedTimestamp": "2019-06-04T18:46:56.508Z",
+ "UpdatedTimestamp": "2019-09-18T16:33:00.806Z"
+ },
+ {
+ "VoiceConnectorId": "cbadef1ghij2klmno3pqr5",
+ "AwsRegion": "us-west-2",
+ "Name": "newVoiceConnector",
+ "OutboundHostName": "cbadef1ghij2klmno3pqr5.voiceconnector.chime.aws",
+ "RequireEncryption": true,
+ "CreatedTimestamp": "2019-09-18T20:34:01.352Z",
+ "UpdatedTimestamp": "2019-09-18T20:34:01.352Z"
+ }
+ ]
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/list-voice-connector-termination-credentials.rst awscli-1.18.69/awscli/examples/chime/list-voice-connector-termination-credentials.rst
--- awscli-1.11.13/awscli/examples/chime/list-voice-connector-termination-credentials.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/list-voice-connector-termination-credentials.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To retrieve a list of termination credentials**
+
+The following ``list-voice-connector-termination-credentials`` example retrieves a list of the termination credentials for the specified Amazon Chime Voice Connector. ::
+
+ aws chime list-voice-connector-termination-credentials \
+ --voice-connector-id abcdef1ghij2klmno3pqr4
+
+This command produces no output.
+Output::
+
+ {
+ "Usernames": [
+ "jdoe"
+ ]
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/logout-user.rst awscli-1.18.69/awscli/examples/chime/logout-user.rst
--- awscli-1.11.13/awscli/examples/chime/logout-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/logout-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,9 @@
+**To log out a user**
+
+The following ``logout-user`` example logs out the specified user. ::
+
+ aws chime logout-user \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
+ --user-id a1b2c3d4-5678-90ab-cdef-22222EXAMPLE
+
+This command produces no output.
diff -Nru awscli-1.11.13/awscli/examples/chime/put-voice-connector-logging-configuration.rst awscli-1.18.69/awscli/examples/chime/put-voice-connector-logging-configuration.rst
--- awscli-1.11.13/awscli/examples/chime/put-voice-connector-logging-configuration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/put-voice-connector-logging-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To add a logging configuration for an Amazon Chime Voice Connector**
+
+The following ``put-voice-connector-logging-configuration`` example turns on the SIP logging configuration for the specified Amazon Chime Voice Connector. ::
+
+ aws chime put-voice-connector-logging-configuration \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --logging-configuration EnableSIPLogs=true
+
+Output::
+
+ {
+ "LoggingConfiguration": {
+ "EnableSIPLogs": true
+ }
+ }
+
+For more information, see `Streaming Amazon Chime Voice Connector Media to Kinesis `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/put-voice-connector-origination.rst awscli-1.18.69/awscli/examples/chime/put-voice-connector-origination.rst
--- awscli-1.11.13/awscli/examples/chime/put-voice-connector-origination.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/put-voice-connector-origination.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,26 @@
+**To set up origination settings**
+
+The following ``put-voice-connector-origination`` example sets up the origination host, port, protocol, priority, and weight for the specified Amazon Chime Voice Connector. ::
+
+ aws chime put-voice-connector-origination \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --origination Routes=[{Host="10.24.34.0",Port=1234,Protocol="TCP",Priority=1,Weight=5}],Disabled=false
+
+Output::
+
+ {
+ "Origination": {
+ "Routes": [
+ {
+ "Host": "10.24.34.0",
+ "Port": 1234,
+ "Protocol": "TCP",
+ "Priority": 1,
+ "Weight": 5
+ }
+ ],
+ "Disabled": false
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/put-voice-connector-proxy.rst awscli-1.18.69/awscli/examples/chime/put-voice-connector-proxy.rst
--- awscli-1.11.13/awscli/examples/chime/put-voice-connector-proxy.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/put-voice-connector-proxy.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,22 @@
+**To put a proxy configuration**
+
+The following ``put-voice-connector-proxy`` example sets a proxy configuration to your Amazon Chime Voice Connector. ::
+
+ aws chime put-voice-connector-proxy \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --default-session-expiry-minutes 60 \
+ --phone-number-pool-countries "US"
+
+Output::
+
+ {
+ "Proxy": {
+ "DefaultSessionExpiryMinutes": 60,
+ "Disabled": false,
+ "PhoneNumberCountries": [
+ "US"
+ ]
+ }
+ }
+
+For more information, see `Proxy Phone Sessions `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/put-voice-connector-streaming-configuration.rst awscli-1.18.69/awscli/examples/chime/put-voice-connector-streaming-configuration.rst
--- awscli-1.11.13/awscli/examples/chime/put-voice-connector-streaming-configuration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/put-voice-connector-streaming-configuration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+**To create a streaming configuration**
+
+The following ``put-voice-connector-streaming-configuration`` example creates a streaming configuration for the specified Amazon Chime Voice Connector. It enables media streaming from the Amazon Chime Voice Connector to Amazon Kinesis, and sets the data retention period to 24 hours. ::
+
+ aws chime put-voice-connector-streaming-configuration \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --streaming-configuration DataRetentionInHours=24,Disabled=false
+
+Output::
+
+ {
+ "StreamingConfiguration": {
+ "DataRetentionInHours": 24,
+ "Disabled": false
+ }
+ }
+
+For more information, see `Streaming Amazon Chime Voice Connector Data to Kinesis `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/put-voice-connector-termination-credentials.rst awscli-1.18.69/awscli/examples/chime/put-voice-connector-termination-credentials.rst
--- awscli-1.11.13/awscli/examples/chime/put-voice-connector-termination-credentials.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/put-voice-connector-termination-credentials.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To set up termination credentials**
+
+The following ``put-voice-connector-termination-credentials`` example sets termination credentials for the specified Amazon Chime Voice Connector. ::
+
+ aws chime put-voice-connector-termination-credentials \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --credentials Username="jdoe",Password="XXXXXXXX"
+
+This command produces no output.
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/put-voice-connector-termination.rst awscli-1.18.69/awscli/examples/chime/put-voice-connector-termination.rst
--- awscli-1.11.13/awscli/examples/chime/put-voice-connector-termination.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/put-voice-connector-termination.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+**To set up termination settings**
+
+The following ``put-voice-connector-termination`` example sets the calling regions and allowed IP host termination settings for the specified Amazon Chime Voice Connector. ::
+
+ aws chime put-voice-connector-termination \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --termination CallingRegions="US",CidrAllowedList="10.24.34.0/23",Disabled=false
+
+Output::
+
+ {
+ "Termination": {
+ "CpsLimit": 0,
+ "CallingRegions": [
+ "US"
+ ],
+ "CidrAllowedList": [
+ "10.24.34.0/23"
+ ],
+ "Disabled": false
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/regenerate-security-token.rst awscli-1.18.69/awscli/examples/chime/regenerate-security-token.rst
--- awscli-1.11.13/awscli/examples/chime/regenerate-security-token.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/regenerate-security-token.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,26 @@
+**To regenerate a security token**
+
+The following ``regenerate-security-token`` example regenerates the security token for the specified bot. ::
+
+ aws chime regenerate-security-token \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k
+
+Output::
+
+ {
+ "Bot": {
+ "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "DisplayName": "myBot (Bot)",
+ "BotType": "ChatBot",
+ "Disabled": false,
+ "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "BotEmail": "myBot-chimebot@example.com",
+ "SecurityToken": "je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY"
+ }
+ }
+
+
+For more information, see `Authenticate Chat Bot Requests `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/reset-personal-pin.rst awscli-1.18.69/awscli/examples/chime/reset-personal-pin.rst
--- awscli-1.11.13/awscli/examples/chime/reset-personal-pin.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/reset-personal-pin.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,29 @@
+**To reset a user's personal meeting PIN**
+
+The following ``reset-personal-pin`` example resets the specified user's personal meeting PIN. ::
+
+ aws chime reset-personal-pin \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE
+ --user-id a1b2c3d4-5678-90ab-cdef-22222EXAMPLE
+
+Output::
+
+ {
+ "User": {
+ "UserId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "PrimaryEmail": "mateo@example.com",
+ "DisplayName": "Mateo Jackson",
+ "LicenseType": "Pro",
+ "UserType": "PrivateUser",
+ "UserRegistrationStatus": "Registered",
+ "RegisteredOn": "2018-12-20T18:45:25.231Z",
+ "AlexaForBusinessMetadata": {
+ "IsAlexaForBusinessEnabled": False,
+ "AlexaForBusinessRoomArn": "null"
+ },
+ "PersonalPIN": "XXXXXXXXXX"
+ }
+ }
+
+For more information, see `Changing Personal Meeting PINs `_ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/restore-phone-number.rst awscli-1.18.69/awscli/examples/chime/restore-phone-number.rst
--- awscli-1.11.13/awscli/examples/chime/restore-phone-number.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/restore-phone-number.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,31 @@
+**To restore a phone number**
+
+The following ``restore-phone-number`` example restores the specified phone number from the deletion queue. ::
+
+ aws chime restore-phone-number \
+ --phone-number-id "+12065550100"
+
+Output::
+
+ {
+ "PhoneNumber": {
+ "PhoneNumberId": "%2B12065550100",
+ "E164PhoneNumber": "+12065550100",
+ "Type": "Local",
+ "ProductType": "BusinessCalling",
+ "Status": "Unassigned",
+ "Capabilities": {
+ "InboundCall": true,
+ "OutboundCall": true,
+ "InboundSMS": true,
+ "OutboundSMS": true,
+ "InboundMMS": true,
+ "OutboundMMS": true
+ },
+ "Associations": [],
+ "CreatedTimestamp": "2019-08-09T21:35:21.445Z",
+ "UpdatedTimestamp": "2019-08-12T22:06:36.355Z"
+ }
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/search-available-phone-numbers.rst awscli-1.18.69/awscli/examples/chime/search-available-phone-numbers.rst
--- awscli-1.11.13/awscli/examples/chime/search-available-phone-numbers.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/search-available-phone-numbers.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To search available phone numbers**
+
+The following ``search-available-phone-numbers`` example searches available phone numbers by area code. ::
+
+ aws chime search-available-phone-numbers \
+ --area-code "206"
+
+Output::
+
+ {
+ "E164PhoneNumbers": [
+ "+12065550100",
+ "+12065550101",
+ "+12065550102",
+ "+12065550103",
+ "+12065550104",
+ "+12065550105",
+ "+12065550106",
+ "+12065550107",
+ "+12065550108",
+ "+12065550109",
+ ]
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-account.rst awscli-1.18.69/awscli/examples/chime/update-account.rst
--- awscli-1.11.13/awscli/examples/chime/update-account.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-account.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,31 @@
+**To update an account**
+
+The following ``update-account`` example updates the specified account name. ::
+
+ aws chime update-account \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
+ --name MyAccountName
+
+Output::
+
+ {
+ "Account": {
+ "AwsAccountId": "111122223333",
+ "AccountId": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE",
+ "Name": "MyAccountName",
+ "AccountType": "Team",
+ "CreatedTimestamp": "2018-09-04T21:44:22.292Z",
+ "DefaultLicense": "Pro",
+ "SupportedLicenses": [
+ "Basic",
+ "Pro"
+ ],
+ "SigninDelegateGroups": [
+ {
+ "GroupName": "myGroup"
+ },
+ ]
+ }
+ }
+
+For more information, see `Renaming Your Account `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-account-settings.rst awscli-1.18.69/awscli/examples/chime/update-account-settings.rst
--- awscli-1.11.13/awscli/examples/chime/update-account-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-account-settings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,9 @@
+**To update the settings for your account**
+
+The following ``update-account-settings`` example disables the remote control of shared screens for the specified Amazon Chime account. ::
+
+ aws chime update-account-settings \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
+ --account-settings DisableRemoteControl=true
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/update-bot.rst awscli-1.18.69/awscli/examples/chime/update-bot.rst
--- awscli-1.11.13/awscli/examples/chime/update-bot.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-bot.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,26 @@
+**To update a bot**
+
+The following ``update-bot`` example updates the status of the specified bot to stop it from running. ::
+
+ aws chime update-bot \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k \
+ --disabled
+
+Output::
+
+ {
+ "Bot": {
+ "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k",
+ "DisplayName": "myBot (Bot)",
+ "BotType": "ChatBot",
+ "Disabled": true,
+ "CreatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "UpdatedTimestamp": "2019-09-09T18:05:56.749Z",
+ "BotEmail": "myBot-chimebot@example.com",
+ "SecurityToken": "je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY"
+ }
+ }
+
+For more information, see `Update Chat Bots `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-global-settings.rst awscli-1.18.69/awscli/examples/chime/update-global-settings.rst
--- awscli-1.11.13/awscli/examples/chime/update-global-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-global-settings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To update global settings**
+
+The following ``update-global-settings`` example updates the S3 bucket used to store call detail records for Amazon Chime Business Calling and Amazon Chime Voice Connectors associated with the administrator's AWS account. ::
+
+ aws chime update-global-settings \
+ --business-calling CdrBucket="s3bucket" \
+ --voice-connector CdrBucket="s3bucket"
+
+This command produces no output.
+
+For more information, see `Managing Global Settings `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-phone-number.rst awscli-1.18.69/awscli/examples/chime/update-phone-number.rst
--- awscli-1.11.13/awscli/examples/chime/update-phone-number.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-phone-number.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,65 @@
+**Example 1: To update the product type for a phone number**
+
+The following ``update-phone-number`` example updates the specified phone number's product type. ::
+
+ aws chime update-phone-number \
+ --phone-number-id "+12065550100" \
+ --product-type "BusinessCalling"
+
+Output::
+
+ {
+ "PhoneNumber": {
+ "PhoneNumberId": "%2B12065550100",
+ "E164PhoneNumber": "+12065550100",
+ "Type": "Local",
+ "ProductType": "BusinessCalling",
+ "Status": "Unassigned",
+ "Capabilities": {
+ "InboundCall": true,
+ "OutboundCall": true,
+ "InboundSMS": true,
+ "OutboundSMS": true,
+ "InboundMMS": true,
+ "OutboundMMS": true
+ },
+ "Associations": [],
+ "CallingName": "phonenumber1",
+ "CreatedTimestamp": "2019-08-09T21:35:21.445Z",
+ "UpdatedTimestamp": "2019-08-12T21:44:07.591Z"
+ }
+ }
+
+**Example 2: To update the outbound calling name for a phone number**
+
+The following ``update-phone-number`` example updates the outbound calling name for the specified phone number.
+
+ aws chime update-phone-number \
+ --phone-number-id "+12065550100" \
+ --calling-name "phonenumber2"
+
+Output::
+
+ {
+ "PhoneNumber": {
+ "PhoneNumberId": "%2B12065550100",
+ "E164PhoneNumber": "+12065550100",
+ "Type": "Local",
+ "ProductType": "BusinessCalling",
+ "Status": "Unassigned",
+ "Capabilities": {
+ "InboundCall": true,
+ "OutboundCall": true,
+ "InboundSMS": true,
+ "OutboundSMS": true,
+ "InboundMMS": true,
+ "OutboundMMS": true
+ },
+ "Associations": [],
+ "CallingName": "phonenumber2",
+ "CreatedTimestamp": "2019-08-09T21:35:21.445Z",
+ "UpdatedTimestamp": "2019-08-12T21:44:07.591Z"
+ }
+ }
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-phone-number-settings.rst awscli-1.18.69/awscli/examples/chime/update-phone-number-settings.rst
--- awscli-1.11.13/awscli/examples/chime/update-phone-number-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-phone-number-settings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**To update an outbound calling name**
+
+The following ``update-phone-number-settings`` example updates the default outbound calling name for the administrator's AWS account. ::
+
+ aws chime update-phone-number-settings \
+ --calling-name "myName"
+
+This command produces no output.
+
+For more information, see `Working with Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-proxy-session.rst awscli-1.18.69/awscli/examples/chime/update-proxy-session.rst
--- awscli-1.11.13/awscli/examples/chime/update-proxy-session.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-proxy-session.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,36 @@
+**To update a proxy session**
+
+The following ``update-proxy-session`` example updates the proxy session capabilities. ::
+
+ aws chime update-proxy-session \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --proxy-session-id 123a4bc5-67d8-901e-2f3g-h4ghjk56789l \
+ --capabilities "Voice"
+
+Output::
+
+ {
+ "ProxySession": {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "ProxySessionId": "123a4bc5-67d8-901e-2f3g-h4ghjk56789l",
+ "Status": "Open",
+ "ExpiryMinutes": 60,
+ "Capabilities": [
+ "Voice"
+ ],
+ "CreatedTimestamp": "2020-04-15T16:10:10.288Z",
+ "UpdatedTimestamp": "2020-04-15T16:10:10.288Z",
+ "Participants": [
+ {
+ "PhoneNumber": "+12065550100",
+ "ProxyPhoneNumber": "+19135550199"
+ },
+ {
+ "PhoneNumber": "+14015550101",
+ "ProxyPhoneNumber": "+19135550199"
+ }
+ ]
+ }
+ }
+
+For more information, see `Proxy Phone Sessions `__ in the *Amazon Chime Developer Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-room-membership.rst awscli-1.18.69/awscli/examples/chime/update-room-membership.rst
--- awscli-1.11.13/awscli/examples/chime/update-room-membership.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-room-membership.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,29 @@
+**To update a room membership**
+
+The following ``update-room-membership`` example modifies the role of the specified chat room member to ``Administrator``. ::
+
+ aws chime update-room-membership \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
+ --member-id 1ab2345c-67de-8901-f23g-45h678901j2k \
+ --role Administrator
+
+Output::
+
+ {
+ "RoomMembership": {
+ "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
+ "Member": {
+ "MemberId": "1ab2345c-67de-8901-f23g-45h678901j2k",
+ "MemberType": "User",
+ "Email": "sofiamartinez@example.com",
+ "FullName": "Sofia Martinez",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45"
+ },
+ "Role": "Administrator",
+ "InvitedBy": "arn:aws:iam::111122223333:user/admin",
+ "UpdatedTimestamp": "2019-12-02T22:40:22.931Z"
+ }
+ }
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/update-room.rst awscli-1.18.69/awscli/examples/chime/update-room.rst
--- awscli-1.11.13/awscli/examples/chime/update-room.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-room.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,23 @@
+**To update a chat room**
+
+The following ``update-room`` example modifies the name of the specified chat room. ::
+
+ aws chime update-room \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --room-id abcd1e2d-3e45-6789-01f2-3g45h67i890j \
+ --name teamRoom
+
+Output::
+
+ {
+ "Room": {
+ "RoomId": "abcd1e2d-3e45-6789-01f2-3g45h67i890j",
+ "Name": "teamRoom",
+ "AccountId": "12a3456b-7c89-012d-3456-78901e23fg45",
+ "CreatedBy": "arn:aws:iam::111122223333:user/alejandro",
+ "CreatedTimestamp": "2019-12-02T22:29:31.549Z",
+ "UpdatedTimestamp": "2019-12-02T22:33:19.310Z"
+ }
+ }
+
+For more information, see `Creating a Chat Room `__ in the *Amazon Chime User Guide*.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/chime/update-user.rst awscli-1.18.69/awscli/examples/chime/update-user.rst
--- awscli-1.11.13/awscli/examples/chime/update-user.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-user.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+**To update user details**
+
+This example updates the specified details for the specified user.
+
+Command::
+
+ aws chime update-user \
+ --account-id a1b2c3d4-5678-90ab-cdef-11111EXAMPLE \
+ --user-id a1b2c3d4-5678-90ab-cdef-22222EXAMPLE \
+ --license-type "Basic"
+
+Output::
+
+ {
+ "User": {
+ "UserId": "a1b2c3d4-5678-90ab-cdef-22222EXAMPLE"
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/chime/update-user-settings.rst awscli-1.18.69/awscli/examples/chime/update-user-settings.rst
--- awscli-1.11.13/awscli/examples/chime/update-user-settings.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-user-settings.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To update user settings**
+
+The following ``update-user-settings`` example enables the specified user to make inbound and outbound calls and send and receive SMS messages. ::
+
+ aws chime update-user-settings \
+ --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \
+ --user-id 1ab2345c-67de-8901-f23g-45h678901j2k \
+ --user-settings "Telephony={InboundCalling=true,OutboundCalling=true,SMS=true}"
+
+This command produces no output.
+
+For more information, see `Managing User Phone Numbers `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-voice-connector-group.rst awscli-1.18.69/awscli/examples/chime/update-voice-connector-group.rst
--- awscli-1.11.13/awscli/examples/chime/update-voice-connector-group.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-voice-connector-group.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,27 @@
+**To update the details for an Amazon Chime Voice Connector group**
+
+The following ``update-voice-connector-group`` example updates the details of the specified Amazon Chime Voice Connector group. ::
+
+ aws chime update-voice-connector-group \
+ --voice-connector-group-id 123a456b-c7d8-90e1-fg23-4h567jkl8901 \
+ --name "newGroupName" \
+ --voice-connector-items VoiceConnectorId=abcdef1ghij2klmno3pqr4,Priority=1
+
+Output::
+
+ {
+ "VoiceConnectorGroup": {
+ "VoiceConnectorGroupId": "123a456b-c7d8-90e1-fg23-4h567jkl8901",
+ "Name": "newGroupName",
+ "VoiceConnectorItems": [
+ {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "Priority": 1
+ }
+ ],
+ "CreatedTimestamp": "2019-09-18T16:38:34.734Z",
+ "UpdatedTimestamp": "2019-10-28T19:00:57.081Z"
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connector Groups `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/chime/update-voice-connector.rst awscli-1.18.69/awscli/examples/chime/update-voice-connector.rst
--- awscli-1.11.13/awscli/examples/chime/update-voice-connector.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/chime/update-voice-connector.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+**To update the details for an Amazon Chime Voice Connector**
+
+The following ``update-voice-connector`` example updates the name of the specified Amazon Chime Voice Connector. ::
+
+ aws chime update-voice-connector \
+ --voice-connector-id abcdef1ghij2klmno3pqr4 \
+ --name newName \
+ --require-encryption
+
+Output::
+
+ {
+ "VoiceConnector": {
+ "VoiceConnectorId": "abcdef1ghij2klmno3pqr4",
+ "AwsRegion": "us-west-2",
+ "Name": "newName",
+ "OutboundHostName": "abcdef1ghij2klmno3pqr4.voiceconnector.chime.aws",
+ "RequireEncryption": true,
+ "CreatedTimestamp": "2019-09-18T20:34:01.352Z",
+ "UpdatedTimestamp": "2019-09-18T20:40:52.895Z"
+ }
+ }
+
+For more information, see `Working with Amazon Chime Voice Connectors `__ in the *Amazon Chime Administration Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloud9/create-environment-ec2.rst awscli-1.18.69/awscli/examples/cloud9/create-environment-ec2.rst
--- awscli-1.11.13/awscli/examples/cloud9/create-environment-ec2.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/create-environment-ec2.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,13 @@
+**To create an AWS Cloud9 EC2 development environment**
+
+This example creates an AWS Cloud9 development environment with the specified settings, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.
+
+Command::
+
+ aws cloud9 create-environment-ec2 --name my-demo-env --description "My demonstration development environment." --instance-type t2.micro --subnet-id subnet-1fab8aEX --automatic-stop-time-minutes 60 --owner-arn arn:aws:iam::123456789012:user/MyDemoUser
+
+Output::
+
+ {
+ "environmentId": "8a34f51ce1e04a08882f1e811bd706EX"
+ }
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/create-environment-membership.rst awscli-1.18.69/awscli/examples/cloud9/create-environment-membership.rst
--- awscli-1.11.13/awscli/examples/cloud9/create-environment-membership.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/create-environment-membership.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+**To add an environment member to an AWS Cloud9 development environment**
+
+This example adds the specified environment member to the specified AWS Cloud9 development environment.
+
+Command::
+
+ aws cloud9 create-environment-membership --environment-id 8a34f51ce1e04a08882f1e811bd706EX --user-arn arn:aws:iam::123456789012:user/AnotherDemoUser --permissions read-write
+
+Output::
+
+ {
+ "membership": {
+ "environmentId": "8a34f51ce1e04a08882f1e811bd706EX",
+ "userId": "AIDAJ3LOROMOUXTBSU6EX",
+ "userArn": "arn:aws:iam::123456789012:user/AnotherDemoUser",
+ "permissions": "read-write"
+ }
+ }
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/delete-environment-membership.rst awscli-1.18.69/awscli/examples/cloud9/delete-environment-membership.rst
--- awscli-1.11.13/awscli/examples/cloud9/delete-environment-membership.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/delete-environment-membership.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete an environment member from an AWS Cloud9 development environment**
+
+This example deletes the specified environment member from the specified AWS Cloud9 development environment.
+
+Command::
+
+ aws cloud9 delete-environment-membership --environment-id 8a34f51ce1e04a08882f1e811bd706EX --user-arn arn:aws:iam::123456789012:user/AnotherDemoUser
+
+Output::
+
+ None.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/delete-environment.rst awscli-1.18.69/awscli/examples/cloud9/delete-environment.rst
--- awscli-1.11.13/awscli/examples/cloud9/delete-environment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/delete-environment.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To delete an AWS Cloud9 development environment**
+
+This example deletes the specified AWS Cloud9 development environment. If an Amazon EC2 instance is connected to the environment, also terminates the instance.
+
+Command::
+
+ aws cloud9 delete-environment --environment-id 8a34f51ce1e04a08882f1e811bd706EX
+
+Output::
+
+ None.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/describe-environment-memberships.rst awscli-1.18.69/awscli/examples/cloud9/describe-environment-memberships.rst
--- awscli-1.11.13/awscli/examples/cloud9/describe-environment-memberships.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/describe-environment-memberships.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,76 @@
+**To gets information about environment members for an AWS Cloud9 development environment**
+
+This example gets information about environment members for the specified AWS Cloud9 development environment.
+
+Command::
+
+ aws cloud9 describe-environment-memberships --environment-id 8a34f51ce1e04a08882f1e811bd706EX
+
+Output::
+
+ {
+ "memberships": [
+ {
+ "environmentId": "8a34f51ce1e04a08882f1e811bd706EX",
+ "userId": "AIDAJ3LOROMOUXTBSU6EX",
+ "userArn": "arn:aws:iam::123456789012:user/AnotherDemoUser",
+ "permissions": "read-write"
+ },
+ {
+ "environmentId": "8a34f51ce1e04a08882f1e811bd706EX",
+ "userId": "AIDAJNUEDQAQWFELJDLEX",
+ "userArn": "arn:aws:iam::123456789012:user/MyDemoUser",
+ "permissions": "owner"
+ }
+ ]
+ }
+
+**To get information about the owner of an AWS Cloud9 development environment**
+
+This example gets information about the owner of the specified AWS Cloud9 development environment.
+
+Command::
+
+ aws cloud9 describe-environment-memberships --environment-id 8a34f51ce1e04a08882f1e811bd706EX --permissions owner
+
+Output::
+
+ {
+ "memberships": [
+ {
+ "environmentId": "8a34f51ce1e04a08882f1e811bd706EX",
+ "userId": "AIDAJNUEDQAQWFELJDLEX",
+ "userArn": "arn:aws:iam::123456789012:user/MyDemoUser",
+ "permissions": "owner"
+ }
+ ]
+ }
+
+**To get information about an environment member for multiple AWS Cloud9 development environments**
+
+This example gets information about the specified environment member for multiple AWS Cloud9 development environments.
+
+Command::
+
+ aws cloud9 describe-environment-memberships --user-arn arn:aws:iam::123456789012:user/MyDemoUser
+
+Output::
+
+ {
+ "memberships": [
+ {
+ "environmentId": "10a75714bd494714929e7f5ec4125aEX",
+ "lastAccess": 1516213427.0,
+ "userId": "AIDAJNUEDQAQWFELJDLEX",
+ "userArn": "arn:aws:iam::123456789012:user/MyDemoUser",
+ "permissions": "owner"
+ },
+ {
+ "environmentId": "1980b80e5f584920801c09086667f0EX",
+ "lastAccess": 1516144884.0,
+ "userId": "AIDAJNUEDQAQWFELJDLEX",
+ "userArn": "arn:aws:iam::123456789012:user/MyDemoUser",
+ "permissions": "owner"
+ }
+ ]
+ }
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/describe-environments.rst awscli-1.18.69/awscli/examples/cloud9/describe-environments.rst
--- awscli-1.11.13/awscli/examples/cloud9/describe-environments.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/describe-environments.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,36 @@
+**To get information about AWS Cloud9 development environments**
+
+This example gets information about the specified AWS Cloud9 development environments.
+
+Command::
+
+ aws cloud9 describe-environments --environment-ids 685f892f431b45c2b28cb69eadcdb0EX 349c86d4579e4e7298d500ff57a6b2EX
+
+Output::
+
+ {
+ "environments": [
+ {
+ "id": "685f892f431b45c2b28cb69eadcdb0EX",
+ "name": "my-demo-ec2-env",
+ "description": "Created from CodeStar.",
+ "type": "ec2",
+ "arn": "arn:aws:cloud9:us-east-1:123456789012:environment:685f892f431b45c2b28cb69eadcdb0EX",
+ "ownerArn": "arn:aws:iam::123456789012:user/MyDemoUser",
+ "lifecycle": {
+ "status": "CREATED"
+ }
+ },
+ {
+ "id": "349c86d4579e4e7298d500ff57a6b2EX",
+ "name": my-demo-ssh-env",
+ "description": "",
+ "type": "ssh",
+ "arn": "arn:aws:cloud9:us-east-1:123456789012:environment:349c86d4579e4e7298d500ff57a6b2EX",
+ "ownerArn": "arn:aws:iam::123456789012:user/MyDemoUser",
+ "lifecycle": {
+ "status": "CREATED"
+ }
+ }
+ ]
+ }
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/describe-environment-status.rst awscli-1.18.69/awscli/examples/cloud9/describe-environment-status.rst
--- awscli-1.11.13/awscli/examples/cloud9/describe-environment-status.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/describe-environment-status.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To get status information for an AWS Cloud9 development environment**
+
+This example gets status information for the specified AWS Cloud9 development environment.
+
+Command::
+
+ aws cloud9 describe-environment-status --environment-id 685f892f431b45c2b28cb69eadcdb0EX
+
+Output::
+
+ {
+ "status": "ready",
+ "message": "Environment is ready to use"
+ }
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/list-environments.rst awscli-1.18.69/awscli/examples/cloud9/list-environments.rst
--- awscli-1.11.13/awscli/examples/cloud9/list-environments.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/list-environments.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,16 @@
+**To get a list of available AWS Cloud9 development environment identifiers**
+
+This example gets a list of available AWS Cloud9 development environment identifiers.
+
+Command::
+
+ aws cloud9 list-environments
+
+Output::
+
+ {
+ "environmentIds": [
+ "685f892f431b45c2b28cb69eadcdb0EX",
+ "1980b80e5f584920801c09086667f0EX"
+ ]
+ }
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/update-environment-membership.rst awscli-1.18.69/awscli/examples/cloud9/update-environment-membership.rst
--- awscli-1.11.13/awscli/examples/cloud9/update-environment-membership.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/update-environment-membership.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+**To change the settings of an existing environment member for an AWS Cloud9 development environment**
+
+This example changes the settings of the specified existing environment member for the specified AWS Cloud9 development environment.
+
+Command::
+
+ aws cloud9 update-environment-membership --environment-id 8a34f51ce1e04a08882f1e811bd706EX --user-arn arn:aws:iam::123456789012:user/AnotherDemoUser --permissions read-only
+
+Output::
+
+ {
+ "membership": {
+ "environmentId": "8a34f51ce1e04a08882f1e811bd706EX",
+ "userId": "AIDAJ3LOROMOUXTBSU6EX",
+ "userArn": "arn:aws:iam::123456789012:user/AnotherDemoUser",
+ "permissions": "read-only"
+ }
+ }
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloud9/update-environment.rst awscli-1.18.69/awscli/examples/cloud9/update-environment.rst
--- awscli-1.11.13/awscli/examples/cloud9/update-environment.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloud9/update-environment.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To change the settings of an existing AWS Cloud9 development environment**
+
+This example changes the specified settings of the specified existing AWS Cloud9 development environment.
+
+Command::
+
+ aws cloud9 update-environment --environment-id 8a34f51ce1e04a08882f1e811bd706EX --name my-changed-demo-env --description "My changed demonstration development environment."
+
+Output::
+
+ None.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/continue-update-rollback.rst awscli-1.18.69/awscli/examples/cloudformation/continue-update-rollback.rst
--- awscli-1.11.13/awscli/examples/cloudformation/continue-update-rollback.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/continue-update-rollback.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To retry an update rollback**
+
+The following ``continue-update-rollback`` example resumes a rollback operation from a previously failed stack update. ::
+
+ aws cloudformation continue-update-rollback \
+ --stack-name my-stack
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/create-change-set.rst awscli-1.18.69/awscli/examples/cloudformation/create-change-set.rst
--- awscli-1.11.13/awscli/examples/cloudformation/create-change-set.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/create-change-set.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,16 @@
+**To create a change set**
+
+The following ``create-change-set`` example creates a change set with the ``CAPABILITY_IAM`` capability. The file ``template.yaml`` is an AWS CloudFormation template in the current folder that defines a stack that includes IAM resources. ::
+
+ aws cloudformation create-change-set \
+ --stack-name my-application \
+ --change-set-name my-change-set \
+ --template-body file://template.yaml \
+ --capabilities CAPABILITY_IAM
+
+Output::
+
+ {
+ "Id": "arn:aws:cloudformation:us-west-2:123456789012:changeSet/my-change-set/bc9555ba-a949-xmpl-bfb8-f41d04ec5784",
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-application/d0a825a0-e4cd-xmpl-b9fb-061c69e99204"
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/create-stack-instances.rst awscli-1.18.69/awscli/examples/cloudformation/create-stack-instances.rst
--- awscli-1.11.13/awscli/examples/cloudformation/create-stack-instances.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/create-stack-instances.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To create stack instances**
+
+The following ``create-stack-instances`` example creates instances of a stack set in two accounts and in four regions. The fault tolerance setting ensures that the update is attempted in all accounts and regions, even if some stacks cannot be created. ::
+
+ aws cloudformation create-stack-instances \
+ --stack-set-name my-stack-set \
+ --accounts 123456789012 223456789012 \
+ --regions us-east-1 us-east-2 us-west-1 us-west-2 \
+ --operation-preferences FailureToleranceCount=7
+
+Output::
+
+ {
+ "OperationId": "d7995c31-83c2-xmpl-a3d4-e9ca2811563f"
+ }
+
+To create a stack set, use the ``create-stack-set`` command.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/create-stack.rst awscli-1.18.69/awscli/examples/cloudformation/create-stack.rst
--- awscli-1.11.13/awscli/examples/cloudformation/create-stack.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/create-stack.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,30 +2,13 @@
The following ``create-stacks`` command creates a stack with the name ``myteststack`` using the ``sampletemplate.json`` template::
- aws cloudformation create-stack --stack-name myteststack --template-body file:////home//local//test//sampletemplate.json
+ aws cloudformation create-stack --stack-name myteststack --template-body file://sampletemplate.json --parameters ParameterKey=KeyPairName,ParameterValue=TestKey ParameterKey=SubnetIDs,ParameterValue=SubnetID1\\,SubnetID2
Output::
- [
- {
- "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896",
- "Description": "AWS CloudFormation Sample Template S3_Bucket: Sample template showing how to create a publicly accessible S3 bucket. **WARNING** This template creates an S3 bucket. You will be billed for the AWS resources used if you create a stack from this template.",
- "Tags": [],
- "Outputs": [
- {
- "Description": "Name of S3 bucket to hold website content",
- "OutputKey": "BucketName",
- "OutputValue": "myteststack-s3bucket-jssofi1zie2w"
- }
- ],
- "StackStatusReason": null,
- "CreationTime": "2013-08-23T01:02:15.422Z",
- "Capabilities": [],
- "StackName": "myteststack",
- "StackStatus": "CREATE_COMPLETE",
- "DisableRollback": false
- }
- ]
+ {
+ "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896"
+ }
For more information, see `Stacks`_ in the *AWS CloudFormation User Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/create-stack-set.rst awscli-1.18.69/awscli/examples/cloudformation/create-stack-set.rst
--- awscli-1.11.13/awscli/examples/cloudformation/create-stack-set.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/create-stack-set.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,16 @@
+**To create a stack set**
+
+The following ``create-stack-set`` example creates a stack set using the specified YAML file temlplate. ``template.yaml`` is an AWS CloudFormation template in the current folder that defines a stack. ::
+
+ aws cloudformation create-stack-set \
+ --stack-set-name my-stack-set \
+ --template-body file://template.yaml \
+ --description "SNS topic"
+
+Output::
+
+ {
+ "StackSetId": "my-stack-set:8d0f160b-d157-xmpl-a8e6-c0ce8e5d8cc1"
+ }
+
+To add stack instances to the stack set, use the ``create-stack-instances`` command.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/delete-change-set.rst awscli-1.18.69/awscli/examples/cloudformation/delete-change-set.rst
--- awscli-1.11.13/awscli/examples/cloudformation/delete-change-set.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/delete-change-set.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,16 @@
+**To delete a change set**
+
+The following ``delete-change-set`` example deletes a change set by specifying the change set name and stack name. ::
+
+ aws cloudformation delete-change-set \
+ --stack-name my-stack \
+ --change-set-name my-change-set
+
+This command produces no output.
+
+The following ``delete-change-set`` example deletes a change set by specifying the full ARN of the change set. ::
+
+ aws cloudformation delete-change-set \
+ --change-set-name arn:aws:cloudformation:us-east-2:123456789012:changeSet/my-change-set/4eca1a01-e285-xmpl-8026-9a1967bfb4b0
+
+This command produces no output.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/delete-stack-instances.rst awscli-1.18.69/awscli/examples/cloudformation/delete-stack-instances.rst
--- awscli-1.11.13/awscli/examples/cloudformation/delete-stack-instances.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/delete-stack-instances.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To delete stack instances**
+
+The following ``delete-stack-instances`` example deletes instances of a stack set in two accounts in two regions and terminates the stacks. ::
+
+ aws cloudformation delete-stack-instances \
+ --stack-set-name my-stack-set \
+ --accounts 123456789012 567890123456 \
+ --regions us-east-1 us-west-1 \
+ --no-retain-stacks
+
+Output::
+
+ {
+ "OperationId": "ad49f10c-fd1d-413f-a20a-8de6e2fa8f27"
+ }
+
+To delete an empty stack set, use the ``delete-stack-set`` command.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/delete-stack.rst awscli-1.18.69/awscli/examples/cloudformation/delete-stack.rst
--- awscli-1.11.13/awscli/examples/cloudformation/delete-stack.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/delete-stack.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+**To delete a stack**
+
+The following ``delete-stack`` example deletes the specified stack. ::
+
+ aws cloudformation delete-stack \
+ --stack-name my-stack
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/delete-stack-set.rst awscli-1.18.69/awscli/examples/cloudformation/delete-stack-set.rst
--- awscli-1.11.13/awscli/examples/cloudformation/delete-stack-set.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/delete-stack-set.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,10 @@
+**To delete a stack set**
+
+The following command deletes the specified empty stack set. The stack set must be empty. ::
+
+ aws cloudformation delete-stack-set \
+ --stack-set-name my-stack-set
+
+This command produces no output.
+
+To delete instances from the stack set, use the ``delete-stack-instances`` command.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/_deploy_description.rst awscli-1.18.69/awscli/examples/cloudformation/_deploy_description.rst
--- awscli-1.11.13/awscli/examples/cloudformation/_deploy_description.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/_deploy_description.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,8 @@
+Deploys the specified AWS CloudFormation template by creating and then executing
+a change set. The command terminates after AWS CloudFormation executes the
+change set. If you want to view the change set before AWS CloudFormation
+executes it, use the ``--no-execute-changeset`` flag.
+
+To update a stack, specify the name of an existing stack. To create a new stack,
+specify a new stack name.
+
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/deploy.rst awscli-1.18.69/awscli/examples/cloudformation/deploy.rst
--- awscli-1.11.13/awscli/examples/cloudformation/deploy.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/deploy.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,6 @@
+Following command deploys template named ``template.json`` to a stack named
+``my-new-stack``::
+
+
+ aws cloudformation deploy --template-file /path_to_template/template.json --stack-name my-new-stack --parameter-overrides Key1=Value1 Key2=Value2 --tags Key1=Value1 Key2=Value2
+
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/deregister-type.rst awscli-1.18.69/awscli/examples/cloudformation/deregister-type.rst
--- awscli-1.11.13/awscli/examples/cloudformation/deregister-type.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/deregister-type.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To deregister a type version**
+
+The following ``deregister-type`` example removes the specified type version from active use in the CloudFormation registry, so that it can no longer be used in CloudFormation operations. ::
+
+ aws cloudformation deregister-type \
+ --type RESOURCE \
+ --type-name My::Logs::LogGroup \
+ --version-id 00000002
+
+This command produces no output.
+
+For more information, see `Using the CloudFormation Registry `__ in the *AWS CloudFormation Users Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-account-limits.rst awscli-1.18.69/awscli/examples/cloudformation/describe-account-limits.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-account-limits.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-account-limits.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+**To get information about your account limits**
+
+The following command retrieves a list of regional limits for the current account. ::
+
+ aws cloudformation describe-account-limits
+
+Output::
+
+ {
+ "AccountLimits": [
+ {
+ "Name": "StackLimit",
+ "Value": 200
+ },
+ {
+ "Name": "StackOutputsLimit",
+ "Value": 60
+ },
+ {
+ "Name": "ConcurrentResourcesLimit",
+ "Value": 2500
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-change-set.rst awscli-1.18.69/awscli/examples/cloudformation/describe-change-set.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-change-set.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-change-set.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,59 @@
+**To get information about a change set**
+
+The following ``describe-change-set`` example displays the details of the change set specified by change set name and stack name. ::
+
+ aws cloudformation describe-change-set \
+ --change-set-name my-change-set \
+ --stack-name my-stack
+
+The following ``describe-change-set`` example displays the details of the change set specified by the full ARN of the change set::
+
+ aws cloudformation describe-change-set \
+ --change-set-name arn:aws:cloudformation:us-west-2:123456789012:changeSet/my-change-set/bc9555ba-a949-xmpl-bfb8-f41d04ec5784
+
+Output::
+
+ {
+ "Changes": [
+ {
+ "Type": "Resource",
+ "ResourceChange": {
+ "Action": "Modify",
+ "LogicalResourceId": "function",
+ "PhysicalResourceId": "my-function-SEZV4XMPL4S5",
+ "ResourceType": "AWS::Lambda::Function",
+ "Replacement": "False",
+ "Scope": [
+ "Properties"
+ ],
+ "Details": [
+ {
+ "Target": {
+ "Attribute": "Properties",
+ "Name": "Timeout",
+ "RequiresRecreation": "Never"
+ },
+ "Evaluation": "Static",
+ "ChangeSource": "DirectModification"
+ }
+ ]
+ }
+ }
+ ],
+ "ChangeSetName": "my-change-set",
+ "ChangeSetId": "arn:aws:cloudformation:us-west-2:123456789012:changeSet/my-change-set/4eca1a01-e285-xmpl-8026-9a1967bfb4b0",
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "StackName": "my-stack",
+ "Description": null,
+ "Parameters": null,
+ "CreationTime": "2019-10-02T05:20:56.651Z",
+ "ExecutionStatus": "AVAILABLE",
+ "Status": "CREATE_COMPLETE",
+ "StatusReason": null,
+ "NotificationARNs": [],
+ "RollbackConfiguration": {},
+ "Capabilities": [
+ "CAPABILITY_IAM"
+ ],
+ "Tags": null
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-stack-drift-detection-status.rst awscli-1.18.69/awscli/examples/cloudformation/describe-stack-drift-detection-status.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-stack-drift-detection-status.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-stack-drift-detection-status.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To check a drift detection operation's status**
+
+The following ``describe-stack-drift-detection-status`` example displays the status of a drift detection operation. Get the by ID running the ``detect-stack-drift`` command. ::
+
+ aws cloudformation describe-stack-drift-detection-status \
+ --stack-drift-detection-id 1a229160-e4d9-xmpl-ab67-0a4f93df83d4
+
+Output::
+
+ {
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "StackDriftDetectionId": "1a229160-e4d9-xmpl-ab67-0a4f93df83d4",
+ "StackDriftStatus": "DRIFTED",
+ "DetectionStatus": "DETECTION_COMPLETE",
+ "DriftedStackResourceCount": 1,
+ "Timestamp": "2019-10-02T05:54:30.902Z"
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-stack-events.rst awscli-1.18.69/awscli/examples/cloudformation/describe-stack-events.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-stack-events.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-stack-events.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,33 @@
+**To describe stack events**
+
+The following ``describe-stack-events`` example displays the 2 most recent events for the specified stack. ::
+
+ aws cloudformation describe-stack-events \
+ --stack-name my-stack \
+ --max-items 2
+
+ {
+ "StackEvents": [
+ {
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "EventId": "4e1516d0-e4d6-xmpl-b94f-0a51958a168c",
+ "StackName": "my-stack",
+ "LogicalResourceId": "my-stack",
+ "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "ResourceType": "AWS::CloudFormation::Stack",
+ "Timestamp": "2019-10-02T05:34:29.556Z",
+ "ResourceStatus": "UPDATE_COMPLETE"
+ },
+ {
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "EventId": "4dd3c810-e4d6-xmpl-bade-0aaf8b31ab7a",
+ "StackName": "my-stack",
+ "LogicalResourceId": "my-stack",
+ "PhysicalResourceId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "ResourceType": "AWS::CloudFormation::Stack",
+ "Timestamp": "2019-10-02T05:34:29.127Z",
+ "ResourceStatus": "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"
+ }
+ ],
+ "NextToken": "eyJOZXh0VG9XMPLiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ=="
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-stack-instance.rst awscli-1.18.69/awscli/examples/cloudformation/describe-stack-instance.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-stack-instance.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-stack-instance.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,22 @@
+**To describe a stack instance**
+
+The following command describes an instance of the specified stack set in the specified account and Region. The stack set is in the current region and account, and the instance is in the ``us-west-2`` region in account ``123456789012``.::
+
+ aws cloudformation describe-stack-instance \
+ --stack-set-name my-stack-set \
+ --stack-instance-account 123456789012 \
+ --stack-instance-region us-west-2
+
+Output::
+
+ {
+ "StackInstance": {
+ "StackSetId": "enable-config:296a3360-xmpl-40af-be78-9341e95bf743",
+ "Region": "us-west-2",
+ "Account": "123456789012",
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/StackSet-enable-config-e6cac20f-xmpl-46e9-8314-53e0d4591532/4287f9a0-e615-xmpl-894a-12b31d3117be",
+ "ParameterOverrides": [],
+ "Status": "OUTDATED",
+ "StatusReason": "ResourceLogicalId:ConfigBucket, ResourceType:AWS::S3::Bucket, ResourceStatusReason:You have attempted to create more buckets than allowed (Service: Amazon S3; Status Code: 400; Error Code: TooManyBuckets; Request ID: F7F21CXMPL580224; S3 Extended Request ID: egd/Fdt89BXMPLyiqbMNljVk55Yqqvi3NYW2nKLUVWhUGEhNfCmZdyj967lhriaG/dWMobSO40o=)."
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-stack-resource-drifts.rst awscli-1.18.69/awscli/examples/cloudformation/describe-stack-resource-drifts.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-stack-resource-drifts.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-stack-resource-drifts.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,37 @@
+**To get information about resources that drifted from the stack definition**
+
+The following command displays information about drifted resources for the specified stack. To initiate drift detection, use the ``detect-stack-drift`` command.::
+
+ aws cloudformation describe-stack-resource-drifts \
+ --stack-name my-stack
+
+The output shows an AWS Lambda function that was modified out-of-band::
+
+ {
+ "StackResourceDrifts": [
+ {
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "LogicalResourceId": "function",
+ "PhysicalResourceId": "my-function-SEZV4XMPL4S5",
+ "ResourceType": "AWS::Lambda::Function",
+ "ExpectedProperties": "{\"Description\":\"Write a file to S3.\",\"Environment\":{\"Variables\":{\"bucket\":\"my-stack-bucket-1vc62xmplgguf\"}},\"Handler\":\"index.handler\",\"MemorySize\":128,\"Role\":\"arn:aws:iam::123456789012:role/my-functionRole-HIZXMPLEOM9E\",\"Runtime\":\"nodejs10.x\",\"Tags\":[{\"Key\":\"lambda:createdBy\",\"Value\":\"SAM\"}],\"Timeout\":900,\"TracingConfig\":{\"Mode\":\"Active\"}}",
+ "ActualProperties": "{\"Description\":\"Write a file to S3.\",\"Environment\":{\"Variables\":{\"bucket\":\"my-stack-bucket-1vc62xmplgguf\"}},\"Handler\":\"index.handler\",\"MemorySize\":256,\"Role\":\"arn:aws:iam::123456789012:role/my-functionRole-HIZXMPLEOM9E\",\"Runtime\":\"nodejs10.x\",\"Tags\":[{\"Key\":\"lambda:createdBy\",\"Value\":\"SAM\"}],\"Timeout\":22,\"TracingConfig\":{\"Mode\":\"Active\"}}",
+ "PropertyDifferences": [
+ {
+ "PropertyPath": "/MemorySize",
+ "ExpectedValue": "128",
+ "ActualValue": "256",
+ "DifferenceType": "NOT_EQUAL"
+ },
+ {
+ "PropertyPath": "/Timeout",
+ "ExpectedValue": "900",
+ "ActualValue": "22",
+ "DifferenceType": "NOT_EQUAL"
+ }
+ ],
+ "StackResourceDriftStatus": "MODIFIED",
+ "Timestamp": "2019-10-02T05:54:44.064Z"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-stack-resource.rst awscli-1.18.69/awscli/examples/cloudformation/describe-stack-resource.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-stack-resource.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-stack-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To get information about a stack resource**
+
+The following ``describe-stack-resource`` example displays details for the resource named ``MyFunction`` in the specified stack. ::
+
+ aws cloudformation describe-stack-resource \
+ --stack-name MyStack \
+ --logical-resource-id MyFunction
+
+Output::
+
+ {
+ "StackResourceDetail": {
+ "StackName": "MyStack",
+ "StackId": "arn:aws:cloudformation:us-east-2:123456789012:stack/MyStack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "LogicalResourceId": "MyFunction",
+ "PhysicalResourceId": "my-function-SEZV4XMPL4S5",
+ "ResourceType": "AWS::Lambda::Function",
+ "LastUpdatedTimestamp": "2019-10-02T05:34:27.989Z",
+ "ResourceStatus": "UPDATE_COMPLETE",
+ "Metadata": "{}",
+ "DriftInformation": {
+ "StackResourceDriftStatus": "IN_SYNC"
+ }
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-stack-resources.rst awscli-1.18.69/awscli/examples/cloudformation/describe-stack-resources.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-stack-resources.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-stack-resources.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,49 @@
+**To get information about a stack resource**
+
+The following ``describe-stack-resources`` example displays details for the resources in the specified stack. ::
+
+ aws cloudformation describe-stack-resources \
+ --stack-name my-stack
+
+Output::
+
+ {
+ "StackResources": [
+ {
+ "StackName": "my-stack",
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "LogicalResourceId": "bucket",
+ "PhysicalResourceId": "my-stack-bucket-1vc62xmplgguf",
+ "ResourceType": "AWS::S3::Bucket",
+ "Timestamp": "2019-10-02T04:34:11.345Z",
+ "ResourceStatus": "CREATE_COMPLETE",
+ "DriftInformation": {
+ "StackResourceDriftStatus": "IN_SYNC"
+ }
+ },
+ {
+ "StackName": "my-stack",
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "LogicalResourceId": "function",
+ "PhysicalResourceId": "my-function-SEZV4XMPL4S5",
+ "ResourceType": "AWS::Lambda::Function",
+ "Timestamp": "2019-10-02T05:34:27.989Z",
+ "ResourceStatus": "UPDATE_COMPLETE",
+ "DriftInformation": {
+ "StackResourceDriftStatus": "IN_SYNC"
+ }
+ },
+ {
+ "StackName": "my-stack",
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "LogicalResourceId": "functionRole",
+ "PhysicalResourceId": "my-functionRole-HIZXMPLEOM9E",
+ "ResourceType": "AWS::IAM::Role",
+ "Timestamp": "2019-10-02T04:34:06.350Z",
+ "ResourceStatus": "CREATE_COMPLETE",
+ "DriftInformation": {
+ "StackResourceDriftStatus": "IN_SYNC"
+ }
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-stack-set-operation.rst awscli-1.18.69/awscli/examples/cloudformation/describe-stack-set-operation.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-stack-set-operation.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-stack-set-operation.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,32 @@
+**To get information about a stack set operation**
+
+The following `describe-stack-set-operation`` example displays details for an update operation on the specified stack set. ::
+
+ aws cloudformation describe-stack-set-operation \
+ --stack-set-name enable-config \
+ --operation-id 35d45ebc-ed88-xmpl-ab59-0197a1fc83a0
+
+Output::
+
+ {
+ "StackSetOperation": {
+ "OperationId": "35d45ebc-ed88-xmpl-ab59-0197a1fc83a0",
+ "StackSetId": "enable-config:296a3360-xmpl-40af-be78-9341e95bf743",
+ "Action": "UPDATE",
+ "Status": "SUCCEEDED",
+ "OperationPreferences": {
+ "RegionOrder": [
+ "us-east-1",
+ "us-west-2",
+ "eu-west-1",
+ "us-west-1"
+ ],
+ "FailureToleranceCount": 7,
+ "MaxConcurrentCount": 2
+ },
+ "AdministrationRoleARN": "arn:aws:iam::123456789012:role/AWSCloudFormationStackSetAdministrationRole",
+ "ExecutionRoleName": "AWSCloudFormationStackSetExecutionRole",
+ "CreationTimestamp": "2019-10-03T16:28:44.377Z",
+ "EndTimestamp": "2019-10-03T16:42:08.607Z"
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-stack-set.rst awscli-1.18.69/awscli/examples/cloudformation/describe-stack-set.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-stack-set.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-stack-set.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+**To get information about a stack set**
+
+The following `describe-stack-set`` example displays details about the specified stack set. ::
+
+ aws cloudformation describe-stack-set \
+ --stack-set-name my-stack-set
+
+Output::
+
+ {
+ "StackSet": {
+ "StackSetName": "my-stack-set",
+ "StackSetId": "my-stack-set:296a3360-xmpl-40af-be78-9341e95bf743",
+ "Description": "Create an Amazon SNS topic",
+ "Status": "ACTIVE",
+ "TemplateBody": "AWSTemplateFormatVersion: '2010-09-09'\nDescription: An AWS SNS topic\nResources:\n topic:\n Type: AWS::SNS::Topic",
+ "Parameters": [],
+ "Capabilities": [],
+ "Tags": [],
+ "StackSetARN": "arn:aws:cloudformation:us-west-2:123456789012:stackset/enable-config:296a3360-xmpl-40af-be78-9341e95bf743",
+ "AdministrationRoleARN": "arn:aws:iam::123456789012:role/AWSCloudFormationStackSetAdministrationRole",
+ "ExecutionRoleName": "AWSCloudFormationStackSetExecutionRole"
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-type-registration.rst awscli-1.18.69/awscli/examples/cloudformation/describe-type-registration.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-type-registration.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-type-registration.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,17 @@
+**To display type registration information**
+
+The following ``describe-type-registration`` example displays information about the specified type registration, including the type's current status, type, and version. ::
+
+ aws cloudformation describe-type-registration \
+ --registration-token a1b2c3d4-5678-90ab-cdef-EXAMPLE11111
+
+Output::
+
+ {
+ "ProgressStatus": "COMPLETE",
+ "TypeArn": "arn:aws:cloudformation:us-west-2:123456789012:type/resource/My-Logs-LogGroup",
+ "Description": "Deployment is currently in DEPLOY_STAGE of status COMPLETED; ",
+ "TypeVersionArn": "arn:aws:cloudformation:us-west-2:123456789012:type/resource/My-Logs-LogGroup/00000001"
+ }
+
+For more information, see `Using the CloudFormation Registry `__ in the *AWS CloudFormation Users Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/describe-type.rst awscli-1.18.69/awscli/examples/cloudformation/describe-type.rst
--- awscli-1.11.13/awscli/examples/cloudformation/describe-type.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/describe-type.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,25 @@
+**To display type information**
+
+The following ``describe-type`` example displays information for the specified type. ::
+
+ aws cloudformation describe-type \
+ --type-name My::Logs::LogGroup \
+ --type RESOURCE
+
+Output::
+
+ {
+ "SourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-logs.git",
+ "Description": "Customized resource derived from AWS::Logs::LogGroup",
+ "TimeCreated": "2019-12-03T23:29:33.321Z",
+ "Visibility": "PRIVATE",
+ "TypeName": "My::Logs::LogGroup",
+ "LastUpdated": "2019-12-03T23:29:33.321Z",
+ "DeprecatedStatus": "LIVE",
+ "ProvisioningType": "FULLY_MUTABLE",
+ "Type": "RESOURCE",
+ "Arn": "arn:aws:cloudformation:us-west-2:123456789012:type/resource/My-Logs-LogGroup/00000001",
+ "Schema": "[details omitted]"
+ }
+
+For more information, see `Using the CloudFormation Registry `__ in the *AWS CloudFormation Users Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/detect-stack-drift.rst awscli-1.18.69/awscli/examples/cloudformation/detect-stack-drift.rst
--- awscli-1.11.13/awscli/examples/cloudformation/detect-stack-drift.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/detect-stack-drift.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To detect drifted resources**
+
+The following ``detect-stack-drift`` example initiates drift detection for the specified stack. ::
+
+ aws cloudformation detect-stack-drift \
+ --stack-name my-stack
+
+Output::
+
+ {
+ "StackDriftDetectionId": "1a229160-e4d9-xmpl-ab67-0a4f93df83d4"
+ }
+
+You can then use this ID with the ``describe-stack-resource-drifts`` command to describe drifted resources.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/detect-stack-resource-drift.rst awscli-1.18.69/awscli/examples/cloudformation/detect-stack-resource-drift.rst
--- awscli-1.11.13/awscli/examples/cloudformation/detect-stack-resource-drift.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/detect-stack-resource-drift.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,36 @@
+**To detect drift for a resource**
+
+The following ``detect-stack-resource-drift`` example checks a resource named ``MyFunction`` in a stack named ``MyStack`` for drift::
+
+ aws cloudformation detect-stack-resource-drift \
+ --stack-name MyStack \
+ --logical-resource-id MyFunction
+
+The output shows an AWS Lambda function that was modified out-of-band::
+
+ {
+ "StackResourceDrift": {
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/MyStack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "LogicalResourceId": "MyFunction",
+ "PhysicalResourceId": "my-function-SEZV4XMPL4S5",
+ "ResourceType": "AWS::Lambda::Function",
+ "ExpectedProperties": "{\"Description\":\"Write a file to S3.\",\"Environment\":{\"Variables\":{\"bucket\":\"my-stack-bucket-1vc62xmplgguf\"}},\"Handler\":\"index.handler\",\"MemorySize\":128,\"Role\":\"arn:aws:iam::123456789012:role/my-functionRole-HIZXMPLEOM9E\",\"Runtime\":\"nodejs10.x\",\"Tags\":[{\"Key\":\"lambda:createdBy\",\"Value\":\"SAM\"}],\"Timeout\":900,\"TracingConfig\":{\"Mode\":\"Active\"}}",
+ "ActualProperties": "{\"Description\":\"Write a file to S3.\",\"Environment\":{\"Variables\":{\"bucket\":\"my-stack-bucket-1vc62xmplgguf\"}},\"Handler\":\"index.handler\",\"MemorySize\":256,\"Role\":\"arn:aws:iam::123456789012:role/my-functionRole-HIZXMPLEOM9E\",\"Runtime\":\"nodejs10.x\",\"Tags\":[{\"Key\":\"lambda:createdBy\",\"Value\":\"SAM\"}],\"Timeout\":22,\"TracingConfig\":{\"Mode\":\"Active\"}}",
+ "PropertyDifferences": [
+ {
+ "PropertyPath": "/MemorySize",
+ "ExpectedValue": "128",
+ "ActualValue": "256",
+ "DifferenceType": "NOT_EQUAL"
+ },
+ {
+ "PropertyPath": "/Timeout",
+ "ExpectedValue": "900",
+ "ActualValue": "22",
+ "DifferenceType": "NOT_EQUAL"
+ }
+ ],
+ "StackResourceDriftStatus": "MODIFIED",
+ "Timestamp": "2019-10-02T05:58:47.433Z"
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/detect-stack-set-drift.rst awscli-1.18.69/awscli/examples/cloudformation/detect-stack-set-drift.rst
--- awscli-1.11.13/awscli/examples/cloudformation/detect-stack-set-drift.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/detect-stack-set-drift.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To detect drift on a stack set and all associated stack instances**
+
+The following ``detect-stack-set-drift`` example initiates drift detection operations on the specified stack set, including all the stack instances associated with that stack set, and returns an operation ID that can be used to track the status of the drift operation. ::
+
+ aws cloudformation detect-stack-set-drift \
+ --stack-set-name stack-set-drift-example
+
+Output::
+
+ {
+ "OperationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
+ }
+
+For more information, see `Detecting Unmanaged Configuration Changes in Stack Sets `__ in the *AWS CloudFormation Users Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/estimate-template-cost.rst awscli-1.18.69/awscli/examples/cloudformation/estimate-template-cost.rst
--- awscli-1.11.13/awscli/examples/cloudformation/estimate-template-cost.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/estimate-template-cost.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To estimate template cost**
+
+The following ``estimate-template-cost`` example generates a cost estimate for a template named ``template.yaml`` in the current folder. ::
+
+ aws cloudformation estimate-template-cost \
+ --template-body file://template.yaml
+
+Output::
+
+ {
+ "Url": "http://calculator.s3.amazonaws.com/calc5.html?key=cloudformation/7870825a-xmpl-4def-92e7-c4f8dd360cca"
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/execute-change-set.rst awscli-1.18.69/awscli/examples/cloudformation/execute-change-set.rst
--- awscli-1.11.13/awscli/examples/cloudformation/execute-change-set.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/execute-change-set.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To execute a change set**
+
+The following ``execute-change-set`` example executes a change set specified by change set name and stack name. ::
+
+ aws cloudformation execute-change-set \
+ --change-set-name my-change-set \
+ --stack-name my-stack
+
+The following ``execute-change-set`` example executes a change set specified by the full ARN of the change set. ::
+
+ aws cloudformation execute-change-set \
+ --change-set-name arn:aws:cloudformation:us-west-2:123456789012:changeSet/my-change-set/bc9555ba-a949-xmpl-bfb8-f41d04ec5784
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/get-stack-policy.rst awscli-1.18.69/awscli/examples/cloudformation/get-stack-policy.rst
--- awscli-1.11.13/awscli/examples/cloudformation/get-stack-policy.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/get-stack-policy.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To view a stack policy**
+
+The following ``get-stack-policy`` example displays the stack policy for the specified stack. To attach a policy to a stack, use the ``set-stack-policy`` command. ::
+
+ aws cloudformation get-stack-policy \
+ --stack-name my-stack
+
+Output::
+
+ {
+ "StackPolicyBody": "{\n \"Statement\" : [\n {\n \"Effect\" : \"Allow\",\n \"Action\" : \"Update:*\",\n \"Principal\": \"*\",\n \"Resource\" : \"*\"\n },\n {\n \"Effect\" : \"Deny\",\n \"Action\" : \"Update:*\",\n \"Principal\": \"*\",\n \"Resource\" : \"LogicalResourceId/bucket\"\n }\n ]\n}\n"
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/get-template-summary.rst awscli-1.18.69/awscli/examples/cloudformation/get-template-summary.rst
--- awscli-1.11.13/awscli/examples/cloudformation/get-template-summary.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/get-template-summary.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+**To display a template summary**
+
+The following command displays summary information about the resources and metadata for the specified template file. ::
+
+ aws cloudformation get-template-summary \
+ --template-body file://template.yaml
+
+Output::
+
+ {
+ "Parameters": [],
+ "Description": "A VPC and subnets.",
+ "ResourceTypes": [
+ "AWS::EC2::VPC",
+ "AWS::EC2::Subnet",
+ "AWS::EC2::Subnet",
+ "AWS::EC2::RouteTable",
+ "AWS::EC2::VPCEndpoint",
+ "AWS::EC2::SubnetRouteTableAssociation",
+ "AWS::EC2::SubnetRouteTableAssociation",
+ "AWS::EC2::VPCEndpoint"
+ ],
+ "Version": "2010-09-09"
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-change-sets.rst awscli-1.18.69/awscli/examples/cloudformation/list-change-sets.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-change-sets.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-change-sets.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,22 @@
+**To list change sets**
+
+The following ``list-change-sets`` example displays a list of the pending change sets for the specified stack. ::
+
+ aws cloudformation list-change-sets \
+ --stack-name my-stack
+
+Output::
+
+ {
+ "Summaries": [
+ {
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204",
+ "StackName": "my-stack",
+ "ChangeSetId": "arn:aws:cloudformation:us-west-2:123456789012:changeSet/my-change-set/70160340-7914-xmpl-bcbf-128a1fa78b5d",
+ "ChangeSetName": "my-change-set",
+ "ExecutionStatus": "AVAILABLE",
+ "Status": "CREATE_COMPLETE",
+ "CreationTime": "2019-10-02T05:38:54.297Z"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-exports.rst awscli-1.18.69/awscli/examples/cloudformation/list-exports.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-exports.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-exports.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,27 @@
+**To list exports**
+
+The following ``list-exports`` example displays a list of the exports from stacks in the current region. ::
+
+ aws cloudformation list-exports
+
+Output::
+
+ {
+ "Exports": [
+ {
+ "ExportingStackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/private-vpc/99764070-b56c-xmpl-bee8-062a88d1d800",
+ "Name": "private-vpc-subnet-a",
+ "Value": "subnet-07b410xmplddcfa03"
+ },
+ {
+ "ExportingStackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/private-vpc/99764070-b56c-xmpl-bee8-062a88d1d800",
+ "Name": "private-vpc-subnet-b",
+ "Value": "subnet-075ed3xmplebd2fb1"
+ },
+ {
+ "ExportingStackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/private-vpc/99764070-b56c-xmpl-bee8-062a88d1d800",
+ "Name": "private-vpc-vpcid",
+ "Value": "vpc-011d7xmpl100e9841"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-imports.rst awscli-1.18.69/awscli/examples/cloudformation/list-imports.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-imports.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-imports.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To list imports**
+
+The following ``list-imports`` example lists the stacks that import the specified export. To get the list of available exports, use the ``list-exports`` command. ::
+
+ aws cloudformation list-imports \
+ --export-name private-vpc-vpcid
+
+Output::
+
+ {
+ "Imports": [
+ "my-database-stack"
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-stack-instances.rst awscli-1.18.69/awscli/examples/cloudformation/list-stack-instances.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-stack-instances.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-stack-instances.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,28 @@
+**To list instances for a stack**
+
+The following ``list-stack-instances`` example lists the instances created from the specified stack set. ::
+
+ aws cloudformation list-stack-instances \
+ --stack-set-name enable-config
+
+The example output includes details about a stack that failed to update due to an error::
+
+ {
+ "Summaries": [
+ {
+ "StackSetId": "enable-config:296a3360-xmpl-40af-be78-9341e95bf743",
+ "Region": "us-west-2",
+ "Account": "123456789012",
+ "StackId": "arn:aws:cloudformation:ap-northeast-1:123456789012:stack/StackSet-enable-config-35a6ac50-d9f8-4084-86e4-7da34d5de4c4/a1631cd0-e5fb-xmpl-b474-0aa20f14f06e",
+ "Status": "CURRENT"
+ },
+ {
+ "StackSetId": "enable-config:296a3360-xmpl-40af-be78-9341e95bf743",
+ "Region": "us-west-2",
+ "Account": "123456789012",
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/StackSet-enable-config-e6cac20f-xmpl-46e9-8314-53e0d4591532/eab53680-e5fa-xmpl-ba14-0a522351f81e",
+ "Status": "OUTDATED",
+ "StatusReason": "ResourceLogicalId:ConfigDeliveryChannel, ResourceType:AWS::Config::DeliveryChannel, ResourceStatusReason:Failed to put delivery channel 'StackSet-enable-config-e6cac20f-xmpl-46e9-8314-53e0d4591532-ConfigDeliveryChannel-1OJWJ7XD59WR0' because the maximum number of delivery channels: 1 is reached. (Service: AmazonConfig; Status Code: 400; Error Code: MaxNumberOfDeliveryChannelsExceededException; Request ID: d14b34a0-ef7c-xmpl-acf8-8a864370ae56)."
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-stack-resources.rst awscli-1.18.69/awscli/examples/cloudformation/list-stack-resources.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-stack-resources.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-stack-resources.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,43 @@
+**To list resources in a stack**
+
+The following command displays the list of resources in the specified stack. ::
+
+ aws cloudformation list-stack-resources \
+ --stack-name my-stack
+
+Output::
+
+ {
+ "StackResourceSummaries": [
+ {
+ "LogicalResourceId": "bucket",
+ "PhysicalResourceId": "my-stack-bucket-1vc62xmplgguf",
+ "ResourceType": "AWS::S3::Bucket",
+ "LastUpdatedTimestamp": "2019-10-02T04:34:11.345Z",
+ "ResourceStatus": "CREATE_COMPLETE",
+ "DriftInformation": {
+ "StackResourceDriftStatus": "IN_SYNC"
+ }
+ },
+ {
+ "LogicalResourceId": "function",
+ "PhysicalResourceId": "my-function-SEZV4XMPL4S5",
+ "ResourceType": "AWS::Lambda::Function",
+ "LastUpdatedTimestamp": "2019-10-02T05:34:27.989Z",
+ "ResourceStatus": "UPDATE_COMPLETE",
+ "DriftInformation": {
+ "StackResourceDriftStatus": "IN_SYNC"
+ }
+ },
+ {
+ "LogicalResourceId": "functionRole",
+ "PhysicalResourceId": "my-functionRole-HIZXMPLEOM9E",
+ "ResourceType": "AWS::IAM::Role",
+ "LastUpdatedTimestamp": "2019-10-02T04:34:06.350Z",
+ "ResourceStatus": "CREATE_COMPLETE",
+ "DriftInformation": {
+ "StackResourceDriftStatus": "IN_SYNC"
+ }
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-stack-set-operation-results.rst awscli-1.18.69/awscli/examples/cloudformation/list-stack-set-operation-results.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-stack-set-operation-results.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-stack-set-operation-results.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,31 @@
+**To list stack set operation results**
+
+The following command displays the results of an update operation on instances in the specified stack set. ::
+
+ aws cloudformation list-stack-set-operation-results \
+ --stack-set-name enable-config \
+ --operation-id 35d45ebc-ed88-xmpl-ab59-0197a1fc83a0
+
+Output::
+
+ {
+ "Summaries": [
+ {
+ "Account": "223456789012",
+ "Region": "us-west-2",
+ "Status": "SUCCEEDED",
+ "AccountGateResult": {
+ "Status": "SKIPPED",
+ "StatusReason": "Function not found: arn:aws:lambda:eu-west-1:223456789012:function:AWSCloudFormationStackSetAccountGate"
+ }
+ },
+ {
+ "Account": "223456789012",
+ "Region": "ap-south-1",
+ "Status": "CANCELLED",
+ "StatusReason": "Cancelled since failure tolerance has exceeded"
+ }
+ ]
+ }
+
+**Note:** The ``SKIPPED`` status for ``AccountGateResult`` is expected for successful operations unless you create an account gate function.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-stack-set-operations.rst awscli-1.18.69/awscli/examples/cloudformation/list-stack-set-operations.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-stack-set-operations.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-stack-set-operations.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,27 @@
+**To list stack set operations**
+
+The following ``list-stack-set-operations`` example displays the list of the most recent operations on the specified stack set. ::
+
+ aws cloudformation list-stack-set-operations \
+ --stack-set-name my-stack-set
+
+Output::
+
+ {
+ "Summaries": [
+ {
+ "OperationId": "35d45ebc-ed88-xmpl-ab59-0197a1fc83a0",
+ "Action": "UPDATE",
+ "Status": "SUCCEEDED",
+ "CreationTimestamp": "2019-10-03T16:28:44.377Z",
+ "EndTimestamp": "2019-10-03T16:42:08.607Z"
+ },
+ {
+ "OperationId": "891aa98f-7118-xmpl-00b2-00954d1dd0d6",
+ "Action": "UPDATE",
+ "Status": "FAILED",
+ "CreationTimestamp": "2019-10-03T15:43:53.916Z",
+ "EndTimestamp": "2019-10-03T15:45:58.925Z"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-stack-sets.rst awscli-1.18.69/awscli/examples/cloudformation/list-stack-sets.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-stack-sets.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-stack-sets.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,18 @@
+**To list stack sets**
+
+The following ``list-stack-sets`` example displays the list of stack sets in the current region and account. ::
+
+ aws cloudformation list-stack-sets
+
+Output::
+
+ {
+ "Summaries": [
+ {
+ "StackSetName": "enable-config",
+ "StackSetId": "enable-config:296a3360-xmpl-40af-be78-9341e95bf743",
+ "Description": "Enable AWS Config",
+ "Status": "ACTIVE"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-type-registrations.rst awscli-1.18.69/awscli/examples/cloudformation/list-type-registrations.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-type-registrations.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-type-registrations.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,20 @@
+**To list the completed registrations of a type**
+
+The following ``list-type-registrations`` example displays a list of the completed type registrations for the specified type. ::
+
+ aws cloudformation list-type-registrations \
+ --type RESOURCE \
+ --type-name My::Logs::LogGroup \
+ --registration-status-filter COMPLETE
+
+Output::
+
+ {
+ "RegistrationTokenList": [
+ "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
+ "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
+ "a1b2c3d4-5678-90ab-cdef-EXAMPLE33333"
+ ]
+ }
+
+For more information, see `Using the CloudFormation Registry `__ in the *AWS CloudFormation Users Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-types.rst awscli-1.18.69/awscli/examples/cloudformation/list-types.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-types.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-types.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,30 @@
+**To list the private resource types in an account**
+
+The following ``list-types`` example displays a list of the private resource types currently registered in the current AWS account. ::
+
+ aws cloudformation list-types
+
+Output::
+
+ {
+ "TypeSummaries": [
+ {
+ "Description": "WordPress blog resource for internal use",
+ "LastUpdated": "2019-12-04T18:28:15.059Z",
+ "TypeName": "My::WordPress::BlogExample",
+ "TypeArn": "arn:aws:cloudformation:us-west-2:123456789012:type/resource/My-WordPress-BlogExample",
+ "DefaultVersionId": "00000005",
+ "Type": "RESOURCE"
+ },
+ {
+ "Description": "Customized resource derived from AWS::Logs::LogGroup",
+ "LastUpdated": "2019-12-04T18:28:15.059Z",
+ "TypeName": "My::Logs::LogGroup",
+ "TypeArn": "arn:aws:cloudformation:us-west-2:123456789012:type/resource/My-Logs-LogGroup",
+ "DefaultVersionId": "00000003",
+ "Type": "RESOURCE"
+ }
+ ]
+ }
+
+For more information, see `Using the CloudFormation Registry `__ in the *AWS CloudFormation Users Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/list-type-versions.rst awscli-1.18.69/awscli/examples/cloudformation/list-type-versions.rst
--- awscli-1.11.13/awscli/examples/cloudformation/list-type-versions.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/list-type-versions.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,33 @@
+**To list versions of a type**
+
+The following ``list-type-versions`` example displays summary information of each version of the specified type whose status is ``LIVE``. ::
+
+ aws cloudformation list-type-versions \
+ --type RESOURCE \
+ --type-name My::Logs::LogGroup \
+ --deprecated-status LIVE
+
+Output::
+
+ {
+ "TypeVersionSummaries": [
+ {
+ "Description": "Customized resource derived from AWS::Logs::LogGroup",
+ "TimeCreated": "2019-12-03T23:29:33.321Z",
+ "TypeName": "My::Logs::LogGroup",
+ "VersionId": "00000001",
+ "Type": "RESOURCE",
+ "Arn": "arn:aws:cloudformation:us-west-2:123456789012:type/resource/My-Logs-LogGroup/00000001"
+ },
+ {
+ "Description": "Customized resource derived from AWS::Logs::LogGroup",
+ "TimeCreated": "2019-12-04T06:58:14.902Z",
+ "TypeName": "My::Logs::LogGroup",
+ "VersionId": "00000002",
+ "Type": "RESOURCE",
+ "Arn": "arn:aws:cloudformation:us-west-2:123456789012:type/resource/My-Logs-LogGroup/00000002"
+ }
+ ]
+ }
+
+For more information, see `Using the CloudFormation Registry `__ in the *AWS CloudFormation Users Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/_package_description.rst awscli-1.18.69/awscli/examples/cloudformation/_package_description.rst
--- awscli-1.11.13/awscli/examples/cloudformation/_package_description.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/_package_description.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,48 @@
+Packages the local artifacts (local paths) that your AWS CloudFormation template
+references. The command uploads local artifacts, such as source code for an AWS
+Lambda function or a Swagger file for an AWS API Gateway REST API, to an S3
+bucket. The command returns a copy of your template, replacing references to
+local artifacts with the S3 location where the command uploaded the artifacts.
+
+Use this command to quickly upload local artifacts that might be required by
+your template. After you package your template's artifacts, run the deploy
+command to ``deploy`` the returned template.
+
+This command can upload local artifacts referenced in the following places:
+
+
+ - ``BodyS3Location`` property for the ``AWS::ApiGateway::RestApi`` resource
+ - ``Code`` property for the ``AWS::Lambda::Function`` resource
+ - ``CodeUri`` property for the ``AWS::Serverless::Function`` resource
+ - ``DefinitionS3Location`` property for the ``AWS::AppSync::GraphQLSchema`` resource
+ - ``RequestMappingTemplateS3Location`` property for the ``AWS::AppSync::Resolver`` resource
+ - ``ResponseMappingTemplateS3Location`` property for the ``AWS::AppSync::Resolver`` resource
+ - ``DefinitionUri`` property for the ``AWS::Serverless::Api`` resource
+ - ``Location`` parameter for the ``AWS::Include`` transform
+ - ``SourceBundle`` property for the ``AWS::ElasticBeanstalk::ApplicationVersion`` resource
+ - ``TemplateURL`` property for the ``AWS::CloudFormation::Stack`` resource
+ - ``Command.ScriptLocation`` property for the ``AWS::Glue::Job`` resource
+
+
+To specify a local artifact in your template, specify a path to a local file or folder,
+as either an absolute or relative path. The relative path is a location
+that is relative to your template's location.
+
+For example, if your AWS Lambda function source code is in the
+``/home/user/code/lambdafunction/`` folder, specify
+``CodeUri: /home/user/code/lambdafunction`` for the
+``AWS::Serverless::Function`` resource. The command returns a template and replaces
+the local path with the S3 location: ``CodeUri: s3://mybucket/lambdafunction.zip``.
+
+If you specify a file, the command directly uploads it to the S3 bucket. If you
+specify a folder, the command zips the folder and then uploads the .zip file.
+For most resources, if you don't specify a path, the command zips and uploads the
+current working directory. The exception is ``AWS::ApiGateway::RestApi``;
+if you don't specify a ``BodyS3Location``, this command will not upload an artifact to S3.
+
+Before the command uploads artifacts, it checks if the artifacts are already
+present in the S3 bucket to prevent unnecessary uploads. The command uses MD5
+checksums to compare files. If the values match, the command doesn't upload the
+artifacts. Use the ``--force flag`` to skip this check and always upload the
+artifacts.
+
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/package.rst awscli-1.18.69/awscli/examples/cloudformation/package.rst
--- awscli-1.11.13/awscli/examples/cloudformation/package.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/package.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,6 @@
+Following command exports a template named ``template.json`` by uploading local
+artifacts to S3 bucket ``bucket-name`` and writes the exported template to
+``packaged-template.json``::
+
+ aws cloudformation package --template-file /path_to_template/template.json --s3-bucket bucket-name --output-template-file packaged-template.json
+
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/register-type.rst awscli-1.18.69/awscli/examples/cloudformation/register-type.rst
--- awscli-1.11.13/awscli/examples/cloudformation/register-type.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/register-type.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,16 @@
+**To register a resource type**
+
+The following ``register-type`` example registers the specified resource type as a private resource type in the user's account. ::
+
+ aws cloudformation register-type \
+ --type-name My::Organization::ResourceName \
+ --schema-handler-package s3://bucket_name/my-organization-resource_name.zip \
+ --type RESOURCE
+
+Output::
+
+ {
+ "RegistrationToken": "f5525280-104e-4d35-bef5-8f1f1example"
+ }
+
+For more information, see `Registering Resource Providers `__ in the *CloudFormation Command Line Interface User Guide for Type Development*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/set-stack-policy.rst awscli-1.18.69/awscli/examples/cloudformation/set-stack-policy.rst
--- awscli-1.11.13/awscli/examples/cloudformation/set-stack-policy.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/set-stack-policy.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,26 @@
+**To apply a stack policy**
+
+The following ``set-stack-policy`` example disables updates for the specified resource in the specified stack. ``stack-policy.json`` is a JSON document that defines the operations allowed on resources in the stack. ::
+
+ aws cloudformation set-stack-policy \
+ --stack-name my-stack \
+ --stack-policy-body file://stack-policy.json
+
+Output::
+
+ {
+ "Statement" : [
+ {
+ "Effect" : "Allow",
+ "Action" : "Update:*",
+ "Principal": "*",
+ "Resource" : "*"
+ },
+ {
+ "Effect" : "Deny",
+ "Action" : "Update:*",
+ "Principal": "*",
+ "Resource" : "LogicalResourceId/bucket"
+ }
+ ]
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/set-type-default-version.rst awscli-1.18.69/awscli/examples/cloudformation/set-type-default-version.rst
--- awscli-1.11.13/awscli/examples/cloudformation/set-type-default-version.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/set-type-default-version.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,12 @@
+**To set a type's default version**
+
+The following ``set-type-default-version`` example sets the specified type version to be used as the default for this type. ::
+
+ aws cloudformation set-type-default-version \
+ --type RESOURCE \
+ --type-name My::Logs::LogGroup \
+ --version-id 00000003
+
+This command produces no output.
+
+For more information, see `Using the CloudFormation Registry `__ in the *AWS CloudFormation Users Guide*.
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/signal-resource.rst awscli-1.18.69/awscli/examples/cloudformation/signal-resource.rst
--- awscli-1.11.13/awscli/examples/cloudformation/signal-resource.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/signal-resource.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,11 @@
+**To signal a resource**
+
+The following ``signal-resource`` example signals ``success`` to fulfill the wait condition named ``MyWaitCondition`` in the stack named ``my-stack``. ::
+
+ aws cloudformation signal-resource \
+ --stack-name my-stack \
+ --logical-resource-id MyWaitCondition \
+ --unique-id 1234 \
+ --status SUCCESS
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/stop-stack-set-operation.rst awscli-1.18.69/awscli/examples/cloudformation/stop-stack-set-operation.rst
--- awscli-1.11.13/awscli/examples/cloudformation/stop-stack-set-operation.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/stop-stack-set-operation.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,9 @@
+**To stop a stack set operation**
+
+The following ``stop-stack-set-operation`` example stops an in-progess update operation on the specified stack set. ::
+
+ aws cloudformation stop-stack-set-operation \
+ --stack-set-name my-stack-set \
+ --operation-id 1261cd27-490b-xmpl-ab42-793a896c69e6
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/update-stack-instances.rst awscli-1.18.69/awscli/examples/cloudformation/update-stack-instances.rst
--- awscli-1.11.13/awscli/examples/cloudformation/update-stack-instances.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/update-stack-instances.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,15 @@
+**To update stack instances**
+
+The following ``update-stack-instances`` example retries an update on stack instances in two accounts in two regions with the most recent settings. The specified fault tolerance setting ensures that the update is attempted in all accounts and regions, even if some stacks cannot be updated. ::
+
+ aws cloudformation update-stack-instances \
+ --stack-set-name my-stack-set \
+ --accounts 123456789012 567890123456 \
+ --regions us-east-1 us-west-2 \
+ --operation-preferences FailureToleranceCount=3
+
+Output::
+
+ {
+ "OperationId": "103ebdf2-21ea-xmpl-8892-de5e30733132"
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/update-stack-set.rst awscli-1.18.69/awscli/examples/cloudformation/update-stack-set.rst
--- awscli-1.11.13/awscli/examples/cloudformation/update-stack-set.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/update-stack-set.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,14 @@
+**To update a stack set**
+
+The following ``update-stack-set`` example adds a tag with the key name ``Owner`` and a value of ``IT`` to the stack instances in the specified stack set. ::
+
+ aws cloudformation update-stack-set \
+ --stack-set-name my-stack-set \
+ --use-previous-template \
+ --tags Key=Owner,Value=IT
+
+Output::
+
+ {
+ "OperationId": "e2b60321-6cab-xmpl-bde7-530c6f47950e"
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/update-termination-protection.rst awscli-1.18.69/awscli/examples/cloudformation/update-termination-protection.rst
--- awscli-1.11.13/awscli/examples/cloudformation/update-termination-protection.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/update-termination-protection.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,13 @@
+**To enable termination protection**
+
+The following ``update-termination-protection`` example enables termination protection on the specified stack. ::
+
+ aws cloudformation update-termination-protection \
+ --stack-name my-stack \
+ --enable-termination-protection
+
+Output::
+
+ {
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack/d0a825a0-e4cd-xmpl-b9fb-061c69e99204"
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/validate-template.rst awscli-1.18.69/awscli/examples/cloudformation/validate-template.rst
--- awscli-1.11.13/awscli/examples/cloudformation/validate-template.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/validate-template.rst 2020-05-28 19:25:48.000000000 +0000
@@ -2,7 +2,7 @@
The following ``validate-template`` command validates the ``sampletemplate.json`` template::
- aws cloudformation validate-template --template-body file:////home//local//test//sampletemplate.json
+ aws cloudformation validate-template --template-body file://sampletemplate.json
Output::
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/wait/change-set-create-complete.rst awscli-1.18.69/awscli/examples/cloudformation/wait/change-set-create-complete.rst
--- awscli-1.11.13/awscli/examples/cloudformation/wait/change-set-create-complete.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/wait/change-set-create-complete.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,9 @@
+**To wait for a change set to finish creating**
+
+The following ``wait change-set-create-complete`` example pauses and resumes only after it can confirm that the specified change set in the specified stack is ready to run. ::
+
+ aws cloudformation wait change-set-create-complete \
+ --stack-name my-stack \
+ --change-set-name my-change-set
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/wait/stack-create-complete.rst awscli-1.18.69/awscli/examples/cloudformation/wait/stack-create-complete.rst
--- awscli-1.11.13/awscli/examples/cloudformation/wait/stack-create-complete.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/wait/stack-create-complete.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,8 @@
+**To wait for CloudFormation to finish creating a stack**
+
+The following ``wait stack-create-complete`` example pauses and resumes only after it can confirm that CloudFormation has successfully created the specified stack. ::
+
+ aws cloudformation wait stack-create-complete \
+ --stack-name "arn:aws:cloudformation:uus-west-2:123456789012:stack/my-stack-1234/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/wait/stack-delete-complete.rst awscli-1.18.69/awscli/examples/cloudformation/wait/stack-delete-complete.rst
--- awscli-1.11.13/awscli/examples/cloudformation/wait/stack-delete-complete.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/wait/stack-delete-complete.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,8 @@
+**To wait for CloudFormation to finish deleting a stack**
+
+The following ``wait stack-delete-complete`` example pauses and resumes only after it can confirm that CloudFormation has deleted the specified stack. ::
+
+ aws cloudformation wait stack-delete-complete \
+ --stack-name "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-1234/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/wait/stack-exists.rst awscli-1.18.69/awscli/examples/cloudformation/wait/stack-exists.rst
--- awscli-1.11.13/awscli/examples/cloudformation/wait/stack-exists.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/wait/stack-exists.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,8 @@
+**To wait for confirmation that a stack exists**
+
+The following ``wait stack-exists`` example pauses and resumes only after it can confirm that the specified stack actually exists. ::
+
+ aws cloudformation wait stack-exists \
+ --stack-name "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-1234/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/wait/stack-import-complete.rst awscli-1.18.69/awscli/examples/cloudformation/wait/stack-import-complete.rst
--- awscli-1.11.13/awscli/examples/cloudformation/wait/stack-import-complete.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/wait/stack-import-complete.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,8 @@
+**To wait for confirmation that resources have been imported into a stack**
+
+The following ``wait stack-import-complete`` example pauses and resumes only after it can confirm that the import operation successfully completed for all resources in the stack that support resource import. ::
+
+ aws cloudformation wait stack-import-complete \
+ --stack-name "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-1234/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/wait/stack-rollback-complete.rst awscli-1.18.69/awscli/examples/cloudformation/wait/stack-rollback-complete.rst
--- awscli-1.11.13/awscli/examples/cloudformation/wait/stack-rollback-complete.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/wait/stack-rollback-complete.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,8 @@
+**To wait for CloudFormation to finish rolling back a stack**
+
+The following ``wait stack-rollback-complete`` example pauses and resumes only after it can confirm that CloudFormation has completed a rollback operation on the specified stack. ::
+
+ aws cloudformation wait stack-rollback-complete \
+ --stack-name "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-1234/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/wait/stack-update-complete.rst awscli-1.18.69/awscli/examples/cloudformation/wait/stack-update-complete.rst
--- awscli-1.11.13/awscli/examples/cloudformation/wait/stack-update-complete.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/wait/stack-update-complete.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,8 @@
+**To wait for CloudFormation to finish updating a stack**
+
+The following ``wait stack-update-complete`` example pauses and resumes only after it can confirm that CloudFormation has updated the specified stack. ::
+
+ aws cloudformation wait stack-update-complete \
+ --stack-name "arn:aws:cloudformation:us-west-2:123456789012:stack/my-stack-1234/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111"
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudformation/wait/type-registration-complete.rst awscli-1.18.69/awscli/examples/cloudformation/wait/type-registration-complete.rst
--- awscli-1.11.13/awscli/examples/cloudformation/wait/type-registration-complete.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudformation/wait/type-registration-complete.rst 2020-05-28 19:26:18.000000000 +0000
@@ -0,0 +1,8 @@
+**To wait for CloudFormation to register a resource type**
+
+The following ``wait type-registration-complete`` example pauses and resumes only after it can confirm that CloudFormation has registered the specified resource type. ::
+
+ aws cloudformation wait type-registration-complete \
+ --registration-token "f5525280-104e-4d35-bef5-8f1f1example"
+
+This command produces no output.
\ No newline at end of file
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/create-cloud-front-origin-access-identity.rst awscli-1.18.69/awscli/examples/cloudfront/create-cloud-front-origin-access-identity.rst
--- awscli-1.11.13/awscli/examples/cloudfront/create-cloud-front-origin-access-identity.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/create-cloud-front-origin-access-identity.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,38 @@
+**To create a CloudFront origin access identity**
+
+The following example creates a CloudFront origin access identity (OAI) by
+providing the OAI configuration as a command line argument::
+
+ aws cloudfront create-cloud-front-origin-access-identity \
+ --cloud-front-origin-access-identity-config \
+ CallerReference="cli-example",Comment="Example OAI"
+
+You can accomplish the same thing by providing the OAI configuration in a JSON
+file, as shown in the following example::
+
+ aws cloudfront create-cloud-front-origin-access-identity \
+ --cloud-front-origin-access-identity-config file://OAI-config.json
+
+The file ``OAI-config.json`` is a JSON document in the current directory that
+contains the following::
+
+ {
+ "CallerReference": "cli-example",
+ "Comment": "Example OAI"
+ }
+
+Whether you provide the OAI configuration with a command line argument or a
+JSON file, the output is the same::
+
+ {
+ "Location": "https://cloudfront.amazonaws.com/2019-03-26/origin-access-identity/cloudfront/E74FTE3AEXAMPLE",
+ "ETag": "E2QWRUHEXAMPLE",
+ "CloudFrontOriginAccessIdentity": {
+ "Id": "E74FTE3AEXAMPLE",
+ "S3CanonicalUserId": "cd13868f797c227fbea2830611a26fe0a21ba1b826ab4bed9b7771c9aEXAMPLE",
+ "CloudFrontOriginAccessIdentityConfig": {
+ "CallerReference": "cli-example",
+ "Comment": "Example OAI"
+ }
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/create-distribution.rst awscli-1.18.69/awscli/examples/cloudfront/create-distribution.rst
--- awscli-1.11.13/awscli/examples/cloudfront/create-distribution.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/create-distribution.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,161 +1,235 @@
-You can create a CloudFront web distribution for an S3 domain (such as
-my-bucket.s3.amazonaws.com) or for a custom domain (such as example.com).
-The following command shows an example for an S3 domain, and optionally also
-specifies a default root object::
-
- aws cloudfront create-distribution \
- --origin-domain-name my-bucket.s3.amazonaws.com \
- --default-root-object index.html
-
-Or you can use the following command together with a JSON document to do the
-same thing::
-
- aws cloudfront create-distribution --distribution-config file://distconfig.json
-
-The file ``distconfig.json`` is a JSON document in the current folder that defines a CloudFront distribution::
-
- {
- "CallerReference": "my-distribution-2015-09-01",
- "Aliases": {
- "Quantity": 0
- },
- "DefaultRootObject": "index.html",
- "Origins": {
- "Quantity": 1,
- "Items": [
- {
- "Id": "my-origin",
- "DomainName": "my-bucket.s3.amazonaws.com",
- "S3OriginConfig": {
- "OriginAccessIdentity": ""
- }
- }
- ]
- },
- "DefaultCacheBehavior": {
- "TargetOriginId": "my-origin",
- "ForwardedValues": {
- "QueryString": true,
- "Cookies": {
- "Forward": "none"
+**To create a CloudFront distribution**
+
+The following example creates a distribution for an S3 bucket named
+``awsexamplebucket``, and also specifies ``index.html`` as the default root
+object, using command line arguments::
+
+ aws cloudfront create-distribution \
+ --origin-domain-name awsexamplebucket.s3.amazonaws.com \
+ --default-root-object index.html
+
+Instead of using command line arguments, you can provide the distribution
+configuration in a JSON file, as shown in the following example::
+
+ aws cloudfront create-distribution \
+ --distribution-config file://dist-config.json
+
+The file ``dist-config.json`` is a JSON document in the current folder that
+contains the following::
+
+ {
+ "CallerReference": "cli-example",
+ "Aliases": {
+ "Quantity": 0
+ },
+ "DefaultRootObject": "index.html",
+ "Origins": {
+ "Quantity": 1,
+ "Items": [
+ {
+ "Id": "awsexamplebucket.s3.amazonaws.com-cli-example",
+ "DomainName": "awsexamplebucket.s3.amazonaws.com",
+ "OriginPath": "",
+ "CustomHeaders": {
+ "Quantity": 0
+ },
+ "S3OriginConfig": {
+ "OriginAccessIdentity": ""
+ }
+ }
+ ]
+ },
+ "OriginGroups": {
+ "Quantity": 0
+ },
+ "DefaultCacheBehavior": {
+ "TargetOriginId": "awsexamplebucket.s3.amazonaws.com-cli-example",
+ "ForwardedValues": {
+ "QueryString": false,
+ "Cookies": {
+ "Forward": "none"
+ },
+ "Headers": {
+ "Quantity": 0
+ },
+ "QueryStringCacheKeys": {
+ "Quantity": 0
+ }
+ },
+ "TrustedSigners": {
+ "Enabled": false,
+ "Quantity": 0
+ },
+ "ViewerProtocolPolicy": "allow-all",
+ "MinTTL": 0,
+ "AllowedMethods": {
+ "Quantity": 2,
+ "Items": [
+ "HEAD",
+ "GET"
+ ],
+ "CachedMethods": {
+ "Quantity": 2,
+ "Items": [
+ "HEAD",
+ "GET"
+ ]
+ }
+ },
+ "SmoothStreaming": false,
+ "DefaultTTL": 86400,
+ "MaxTTL": 31536000,
+ "Compress": false,
+ "LambdaFunctionAssociations": {
+ "Quantity": 0
+ },
+ "FieldLevelEncryptionId": ""
+ },
+ "CacheBehaviors": {
+ "Quantity": 0
+ },
+ "CustomErrorResponses": {
+ "Quantity": 0
+ },
+ "Comment": "",
+ "Logging": {
+ "Enabled": false,
+ "IncludeCookies": false,
+ "Bucket": "",
+ "Prefix": ""
+ },
+ "PriceClass": "PriceClass_All",
+ "Enabled": true,
+ "ViewerCertificate": {
+ "CloudFrontDefaultCertificate": true,
+ "MinimumProtocolVersion": "TLSv1",
+ "CertificateSource": "cloudfront"
+ },
+ "Restrictions": {
+ "GeoRestriction": {
+ "RestrictionType": "none",
+ "Quantity": 0
+ }
+ },
+ "WebACLId": "",
+ "HttpVersion": "http2",
+ "IsIPV6Enabled": true
+ }
+
+Whether you provide the distribution information with a command line argument
+or a JSON file, the output is the same::
+
+ {
+ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EMLARXS9EXAMPLE",
+ "ETag": "E9LHASXEXAMPLE",
+ "Distribution": {
+ "Id": "EMLARXS9EXAMPLE",
+ "ARN": "arn:aws:cloudfront::123456789012:distribution/EMLARXS9EXAMPLE",
+ "Status": "InProgress",
+ "LastModifiedTime": "2019-11-22T00:55:15.705Z",
+ "InProgressInvalidationBatches": 0,
+ "DomainName": "d111111abcdef8.cloudfront.net",
+ "ActiveTrustedSigners": {
+ "Enabled": false,
+ "Quantity": 0
+ },
+ "DistributionConfig": {
+ "CallerReference": "cli-example",
+ "Aliases": {
+ "Quantity": 0
+ },
+ "DefaultRootObject": "index.html",
+ "Origins": {
+ "Quantity": 1,
+ "Items": [
+ {
+ "Id": "awsexamplebucket.s3.amazonaws.com-cli-example",
+ "DomainName": "awsexamplebucket.s3.amazonaws.com",
+ "OriginPath": "",
+ "CustomHeaders": {
+ "Quantity": 0
+ },
+ "S3OriginConfig": {
+ "OriginAccessIdentity": ""
+ }
+ }
+ ]
+ },
+ "OriginGroups": {
+ "Quantity": 0
+ },
+ "DefaultCacheBehavior": {
+ "TargetOriginId": "awsexamplebucket.s3.amazonaws.com-cli-example",
+ "ForwardedValues": {
+ "QueryString": false,
+ "Cookies": {
+ "Forward": "none"
+ },
+ "Headers": {
+ "Quantity": 0
+ },
+ "QueryStringCacheKeys": {
+ "Quantity": 0
+ }
+ },
+ "TrustedSigners": {
+ "Enabled": false,
+ "Quantity": 0
+ },
+ "ViewerProtocolPolicy": "allow-all",
+ "MinTTL": 0,
+ "AllowedMethods": {
+ "Quantity": 2,
+ "Items": [
+ "HEAD",
+ "GET"
+ ],
+ "CachedMethods": {
+ "Quantity": 2,
+ "Items": [
+ "HEAD",
+ "GET"
+ ]
+ }
+ },
+ "SmoothStreaming": false,
+ "DefaultTTL": 86400,
+ "MaxTTL": 31536000,
+ "Compress": false,
+ "LambdaFunctionAssociations": {
+ "Quantity": 0
+ },
+ "FieldLevelEncryptionId": ""
+ },
+ "CacheBehaviors": {
+ "Quantity": 0
+ },
+ "CustomErrorResponses": {
+ "Quantity": 0
+ },
+ "Comment": "",
+ "Logging": {
+ "Enabled": false,
+ "IncludeCookies": false,
+ "Bucket": "",
+ "Prefix": ""
+ },
+ "PriceClass": "PriceClass_All",
+ "Enabled": true,
+ "ViewerCertificate": {
+ "CloudFrontDefaultCertificate": true,
+ "MinimumProtocolVersion": "TLSv1",
+ "CertificateSource": "cloudfront"
+ },
+ "Restrictions": {
+ "GeoRestriction": {
+ "RestrictionType": "none",
+ "Quantity": 0
+ }
+ },
+ "WebACLId": "",
+ "HttpVersion": "http2",
+ "IsIPV6Enabled": true
+ }
}
- },
- "TrustedSigners": {
- "Enabled": false,
- "Quantity": 0
- },
- "ViewerProtocolPolicy": "allow-all",
- "MinTTL": 3600
- },
- "CacheBehaviors": {
- "Quantity": 0
- },
- "Comment": "",
- "Logging": {
- "Enabled": false,
- "IncludeCookies": true,
- "Bucket": "",
- "Prefix": ""
- },
- "PriceClass": "PriceClass_All",
- "Enabled": true
- }
-
-
-Output::
-
- {
- "Distribution": {
- "Status": "InProgress",
- "DomainName": "d2wkuj2w9l34gt.cloudfront.net",
- "InProgressInvalidationBatches": 0,
- "DistributionConfig": {
- "Comment": "",
- "CacheBehaviors": {
- "Quantity": 0
- },
- "Logging": {
- "Bucket": "",
- "Prefix": "",
- "Enabled": false,
- "IncludeCookies": false
- },
- "Origins": {
- "Items": [
- {
- "OriginPath": "",
- "S3OriginConfig": {
- "OriginAccessIdentity": ""
- },
- "Id": "my-origin",
- "DomainName": "my-bucket.s3.amazonaws.com"
- }
- ],
- "Quantity": 1
- },
- "DefaultRootObject": "",
- "PriceClass": "PriceClass_All",
- "Enabled": true,
- "DefaultCacheBehavior": {
- "TrustedSigners": {
- "Enabled": false,
- "Quantity": 0
- },
- "TargetOriginId": "my-origin",
- "ViewerProtocolPolicy": "allow-all",
- "ForwardedValues": {
- "Headers": {
- "Quantity": 0
- },
- "Cookies": {
- "Forward": "none"
- },
- "QueryString": true
- },
- "MaxTTL": 31536000,
- "SmoothStreaming": false,
- "DefaultTTL": 86400,
- "AllowedMethods": {
- "Items": [
- "HEAD",
- "GET"
- ],
- "CachedMethods": {
- "Items": [
- "HEAD",
- "GET"
- ],
- "Quantity": 2
- },
- "Quantity": 2
- },
- "MinTTL": 3600
- },
- "CallerReference": "my-distribution-2015-09-01",
- "ViewerCertificate": {
- "CloudFrontDefaultCertificate": true,
- "MinimumProtocolVersion": "SSLv3"
- },
- "CustomErrorResponses": {
- "Quantity": 0
- },
- "Restrictions": {
- "GeoRestriction": {
- "RestrictionType": "none",
- "Quantity": 0
- }
- },
- "Aliases": {
- "Quantity": 0
- }
- },
- "ActiveTrustedSigners": {
- "Enabled": false,
- "Quantity": 0
- },
- "LastModifiedTime": "2015-08-31T21:11:29.093Z",
- "Id": "S11A16G5KZMEQD"
- },
- "ETag": "E37HOT42DHPVYH",
- "Location": "https://cloudfront.amazonaws.com/2015-04-17/distribution/S11A16G5KZMEQD"
- }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/create-distribution-with-tags.rst awscli-1.18.69/awscli/examples/cloudfront/create-distribution-with-tags.rst
--- awscli-1.11.13/awscli/examples/cloudfront/create-distribution-with-tags.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/create-distribution-with-tags.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,247 @@
+**To create a CloudFront distribution with tags**
+
+The following example creates a distribution with two tags by providing the
+distribution configuration and tags in a JSON file named
+``dist-config-with-tags.json``::
+
+ aws cloudfront create-distribution-with-tags \
+ --distribution-config-with-tags file://dist-config-with-tags.json
+
+The file ``dist-config-with-tags.json`` is a JSON document in the current
+folder that contains the following. Note the ``Tags`` object at the top of
+the file, which contains two tags:
+
+- ``Name = ExampleDistribution``
+- ``Project = ExampleProject``
+
+::
+
+ {
+ "Tags": {
+ "Items": [
+ {
+ "Key": "Name",
+ "Value": "ExampleDistribution"
+ },
+ {
+ "Key": "Project",
+ "Value": "ExampleProject"
+ }
+ ]
+ },
+ "DistributionConfig": {
+ "CallerReference": "cli-example",
+ "Aliases": {
+ "Quantity": 0
+ },
+ "DefaultRootObject": "index.html",
+ "Origins": {
+ "Quantity": 1,
+ "Items": [
+ {
+ "Id": "awsexamplebucket.s3.amazonaws.com-cli-example",
+ "DomainName": "awsexamplebucket.s3.amazonaws.com",
+ "OriginPath": "",
+ "CustomHeaders": {
+ "Quantity": 0
+ },
+ "S3OriginConfig": {
+ "OriginAccessIdentity": ""
+ }
+ }
+ ]
+ },
+ "OriginGroups": {
+ "Quantity": 0
+ },
+ "DefaultCacheBehavior": {
+ "TargetOriginId": "awsexamplebucket.s3.amazonaws.com-cli-example",
+ "ForwardedValues": {
+ "QueryString": false,
+ "Cookies": {
+ "Forward": "none"
+ },
+ "Headers": {
+ "Quantity": 0
+ },
+ "QueryStringCacheKeys": {
+ "Quantity": 0
+ }
+ },
+ "TrustedSigners": {
+ "Enabled": false,
+ "Quantity": 0
+ },
+ "ViewerProtocolPolicy": "allow-all",
+ "MinTTL": 0,
+ "AllowedMethods": {
+ "Quantity": 2,
+ "Items": [
+ "HEAD",
+ "GET"
+ ],
+ "CachedMethods": {
+ "Quantity": 2,
+ "Items": [
+ "HEAD",
+ "GET"
+ ]
+ }
+ },
+ "SmoothStreaming": false,
+ "DefaultTTL": 86400,
+ "MaxTTL": 31536000,
+ "Compress": false,
+ "LambdaFunctionAssociations": {
+ "Quantity": 0
+ },
+ "FieldLevelEncryptionId": ""
+ },
+ "CacheBehaviors": {
+ "Quantity": 0
+ },
+ "CustomErrorResponses": {
+ "Quantity": 0
+ },
+ "Comment": "",
+ "Logging": {
+ "Enabled": false,
+ "IncludeCookies": false,
+ "Bucket": "",
+ "Prefix": ""
+ },
+ "PriceClass": "PriceClass_All",
+ "Enabled": true,
+ "ViewerCertificate": {
+ "CloudFrontDefaultCertificate": true,
+ "MinimumProtocolVersion": "TLSv1",
+ "CertificateSource": "cloudfront"
+ },
+ "Restrictions": {
+ "GeoRestriction": {
+ "RestrictionType": "none",
+ "Quantity": 0
+ }
+ },
+ "WebACLId": "",
+ "HttpVersion": "http2",
+ "IsIPV6Enabled": true
+ }
+ }
+
+Output::
+
+ {
+ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE",
+ "ETag": "E2QWRUHEXAMPLE",
+ "Distribution": {
+ "Id": "EDFDVBD6EXAMPLE",
+ "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE",
+ "Status": "InProgress",
+ "LastModifiedTime": "2019-12-04T23:35:41.433Z",
+ "InProgressInvalidationBatches": 0,
+ "DomainName": "d111111abcdef8.cloudfront.net",
+ "ActiveTrustedSigners": {
+ "Enabled": false,
+ "Quantity": 0
+ },
+ "DistributionConfig": {
+ "CallerReference": "cli-example",
+ "Aliases": {
+ "Quantity": 0
+ },
+ "DefaultRootObject": "index.html",
+ "Origins": {
+ "Quantity": 1,
+ "Items": [
+ {
+ "Id": "awsexamplebucket.s3.amazonaws.com-cli-example",
+ "DomainName": "awsexamplebucket.s3.amazonaws.com",
+ "OriginPath": "",
+ "CustomHeaders": {
+ "Quantity": 0
+ },
+ "S3OriginConfig": {
+ "OriginAccessIdentity": ""
+ }
+ }
+ ]
+ },
+ "OriginGroups": {
+ "Quantity": 0
+ },
+ "DefaultCacheBehavior": {
+ "TargetOriginId": "awsexamplebucket.s3.amazonaws.com-cli-example",
+ "ForwardedValues": {
+ "QueryString": false,
+ "Cookies": {
+ "Forward": "none"
+ },
+ "Headers": {
+ "Quantity": 0
+ },
+ "QueryStringCacheKeys": {
+ "Quantity": 0
+ }
+ },
+ "TrustedSigners": {
+ "Enabled": false,
+ "Quantity": 0
+ },
+ "ViewerProtocolPolicy": "allow-all",
+ "MinTTL": 0,
+ "AllowedMethods": {
+ "Quantity": 2,
+ "Items": [
+ "HEAD",
+ "GET"
+ ],
+ "CachedMethods": {
+ "Quantity": 2,
+ "Items": [
+ "HEAD",
+ "GET"
+ ]
+ }
+ },
+ "SmoothStreaming": false,
+ "DefaultTTL": 86400,
+ "MaxTTL": 31536000,
+ "Compress": false,
+ "LambdaFunctionAssociations": {
+ "Quantity": 0
+ },
+ "FieldLevelEncryptionId": ""
+ },
+ "CacheBehaviors": {
+ "Quantity": 0
+ },
+ "CustomErrorResponses": {
+ "Quantity": 0
+ },
+ "Comment": "",
+ "Logging": {
+ "Enabled": false,
+ "IncludeCookies": false,
+ "Bucket": "",
+ "Prefix": ""
+ },
+ "PriceClass": "PriceClass_All",
+ "Enabled": true,
+ "ViewerCertificate": {
+ "CloudFrontDefaultCertificate": true,
+ "MinimumProtocolVersion": "TLSv1",
+ "CertificateSource": "cloudfront"
+ },
+ "Restrictions": {
+ "GeoRestriction": {
+ "RestrictionType": "none",
+ "Quantity": 0
+ }
+ },
+ "WebACLId": "",
+ "HttpVersion": "http2",
+ "IsIPV6Enabled": true
+ }
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/create-field-level-encryption-config.rst awscli-1.18.69/awscli/examples/cloudfront/create-field-level-encryption-config.rst
--- awscli-1.11.13/awscli/examples/cloudfront/create-field-level-encryption-config.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/create-field-level-encryption-config.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,80 @@
+**To create a CloudFront field-level encryption configuration**
+
+The following example creates a field-level encryption configuration by
+providing the configuration parameters in a JSON file named
+``fle-config.json``. Before you can create a field-level encryption
+configuration, you must have a field-level encryption profile. To create a
+profile, see the `create-field-level-encryption-profile
+`_ command.
+
+For more information about CloudFront field-level
+encryption, see
+`Using Field-Level Encryption to Help Protect Sensitive Data `_
+in the *Amazon CloudFront Developer Guide*.
+
+::
+
+ aws cloudfront create-field-level-encryption-config \
+ --field-level-encryption-config file://fle-config.json
+
+The file ``fle-config.json`` is a JSON document in the current
+folder that contains the following::
+
+ {
+ "CallerReference": "cli-example",
+ "Comment": "Example FLE configuration",
+ "QueryArgProfileConfig": {
+ "ForwardWhenQueryArgProfileIsUnknown": true,
+ "QueryArgProfiles": {
+ "Quantity": 0
+ }
+ },
+ "ContentTypeProfileConfig": {
+ "ForwardWhenContentTypeIsUnknown": true,
+ "ContentTypeProfiles": {
+ "Quantity": 1,
+ "Items": [
+ {
+ "Format": "URLEncoded",
+ "ProfileId": "P280MFCLSYOCVU",
+ "ContentType": "application/x-www-form-urlencoded"
+ }
+ ]
+ }
+ }
+ }
+
+Output::
+
+ {
+ "Location": "https://cloudfront.amazonaws.com/2019-03-26/field-level-encryption/C3KM2WVD605UAY",
+ "ETag": "E2P4Z4VU7TY5SG",
+ "FieldLevelEncryption": {
+ "Id": "C3KM2WVD605UAY",
+ "LastModifiedTime": "2019-12-10T21:30:18.974Z",
+ "FieldLevelEncryptionConfig": {
+ "CallerReference": "cli-example",
+ "Comment": "Example FLE configuration",
+ "QueryArgProfileConfig": {
+ "ForwardWhenQueryArgProfileIsUnknown": true,
+ "QueryArgProfiles": {
+ "Quantity": 0,
+ "Items": []
+ }
+ },
+ "ContentTypeProfileConfig": {
+ "ForwardWhenContentTypeIsUnknown": true,
+ "ContentTypeProfiles": {
+ "Quantity": 1,
+ "Items": [
+ {
+ "Format": "URLEncoded",
+ "ProfileId": "P280MFCLSYOCVU",
+ "ContentType": "application/x-www-form-urlencoded"
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/create-field-level-encryption-profile.rst awscli-1.18.69/awscli/examples/cloudfront/create-field-level-encryption-profile.rst
--- awscli-1.11.13/awscli/examples/cloudfront/create-field-level-encryption-profile.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/create-field-level-encryption-profile.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,71 @@
+**To create a CloudFront field-level encryption profile**
+
+The following example creates a field-level encryption profile by providing the
+parameters in a JSON file named ``fle-profile-config.json``. Before you can
+create a field-level encryption profile, you must have a CloudFront public key.
+To create a CloudFront public key, see the `create-public-key
+`_ command.
+
+For more information about CloudFront field-level encryption, see
+`Using Field-Level Encryption to Help Protect Sensitive Data `_
+in the *Amazon CloudFront Developer Guide*.
+
+::
+
+ aws cloudfront create-field-level-encryption-profile \
+ --field-level-encryption-profile-config file://fle-profile-config.json
+
+The file ``fle-profile-config.json`` is a JSON document in the current folder
+that contains the following::
+
+ {
+ "Name": "ExampleFLEProfile",
+ "CallerReference": "cli-example",
+ "Comment": "FLE profile for AWS CLI example",
+ "EncryptionEntities": {
+ "Quantity": 1,
+ "Items": [
+ {
+ "PublicKeyId": "K2K8NC4HVFE3M0",
+ "ProviderId": "ExampleFLEProvider",
+ "FieldPatterns": {
+ "Quantity": 1,
+ "Items": [
+ "ExampleSensitiveField"
+ ]
+ }
+ }
+ ]
+ }
+ }
+
+Output::
+
+ {
+ "Location": "https://cloudfront.amazonaws.com/2019-03-26/field-level-encryption-profile/PPK0UOSIF5WSV",
+ "ETag": "E2QWRUHEXAMPLE",
+ "FieldLevelEncryptionProfile": {
+ "Id": "PPK0UOSIF5WSV",
+ "LastModifiedTime": "2019-12-10T01:03:16.537Z",
+ "FieldLevelEncryptionProfileConfig": {
+ "Name": "ExampleFLEProfile",
+ "CallerReference": "cli-example",
+ "Comment": "FLE profile for AWS CLI example",
+ "EncryptionEntities": {
+ "Quantity": 1,
+ "Items": [
+ {
+ "PublicKeyId": "K2K8NC4HVFE3M0",
+ "ProviderId": "ExampleFLEProvider",
+ "FieldPatterns": {
+ "Quantity": 1,
+ "Items": [
+ "ExampleSensitiveField"
+ ]
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/create-invalidation.rst awscli-1.18.69/awscli/examples/cloudfront/create-invalidation.rst
--- awscli-1.11.13/awscli/examples/cloudfront/create-invalidation.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/create-invalidation.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,43 +1,68 @@
-The following command creates an invalidation for a CloudFront distribution with the ID ``S11A16G5KZMEQD``::
+**To create an invalidation for a CloudFront distribution**
- aws cloudfront create-invalidation --distribution-id S11A16G5KZMEQD \
- --paths /index.html /error.html
+The following ``create-invalidation`` example creates an invalidation for the specified files in the specified CloudFront distribution::
-The --paths will automatically generate a random ``CallerReference`` every time.
-
-Or you can use the following command to do the same thing, so that you can have a chance to specify your own ``CallerReference`` here::
-
- aws cloudfront create-invalidation --invalidation-batch file://invbatch.json --distribution-id S11A16G5KZMEQD
-
-The distribution ID is available in the output of ``create-distribution`` and ``list-distributions``.
-
-The file ``invbatch.json`` is a JSON document in the current folder that specifies two paths to invalidate::
-
- {
- "Paths": {
- "Quantity": 2,
- "Items": ["/index.html", "/error.html"]
- },
- "CallerReference": "my-invalidation-2015-09-01"
- }
-
-Output of both commands::
-
- {
- "Invalidation": {
- "Status": "InProgress",
- "InvalidationBatch": {
- "Paths": {
- "Items": [
- "/index.html",
- "/error.html"
- ],
- "Quantity": 2
- },
- "CallerReference": "my-invalidation-2015-09-01"
- },
- "Id": "YNY2LI2BVJ4NJU",
- "CreateTime": "2015-08-31T21:15:52.042Z"
- },
- "Location": "https://cloudfront.amazonaws.com/2015-04-17/distribution/S11A16G5KZMEQD/invalidation/YNY2LI2BVJ4NJU"
- }
\ No newline at end of file
+ aws cloudfront create-invalidation \
+ --distribution-id EDFDVBD6EXAMPLE \
+ --paths "/example-path/example-file.jpg" "/example-path/example-file2.png"
+
+Output::
+
+ {
+ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE/invalidation/I1JLWSDAP8FU89",
+ "Invalidation": {
+ "Id": "I1JLWSDAP8FU89",
+ "Status": "InProgress",
+ "CreateTime": "2019-12-05T18:24:51.407Z",
+ "InvalidationBatch": {
+ "Paths": {
+ "Quantity": 2,
+ "Items": [
+ "/example-path/example-file2.png",
+ "/example-path/example-file.jpg"
+ ]
+ },
+ "CallerReference": "cli-1575570291-670203"
+ }
+ }
+ }
+
+In the previous example, the AWS CLI automatically generated a random ``CallerReference``. To specify your own ``CallerReference``, or to avoid passing the invalidation parameters as command line arguments, you can use a JSON file. The following example creates an invalidation for two files, by providing the invalidation parameters in a JSON file named ``inv-batch.json``::
+
+ aws cloudfront create-invalidation \
+ --distribution-id EDFDVBD6EXAMPLE \
+ --invalidation-batch file://inv-batch.json
+
+Contents of ``inv-batch.json``::
+
+ {
+ "Paths": {
+ "Quantity": 2,
+ "Items": [
+ "/example-path/example-file.jpg",
+ "/example-path/example-file2.png"
+ ]
+ },
+ "CallerReference": "cli-example"
+ }
+
+Output::
+
+ {
+ "Location": "https://cloudfront.amazonaws.com/2019-03-26/distribution/EDFDVBD6EXAMPLE/invalidation/I2J0I21PCUYOIK",
+ "Invalidation": {
+ "Id": "I2J0I21PCUYOIK",
+ "Status": "InProgress",
+ "CreateTime": "2019-12-05T18:40:49.413Z",
+ "InvalidationBatch": {
+ "Paths": {
+ "Quantity": 2,
+ "Items": [
+ "/example-path/example-file.jpg",
+ "/example-path/example-file2.png"
+ ]
+ },
+ "CallerReference": "cli-example"
+ }
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/create-public-key.rst awscli-1.18.69/awscli/examples/cloudfront/create-public-key.rst
--- awscli-1.11.13/awscli/examples/cloudfront/create-public-key.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/create-public-key.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,42 @@
+**To create a CloudFront public key**
+
+The following example creates a CloudFront public key by providing the
+parameters in a JSON file named ``pub-key-config.json``. Before you can use
+this command, you must have a PEM-encoded public key. For more information, see
+`Create an RSA Key Pair
+`_
+in the *Amazon CloudFront Developer Guide*.
+
+::
+
+ aws cloudfront create-public-key \
+ --public-key-config file://pub-key-config.json
+
+The file ``pub-key-config.json`` is a JSON document in the current folder that
+contains the following. Note that the public key is encoded in PEM format.
+
+::
+
+ {
+ "CallerReference": "cli-example",
+ "Name": "ExampleKey",
+ "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n",
+ "Comment": "example public key"
+ }
+
+Output::
+
+ {
+ "Location": "https://cloudfront.amazonaws.com/2019-03-26/public-key/KDFB19YGCR002",
+ "ETag": "E2QWRUHEXAMPLE",
+ "PublicKey": {
+ "Id": "KDFB19YGCR002",
+ "CreatedTime": "2019-12-05T18:51:43.781Z",
+ "PublicKeyConfig": {
+ "CallerReference": "cli-example",
+ "Name": "ExampleKey",
+ "EncodedKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxPMbCA2Ks0lnd7IR+3pw\nwd3H/7jPGwj8bLUmore7bX+oeGpZ6QmLAe/1UOWcmZX2u70dYcSIzB1ofZtcn4cJ\nenHBAzO3ohBY/L1tQGJfS2A+omnN6H16VZE1JCK8XSJyfze7MDLcUyHZETdxuvRb\nA9X343/vMAuQPnhinFJ8Wdy8YBXSPpy7r95ylUQd9LfYTBzVZYG2tSesplcOkjM3\n2Uu+oMWxQAw1NINnSLPinMVsutJy6ZqlV3McWNWe4T+STGtWhrPNqJEn45sIcCx4\nq+kGZ2NQ0FyIyT2eiLKOX5Rgb/a36E/aMk4VoDsaenBQgG7WLTnstb9sr7MIhS6A\nrwIDAQAB\n-----END PUBLIC KEY-----\n",
+ "Comment": "example public key"
+ }
+ }
+ }
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/delete-cloud-front-origin-access-identity.rst awscli-1.18.69/awscli/examples/cloudfront/delete-cloud-front-origin-access-identity.rst
--- awscli-1.11.13/awscli/examples/cloudfront/delete-cloud-front-origin-access-identity.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/delete-cloud-front-origin-access-identity.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,23 @@
+**To delete a CloudFront origin access identity**
+
+The following example deletes the origin access identity (OAI) with the ID
+``E74FTE3AEXAMPLE``. To delete an OAI, you must have the OAI's ID and ``ETag``.
+The OAI ID is returned in the output of the
+`create-cloud-front-origin-access-identity
+`_ and
+`list-cloud-front-origin-access-identities
+`_ commands.
+To get the ``ETag``, use the
+`get-cloud-front-origin-access-identity
+`_ or
+`get-cloud-front-origin-access-identity-config
+`_ command.
+Use the ``--if-match`` option to provide the OAI's ``ETag``.
+
+::
+
+ aws cloudfront delete-cloud-front-origin-access-identity \
+ --id E74FTE3AEXAMPLE \
+ --if-match E2QWRUHEXAMPLE
+
+When successful, this command has no output.
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/delete-distribution.rst awscli-1.18.69/awscli/examples/cloudfront/delete-distribution.rst
--- awscli-1.11.13/awscli/examples/cloudfront/delete-distribution.rst 2016-11-03 20:32:27.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/delete-distribution.rst 2020-05-28 19:25:48.000000000 +0000
@@ -1,5 +1,20 @@
-The following command deletes a CloudFront distribution with the ID ``S11A16G5KZMEQD``::
+**To delete a CloudFront distribution**
- aws cloudfront delete-distribution --id S11A16G5KZMEQD --if-match 8UBQECEJX24ST
+The following example deletes the CloudFront distribution with the ID
+``EDFDVBD6EXAMPLE``. Before you can delete a distribution, you must disable it.
+To disable a distribution, use the `update-distribution
+`_ command. For more information, see the
+`update-distribution examples `_.
-The distribution ID is available in the output of ``create-distribution`` and ``list-distributions``. The distribution must be disabled with ``update-distribution`` prior to deletion. The ETag value ``8UBQECEJX24ST`` for the ``if-match`` parameter is available in the output of ``update-distribution``, ``get-distribution`` or ``get-distribution-config``.
\ No newline at end of file
+When a distribution is disabled, you can delete it. To delete a distribution,
+you must use the ``--if-match`` option to provide the distribution's ``ETag``.
+To get the ``ETag``, use the `get-distribution `_ or
+`get-distribution-config `_ command.
+
+::
+
+ aws cloudfront delete-distribution \
+ --id EDFDVBD6EXAMPLE \
+ --if-match E2QWRUHEXAMPLE
+
+When successful, this command has no output.
diff -Nru awscli-1.11.13/awscli/examples/cloudfront/delete-field-level-encryption-config.rst awscli-1.18.69/awscli/examples/cloudfront/delete-field-level-encryption-config.rst
--- awscli-1.11.13/awscli/examples/cloudfront/delete-field-level-encryption-config.rst 1970-01-01 00:00:00.000000000 +0000
+++ awscli-1.18.69/awscli/examples/cloudfront/delete-field-level-encryption-config.rst 2020-05-28 19:25:48.000000000 +0000
@@ -0,0 +1,24 @@
+**To delete a CloudFront field-level encryption configuration**
+
+The following example deletes the CloudFront field-level encryption
+configuration with the ID ``C3KM2WVD605UAY``. To delete a field-level
+encryption configuration, you must have its ID and ``ETag``. The ID is returned
+in the output of the
+`create-field-level-encryption-config
+`_ and
+`list-field-level-encryption-configs
+