awscli-1.14.44/0000777454262600001440000000000013243367512014227 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/bin/0000777454262600001440000000000013243367512014777 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/bin/aws0000777454262600001440000000146213243367510015520 0ustar pysdk-ciamazon00000000000000#!/usr/bin/env python # Copyright 2012 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 os if os.environ.get('LC_CTYPE', '') == 'UTF-8': os.environ['LC_CTYPE'] = 'en_US.UTF-8' import awscli.clidriver def main(): return awscli.clidriver.main() if __name__ == '__main__': sys.exit(main()) awscli-1.14.44/bin/aws.cmd0000666454262600001440000000263013243367510016255 0ustar pysdk-ciamazon00000000000000@echo OFF REM=""" setlocal set PythonExe="" set PythonExeFlags= for %%i in (cmd bat exe) do ( for %%j in (python.%%i) do ( call :SetPythonExe "%%~$PATH:j" ) ) for /f "tokens=2 delims==" %%i in ('assoc .py') do ( for /f "tokens=2 delims==" %%j in ('ftype %%i') do ( for /f "tokens=1" %%k in ("%%j") do ( call :SetPythonExe %%k ) ) ) %PythonExe% -x %PythonExeFlags% "%~f0" %* exit /B %ERRORLEVEL% goto :EOF :SetPythonExe if not ["%~1"]==[""] ( if [%PythonExe%]==[""] ( set PythonExe="%~1" ) ) goto :EOF """ # =================================================== # Python script starts here # =================================================== #!/usr/bin/env python # Copyright 2012 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 awscli.clidriver import sys def main(): return awscli.clidriver.main() if __name__ == '__main__': sys.exit(main()) awscli-1.14.44/bin/aws_zsh_completer.sh0000666454262600001440000000341713243367510021066 0ustar pysdk-ciamazon00000000000000# Source this file to activate auto completion for zsh using the bash # compatibility helper. Make sure to run `compinit` before, which should be # given usually. # # % source /path/to/zsh_complete.sh # # Typically that would be called somewhere in your .zshrc. # # Note, the overwrite of _bash_complete() is to export COMP_LINE and COMP_POINT # That is only required for zsh <= edab1d3dbe61da7efe5f1ac0e40444b2ec9b9570 # # https://github.com/zsh-users/zsh/commit/edab1d3dbe61da7efe5f1ac0e40444b2ec9b9570 # # zsh relases prior to that version do not export the required env variables! autoload -Uz bashcompinit bashcompinit -i _bash_complete() { local ret=1 local -a suf matches local -x COMP_POINT COMP_CWORD local -a COMP_WORDS COMPREPLY BASH_VERSINFO local -x COMP_LINE="$words" local -A savejobstates savejobtexts (( COMP_POINT = 1 + ${#${(j. .)words[1,CURRENT]}} + $#QIPREFIX + $#IPREFIX + $#PREFIX )) (( COMP_CWORD = CURRENT - 1)) COMP_WORDS=( $words ) BASH_VERSINFO=( 2 05b 0 1 release ) savejobstates=( ${(kv)jobstates} ) savejobtexts=( ${(kv)jobtexts} ) [[ ${argv[${argv[(I)nospace]:-0}-1]} = -o ]] && suf=( -S '' ) matches=( ${(f)"$(compgen $@ -- ${words[CURRENT]})"} ) if [[ -n $matches ]]; then if [[ ${argv[${argv[(I)filenames]:-0}-1]} = -o ]]; then compset -P '*/' && matches=( ${matches##*/} ) compset -S '/*' && matches=( ${matches%%/*} ) compadd -Q -f "${suf[@]}" -a matches && ret=0 else compadd -Q "${suf[@]}" -a matches && ret=0 fi fi if (( ret )); then if [[ ${argv[${argv[(I)default]:-0}-1]} = -o ]]; then _default "${suf[@]}" && ret=0 elif [[ ${argv[${argv[(I)dirnames]:-0}-1]} = -o ]]; then _directories "${suf[@]}" && ret=0 fi fi return ret } complete -C aws_completer aws awscli-1.14.44/bin/aws_bash_completer0000666454262600001440000000031413243367510020557 0ustar pysdk-ciamazon00000000000000# Typically that would be added under one of the following paths: # - /etc/bash_completion.d # - /usr/local/etc/bash_completion.d # - /usr/share/bash-completion/completions complete -C aws_completer aws awscli-1.14.44/bin/aws_completer0000777454262600001440000000216313243367510017571 0ustar pysdk-ciamazon00000000000000#!/usr/bin/env python # Copyright 2012 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 if os.environ.get('LC_CTYPE', '') == 'UTF-8': os.environ['LC_CTYPE'] = 'en_US.UTF-8' import awscli.completer if __name__ == '__main__': # bash exports COMP_LINE and COMP_POINT, tcsh COMMAND_LINE only cline = os.environ.get('COMP_LINE') or os.environ.get('COMMAND_LINE') or '' cpoint = int(os.environ.get('COMP_POINT') or len(cline)) try: awscli.completer.complete(cline, cpoint) except KeyboardInterrupt: # If the user hits Ctrl+C, we don't want to print # a traceback to the user. pass awscli-1.14.44/setup.py0000666454262600001440000000560113243367511015742 0ustar pysdk-ciamazon00000000000000#!/usr/bin/env python import codecs import os.path import re import sys from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): return codecs.open(os.path.join(here, *parts), 'r').read() def find_version(*file_paths): version_file = read(*file_paths) version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) if version_match: return version_match.group(1) raise RuntimeError("Unable to find version string.") requires = ['botocore==1.8.48', 'colorama>=0.2.5,<=0.3.7', 'docutils>=0.10', 'rsa>=3.1.2,<=3.5.0', 's3transfer>=0.1.12,<0.2.0', 'PyYAML>=3.10,<=3.12'] if sys.version_info[:2] == (2, 6): # For python2.6 we have to require argparse since it # was not in stdlib until 2.7. requires.append('argparse>=1.1') setup_options = dict( name='awscli', version=find_version("awscli", "__init__.py"), description='Universal Command Line Environment for AWS.', long_description=open('README.rst').read(), author='Amazon Web Services', url='http://aws.amazon.com/cli/', scripts=['bin/aws', 'bin/aws.cmd', 'bin/aws_completer', 'bin/aws_zsh_completer.sh', 'bin/aws_bash_completer'], packages=find_packages(exclude=['tests*']), package_data={'awscli': ['data/*.json', 'examples/*/*.rst', 'examples/*/*/*.rst', 'topics/*.rst', 'topics/*.json']}, install_requires=requires, extras_require={ ':python_version=="2.6"': [ 'argparse>=1.1', ] }, license="Apache License 2.0", classifiers=( 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Natural Language :: English', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ), ) if 'py2exe' in sys.argv: # This will actually give us a py2exe command. import py2exe # And we have some py2exe specific options. setup_options['options'] = { 'py2exe': { 'optimize': 0, 'skip_archive': True, 'dll_excludes': ['crypt32.dll'], 'packages': ['docutils', 'urllib', 'httplib', 'HTMLParser', 'awscli', 'ConfigParser', 'xml.etree', 'pipes'], } } setup_options['console'] = ['bin/aws'] setup(**setup_options) awscli-1.14.44/awscli/0000777454262600001440000000000013243367512015511 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/help.py0000666454262600001440000003244513243367510017021 0ustar pysdk-ciamazon00000000000000# 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 sys import platform import shlex from subprocess import Popen, PIPE from docutils.core import publish_string from docutils.writers import manpage from botocore.docs.bcdoc import docevents from botocore.docs.bcdoc.restdoc import ReSTDocument from botocore.docs.bcdoc.textwriter import TextWriter from awscli.clidocs import ProviderDocumentEventHandler from awscli.clidocs import ServiceDocumentEventHandler from awscli.clidocs import OperationDocumentEventHandler from awscli.clidocs import TopicListerDocumentEventHandler from awscli.clidocs import TopicDocumentEventHandler from awscli.argprocess import ParamShorthandParser from awscli.argparser import ArgTableArgParser from awscli.topictags import TopicTagDB from awscli.utils import ignore_ctrl_c LOG = logging.getLogger('awscli.help') class ExecutableNotFoundError(Exception): def __init__(self, executable_name): super(ExecutableNotFoundError, self).__init__( 'Could not find executable named "%s"' % executable_name) def get_renderer(): """ Return the appropriate HelpRenderer implementation for the current platform. """ if platform.system() == 'Windows': return WindowsHelpRenderer() else: return PosixHelpRenderer() class PagingHelpRenderer(object): """ Interface for a help renderer. The renderer is responsible for displaying the help content on a particular platform. """ def __init__(self, output_stream=sys.stdout): self.output_stream = output_stream PAGER = None def get_pager_cmdline(self): pager = self.PAGER if 'MANPAGER' in os.environ: pager = os.environ['MANPAGER'] elif 'PAGER' in os.environ: pager = os.environ['PAGER'] return shlex.split(pager) def render(self, contents): """ Each implementation of HelpRenderer must implement this render method. """ converted_content = self._convert_doc_content(contents) self._send_output_to_pager(converted_content) def _send_output_to_pager(self, output): cmdline = self.get_pager_cmdline() LOG.debug("Running command: %s", cmdline) p = self._popen(cmdline, stdin=PIPE) p.communicate(input=output) def _popen(self, *args, **kwargs): return Popen(*args, **kwargs) def _convert_doc_content(self, contents): return contents class PosixHelpRenderer(PagingHelpRenderer): """ Render help content on a Posix-like system. This includes Linux and MacOS X. """ PAGER = 'less -R' def _convert_doc_content(self, contents): man_contents = publish_string(contents, writer=manpage.Writer()) if not self._exists_on_path('groff'): raise ExecutableNotFoundError('groff') cmdline = ['groff', '-m', 'man', '-T', 'ascii'] LOG.debug("Running command: %s", cmdline) p3 = self._popen(cmdline, stdin=PIPE, stdout=PIPE, stderr=PIPE) groff_output = p3.communicate(input=man_contents)[0] return groff_output def _send_output_to_pager(self, output): cmdline = self.get_pager_cmdline() if not self._exists_on_path(cmdline[0]): LOG.debug("Pager '%s' not found in PATH, printing raw help." % cmdline[0]) self.output_stream.write(output.decode('utf-8') + "\n") self.output_stream.flush() return LOG.debug("Running command: %s", cmdline) with ignore_ctrl_c(): # We can't rely on the KeyboardInterrupt from # the CLIDriver being caught because when we # send the output to a pager it will use various # control characters that need to be cleaned # up gracefully. Otherwise if we simply catch # the Ctrl-C and exit, it will likely leave the # users terminals in a bad state and they'll need # to manually run ``reset`` to fix this issue. # Ignoring Ctrl-C solves this issue. It's also # the default behavior of less (you can't ctrl-c # out of a manpage). p = self._popen(cmdline, stdin=PIPE) p.communicate(input=output) def _exists_on_path(self, name): # Since we're only dealing with POSIX systems, we can # ignore things like PATHEXT. return any([os.path.exists(os.path.join(p, name)) for p in os.environ.get('PATH', '').split(os.pathsep)]) class WindowsHelpRenderer(PagingHelpRenderer): """Render help content on a Windows platform.""" PAGER = 'more' def _convert_doc_content(self, contents): text_output = publish_string(contents, writer=TextWriter()) return text_output def _popen(self, *args, **kwargs): # Also set the shell value to True. To get any of the # piping to a pager to work, we need to use shell=True. kwargs['shell'] = True return Popen(*args, **kwargs) class HelpCommand(object): """ HelpCommand Interface --------------------- A HelpCommand object acts as the interface between objects in the CLI (e.g. Providers, Services, Operations, etc.) and the documentation system (bcdoc). A HelpCommand object wraps the object from the CLI space and provides a consistent interface to critical information needed by the documentation pipeline such as the object's name, description, etc. The HelpCommand object is passed to the component of the documentation pipeline that fires documentation events. It is then passed on to each document event handler that has registered for the events. All HelpCommand objects contain the following attributes: + ``session`` - A ``botocore`` ``Session`` object. + ``obj`` - The object that is being documented. + ``command_table`` - A dict mapping command names to callable objects. + ``arg_table`` - A dict mapping argument names to callable objects. + ``doc`` - A ``Document`` object that is used to collect the generated documentation. In addition, please note the `properties` defined below which are required to allow the object to be used in the document pipeline. Implementations of HelpCommand are provided here for Provider, Service and Operation objects. Other implementations for other types of objects might be needed for customization in plugins. As long as the implementations conform to this basic interface it should be possible to pass them to the documentation system and generate interactive and static help files. """ EventHandlerClass = None """ Each subclass should define this class variable to point to the EventHandler class used by this HelpCommand. """ def __init__(self, session, obj, command_table, arg_table): self.session = session self.obj = obj if command_table is None: command_table = {} self.command_table = command_table if arg_table is None: arg_table = {} self.arg_table = arg_table self._subcommand_table = {} self._related_items = [] self.renderer = get_renderer() self.doc = ReSTDocument(target='man') @property def event_class(self): """ Return the ``event_class`` for this object. The ``event_class`` is used by the documentation pipeline when generating documentation events. For the event below:: doc-title.. The document pipeline would use this property to determine the ``event_class`` value. """ pass @property def name(self): """ Return the name of the wrapped object. This would be called by the document pipeline to determine the ``name`` to be inserted into the event, as shown above. """ pass @property def subcommand_table(self): """These are the commands that may follow after the help command""" return self._subcommand_table @property def related_items(self): """This is list of items that are related to the help command""" return self._related_items def __call__(self, args, parsed_globals): if args: subcommand_parser = ArgTableArgParser({}, self.subcommand_table) parsed, remaining = subcommand_parser.parse_known_args(args) if getattr(parsed, 'subcommand', None) is not None: return self.subcommand_table[parsed.subcommand](remaining, parsed_globals) # Create an event handler for a Provider Document instance = self.EventHandlerClass(self) # Now generate all of the events for a Provider document. # We pass ourselves along so that we can, in turn, get passed # to all event handlers. docevents.generate_events(self.session, self) self.renderer.render(self.doc.getvalue()) instance.unregister() class ProviderHelpCommand(HelpCommand): """Implements top level help command. This is what is called when ``aws help`` is run. """ EventHandlerClass = ProviderDocumentEventHandler def __init__(self, session, command_table, arg_table, description, synopsis, usage): HelpCommand.__init__(self, session, None, command_table, arg_table) self.description = description self.synopsis = synopsis self.help_usage = usage self._subcommand_table = None self._topic_tag_db = None self._related_items = ['aws help topics'] @property def event_class(self): return 'aws' @property def name(self): return 'aws' @property def subcommand_table(self): if self._subcommand_table is None: if self._topic_tag_db is None: self._topic_tag_db = TopicTagDB() self._topic_tag_db.load_json_index() self._subcommand_table = self._create_subcommand_table() return self._subcommand_table def _create_subcommand_table(self): subcommand_table = {} # Add the ``aws help topics`` command to the ``topic_table`` topic_lister_command = TopicListerCommand(self.session) subcommand_table['topics'] = topic_lister_command topic_names = self._topic_tag_db.get_all_topic_names() # Add all of the possible topics to the ``topic_table`` for topic_name in topic_names: topic_help_command = TopicHelpCommand(self.session, topic_name) subcommand_table[topic_name] = topic_help_command return subcommand_table class ServiceHelpCommand(HelpCommand): """Implements service level help. This is the object invoked whenever a service command help is implemented, e.g. ``aws ec2 help``. """ EventHandlerClass = ServiceDocumentEventHandler def __init__(self, session, obj, command_table, arg_table, name, event_class): super(ServiceHelpCommand, self).__init__(session, obj, command_table, arg_table) self._name = name self._event_class = event_class @property def event_class(self): return self._event_class @property def name(self): return self._name class OperationHelpCommand(HelpCommand): """Implements operation level help. This is the object invoked whenever help for a service is requested, e.g. ``aws ec2 describe-instances help``. """ EventHandlerClass = OperationDocumentEventHandler def __init__(self, session, operation_model, arg_table, name, event_class): HelpCommand.__init__(self, session, operation_model, None, arg_table) self.param_shorthand = ParamShorthandParser() self._name = name self._event_class = event_class @property def event_class(self): return self._event_class @property def name(self): return self._name class TopicListerCommand(HelpCommand): EventHandlerClass = TopicListerDocumentEventHandler def __init__(self, session): super(TopicListerCommand, self).__init__(session, None, {}, {}) @property def event_class(self): return 'topics' @property def name(self): return 'topics' class TopicHelpCommand(HelpCommand): EventHandlerClass = TopicDocumentEventHandler def __init__(self, session, topic_name): super(TopicHelpCommand, self).__init__(session, None, {}, {}) self._topic_name = topic_name @property def event_class(self): return 'topics.' + self.name @property def name(self): return self._topic_name awscli-1.14.44/awscli/text.py0000666454262600001440000001027413243367510017051 0ustar pysdk-ciamazon00000000000000# Copyright 2012-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.compat import six def format_text(data, stream): _format_text(data, stream) def _format_text(item, stream, identifier=None, scalar_keys=None): if isinstance(item, dict): _format_dict(scalar_keys, item, identifier, stream) elif isinstance(item, list): _format_list(item, identifier, stream) else: # If it's not a list or a dict, we just write the scalar # value out directly. stream.write(six.text_type(item)) stream.write('\n') def _format_list(item, identifier, stream): if not item: return if any(isinstance(el, dict) for el in item): all_keys = _all_scalar_keys(item) for element in item: _format_text(element, stream=stream, identifier=identifier, scalar_keys=all_keys) elif any(isinstance(el, list) for el in item): scalar_elements, non_scalars = _partition_list(item) if scalar_elements: _format_scalar_list(scalar_elements, identifier, stream) for non_scalar in non_scalars: _format_text(non_scalar, stream=stream, identifier=identifier) else: _format_scalar_list(item, identifier, stream) def _partition_list(item): scalars = [] non_scalars = [] for element in item: if isinstance(element, (list, dict)): non_scalars.append(element) else: scalars.append(element) return scalars, non_scalars def _format_scalar_list(elements, identifier, stream): if identifier is not None: for item in elements: stream.write('%s\t%s\n' % (identifier.upper(), item)) else: # For a bare list, just print the contents. stream.write('\t'.join([six.text_type(item) for item in elements])) stream.write('\n') def _format_dict(scalar_keys, item, identifier, stream): scalars, non_scalars = _partition_dict(item, scalar_keys=scalar_keys) if scalars: if identifier is not None: scalars.insert(0, identifier.upper()) stream.write('\t'.join(scalars)) stream.write('\n') for new_identifier, non_scalar in non_scalars: _format_text(item=non_scalar, stream=stream, identifier=new_identifier) def _all_scalar_keys(list_of_dicts): keys_seen = set() for item_dict in list_of_dicts: for key, value in item_dict.items(): if not isinstance(value, (dict, list)): keys_seen.add(key) return list(sorted(keys_seen)) def _partition_dict(item_dict, scalar_keys): # Given a dictionary, partition it into two list based on the # values associated with the keys. # {'foo': 'scalar', 'bar': 'scalar', 'baz': ['not, 'scalar']} # scalar = [('foo', 'scalar'), ('bar', 'scalar')] # non_scalar = [('baz', ['not', 'scalar'])] scalar = [] non_scalar = [] if scalar_keys is None: # scalar_keys can have more than just the keys in the item_dict, # but if user does not provide scalar_keys, we'll grab the keys # from the current item_dict for key, value in sorted(item_dict.items()): if isinstance(value, (dict, list)): non_scalar.append((key, value)) else: scalar.append(six.text_type(value)) else: for key in scalar_keys: scalar.append(six.text_type(item_dict.get(key, ''))) remaining_keys = sorted(set(item_dict.keys()) - set(scalar_keys)) for remaining_key in remaining_keys: non_scalar.append((remaining_key, item_dict[remaining_key])) return scalar, non_scalar awscli-1.14.44/awscli/argparser.py0000666454262600001440000001620313243367510020051 0ustar pysdk-ciamazon00000000000000# Copyright 2013 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 argparse import sys from awscli.compat import six from difflib import get_close_matches HELP_BLURB = ( "To see help text, you can run:\n" "\n" " aws help\n" " aws help\n" " aws help\n" ) USAGE = ( "aws [options] [ ...] [parameters]\n" "%s" % HELP_BLURB ) 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 # When displaying invalid choice error messages, # this controls how many options to show per line. ChoicesPerLine = 2 def _check_value(self, action, value): """ It's probably not a great idea to override a "hidden" method but the default behavior is pretty ugly and there doesn't seem to be any other way to change it. """ # converted value must be one of the choices (if specified) if action.choices is not None and value not in action.choices: msg = ['Invalid choice, valid choices are:\n'] for i in range(len(action.choices))[::self.ChoicesPerLine]: current = [] for choice in action.choices[i:i+self.ChoicesPerLine]: current.append('%-40s' % choice) msg.append(' | '.join(current)) possible = get_close_matches(value, action.choices, cutoff=0.8) if possible: extra = ['\n\nInvalid choice: %r, maybe you meant:\n' % value] for word in possible: extra.append(' * %s' % word) msg.extend(extra) raise argparse.ArgumentError(action, '\n'.join(msg)) def parse_known_args(self, args, namespace=None): parsed, remaining = super(CLIArgParser, self).parse_known_args(args, namespace) terminal_encoding = getattr(sys.stdin, 'encoding', 'utf-8') if terminal_encoding is None: # In some cases, sys.stdin won't have an encoding set, # (e.g if it's set to a StringIO). In this case we just # default to utf-8. terminal_encoding = 'utf-8' for arg, value in vars(parsed).items(): if isinstance(value, six.binary_type): setattr(parsed, arg, value.decode(terminal_encoding)) elif isinstance(value, list): encoded = [] for v in value: if isinstance(v, six.binary_type): encoded.append(v.decode(terminal_encoding)) else: encoded.append(v) setattr(parsed, arg, encoded) return parsed, remaining class MainArgParser(CLIArgParser): Formatter = argparse.RawTextHelpFormatter def __init__(self, command_table, version_string, description, argument_table, prog=None): super(MainArgParser, self).__init__( formatter_class=self.Formatter, add_help=False, conflict_handler='resolve', description=description, usage=USAGE, prog=prog) self._build(command_table, version_string, argument_table) def _create_choice_help(self, choices): help_str = '' for choice in sorted(choices): help_str += '* %s\n' % choice return help_str def _build(self, command_table, version_string, argument_table): for argument_name in argument_table: argument = argument_table[argument_name] argument.add_to_parser(self) self.add_argument('--version', action="version", version=version_string, help='Display the version of this tool') self.add_argument('command', action=CommandAction, command_table=command_table) class ServiceArgParser(CLIArgParser): def __init__(self, operations_table, service_name): super(ServiceArgParser, self).__init__( formatter_class=argparse.RawTextHelpFormatter, add_help=False, conflict_handler='resolve', usage=USAGE) self._build(operations_table) self._service_name = service_name def _build(self, operations_table): self.add_argument('operation', action=CommandAction, command_table=operations_table) class ArgTableArgParser(CLIArgParser): """CLI arg parser based on an argument table.""" def __init__(self, argument_table, command_table=None): # command_table is an optional subcommand_table. If it's passed # in, then we'll update the argparse to parse a 'subcommand' argument # and populate the choices field with the command table keys. super(ArgTableArgParser, self).__init__( formatter_class=self.Formatter, add_help=False, usage=USAGE, conflict_handler='resolve') if command_table is None: command_table = {} self._build(argument_table, command_table) def _build(self, argument_table, command_table): for arg_name in argument_table: argument = argument_table[arg_name] argument.add_to_parser(self) if command_table: 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': namespace = argparse.Namespace() namespace.help = 'help' return namespace, [] else: return super(ArgTableArgParser, self).parse_known_args( args, namespace) awscli-1.14.44/awscli/shorthand.py0000666454262600001440000003452013243367510020057 0ustar pysdk-ciamazon00000000000000# 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. """Module for parsing shorthand syntax. This module parses any CLI options that use a "shorthand" syntax:: --foo A=b,C=d |------| | Shorthand syntax This module provides two main classes to do this. First, there's a ``ShorthandParser`` class. This class works on a purely syntactic level. It looks only at the string value provided to it in order to figure out how the string should be parsed. However, because there was a pre-existing shorthand parser, we need to remain backwards compatible with the previous parser. One of the things the previous parser did was use the associated JSON model to control how the expression was parsed. In order to accommodate this a post processing class is provided that takes the parsed values from the ``ShorthandParser`` as well as the corresponding JSON model for the CLI argument and makes any adjustments necessary to maintain backwards compatibility. This is done in the ``BackCompatVisitor`` class. """ import re import string _EOF = object() class _NamedRegex(object): def __init__(self, name, regex_str): self.name = name self.regex = re.compile(regex_str, re.UNICODE) def match(self, value): return self.regex.match(value) class ShorthandParseError(Exception): def __init__(self, value, expected, actual, index): self.value = value self.expected = expected self.actual = actual self.index = index msg = self._construct_msg() super(ShorthandParseError, self).__init__(msg) def _construct_msg(self): consumed, remaining, num_spaces = self.value, '', self.index if '\n' in self.value[:self.index]: # If there's newlines in the consumed expression, we want # to make sure we're only counting the spaces # from the last newline: # foo=bar,\n # bar==baz # ^ last_newline = self.value[:self.index].rindex('\n') num_spaces = self.index - last_newline - 1 if '\n' in self.value[self.index:]: # If there's newline in the remaining, divide value # into consumed and remainig # foo==bar,\n # ^ # bar=baz next_newline = self.index + self.value[self.index:].index('\n') consumed = self.value[:next_newline] remaining = self.value[next_newline:] msg = ( "Expected: '%s', received: '%s' for input:\n" "%s\n" "%s" "%s" ) % (self.expected, self.actual, consumed, ' ' * num_spaces + '^', remaining) return msg class ShorthandParser(object): """Parses shorthand syntax in the CLI. Note that this parser does not rely on any JSON models to control how to parse the shorthand syntax. """ _SINGLE_QUOTED = _NamedRegex('singled quoted', r'\'(?:\\\\|\\\'|[^\'])*\'') _DOUBLE_QUOTED = _NamedRegex('double quoted', r'"(?:\\\\|\\"|[^"])*"') _START_WORD = u'\!\#-&\(-\+\--\<\>-Z\\\\-z\u007c-\uffff' _FIRST_FOLLOW_CHARS = u'\s\!\#-&\(-\+\--\\\\\^-\|~-\uffff' _SECOND_FOLLOW_CHARS = u'\s\!\#-&\(-\+\--\<\>-\uffff' _ESCAPED_COMMA = '(\\\\,)' _FIRST_VALUE = _NamedRegex( 'first', u'({escaped_comma}|[{start_word}])' u'({escaped_comma}|[{follow_chars}])*'.format( escaped_comma=_ESCAPED_COMMA, start_word=_START_WORD, follow_chars=_FIRST_FOLLOW_CHARS, )) _SECOND_VALUE = _NamedRegex( 'second', u'({escaped_comma}|[{start_word}])' u'({escaped_comma}|[{follow_chars}])*'.format( escaped_comma=_ESCAPED_COMMA, start_word=_START_WORD, follow_chars=_SECOND_FOLLOW_CHARS, )) def __init__(self): self._tokens = [] def parse(self, value): """Parse shorthand syntax. For example:: parser = ShorthandParser() parser.parse('a=b') # {'a': 'b'} parser.parse('a=b,c') # {'a': ['b', 'c']} :tpye value: str :param value: Any value that needs to be parsed. :return: Parsed value, which will be a dictionary. """ self._input_value = value self._index = 0 return self._parameter() def _parameter(self): # parameter = keyval *("," keyval) params = {} params.update(self._keyval()) while self._index < len(self._input_value): self._expect(',', consume_whitespace=True) params.update(self._keyval()) return params def _keyval(self): # keyval = key "=" [values] key = self._key() self._expect('=', consume_whitespace=True) values = self._values() return {key: values} def _key(self): # key = 1*(alpha / %x30-39 / %x5f / %x2e / %x23) ; [a-zA-Z0-9\-_.#] valid_chars = string.ascii_letters + string.digits + '-_.#' start = self._index while not self._at_eof(): if self._current() not in valid_chars: break self._index += 1 return self._input_value[start:self._index] def _values(self): # values = csv-list / explicit-list / hash-literal if self._at_eof(): return '' elif self._current() == '[': return self._explicit_list() elif self._current() == '{': return self._hash_literal() else: return self._csv_value() def _csv_value(self): # Supports either: # foo=bar -> 'bar' # ^ # foo=bar,baz -> ['bar', 'baz'] # ^ first_value = self._first_value() self._consume_whitespace() if self._at_eof() or self._input_value[self._index] != ',': return first_value self._expect(',', consume_whitespace=True) csv_list = [first_value] # Try to parse remaining list values. # It's possible we don't parse anything: # a=b,c=d # ^-here # In the case above, we'll hit the ShorthandParser, # backtrack to the comma, and return a single scalar # value 'b'. while True: try: current = self._second_value() self._consume_whitespace() if self._at_eof(): csv_list.append(current) break self._expect(',', consume_whitespace=True) csv_list.append(current) except ShorthandParseError: # Backtrack to the previous comma. # This can happen when we reach this case: # foo=a,b,c=d,e=f # ^-start # foo=a,b,c=d,e=f # ^-error, "expected ',' received '=' # foo=a,b,c=d,e=f # ^-backtrack to here. if self._at_eof(): raise self._backtrack_to(',') break if len(csv_list) == 1: # Then this was a foo=bar case, so we expect # this to parse to a scalar value 'bar', i.e # {"foo": "bar"} instead of {"bar": ["bar"]} return first_value return csv_list def _value(self): result = self._FIRST_VALUE.match(self._input_value[self._index:]) if result is not None: consumed = self._consume_matched_regex(result) return consumed.replace('\\,', ',').rstrip() return '' def _explicit_list(self): # explicit-list = "[" [value *(",' value)] "]" self._expect('[', consume_whitespace=True) values = [] while self._current() != ']': val = self._explicit_values() values.append(val) self._consume_whitespace() if self._current() != ']': self._expect(',') self._consume_whitespace() self._expect(']') return values def _explicit_values(self): # values = csv-list / explicit-list / hash-literal if self._current() == '[': return self._explicit_list() elif self._current() == '{': return self._hash_literal() else: return self._first_value() def _hash_literal(self): self._expect('{', consume_whitespace=True) keyvals = {} while self._current() != '}': key = self._key() self._expect('=', consume_whitespace=True) v = self._explicit_values() self._consume_whitespace() if self._current() != '}': self._expect(',') self._consume_whitespace() keyvals[key] = v self._expect('}') return keyvals def _first_value(self): # first-value = value / single-quoted-val / double-quoted-val if self._current() == "'": return self._single_quoted_value() elif self._current() == '"': return self._double_quoted_value() return self._value() def _single_quoted_value(self): # single-quoted-value = %x27 *(val-escaped-single) %x27 # val-escaped-single = %x20-26 / %x28-7F / escaped-escape / # (escape single-quote) return self._consume_quoted(self._SINGLE_QUOTED, escaped_char="'") def _consume_quoted(self, regex, escaped_char=None): value = self._must_consume_regex(regex)[1:-1] if escaped_char is not None: value = value.replace("\\%s" % escaped_char, escaped_char) value = value.replace("\\\\", "\\") return value def _double_quoted_value(self): return self._consume_quoted(self._DOUBLE_QUOTED, escaped_char='"') def _second_value(self): if self._current() == "'": return self._single_quoted_value() elif self._current() == '"': return self._double_quoted_value() else: consumed = self._must_consume_regex(self._SECOND_VALUE) return consumed.replace('\\,', ',').rstrip() def _expect(self, char, consume_whitespace=False): if consume_whitespace: self._consume_whitespace() if self._index >= len(self._input_value): raise ShorthandParseError(self._input_value, char, 'EOF', self._index) actual = self._input_value[self._index] if actual != char: raise ShorthandParseError(self._input_value, char, actual, self._index) self._index += 1 if consume_whitespace: self._consume_whitespace() def _must_consume_regex(self, regex): result = regex.match(self._input_value[self._index:]) if result is not None: return self._consume_matched_regex(result) raise ShorthandParseError(self._input_value, '<%s>' % regex.name, '', self._index) def _consume_matched_regex(self, result): start, end = result.span() v = self._input_value[self._index+start:self._index+end] self._index += (end - start) return v def _current(self): # If the index is at the end of the input value, # then _EOF will be returned. if self._index < len(self._input_value): return self._input_value[self._index] return _EOF def _at_eof(self): return self._index >= len(self._input_value) def _backtrack_to(self, char): while self._index >= 0 and self._input_value[self._index] != char: self._index -= 1 def _consume_whitespace(self): while self._current() != _EOF and self._current() in string.whitespace: self._index += 1 class ModelVisitor(object): def visit(self, params, model): self._visit({}, model, '', params) def _visit(self, parent, shape, name, value): method = getattr(self, '_visit_%s' % shape.type_name, self._visit_scalar) method(parent, shape, name, value) def _visit_structure(self, parent, shape, name, value): if not isinstance(value, dict): return for member_name, member_shape in shape.members.items(): self._visit(value, member_shape, member_name, value.get(member_name)) def _visit_list(self, parent, shape, name, value): if not isinstance(value, list): return for i, element in enumerate(value): self._visit(value, shape.member, i, element) def _visit_map(self, parent, shape, name, value): if not isinstance(value, dict): return value_shape = shape.value for k, v in value.items(): self._visit(value, value_shape, k, v) def _visit_scalar(self, parent, shape, name, value): pass class BackCompatVisitor(ModelVisitor): def _visit_list(self, parent, shape, name, value): if not isinstance(value, list): # Convert a -> [a] because they specified # "foo=bar", but "bar" should really be ["bar"]. if value is not None: parent[name] = [value] else: return super(BackCompatVisitor, self)._visit_list( parent, shape, name, value) def _visit_scalar(self, parent, shape, name, value): if value is None: return type_name = shape.type_name if type_name in ['integer', 'long']: parent[name] = int(value) elif type_name in ['double', 'float']: parent[name] = float(value) elif type_name == 'boolean': # We want to make sure we only set a value # only if "true"/"false" is specified. if value.lower() == 'true': parent[name] = True elif value.lower() == 'false': parent[name] = False awscli-1.14.44/awscli/clidocs.py0000666454262600001440000007064713243367510017517 0ustar pysdk-ciamazon00000000000000# Copyright 2012-2013 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 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 from awscli.topictags import TopicTagDB from awscli.utils import find_service_and_method_in_event_name LOG = logging.getLogger(__name__) class CLIDocumentEventHandler(object): 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 = [] def _build_arg_table_groups(self, help_command): arg_groups = {} for name, arg in help_command.arg_table.items(): if arg.group_name is not None: 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: event_handler_name = event.replace('-', '_') if hasattr(self, event_handler_name): event_handler = getattr(self, event_handler_name) format_string = DOC_EVENTS[event] num_args = len(format_string.split('.')) - 2 format_args = (event_class,) + ('*',) * num_args event_string = event + format_string % format_args unique_id = event_class + event_handler_name mapfn(event_string, event_handler, unique_id) def register(self, session, event_class): """ The default register iterates through all of the available document events and looks for a corresponding handler method defined in the object. If it's there, that handler method will be registered for the all events of that type for the specified ``event_class``. """ self._map_handlers(session, event_class, session.register) def unregister(self): """ The default unregister iterates through all of the available document events and looks for a corresponding handler method defined in the object. If it's there, that handler method will be unregistered for the all events of that type for the specified ``event_class``. """ self._map_handlers(self.help_command.session, self.help_command.event_class, self.help_command.session.unregister) # These are default doc handlers that apply in the general case. def doc_breadcrumbs(self, help_command, **kwargs): doc = help_command.doc if doc.target != 'man': cmd_names = help_command.event_class.split('.') doc.write('[ ') doc.write(':ref:`aws `') full_cmd_list = ['aws'] for cmd in cmd_names[:-1]: doc.write(' . ') full_cmd_list.append(cmd) full_cmd_name = ' '.join(full_cmd_list) doc.write(':ref:`%s `' % (cmd, full_cmd_name)) doc.write(' ]') def doc_title(self, help_command, **kwargs): doc = help_command.doc doc.style.new_paragraph() reference = help_command.event_class.replace('.', ' ') if reference != 'aws': reference = 'aws ' + reference doc.writeln('.. _cli:%s:' % reference) doc.style.h1(help_command.name) def doc_description(self, help_command, **kwargs): doc = help_command.doc doc.style.h2('Description') doc.include_doc_string(help_command.description) doc.style.new_paragraph() def doc_synopsis_start(self, help_command, **kwargs): self._documented_arg_groups = [] doc = help_command.doc doc.style.h2('Synopsis') doc.style.start_codeblock() doc.writeln('%s' % help_command.name) def doc_synopsis_option(self, arg_name, help_command, **kwargs): doc = help_command.doc argument = help_command.arg_table[arg_name] if argument.group_name in self._arg_groups: if argument.group_name in self._documented_arg_groups: # This arg is already documented so we can move on. return option_str = ' | '.join( [a.cli_name for a in self._arg_groups[argument.group_name]]) self._documented_arg_groups.append(argument.group_name) else: option_str = '%s ' % argument.cli_name if not (argument.required or getattr(argument, '_DOCUMENT_AS_REQUIRED', False)): option_str = '[%s]' % option_str doc.writeln('%s' % option_str) def doc_synopsis_end(self, help_command, **kwargs): doc = help_command.doc doc.style.end_codeblock() # Reset the documented arg groups for other sections # that may document args (the detailed docs following # the synopsis). self._documented_arg_groups = [] def doc_options_start(self, help_command, **kwargs): doc = help_command.doc doc.style.h2('Options') if not help_command.arg_table: doc.write('*None*\n') def doc_option(self, arg_name, help_command, **kwargs): doc = help_command.doc argument = help_command.arg_table[arg_name] if argument.group_name in self._arg_groups: if argument.group_name in self._documented_arg_groups: # This arg is already documented so we can move on. return name = ' | '.join( ['``%s``' % a.cli_name for a in self._arg_groups[argument.group_name]]) self._documented_arg_groups.append(argument.group_name) else: name = '``%s``' % argument.cli_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) doc.style.dedent() doc.style.new_paragraph() def doc_relateditems_start(self, help_command, **kwargs): if help_command.related_items: doc = help_command.doc doc.style.h2('See Also') def doc_relateditem(self, help_command, related_item, **kwargs): doc = help_command.doc doc.write('* ') doc.style.sphinx_reference_label( label='cli:%s' % related_item, text=related_item ) doc.write('\n') def _document_enums(self, argument, doc): """Documents top-level parameter enums""" if hasattr(argument, 'argument_model'): model = argument.argument_model if isinstance(model, StringShape): if model.enum: doc.style.new_paragraph() doc.write('Possible values:') doc.style.start_ul() for enum in model.enum: doc.style.li('``%s``' % enum) doc.style.end_ul() class ProviderDocumentEventHandler(CLIDocumentEventHandler): def doc_breadcrumbs(self, help_command, event_name, **kwargs): pass def doc_synopsis_start(self, help_command, **kwargs): doc = help_command.doc doc.style.h2('Synopsis') doc.style.codeblock(help_command.synopsis) doc.include_doc_string(help_command.help_usage) def doc_synopsis_option(self, arg_name, help_command, **kwargs): pass def doc_synopsis_end(self, help_command, **kwargs): doc = help_command.doc doc.style.new_paragraph() def doc_options_start(self, help_command, **kwargs): doc = help_command.doc doc.style.h2('Options') def doc_option(self, arg_name, help_command, **kwargs): doc = help_command.doc argument = help_command.arg_table[arg_name] doc.writeln('``%s`` (%s)' % (argument.cli_name, argument.cli_type_name)) doc.include_doc_string(argument.documentation) if argument.choices: doc.style.start_ul() for choice in argument.choices: doc.style.li(choice) doc.style.end_ul() def doc_subitems_start(self, help_command, **kwargs): doc = help_command.doc doc.style.h2('Available Services') doc.style.toctree() def doc_subitem(self, command_name, help_command, **kwargs): doc = help_command.doc file_name = '%s/index' % command_name doc.style.tocitem(command_name, file_name=file_name) 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 def doc_synopsis_option(self, arg_name, help_command, **kwargs): pass def doc_synopsis_end(self, help_command, **kwargs): pass # A service document has no option section. def doc_options_start(self, help_command, **kwargs): pass def doc_option(self, arg_name, help_command, **kwargs): pass def doc_option_example(self, arg_name, help_command, **kwargs): pass def doc_options_end(self, help_command, **kwargs): pass def doc_description(self, help_command, **kwargs): doc = help_command.doc service_model = help_command.obj doc.style.h2('Description') # TODO: need a documentation attribute. doc.include_doc_string(service_model.documentation) def doc_subitems_start(self, help_command, **kwargs): doc = help_command.doc doc.style.h2('Available Commands') doc.style.toctree() def doc_subitem(self, command_name, help_command, **kwargs): doc = help_command.doc subcommand = help_command.command_table[command_name] subcommand_table = getattr(subcommand, 'subcommand_table', {}) # If the subcommand table has commands in it, # direct the subitem to the command's index because # it has more subcommands to be documented. if (len(subcommand_table) > 0): file_name = '%s/index' % command_name doc.style.tocitem(command_name, file_name=file_name) else: doc.style.tocitem(command_name) class OperationDocumentEventHandler(CLIDocumentEventHandler): AWS_DOC_BASE = 'https://docs.aws.amazon.com/goto/WebAPI' 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 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 # are included as the sample JSON value. if isinstance(argument_model, StringShape): if argument_model.enum and include_enum_values: choices = argument_model.enum return '|'.join(['"%s"' % c for c in choices]) else: return '"string"' elif argument_model.type_name == 'boolean': return 'true|false' else: return '%s' % argument_model.type_name def _json_example(self, doc, argument_model, stack): if argument_model.name in stack: # Document the recursion once, otherwise just # note the fact that it's recursive and return. if stack.count(argument_model.name) > 1: if argument_model.type_name == 'structure': doc.write('{ ... recursive ... }') return stack.append(argument_model.name) try: self._do_json_example(doc, argument_model, stack) finally: stack.pop() def _do_json_example(self, doc, argument_model, stack): if argument_model.type_name == 'list': doc.write('[') if argument_model.member.type_name in SCALAR_TYPES: doc.write('%s, ...' % self._json_example_value_name(argument_model.member)) else: doc.style.indent() doc.style.new_line() self._json_example(doc, argument_model.member, stack) doc.style.new_line() doc.write('...') doc.style.dedent() doc.style.new_line() doc.write(']') elif argument_model.type_name == 'map': doc.write('{') doc.style.indent() key_string = self._json_example_value_name(argument_model.key) doc.write('%s: ' % key_string) if argument_model.value.type_name in SCALAR_TYPES: doc.write(self._json_example_value_name(argument_model.value)) else: doc.style.indent() self._json_example(doc, argument_model.value, stack) doc.style.dedent() doc.style.new_line() doc.write('...') doc.style.dedent() doc.write('}') elif argument_model.type_name == 'structure': 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] member_type_name = member_model.type_name if member_type_name in SCALAR_TYPES: doc.write('"%s": %s' % (member_name, self._json_example_value_name(member_model))) elif member_type_name == 'structure': doc.write('"%s": ' % member_name) self._json_example(doc, member_model, stack) elif member_type_name == 'map': doc.write('"%s": ' % member_name) self._json_example(doc, member_model, stack) elif member_type_name == 'list': doc.write('"%s": ' % member_name) self._json_example(doc, member_model, stack) if i < len(members) - 1: doc.write(',') 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 = \ find_service_and_method_in_event_name(event_name) doc = help_command.doc cli_argument = help_command.arg_table[arg_name] if cli_argument.group_name in self._arg_groups: if cli_argument.group_name in self._documented_arg_groups: # Args with group_names (boolean args) don't # need to generate example syntax. return argument_model = cli_argument.argument_model docgen = ParamShorthandDocGen() if docgen.supports_shorthand(cli_argument.argument_model): example_shorthand_syntax = docgen.generate_shorthand_example( cli_argument, service_name, 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 # needed for this param so we can immediately # return. return if example_shorthand_syntax: doc.style.new_paragraph() doc.write('Shorthand Syntax') doc.style.start_codeblock() for example_line in example_shorthand_syntax.splitlines(): doc.writeln(example_line) doc.style.end_codeblock() if argument_model is not None and argument_model.type_name == 'list' and \ argument_model.member.type_name in SCALAR_TYPES: # A list of scalars is special. While you *can* use # JSON ( ["foo", "bar", "baz"] ), you can also just # use the argparse behavior of space separated lists. # "foo" "bar" "baz". In fact we don't even want to # document the JSON syntax in this case. member = argument_model.member doc.style.new_paragraph() doc.write('Syntax') doc.style.start_codeblock() example_type = self._json_example_value_name( member, include_enum_values=False) doc.write('%s %s ...' % (example_type, example_type)) if isinstance(member, StringShape) and member.enum: # If we have enum values, we can tell the user # exactly what valid values they can provide. self._write_valid_enums(doc, member.enum) doc.style.end_codeblock() doc.style.new_paragraph() elif cli_argument.cli_type_name not in SCALAR_TYPES: doc.style.new_paragraph() doc.write('JSON Syntax') doc.style.start_codeblock() self._json_example(doc, argument_model, stack=[]) doc.style.end_codeblock() doc.style.new_paragraph() def _write_valid_enums(self, doc, enum_values): doc.style.new_paragraph() doc.write("Where valid values are:\n") for value in enum_values: doc.write(" %s\n" % value) doc.write("\n") def doc_output(self, help_command, event_name, **kwargs): doc = help_command.doc doc.style.h2('Output') operation_model = help_command.obj output_shape = operation_model.output_shape if output_shape is None: doc.write('None') else: for member_name, member_shape in output_shape.members.items(): self._doc_member_for_output(doc, member_name, member_shape, stack=[]) def _doc_member_for_output(self, doc, member_name, member_shape, stack): if member_shape.name in stack: # Document the recursion once, otherwise just # note the fact that it's recursive and return. if stack.count(member_shape.name) > 1: if member_shape.type_name == 'structure': doc.write('( ... recursive ... )') return stack.append(member_shape.name) try: self._do_doc_member_for_output(doc, member_name, member_shape, stack) finally: stack.pop() 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, self._get_argument_type_name( member_shape, member_shape.type_name))) else: doc.write('(%s)' % member_shape.type_name) doc.style.indent() doc.style.new_paragraph() doc.include_doc_string(docs) doc.style.new_paragraph() member_type_name = member_shape.type_name if member_type_name == 'structure': for sub_name, sub_shape in member_shape.members.items(): self._doc_member_for_output(doc, sub_name, sub_shape, stack) elif member_type_name == 'map': key_shape = member_shape.key key_name = key_shape.serialization.get('name', 'key') self._doc_member_for_output(doc, key_name, key_shape, stack) value_shape = member_shape.value value_name = value_shape.serialization.get('name', 'value') self._doc_member_for_output(doc, value_name, value_shape, stack) elif member_type_name == 'list': self._doc_member_for_output(doc, '', member_shape.member, stack) 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 = ( 'This is the AWS CLI Topic Guide. It gives access to a set ' 'of topics that provide a deeper understanding of the CLI. To access ' 'the list of topics from the command line, run ``aws help topics``. ' 'To access a specific topic from the command line, run ' '``aws help [topicname]``, where ``topicname`` is the name of the ' 'topic as it appears in the output from ``aws help topics``.') 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() def doc_breadcrumbs(self, help_command, **kwargs): doc = help_command.doc if doc.target != 'man': doc.write('[ ') doc.style.sphinx_reference_label(label='cli:aws', text='aws') doc.write(' ]') def doc_title(self, help_command, **kwargs): doc = help_command.doc doc.style.new_paragraph() doc.style.link_target_definition( refname='cli:aws help %s' % self.help_command.name, link='') doc.style.h1('AWS CLI Topic Guide') def doc_description(self, help_command, **kwargs): doc = help_command.doc doc.style.h2('Description') doc.include_doc_string(self.DESCRIPTION) doc.style.new_paragraph() def doc_synopsis_start(self, help_command, **kwargs): pass def doc_synopsis_end(self, help_command, **kwargs): pass def doc_options_start(self, help_command, **kwargs): pass def doc_options_end(self, help_command, **kwargs): pass def doc_subitems_start(self, help_command, **kwargs): doc = help_command.doc doc.style.h2('Available Topics') categories = self._topic_tag_db.query('category') topic_names = self._topic_tag_db.get_all_topic_names() # Sort the categories category_names = sorted(categories.keys()) for category_name in category_names: doc.style.h3(category_name) doc.style.new_paragraph() # Write out the topic and a description for each topic under # each category. for topic_name in sorted(categories[category_name]): description = self._topic_tag_db.get_tag_single_value( topic_name, 'description') doc.write('* ') doc.style.sphinx_reference_label( label='cli:aws help %s' % topic_name, text=topic_name ) doc.write(': %s\n' % description) # Add a hidden toctree to make sure everything is connected in # the document. doc.style.hidden_toctree() for topic_name in topic_names: doc.style.hidden_tocitem(topic_name) class TopicDocumentEventHandler(TopicListerDocumentEventHandler): def doc_breadcrumbs(self, help_command, **kwargs): doc = help_command.doc if doc.target != 'man': doc.write('[ ') doc.style.sphinx_reference_label(label='cli:aws', text='aws') doc.write(' . ') doc.style.sphinx_reference_label( label='cli:aws help topics', text='topics' ) doc.write(' ]') def doc_title(self, help_command, **kwargs): doc = help_command.doc doc.style.new_paragraph() doc.style.link_target_definition( refname='cli:aws help %s' % self.help_command.name, link='') title = self._topic_tag_db.get_tag_single_value( help_command.name, 'title') doc.style.h1(title) def doc_description(self, help_command, **kwargs): doc = help_command.doc topic_filename = os.path.join(self._topic_tag_db.topic_dir, help_command.name + '.rst') contents = self._remove_tags_from_content(topic_filename) doc.writeln(contents) doc.style.new_paragraph() def _remove_tags_from_content(self, filename): with open(filename, 'r') as f: lines = f.readlines() content_begin_index = 0 for i, line in enumerate(lines): # If a line is encountered that does not begin with the tag # end the search for tags and mark where tags end. if not self._line_has_tag(line): content_begin_index = i break # Join all of the non-tagged lines back together. return ''.join(lines[content_begin_index:]) def _line_has_tag(self, line): for tag in self._topic_tag_db.valid_tags: if line.startswith(':' + tag + ':'): return True return False def doc_subitems_start(self, help_command, **kwargs): pass awscli-1.14.44/awscli/table.py0000666454262600001440000003573713243367510017167 0ustar pysdk-ciamazon00000000000000# Copyright 2012-2013 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 struct import unicodedata import colorama from awscli.utils import is_a_tty from awscli.compat import six def get_text_length(text): # `len(unichar)` measures the number of characters, so we use # `unicodedata.east_asian_width` to measure the length of characters. # Following responses are considered to be full-width length. # * A(Ambiguous) # * F(Fullwidth) # * W(Wide) text = six.text_type(text) return sum(2 if unicodedata.east_asian_width(char) in 'WFA' else 1 for char in text) def determine_terminal_width(default_width=80): # If we can't detect the terminal width, the default_width is returned. try: from termios import TIOCGWINSZ from fcntl import ioctl except ImportError: return default_width try: height, width = struct.unpack('hhhh', ioctl(sys.stdout, TIOCGWINSZ, '\000' * 8))[0:2] except Exception: return default_width else: return width def center_text(text, length=80, left_edge='|', right_edge='|', text_length=None): """Center text with specified edge chars. You can pass in the length of the text as an arg, otherwise it is computed automatically for you. This can allow you to center a string not based on it's literal length (useful if you're using ANSI codes). """ # postcondition: get_text_length(returned_text) == length if text_length is None: text_length = get_text_length(text) output = [] char_start = (length // 2) - (text_length // 2) - 1 output.append(left_edge + ' ' * char_start + text) length_so_far = get_text_length(left_edge) + char_start + text_length right_side_spaces = length - get_text_length(right_edge) - length_so_far output.append(' ' * right_side_spaces) output.append(right_edge) final = ''.join(output) return final def align_left(text, length, left_edge='|', right_edge='|', text_length=None, left_padding=2): """Left align text.""" # postcondition: get_text_length(returned_text) == length if text_length is None: text_length = get_text_length(text) computed_length = ( text_length + left_padding + \ get_text_length(left_edge) + get_text_length(right_edge)) if length - computed_length >= 0: padding = left_padding else: padding = 0 output = [] length_so_far = 0 output.append(left_edge) length_so_far += len(left_edge) output.append(' ' * padding) length_so_far += padding output.append(text) length_so_far += text_length output.append(' ' * (length - length_so_far - len(right_edge))) output.append(right_edge) return ''.join(output) def convert_to_vertical_table(sections): # Any section that only has a single row is # inverted, so: # header1 | header2 | header3 # val1 | val2 | val2 # # becomes: # # header1 | val1 # header2 | val2 # header3 | val3 for i, section in enumerate(sections): if len(section.rows) == 1 and section.headers: headers = section.headers new_section = Section() new_section.title = section.title new_section.indent_level = section.indent_level for header, element in zip(headers, section.rows[0]): new_section.add_row([header, element]) sections[i] = new_section class IndentedStream(object): def __init__(self, stream, indent_level, left_indent_char='|', right_indent_char='|'): self._stream = stream self._indent_level = indent_level self._left_indent_char = left_indent_char self._right_indent_char = right_indent_char def write(self, text): self._stream.write(self._left_indent_char * self._indent_level) if text.endswith('\n'): self._stream.write(text[:-1]) self._stream.write(self._right_indent_char * self._indent_level) self._stream.write('\n') else: self._stream.write(text) def __getattr__(self, attr): return getattr(self._stream, attr) class Styler(object): def style_title(self, text): return text def style_header_column(self, text): return text def style_row_element(self, text): return text def style_indentation_char(self, text): return text class ColorizedStyler(Styler): def __init__(self): # `autoreset` allows us to not have to sent reset sequences for every # string. `strip` lets us preserve color when redirecting. colorama.init(autoreset=True, strip=False) def style_title(self, text): # Originally bold + underline return text #return colorama.Style.BOLD + text + colorama.Style.RESET_ALL def style_header_column(self, text): # Originally underline return text def style_row_element(self, text): return (colorama.Style.BRIGHT + colorama.Fore.BLUE + text + colorama.Style.RESET_ALL) def style_indentation_char(self, text): return (colorama.Style.DIM + colorama.Fore.YELLOW + text + colorama.Style.RESET_ALL) class MultiTable(object): def __init__(self, terminal_width=None, initial_section=True, column_separator='|', terminal=None, styler=None, auto_reformat=True): self._auto_reformat = auto_reformat if initial_section: self._current_section = Section() self._sections = [self._current_section] else: self._current_section = None self._sections = [] if styler is None: # Move out to factory. if is_a_tty(): self._styler = ColorizedStyler() else: self._styler = Styler() else: self._styler = styler self._rendering_index = 0 self._column_separator = column_separator if terminal_width is None: self._terminal_width = determine_terminal_width() def add_title(self, title): self._current_section.add_title(title) def add_row_header(self, headers): self._current_section.add_header(headers) def add_row(self, row_elements): self._current_section.add_row(row_elements) def new_section(self, title, indent_level=0): self._current_section = Section() self._sections.append(self._current_section) self._current_section.add_title(title) self._current_section.indent_level = indent_level def render(self, stream): max_width = self._calculate_max_width() should_convert_table = self._determine_conversion_needed(max_width) if should_convert_table: convert_to_vertical_table(self._sections) max_width = self._calculate_max_width() stream.write('-' * max_width + '\n') for section in self._sections: self._render_section(section, max_width, stream) def _determine_conversion_needed(self, max_width): # If we don't know the width of the controlling terminal, # then we don't try to resize the table. if max_width > self._terminal_width: return self._auto_reformat def _calculate_max_width(self): max_width = max(s.total_width(padding=4, with_border=True, outer_padding=s.indent_level) for s in self._sections) return max_width def _render_section(self, section, max_width, stream): stream = IndentedStream(stream, section.indent_level, self._styler.style_indentation_char('|'), self._styler.style_indentation_char('|')) max_width -= (section.indent_level * 2) self._render_title(section, max_width, stream) self._render_column_titles(section, max_width, stream) self._render_rows(section, max_width, stream) def _render_title(self, section, max_width, stream): # The title consists of: # title : | This is the title | # bottom_border: ---------------------------- if section.title: title = self._styler.style_title(section.title) stream.write(center_text(title, max_width, '|', '|', get_text_length(section.title)) + '\n') if not section.headers and not section.rows: stream.write('+%s+' % ('-' * (max_width - 2)) + '\n') def _render_column_titles(self, section, max_width, stream): if not section.headers: return # In order to render the column titles we need to know # the width of each of the columns. widths = section.calculate_column_widths(padding=4, max_width=max_width) # TODO: Built a list instead of +=, it's more efficient. current = '' length_so_far = 0 # The first cell needs both left and right edges '| foo |' # while subsequent cells only need right edges ' foo |'. first = True for width, header in zip(widths, section.headers): stylized_header = self._styler.style_header_column(header) if first: left_edge = '|' first = False else: left_edge = '' current += center_text(text=stylized_header, length=width, left_edge=left_edge, right_edge='|', text_length=get_text_length(header)) length_so_far += width self._write_line_break(stream, widths) stream.write(current + '\n') def _write_line_break(self, stream, widths): # Write out something like: # +-------+---------+---------+ parts = [] first = True for width in widths: if first: parts.append('+%s+' % ('-' * (width - 2))) first = False else: parts.append('%s+' % ('-' * (width - 1))) parts.append('\n') stream.write(''.join(parts)) def _render_rows(self, section, max_width, stream): if not section.rows: return widths = section.calculate_column_widths(padding=4, max_width=max_width) if not widths: return self._write_line_break(stream, widths) for row in section.rows: # TODO: Built the string in a list then join instead of using +=, # it's more efficient. current = '' length_so_far = 0 first = True for width, element in zip(widths, row): if first: left_edge = '|' first = False else: left_edge = '' stylized = self._styler.style_row_element(element) current += align_left(text=stylized, length=width, left_edge=left_edge, right_edge=self._column_separator, text_length=get_text_length(element)) length_so_far += width stream.write(current + '\n') self._write_line_break(stream, widths) class Section(object): def __init__(self): self.title = '' self.headers = [] self.rows = [] self.indent_level = 0 self._num_cols = None self._max_widths = [] def __repr__(self): return ("Section(title=%s, headers=%s, indent_level=%s, num_rows=%s)" % (self.title, self.headers, self.indent_level, len(self.rows))) def calculate_column_widths(self, padding=0, max_width=None): # postcondition: sum(widths) == max_width unscaled_widths = [w + padding for w in self._max_widths] if max_width is None: return unscaled_widths if not unscaled_widths: return unscaled_widths else: # Compute scale factor for max_width. scale_factor = max_width / float(sum(unscaled_widths)) scaled = [int(round(scale_factor * w)) for w in unscaled_widths] # Once we've scaled the columns, we may be slightly over/under # the amount we need so we have to adjust the columns. off_by = sum(scaled) - max_width while off_by != 0: iter_order = range(len(scaled)) if off_by < 0: iter_order = reversed(iter_order) for i in iter_order: if off_by > 0: scaled[i] -= 1 off_by -= 1 else: scaled[i] += 1 off_by += 1 if off_by == 0: break return scaled def total_width(self, padding=0, with_border=False, outer_padding=0): total = 0 # One char on each side == 2 chars total to the width. border_padding = 2 for w in self.calculate_column_widths(): total += w + padding if with_border: total += border_padding total += outer_padding + outer_padding return max(get_text_length(self.title) + border_padding + outer_padding + outer_padding, total) def add_title(self, title): self.title = title def add_header(self, headers): self._update_max_widths(headers) if self._num_cols is None: self._num_cols = len(headers) self.headers = self._format_headers(headers) def _format_headers(self, headers): return headers def add_row(self, row): if self._num_cols is None: self._num_cols = len(row) if len(row) != self._num_cols: raise ValueError("Row should have %s elements, instead " "it has %s" % (self._num_cols, len(row))) row = self._format_row(row) self.rows.append(row) self._update_max_widths(row) def _format_row(self, row): return [six.text_type(r) for r in row] def _update_max_widths(self, row): if not self._max_widths: self._max_widths = [get_text_length(el) for el in row] else: for i, el in enumerate(row): self._max_widths[i] = max(get_text_length(el), self._max_widths[i]) awscli-1.14.44/awscli/testutils.py0000666454262600001440000010107213243367510020122 0ustar pysdk-ciamazon00000000000000# Copyright 2012-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. """Test utilities for the AWS CLI. This module includes various classes/functions that help in writing CLI unit/integration tests. This module should not be imported by any module **except** for test code. This is included in the CLI package so that code that is not part of the CLI can still take advantage of all the testing utilities we provide. """ import os import sys import copy import shutil import time import json import logging import tempfile import platform import contextlib import string import binascii from pprint import pformat from subprocess import Popen, PIPE from awscli.compat import StringIO try: import mock except ImportError as e: # In the off chance something imports this module # that's not suppose to, we should not stop the CLI # by raising an ImportError. Now if anything actually # *uses* this module that isn't suppose to, that's a # different story. mock = None from awscli.compat import six from botocore.hooks import HierarchicalEmitter from botocore.session import Session from botocore.exceptions import ClientError from botocore.exceptions import WaiterError import botocore.loaders from botocore.vendored import requests import awscli.clidriver from awscli.plugin import load_plugins from awscli.clidriver import CLIDriver from awscli import EnvironmentVariables # The unittest module got a significant overhaul # in 2.7, so if we're in 2.6 we can use the backported # version unittest2. if sys.version_info[:2] == (2, 6): import unittest2 as unittest else: import unittest # In python 3, order matters when calling assertEqual to # compare lists and dictionaries with lists. Therefore, # assertItemsEqual needs to be used but it is renamed to # assertCountEqual in python 3. if six.PY2: unittest.TestCase.assertCountEqual = unittest.TestCase.assertItemsEqual _LOADER = botocore.loaders.Loader() INTEG_LOG = logging.getLogger('awscli.tests.integration') AWS_CMD = None def skip_if_windows(reason): """Decorator to skip tests that should not be run on windows. Example usage: @skip_if_windows("Not valid") def test_some_non_windows_stuff(self): self.assertEqual(...) """ def decorator(func): return unittest.skipIf( platform.system() not in ['Darwin', 'Linux'], reason)(func) return decorator def set_invalid_utime(path): """Helper function to set an invalid last modified time""" try: os.utime(path, (-1, -100000000000)) except (OSError, OverflowError): # Some OS's such as Windows throws an error for trying to set a # last modified time of that size. So if an error is thrown, set it # to just a negative time which will trigger the warning as well for # Windows. os.utime(path, (-1, -1)) def create_clidriver(): driver = awscli.clidriver.create_clidriver() session = driver.session data_path = session.get_config_variable('data_path').split(os.pathsep) if not data_path: data_path = [] _LOADER.search_paths.extend(data_path) session.register_component('data_loader', _LOADER) return driver def get_aws_cmd(): global AWS_CMD import awscli if AWS_CMD is None: # Try /bin/aws repo_root = os.path.dirname(os.path.abspath(awscli.__file__)) aws_cmd = os.path.join(repo_root, 'bin', 'aws') if not os.path.isfile(aws_cmd): aws_cmd = _search_path_for_cmd('aws') if aws_cmd is None: raise ValueError('Could not find "aws" executable. Either ' 'make sure it is on your PATH, or you can ' 'explicitly set this value using ' '"set_aws_cmd()"') AWS_CMD = aws_cmd return AWS_CMD def _search_path_for_cmd(cmd_name): for path in os.environ.get('PATH', '').split(os.pathsep): full_cmd_path = os.path.join(path, cmd_name) if os.path.isfile(full_cmd_path): return full_cmd_path return None def set_aws_cmd(aws_cmd): global AWS_CMD AWS_CMD = aws_cmd @contextlib.contextmanager def temporary_file(mode): """This is a cross platform temporary file creation. tempfile.NamedTemporary file on windows creates a secure temp file that can't be read by other processes and can't be opened a second time. For tests, we generally *want* them to be read multiple times. The test fixture writes the temp file contents, the test reads the temp file. """ temporary_directory = tempfile.mkdtemp() basename = 'tmpfile-%s' % str(random_chars(8)) full_filename = os.path.join(temporary_directory, basename) open(full_filename, 'w').close() try: with open(full_filename, mode) as f: yield f finally: shutil.rmtree(temporary_directory) def create_bucket(session, name=None, region=None): """ Creates a bucket :returns: the name of the bucket created """ if not region: region = 'us-west-2' client = session.create_client('s3', region_name=region) if name: bucket_name = name else: bucket_name = random_bucket_name() params = {'Bucket': bucket_name} if region != 'us-east-1': params['CreateBucketConfiguration'] = {'LocationConstraint': region} try: client.create_bucket(**params) except ClientError as e: if e.response['Error'].get('Code') == 'BucketAlreadyOwnedByYou': # This can happen in the retried request, when the first one # succeeded on S3 but somehow the response never comes back. # We still got a bucket ready for test anyway. pass else: raise return bucket_name def random_chars(num_chars): """Returns random hex characters. Useful for creating resources with random names. """ return binascii.hexlify(os.urandom(int(num_chars / 2))).decode('ascii') def random_bucket_name(prefix='awscli-s3integ-', num_random=10): """Generate a random S3 bucket name. :param prefix: A prefix to use in the bucket name. Useful for tracking resources. This default value makes it easy to see which buckets were created from CLI integ tests. :param num_random: Number of random chars to include in the bucket name. :returns: The name of a randomly generated bucket name as a string. """ return prefix + random_chars(num_random) class BaseCLIDriverTest(unittest.TestCase): """Base unittest that use clidriver. This will load all the default plugins as well so it will simulate the behavior the user will see. """ def setUp(self): self.environ = { 'AWS_DATA_PATH': os.environ['AWS_DATA_PATH'], 'AWS_DEFAULT_REGION': 'us-east-1', 'AWS_ACCESS_KEY_ID': 'access_key', 'AWS_SECRET_ACCESS_KEY': 'secret_key', 'AWS_CONFIG_FILE': '', } self.environ_patch = mock.patch('os.environ', self.environ) self.environ_patch.start() self.driver = create_clidriver() self.session = self.driver.session def tearDown(self): self.environ_patch.stop() class BaseAWSHelpOutputTest(BaseCLIDriverTest): def setUp(self): super(BaseAWSHelpOutputTest, self).setUp() self.renderer_patch = mock.patch('awscli.help.get_renderer') self.renderer_mock = self.renderer_patch.start() self.renderer = CapturedRenderer() self.renderer_mock.return_value = self.renderer def tearDown(self): super(BaseAWSHelpOutputTest, self).tearDown() self.renderer_patch.stop() def assert_contains(self, contains): if contains not in self.renderer.rendered_contents: self.fail("The expected contents:\n%s\nwere not in the " "actual rendered contents:\n%s" % ( contains, self.renderer.rendered_contents)) def assert_contains_with_count(self, contains, count): r_count = self.renderer.rendered_contents.count(contains) if r_count != count: self.fail("The expected contents:\n%s\n, with the " "count:\n%d\nwere not in the actual rendered " " contents:\n%s\nwith count:\n%d" % ( contains, count, self.renderer.rendered_contents, r_count)) def assert_not_contains(self, contents): if contents in self.renderer.rendered_contents: self.fail("The contents:\n%s\nwere not suppose to be in the " "actual rendered contents:\n%s" % ( contents, self.renderer.rendered_contents)) def assert_text_order(self, *args, **kwargs): # First we need to find where the SYNOPSIS section starts. starting_from = kwargs.pop('starting_from') args = list(args) contents = self.renderer.rendered_contents self.assertIn(starting_from, contents) start_index = contents.find(starting_from) arg_indices = [contents.find(arg, start_index) for arg in args] previous = arg_indices[0] for i, index in enumerate(arg_indices[1:], 1): if index == -1: self.fail('The string %r was not found in the contents: %s' % (args[index], contents)) if index < previous: self.fail('The string %r came before %r, but was suppose to come ' 'after it.\n%s' % (args[i], args[i - 1], contents)) previous = index class CapturedRenderer(object): def __init__(self): self.rendered_contents = '' def render(self, contents): self.rendered_contents = contents.decode('utf-8') class CapturedOutput(object): def __init__(self, stdout, stderr): self.stdout = stdout self.stderr = stderr @contextlib.contextmanager def capture_output(): stderr = six.StringIO() stdout = six.StringIO() with mock.patch('sys.stderr', stderr): with mock.patch('sys.stdout', stdout): yield CapturedOutput(stdout, stderr) @contextlib.contextmanager def capture_input(input_bytes=b''): input_data = six.BytesIO(input_bytes) if six.PY3: mock_object = mock.Mock() mock_object.buffer = input_data else: mock_object = input_data with mock.patch('sys.stdin', mock_object): yield input_data class BaseAWSCommandParamsTest(unittest.TestCase): maxDiff = None def setUp(self): self.last_params = {} self.last_kwargs = None # awscli/__init__.py injects AWS_DATA_PATH at import time # so that we can find cli.json. This might be fixed in the # future, but for now we just grab that value out of the real # os.environ so the patched os.environ has this data and # the CLI works. self.environ = { 'AWS_DATA_PATH': os.environ['AWS_DATA_PATH'], 'AWS_DEFAULT_REGION': 'us-east-1', 'AWS_ACCESS_KEY_ID': 'access_key', 'AWS_SECRET_ACCESS_KEY': 'secret_key', 'AWS_CONFIG_FILE': '', 'AWS_SHARED_CREDENTIALS_FILE': '', } self.environ_patch = mock.patch('os.environ', self.environ) self.environ_patch.start() self.http_response = requests.models.Response() self.http_response.status_code = 200 self.parsed_response = {} self.make_request_patch = mock.patch('botocore.endpoint.Endpoint.make_request') self.make_request_is_patched = False self.operations_called = [] self.parsed_responses = None self.driver = create_clidriver() def tearDown(self): # This clears all the previous registrations. self.environ_patch.stop() if self.make_request_is_patched: self.make_request_patch.stop() self.make_request_is_patched = False def before_call(self, params, **kwargs): self._store_params(params) def _store_params(self, params): self.last_request_dict = params self.last_params = params['body'] def patch_make_request(self): # If you do not stop a previously started patch, # it can never be stopped if you call start() again on the same # patch again... # So stop the current patch before calling start() on it again. if self.make_request_is_patched: self.make_request_patch.stop() self.make_request_is_patched = False make_request_patch = self.make_request_patch.start() if self.parsed_responses is not None: make_request_patch.side_effect = lambda *args, **kwargs: \ (self.http_response, self.parsed_responses.pop(0)) else: make_request_patch.return_value = (self.http_response, self.parsed_response) self.make_request_is_patched = True def assert_params_for_cmd(self, cmd, params=None, expected_rc=0, stderr_contains=None, ignore_params=None): stdout, stderr, rc = self.run_cmd(cmd, expected_rc) if stderr_contains is not None: self.assertIn(stderr_contains, stderr) if params is not None: # The last kwargs of Operation.call() in botocore. last_kwargs = copy.copy(self.last_kwargs) if ignore_params is not None: for key in ignore_params: try: del last_kwargs[key] except KeyError: pass if params != last_kwargs: self.fail("Actual params did not match expected params.\n" "Expected:\n\n" "%s\n" "Actual:\n\n%s\n" % ( pformat(params), pformat(last_kwargs))) return stdout, stderr, rc def before_parameter_build(self, params, model, **kwargs): self.last_kwargs = params self.operations_called.append((model, params)) def run_cmd(self, cmd, expected_rc=0): logging.debug("Calling cmd: %s", cmd) self.patch_make_request() self.driver.session.register('before-call', self.before_call) self.driver.session.register('before-parameter-build', self.before_parameter_build) if not isinstance(cmd, list): cmdlist = cmd.split() else: cmdlist = cmd with capture_output() as captured: try: rc = self.driver.main(cmdlist) except SystemExit as e: # We need to catch SystemExit so that we # can get a proper rc and still present the # stdout/stderr to the test runner so we can # figure out what went wrong. rc = e.code stderr = captured.stderr.getvalue() stdout = captured.stdout.getvalue() self.assertEqual( rc, expected_rc, "Unexpected rc (expected: %s, actual: %s) for command: %s\n" "stdout:\n%sstderr:\n%s" % ( expected_rc, rc, cmd, stdout, stderr)) return stdout, stderr, rc class BaseAWSPreviewCommandParamsTest(BaseAWSCommandParamsTest): def setUp(self): self.preview_patch = mock.patch( 'awscli.customizations.preview.mark_as_preview') self.preview_patch.start() super(BaseAWSPreviewCommandParamsTest, self).setUp() def tearDown(self): self.preview_patch.stop() super(BaseAWSPreviewCommandParamsTest, self).tearDown() class BaseCLIWireResponseTest(unittest.TestCase): def setUp(self): self.environ = { 'AWS_DATA_PATH': os.environ['AWS_DATA_PATH'], 'AWS_DEFAULT_REGION': 'us-east-1', 'AWS_ACCESS_KEY_ID': 'access_key', 'AWS_SECRET_ACCESS_KEY': 'secret_key', 'AWS_CONFIG_FILE': '' } self.environ_patch = mock.patch('os.environ', self.environ) self.environ_patch.start() self.send_patch = mock.patch('botocore.endpoint.Session.send') self.send_is_patched = False self.driver = create_clidriver() def tearDown(self): self.environ_patch.stop() if self.send_is_patched: self.send_patch.stop() self.send_is_patched = False def patch_send(self, status_code=200, headers={}, content=b''): if self.send_is_patched: self.patch_send.stop() self.send_is_patched = False send_patch = self.send_patch.start() send_patch.return_value = mock.Mock(status_code=status_code, headers=headers, content=content) self.send_is_patched = True def run_cmd(self, cmd, expected_rc=0): if not isinstance(cmd, list): cmdlist = cmd.split() else: cmdlist = cmd with capture_output() as captured: try: rc = self.driver.main(cmdlist) except SystemExit as e: rc = e.code stderr = captured.stderr.getvalue() stdout = captured.stdout.getvalue() self.assertEqual( rc, expected_rc, "Unexpected rc (expected: %s, actual: %s) for command: %s\n" "stdout:\n%sstderr:\n%s" % ( expected_rc, rc, cmd, stdout, stderr)) return stdout, stderr, rc class FileCreator(object): def __init__(self): self.rootdir = tempfile.mkdtemp() def remove_all(self): shutil.rmtree(self.rootdir) def create_file(self, filename, contents, mtime=None, mode='w'): """Creates a file in a tmpdir ``filename`` should be a relative path, e.g. "foo/bar/baz.txt" It will be translated into a full path in a tmp dir. If the ``mtime`` argument is provided, then the file's mtime will be set to the provided value (must be an epoch time). Otherwise the mtime is left untouched. ``mode`` is the mode the file should be opened either as ``w`` or `wb``. Returns the full path to the file. """ full_path = os.path.join(self.rootdir, filename) if not os.path.isdir(os.path.dirname(full_path)): os.makedirs(os.path.dirname(full_path)) with open(full_path, mode) as f: f.write(contents) current_time = os.path.getmtime(full_path) # Subtract a few years off the last modification date. os.utime(full_path, (current_time, current_time - 100000000)) if mtime is not None: os.utime(full_path, (mtime, mtime)) return full_path def append_file(self, filename, contents): """Append contents to a file ``filename`` should be a relative path, e.g. "foo/bar/baz.txt" It will be translated into a full path in a tmp dir. Returns the full path to the file. """ full_path = os.path.join(self.rootdir, filename) if not os.path.isdir(os.path.dirname(full_path)): os.makedirs(os.path.dirname(full_path)) with open(full_path, 'a') as f: f.write(contents) return full_path def full_path(self, filename): """Translate relative path to full path in temp dir. f.full_path('foo/bar.txt') -> /tmp/asdfasd/foo/bar.txt """ return os.path.join(self.rootdir, filename) class ProcessTerminatedError(Exception): pass class Result(object): def __init__(self, rc, stdout, stderr, memory_usage=None): self.rc = rc self.stdout = stdout self.stderr = stderr INTEG_LOG.debug("rc: %s", rc) INTEG_LOG.debug("stdout: %s", stdout) INTEG_LOG.debug("stderr: %s", stderr) if memory_usage is None: memory_usage = [] self.memory_usage = memory_usage @property def json(self): return json.loads(self.stdout) def _escape_quotes(command): # For windows we have different rules for escaping. # First, double quotes must be escaped. command = command.replace('"', '\\"') # Second, single quotes do nothing, to quote a value we need # to use double quotes. command = command.replace("'", '"') return command def aws(command, collect_memory=False, env_vars=None, wait_for_finish=True, input_data=None, input_file=None): """Run an aws command. This help function abstracts the differences of running the "aws" command on different platforms. If collect_memory is ``True`` the the Result object will have a list of memory usage taken at 2 second intervals. The memory usage will be in bytes. If env_vars is None, this will set the environment variables to be used by the aws process. If wait_for_finish is False, then the Process object is returned to the caller. It is then the caller's responsibility to ensure proper cleanup. This can be useful if you want to test timeout's or how the CLI responds to various signals. :type input_data: string :param input_data: This string will be communicated to the process through the stdin of the process. It essentially allows the user to avoid having to use a file handle to pass information to the process. Note that this string is not passed on creation of the process, but rather communicated to the process. :type input_file: a file handle :param input_file: This is a file handle that will act as the the stdin of the process immediately on creation. Essentially any data written to the file will be read from stdin of the process. This is needed if you plan to stream data into stdin while collecting memory. """ if platform.system() == 'Windows': command = _escape_quotes(command) if 'AWS_TEST_COMMAND' in os.environ: aws_command = os.environ['AWS_TEST_COMMAND'] else: aws_command = 'python %s' % get_aws_cmd() full_command = '%s %s' % (aws_command, command) stdout_encoding = get_stdout_encoding() if isinstance(full_command, six.text_type) and not six.PY3: full_command = full_command.encode(stdout_encoding) INTEG_LOG.debug("Running command: %s", full_command) env = os.environ.copy() if 'AWS_DEFAULT_REGION' not in env: env['AWS_DEFAULT_REGION'] = "us-east-1" if env_vars is not None: env = env_vars if input_file is None: input_file = PIPE process = Popen(full_command, stdout=PIPE, stderr=PIPE, stdin=input_file, shell=True, env=env) if not wait_for_finish: return process memory = None if not collect_memory: kwargs = {} if input_data: kwargs = {'input': input_data} stdout, stderr = process.communicate(**kwargs) else: stdout, stderr, memory = _wait_and_collect_mem(process) return Result(process.returncode, stdout.decode(stdout_encoding), stderr.decode(stdout_encoding), memory) def get_stdout_encoding(): encoding = getattr(sys.__stdout__, 'encoding', None) if encoding is None: encoding = 'utf-8' return encoding def _wait_and_collect_mem(process): # We only know how to collect memory on mac/linux. if platform.system() == 'Darwin': get_memory = _get_memory_with_ps elif platform.system() == 'Linux': get_memory = _get_memory_with_ps else: raise ValueError( "Can't collect memory for process on platform %s." % platform.system()) memory = [] while process.poll() is None: try: current = get_memory(process.pid) except ProcessTerminatedError: # It's possible the process terminated between .poll() # and get_memory(). break memory.append(current) stdout, stderr = process.communicate() return stdout, stderr, memory def _get_memory_with_ps(pid): # It's probably possible to do with proc_pidinfo and ctypes on a Mac, # but we'll do it the easy way with parsing ps output. command_list = 'ps u -p'.split() command_list.append(str(pid)) p = Popen(command_list, stdout=PIPE) stdout = p.communicate()[0] if not p.returncode == 0: raise ProcessTerminatedError(str(pid)) else: # Get the RSS from output that looks like this: # USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND # user 47102 0.0 0.1 2437000 4496 s002 S+ 7:04PM 0:00.12 python2.6 return int(stdout.splitlines()[1].split()[5]) * 1024 class BaseS3CLICommand(unittest.TestCase): """Base class for aws s3 command. This contains convenience functions to make writing these tests easier and more streamlined. """ def setUp(self): self.files = FileCreator() self.session = botocore.session.get_session() self.regions = {} self.region = 'us-west-2' self.client = self.session.create_client('s3', region_name=self.region) self.extra_setup() def extra_setup(self): # Subclasses can use this to define extra setup steps. pass def tearDown(self): self.files.remove_all() self.extra_teardown() def extra_teardown(self): # Subclasses can use this to define extra teardown steps. pass def override_parser(self, **kwargs): factory = self.session.get_component('response_parser_factory') factory.set_parser_defaults(**kwargs) def create_client_for_bucket(self, bucket_name): region = self.regions.get(bucket_name, self.region) client = self.session.create_client('s3', region_name=region) return client def assert_key_contents_equal(self, bucket, key, expected_contents): if isinstance(expected_contents, six.BytesIO): expected_contents = expected_contents.getvalue().decode('utf-8') actual_contents = self.get_key_contents(bucket, key) # The contents can be huge so we try to give helpful error messages # without necessarily printing the actual contents. self.assertEqual(len(actual_contents), len(expected_contents)) if actual_contents != expected_contents: self.fail("Contents for %s/%s do not match (but they " "have the same length)" % (bucket, key)) def create_bucket(self, name=None, region=None): if not region: region = self.region bucket_name = create_bucket(self.session, name, region) self.regions[bucket_name] = region self.addCleanup(self.delete_bucket, bucket_name) # Wait for the bucket to exist before letting it be used. self.wait_bucket_exists(bucket_name) return bucket_name def put_object(self, bucket_name, key_name, contents='', extra_args=None): client = self.create_client_for_bucket(bucket_name) call_args = { 'Bucket': bucket_name, 'Key': key_name, 'Body': contents } if extra_args is not None: call_args.update(extra_args) response = client.put_object(**call_args) self.addCleanup(self.delete_key, bucket_name, key_name) def delete_bucket(self, bucket_name, attempts=5, delay=5): self.remove_all_objects(bucket_name) client = self.create_client_for_bucket(bucket_name) # There's a chance that, even though the bucket has been used # several times, the delete will fail due to eventual consistency # issues. attempts_remaining = attempts while True: attempts_remaining -= 1 try: client.delete_bucket(Bucket=bucket_name) break except client.exceptions.NoSuchBucket: if self.bucket_not_exists(bucket_name): # Fast fail when the NoSuchBucket error is real. break if attempts_remaining <= 0: raise time.sleep(delay) self.regions.pop(bucket_name, None) def remove_all_objects(self, bucket_name): client = self.create_client_for_bucket(bucket_name) paginator = client.get_paginator('list_objects') pages = paginator.paginate(Bucket=bucket_name) key_names = [] for page in pages: key_names += [obj['Key'] for obj in page.get('Contents', [])] for key_name in key_names: self.delete_key(bucket_name, key_name) def delete_key(self, bucket_name, key_name): client = self.create_client_for_bucket(bucket_name) response = client.delete_object(Bucket=bucket_name, Key=key_name) def get_key_contents(self, bucket_name, key_name): client = self.create_client_for_bucket(bucket_name) response = client.get_object(Bucket=bucket_name, Key=key_name) return response['Body'].read().decode('utf-8') def wait_bucket_exists(self, bucket_name, min_successes=3): client = self.create_client_for_bucket(bucket_name) waiter = client.get_waiter('bucket_exists') for _ in range(min_successes): waiter.wait(Bucket=bucket_name) def bucket_not_exists(self, bucket_name): client = self.create_client_for_bucket(bucket_name) try: client.head_bucket(Bucket=bucket_name) return True except ClientError as error: if error.response.get('Code') == '404': return False raise def key_exists(self, bucket_name, key_name, min_successes=3): try: self.wait_until_key_exists( bucket_name, key_name, min_successes=min_successes) return True except (ClientError, WaiterError): return False def key_not_exists(self, bucket_name, key_name, min_successes=3): try: self.wait_until_key_not_exists( bucket_name, key_name, min_successes=min_successes) return True except (ClientError, WaiterError): return False def list_buckets(self): response = self.client.list_buckets() return response['Buckets'] def content_type_for_key(self, bucket_name, key_name): parsed = self.head_object(bucket_name, key_name) return parsed['ContentType'] def head_object(self, bucket_name, key_name): client = self.create_client_for_bucket(bucket_name) response = client.head_object(Bucket=bucket_name, Key=key_name) return response def wait_until_key_exists(self, bucket_name, key_name, extra_params=None, min_successes=3): self._wait_for_key(bucket_name, key_name, extra_params, min_successes, exists=True) def wait_until_key_not_exists(self, bucket_name, key_name, extra_params=None, min_successes=3): self._wait_for_key(bucket_name, key_name, extra_params, min_successes, exists=False) def _wait_for_key(self, bucket_name, key_name, extra_params=None, min_successes=3, exists=True): client = self.create_client_for_bucket(bucket_name) if exists: waiter = client.get_waiter('object_exists') else: waiter = client.get_waiter('object_not_exists') params = {'Bucket': bucket_name, 'Key': key_name} if extra_params is not None: params.update(extra_params) for _ in range(min_successes): waiter.wait(**params) def assert_no_errors(self, p): self.assertEqual( p.rc, 0, "Non zero rc (%s) received: %s" % (p.rc, p.stdout + p.stderr)) self.assertNotIn("Error:", p.stderr) self.assertNotIn("failed:", p.stderr) self.assertNotIn("client error", p.stderr) self.assertNotIn("server error", p.stderr) class StringIOWithFileNo(StringIO): def fileno(self): return 0 class TestEventHandler(object): def __init__(self, handler=None): self._handler = handler self._called = False @property def called(self): return self._called def handler(self, **kwargs): self._called = True if self._handler is not None: self._handler(**kwargs) awscli-1.14.44/awscli/examples/0000777454262600001440000000000013243367512017327 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/ec2/0000777454262600001440000000000013243367512020000 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/ec2/describe-instance-attribute.rst0000666454262600001440000000323713243367510026120 0ustar pysdk-ciamazon00000000000000**To describe the instance type** This example describes the instance type of the specified instance. Command:: aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute instanceType Output:: { "InstanceId": "i-1234567890abcdef0" "InstanceType": { "Value": "t1.micro" } } **To describe the disableApiTermination attribute** This example describes the ``disableApiTermination`` attribute of the specified instance. Command:: aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute disableApiTermination Output:: { "InstanceId": "i-1234567890abcdef0" "DisableApiTermination": { "Value": "false" } } **To describe the block device mapping for an instance** This example describes the ``blockDeviceMapping`` attribute of the specified instance. Command:: aws ec2 describe-instance-attribute --instance-id i-1234567890abcdef0 --attribute blockDeviceMapping Output:: { "InstanceId": "i-1234567890abcdef0" "BlockDeviceMappings": [ { "DeviceName": "/dev/sda1", "Ebs": { "Status": "attached", "DeleteOnTermination": true, "VolumeId": "vol-049df61146c4d7901", "AttachTime": "2013-05-17T22:42:34.000Z" } }, { "DeviceName": "/dev/sdf", "Ebs": { "Status": "attached", "DeleteOnTermination": false, "VolumeId": "vol-049df61146c4d7901", "AttachTime": "2013-09-10T23:07:00.000Z" } } ], } awscli-1.14.44/awscli/examples/ec2/create-vpc-peering-connection.rst0000666454262600001440000000366313243367510026355 0ustar pysdk-ciamazon00000000000000**To create a VPC peering connection between your VPCs** This example requests a peering connection between your VPCs vpc-1a2b3c4d and vpc-11122233. Command:: aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233 Output:: { "VpcPeeringConnection": { "Status": { "Message": "Initiating Request to 444455556666", "Code": "initiating-request" }, "Tags": [], "RequesterVpcInfo": { "OwnerId": "444455556666", "VpcId": "vpc-1a2b3c4d", "CidrBlock": "10.0.0.0/28" }, "VpcPeeringConnectionId": "pcx-111aaa111", "ExpirationTime": "2014-04-02T16:13:36.000Z", "AccepterVpcInfo": { "OwnerId": "444455556666", "VpcId": "vpc-11122233" } } } **To create a VPC peering connection with a VPC in another account** This example requests a peering connection between your VPC (vpc-1a2b3c4d), and a VPC (vpc-11122233) that belongs AWS account 123456789012. Command:: aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233 --peer-owner-id 123456789012 **To create a VPC peering connection with a VPC in a different region** This example requests a peering connection between your VPC in the current region (vpc-1a2b3c4d), and a VPC (vpc-11122233) in your account in the ``us-west-2`` region. Command:: aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233 --peer-region us-west-2 This example requests a peering connection between your VPC in the current region (vpc-1a2b3c4d), and a VPC (vpc-11122233) that belongs AWS account 123456789012 that's in the ``us-west-2`` region. Command:: aws ec2 create-vpc-peering-connection --vpc-id vpc-1a2b3c4d --peer-vpc-id vpc-11122233 --peer-owner-id 123456789012 --peer-region us-west-2awscli-1.14.44/awscli/examples/ec2/associate-route-table.rst0000666454262600001440000000043613243367510024727 0ustar pysdk-ciamazon00000000000000**To associate a route table with a subnet** This example associates the specified route table with the specified subnet. Command:: aws ec2 associate-route-table --route-table-id rtb-22574640 --subnet-id subnet-9d4a7b6c Output:: { "AssociationId": "rtbassoc-781d0d1a" }awscli-1.14.44/awscli/examples/ec2/describe-vpc-endpoint-service-configurations.rst0000666454262600001440000000173113243367510031404 0ustar pysdk-ciamazon00000000000000**To describe endpoint service configurations** This example describes your endpoint service configurations. Command:: aws ec2 describe-vpc-endpoint-service-configurations Output:: { "ServiceConfigurations": [ { "ServiceType": [ { "ServiceType": "Interface" } ], "NetworkLoadBalancerArns": [ "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/net/NLBforService/8218753950b25648" ], "ServiceName": "com.amazonaws.vpce.us-east-1.vpce-svc-0e7555fb6441987e1", "ServiceState": "Available", "ServiceId": "vpce-svc-0e7555fb6441987e1", "AcceptanceRequired": true, "AvailabilityZones": [ "us-east-1d" ], "BaseEndpointDnsNames": [ "vpce-svc-0e7555fb6441987e1.us-east-1.vpce.amazonaws.com" ] } ] }awscli-1.14.44/awscli/examples/ec2/get-launch-template-data.rst0000666454262600001440000000307013243367510025277 0ustar pysdk-ciamazon00000000000000**To get instance data for a launch template** This example gets data about the specified instance and uses the ``--query`` option to return the contents in ``LaunchTemplateData``. You can use the output as a base to create a new launch template or launch template version. Command:: aws ec2 get-launch-template-data --instance-id i-0123d646e8048babc --query 'LaunchTemplateData' Output:: { "Monitoring": {}, "ImageId": "ami-8c1be5f6", "BlockDeviceMappings": [ { "DeviceName": "/dev/xvda", "Ebs": { "DeleteOnTermination": true } } ], "EbsOptimized": false, "Placement": { "Tenancy": "default", "GroupName": "", "AvailabilityZone": "us-east-1a" }, "InstanceType": "t2.micro", "NetworkInterfaces": [ { "Description": "", "NetworkInterfaceId": "eni-35306abc", "PrivateIpAddresses": [ { "Primary": true, "PrivateIpAddress": "10.0.0.72" } ], "SubnetId": "subnet-7b16de0c", "Groups": [ "sg-7c227019" ], "Ipv6Addresses": [ { "Ipv6Address": "2001:db8:1234:1a00::123" } ], "PrivateIpAddress": "10.0.0.72" } ] }awscli-1.14.44/awscli/examples/ec2/release-hosts.rst0000666454262600001440000000057013243367510023310 0ustar pysdk-ciamazon00000000000000**To release a Dedicated host from your account** To release a Dedicated host from your account. Instances that are on the host must be stopped or terminated before the host can be released. Command:: aws ec2 release-hosts --host-id=h-0029d6e3cacf1b3da Output:: { "Successful": [ "h-0029d6e3cacf1b3da" ], "Unsuccessful": [] } awscli-1.14.44/awscli/examples/ec2/create-security-group.rst0000666454262600001440000000140713243367510024774 0ustar pysdk-ciamazon00000000000000**To create a security group for EC2-Classic** This example creates a security group named ``MySecurityGroup``. Command:: aws ec2 create-security-group --group-name MySecurityGroup --description "My security group" Output:: { "GroupId": "sg-903004f8" } **To create a security group for EC2-VPC** This example creates a security group named ``MySecurityGroup`` for the specified VPC. Command:: aws ec2 create-security-group --group-name MySecurityGroup --description "My security group" --vpc-id vpc-1a2b3c4d Output:: { "GroupId": "sg-903004f8" } For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*. .. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html awscli-1.14.44/awscli/examples/ec2/create-network-interface.rst0000666454262600001440000000216213243367510025421 0ustar pysdk-ciamazon00000000000000**To create a network interface** This example creates a network interface for the specified subnet. Command:: aws ec2 create-network-interface --subnet-id subnet-9d4a7b6c --description "my network interface" --groups sg-903004f8 --private-ip-address 10.0.2.17 Output:: { "NetworkInterface": { "Status": "pending", "MacAddress": "02:1a:80:41:52:9c", "SourceDestCheck": true, "VpcId": "vpc-a01106c2", "Description": "my network interface", "NetworkInterfaceId": "eni-e5aa89a3", "PrivateIpAddresses": [ { "Primary": true, "PrivateIpAddress": "10.0.2.17" } ], "RequesterManaged": false, "AvailabilityZone": "us-east-1d", "Ipv6Addresses": [], "Groups": [ { "GroupName": "default", "GroupId": "sg-903004f8" } ], "SubnetId": "subnet-9d4a7b6c", "OwnerId": "123456789012", "TagSet": [], "PrivateIpAddress": "10.0.2.17" } }awscli-1.14.44/awscli/examples/ec2/create-vpc-endpoint-connection-notification.rst0000666454262600001440000000163113243367510031221 0ustar pysdk-ciamazon00000000000000**To create an endpoint connection notification** This example creates a notification for a specific endpoint service that alerts you when interface endpoints have connected to your service and when endpoints have been accepted for your service. Command:: aws ec2 create-vpc-endpoint-connection-notification --connection-notification-arn arn:aws:sns:us-east-2:123456789012:VpceNotification --connection-events Connect Accept --service-id vpce-svc-1237881c0d25a3abc Output:: { "ConnectionNotification": { "ConnectionNotificationState": "Enabled", "ConnectionNotificationType": "Topic", "ServiceId": "vpce-svc-1237881c0d25a3abc", "ConnectionEvents": [ "Accept", "Connect" ], "ConnectionNotificationId": "vpce-nfn-008776de7e03f5abc", "ConnectionNotificationArn": "arn:aws:sns:us-east-2:123456789012:VpceNotification" } } awscli-1.14.44/awscli/examples/ec2/accept-vpc-peering-connection.rst0000666454262600001440000000126313243367510026343 0ustar pysdk-ciamazon00000000000000**To accept a VPC peering connection** This example accepts the specified VPC peering connection request. Command:: aws ec2 accept-vpc-peering-connection --vpc-peering-connection-id pcx-1a2b3c4d Output:: { "VpcPeeringConnection": { "Status": { "Message": "Provisioning", "Code": "provisioning" }, "Tags": [], "AccepterVpcInfo": { "OwnerId": "444455556666", "VpcId": "vpc-44455566", "CidrBlock": "10.0.1.0/28" }, "VpcPeeringConnectionId": "pcx-1a2b3c4d", "RequesterVpcInfo": { "OwnerId": "444455556666", "VpcId": "vpc-111abc45", "CidrBlock": "10.0.0.0/28" } } }awscli-1.14.44/awscli/examples/ec2/unassign-private-ip-addresses.rst0000666454262600001440000000052013243367510026405 0ustar pysdk-ciamazon00000000000000**To unassign a secondary private IP address from a network interface** This example unassigns the specified private IP address from the specified network interface. If the command succeeds, no output is returned. Command:: aws ec2 unassign-private-ip-addresses --network-interface-id eni-e5aa89a3 --private-ip-addresses 10.0.0.82 awscli-1.14.44/awscli/examples/ec2/attach-network-interface.rst0000666454262600001440000000050713243367510025423 0ustar pysdk-ciamazon00000000000000**To attach a network interface to an instance** This example attaches the specified network interface to the specified instance. Command:: aws ec2 attach-network-interface --network-interface-id eni-e5aa89a3 --instance-id i-1234567890abcdef0 --device-index 1 Output:: { "AttachmentId": "eni-attach-66c4350a" }awscli-1.14.44/awscli/examples/ec2/describe-snapshot-attribute.rst0000666454262600001440000000062113243367510026145 0ustar pysdk-ciamazon00000000000000**To describe snapshot attributes** This example command describes the ``createVolumePermission`` attribute on a snapshot with the snapshot ID of ``snap-066877671789bd71b``. Command:: aws ec2 describe-snapshot-attribute --snapshot-id snap-066877671789bd71b --attribute createVolumePermission Output:: { "SnapshotId": "snap-066877671789bd71b", "CreateVolumePermissions": [] }awscli-1.14.44/awscli/examples/ec2/describe-subnets.rst0000666454262600001440000000357013243367510023776 0ustar pysdk-ciamazon00000000000000**To describe your subnets** This example describes your subnets. Command:: aws ec2 describe-subnets Output:: { "Subnets": [ { "VpcId": "vpc-a01106c2", "AvailableIpAddressCount": 251, "MapPublicIpOnLaunch": false, "DefaultForAz": false, "Ipv6CidrBlockAssociationSet": [], "State": "available", "AvailabilityZone": "us-east-1c", "SubnetId": "subnet-9d4a7b6c", "CidrBlock": "10.0.1.0/24", "AssignIpv6AddressOnCreation": false }, { "VpcId": "vpc-31896b55", "AvailableIpAddressCount": 251, "MapPublicIpOnLaunch": false, "DefaultForAz": false, "Ipv6CidrBlockAssociationSet": [ { "Ipv6CidrBlock": "2001:db8:1234:a101::/64", "AssociationId": "subnet-cidr-assoc-30e7e348", "Ipv6CidrBlockState": { "State": "ASSOCIATED" } } ], "State": "available", "AvailabilityZone": "us-east-1a", "SubnetId": "subnet-4204d234", "CidrBlock": "10.0.1.0/24", "AssignIpv6AddressOnCreation": false } ] } **To describe the subnets for a specific VPC** This example describes the subnets for the specified VPC. Command:: aws ec2 describe-subnets --filters "Name=vpc-id,Values=vpc-a01106c2" **To describe subnets with a specific tag** This example lists subnets with the tag ``Name=MySubnet`` and returns the output in text format. Command:: aws ec2 describe-subnets --filters Name=tag:Name,Values=MySubnet --output text Output:: SUBNETS False us-east-1a 251 10.0.1.0/24 False False available subnet-5f46ec3b vpc-a034d6c4 TAGS Name MySubnetawscli-1.14.44/awscli/examples/ec2/modify-identity-id-format.rst0000666454262600001440000000137213243367510025531 0ustar pysdk-ciamazon00000000000000**To enable an IAM role to use longer IDs for a resource** This example enables the IAM role ``EC2Role`` in your AWS account to use the longer ID format for the ``instance`` resource type. If the request is successful, no output is returned. Command:: aws ec2 modify-identity-id-format --principal-arn arn:aws:iam::123456789012:role/EC2Role --resource instance --use-long-ids **To enable an IAM user to use longer IDs for a resource** This example enables the IAM user ``AdminUser`` in your AWS account to use the longer ID format for the ``volume`` resource type. If the request is successful, no output is returned. Command:: aws ec2 modify-identity-id-format --principal-arn arn:aws:iam::123456789012:user/AdminUser --resource volume --use-long-idsawscli-1.14.44/awscli/examples/ec2/describe-internet-gateways.rst0000666454262600001440000000222313243367510025757 0ustar pysdk-ciamazon00000000000000**To describe your Internet gateways** This example describes your Internet gateways. Command:: aws ec2 describe-internet-gateways Output:: { "InternetGateways": [ { "Tags": [], "InternetGatewayId": "igw-c0a643a9", "Attachments": [ { "State": "available", "VpcId": "vpc-a01106c2" } ] }, { "Tags": [], "InternetGatewayId": "igw-046d7966", "Attachments": [] } ] } **To describe the Internet gateway for a specific VPC** This example describes the Internet gateway for the specified VPC. Command:: aws ec2 describe-internet-gateways --filters "Name=attachment.vpc-id,Values=vpc-a01106c2" Output:: { "InternetGateways": [ { "Tags": [], "InternetGatewayId": "igw-c0a643a9", "Attachments": [ { "State": "available", "VpcId": "vpc-a01106c2" } ] } ] } awscli-1.14.44/awscli/examples/ec2/terminate-instances.rst0000666454262600001440000000135113243367510024505 0ustar pysdk-ciamazon00000000000000**To terminate an Amazon EC2 instance** This example terminates the specified instance. Command:: aws ec2 terminate-instances --instance-ids i-1234567890abcdef0 Output:: { "TerminatingInstances": [ { "InstanceId": "i-1234567890abcdef0", "CurrentState": { "Code": 32, "Name": "shutting-down" }, "PreviousState": { "Code": 16, "Name": "running" } } ] } For more information, see `Using Amazon EC2 Instances`_ in the *AWS Command Line Interface User Guide*. .. _`Using Amazon EC2 Instances`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html awscli-1.14.44/awscli/examples/ec2/reboot-instances.rst0000666454262600001440000000063413243367510024012 0ustar pysdk-ciamazon00000000000000**To reboot an Amazon EC2 instance** This example reboots the specified instance. If the command succeeds, no output is returned. Command:: aws ec2 reboot-instances --instance-ids i-1234567890abcdef5 For more information, see `Reboot Your Instance`_ in the *Amazon Elastic Compute Cloud User Guide*. .. _`Reboot Your Instance`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-reboot.html awscli-1.14.44/awscli/examples/ec2/restore-address-to-classic.rst0000666454262600001440000000043213243367510025674 0ustar pysdk-ciamazon00000000000000**To restore an address to EC2-Classic** This example restores Elastic IP address 198.51.100.0 to the EC2-Classic platform. Command:: aws ec2 restore-address-to-classic --public-ip 198.51.100.0 Output:: { "Status": "MoveInProgress", "PublicIp": "198.51.100.0" } awscli-1.14.44/awscli/examples/ec2/cancel-bundle-task.rst0000666454262600001440000000100213243367510024155 0ustar pysdk-ciamazon00000000000000**To cancel a bundle task** This example cancels bundle task ``bun-2a4e041c``. Command:: aws ec2 cancel-bundle-task --bundle-id bun-2a4e041c Output:: { "BundleTask": { "UpdateTime": "2015-09-15T13:27:40.000Z", "InstanceId": "i-1234567890abcdef0", "Storage": { "S3": { "Prefix": "winami", "Bucket": "bundletasks" } }, "State": "cancelling", "StartTime": "2015-09-15T13:24:35.000Z", "BundleId": "bun-2a4e041c" } }awscli-1.14.44/awscli/examples/ec2/create-vpn-connection-route.rst0000666454262600001440000000044213243367510026065 0ustar pysdk-ciamazon00000000000000**To create a static route for a VPN connection** This example creates a static route for the specified VPN connection. If the command succeeds, no output is returned. Command:: aws ec2 create-vpn-connection-route --vpn-connection-id vpn-40f41529 --destination-cidr-block 11.12.0.0/16 awscli-1.14.44/awscli/examples/ec2/request-spot-instances.rst0000666454262600001440000001157713243367510025203 0ustar pysdk-ciamazon00000000000000**To request Spot Instances** This example command creates a one-time Spot Instance request for five instances in the specified Availability Zone. If your account supports EC2-VPC only, Amazon EC2 launches the instances in the default subnet of the specified Availability Zone. If your account supports EC2-Classic, Amazon EC2 launches the instances in EC2-Classic in the specified Availability Zone. Command:: aws ec2 request-spot-instances --spot-price "0.03" --instance-count 5 --type "one-time" --launch-specification file://specification.json Specification.json:: { "ImageId": "ami-1a2b3c4d", "KeyName": "my-key-pair", "SecurityGroupIds": [ "sg-1a2b3c4d" ], "InstanceType": "m3.medium", "Placement": { "AvailabilityZone": "us-west-2a" }, "IamInstanceProfile": { "Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role" } } Output:: { "SpotInstanceRequests": [ { "Status": { "UpdateTime": "2014-03-25T20:54:21.000Z", "Code": "pending-evaluation", "Message": "Your Spot request has been submitted for review, and is pending evaluation." }, "ProductDescription": "Linux/UNIX", "SpotInstanceRequestId": "sir-df6f405d", "State": "open", "LaunchSpecification": { "Placement": { "AvailabilityZone": "us-west-2a" }, "ImageId": "ami-1a2b3c4d", "KeyName": "my-key-pair", "SecurityGroups": [ { "GroupName": "my-security-group", "GroupId": "sg-1a2b3c4d" } ], "Monitoring": { "Enabled": false }, "IamInstanceProfile": { "Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role" }, "InstanceType": "m3.medium" }, "Type": "one-time", "CreateTime": "2014-03-25T20:54:20.000Z", "SpotPrice": "0.050000" }, ... ] } This example command creates a one-time Spot Instance request for five instances in the specified subnet. Amazon EC2 launches the instances in the specified subnet. If the VPC is a nondefault VPC, the instances do not receive a public IP address by default. Command:: aws ec2 request-spot-instances --spot-price "0.050" --instance-count 5 --type "one-time" --launch-specification file://specification.json Specification.json:: { "ImageId": "ami-1a2b3c4d", "SecurityGroupIds": [ "sg-1a2b3c4d" ], "InstanceType": "m3.medium", "SubnetId": "subnet-1a2b3c4d", "IamInstanceProfile": { "Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role" } } Output:: { "SpotInstanceRequests": [ { "Status": { "UpdateTime": "2014-03-25T22:21:58.000Z", "Code": "pending-evaluation", "Message": "Your Spot request has been submitted for review, and is pending evaluation." }, "ProductDescription": "Linux/UNIX", "SpotInstanceRequestId": "sir-df6f405d", "State": "open", "LaunchSpecification": { "Placement": { "AvailabilityZone": "us-west-2a" } "ImageId": "ami-1a2b3c4d" "SecurityGroups": [ { "GroupName": "my-security-group", "GroupID": "sg-1a2b3c4d" } ] "SubnetId": "subnet-1a2b3c4d", "Monitoring": { "Enabled": false }, "IamInstanceProfile": { "Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role" }, "InstanceType": "m3.medium", }, "Type": "one-time", "CreateTime": "2014-03-25T22:21:58.000Z", "SpotPrice": "0.050000" }, ... ] } This example assigns a public IP address to the Spot Instances that you launch in a nondefault VPC. Note that when you specify a network interface, you must include the subnet ID and security group ID using the network interface. Command:: aws ec2 request-spot-instances --spot-price "0.050" --instance-count 1 --type "one-time" --launch-specification file://specification.json Specification.json:: { "ImageId": "ami-1a2b3c4d", "KeyName": "my-key-pair", "InstanceType": "m3.medium", "NetworkInterfaces": [ { "DeviceIndex": 0, "SubnetId": "subnet-1a2b3c4d", "Groups": [ "sg-1a2b3c4d" ], "AssociatePublicIpAddress": true } ], "IamInstanceProfile": { "Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role" } } awscli-1.14.44/awscli/examples/ec2/describe-route-tables.rst0000666454262600001440000000642513243367510024723 0ustar pysdk-ciamazon00000000000000**To describe your route tables** This example describes your route tables. Command:: aws ec2 describe-route-tables Output:: { "RouteTables": [ { "Associations": [ { "RouteTableAssociationId": "rtbassoc-d8ccddba", "Main": true, "RouteTableId": "rtb-1f382e7d" } ], "RouteTableId": "rtb-1f382e7d", "VpcId": "vpc-a01106c2", "PropagatingVgws": [], "Tags": [], "Routes": [ { "GatewayId": "local", "DestinationCidrBlock": "10.0.0.0/16", "State": "active", "Origin": "CreateRouteTable" } ] }, { "Associations": [ { "SubnetId": "subnet-b61f49f0", "RouteTableAssociationId": "rtbassoc-781d0d1a", "Main": false, "RouteTableId": "rtb-22574640" } ], "RouteTableId": "rtb-22574640", "VpcId": "vpc-a01106c2", "PropagatingVgws": [ { "GatewayId": "vgw-f211f09b" } ], "Tags": [], "Routes": [ { "GatewayId": "local", "DestinationCidrBlock": "10.0.0.0/16", "State": "active", "Origin": "CreateRouteTable" }, { "GatewayId": "igw-046d7966", "DestinationCidrBlock": "0.0.0.0/0", "State": "active", "Origin": "CreateRoute" } ] }, { "Associations": [ { "RouteTableAssociationId": "rtbassoc-91fbacf5", "Main": true, "RouteTableId": "rtb-1a459c7e" } ], "RouteTableId": "rtb-1a459c7e", "VpcId": "vpc-31896b55", "PropagatingVgws": [], "Tags": [], "Routes": [ { "GatewayId": "local", "DestinationCidrBlock": "10.0.0.0/16", "State": "active", "Origin": "CreateRouteTable" }, { "GatewayId": "igw-2fa4e34a", "DestinationCidrBlock": "0.0.0.0/0", "State": "active", "Origin": "CreateRoute" }, { "GatewayId": "local", "Origin": "CreateRouteTable", "State": "active", "DestinationIpv6CidrBlock": "2001:db8:1234:a100::/56" }, { "GatewayId": "igw-2fa4e34a", "Origin": "CreateRoute", "State": "active", "DestinationIpv6CidrBlock": "::/0" } ] } ] } awscli-1.14.44/awscli/examples/ec2/associate-iam-instance-profile.rst0000666454262600001440000000121213243367510026503 0ustar pysdk-ciamazon00000000000000**To associate an IAM instance profile with an instance** This example associates an IAM instance profile named ``admin-role`` with instance ``i-123456789abcde123``. Command:: aws ec2 associate-iam-instance-profile --instance-id i-123456789abcde123 --iam-instance-profile Name=admin-role Output:: { "IamInstanceProfileAssociation": { "InstanceId": "i-123456789abcde123", "State": "associating", "AssociationId": "iip-assoc-0e7736511a163c209", "IamInstanceProfile": { "Id": "AIPAJBLK7RKJKWDXVHIEC", "Arn": "arn:aws:iam::123456789012:instance-profile/admin-role" } } } awscli-1.14.44/awscli/examples/ec2/associate-address.rst0000666454262600001440000000176613243367510024140 0ustar pysdk-ciamazon00000000000000**To associate an Elastic IP addresses in EC2-Classic** This example associates an Elastic IP address with an instance in EC2-Classic. If the command succeeds, no output is returned. Command:: aws ec2 associate-address --instance-id i-07ffe74c7330ebf53 --public-ip 198.51.100.0 **To associate an Elastic IP address in EC2-VPC** This example associates an Elastic IP address with an instance in a VPC. Command:: aws ec2 associate-address --instance-id i-0b263919b6498b123 --allocation-id eipalloc-64d5890a Output:: { "AssociationId": "eipassoc-2bebb745" } This example associates an Elastic IP address with a network interface. Command:: aws ec2 associate-address --allocation-id eipalloc-64d5890a --network-interface-id eni-1a2b3c4d This example associates an Elastic IP with a private IP address that's associated with a network interface. Command:: aws ec2 associate-address --allocation-id eipalloc-64d5890a --network-interface-id eni-1a2b3c4d --private-ip-address 10.0.0.85 awscli-1.14.44/awscli/examples/ec2/describe-vpc-endpoints.rst0000666454262600001440000000477113243367510025110 0ustar pysdk-ciamazon00000000000000**To describe endpoints** This example describes all of your endpoints. Command:: aws ec2 describe-vpc-endpoints Output:: { "VpcEndpoints": [ { "PolicyDocument": "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"*\",\"Resource\":\"*\"}]}", "VpcId": "vpc-aabb1122", "NetworkInterfaceIds": [], "SubnetIds": [], "PrivateDnsEnabled": true, "State": "available", "ServiceName": "com.amazonaws.us-east-1.dynamodb", "RouteTableIds": [ "rtb-3d560345" ], "Groups": [], "VpcEndpointId": "vpce-032a826a", "VpcEndpointType": "Gateway", "CreationTimestamp": "2017-09-05T20:41:28Z", "DnsEntries": [] }, { "PolicyDocument": "{\n \"Statement\": [\n {\n \"Action\": \"*\", \n \"Effect\": \"Allow\", \n \"Principal\": \"*\", \n \"Resource\": \"*\"\n }\n ]\n}", "VpcId": "vpc-1a2b3c4d", "NetworkInterfaceIds": [ "eni-2ec2b084", "eni-1b4a65cf" ], "SubnetIds": [ "subnet-d6fcaa8d", "subnet-7b16de0c" ], "PrivateDnsEnabled": false, "State": "available", "ServiceName": "com.amazonaws.us-east-1.elasticloadbalancing", "RouteTableIds": [], "Groups": [ { "GroupName": "default", "GroupId": "sg-54e8bf31" } ], "VpcEndpointId": "vpce-0f89a33420c1931d7", "VpcEndpointType": "Interface", "CreationTimestamp": "2017-09-05T17:55:27.583Z", "DnsEntries": [ { "HostedZoneId": "Z7HUB22UULQXV", "DnsName": "vpce-0f89a33420c1931d7-bluzidnv.elasticloadbalancing.us-east-1.vpce.amazonaws.com" }, { "HostedZoneId": "Z7HUB22UULQXV", "DnsName": "vpce-0f89a33420c1931d7-bluzidnv-us-east-1b.elasticloadbalancing.us-east-1.vpce.amazonaws.com" }, { "HostedZoneId": "Z7HUB22UULQXV", "DnsName": "vpce-0f89a33420c1931d7-bluzidnv-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com" } ] } ] } awscli-1.14.44/awscli/examples/ec2/describe-launch-template-versions.rst0000666454262600001440000000537113243367510027245 0ustar pysdk-ciamazon00000000000000**To describe launch template versions** This example describes the versions of the specified launch template. Command:: aws ec2 describe-launch-template-versions --launch-template-id lt-068f72b72934aff71 Output:: { "LaunchTemplateVersions": [ { "LaunchTemplateId": "lt-068f72b72934aff71", "LaunchTemplateName": "Webservers", "VersionNumber": 3, "CreatedBy": "arn:aws:iam::123456789102:root", "LaunchTemplateData": { "KeyName": "kp-us-east", "ImageId": "ami-6057e21a", "InstanceType": "t2.small", "NetworkInterfaces": [ { "SubnetId": "subnet-7b16de0c", "DeviceIndex": 0, "Groups": [ "sg-7c227019" ] } ] }, "DefaultVersion": false, "CreateTime": "2017-11-20T13:19:54.000Z" }, { "LaunchTemplateId": "lt-068f72b72934aff71", "LaunchTemplateName": "Webservers", "VersionNumber": 2, "CreatedBy": "arn:aws:iam::123456789102:root", "LaunchTemplateData": { "KeyName": "kp-us-east", "ImageId": "ami-6057e21a", "InstanceType": "t2.medium", "NetworkInterfaces": [ { "SubnetId": "subnet-1a2b3c4d", "DeviceIndex": 0, "Groups": [ "sg-7c227019" ] } ] }, "DefaultVersion": false, "CreateTime": "2017-11-20T13:12:32.000Z" }, { "LaunchTemplateId": "lt-068f72b72934aff71", "LaunchTemplateName": "Webservers", "VersionNumber": 1, "CreatedBy": "arn:aws:iam::123456789102:root", "LaunchTemplateData": { "UserData": "", "KeyName": "kp-us-east", "ImageId": "ami-aabbcc11", "InstanceType": "t2.medium", "NetworkInterfaces": [ { "SubnetId": "subnet-7b16de0c", "DeviceIndex": 0, "DeleteOnTermination": false, "Groups": [ "sg-7c227019" ], "AssociatePublicIpAddress": true } ] }, "DefaultVersion": true, "CreateTime": "2017-11-20T12:52:33.000Z" } ] }awscli-1.14.44/awscli/examples/ec2/describe-prefix-lists.rst0000666454262600001440000000053613243367510024743 0ustar pysdk-ciamazon00000000000000**To describe prefix lists** This example lists all available prefix lists for the region. Command:: aws ec2 describe-prefix-lists Output:: { "PrefixLists": [ { "PrefixListName": "com.amazonaws.us-east-1.s3", "Cidrs": [ "54.231.0.0/17" ], "PrefixListId": "pl-63a5400a" } ] } awscli-1.14.44/awscli/examples/ec2/delete-launch-template.rst0000666454262600001440000000076013243367510025056 0ustar pysdk-ciamazon00000000000000**To delete a launch template** This example deletes the specified launch template. Command:: aws ec2 delete-launch-template --launch-template-id lt-0abcd290751193123 Output:: { "LaunchTemplate": { "LatestVersionNumber": 2, "LaunchTemplateId": "lt-0abcd290751193123", "LaunchTemplateName": "TestTemplate", "DefaultVersionNumber": 2, "CreatedBy": "arn:aws:iam::123456789012:root", "CreateTime": "2017-11-23T16:46:25.000Z" } }awscli-1.14.44/awscli/examples/ec2/create-vpc.rst0000666454262600001440000000502613243367510022564 0ustar pysdk-ciamazon00000000000000**To create a VPC** This example creates a VPC with the specified IPv4 CIDR block. Command:: aws ec2 create-vpc --cidr-block 10.0.0.0/16 Output:: { "Vpc": { "VpcId": "vpc-ff7bbf86", "InstanceTenancy": "default", "Tags": [], "CidrBlockAssociations": [ { "AssociationId": "vpc-cidr-assoc-6e42b505", "CidrBlock": "10.0.0.0/16", "CidrBlockState": { "State": "associated" } } ], "Ipv6CidrBlockAssociationSet": [], "State": "pending", "DhcpOptionsId": "dopt-38f7a057", "CidrBlock": "10.0.0.0/16", "IsDefault": false } } **To create a VPC with dedicated tenancy** This example creates a VPC with the specified IPv4 CIDR block and ``dedicated`` tenancy. Command:: aws ec2 create-vpc --cidr-block 10.0.0.0/16 --instance-tenancy dedicated Output:: { "Vpc": { "VpcId": "vpc-848344fd", "InstanceTenancy": "dedicated", "Tags": [], "CidrBlockAssociations": [ { "AssociationId": "vpc-cidr-assoc-8c4fb8e7", "CidrBlock": "10.0.0.0/16", "CidrBlockState": { "State": "associated" } } ], "Ipv6CidrBlockAssociationSet": [], "State": "pending", "DhcpOptionsId": "dopt-38f7a057", "CidrBlock": "10.0.0.0/16", "IsDefault": false } } **To create a VPC with an IPv6 CIDR block** This example creates a VPC with an Amazon-provided IPv6 CIDR block. Command:: aws ec2 create-vpc --cidr-block 10.0.0.0/16 --amazon-provided-ipv6-cidr-block Output:: { "Vpc": { "VpcId": "vpc-4b804732", "InstanceTenancy": "default", "Tags": [], "CidrBlockAssociations": [ { "AssociationId": "vpc-cidr-assoc-6c4dba07", "CidrBlock": "10.0.0.0/16", "CidrBlockState": { "State": "associated" } } ], "Ipv6CidrBlockAssociationSet": [ { "Ipv6CidrBlock": "", "AssociationId": "vpc-cidr-assoc-634dba08", "Ipv6CidrBlockState": { "State": "associating" } } ], "State": "pending", "DhcpOptionsId": "dopt-38f7a057", "CidrBlock": "10.0.0.0/16", "IsDefault": false } } awscli-1.14.44/awscli/examples/ec2/delete-flow-logs.rst0000666454262600001440000000026313243367510023702 0ustar pysdk-ciamazon00000000000000**To delete a flow log** This example deletes flow log ``fl-1a2b3c4d``. Command:: aws ec2 delete-flow-logs --flow-log-id fl-1a2b3c4d Output:: { "Unsuccessful": [] }awscli-1.14.44/awscli/examples/ec2/modify-instance-attribute.rst0000666454262600001440000000270413243367510025625 0ustar pysdk-ciamazon00000000000000**To modify the instance type** This example modifies the instance type of the specified instance. The instance must be in the ``stopped`` state. If the command succeeds, no output is returned. Command:: aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --instance-type "{\"Value\": \"m1.small\"}" **To enable enhanced networking on an instance** This example enables enhanced networking for the specified instance. The instance must be in the ``stopped`` state. If the command succeeds, no output is returned. Command:: aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --sriov-net-support simple **To modify the sourceDestCheck attribute** This example sets the ``sourceDestCheck`` attribute of the specified instance to ``true``. The instance must be in a VPC. If the command succeeds, no output is returned. Command:: aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --source-dest-check "{\"Value\": true}" **To modify the deleteOnTermination attribute of the root volume** This example sets the ``deleteOnTermination`` attribute for the root volume of the specified Amazon EBS-backed instance to ``false``. By default, this attribute is ``true`` for the root volume. If the command succeeds, no output is returned. Command:: aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --block-device-mappings "[{\"DeviceName\": \"/dev/sda1\",\"Ebs\":{\"DeleteOnTermination\":false}}]" awscli-1.14.44/awscli/examples/ec2/describe-vpn-connections.rst0000666454262600001440000000313513243367510025433 0ustar pysdk-ciamazon00000000000000**To describe your VPN connections** This example describes your VPN connections. Command:: aws ec2 describe-vpn-connections Output:: { "VpnConnections": { "VpnConnectionId": "vpn-40f41529", "Tags": [ { "Value": "MyBGPVPN", "Key": "Name" } ], "CustomerGatewayConfiguration": "...configuration information...", "Routes": [], "State": "available", "VpnGatewayId": "vgw-9a4cacf3", "CustomerGatewayId": "cgw-0e11f167", "Type": "ipsec.1", "Options": { "StaticRoutesOnly": false }, "Category": "VPN", "VgwTelemetry": [ { "Status": "DOWN", "AcceptedRouteCount": 0, "OutsideIpAddress": "72.21.209.192", "LastStatusChange": "2013-02-04T20:19:34.000Z", "StatusMessage": "IPSEC IS DOWN" }, { "Status": "DOWN", "AcceptedRouteCount": 0, "OutsideIpAddress": "72.21.209.224", "LastStatusChange": "2013-02-04T20:19:34.000Z", "StatusMessage": "IPSEC IS DOWN" } ] } } **To describe your available VPN connections** This example describes your VPN connections with a state of ``available``. Command:: aws ec2 describe-vpn-connections --filters "Name=state,Values=available" awscli-1.14.44/awscli/examples/ec2/describe-reserved-instances.rst0000666454262600001440000000442013243367510026112 0ustar pysdk-ciamazon00000000000000**To describe your Reserved Instances** This example command describes the Reserved Instances that you own. Command:: aws ec2 describe-reserved-instances Output:: { "ReservedInstances": [ { "ReservedInstancesId": "b847fa93-e282-4f55-b59a-1342fexample", "OfferingType": "No Upfront", "AvailabilityZone": "us-west-1c", "End": "2016-08-14T21:34:34.000Z", "ProductDescription": "Linux/UNIX", "UsagePrice": 0.00, "RecurringCharges": [ { "Amount": 0.104, "Frequency": "Hourly" } ], "Start": "2015-08-15T21:34:35.086Z", "State": "active", "FixedPrice": 0.0, "CurrencyCode": "USD", "Duration": 31536000, "InstanceTenancy": "default", "InstanceType": "m3.medium", "InstanceCount": 2 }, ... ] } **To describe your Reserved Instances using filters** This example filters the response to include only three-year, t2.micro Linux/UNIX Reserved Instances in us-west-1c. Command:: aws ec2 describe-reserved-instances --filters Name=duration,Values=94608000 Name=instance-type,Values=t2.micro Name=product-description,Values=Linux/UNIX Name=availability-zone,Values=us-east-1e Output:: { "ReservedInstances": [ { "ReservedInstancesId": "f127bd27-edb7-44c9-a0eb-0d7e09259af0", "OfferingType": "All Upfront", "AvailabilityZone": "us-east-1e", "End": "2018-03-26T21:34:34.000Z", "ProductDescription": "Linux/UNIX", "UsagePrice": 0.00, "RecurringCharges": [], "Start": "2015-03-27T21:34:35.848Z", "State": "active", "FixedPrice": 151.0, "CurrencyCode": "USD", "Duration": 94608000, "InstanceTenancy": "default", "InstanceType": "t2.micro", "InstanceCount": 1 } ] } For more information, see `Using Amazon EC2 Instances`_ in the *AWS Command Line Interface User Guide*. .. _`Using Amazon EC2 Instances`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html awscli-1.14.44/awscli/examples/ec2/create-vpn-connection.rst0000666454262600001440000000465513243367510024743 0ustar pysdk-ciamazon00000000000000**To create a VPN connection with dynamic routing** This example creates a VPN connection between the specified virtual private gateway and the specified customer gateway. The output includes the configuration information that your network administrator needs, in XML format. Command:: aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id cgw-0e11f167 --vpn-gateway-id vgw-9a4cacf3 Output:: { "VpnConnection": { "VpnConnectionId": "vpn-1a2b3c4d" "CustomerGatewayConfiguration": "...configuration information...", "State": "available", "VpnGatewayId": "vgw-9a4cacf3", "CustomerGatewayId": "cgw-0e11f167" } } **To create a VPN connection with static routing** This example creates a VPN connection between the specified virtual private gateway and the specified customer gateway. The options specify static routing. The output includes the configuration information that your network administrator needs, in XML format. Command:: aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id cgw-1a1a1a1a --vpn-gateway-id vgw-9a4cacf3 --options "{\"StaticRoutesOnly\":true}" Output:: { "VpnConnection": { "VpnConnectionId": "vpn-11aa33cc" "CustomerGatewayConfiguration": "...configuration information...", "State": "pending", "VpnGatewayId": "vgw-9a4cacf3", "CustomerGatewayId": "cgw-1a1a1a1a", "Options": { "StaticRoutesOnly": true } } } **To create a VPN connection and specify your own inside CIDR and pre-shared key** This example creates a VPN connection and specifies the inside IP address CIDR block and a custom pre-shared key for each tunnel. The specified values are returned in the ``CustomerGatewayConfiguration`` information. Command:: aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id cgw-b4de3fdd --vpn-gateway-id vgw-f211f09b --options "{"StaticRoutesOnly":false,"TunnelOptions":[{"TunnelInsideCidr":"169.254.12.0/30","PreSharedKey":"ExamplePreSharedKey1"},{"TunnelInsideCidr":"169.254.13.0/30","PreSharedKey":"ExamplePreSharedKey2"}]}" Output:: { "VpnConnection": { "VpnConnectionId": "vpn-40f41529" "CustomerGatewayConfiguration": "...configuration information...", "State": "pending", "VpnGatewayId": "vgw-f211f09b", "CustomerGatewayId": "cgw-b4de3fdd" } } awscli-1.14.44/awscli/examples/ec2/describe-vpc-endpoint-connection-notifications.rst0000666454262600001440000000136213243367510031722 0ustar pysdk-ciamazon00000000000000**To describe endpoint connection notifications** This example describe all of your endpoint connection notifications. Command:: aws ec2 describe-vpc-endpoint-connection-notifications Output:: { "ConnectionNotificationSet": [ { "ConnectionNotificationState": "Enabled", "ConnectionNotificationType": "Topic", "ConnectionEvents": [ "Accept", "Reject", "Delete", "Connect" ], "ConnectionNotificationId": "vpce-nfn-04bcb952bc8af7abc", "ConnectionNotificationArn": "arn:aws:sns:us-east-1:123456789012:VpceNotification", "VpcEndpointId": "vpce-0324151a02f327123" } ] } awscli-1.14.44/awscli/examples/ec2/get-password-data.rst0000666454262600001440000000172313243367510024061 0ustar pysdk-ciamazon00000000000000**To get the encrypted password** This example gets the encrypted password. Command:: aws ec2 get-password-data --instance-id i-1234567890abcdef0 Output:: { "InstanceId": "i-1234567890abcdef0", "Timestamp": "2013-08-07T22:18:38.000Z", "PasswordData": "gSlJFq+VpcZXqy+iktxMF6NyxQ4qCrT4+gaOuNOenX1MmgXPTj7XEXAMPLE UQ+YeFfb+L1U4C4AKv652Ux1iRB3CPTYP7WmU3TUnhsuBd+p6LVk7T2lKUml6OXbk6WPW1VYYm/TRPB1 e1DQ7PY4an/DgZT4mwcpRFigzhniQgDDeO1InvSDcwoUTwNs0Y1S8ouri2W4n5GNlriM3Q0AnNVelVz/ 53TkDtxbNoU606M1gK9zUWSxqEgwvbV2j8c5rP0WCuaMWSFl4ziDu4bd7q+4RSyi8NUsVWnKZ4aEZffu DPGzKrF5yLlf3etP2L4ZR6CvG7K1hx7VKOQVN32Dajw==" } **To get the decrypted password** This example gets the decrypted password. Command:: aws ec2 get-password-data --instance-id i-1234567890abcdef0 --priv-launch-key C:\Keys\MyKeyPair.pem Output:: { "InstanceId": "i-1234567890abcdef0", "Timestamp": "2013-08-30T23:18:05.000Z", "PasswordData": "&ViJ652e*u" } awscli-1.14.44/awscli/examples/ec2/run-instances.rst0000666454262600001440000002612213243367510023324 0ustar pysdk-ciamazon00000000000000**To launch an instance in EC2-Classic** This example launches a single instance of type ``c3.large``. The key pair and security group, named ``MyKeyPair`` and ``MySecurityGroup``, must exist. Command:: aws ec2 run-instances --image-id ami-1a2b3c4d --count 1 --instance-type c3.large --key-name MyKeyPair --security-groups MySecurityGroup Output:: { "OwnerId": "123456789012", "ReservationId": "r-08626e73c547023b1", "Groups": [ { "GroupName": "MySecurityGroup", "GroupId": "sg-903004f8" } ], "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": null, "RootDeviceType": "ebs", "State": { "Code": 0, "Name": "pending" }, "EbsOptimized": false, "LaunchTime": "2013-07-19T02:42:39.000Z", "ProductCodes": [], "StateTransitionReason": null, "InstanceId": "i-1234567890abcdef0", "ImageId": "ami-1a2b3c4d", "PrivateDnsName": null, "KeyName": "MyKeyPair", "SecurityGroups": [ { "GroupName": "MySecurityGroup", "GroupId": "sg-903004f8" } ], "ClientToken": null, "InstanceType": "c3.large", "NetworkInterfaces": [], "Placement": { "Tenancy": "default", "GroupName": null, "AvailabilityZone": "us-east-1b" }, "Hypervisor": "xen", "BlockDeviceMappings": [], "Architecture": "x86_64", "StateReason": { "Message": "pending", "Code": "pending" }, "RootDeviceName": "/dev/sda1", "VirtualizationType": "hvm", "AmiLaunchIndex": 0 } ] } **To launch an instance in EC2-VPC** This example launches a single instance of type ``t2.micro`` into the specified subnet. The key pair named ``MyKeyPair`` and the security group sg-903004f8 must exist. Command:: aws ec2 run-instances --image-id ami-abc12345 --count 1 --instance-type t2.micro --key-name MyKeyPair --security-group-ids sg-903004f8 --subnet-id subnet-6e7f829e Output:: { "OwnerId": "123456789012", "ReservationId": "r-08626e73c547023b2", "Groups": [], "Instances": [ { "Monitoring": { "State": "disabled" }, "PublicDnsName": null, "RootDeviceType": "ebs", "State": { "Code": 0, "Name": "pending" }, "EbsOptimized": false, "LaunchTime": "2013-07-19T02:42:39.000Z", "PrivateIpAddress": "10.0.1.114", "ProductCodes": [], "VpcId": "vpc-1a2b3c4d", "InstanceId": "i-1234567890abcdef5", "ImageId": "ami-abc12345", "PrivateDnsName": "ip-10-0-1-114.ec2.internal", "KeyName": "MyKeyPair", "SecurityGroups": [ { "GroupName": "MySecurityGroup", "GroupId": "sg-903004f8" } ], "ClientToken": null, "SubnetId": "subnet-6e7f829e", "InstanceType": "t2.micro", "NetworkInterfaces": [ { "Status": "in-use", "MacAddress": "0e:ad:05:3b:60:52", "SourceDestCheck": true, "VpcId": "vpc-1a2b3c4d", "Description": "null", "NetworkInterfaceId": "eni-a7edb1c9", "PrivateIpAddresses": [ { "PrivateDnsName": "ip-10-0-1-114.ec2.internal", "Primary": true, "PrivateIpAddress": "10.0.1.114" } ], "Ipv6Addresses": [], "PrivateDnsName": "ip-10-0-1-114.ec2.internal", "Attachment": { "Status": "attached", "DeviceIndex": 0, "DeleteOnTermination": true, "AttachmentId": "eni-attach-52193138", "AttachTime": "2013-07-19T02:42:39.000Z" }, "Groups": [ { "GroupName": "MySecurityGroup", "GroupId": "sg-903004f8" } ], "SubnetId": "subnet-6e7f829e", "OwnerId": "123456789012", "PrivateIpAddress": "10.0.1.114" } ], "SourceDestCheck": true, "Placement": { "Tenancy": "default", "GroupName": null, "AvailabilityZone": "us-east-1b" }, "Hypervisor": "xen", "BlockDeviceMappings": [], "Architecture": "x86_64", "StateReason": { "Message": "pending", "Code": "pending" }, "RootDeviceName": "/dev/sda1", "VirtualizationType": "hvm", "AmiLaunchIndex": 0 } ] } The following example requests a public IP address for an instance that you're launching into a nondefault subnet: Command:: aws ec2 run-instances --image-id ami-c3b8d6aa --count 1 --instance-type t2.medium --key-name MyKeyPair --security-group-ids sg-903004f8 --subnet-id subnet-6e7f829e --associate-public-ip-address **To launch an instance using a block device mapping** Add the following parameter to your ``run-instances`` command to specify block devices:: --block-device-mappings file://mapping.json To add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100, specify the following in mapping.json:: [ { "DeviceName": "/dev/sdh", "Ebs": { "VolumeSize": 100 } } ] To add ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``, specify the following in mapping.json:: [ { "DeviceName": "/dev/sdc", "VirtualName": "ephemeral1" } ] To omit a device specified by the AMI used to launch the instance (for example, ``/dev/sdf``), specify the following in mapping.json:: [ { "DeviceName": "/dev/sdf", "NoDevice": "" } ] You can view only the Amazon EBS volumes in your block device mapping using the console or the ``describe-instances`` command. To view all volumes, including the instance store volumes, use the following command. Command:: curl http://169.254.169.254/latest/meta-data/block-device-mapping/ Output:: ami ephemeral1 Note that ``ami`` represents the root volume. To get details about the instance store volume ``ephemeral1``, use the following command. Command:: curl http://169.254.169.254/latest/meta-data/block-device-mapping/ephemeral1 Output:: sdc **To launch an instance with a modified block device mapping** You can change individual characteristics of existing AMI block device mappings to suit your needs. Perhaps you want to use an existing AMI, but you want a larger root volume than the usual 8 GiB. Or, you would like to use a General Purpose (SSD) volume for an AMI that currently uses a Magnetic volume. Use the ``describe-images`` command with the image ID of the AMI you want to use to find its existing block device mapping. You should see a block device mapping in the output:: { "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "SnapshotId": "snap-1234567890abcdef0", "VolumeSize": 8, "VolumeType": "standard", "Encrypted": false } } You can modify the above mapping by changing the individual parameters. For example, to launch an instance with a modified block device mapping, add the following parameter to your ``run-instances`` command to change the above mapping's volume size and type:: --block-device-mappings file://mapping.json Where mapping.json contains the following:: [ { "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "SnapshotId": "snap-1234567890abcdef0", "VolumeSize": 100, "VolumeType": "gp2" } } ] **To launch an instance with user data** You can launch an instance and specify user data that performs instance configuration, or that runs a script. The user data needs to be passed as normal string, base64 encoding is handled internally. The following example passes user data in a file called ``my_script.txt`` that contains a configuration script for your instance. The script runs at launch. Command:: aws ec2 run-instances --image-id ami-abc1234 --count 1 --instance-type m4.large --key-name keypair --user-data file://my_script.txt --subnet-id subnet-abcd1234 --security-group-ids sg-abcd1234 For more information about launching instances, see `Using Amazon EC2 Instances`_ in the *AWS Command Line Interface User Guide*. .. _`Using Amazon EC2 Instances`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html **To launch an instance with an instance profile** This example shows the use of the ``iam-instance-profile`` option to specify an `IAM instance profile`_ by name. .. _`IAM instance profile`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html Command:: aws ec2 run-instances --iam-instance-profile Name=MyInstanceProfile --image-id ami-1a2b3c4d --count 1 --instance-type t2.micro --key-name MyKeyPair --security-groups MySecurityGroup **To launch an instance with tags** You can launch an instance and specify tags for the instance, volumes, or both. The following example applies a tag with a key of ``webserver`` and value of ``production`` to the instance. The command also applies a tag with a key of ``cost-center`` and a value of ``cc123`` to any EBS volume that's created (in this case, the root volume). Command:: aws ec2 run-instances --image-id ami-abc12345 --count 1 --instance-type t2.micro --key-name MyKeyPair --subnet-id subnet-6e7f829e --tag-specifications 'ResourceType=instance,Tags=[{Key=webserver,Value=production}]' 'ResourceType=volume,Tags=[{Key=cost-center,Value=cc123}]' **To launch an instance with the credit option for CPU usage of "unlimited"** You can launch an instance and specify the credit option for CPU usage for the instance. If you do not specify the credit option, the instance launches with the default "standard" credit option. The following example launches a t2.micro instance with the "unlimited" credit option. Command:: aws ec2 run-instances --image-id ami-abc12345 --count 1 --instance-type t2.micro --key-name MyKeyPair --credit-specification CpuCredits=unlimitedawscli-1.14.44/awscli/examples/ec2/assign-private-ip-addresses.rst0000666454262600001440000000154213243367510026047 0ustar pysdk-ciamazon00000000000000**To assign a specific secondary private IP address a network interface** This example assigns the specified secondary private IP address to the specified network interface. If the command succeeds, no output is returned. Command:: aws ec2 assign-private-ip-addresses --network-interface-id eni-e5aa89a3 --private-ip-addresses 10.0.0.82 **To assign secondary private IP addresses that Amazon EC2 selects to a network interface** This example assigns two secondary private IP addresses to the specified network interface. Amazon EC2 automatically assigns these IP addresses from the available IP addresses in the CIDR block range of the subnet the network interface is associated with. If the command succeeds, no output is returned. Command:: aws ec2 assign-private-ip-addresses --network-interface-id eni-e5aa89a3 --secondary-private-ip-address-count 2 awscli-1.14.44/awscli/examples/ec2/disassociate-subnet-cidr-block.rst0000666454262600001440000000103313243367510026505 0ustar pysdk-ciamazon00000000000000**To disassociate an IPv6 CIDR block from a subnet** This example disassociates an IPv6 CIDR block from a subnet using the association ID for the CIDR block. Command:: aws ec2 disassociate-subnet-cidr-block --association-id subnet-cidr-assoc-3aa54053 Output:: { "SubnetId": "subnet-5f46ec3b", "Ipv6CidrBlockAssociation": { "Ipv6CidrBlock": "2001:db8:1234:1a00::/64", "AssociationId": "subnet-cidr-assoc-3aa54053", "Ipv6CidrBlockState": { "State": "disassociating" } } }awscli-1.14.44/awscli/examples/ec2/describe-vpc-classic-link.rst0000666454262600001440000000122313243367510025446 0ustar pysdk-ciamazon00000000000000**To describe the ClassicLink status of your VPCs** This example lists the ClassicLink status of vpc-88888888. Command:: aws ec2 describe-vpc-classic-link --vpc-id vpc-88888888 Output:: { "Vpcs": [ { "ClassicLinkEnabled": true, "VpcId": "vpc-88888888", "Tags": [ { "Value": "classiclinkvpc", "Key": "Name" } ] } ] } This example lists only VPCs that are enabled for Classiclink (the filter value of ``is-classic-link-enabled`` is set to ``true``). Command:: aws ec2 describe-vpc-classic-link --filter "Name=is-classic-link-enabled,Values=true" awscli-1.14.44/awscli/examples/ec2/describe-instances.rst0000666454262600001440000000350113243367510024274 0ustar pysdk-ciamazon00000000000000**To describe an Amazon EC2 instance** Command:: aws ec2 describe-instances --instance-ids i-1234567890abcdef0 **To describe all instances with the instance type m1.small** Command:: aws ec2 describe-instances --filters "Name=instance-type,Values=m1.small" **To describe all instances with a Owner tag** Command:: aws ec2 describe-instances --filters "Name=tag-key,Values=Owner" **To describe all instances with a Purpose=test tag** Command:: aws ec2 describe-instances --filters "Name=tag:Purpose,Values=test" **To describe an EC2 instance and filter the result to return the AMI ID, and all tags associated with the instance.** Command:: aws ec2 describe-instances --instance-id i-1234567890abcdef0 --query 'Reservations[*].Instances[*].[ImageId,Tags[*]]' **To describe all instances, and return all instance IDs and AMI IDs, but only show the tag value where the tag key is "Application".** Command:: aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,ImageId,Tags[?Key==`Application`].Value]' **To describe all EC2 instances that have an instance type of m1.small or m1.medium that are also in the us-west-2c Availability Zone** Command:: aws ec2 describe-instances --filters "Name=instance-type,Values=m1.small,m1.medium" "Name=availability-zone,Values=us-west-2c" The following JSON input performs the same filtering. Command:: aws ec2 describe-instances --filters file://filters.json filters.json:: [ { "Name": "instance-type", "Values": ["m1.small", "m1.medium"] }, { "Name": "availability-zone", "Values": ["us-west-2c"] } ] For more information, see `Using Amazon EC2 Instances`_ in the *AWS Command Line Interface User Guide*. .. _`Using Amazon EC2 Instances`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html awscli-1.14.44/awscli/examples/ec2/associate-dhcp-options.rst0000666454262600001440000000105513243367510025111 0ustar pysdk-ciamazon00000000000000**To associate a DHCP options set with your VPC** This example associates the specified DHCP options set with the specified VPC. If the command succeeds, no output is returned. Command:: aws ec2 associate-dhcp-options --dhcp-options-id dopt-d9070ebb --vpc-id vpc-a01106c2 **To associate the default DHCP options set with your VPC** This example associates the default DHCP options set with the specified VPC. If the command succeeds, no output is returned. Command:: aws ec2 associate-dhcp-options --dhcp-options-id default --vpc-id vpc-a01106c2 awscli-1.14.44/awscli/examples/ec2/detach-internet-gateway.rst0000666454262600001440000000042513243367510025246 0ustar pysdk-ciamazon00000000000000**To detach an Internet gateway from your VPC** This example detaches the specified Internet gateway from the specified VPC. If the command succeeds, no output is returned. Command:: aws ec2 detach-internet-gateway --internet-gateway-id igw-c0a643a9 --vpc-id vpc-a01106c2 awscli-1.14.44/awscli/examples/ec2/create-internet-gateway.rst0000666454262600001440000000042213243367510025256 0ustar pysdk-ciamazon00000000000000**To create an Internet gateway** This example creates an Internet gateway. Command:: aws ec2 create-internet-gateway Output:: { "InternetGateway": { "Tags": [], "InternetGatewayId": "igw-c0a643a9", "Attachments": [] } }awscli-1.14.44/awscli/examples/ec2/describe-vpc-attribute.rst0000666454262600001440000000202513243367510025076 0ustar pysdk-ciamazon00000000000000**To describe the enableDnsSupport attribute** This example describes the ``enableDnsSupport`` attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is ``true``, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not. Command:: aws ec2 describe-vpc-attribute --vpc-id vpc-a01106c2 --attribute enableDnsSupport Output:: { "VpcId": "vpc-a01106c2", "EnableDnsSupport": { "Value": true } } **To describe the enableDnsHostnames attribute** This example describes the ``enableDnsHostnames`` attribute. This attribute indicates whether the instances launched in the VPC get DNS hostnames. If this attribute is ``true``, instances in the VPC get DNS hostnames; otherwise, they do not. Command:: aws ec2 describe-vpc-attribute --vpc-id vpc-a01106c2 --attribute enableDnsHostnames Output:: { "VpcId": "vpc-a01106c2", "EnableDnsHostnames": { "Value": true } }awscli-1.14.44/awscli/examples/ec2/delete-vpc-endpoints.rst0000666454262600001440000000056513243367510024567 0ustar pysdk-ciamazon00000000000000**To delete an endpoint** This example deletes endpoints vpce-aa22bb33 and vpce-1a2b3c4d. If the command is partially successful or unsuccessful, a list of unsuccessful items is returned. If the command succeeds, the returned list is empty. Command:: aws ec2 delete-vpc-endpoints --vpc-endpoint-ids vpce-aa22bb33 vpce-1a2b3c4d Output:: { "Unsuccessful": [] }awscli-1.14.44/awscli/examples/ec2/describe-network-interface-permissions.rst0000666454262600001440000000105713243367510030311 0ustar pysdk-ciamazon00000000000000**To describe your network interface permissions** This example describes all of your network interface permissions. Command:: aws ec2 describe-network-interface-permissions Output:: { "NetworkInterfacePermissions": [ { "PermissionState": { "State": "GRANTED" }, "NetworkInterfacePermissionId": "eni-perm-06fd19020ede149ea", "NetworkInterfaceId": "eni-b909511a", "Permission": "INSTANCE-ATTACH", "AwsAccountId": "123456789012" } ] }awscli-1.14.44/awscli/examples/ec2/modify-vpc-peering-connection-options.rst0000666454262600001440000000344613243367510030071 0ustar pysdk-ciamazon00000000000000**To enable communication over a VPC peering connection from your local ClassicLink connection** In this example, for peering connection ``pcx-aaaabbb``, the owner of the requester VPC modifies the VPC peering connection options to enable a local ClassicLink connection to communicate with the peer VPC. Command:: aws ec2 modify-vpc-peering-connection-options --vpc-peering-connection-id pcx-aaaabbbb --requester-peering-connection-options AllowEgressFromLocalClassicLinkToRemoteVpc=true Output:: { "RequesterPeeringConnectionOptions": { "AllowEgressFromLocalClassicLinkToRemoteVpc": true } } **To enable communication over a VPC peering connection from your local VPC to a remote ClassicLink connection** In this example, the owner of the accepter VPC modifies the VPC peering connection options to enable the local VPC to communicate with the ClassicLink connection in the peer VPC. Command:: aws ec2 modify-vpc-peering-connection-options --vpc-peering-connection-id pcx-aaaabbbb --accepter-peering-connection-options AllowEgressFromLocalVpcToRemoteClassicLink=true Output:: { "AccepterPeeringConnectionOptions": { "AllowEgressFromLocalVpcToRemoteClassicLink": true } } **To enable DNS resolution support for the VPC peering connection** In this example, the owner of the requester VPC modifies the VPC peering connection options for ``pcx-aaaabbbb`` to enable the local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC. Command:: aws ec2 modify-vpc-peering-connection-options --vpc-peering-connection-id pcx-aaaabbbb --requester-peering-connection-options AllowDnsResolutionFromRemoteVpc=true Output:: { "RequesterPeeringConnectionOptions": { "AllowDnsResolutionFromRemoteVpc": true } }awscli-1.14.44/awscli/examples/ec2/reset-image-attribute.rst0000666454262600001440000000047713243367510024743 0ustar pysdk-ciamazon00000000000000**To reset the launchPermission attribute** This example resets the ``launchPermission`` attribute for the specified AMI to its default value. By default, AMIs are private. If the command succeeds, no output is returned. Command:: aws ec2 reset-image-attribute --image-id ami-5731123e --attribute launchPermission awscli-1.14.44/awscli/examples/ec2/get-reserved-instances-exchange-quote.rst0000666454262600001440000000314113243367510030023 0ustar pysdk-ciamazon00000000000000**To get a quote for exchanging a Convertible Reserved Instance** This example gets the exchange information for the specified Convertible Reserved Instances. Command:: aws ec2 get-reserved-instances-exchange-quote --reserved-instance-ids 7b8750c3-397e-4da4-bbcb-a45ebexample --target-configurations OfferingId=6fea5434-b379-434c-b07b-a7abexample Output:: { "CurrencyCode": "USD", "ReservedInstanceValueSet": [ { "ReservedInstanceId": "7b8750c3-397e-4da4-bbcb-a45ebexample", "ReservationValue": { "RemainingUpfrontValue": "0.000000", "HourlyPrice": "0.027800", "RemainingTotalValue": "730.556200" } } ], "PaymentDue": "424.983828", "TargetConfigurationValueSet": [ { "TargetConfiguration": { "InstanceCount": 5, "OfferingId": "6fea5434-b379-434c-b07b-a7abexample" }, "ReservationValue": { "RemainingUpfrontValue": "424.983828", "HourlyPrice": "0.016000", "RemainingTotalValue": "845.447828" } } ], "IsValidExchange": true, "OutputReservedInstancesWillExpireAt": "2020-10-01T13:03:39Z", "ReservedInstanceValueRollup": { "RemainingUpfrontValue": "0.000000", "HourlyPrice": "0.027800", "RemainingTotalValue": "730.556200" }, "TargetConfigurationValueRollup": { "RemainingUpfrontValue": "424.983828", "HourlyPrice": "0.016000", "RemainingTotalValue": "845.447828" } } awscli-1.14.44/awscli/examples/ec2/modify-id-format.rst0000666454262600001440000000072213243367510023700 0ustar pysdk-ciamazon00000000000000**To enable the longer ID format for a resource** This example enables the longer ID format for the ``instance`` resource type. If the request is successful, no output is returned. Command:: aws ec2 modify-id-format --resource instance --use-long-ids **To disable the longer ID format for a resource** This example disables the longer ID format for the ``instance`` resource type. Command:: aws ec2 modify-id-format --resource instance --no-use-long-ids awscli-1.14.44/awscli/examples/ec2/unmonitor-instances.rst0000666454262600001440000000063113243367510024547 0ustar pysdk-ciamazon00000000000000**To disable detailed monitoring for an instance** This example command disables detailed monitoring for the specified instance. Command:: aws ec2 unmonitor-instances --instance-ids i-1234567890abcdef0 Output:: { "InstanceMonitorings": [ { "InstanceId": "i-1234567890abcdef0", "Monitoring": { "State": "disabling" } } ] } awscli-1.14.44/awscli/examples/ec2/create-instance-export-task.rst0000666454262600001440000000163113243367510026055 0ustar pysdk-ciamazon00000000000000**To export an instance** This example command creates a task to export the instance i-1234567890abcdef0 to the Amazon S3 bucket myexportbucket. Command:: aws ec2 create-instance-export-task --description "RHEL5 instance" --instance-id i-1234567890abcdef0 --target-environment vmware --export-to-s3-task DiskImageFormat=vmdk,ContainerFormat=ova,S3Bucket=myexportbucket,S3Prefix=RHEL5 Output:: { "ExportTask": { "State": "active", "InstanceExportDetails": { "InstanceId": "i-1234567890abcdef0", "TargetEnvironment": "vmware" }, "ExportToS3Task": { "S3Bucket": "myexportbucket", "S3Key": "RHEL5export-i-fh8sjjsq.ova", "DiskImageFormat": "vmdk", "ContainerFormat": "ova" }, "Description": "RHEL5 instance", "ExportTaskId": "export-i-fh8sjjsq" } } awscli-1.14.44/awscli/examples/ec2/create-network-interface-permission.rst0000666454262600001440000000120313243367510027602 0ustar pysdk-ciamazon00000000000000**To create a network interface permission** This example grants permission to account ``123456789012`` to attach network interface ``eni-1a2b3c4d`` to an instance. Command:: aws ec2 create-network-interface-permission --network-interface-id eni-1a2b3c4d --aws-account-id 123456789012 --permission INSTANCE-ATTACH Output:: { "InterfacePermission": { "PermissionState": { "State": "GRANTED" }, "NetworkInterfacePermissionId": "eni-perm-06fd19020ede149ea", "NetworkInterfaceId": "eni-1a2b3c4d", "Permission": "INSTANCE-ATTACH", "AwsAccountId": "123456789012" } }awscli-1.14.44/awscli/examples/ec2/describe-id-format.rst0000666454262600001440000000216313243367510024172 0ustar pysdk-ciamazon00000000000000**To describe the ID format for your resources** This example describes the ID format for all resource types that support longer IDs. The output indicates that the ``instance``, ``reservation``, ``volume``, and ``snapshot`` resource types can be enabled or disabled for longer IDs. The ``reservation`` resource is already enabled. The ``Deadline`` field indicates the date (in UTC) at which you're automatically switched over to using longer IDs for that resource type. If a deadline is not yet available for the resource type, this value is not returned. Command:: aws ec2 describe-id-format Output:: { "Statuses": [ { "Deadline": "2016-11-01T13:00:00.000Z", "UseLongIds": false, "Resource": "instance" }, { "Deadline": "2016-11-01T13:00:00.000Z", "UseLongIds": true, "Resource": "reservation" }, { "Deadline": "2016-11-01T13:00:00.000Z", "UseLongIds": false, "Resource": "volume" }, { "Deadline": "2016-11-01T13:00:00.000Z", "UseLongIds": false, "Resource": "snapshot" } ] }awscli-1.14.44/awscli/examples/ec2/enable-vgw-route-propagation.rst0000666454262600001440000000046013243367510026234 0ustar pysdk-ciamazon00000000000000**To enable route propagation** This example enables the specified virtual private gateway to propagate static routes to the specified route table. If the command succeeds, no output is returned. Command:: aws ec2 enable-vgw-route-propagation --route-table-id rtb-22574640 --gateway-id vgw-9a4cacf3 awscli-1.14.44/awscli/examples/ec2/delete-subnet.rst0000666454262600001440000000026313243367510023271 0ustar pysdk-ciamazon00000000000000**To delete a subnet** This example deletes the specified subnet. If the command succeeds, no output is returned. Command:: aws ec2 delete-subnet --subnet-id subnet-9d4a7b6c awscli-1.14.44/awscli/examples/ec2/copy-snapshot.rst0000666454262600001440000000071613243367510023343 0ustar pysdk-ciamazon00000000000000**To copy a snapshot** This example command copies a snapshot with the snapshot ID of ``snap-066877671789bd71b`` from the ``us-west-2`` region to the ``us-east-1`` region and adds a short description to identify the snapshot. Command:: aws --region us-east-1 ec2 copy-snapshot --source-region us-west-2 --source-snapshot-id snap-066877671789bd71b --description "This is my copied snapshot." Output:: { "SnapshotId": "snap-066877671789bd71b" }awscli-1.14.44/awscli/examples/ec2/describe-vpc-endpoint-services.rst0000666454262600001440000001276313243367510026546 0ustar pysdk-ciamazon00000000000000**To describe VPC endpoint services** This example describes all available endpoint services for the region. Command:: aws ec2 describe-vpc-endpoint-services Output:: { "ServiceDetails": [ { "ServiceType": [ { "ServiceType": "Gateway" } ], "AcceptanceRequired": false, "ServiceName": "com.amazonaws.us-east-1.dynamodb", "VpcEndpointPolicySupported": true, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "BaseEndpointDnsNames": [ "dynamodb.us-east-1.amazonaws.com" ] }, { "ServiceType": [ { "ServiceType": "Interface" } ], "PrivateDnsName": "ec2.us-east-1.amazonaws.com", "ServiceName": "com.amazonaws.us-east-1.ec2", "VpcEndpointPolicySupported": false, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "AcceptanceRequired": false, "BaseEndpointDnsNames": [ "ec2.us-east-1.vpce.amazonaws.com" ] }, { "ServiceType": [ { "ServiceType": "Interface" } ], "PrivateDnsName": "ec2messages.us-east-1.amazonaws.com", "ServiceName": "com.amazonaws.us-east-1.ec2messages", "VpcEndpointPolicySupported": false, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "AcceptanceRequired": false, "BaseEndpointDnsNames": [ "ec2messages.us-east-1.vpce.amazonaws.com" ] }, { "ServiceType": [ { "ServiceType": "Interface" } ], "PrivateDnsName": "elasticloadbalancing.us-east-1.amazonaws.com", "ServiceName": "com.amazonaws.us-east-1.elasticloadbalancing", "VpcEndpointPolicySupported": false, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "AcceptanceRequired": false, "BaseEndpointDnsNames": [ "elasticloadbalancing.us-east-1.vpce.amazonaws.com" ] }, { "ServiceType": [ { "ServiceType": "Interface" } ], "PrivateDnsName": "kinesis.us-east-1.amazonaws.com", "ServiceName": "com.amazonaws.us-east-1.kinesis-streams", "VpcEndpointPolicySupported": false, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "AcceptanceRequired": false, "BaseEndpointDnsNames": [ "kinesis.us-east-1.vpce.amazonaws.com" ] }, { "ServiceType": [ { "ServiceType": "Gateway" } ], "AcceptanceRequired": false, "ServiceName": "com.amazonaws.us-east-1.s3", "VpcEndpointPolicySupported": true, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e", "us-east-1f" ], "BaseEndpointDnsNames": [ "s3.us-east-1.amazonaws.com" ] }, { "ServiceType": [ { "ServiceType": "Interface" } ], "PrivateDnsName": "ssm.us-east-1.amazonaws.com", "ServiceName": "com.amazonaws.us-east-1.ssm", "VpcEndpointPolicySupported": true, "Owner": "amazon", "AvailabilityZones": [ "us-east-1a", "us-east-1b", "us-east-1c", "us-east-1d", "us-east-1e" ], "AcceptanceRequired": false, "BaseEndpointDnsNames": [ "ssm.us-east-1.vpce.amazonaws.com" ] } ], "ServiceNames": [ "com.amazonaws.us-east-1.dynamodb", "com.amazonaws.us-east-1.ec2", "com.amazonaws.us-east-1.ec2messages", "com.amazonaws.us-east-1.elasticloadbalancing", "com.amazonaws.us-east-1.kinesis-streams", "com.amazonaws.us-east-1.s3", "com.amazonaws.us-east-1.ssm" ] }awscli-1.14.44/awscli/examples/ec2/copy-fpga-image.rst0000666454262600001440000000053313243367510023476 0ustar pysdk-ciamazon00000000000000**To copy an Amazon FPGA image** This example copies the specified AFI from the ``us-east-1`` region to the current region (``eu-west-1``). Command:: aws ec2 copy-fpga-image --name copy-afi --source-fpga-image-id afi-0d123e123bfc85abc --source-region us-east-1 --region eu-west-1 Output:: { "FpgaImageId": "afi-06b12350a123fbabc" } awscli-1.14.44/awscli/examples/ec2/modify-launch-template.rst0000666454262600001440000000107213243367510025100 0ustar pysdk-ciamazon00000000000000**To change the default launch template version** This example specifies version 2 of the specified launch template as the default version. Command:: aws ec2 modify-launch-template --launch-template-id lt-0abcd290751193123 --default-version 2 Output:: { "LaunchTemplate": { "LatestVersionNumber": 2, "LaunchTemplateId": "lt-0abcd290751193123", "LaunchTemplateName": "WebServers", "DefaultVersionNumber": 2, "CreatedBy": "arn:aws:iam::123456789012:root", "CreateTime": "2017-12-01T13:35:46.000Z" } }awscli-1.14.44/awscli/examples/ec2/modify-image-attribute.rst0000666454262600001440000000212413243367510025077 0ustar pysdk-ciamazon00000000000000**To make an AMI public** This example makes the specified AMI public. If the command succeeds, no output is returned. Command:: aws ec2 modify-image-attribute --image-id ami-5731123e --launch-permission "{\"Add\": [{\"Group\":\"all\"}]}" **To make an AMI private** This example makes the specified AMI private. If the command succeeds, no output is returned. Command:: aws ec2 modify-image-attribute --image-id ami-5731123e --launch-permission "{\"Remove\": [{\"Group\":\"all\"}]}" **To grant launch permission to an AWS account** This example grants launch permissions to the specified AWS account. If the command succeeds, no output is returned. Command:: aws ec2 modify-image-attribute --image-id ami-5731123e --launch-permission "{\"Add\": [{\"UserId\":\"123456789012\"}]}" **To removes launch permission from an AWS account** This example removes launch permissions from the specified AWS account. If the command succeeds, no output is returned. Command:: aws ec2 modify-image-attribute --image-id ami-5731123e --launch-permission "{\"Remove\": [{\"UserId\":\"123456789012\"}]}" awscli-1.14.44/awscli/examples/ec2/describe-fpga-images.rst0000666454262600001440000000165613243367510024476 0ustar pysdk-ciamazon00000000000000**To describe Amazon FPGA images** This example describes AFIs that are owned by account ``123456789012``. Command:: aws ec2 describe-fpga-images --filters Name=owner-id,Values=123456789012 Output:: { "FpgaImages": [ { "UpdateTime": "2017-12-22T12:09:14.000Z", "Name": "my-afi", "PciId": { "SubsystemVendorId": "0xfedd", "VendorId": "0x1d0f", "DeviceId": "0xf000", "SubsystemId": "0x1d51" }, "FpgaImageGlobalId": "agfi-123cb27b5e84a0abc", "Public": false, "State": { "Code": "available" }, "ShellVersion": "0x071417d3", "OwnerId": "123456789012", "FpgaImageId": "afi-0d123e123bfc85abc", "CreateTime": "2017-12-22T11:43:33.000Z", "Description": "my-afi" } ] }awscli-1.14.44/awscli/examples/ec2/describe-key-pairs.rst0000666454262600001440000000105513243367510024213 0ustar pysdk-ciamazon00000000000000**To display a key pair** This example displays the fingerprint for the key pair named ``MyKeyPair``. Command:: aws ec2 describe-key-pairs --key-name MyKeyPair Output:: { "KeyPairs": [ { "KeyName": "MyKeyPair", "KeyFingerprint": "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f" } ] } For more information, see `Using Key Pairs`_ in the *AWS Command Line Interface User Guide*. .. _`Using Key Pairs`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html awscli-1.14.44/awscli/examples/ec2/modify-vpc-endpoint-service-configuration.rst0000666454262600001440000000045613243367510030733 0ustar pysdk-ciamazon00000000000000**To modify an endpoint service configuration** This example changes the acceptance requirement for the specified endpoint service. Command:: aws ec2 modify-vpc-endpoint-service-configuration --service-id vpce-svc-09222513e6e77dc86 --no-acceptance-required Output:: { "ReturnValue": true }awscli-1.14.44/awscli/examples/ec2/cancel-conversion-task.rst0000666454262600001440000000042213243367510025076 0ustar pysdk-ciamazon00000000000000**To cancel an active conversion of an instance or a volume** This example cancels the upload associated with the task ID import-i-fh95npoc. If the command succeeds, no output is returned. Command:: aws ec2 cancel-conversion-task --conversion-task-id import-i-fh95npoc awscli-1.14.44/awscli/examples/ec2/describe-egress-only-internet-gateways.rst0000666454262600001440000000074713243367510030235 0ustar pysdk-ciamazon00000000000000**To describe your egress-only Internet gateways** This example describes your egress-only Internet gateways. Command:: aws ec2 describe-egress-only-internet-gateways Output:: { "EgressOnlyInternetGateways": [ { "EgressOnlyInternetGatewayId": "eigw-015e0e244e24dfe8a", "Attachments": [ { "State": "attached", "VpcId": "vpc-0c62a468" } ] } ] }awscli-1.14.44/awscli/examples/ec2/create-network-acl.rst0000666454262600001440000000151413243367510024220 0ustar pysdk-ciamazon00000000000000**To create a network ACL** This example creates a network ACL for the specified VPC. Command:: aws ec2 create-network-acl --vpc-id vpc-a01106c2 Output:: { "NetworkAcl": { "Associations": [], "NetworkAclId": "acl-5fb85d36", "VpcId": "vpc-a01106c2", "Tags": [], "Entries": [ { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": true, "RuleAction": "deny" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": false, "RuleAction": "deny" } ], "IsDefault": false } }awscli-1.14.44/awscli/examples/ec2/create-dhcp-options.rst0000666454262600001440000000101713243367510024377 0ustar pysdk-ciamazon00000000000000**To create a DHCP options set** This example creates a DHCP options set. Command:: aws ec2 create-dhcp-options --dhcp-configuration "Key=domain-name-servers,Values=10.2.5.1,10.2.5.2" Output:: { "DhcpOptions": { "DhcpConfigurations": [ { "Values": [ "10.2.5.2", "10.2.5.1" ], "Key": "domain-name-servers" } ], "DhcpOptionsId": "dopt-d9070ebb" } }awscli-1.14.44/awscli/examples/ec2/describe-image-attribute.rst0000666454262600001440000000127313243367510025374 0ustar pysdk-ciamazon00000000000000**To describe the launch permissions for an AMI** This example describes the launch permissions for the specified AMI. Command:: aws ec2 describe-image-attribute --image-id ami-5731123e --attribute launchPermission Output:: { "LaunchPermissions": [ { "UserId": "123456789012" } ], "ImageId": "ami-5731123e", } **To describe the product codes for an AMI** This example describes the product codes for the specified AMI. Note that this AMI has no product codes. Command:: aws ec2 describe-image-attribute --image-id ami-5731123e --attribute productCodes Output:: { "ProductCodes": [], "ImageId": "ami-5731123e", }awscli-1.14.44/awscli/examples/ec2/describe-reserved-instances-offerings.rst0000666454262600001440000000675013243367510030102 0ustar pysdk-ciamazon00000000000000**To describe Reserved Instances offerings** This example command describes all Reserved Instances available for purchase in the region. Command:: aws ec2 describe-reserved-instances-offerings Output:: { "ReservedInstancesOfferings": [ { "OfferingType": "Partial Upfront", "AvailabilityZone": "us-east-1b", "InstanceTenancy": "default", "PricingDetails": [], "ProductDescription": "Red Hat Enterprise Linux", "UsagePrice": 0.0, "RecurringCharges": [ { "Amount": 0.088, "Frequency": "Hourly" } ], "Marketplace": false, "CurrencyCode": "USD", "FixedPrice": 631.0, "Duration": 94608000, "ReservedInstancesOfferingId": "9a06095a-bdc6-47fe-a94a-2a382f016040", "InstanceType": "c1.medium" }, { "OfferingType": "PartialUpfront", "AvailabilityZone": "us-east-1b", "InstanceTenancy": "default", "PricingDetails": [], "ProductDescription": "Linux/UNIX", "UsagePrice": 0.0, "RecurringCharges": [ { "Amount": 0.028, "Frequency": "Hourly" } ], "Marketplace": false, "CurrencyCode": "USD", "FixedPrice": 631.0, "Duration": 94608000, "ReservedInstancesOfferingId": "bfbefc6c-0d10-418d-b144-7258578d329d", "InstanceType": "c1.medium" }, ... } **To describe your Reserved Instances offerings using options** This example lists Reserved Instances offered by AWS with the following specifications: t1.micro instance types, Windows (Amazon VPC) product, and Heavy Utilization offerings. Command:: aws ec2 describe-reserved-instances-offerings --no-include-marketplace --instance-type "t1.micro" --product-description "Windows (Amazon VPC)" --offering-type "no upfront" Output:: { "ReservedInstancesOfferings": [ { "OfferingType": "No Upfront", "AvailabilityZone": "us-east-1b", "InstanceTenancy": "default", "PricingDetails": [], "ProductDescription": "Windows", "UsagePrice": 0.0, "RecurringCharges": [ { "Amount": 0.015, "Frequency": "Hourly" } ], "Marketplace": false, "CurrencyCode": "USD", "FixedPrice": 0.0, "Duration": 31536000, "ReservedInstancesOfferingId": "c48ab04c-fe69-4f94-8e39-a23842292823", "InstanceType": "t1.micro" }, ... { "OfferingType": "No Upfront", "AvailabilityZone": "us-east-1d", "InstanceTenancy": "default", "PricingDetails": [], "ProductDescription": "Windows (Amazon VPC)", "UsagePrice": 0.0, "RecurringCharges": [ { "Amount": 0.015, "Frequency": "Hourly" } ], "Marketplace": false, "CurrencyCode": "USD", "FixedPrice": 0.0, "Duration": 31536000, "ReservedInstancesOfferingId": "3a98bf7d-2123-42d4-b4f5-8dbec4b06dc6", "InstanceType": "t1.micro" } ] } awscli-1.14.44/awscli/examples/ec2/describe-flow-logs.rst0000666454262600001440000000130013243367510024211 0ustar pysdk-ciamazon00000000000000**To describe flow logs** This example describes all of your flow logs. Command:: aws ec2 describe-flow-logs Output:: { "FlowLogs": [ { "ResourceId": "eni-11aa22bb", "CreationTime": "2015-06-12T14:41:15Z", "LogGroupName": "MyFlowLogs", "TrafficType": "ALL", "FlowLogStatus": "ACTIVE", "FlowLogId": "fl-1a2b3c4d", "DeliverLogsPermissionArn": "arn:aws:iam::123456789101:role/flow-logs-role" } ] } This example uses a filter to describe only flow logs that are in the log group ``MyFlowLogs`` in Amazon CloudWatch Logs. Command:: aws ec2 describe-flow-logs --filter "Name=log-group-name,Values=MyFlowLogs"awscli-1.14.44/awscli/examples/ec2/delete-egress-only-internet-gateway.rst0000666454262600001440000000041413243367510027523 0ustar pysdk-ciamazon00000000000000**To delete an egress-only Internet gateway** This example deletes the specified egress-only Internet gateway. Command:: aws ec2 delete-egress-only-internet-gateway --egress-only-internet-gateway-id eigw-01eadbd45ecd7943f Output:: { "ReturnCode": true }awscli-1.14.44/awscli/examples/ec2/accept-reserved-instances-exchange-quote.rst0000666454262600001440000000064013243367510030504 0ustar pysdk-ciamazon00000000000000**To perform a Convertible Reserved Instance exchange** This example performs an exchange of the specified Convertible Reserved Instances. Command:: aws ec2 accept-reserved-instances-exchange-quote --reserved-instance-ids 7b8750c3-397e-4da4-bbcb-a45ebexample --target-configurations OfferingId=b747b472-423c-48f3-8cee-679bcexample Output:: { "ExchangeId": "riex-e68ed3c1-8bc8-4c17-af77-811afexample" }awscli-1.14.44/awscli/examples/ec2/accept-vpc-endpoint-connections.rst0000666454262600001440000000051613243367510026715 0ustar pysdk-ciamazon00000000000000**To accept an interface endpoint connection request** This example accepts the specified endpoint connection request for the specified endpoint service. Command:: aws ec2 accept-vpc-endpoint-connections --service-id vpce-svc-03d5ebb7d9579a2b3 --vpc-endpoint-ids vpce-0c1308d7312217abc Output:: { "Unsuccessful": [] }awscli-1.14.44/awscli/examples/ec2/describe-stale-security-groups.rst0000666454262600001440000000405113243367510026600 0ustar pysdk-ciamazon00000000000000**To describe stale security groups** This example describes stale security group rules for ``vpc-11223344``. The response shows that sg-5fa68d3a in your account has a stale ingress SSH rule that references ``sg-279ab042`` in the peer VPC, and that ``sg-fe6fba9a`` in your account has a stale egress SSH rule that references ``sg-ef6fba8b`` in the peer VPC. Command:: aws ec2 describe-stale-security-groups --vpc-id vpc-11223344 Output:: { "StaleSecurityGroupSet": [ { "VpcId": "vpc-11223344", "StaleIpPermissionsEgress": [ { "ToPort": 22, "FromPort": 22, "UserIdGroupPairs": [ { "VpcId": "vpc-7a20e51f", "GroupId": "sg-ef6fba8b", "VpcPeeringConnectionId": "pcx-b04deed9", "PeeringStatus": "active" } ], "IpProtocol": "tcp" } ], "GroupName": "MySG1", "StaleIpPermissions": [], "GroupId": "sg-fe6fba9a", "Description": MySG1" }, { "VpcId": "vpc-11223344", "StaleIpPermissionsEgress": [], "GroupName": "MySG2", "StaleIpPermissions": [ { "ToPort": 22, "FromPort": 22, "UserIdGroupPairs": [ { "VpcId": "vpc-7a20e51f", "GroupId": "sg-279ab042", "Description": "Access from pcx-b04deed9", "VpcPeeringConnectionId": "pcx-b04deed9", "PeeringStatus": "active" } ], "IpProtocol": "tcp" } ], "GroupId": "sg-5fa68d3a", "Description": "MySG2" } ] }awscli-1.14.44/awscli/examples/ec2/disable-vpc-classic-link.rst0000666454262600001440000000030313243367510025267 0ustar pysdk-ciamazon00000000000000**To disable ClassicLink for a VPC** This example disables ClassicLink for vpc-8888888. Command:: aws ec2 disable-vpc-classic-link --vpc-id vpc-88888888 Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/create-placement-group.rst0000666454262600001440000000030113243367510025065 0ustar pysdk-ciamazon00000000000000**To create a placement group** This example command creates a placement group with the specified name. Command:: aws ec2 create-placement-group --group-name my-cluster --strategy cluster awscli-1.14.44/awscli/examples/ec2/detach-vpn-gateway.rst0000666454262600001440000000043013243367510024215 0ustar pysdk-ciamazon00000000000000**To detach a virtual private gateway from your VPC** This example detaches the specified virtual private gateway from the specified VPC. If the command succeeds, no output is returned. Command:: aws ec2 detach-vpn-gateway --vpn-gateway-id vgw-9a4cacf3 --vpc-id vpc-a01106c2 awscli-1.14.44/awscli/examples/ec2/stop-instances.rst0000666454262600001440000000140713243367510023504 0ustar pysdk-ciamazon00000000000000**To stop an Amazon EC2 instance** This example stops the specified Amazon EBS-backed instance. Command:: aws ec2 stop-instances --instance-ids i-1234567890abcdef0 Output:: { "StoppingInstances": [ { "InstanceId": "i-1234567890abcdef0", "CurrentState": { "Code": 64, "Name": "stopping" }, "PreviousState": { "Code": 16, "Name": "running" } } ] } For more information, see `Stop and Start Your Instance`_ in the *Amazon Elastic Compute Cloud User Guide*. .. _`Stop and Start Your Instance`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html awscli-1.14.44/awscli/examples/ec2/create-default-vpc.rst0000666454262600001440000000064113243367510024204 0ustar pysdk-ciamazon00000000000000**To create a default VPC** This example creates a default VPC. Command:: aws ec2 create-default-vpc Output:: { "Vpc": { "VpcId": "vpc-8eaae5ea", "InstanceTenancy": "default", "Tags": [], "Ipv6CidrBlockAssociationSet": [], "State": "pending", "DhcpOptionsId": "dopt-af0c32c6", "CidrBlock": "172.31.0.0/16", "IsDefault": true } }awscli-1.14.44/awscli/examples/ec2/purchase-scheduled-instances.rst0000666454262600001440000000241113243367510026263 0ustar pysdk-ciamazon00000000000000**To purchase a Scheduled Instance** This example purchases a Scheduled Instance. Command:: aws ec2 purchase-scheduled-instances --purchase-requests file://purchase-request.json Purchase-request.json:: [ { "PurchaseToken": "eyJ2IjoiMSIsInMiOjEsImMiOi...", "InstanceCount": 1 } ] Output:: { "ScheduledInstanceSet": [ { "AvailabilityZone": "us-west-2b", "ScheduledInstanceId": "sci-1234-1234-1234-1234-123456789012", "HourlyPrice": "0.095", "CreateDate": "2016-01-25T21:43:38.612Z", "Recurrence": { "OccurrenceDaySet": [ 1 ], "Interval": 1, "Frequency": "Weekly", "OccurrenceRelativeToEnd": false, "OccurrenceUnit": "" }, "Platform": "Linux/UNIX", "TermEndDate": "2017-01-31T09:00:00Z", "InstanceCount": 1, "SlotDurationInHours": 32, "TermStartDate": "2016-01-31T09:00:00Z", "NetworkPlatform": "EC2-VPC", "TotalScheduledInstanceHours": 1696, "NextSlotStartTime": "2016-01-31T09:00:00Z", "InstanceType": "c4.large" } ] } awscli-1.14.44/awscli/examples/ec2/deregister-image.rst0000666454262600001440000000026513243367510023750 0ustar pysdk-ciamazon00000000000000**To deregister an AMI** This example deregisters the specified AMI. If the command succeeds, no output is returned. Command:: aws ec2 deregister-image --image-id ami-4fa54026 awscli-1.14.44/awscli/examples/ec2/describe-availability-zones.rst0000666454262600001440000000144213243367510026115 0ustar pysdk-ciamazon00000000000000**To describe your Availability Zones** This example describes the Availability Zones that are available to you. The response includes Availability Zones only for the current region. Command:: aws ec2 describe-availability-zones Output:: { "AvailabilityZones": [ { "State": "available", "RegionName": "us-east-1", "Messages": [], "ZoneName": "us-east-1b" }, { "State": "available", "RegionName": "us-east-1", "Messages": [], "ZoneName": "us-east-1c" }, { "State": "available", "RegionName": "us-east-1", "Messages": [], "ZoneName": "us-east-1d" } ] } awscli-1.14.44/awscli/examples/ec2/modify-vpc-endpoint-service-permissions.rst0000666454262600001440000000116113243367510030431 0ustar pysdk-ciamazon00000000000000**To modify endpoint service permissions** This example adds permission for an AWS account to connect to the specified endpoint service. Command:: aws ec2 modify-vpc-endpoint-service-permissions --service-id vpce-svc-03d5ebb7d9579a2b3 --add-allowed-principals '["arn:aws:iam::123456789012:root"]' Output:: { "ReturnValue": true } This example adds permission for a specific IAM user (``admin``) to connect to the specified endpoint service. Command:: aws ec2 modify-vpc-endpoint-service-permissions --service-id vpce-svc-03d5ebb7d9579a2b3 --add-allowed-principals '["arn:aws:iam::123456789012:user/admin"]' awscli-1.14.44/awscli/examples/ec2/revoke-security-group-ingress.rst0000666454262600001440000000202413243367510026470 0ustar pysdk-ciamazon00000000000000**To remove a rule from a security group** This example removes TCP port 22 access for the ``203.0.113.0/24`` address range from the security group named ``MySecurityGroup``. If the command succeeds, no output is returned. Command:: aws ec2 revoke-security-group-ingress --group-name MySecurityGroup --protocol tcp --port 22 --cidr 203.0.113.0/24 **[EC2-VPC] To remove a rule using the IP permissions set** This example uses the ``ip-permissions`` parameter to remove an inbound rule that allows the ICMP message ``Destination Unreachable: Fragmentation Needed and Don't Fragment was Set`` (Type 3, Code 4). If the command succeeds, no output is returned. For more information about quoting JSON-formatted parameters, see `Quoting Strings`_. Command:: aws ec2 revoke-security-group-ingress --group-id sg-123abc12 --ip-permissions '[{"IpProtocol": "icmp", "FromPort": 3, "ToPort": 4, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]}]' .. _`Quoting Strings`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#quoting-stringsawscli-1.14.44/awscli/examples/ec2/create-vpn-gateway.rst0000666454262600001440000000154413243367510024237 0ustar pysdk-ciamazon00000000000000**To create a virtual private gateway** This example creates a virtual private gateway. Command:: aws ec2 create-vpn-gateway --type ipsec.1 Output:: { "VpnGateway": { "AmazonSideAsn": 64512, "State": "available", "Type": "ipsec.1", "VpnGatewayId": "vgw-9a4cacf3", "VpcAttachments": [] } } **To create a virtual private gateway with a specific Amazon-side ASN** This example creates a virtual private gateway and specifies the Autonomous System Number (ASN) for the Amazon side of the BGP session. Command:: aws ec2 create-vpn-gateway --type ipsec.1 --amazon-side-asn 65001 Output:: { "VpnGateway": { "AmazonSideAsn": 65001, "State": "available", "Type": "ipsec.1", "VpnGatewayId": "vgw-9a4cacf3", "VpcAttachments": [] } }awscli-1.14.44/awscli/examples/ec2/start-instances.rst0000666454262600001440000000141013243367510023646 0ustar pysdk-ciamazon00000000000000**To start an Amazon EC2 instance** This example starts the specified Amazon EBS-backed instance. Command:: aws ec2 start-instances --instance-ids i-1234567890abcdef0 Output:: { "StartingInstances": [ { "InstanceId": "i-1234567890abcdef0", "CurrentState": { "Code": 0, "Name": "pending" }, "PreviousState": { "Code": 80, "Name": "stopped" } } ] } For more information, see `Stop and Start Your Instance`_ in the *Amazon Elastic Compute Cloud User Guide*. .. _`Stop and Start Your Instance`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html awscli-1.14.44/awscli/examples/ec2/describe-regions.rst0000666454262600001440000000517713243367510023766 0ustar pysdk-ciamazon00000000000000**To describe your regions** This example describes all the regions that are available to you. Command:: aws ec2 describe-regions Output:: { "Regions": [ { "Endpoint": "ec2.eu-west-1.amazonaws.com", "RegionName": "eu-west-1" }, { "Endpoint": "ec2.ap-south-1.amazonaws.com", "RegionName": "ap-south-1" }, { "Endpoint": "ec2.ap-southeast-1.amazonaws.com", "RegionName": "ap-southeast-1" }, { "Endpoint": "ec2.ap-southeast-2.amazonaws.com", "RegionName": "ap-southeast-2" }, { "Endpoint": "ec2.eu-central-1.amazonaws.com", "RegionName": "eu-central-1" }, { "Endpoint": "ec2.ap-northeast-2.amazonaws.com", "RegionName": "ap-northeast-2" }, { "Endpoint": "ec2.ap-northeast-1.amazonaws.com", "RegionName": "ap-northeast-1" }, { "Endpoint": "ec2.us-east-1.amazonaws.com", "RegionName": "us-east-1" }, { "Endpoint": "ec2.sa-east-1.amazonaws.com", "RegionName": "sa-east-1" }, { "Endpoint": "ec2.us-west-1.amazonaws.com", "RegionName": "us-west-1" }, { "Endpoint": "ec2.us-west-2.amazonaws.com", "RegionName": "us-west-2" } ] } **To describe the regions with an endpoint that has a specific string** This example describes all regions that are available to you that have the string "us" in the endpoint. Command:: aws ec2 describe-regions --filters "Name=endpoint,Values=*us*" Output:: { "Regions": [ { "Endpoint": "ec2.us-east-1.amazonaws.com", "RegionName": "us-east-1" }, { "Endpoint": "ec2.us-west-2.amazonaws.com", "RegionName": "us-west-2" }, { "Endpoint": "ec2.us-west-1.amazonaws.com", "RegionName": "us-west-1" }, ] } **To describe region names only** This example uses the ``--query`` parameter to filter the output and return the names of the regions only. The output is returned as tab-delimited lines. Command:: aws ec2 describe-regions --query 'Regions[].{Name:RegionName}' --output text Output:: ap-south-1 eu-west-1 ap-southeast-1 ap-southeast-2 eu-central-1 ap-northeast-2 ap-northeast-1 us-east-1 sa-east-1 us-west-1 us-west-2 awscli-1.14.44/awscli/examples/ec2/describe-volume-attribute.rst0000666454262600001440000000057713243367510025627 0ustar pysdk-ciamazon00000000000000**To describe a volume attribute** This example command describes the ``autoEnableIo`` attribute of the volume with the ID ``vol-049df61146c4d7901``. Command:: aws ec2 describe-volume-attribute --volume-id vol-049df61146c4d7901 --attribute autoEnableIO Output:: { "AutoEnableIO": { "Value": false }, "VolumeId": "vol-049df61146c4d7901" } awscli-1.14.44/awscli/examples/ec2/describe-spot-price-history.rst0000666454262600001440000000411113243367510026067 0ustar pysdk-ciamazon00000000000000**To describe Spot price history** This example command returns the Spot Price history for m1.xlarge instances for a particular day in January. Command:: aws ec2 describe-spot-price-history --instance-types m1.xlarge --start-time 2014-01-06T07:08:09 --end-time 2014-01-06T08:09:10 Output:: { "SpotPriceHistory": [ { "Timestamp": "2014-01-06T07:10:55.000Z", "ProductDescription": "SUSE Linux", "InstanceType": "m1.xlarge", "SpotPrice": "0.087000", "AvailabilityZone": "us-west-1b" }, { "Timestamp": "2014-01-06T07:10:55.000Z", "ProductDescription": "SUSE Linux", "InstanceType": "m1.xlarge", "SpotPrice": "0.087000", "AvailabilityZone": "us-west-1c" }, { "Timestamp": "2014-01-06T05:42:36.000Z", "ProductDescription": "SUSE Linux (Amazon VPC)", "InstanceType": "m1.xlarge", "SpotPrice": "0.087000", "AvailabilityZone": "us-west-1a" }, ... } **To describe Spot price history for Linux/UNIX Amazon VPC** This example command returns the Spot Price history for m1.xlarge, Linux/UNIX Amazon VPC instances for a particular day in January. Command:: aws ec2 describe-spot-price-history --instance-types m1.xlarge --product-description "Linux/UNIX (Amazon VPC)" --start-time 2014-01-06T07:08:09 --end-time 2014-01-06T08:09:10 Output:: { "SpotPriceHistory": [ { "Timestamp": "2014-01-06T04:32:53.000Z", "ProductDescription": "Linux/UNIX (Amazon VPC)", "InstanceType": "m1.xlarge", "SpotPrice": "0.080000", "AvailabilityZone": "us-west-1a" }, { "Timestamp": "2014-01-05T11:28:26.000Z", "ProductDescription": "Linux/UNIX (Amazon VPC)", "InstanceType": "m1.xlarge", "SpotPrice": "0.080000", "AvailabilityZone": "us-west-1c" } ] }awscli-1.14.44/awscli/examples/ec2/create-key-pair.rst0000666454262600001440000000066313243367510023517 0ustar pysdk-ciamazon00000000000000**To create a key pair** This example creates a key pair named ``MyKeyPair``. Command:: aws ec2 create-key-pair --key-name MyKeyPair The output is an ASCII version of the private key and key fingerprint. You need to save the key to a file. For more information, see `Using Key Pairs`_ in the *AWS Command Line Interface User Guide*. .. _`Using Key Pairs`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html awscli-1.14.44/awscli/examples/ec2/modify-vpc-endpoint-connection-notification.rst0000666454262600001440000000062713243367510031251 0ustar pysdk-ciamazon00000000000000**To modify an endpoint connection notification** This example changes the SNS topic for the specified endpoint connection notification. Command:: aws ec2 modify-vpc-endpoint-connection-notification --connection-notification-id vpce-nfn-008776de7e03f5abc --connection-events Accept Reject --connection-notification-arn arn:aws:sns:us-east-2:123456789012:mytopic Output:: { "ReturnValue": true }awscli-1.14.44/awscli/examples/ec2/delete-vpc-peering-connection.rst0000666454262600001440000000035013243367510026342 0ustar pysdk-ciamazon00000000000000**To delete a VPC peering connection** This example deletes the specified VPC peering connection. Command:: aws ec2 delete-vpc-peering-connection --vpc-peering-connection-id pcx-1a2b3c4d Output:: { "Return": true } awscli-1.14.44/awscli/examples/ec2/revoke-security-group-egress.rst0000666454262600001440000000137013243367510026311 0ustar pysdk-ciamazon00000000000000**To remove the rule that allows outbound traffic to a specific address range** This example command removes the rule that grants access to the specified address ranges on TCP port 80. Command:: aws ec2 revoke-security-group-egress --group-id sg-1a2b3c4d --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 80, "ToPort": 80, "IpRanges": [{"CidrIp": "10.0.0.0/16"}]}]' **To remove the rule that allows outbound traffic to a specific security group** This example command removes the rule that grants access to the specified security group on TCP port 80. Command:: aws ec2 revoke-security-group-egress --group-id sg-1a2b3c4d --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 80, "ToPort": 80, "UserIdGroupPairs": [{"GroupId": "sg-4b51a32f"}]}]' awscli-1.14.44/awscli/examples/ec2/modify-volume-attribute.rst0000666454262600001440000000044513243367510025330 0ustar pysdk-ciamazon00000000000000**To modify a volume attribute** This example sets the ``autoEnableIo`` attribute of the volume with the ID ``vol-1234567890abcdef0`` to ``true``. If the command succeeds, no output is returned. Command:: aws ec2 modify-volume-attribute --volume-id vol-1234567890abcdef0 --auto-enable-io awscli-1.14.44/awscli/examples/ec2/modify-vpc-attribute.rst0000666454262600001440000000164213243367510024611 0ustar pysdk-ciamazon00000000000000**To modify the enableDnsSupport attribute** This example modifies the ``enableDnsSupport`` attribute. This attribute indicates whether DNS resolution is enabled for the VPC. If this attribute is ``true``, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not. If the command succeeds, no output is returned. Command:: aws ec2 modify-vpc-attribute --vpc-id vpc-a01106c2 --enable-dns-support "{\"Value\":false}" **To modify the enableDnsHostnames attribute** This example modifies the ``enableDnsHostnames`` attribute. This attribute indicates whether instances launched in the VPC get DNS hostnames. If this attribute is ``true``, instances in the VPC get DNS hostnames; otherwise, they do not. If the command succeeds, no output is returned. Command:: aws ec2 modify-vpc-attribute --vpc-id vpc-a01106c2 --enable-dns-hostnames "{\"Value\":false}" awscli-1.14.44/awscli/examples/ec2/detach-classic-link-vpc.rst0000666454262600001440000000041713243367510025122 0ustar pysdk-ciamazon00000000000000**To unlink (detach) an EC2-Classic instance from a VPC** This example unlinks instance i-0598c7d356eba48d7 from VPC vpc-88888888. Command:: aws ec2 detach-classic-link-vpc --instance-id i-0598c7d356eba48d7 --vpc-id vpc-88888888 Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/describe-vpcs.rst0000666454262600001440000000634713243367510023273 0ustar pysdk-ciamazon00000000000000**To describe your VPCs** This example describes your VPCs. Command:: aws ec2 describe-vpcs Output:: { "Vpcs": [ { "VpcId": "vpc-a01106c2", "InstanceTenancy": "default", "Tags": [ { "Value": "MyVPC", "Key": "Name" } ], "CidrBlockAssociations": [ { "AssociationId": "vpc-cidr-assoc-dbd28eb3", "CidrBlock": "10.0.0.0/16", "CidrBlockState": { "State": "associated" } } ], "State": "available", "DhcpOptionsId": "dopt-7a8b9c2d", "CidrBlock": "10.0.0.0/16", "IsDefault": false }, { "VpcId": "vpc-b61106d4", "InstanceTenancy": "dedicated", "CidrBlockAssociations": [ { "AssociationId": "vpc-cidr-assoc-6e42b505", "CidrBlock": "10.50.0.0/16", "CidrBlockState": { "State": "associated" } } ], "State": "available", "DhcpOptionsId": "dopt-97eb5efa", "CidrBlock": "10.50.0.0/16", "IsDefault": false }, { "VpcId": "vpc-a45db1c0", "InstanceTenancy": "default", "CidrBlockAssociations": [ { "AssociationId": "vpc-cidr-assoc-42d6132b", "CidrBlock": "198.168.0.0/24", "CidrBlockState": { "State": "associated" } } ], "Ipv6CidrBlockAssociationSet": [ { "Ipv6CidrBlock": "2001:db8:1234:8800::/56", "AssociationId": "vpc-cidr-assoc-e5a5408c", "Ipv6CidrBlockState": { "State": "associated" } } ], "State": "available", "DhcpOptionsId": "dopt-dbedadb2", "CidrBlock": "198.168.0.0/24", "IsDefault": false } ] } **To describe a specific VPC** This example describes the specified VPC. Command:: aws ec2 describe-vpcs --vpc-ids vpc-a01106c2 Output:: { "Vpcs": [ { "VpcId": "vpc-a01106c2", "InstanceTenancy": "default", "Tags": [ { "Value": "MyVPC", "Key": "Name" } ], "CidrBlockAssociations": [ { "AssociationId": "vpc-cidr-assoc-a26a41ca", "CidrBlock": "10.0.0.0/16", "CidrBlockState": { "State": "associated" } } ], "State": "available", "DhcpOptionsId": "dopt-7a8b9c2d", "CidrBlock": "10.0.0.0/16", "IsDefault": false } ] }awscli-1.14.44/awscli/examples/ec2/enable-vpc-classic-link.rst0000666454262600001440000000030013243367510025107 0ustar pysdk-ciamazon00000000000000**To enable a VPC for ClassicLink** This example enables vpc-8888888 for ClassicLink. Command:: aws ec2 enable-vpc-classic-link --vpc-id vpc-88888888 Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/report-instance-status.rst0000666454262600001440000000036313243367510025170 0ustar pysdk-ciamazon00000000000000**To report status feedback for an instance** This example command reports status feedback for the specified instance. Command:: aws ec2 report-instance-status --instances i-1234567890abcdef0 --status impaired --reason-codes unresponsive awscli-1.14.44/awscli/examples/ec2/modify-network-interface-attribute.rst0000666454262600001440000000223513243367510027447 0ustar pysdk-ciamazon00000000000000**To modify the attachment attribute of a network interface** This example command modifies the ``attachment`` attribute of the specified network interface. Command:: aws ec2 modify-network-interface-attribute --network-interface-id eni-686ea200 --attachment AttachmentId=eni-attach-43348162,DeleteOnTermination=false **To modify the description attribute of a network interface** This example command modifies the ``description`` attribute of the specified network interface. Command:: aws ec2 modify-network-interface-attribute --network-interface-id eni-686ea200 --description "My description" **To modify the groupSet attribute of a network interface** This example command modifies the ``groupSet`` attribute of the specified network interface. Command:: aws ec2 modify-network-interface-attribute --network-interface-id eni-686ea200 --groups sg-903004f8 sg-1a2b3c4d **To modify the sourceDestCheck attribute of a network interface** This example command modifies the ``sourceDestCheck`` attribute of the specified network interface. Command:: aws ec2 modify-network-interface-attribute --network-interface-id eni-686ea200 --no-source-dest-check awscli-1.14.44/awscli/examples/ec2/run-scheduled-instances.rst0000666454262600001440000000255313243367510025264 0ustar pysdk-ciamazon00000000000000**To launch a Scheduled Instance** This example launches the specified Scheduled Instance in a VPC. Command:: aws ec2 run-scheduled-instances --scheduled-instance-id sci-1234-1234-1234-1234-123456789012 --instance-count 1 --launch-specification file://launch-specification.json Launch-specification.json:: { "ImageId": "ami-12345678", "KeyName": "my-key-pair", "InstanceType": "c4.large", "NetworkInterfaces": [ { "DeviceIndex": 0, "SubnetId": "subnet-12345678", "AssociatePublicIpAddress": true, "Groups": ["sg-12345678"] } ], "IamInstanceProfile": { "Name": "my-iam-role" } } Output:: { "InstanceIdSet": [ "i-1234567890abcdef0" ] } This example launches the specified Scheduled Instance in EC2-Classic. Command:: aws ec2 run-scheduled-instances --scheduled-instance-id sci-1234-1234-1234-1234-123456789012 --instance-count 1 --launch-specification file://launch-specification.json Launch-specification.json:: { "ImageId": "ami-12345678", "KeyName": "my-key-pair", "SecurityGroupIds": ["sg-12345678"], "InstanceType": "c4.large", "Placement": { "AvailabilityZone": "us-west-2b" } "IamInstanceProfile": { "Name": "my-iam-role" } } Output:: { "InstanceIdSet": [ "i-1234567890abcdef0" ] } awscli-1.14.44/awscli/examples/ec2/describe-spot-fleet-requests.rst0000666454262600001440000001150313243367510026241 0ustar pysdk-ciamazon00000000000000**To describe your Spot fleet requests** This example describes all of your Spot fleet requests. Command:: aws ec2 describe-spot-fleet-requests Output:: { "SpotFleetRequestConfigs": [ { "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", "SpotFleetRequestConfig": { "TargetCapacity": 20, "LaunchSpecifications": [ { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-a61dafcf", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "cc2.8xlarge", "ImageId": "ami-1a2b3c4d" }, { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-a61dafcf", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "r3.8xlarge", "ImageId": "ami-1a2b3c4d" } ], "SpotPrice": "0.05", "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role" }, "SpotFleetRequestState": "active" }, { "SpotFleetRequestId": "sfr-306341ed-9739-402e-881b-ce47bEXAMPLE", "SpotFleetRequestConfig": { "TargetCapacity": 20, "LaunchSpecifications": [ { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-6e7f829e", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "m3.medium", "ImageId": "ami-1a2b3c4d" } ], "SpotPrice": "0.05", "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role" }, "SpotFleetRequestState": "active" } ] } **To describe a Spot fleet request** This example describes the specified Spot fleet request. Command:: aws ec2 describe-spot-fleet-requests --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE Output:: { "SpotFleetRequestConfigs": [ { "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", "SpotFleetRequestConfig": { "TargetCapacity": 20, "LaunchSpecifications": [ { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-a61dafcf", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "cc2.8xlarge", "ImageId": "ami-1a2b3c4d" }, { "EbsOptimized": false, "NetworkInterfaces": [ { "SubnetId": "subnet-a61dafcf", "DeviceIndex": 0, "DeleteOnTermination": false, "AssociatePublicIpAddress": true, "SecondaryPrivateIpAddressCount": 0 } ], "InstanceType": "r3.8xlarge", "ImageId": "ami-1a2b3c4d" } ], "SpotPrice": "0.05", "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role" }, "SpotFleetRequestState": "active" } ] } awscli-1.14.44/awscli/examples/ec2/create-default-subnet.rst0000666454262600001440000000115413243367510024714 0ustar pysdk-ciamazon00000000000000**To create a default subnet** This example creates a default subnet in Availability Zone ``us-east-2a``. Command:: aws ec2 create-default-subnet --availability-zone us-east-2a { "Subnet": { "AvailabilityZone": "us-east-2a", "Tags": [], "AvailableIpAddressCount": 4091, "DefaultForAz": true, "Ipv6CidrBlockAssociationSet": [], "VpcId": "vpc-1a2b3c4d", "State": "available", "MapPublicIpOnLaunch": true, "SubnetId": "subnet-1122aabb", "CidrBlock": "172.31.32.0/20", "AssignIpv6AddressOnCreation": false } }awscli-1.14.44/awscli/examples/ec2/create-vpc-endpoint-service-configuration.rst0000666454262600001440000000223513243367510030704 0ustar pysdk-ciamazon00000000000000**To create an endpoint service configuration** This example creates a VPC endpoint service configuration using the load balancer ``nlb-vpce``. This example also specifies that requests to connect to the service through an interface endpoint must be accepted. Command:: aws ec2 create-vpc-endpoint-service-configuration --network-load-balancer-arns arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/net/nlb-vpce/e94221227f1ba532 --acceptance-required Output:: { "ServiceConfiguration": { "ServiceType": [ { "ServiceType": "Interface" } ], "NetworkLoadBalancerArns": [ "arn:aws:elasticloadbalancing:us-east-1:123456789012:loadbalancer/net/nlb-vpce/e94221227f1ba532" ], "ServiceName": "com.amazonaws.vpce.us-east-1.vpce-svc-03d5ebb7d9579a2b3", "ServiceState": "Available", "ServiceId": "vpce-svc-03d5ebb7d9579a2b3", "AcceptanceRequired": true, "AvailabilityZones": [ "us-east-1d" ], "BaseEndpointDnsNames": [ "vpce-svc-03d5ebb7d9579a2b3.us-east-1.vpce.amazonaws.com" ] } }awscli-1.14.44/awscli/examples/ec2/describe-images.rst0000666454262600001440000000360013243367510023552 0ustar pysdk-ciamazon00000000000000**To describe a specific AMI** This example describes the specified AMI. Command:: aws ec2 describe-images --image-ids ami-5731123e Output:: { "Images": [ { "VirtualizationType": "paravirtual", "Name": "My server", "Hypervisor": "xen", "ImageId": "ami-5731123e", "RootDeviceType": "ebs", "State": "available", "BlockDeviceMappings": [ { "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "SnapshotId": "snap-1234567890abcdef0", "VolumeSize": 8, "VolumeType": "standard" } } ], "Architecture": "x86_64", "ImageLocation": "123456789012/My server", "KernelId": "aki-88aa75e1", "OwnerId": "123456789012", "RootDeviceName": "/dev/sda1", "Public": false, "ImageType": "machine", "Description": "An AMI for my server" } ] } **To describe Windows AMIs from Amazon that are backed by Amazon EBS** This example describes Windows AMIs provided by Amazon that are backed by Amazon EBS. Command:: aws ec2 describe-images --owners amazon --filters "Name=platform,Values=windows" "Name=root-device-type,Values=ebs" **To describe tagged AMIs** This example describes all AMIs that have the tag ``Custom=Linux1`` or ``Custom=Ubuntu1``. The output is filtered to display only the AMI IDs. Command:: aws ec2 describe-images --filters Name=tag-key,Values=Custom Name=tag-value,Values=Linux1,Ubuntu1 --query 'Images[*].{ID:ImageId}' Output:: [ { "ID": "ami-1a2b3c4d" }, { "ID": "ami-ab12cd34" } ] awscli-1.14.44/awscli/examples/ec2/create-vpc-endpoint.rst0000666454262600001440000000531613243367510024404 0ustar pysdk-ciamazon00000000000000**To create a gateway endpoint** This example creates a gateway VPC endpoint between VPC ``vpc-1a2b3c4d`` and Amazon S3 in the us-east-1 region, and associates route table ``rtb-11aa22bb`` with the endpoint. Command:: aws ec2 create-vpc-endpoint --vpc-id vpc-1a2b3c4d --service-name com.amazonaws.us-east-1.s3 --route-table-ids rtb-11aa22bb Output:: { "VpcEndpoint": { "PolicyDocument": "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"*\",\"Resource\":\"*\"}]}", "VpcId": "vpc-1a2b3c4d", "State": "available", "ServiceName": "com.amazonaws.us-east-1.s3", "RouteTableIds": [ "rtb-11aa22bb" ], "VpcEndpointId": "vpce-3ecf2a57", "CreationTimestamp": "2015-05-15T09:40:50Z" } } **To create an interface endpoint** This example creates an interface VPC endpoint between VPC ``vpc-1a2b3c4d`` and Elastic Load Balancing in the us-east-1 region. The endpoint is created in subnet ``subnet-7b16de0c``, and security group ``sg-1a2b3c4d`` is associated with the endpoint network interface. Command:: aws ec2 create-vpc-endpoint --vpc-id vpc-1a2b3c4d --vpc-endpoint-type Interface --service-name com.amazonaws.us-east-1.elasticloadbalancing --subnet-id subnet-7b16de0c --security-group-id sg-1a2b3c4d Output:: { "VpcEndpoint": { "PolicyDocument": "{\n \"Statement\": [\n {\n \"Action\": \"*\", \n \"Effect\": \"Allow\", \n \"Principal\": \"*\", \n \"Resource\": \"*\"\n }\n ]\n}", "VpcId": "vpc-1a2b3c4d", "NetworkInterfaceIds": [ "eni-bf8aa46b" ], "SubnetIds": [ "subnet-7b16de0c" ], "PrivateDnsEnabled": true, "State": "pending", "ServiceName": "com.amazonaws.us-east-1.elasticloadbalancing", "RouteTableIds": [], "Groups": [ { "GroupName": "default", "GroupId": "sg-1a2b3c4d" } ], "VpcEndpointId": "vpce-088d25a4bbf4a7e66", "VpcEndpointType": "Interface", "CreationTimestamp": "2017-09-05T20:14:41.240Z", "DnsEntries": [ { "HostedZoneId": "Z7HUB22UULQXV", "DnsName": "vpce-088d25a4bbf4a7e66-ks83awe7.elasticloadbalancing.us-east-1.vpce.amazonaws.com" }, { "HostedZoneId": "Z7HUB22UULQXV", "DnsName": "vpce-088d25a4bbf4a7e66-ks83awe7-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com" }, { "HostedZoneId": "Z1K56Z6FNPJRR", "DnsName": "elasticloadbalancing.us-east-1.amazonaws.com" } ] } }awscli-1.14.44/awscli/examples/ec2/delete-vpc.rst0000666454262600001440000000024413243367510022560 0ustar pysdk-ciamazon00000000000000**To delete a VPC** This example deletes the specified VPC. If the command succeeds, no output is returned. Command:: aws ec2 delete-vpc --vpc-id vpc-a01106c2 awscli-1.14.44/awscli/examples/ec2/describe-tags.rst0000666454262600001440000000725113243367510023251 0ustar pysdk-ciamazon00000000000000**To describe your tags** This example describes the tags for all your resources. Command:: aws ec2 describe-tags Output:: { "Tags": [ { "ResourceType": "image", "ResourceId": "ami-78a54011", "Value": "Production", "Key": "Stack" }, { "ResourceType": "image", "ResourceId": "ami-3ac33653", "Value": "Test", "Key": "Stack" }, { "ResourceType": "instance", "ResourceId": "i-1234567890abcdef0", "Value": "Production", "Key": "Stack" }, { "ResourceType": "instance", "ResourceId": "i-1234567890abcdef1", "Value": "Test", "Key": "Stack" }, { "ResourceType": "instance", "ResourceId": "i-1234567890abcdef5", "Value": "Beta Server", "Key": "Name" }, { "ResourceType": "volume", "ResourceId": "vol-049df61146c4d7901", "Value": "Project1", "Key": "Purpose" }, { "ResourceType": "volume", "ResourceId": "vol-1234567890abcdef0", "Value": "Logs", "Key": "Purpose" } ] } **To describe the tags for a single resource** This example describes the tags for the specified instance. Command:: aws ec2 describe-tags --filters "Name=resource-id,Values=i-1234567890abcdef8" Output:: { "Tags": [ { "ResourceType": "instance", "ResourceId": "i-1234567890abcdef8", "Value": "Test", "Key": "Stack" }, { "ResourceType": "instance", "ResourceId": "i-1234567890abcdef8", "Value": "Beta Server", "Key": "Name" } ] } **To describe the tags for a type of resource** This example describes the tags for your volumes. Command:: aws ec2 describe-tags --filters "Name=resource-type,Values=volume" Output:: { "Tags": [ { "ResourceType": "volume", "ResourceId": "vol-1234567890abcdef0", "Value": "Project1", "Key": "Purpose" }, { "ResourceType": "volume", "ResourceId": "vol-049df61146c4d7901", "Value": "Logs", "Key": "Purpose" } ] } **To describe the tags for your resources based on a key and a value** This example describes the tags for your resources that have the key ``Stack`` and a value ``Test``. Command:: aws ec2 describe-tags --filters "Name=key,Values=Stack" "Name=value,Values=Test" Output:: { "Tags": [ { "ResourceType": "image", "ResourceId": "ami-3ac33653", "Value": "Test", "Key": "Stack" }, { "ResourceType": "instance", "ResourceId": "i-1234567890abcdef8", "Value": "Test", "Key": "Stack" } ] } This example describes the tags for all your instances that have a tag with the key ``Purpose`` and no value. Command:: aws ec2 describe-tags --filters "Name=resource-type,Values=instance" "Name=key,Values=Purpose" "Name=value,Values=" Output:: { "Tags": [ { "ResourceType": "instance", "ResourceId": "i-1234567890abcdef5", "Value": null, "Key": "Purpose" } ] } awscli-1.14.44/awscli/examples/ec2/describe-hosts.rst0000666454262600001440000000264513243367510023455 0ustar pysdk-ciamazon00000000000000**To describe Dedicated hosts in your account and generate a machine-readable list** To output a list of Dedicated host IDs in JSON (comma separated). Command:: aws ec2 describe-hosts --query 'Hosts[].HostId' --output json Output:: [ "h-085664df5899941c", "h-056c1b0724170dc38" ] To output a list of Dedicated host IDs in plaintext (comma separated). Command:: aws ec2 describe-hosts --query 'Hosts[].HostId' --output text Output:: h-085664df5899941c h-056c1b0724170dc38 **To describe available Dedicated hosts in your account** Command:: aws ec2 describe-hosts --filter "Name=state,Values=available" Output:: { "Hosts": [ { "HostId": "h-085664df5899941c" "HostProperties: { "Cores": 20, "Sockets": 2, "InstanceType": "m3.medium". "TotalVCpus": 32 }, "Instances": [], "State": "available", "AvailabilityZone": "us-east-1b", "AvailableCapacity": { "AvailableInstanceCapacity": [ { "AvailableCapacity": 32, "InstanceType": "m3.medium", "TotalCapacity": 32 } ], "AvailableVCpus": 32 }, "AutoPlacement": "off" } ] } awscli-1.14.44/awscli/examples/ec2/attach-vpn-gateway.rst0000666454262600001440000000053213243367510024234 0ustar pysdk-ciamazon00000000000000**To attach a virtual private gateway to your VPC** This example attaches the specified virtual private gateway to the specified VPC. Command:: aws ec2 attach-vpn-gateway --vpn-gateway-id vgw-9a4cacf3 --vpc-id vpc-a01106c2 Output:: { "VpcAttachement": { "State": "attaching", "VpcId": "vpc-a01106c2" } }awscli-1.14.44/awscli/examples/ec2/create-fpga-image.rst0000666454262600001440000000070313243367510023766 0ustar pysdk-ciamazon00000000000000**To create an Amazon FPGA image** This example creates an AFI from the specified tarball in the specified bucket. Command:: aws ec2 create-fpga-image --name my-afi --description test-afi --input-storage-location Bucket=my-fpga-bucket,Key=dcp/17_12_22-103226.Developer_CL.tar --logs-storage-location Bucket=my-fpga-bucket,Key=logs Output:: { "FpgaImageId": "afi-0d123e123bfc85abc", "FpgaImageGlobalId": "agfi-123cb27b5e84a0abc" } awscli-1.14.44/awscli/examples/ec2/confirm-product-instance.rst0000666454262600001440000000044413243367510025447 0ustar pysdk-ciamazon00000000000000**To confirm the product instance** This example determines whether the specified product code is associated with the specified instance. Command:: aws ec2 confirm-product-instance --product-code 774F4FF8 --instance-id i-1234567890abcdef0 Output:: { "OwnerId": "123456789012" }awscli-1.14.44/awscli/examples/ec2/describe-placement-groups.rst0000666454262600001440000000054213243367510025574 0ustar pysdk-ciamazon00000000000000**To describe your placement groups** This example command describes all of your placement groups. Command:: aws ec2 describe-placement-groups Output:: { "PlacementGroups": [ { "GroupName": "my-cluster", "State": "available", "Strategy": "cluster" }, ... ] } awscli-1.14.44/awscli/examples/ec2/attach-classic-link-vpc.rst0000666454262600001440000000051013243367510025130 0ustar pysdk-ciamazon00000000000000**To link (attach) an EC2-Classic instance to a VPC** This example links instance i-1234567890abcdef0 to VPC vpc-88888888 through the VPC security group sg-12312312. Command:: aws ec2 attach-classic-link-vpc --instance-id i-1234567890abcdef0 --vpc-id vpc-88888888 --groups sg-12312312 Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/create-snapshot.rst0000666454262600001440000000115113243367510023626 0ustar pysdk-ciamazon00000000000000**To create a snapshot** This example command creates a snapshot of the volume with a volume ID of ``vol-1234567890abcdef0`` and a short description to identify the snapshot. Command:: aws ec2 create-snapshot --volume-id vol-1234567890abcdef0 --description "This is my root volume snapshot." Output:: { "Description": "This is my root volume snapshot.", "Tags": [], "VolumeId": "vol-1234567890abcdef0", "State": "pending", "VolumeSize": 8, "StartTime": "2014-02-28T21:06:01.000Z", "OwnerId": "012345678910", "SnapshotId": "snap-066877671789bd71b" }awscli-1.14.44/awscli/examples/ec2/register-image.rst0000666454262600001440000000174713243367510023445 0ustar pysdk-ciamazon00000000000000**To register an AMI using a manifest file** This example registers an AMI using the specified manifest file in Amazon S3. Command:: aws ec2 register-image --image-location my-s3-bucket/myimage/image.manifest.xml --name "MyImage" Output:: { "ImageId": "ami-61341708" } **To add a block device mapping** Add the following parameter to your ``register-image`` command to add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100:: --block-device-mappings "[{\"DeviceName\": \"/dev/sdh\",\"Ebs\":{\"VolumeSize\":100}}]" Add the following parameter to your ``register-image`` command to add ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``:: --block-device-mappings "[{\"DeviceName\": \"/dev/sdc\",\"VirtualName\":\"ephemeral1\"}]" Add the following parameter to your ``register-image`` command to omit a device (for example, ``/dev/sdf``):: --block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"NoDevice\":\"\"}]" awscli-1.14.44/awscli/examples/ec2/request-spot-fleet.rst0000666454262600001440000001200313243367510024274 0ustar pysdk-ciamazon00000000000000**To request a Spot fleet in the subnet with the lowest price** This example command creates a Spot fleet request with two launch specifications that differ only by subnet. The Spot fleet launches the instances in the specified subnet with the lowest price. If the instances are launched in a default VPC, they receive a public IP address by default. If the instances are launched in a nondefault VPC, they do not receive a public IP address by default. Note that you can't specify different subnets from the same Availability Zone in a Spot fleet request. Command:: aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json Config.json:: { "SpotPrice": "0.04", "TargetCapacity": 2, "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role", "LaunchSpecifications": [ { "ImageId": "ami-1a2b3c4d", "KeyName": "my-key-pair", "SecurityGroups": [ { "GroupId": "sg-1a2b3c4d" } ], "InstanceType": "m3.medium", "SubnetId": "subnet-1a2b3c4d, subnet-3c4d5e6f", "IamInstanceProfile": { "Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role" } } ] } Output:: { "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE" } **To request a Spot fleet in the Availability Zone with the lowest price** This example command creates a Spot fleet request with two launch specifications that differ only by Availability Zone. The Spot fleet launches the instances in the specified Availability Zone with the lowest price. If your account supports EC2-VPC only, Amazon EC2 launches the Spot instances in the default subnet of the Availability Zone. If your account supports EC2-Classic, Amazon EC2 launches the instances in EC2-Classic in the Availability Zone. Command:: aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json Config.json:: { "SpotPrice": "0.04", "TargetCapacity": 2, "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role", "LaunchSpecifications": [ { "ImageId": "ami-1a2b3c4d", "KeyName": "my-key-pair", "SecurityGroups": [ { "GroupId": "sg-1a2b3c4d" } ], "InstanceType": "m3.medium", "Placement": { "AvailabilityZone": "us-west-2a, us-west-2b" }, "IamInstanceProfile": { "Arn": "arn:aws:iam::123456789012:instance-profile/my-iam-role" } } ] } **To launch Spot instances in a subnet and assign them public IP addresses** This example command assigns public addresses to instances launched in a nondefault VPC. Note that when you specify a network interface, you must include the subnet ID and security group ID using the network interface. Command:: aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json Config.json:: { "SpotPrice": "0.04", "TargetCapacity": 2, "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role", "LaunchSpecifications": [ { "ImageId": "ami-1a2b3c4d", "KeyName": "my-key-pair", "InstanceType": "m3.medium", "NetworkInterfaces": [ { "DeviceIndex": 0, "SubnetId": "subnet-1a2b3c4d", "Groups": [ "sg-1a2b3c4d" ], "AssociatePublicIpAddress": true } ], "IamInstanceProfile": { "Arn": "arn:aws:iam::880185128111:instance-profile/my-iam-role" } } ] } **To request a Spot fleet using the diversified allocation strategy** This example command creates a Spot fleet request that launches 30 instances using the diversified allocation strategy. The launch specifications differ by instance type. The Spot fleet distributes the instances across the launch specifications such that there are 10 instances of each type. Command:: aws ec2 request-spot-fleet --spot-fleet-request-config file://config.json Config.json:: { "SpotPrice": "0.70", "TargetCapacity": 30, "AllocationStrategy": "diversified", "IamFleetRole": "arn:aws:iam::123456789012:role/my-spot-fleet-role", "LaunchSpecifications": [ { "ImageId": "ami-1a2b3c4d", "InstanceType": "c4.2xlarge", "SubnetId": "subnet-1a2b3c4d" }, { "ImageId": "ami-1a2b3c4d", "InstanceType": "m3.2xlarge", "SubnetId": "subnet-1a2b3c4d" }, { "ImageId": "ami-1a2b3c4d", "InstanceType": "r3.2xlarge", "SubnetId": "subnet-1a2b3c4d" } ] } For more information, see `Spot Fleet Requests`_ in the *Amazon Elastic Compute Cloud User Guide*. .. _`Spot Fleet Requests`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html awscli-1.14.44/awscli/examples/ec2/disable-vgw-route-propagation.rst0000666454262600001440000000046713243367510026420 0ustar pysdk-ciamazon00000000000000**To disable route propagation** This example disables the specified virtual private gateway from propagating static routes to the specified route table. If the command succeeds, no output is returned. Command:: aws ec2 disable-vgw-route-propagation --route-table-id rtb-22574640 --gateway-id vgw-9a4cacf3 awscli-1.14.44/awscli/examples/ec2/describe-instance-status.rst0000666454262600001440000000202213243367510025427 0ustar pysdk-ciamazon00000000000000**To describe the status of an instance** This example describes the current status of the specified instance. Command:: aws ec2 describe-instance-status --instance-id i-1234567890abcdef0 Output:: { "InstanceStatuses": [ { "InstanceId": "i-1234567890abcdef0", "InstanceState": { "Code": 16, "Name": "running" }, "AvailabilityZone": "us-east-1d", "SystemStatus": { "Status": "ok", "Details": [ { "Status": "passed", "Name": "reachability" } ] }, "InstanceStatus": { "Status": "ok", "Details": [ { "Status": "passed", "Name": "reachability" } ] } } ] } awscli-1.14.44/awscli/examples/ec2/create-network-acl-entry.rst0000666454262600001440000000141213243367510025354 0ustar pysdk-ciamazon00000000000000**To create a network ACL entry** This example creates an entry for the specified network ACL. The rule allows ingress traffic from any IPv4 address (0.0.0.0/0) on UDP port 53 (DNS) into any associated subnet. If the command succeeds, no output is returned. Command:: aws ec2 create-network-acl-entry --network-acl-id acl-5fb85d36 --ingress --rule-number 100 --protocol udp --port-range From=53,To=53 --cidr-block 0.0.0.0/0 --rule-action allow This example creates a rule for the specified network ACL that allows ingress traffic from any IPv6 address (::/0) on TCP port 80 (HTTP). Command:: aws ec2 create-network-acl-entry --network-acl-id acl-5fb85d36 --ingress --rule-number 120 --protocol tcp --port-range From=80,To=80 --ipv6-cidr-block ::/0 --rule-action allowawscli-1.14.44/awscli/examples/ec2/enable-volume-io.rst0000666454262600001440000000031613243367510023670 0ustar pysdk-ciamazon00000000000000**To enable I/O for a volume** This example enables I/O on volume ``vol-1234567890abcdef0``. Command:: aws ec2 enable-volume-io --volume-id vol-1234567890abcdef0 Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/describe-spot-datafeed-subscription.rst0000666454262600001440000000060113243367510027545 0ustar pysdk-ciamazon00000000000000**To describe Spot Instance datafeed subscription for an account** This example command describes the data feed for the account. Command:: aws ec2 describe-spot-datafeed-subscription Output:: { "SpotDatafeedSubscription": { "OwnerId": "123456789012", "Prefix": "spotdata", "Bucket": "my-s3-bucket", "State": "Active" } } awscli-1.14.44/awscli/examples/ec2/reset-snapshot-attribute.rst0000666454262600001440000000044613243367510025514 0ustar pysdk-ciamazon00000000000000**To reset a snapshot attribute** This example resets the create volume permissions for snapshot ``snap-1234567890abcdef0``. If the command succeeds, no output is returned. Command:: aws ec2 reset-snapshot-attribute --snapshot-id snap-1234567890abcdef0 --attribute createVolumePermission awscli-1.14.44/awscli/examples/ec2/create-nat-gateway.rst0000666454262600001440000000120513243367510024210 0ustar pysdk-ciamazon00000000000000**To create a NAT gateway** This example creates a NAT gateway in subnet ``subnet-1a2b3c4d`` and associates an Elastic IP address with the allocation ID ``eipalloc-37fc1a52`` with the NAT gateway. Command:: aws ec2 create-nat-gateway --subnet-id subnet-1a2b3c4d --allocation-id eipalloc-37fc1a52 Output:: { "NatGateway": { "NatGatewayAddresses": [ { "AllocationId": "eipalloc-37fc1a52" } ], "VpcId": "vpc-1122aabb", "State": "pending", "NatGatewayId": "nat-08d48af2a8e83edfd", "SubnetId": "subnet-1a2b3c4d", "CreateTime": "2015-12-17T12:45:26.732Z" } }awscli-1.14.44/awscli/examples/ec2/cancel-export-task.rst0000666454262600001440000000036013243367510024233 0ustar pysdk-ciamazon00000000000000**To cancel an active export task** This example cancels an active export task with the task ID export-i-fgelt0i7. If the command succeeds, no output is returned. Command:: aws ec2 cancel-export-task --export-task-id export-i-fgelt0i7 awscli-1.14.44/awscli/examples/ec2/describe-scheduled-instance-availability.rst0000666454262600001440000000261613243367510030525 0ustar pysdk-ciamazon00000000000000**To describe an available schedule** This example describes a schedule that occurs every week on Sunday, starting on the specified date. Command:: aws ec2 describe-scheduled-instance-availability --recurrence Frequency=Weekly,Interval=1,OccurrenceDays=[1] --first-slot-start-time-range EarliestTime=2016-01-31T00:00:00Z,LatestTime=2016-01-31T04:00:00Z Output:: { "ScheduledInstanceAvailabilitySet": [ { "AvailabilityZone": "us-west-2b", "TotalScheduledInstanceHours": 1219, "PurchaseToken": "eyJ2IjoiMSIsInMiOjEsImMiOi...", "MinTermDurationInDays": 366, "AvailableInstanceCount": 20, "Recurrence": { "OccurrenceDaySet": [ 1 ], "Interval": 1, "Frequency": "Weekly", "OccurrenceRelativeToEnd": false }, "Platform": "Linux/UNIX", "FirstSlotStartTime": "2016-01-31T00:00:00Z", "MaxTermDurationInDays": 366, "SlotDurationInHours": 23, "NetworkPlatform": "EC2-VPC", "InstanceType": "c4.large", "HourlyPrice": "0.095" }, ... ] } To narrow the results, you can add filters that specify the operating system, network, and instance type. Command: --filters Name=platform,Values=Linux/UNIX Name=network-platform,Values=EC2-VPC Name=instance-type,Values=c4.large awscli-1.14.44/awscli/examples/ec2/create-launch-template-version.rst0000666454262600001440000000237113243367510026542 0ustar pysdk-ciamazon00000000000000**To create a launch template version** This example creates a new launch template version based on version 1 of the launch template and specifies a different AMI ID. Command:: aws ec2 create-launch-template-version --launch-template-id lt-0abcd290751193123 --version-description WebVersion2 --source-version 1 --launch-template-data '{"ImageId":"ami-c998b6b2"}' Output:: { "LaunchTemplateVersion": { "VersionDescription": "WebVersion2", "LaunchTemplateId": "lt-0abcd290751193123", "LaunchTemplateName": "WebServers", "VersionNumber": 2, "CreatedBy": "arn:aws:iam::123456789012:root", "LaunchTemplateData": { "ImageId": "ami-c998b6b2", "InstanceType": "t2.micro", "NetworkInterfaces": [ { "Ipv6Addresses": [ { "Ipv6Address": "2001:db8:1234:1a00::123" } ], "DeviceIndex": 0, "SubnetId": "subnet-7b16de0c", "AssociatePublicIpAddress": true } ] }, "DefaultVersion": false, "CreateTime": "2017-12-01T13:35:46.000Z" } }awscli-1.14.44/awscli/examples/ec2/replace-route.rst0000666454262600001440000000057113243367510023302 0ustar pysdk-ciamazon00000000000000**To replace a route** This example replaces the specified route in the specified route table. The new route matches the specified CIDR and sends the traffic to the specified virtual private gateway. If the command succeeds, no output is returned. Command:: aws ec2 replace-route --route-table-id rtb-22574640 --destination-cidr-block 10.0.0.0/16 --gateway-id vgw-9a4cacf3awscli-1.14.44/awscli/examples/ec2/create-egress-only-internet-gateway.rst0000666454262600001440000000072513243367510027531 0ustar pysdk-ciamazon00000000000000**To create an egress-only Internet gateway** This example creates an egress-only Internet gateway for the specified VPC. Command:: aws ec2 create-egress-only-internet-gateway --vpc-id vpc-0c62a468 Output:: { "EgressOnlyInternetGateway": { "EgressOnlyInternetGatewayId": "eigw-015e0e244e24dfe8a", "Attachments": [ { "State": "attached", "VpcId": "vpc-0c62a468" } ] } }awscli-1.14.44/awscli/examples/ec2/describe-vpc-classic-link-dns-support.rst0000666454262600001440000000064013243367510027744 0ustar pysdk-ciamazon00000000000000**To describe ClassicLink DNS support for your VPCs** This example describes the ClassicLink DNS support status of all of your VPCs. Command:: aws ec2 describe-vpc-classic-link-dns-support Output:: { "Vpcs": [ { "VpcId": "vpc-88888888", "ClassicLinkDnsSupported": true }, { "VpcId": "vpc-1a2b3c4d", "ClassicLinkDnsSupported": false } ] }awscli-1.14.44/awscli/examples/ec2/disassociate-iam-instance-profile.rst0000666454262600001440000000114613243367510027211 0ustar pysdk-ciamazon00000000000000**To disassociate an IAM instance profile** This example disassociates an IAM instance profile with the association ID ``iip-assoc-05020b59952902f5f``. Command:: aws ec2 disassociate-iam-instance-profile --association-id iip-assoc-05020b59952902f5f Output:: { "IamInstanceProfileAssociation": { "InstanceId": "i-123456789abcde123", "State": "disassociating", "AssociationId": "iip-assoc-05020b59952902f5f", "IamInstanceProfile": { "Id": "AIPAI5IVIHMFFYY2DKV5Y", "Arn": "arn:aws:iam::123456789012:instance-profile/admin-role" } } } awscli-1.14.44/awscli/examples/ec2/describe-network-interfaces.rst0000666454262600001440000001225713243367510026127 0ustar pysdk-ciamazon00000000000000**To describe your network interfaces** This example describes all your network interfaces. Command:: aws ec2 describe-network-interfaces Output:: { "NetworkInterfaces": [ { "Status": "in-use", "MacAddress": "02:2f:8f:b0:cf:75", "SourceDestCheck": true, "VpcId": "vpc-a01106c2", "Description": "my network interface", "Association": { "PublicIp": "203.0.113.12", "AssociationId": "eipassoc-0fbb766a", "PublicDnsName": "ec2-203-0-113-12.compute-1.amazonaws.com", "IpOwnerId": "123456789012" }, "NetworkInterfaceId": "eni-e5aa89a3", "PrivateIpAddresses": [ { "PrivateDnsName": "ip-10-0-1-17.ec2.internal", "Association": { "PublicIp": "203.0.113.12", "AssociationId": "eipassoc-0fbb766a", "PublicDnsName": "ec2-203-0-113-12.compute-1.amazonaws.com", "IpOwnerId": "123456789012" }, "Primary": true, "PrivateIpAddress": "10.0.1.17" } ], "RequesterManaged": false, "Ipv6Addresses": [], "PrivateDnsName": "ip-10-0-1-17.ec2.internal", "AvailabilityZone": "us-east-1d", "Attachment": { "Status": "attached", "DeviceIndex": 1, "AttachTime": "2013-11-30T23:36:42.000Z", "InstanceId": "i-1234567890abcdef0", "DeleteOnTermination": false, "AttachmentId": "eni-attach-66c4350a", "InstanceOwnerId": "123456789012" }, "Groups": [ { "GroupName": "default", "GroupId": "sg-8637d3e3" } ], "SubnetId": "subnet-b61f49f0", "OwnerId": "123456789012", "TagSet": [], "PrivateIpAddress": "10.0.1.17" }, { "Status": "in-use", "MacAddress": "02:58:f5:ef:4b:06", "SourceDestCheck": true, "VpcId": "vpc-a01106c2", "Description": "Primary network interface", "Association": { "PublicIp": "198.51.100.0", "IpOwnerId": "amazon" }, "NetworkInterfaceId": "eni-f9ba99bf", "PrivateIpAddresses": [ { "Association": { "PublicIp": "198.51.100.0", "IpOwnerId": "amazon" }, "Primary": true, "PrivateIpAddress": "10.0.1.149" } ], "RequesterManaged": false, "Ipv6Addresses": [], "AvailabilityZone": "us-east-1d", "Attachment": { "Status": "attached", "DeviceIndex": 0, "AttachTime": "2013-11-30T23:35:33.000Z", "InstanceId": "i-0598c7d356eba48d7", "DeleteOnTermination": true, "AttachmentId": "eni-attach-1b9db777", "InstanceOwnerId": "123456789012" }, "Groups": [ { "GroupName": "default", "GroupId": "sg-8637d3e3" } ], "SubnetId": "subnet-b61f49f0", "OwnerId": "123456789012", "TagSet": [], "PrivateIpAddress": "10.0.1.149" } ] } This example describes network interfaces that have a tag with the key ``Purpose`` and the value ``Prod``. Command:: aws ec2 describe-network-interfaces --filters Name=tag:Purpose,Values=Prod Output:: { "NetworkInterfaces": [ { "Status": "available", "MacAddress": "12:2c:bd:f9:bf:17", "SourceDestCheck": true, "VpcId": "vpc-8941ebec", "Description": "ProdENI", "NetworkInterfaceId": "eni-b9a5ac93", "PrivateIpAddresses": [ { "PrivateDnsName": "ip-10-0-1-55.ec2.internal", "Primary": true, "PrivateIpAddress": "10.0.1.55" }, { "PrivateDnsName": "ip-10-0-1-117.ec2.internal", "Primary": false, "PrivateIpAddress": "10.0.1.117" } ], "RequesterManaged": false, "PrivateDnsName": "ip-10-0-1-55.ec2.internal", "AvailabilityZone": "us-east-1d", "Ipv6Addresses": [], "Groups": [ { "GroupName": "MySG", "GroupId": "sg-905002f5" } ], "SubnetId": "subnet-31d6c219", "OwnerId": "123456789012", "TagSet": [ { "Value": "Prod", "Key": "Purpose" } ], "PrivateIpAddress": "10.0.1.55" } ] }awscli-1.14.44/awscli/examples/ec2/delete-network-interface-permission.rst0000666454262600001440000000041313243367510027603 0ustar pysdk-ciamazon00000000000000**To delete a network interface permission** This example deletes the specified network interface permission. Command:: aws ec2 delete-network-interface-permission --network-interface-permission-id eni-perm-06fd19020ede149ea Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/authorize-security-group-ingress.rst0000666454262600001440000000766113243367510027223 0ustar pysdk-ciamazon00000000000000**[EC2-Classic] To add a rule that allows inbound SSH traffic** This example enables inbound traffic on TCP port 22 (SSH). If the command succeeds, no output is returned. Command:: aws ec2 authorize-security-group-ingress --group-name MySecurityGroup --protocol tcp --port 22 --cidr 203.0.113.0/24 **[EC2-Classic] To add a rule that allows inbound HTTP traffic from a security group in another account** This example enables inbound traffic on TCP port 80 from a source security group (otheraccountgroup) in a different AWS account (123456789012). Incoming traffic is allowed based on the private IP addresses of instances that are associated with the source security group (not the public IP or Elastic IP addresses). If the command succeeds, no output is returned. Command:: aws ec2 authorize-security-group-ingress --group-name MySecurityGroup --protocol tcp --port 80 --source-group otheraccountgroup --group-owner 123456789012 **[EC2-Classic] To add a rule that allows inbound HTTPS traffic from an ELB** This example enables inbound traffic on TCP port 443 from an ELB. If the command succeeds, no output is returned. Command:: aws ec2 authorize-security-group-ingress --group-name MySecurityGroup --protocol tcp --port 443 --source-group amazon-elb-sg --group-owner amazon-elb **[EC2-VPC] To add a rule that allows inbound SSH traffic** This example enables inbound traffic on TCP port 22 (SSH). Note that you can't reference a security group for EC2-VPC by name. If the command succeeds, no output is returned. Command:: aws ec2 authorize-security-group-ingress --group-id sg-903004f8 --protocol tcp --port 22 --cidr 203.0.113.0/24 **[EC2-VPC] To add a rule that allows inbound HTTP traffic from another security group** This example enables inbound access on TCP port 80 from the source security group sg-1a2b3c4d. Note that for EC2-VPC, the source group must be in the same VPC or in a peer VPC (requires a VPC peering connection). Incoming traffic is allowed based on the private IP addresses of instances that are associated with the source security group (not the public IP or Elastic IP addresses). If the command succeeds, no output is returned. Command:: aws ec2 authorize-security-group-ingress --group-id sg-111aaa22 --protocol tcp --port 80 --source-group sg-1a2b3c4d **[EC2-VPC] To add a custom ICMP rule** This example uses the ``ip-permissions`` parameter to add an inbound rule that allows the ICMP message ``Destination Unreachable: Fragmentation Needed and Don't Fragment was Set`` (Type 3, Code 4) from anywhere. If the command succeeds, no output is returned. For more information about quoting JSON-formatted parameters, see `Quoting Strings`_. Command:: aws ec2 authorize-security-group-ingress --group-id sg-123abc12 --ip-permissions '[{"IpProtocol": "icmp", "FromPort": 3, "ToPort": 4, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]}]' **[EC2-VPC] To add a rule for IPv6 traffic** This example grants SSH access (port 22) from the IPv6 range ``2001:db8:1234:1a00::/64``. Command:: aws ec2 authorize-security-group-ingress --group-id sg-9bf6ceff --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 22, "ToPort": 22, "Ipv6Ranges": [{"CidrIpv6": "2001:db8:1234:1a00::/64"}]}]' **Add a rule with a description** This example uses the ``ip-permissions`` parameter to add an inbound rule that allows RDP traffic from a specific IPv4 address range. The rule includes a description to help you identify it later. Command:: aws ec2 authorize-security-group-ingress --group-id sg-123abc12 --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 3389, "ToPort": 3389, "IpRanges": [{"CidrIp": "203.0.113.0/24", "Description": "RDP access from NY office"}]}]' For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*. .. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html .. _`Quoting Strings`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#quoting-strings awscli-1.14.44/awscli/examples/ec2/describe-nat-gateways.rst0000666454262600001440000000256613243367510024723 0ustar pysdk-ciamazon00000000000000**To describe your NAT gateways** This example describes all of your NAT gateways. Command:: aws ec2 describe-nat-gateways Output:: { "NatGateways": [ { "NatGatewayAddresses": [ { "PublicIp": "198.11.222.333", "NetworkInterfaceId": "eni-9dec76cd", "AllocationId": "eipalloc-89c620ec", "PrivateIp": "10.0.0.149" } ], "VpcId": "vpc-1a2b3c4d", "Tags": [ { "Value": "IT", "Key": "Department" } ], "State": "available", "NatGatewayId": "nat-05dba92075d71c408", "SubnetId": "subnet-847e4dc2", "CreateTime": "2015-12-01T12:26:55.983Z" }, { "NatGatewayAddresses": [ { "PublicIp": "1.2.3.12", "NetworkInterfaceId": "eni-71ec7621", "AllocationId": "eipalloc-5d42583f", "PrivateIp": "10.0.0.77" } ], "VpcId": "vpc-11aa22bb", "Tags": [ { "Value": "Finance", "Key": "Department" } ], "State": "available", "NatGatewayId": "nat-0a93acc57881d4199", "SubnetId": "subnet-7f7e4d39", "CreateTime": "2015-12-01T12:09:22.040Z" } ] }awscli-1.14.44/awscli/examples/ec2/delete-network-interface.rst0000666454262600001440000000033413243367510025417 0ustar pysdk-ciamazon00000000000000**To delete a network interface** This example deletes the specified network interface. If the command succeeds, no output is returned. Command:: aws ec2 delete-network-interface --network-interface-id eni-e5aa89a3 awscli-1.14.44/awscli/examples/ec2/describe-network-acls.rst0000666454262600001440000001273013243367510024722 0ustar pysdk-ciamazon00000000000000**To describe your network ACLs** This example describes your network ACLs. Command:: aws ec2 describe-network-acls Output:: { "NetworkAcls": [ { "Associations": [], "NetworkAclId": "acl-7aaabd18", "VpcId": "vpc-a01106c2", "Tags": [], "Entries": [ { "CidrBlock": "0.0.0.0/0", "RuleNumber": 100, "Protocol": "-1", "Egress": true, "RuleAction": "allow" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": true, "RuleAction": "deny" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 100, "Protocol": "-1", "Egress": false, "RuleAction": "allow" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": false, "RuleAction": "deny" } ], "IsDefault": true }, { "Associations": [], "NetworkAclId": "acl-5fb85d36", "VpcId": "vpc-a01106c2", "Tags": [], "Entries": [ { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": true, "RuleAction": "deny" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": false, "RuleAction": "deny" } ], "IsDefault": false }, { "Associations": [ { "SubnetId": "subnet-6bea5f06", "NetworkAclId": "acl-9aeb5ef7", "NetworkAclAssociationId": "aclassoc-67ea5f0a" }, { "SubnetId": "subnet-65ea5f08", "NetworkAclId": "acl-9aeb5ef7", "NetworkAclAssociationId": "aclassoc-66ea5f0b" } ], "NetworkAclId": "acl-9aeb5ef7", "VpcId": "vpc-98eb5ef5", "Tags": [], "Entries": [ { "CidrBlock": "0.0.0.0/0", "RuleNumber": 100, "Protocol": "-1", "Egress": true, "RuleAction": "allow" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": true, "RuleAction": "deny" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 100, "Protocol": "-1", "Egress": false, "RuleAction": "allow" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": false, "RuleAction": "deny" } ], "IsDefault": true }, { "Associations": [], "NetworkAclId": "acl-6da75208", "VpcId": "vpc-4e20d42b", "Tags": [], "Entries": [ { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": true, "RuleAction": "deny" }, { "Ipv6CidrBlock": "::/0", "RuleNumber": 32768, "Protocol": "-1", "Egress": true, "RuleAction": "deny" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 100, "Protocol": "-1", "Egress": false, "RuleAction": "allow" }, { "Ipv6CidrBlock": "::/0", "RuleNumber": 101, "Protocol": "-1", "Egress": false, "RuleAction": "allow" }, { "CidrBlock": "0.0.0.0/0", "RuleNumber": 32767, "Protocol": "-1", "Egress": false, "RuleAction": "deny" }, { "Ipv6CidrBlock": "::/0", "RuleNumber": 32768, "Protocol": "-1", "Egress": false, "RuleAction": "deny" } ], "IsDefault": true } ] }awscli-1.14.44/awscli/examples/ec2/describe-host-reservation-offerings.rst0000666454262600001440000000356413243367510027612 0ustar pysdk-ciamazon00000000000000**To describe Dedicated Host Reservation offerings** This example describes the Dedicated Host Reservations for the M4 instance family that are available to purchase. Command:: aws ec2 describe-host-reservation-offerings --filter Name=instance-family,Values=m4 Output:: { "OfferingSet": [ { "HourlyPrice": "1.499", "OfferingId": "hro-03f707bf363b6b324", "InstanceFamily": "m4", "PaymentOption": "NoUpfront", "UpfrontPrice": "0.000", "Duration": 31536000 }, { "HourlyPrice": "1.045", "OfferingId": "hro-0ef9181cabdef7a02", "InstanceFamily": "m4", "PaymentOption": "NoUpfront", "UpfrontPrice": "0.000", "Duration": 94608000 }, { "HourlyPrice": "0.714", "OfferingId": "hro-04567a15500b92a51", "InstanceFamily": "m4", "PaymentOption": "PartialUpfront", "UpfrontPrice": "6254.000", "Duration": 31536000 }, { "HourlyPrice": "0.484", "OfferingId": "hro-0d5d7a9d23ed7fbfe", "InstanceFamily": "m4", "PaymentOption": "PartialUpfront", "UpfrontPrice": "12720.000", "Duration": 94608000 }, { "HourlyPrice": "0.000", "OfferingId": "hro-05da4108ca998c2e5", "InstanceFamily": "m4", "PaymentOption": "AllUpfront", "UpfrontPrice": "23913.000", "Duration": 94608000 }, { "HourlyPrice": "0.000", "OfferingId": "hro-0a9f9be3b95a3dc8f", "InstanceFamily": "m4", "PaymentOption": "AllUpfront", "UpfrontPrice": "12257.000", "Duration": 31536000 } ] }awscli-1.14.44/awscli/examples/ec2/describe-vpn-gateways.rst0000666454262600001440000000150213243367510024731 0ustar pysdk-ciamazon00000000000000**To describe your virtual private gateways** This example describes your virtual private gateways. Command:: aws ec2 describe-vpn-gateways Output:: { "VpnGateways": [ { "State": "available", "Type": "ipsec.1", "VpnGatewayId": "vgw-f211f09b", "VpcAttachments": [ { "State": "attached", "VpcId": "vpc-98eb5ef5" } ] }, { "State": "available", "Type": "ipsec.1", "VpnGatewayId": "vgw-9a4cacf3", "VpcAttachments": [ { "State": "attaching", "VpcId": "vpc-a01106c2" } ] } ] }awscli-1.14.44/awscli/examples/ec2/describe-classic-link-instances.rst0000666454262600001440000000234013243367510026646 0ustar pysdk-ciamazon00000000000000**To describe linked EC2-Classic instances** This example lists all of your linked EC2-Classic instances. Command:: aws ec2 describe-classic-link-instances Output:: { "Instances": [ { "InstanceId": "i-1234567890abcdef0", "VpcId": "vpc-88888888", "Groups": [ { "GroupId": "sg-11122233" } ], "Tags": [ { "Value": "ClassicInstance", "Key": "Name" } ] }, { "InstanceId": "i-0598c7d356eba48d7", "VpcId": "vpc-12312312", "Groups": [ { "GroupId": "sg-aabbccdd" } ], "Tags": [ { "Value": "ClassicInstance2", "Key": "Name" } ] } ] } This example lists all of your linked EC2-Classic instances, and filters the response to include only instances that are linked to VPC vpc-88888888. Command:: aws ec2 describe-classic-link-instances --filter "Name=vpc-id,Values=vpc-88888888" Output:: { "Instances": [ { "InstanceId": "i-1234567890abcdef0", "VpcId": "vpc-88888888", "Groups": [ { "GroupId": "sg-11122233" } ], "Tags": [ { "Value": "ClassicInstance", "Key": "Name" } ] } ] } awscli-1.14.44/awscli/examples/ec2/delete-vpn-connection.rst0000666454262600001440000000032013243367510024723 0ustar pysdk-ciamazon00000000000000**To delete a VPN connection** This example deletes the specified VPN connection. If the command succeeds, no output is returned. Command:: aws ec2 delete-vpn-connection --vpn-connection-id vpn-40f41529 awscli-1.14.44/awscli/examples/ec2/disassociate-route-table.rst0000666454262600001440000000036513243367510025430 0ustar pysdk-ciamazon00000000000000**To disassociate a route table** This example disassociates the specified route table from the specified subnet. If the command succeeds, no output is returned. Command:: aws ec2 disassociate-route-table --association-id rtbassoc-781d0d1a awscli-1.14.44/awscli/examples/ec2/authorize-security-group-egress.rst0000666454262600001440000000135213243367510027030 0ustar pysdk-ciamazon00000000000000**To add a rule that allows outbound traffic to a specific address range** This example command adds a rule that grants access to the specified address ranges on TCP port 80. Command:: aws ec2 authorize-security-group-egress --group-id sg-1a2b3c4d --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 80, "ToPort": 80, "IpRanges": [{"CidrIp": "10.0.0.0/16"}]}]' **To add a rule that allows outbound traffic to a specific security group** This example command adds a rule that grants access to the specified security group on TCP port 80. Command:: aws ec2 authorize-security-group-egress --group-id sg-1a2b3c4d --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 80, "ToPort": 80, "UserIdGroupPairs": [{"GroupId": "sg-4b51a32f"}]}]' awscli-1.14.44/awscli/examples/ec2/describe-customer-gateways.rst0000666454262600001440000000210213243367510025764 0ustar pysdk-ciamazon00000000000000**To describe your customer gateways** This example describes your customer gateways. Command:: aws ec2 describe-customer-gateways Output:: { "CustomerGateways": [ { "CustomerGatewayId": "cgw-b4dc3961", "IpAddress": "203.0.113.12", "State": "available", "Type": "ipsec.1", "BgpAsn": "65000" }, { "CustomerGatewayId": "cgw-0e11f167", "IpAddress": "12.1.2.3", "State": "available", "Type": "ipsec.1", "BgpAsn": "65534" } ] } **To describe a specific customer gateway** This example describes the specified customer gateway. Command:: aws ec2 describe-customer-gateways --customer-gateway-ids cgw-0e11f167 Output:: { "CustomerGateways": [ { "CustomerGatewayId": "cgw-0e11f167", "IpAddress": "12.1.2.3", "State": "available", "Type": "ipsec.1", "BgpAsn": "65534" } ] } awscli-1.14.44/awscli/examples/ec2/describe-security-group-references.rst0000666454262600001440000000103713243367510027427 0ustar pysdk-ciamazon00000000000000**To describe security group references** This example describes the security group references for ``sg-bbbb2222``. The response indicates that security group ``sg-bbbb2222`` is being referenced by a security group in VPC ``vpc-aaaaaaaa``. Command:: aws ec2 describe-security-group-references --group-id sg-bbbbb22222 Output:: { "SecurityGroupsReferenceSet": [ { "ReferencingVpcId": "vpc-aaaaaaaa ", "GroupId": "sg-bbbbb22222", "VpcPeeringConnectionId": "pcx-b04deed9" } ] }awscli-1.14.44/awscli/examples/ec2/move-address-to-vpc.rst0000666454262600001440000000034113243367510024325 0ustar pysdk-ciamazon00000000000000**To move an address to EC2-VPC** This example moves Elastic IP address 54.123.4.56 to the EC2-VPC platform. Command:: aws ec2 move-address-to-vpc --public-ip 54.123.4.56 Output:: { "Status": "MoveInProgress" }awscli-1.14.44/awscli/examples/ec2/describe-volumes.rst0000666454262600001440000000634713243367510024012 0ustar pysdk-ciamazon00000000000000**To describe all volumes** This example command describes all of your volumes in the default region. Command:: aws ec2 describe-volumes Output:: { "Volumes": [ { "AvailabilityZone": "us-east-1a", "Attachments": [ { "AttachTime": "2013-12-18T22:35:00.000Z", "InstanceId": "i-1234567890abcdef0", "VolumeId": "vol-049df61146c4d7901", "State": "attached", "DeleteOnTermination": true, "Device": "/dev/sda1" } ], "VolumeType": "standard", "VolumeId": "vol-049df61146c4d7901", "State": "in-use", "SnapshotId": "snap-1234567890abcdef0", "CreateTime": "2013-12-18T22:35:00.084Z", "Size": 8 }, { "AvailabilityZone": "us-east-1a", "Attachments": [], "VolumeType": "io1", "VolumeId": "vol-1234567890abcdef0", "State": "available", "Iops": 1000, "SnapshotId": null, "CreateTime": "2014-02-27T00:02:41.791Z", "Size": 100 } ] } **To describe volumes that are attached to a specific instance** This example command describes all volumes that are both attached to the instance with the ID i-1234567890abcdef0 and set to delete when the instance terminates. Command:: aws ec2 describe-volumes --region us-east-1 --filters Name=attachment.instance-id,Values=i-1234567890abcdef0 Name=attachment.delete-on-termination,Values=true Output:: { "Volumes": [ { "AvailabilityZone": "us-east-1a", "Attachments": [ { "AttachTime": "2013-12-18T22:35:00.000Z", "InstanceId": "i-1234567890abcdef0", "VolumeId": "vol-049df61146c4d7901", "State": "attached", "DeleteOnTermination": true, "Device": "/dev/sda1" } ], "VolumeType": "standard", "VolumeId": "vol-049df61146c4d7901", "State": "in-use", "SnapshotId": "snap-1234567890abcdef0", "CreateTime": "2013-12-18T22:35:00.084Z", "Size": 8 } ] } **To describe tagged volumes and filter the output** This example command describes all volumes that have the tag key ``Name`` and a value that begins with ``Test``. The output is filtered to display only the tags and IDs of the volumes. Command:: aws ec2 describe-volumes --filters Name=tag-key,Values="Name" Name=tag-value,Values="Test*" --query 'Volumes[*].{ID:VolumeId,Tag:Tags}' Output:: [ { "Tag": [ { "Value": "Test2", "Key": "Name" } ], "ID": "vol-1234567890abcdef0" }, { "Tag": [ { "Value": "Test1", "Key": "Name" } ], "ID": "vol-049df61146c4d7901" } ] awscli-1.14.44/awscli/examples/ec2/cancel-spot-fleet-requests.rst0000666454262600001440000000216413243367510025711 0ustar pysdk-ciamazon00000000000000**To cancel Spot fleet requests** This example command cancels a Spot fleet request and terminates the associated Spot Instances. Command:: aws ec2 cancel-spot-fleet-requests --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE --terminate-instances Output:: { "SuccessfulFleetRequests": [ { "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", "CurrentSpotFleetRequestState": "cancelled_running", "PreviousSpotFleetRequestState": "active" } ], "UnsuccessfulFleetRequests": [] } This example command cancels a Spot fleet request without terminating the associated Spot Instances. Command:: aws ec2 cancel-spot-fleet-requests --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE --no-terminate-instances Output:: { "SuccessfulFleetRequests": [ { "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", "CurrentSpotFleetRequestState": "cancelled_terminating", "PreviousSpotFleetRequestState": "active" } ], "UnsuccessfulFleetRequests": [] } awscli-1.14.44/awscli/examples/ec2/create-launch-template.rst0000666454262600001440000000200013243367510025044 0ustar pysdk-ciamazon00000000000000**To create a launch template** This example creates a launch template that specifies the subnet in which to launch the instance (``subnet-7b16de0c``), assigns a public IP address and an IPv6 address to the instance, and creates a tag for the instance (``Name=webserver``). Command:: aws ec2 create-launch-template --launch-template-name TemplateForWebServer --version-description WebVersion1 --launch-template-data '{"NetworkInterfaces":[{"AssociatePublicIpAddress":true,"DeviceIndex":0,"Ipv6AddressCount":1,"SubnetId":"subnet-7b16de0c"}],"ImageId":"ami-8c1be5f6","InstanceType":"t2.small","TagSpecifications":[{"ResourceType":"instance","Tags":[{"Key":"Name","Value":"webserver"}]}]}' Output:: { "LaunchTemplate": { "LatestVersionNumber": 1, "LaunchTemplateId": "lt-01238c059e3466abc", "LaunchTemplateName": "TemplateForWebServer", "DefaultVersionNumber": 1, "CreatedBy": "arn:aws:iam::123456789012:root", "CreateTime": "2017-11-27T09:13:24.000Z" } }awscli-1.14.44/awscli/examples/ec2/delete-network-acl.rst0000666454262600001440000000030413243367510024213 0ustar pysdk-ciamazon00000000000000**To delete a network ACL** This example deletes the specified network ACL. If the command succeeds, no output is returned. Command:: aws ec2 delete-network-acl --network-acl-id acl-5fb85d36 awscli-1.14.44/awscli/examples/ec2/describe-export-tasks.rst0000666454262600001440000000144713243367510024760 0ustar pysdk-ciamazon00000000000000**To list details about an instance export task** This example describes the export task with ID export-i-fh8sjjsq. Command:: aws ec2 describe-export-tasks --export-task-ids export-i-fh8sjjsq Output:: { "ExportTasks": [ { "State": "active", "InstanceExportDetails": { "InstanceId": "i-1234567890abcdef0", "TargetEnvironment": "vmware" }, "ExportToS3Task": { "S3Bucket": "myexportbucket", "S3Key": "RHEL5export-i-fh8sjjsq.ova", "DiskImageFormat": "vmdk", "ContainerFormat": "ova" }, "Description": "RHEL5 instance", "ExportTaskId": "export-i-fh8sjjsq" } ] } awscli-1.14.44/awscli/examples/ec2/reset-fpga-image-attribute.rst0000666454262600001440000000041513243367510025646 0ustar pysdk-ciamazon00000000000000**To reset the attributes of an Amazon FPGA image** This example resets the load permissions for the specified AFI. Command:: aws ec2 reset-fpga-image-attribute --fpga-image-id afi-0d123e123bfc85abc --attribute loadPermission Output:: { "Return": true } awscli-1.14.44/awscli/examples/ec2/describe-host-reservations.rst0000666454262600001440000000141413243367510026005 0ustar pysdk-ciamazon00000000000000**To describe Dedicated Host Reservations in your account** This example describes the Dedicated Host Reservations in your account. Command:: aws ec2 describe-host-reservations Output:: { "HostReservationSet": [ { "Count": 1, "End": "2019-01-10T12:14:09Z", "HourlyPrice": "1.499", "InstanceFamily": "m4", "OfferingId": "hro-03f707bf363b6b324", "PaymentOption": "NoUpfront", "State": "active", "HostIdSet": [ "h-013abcd2a00cbd123" ], "Start": "2018-01-10T12:14:09Z", "HostReservationId": "hr-0d418a3a4ffc669ae", "UpfrontPrice": "0.000", "Duration": 31536000 } ] }awscli-1.14.44/awscli/examples/ec2/describe-spot-fleet-request-history.rst0000666454262600001440000000324213243367510027556 0ustar pysdk-ciamazon00000000000000**To describe Spot fleet history** This example command returns the history for the specified Spot fleet starting at the specified time. Command:: aws ec2 describe-spot-fleet-request-history --spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE --start-time 2015-05-26T00:00:00Z The following example output shows the successful launches of two Spot Instances for the Spot fleet. Output:: { "HistoryRecords": [ { "Timestamp": "2015-05-26T23:17:20.697Z", "EventInformation": { "EventSubType": "submitted" }, "EventType": "fleetRequestChange" }, { "Timestamp": "2015-05-26T23:17:20.873Z", "EventInformation": { "EventSubType": "active" }, "EventType": "fleetRequestChange" }, { "Timestamp": "2015-05-26T23:21:21.712Z", "EventInformation": { "InstanceId": "i-1234567890abcdef0", "EventSubType": "launched" }, "EventType": "instanceChange" }, { "Timestamp": "2015-05-26T23:21:21.816Z", "EventInformation": { "InstanceId": "i-1234567890abcdef1", "EventSubType": "launched" }, "EventType": "instanceChange" } ], "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE", "NextToken": "CpHNsscimcV5oH7bSbub03CI2Qms5+ypNpNm+53MNlR0YcXAkp0xFlfKf91yVxSExmbtma3awYxMFzNA663ZskT0AHtJ6TCb2Z8bQC2EnZgyELbymtWPfpZ1ZbauVg+P+TfGlWxWWB/Vr5dk5d4LfdgA/DRAHUrYgxzrEXAMPLE=", "StartTime": "2015-05-26T00:00:00Z" } awscli-1.14.44/awscli/examples/ec2/modify-spot-fleet-request.rst0000666454262600001440000000122713243367510025567 0ustar pysdk-ciamazon00000000000000**To modify a Spot fleet request** This example command updates the target capacity of the specified Spot fleet request. Command:: aws ec2 modify-spot-fleet-request --target-capacity 20 --spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE Output:: { "Return": true } This example command decreases the target capacity of the specified Spot fleet request without terminating any Spot Instances as a result. Command:: aws ec2 modify-spot-fleet-request --target-capacity 10 --excess-capacity-termination-policy NoTermination --spot-fleet-request-ids sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE Output:: { "Return": true } awscli-1.14.44/awscli/examples/ec2/replace-iam-instance-profile.rst0000666454262600001440000000132313243367510026146 0ustar pysdk-ciamazon00000000000000**To replace an IAM instance profile for an instance** This example replaces the IAM instance profile represented by the association ``iip-assoc-060bae234aac2e7fa`` with the IAM instance profile named ``AdminRole``. Command:: aws ec2 replace-iam-instance-profile-association --iam-instance-profile Name=AdminRole --association-id iip-assoc-060bae234aac2e7fa Output:: { "IamInstanceProfileAssociation": { "InstanceId": "i-087711ddaf98f9489", "State": "associating", "AssociationId": "iip-assoc-0b215292fab192820", "IamInstanceProfile": { "Id": "AIPAJLNLDX3AMYZNWYYAY", "Arn": "arn:aws:iam::123456789012:instance-profile/AdminRole" } } }awscli-1.14.44/awscli/examples/ec2/delete-tags.rst0000666454262600001440000000231213243367510022724 0ustar pysdk-ciamazon00000000000000**To delete a tag from a resource** This example deletes the tag ``Stack=Test`` from the specified image. If the command succeeds, no output is returned. Command:: aws ec2 delete-tags --resources ami-78a54011 --tags Key=Stack,Value=Test It's optional to specify the value for any tag with a value. If you specify a value for the key, the tag is deleted only if the tag's value matches the one you specified. If you specify the empty string as the value, the tag is deleted only if the tag's value is the empty string. The following example specifies the empty string as the value for the tag to delete. Command:: aws ec2 delete-tags --resources i-1234567890abcdef0 --tags Key=Name,Value= This example deletes the tag with the ``purpose`` key from the specified instance, regardless of the tag's value. Command:: aws ec2 delete-tags --resources i-1234567890abcdef0 --tags Key=purpose **To delete a tag from multiple resources** This example deletes the ``Purpose=Test`` tag from a specified instance and AMI. The tag's value can be omitted from the command. If the command succeeds, no output is returned. Command:: aws ec2 delete-tags --resources i-1234567890abcdef0 ami-78a54011 --tags Key=Purpose awscli-1.14.44/awscli/examples/ec2/delete-route.rst0000666454262600001440000000036413243367510023131 0ustar pysdk-ciamazon00000000000000**To delete a route** This example deletes the specified route from the specified route table. If the command succeeds, no output is returned. Command:: aws ec2 delete-route --route-table-id rtb-22574640 --destination-cidr-block 0.0.0.0/0 awscli-1.14.44/awscli/examples/ec2/purchase-reserved-instances-offering.rst0000666454262600001440000000065213243367510027744 0ustar pysdk-ciamazon00000000000000**To purchase a Reserved Instance offering** This example command illustrates a purchase of a Reserved Instances offering, specifying an offering ID and instance count. Command:: aws ec2 purchase-reserved-instances-offering --reserved-instances-offering-id ec06327e-dd07-46ee-9398-75b5fexample --instance-count 3 Output:: { "ReservedInstancesId": "af9f760e-6f91-4559-85f7-4980eexample" } awscli-1.14.44/awscli/examples/ec2/create-route.rst0000666454262600001440000000216613243367510023134 0ustar pysdk-ciamazon00000000000000**To create a route** This example creates a route for the specified route table. The route matches all IPv4 traffic (``0.0.0.0/0``) and routes it to the specified Internet gateway. If the command succeeds, no output is returned. Command:: aws ec2 create-route --route-table-id rtb-22574640 --destination-cidr-block 0.0.0.0/0 --gateway-id igw-c0a643a9 This example command creates a route in route table rtb-g8ff4ea2. The route matches traffic for the IPv4 CIDR block 10.0.0.0/16 and routes it to VPC peering connection, pcx-111aaa22. This route enables traffic to be directed to the peer VPC in the VPC peering connection. If the command succeeds, no output is returned. Command:: aws ec2 create-route --route-table-id rtb-g8ff4ea2 --destination-cidr-block 10.0.0.0/16 --vpc-peering-connection-id pcx-1a2b3c4d This example creates a route in the specified route table that matches all IPv6 traffic (``::/0``) and routes it to the specified egress-only Internet gateway. Command:: aws ec2 create-route --route-table-id rtb-dce620b8 --destination-ipv6-cidr-block ::/0 --egress-only-internet-gateway-id eigw-01eadbd45ecd7943f awscli-1.14.44/awscli/examples/ec2/modify-vpc-endpoint.rst0000666454262600001440000000123013243367510024417 0ustar pysdk-ciamazon00000000000000**To modify a gateway endpoint** This example modifies gateway endpoint ``vpce-1a2b3c4d`` by associating route table ``rtb-aaa222bb`` with the endpoint, and resetting the policy document. Command:: aws ec2 modify-vpc-endpoint --vpc-endpoint-id vpce-1a2b3c4d --add-route-table-ids rtb-aaa222bb --reset-policy Output:: { "Return": true } **To modify an interface endpoint** This example modifies interface endpoint ``vpce-0fe5b17a0707d6fa5`` by adding subnet ``subnet-d6fcaa8d`` to the endpoint. Command:: aws ec2 modify-vpc-endpoint --vpc-endpoint-id vpce-0fe5b17a0707d6fa5 --add-subnet-id subnet-d6fcaa8d Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/replace-network-acl-association.rst0000666454262600001440000000053513243367510026704 0ustar pysdk-ciamazon00000000000000**To replace the network ACL associated with a subnet** This example associates the specified network ACL with the subnet for the specified network ACL association. Command:: aws ec2 replace-network-acl-association --association-id aclassoc-e5b95c8c --network-acl-id acl-5fb85d36 Output:: { "NewAssociationId": "aclassoc-3999875b" }awscli-1.14.44/awscli/examples/ec2/enable-vpc-classic-link-dns-support.rst0000666454262600001440000000035113243367510027411 0ustar pysdk-ciamazon00000000000000**To enable ClassicLink DNS support for a VPC** This example enables ClassicLink DNS support for ``vpc-88888888``. Command:: aws ec2 enable-vpc-classic-link-dns-support --vpc-id vpc-88888888 Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/describe-spot-fleet-instances.rst0000666454262600001440000000106513243367510026357 0ustar pysdk-ciamazon00000000000000**To describe the Spot Instances associated with a Spot fleet** This example command lists the Spot instances associated with the specified Spot fleet. Command:: aws ec2 describe-spot-fleet-instances --spot-fleet-request-id sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE Output:: { "ActiveInstances": [ { "InstanceId": "i-1234567890abcdef0", "InstanceType": "m3.medium", "SpotInstanceRequestId": "sir-08b93456" }, ... ], "SpotFleetRequestId": "sfr-73fbd2ce-aa30-494c-8788-1cee4EXAMPLE" } awscli-1.14.44/awscli/examples/ec2/disassociate-vpc-cidr-block.rst0000666454262600001440000000171413243367510026003 0ustar pysdk-ciamazon00000000000000**To disassociate an IPv6 CIDR block from a VPC** This example disassociates an IPv6 CIDR block from a VPC using the association ID for the CIDR block. Command:: aws ec2 disassociate-vpc-cidr-block --association-id vpc-cidr-assoc-eca54085 Output:: { "Ipv6CidrBlockAssociation": { "Ipv6CidrBlock": "2001:db8:1234:1a00::/56", "AssociationId": "vpc-cidr-assoc-eca54085", "Ipv6CidrBlockState": { "State": "disassociating" } }, "VpcId": "vpc-a034d6c4" } **To disassociate an IPv4 CIDR block from a VPC** This example disassociates an IPv4 CIDR block from a VPC. Command:: aws ec2 disassociate-vpc-cidr-block --association-id vpc-cidr-assoc-0287ac6b Output:: { "CidrBlockAssociation": { "AssociationId": "vpc-cidr-assoc-0287ac6b", "CidrBlock": "172.18.0.0/16", "CidrBlockState": { "State": "disassociating" } }, "VpcId": "vpc-27621243" }awscli-1.14.44/awscli/examples/ec2/describe-fpga-image-attribute.rst0000666454262600001440000000070213243367510026303 0ustar pysdk-ciamazon00000000000000**To describe the attributes of an Amazon FPGA image** This example describes the load permissions for the specified AFI. Command:: aws ec2 describe-fpga-image-attribute --fpga-image-id afi-0d123e123bfc85abc --attribute loadPermission Output:: { "FpgaImageAttribute": { "FpgaImageId": "afi-0d123e123bfc85abc", "LoadPermissions": [ { "UserId": "123456789012" } ] } } awscli-1.14.44/awscli/examples/ec2/update-security-group-rule-descriptions-egress.rst0000666454262600001440000000115613243367510031753 0ustar pysdk-ciamazon00000000000000**To update an outbound security group rule description** This example updates the description for the security group rule that allows outbound access over port 80 to the ``203.0.113.0/24`` IPv4 address range. The description '``Outbound HTTP access to server 2``' replaces any existing description for the rule. If the command succeeds, no output is returned. Command:: aws ec2 update-security-group-rule-descriptions-egress --group-id sg-123abc12 --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 80, "ToPort": 80, "IpRanges": [{"CidrIp": "203.0.113.0/24", "Description": "Outbound HTTP access to server 2"}]}]' awscli-1.14.44/awscli/examples/ec2/create-subnet.rst0000666454262600001440000000336513243367510023300 0ustar pysdk-ciamazon00000000000000**To create a subnet** This example creates a subnet in the specified VPC with the specified IPv4 CIDR block. We recommend that you let us select an Availability Zone for you. Alternatively, you can use the ``--availability-zone`` option to specify the Availability Zone. Command:: aws ec2 create-subnet --vpc-id vpc-a01106c2 --cidr-block 10.0.1.0/24 Output:: { "Subnet": { "VpcId": "vpc-a01106c2", "AvailableIpAddressCount": 251, "MapPublicIpOnLaunch": false, "DefaultForAz": false, "Ipv6CidrBlockAssociationSet": [], "State": "pending", "AvailabilityZone": "us-east-1a", "SubnetId": "subnet-2c2de375", "CidrBlock": "10.0.1.0/24", "AssignIpv6AddressOnCreation": false } } **To create a subnet with an IPv6 CIDR block** This example creates a subnet in the specified VPC with the specified IPv4 and IPv6 CIDR blocks (from the ranges of the VPC). Command:: aws ec2 create-subnet --vpc-id vpc-31896b55 --cidr-block 10.0.0.0/24 --ipv6-cidr-block 2001:db8:1234:a100::/64 Output:: { "Subnet": { "VpcId": "vpc-31896b55", "AvailableIpAddressCount": 251, "MapPublicIpOnLaunch": false, "DefaultForAz": false, "Ipv6CidrBlockAssociationSet": [ { "Ipv6CidrBlock": "2001:db8:1234:a100::/64", "AssociationId": "subnet-cidr-assoc-3fe7e347", "Ipv6CidrBlockState": { "State": "ASSOCIATING" } } ], "State": "pending", "AvailabilityZone": "ap-southeast-2a", "SubnetId": "subnet-5504d223", "CidrBlock": "10.0.0.0/24", "AssignIpv6AddressOnCreation": false } }awscli-1.14.44/awscli/examples/ec2/cancel-spot-instance-requests.rst0000666454262600001440000000056013243367510026414 0ustar pysdk-ciamazon00000000000000**To cancel Spot Instance requests** This example command cancels a Spot Instance request. Command:: aws ec2 cancel-spot-instance-requests --spot-instance-request-ids sir-08b93456 Output:: { "CancelledSpotInstanceRequests": [ { "State": "cancelled", "SpotInstanceRequestId": "sir-08b93456" } ] } awscli-1.14.44/awscli/examples/ec2/replace-route-table-association.rst0000666454262600001440000000053513243367510026701 0ustar pysdk-ciamazon00000000000000**To replace the route table associated with a subnet** This example associates the specified route table with the subnet for the specified route table association. Command:: aws ec2 replace-route-table-association --association-id rtbassoc-781d0d1a --route-table-id rtb-22574640 Output:: { "NewAssociationId": "rtbassoc-3a1f0f58" }awscli-1.14.44/awscli/examples/ec2/update-security-group-rule-descriptions-ingress.rst0000666454262600001440000000114313243367510032131 0ustar pysdk-ciamazon00000000000000**To update an inbound security group rule description** This example updates the description for the security group rule that allows inbound access over port 22 from the ``203.0.113.0/16`` IPv4 address range. The description '``SSH access from ABC office``' replaces any existing description for the rule. If the command succeeds, no output is returned. Command:: aws ec2 update-security-group-rule-descriptions-ingress --group-id sg-123abc12 --ip-permissions '[{"IpProtocol": "tcp", "FromPort": 22, "ToPort": 22, "IpRanges": [{"CidrIp": "203.0.113.0/16", "Description": "SSH access from ABC office"}]}]' awscli-1.14.44/awscli/examples/ec2/describe-vpc-endpoint-service-permissions.rst0000666454262600001440000000061113243367510030721 0ustar pysdk-ciamazon00000000000000**To describe endpoint service permissions** This example describes the permissions for the specified endpoint service. Command:: aws ec2 describe-vpc-endpoint-service-permissions --service-id vpce-svc-03d5ebb7d9579a2b3 Output:: { "AllowedPrincipals": [ { "PrincipalType": "Account", "Principal": "arn:aws:iam::123456789012:root" } ] }awscli-1.14.44/awscli/examples/ec2/describe-reserved-instances-modifications.rst0000666454262600001440000000317213243367510030743 0ustar pysdk-ciamazon00000000000000**To describe Reserved Instances modifications** This example command describes all the Reserved Instances modification requests that have been submitted for your account. Command:: aws ec2 describe-reserved-instances-modifications Output:: { "ReservedInstancesModifications": [ { "Status": "fulfilled", "ModificationResults": [ { "ReservedInstancesId": "93bbbca2-62f1-4d9d-b225-16bada29e6c7", "TargetConfiguration": { "AvailabilityZone": "us-east-1b", "InstanceType": "m1.large", "InstanceCount": 3 } }, { "ReservedInstancesId": "1ba8e2e3-aabb-46c3-bcf5-3fe2fda922e6", "TargetConfiguration": { "AvailabilityZone": "us-east-1d", "InstanceType": "m1.xlarge", "InstanceCount": 1 } } ], "EffectiveDate": "2015-08-12T17:00:00.000Z", "CreateDate": "2015-08-12T17:52:52.630Z", "UpdateDate": "2015-08-12T18:08:06.698Z", "ClientToken": "c9adb218-3222-4889-8216-0cf0e52dc37e: "ReservedInstancesModificationId": "rimod-d3ed4335-b1d3-4de6-ab31-0f13aaf46687", "ReservedInstancesIds": [ { "ReservedInstancesId": "b847fa93-e282-4f55-b59a-1342f5bd7c02" } ] } ] } awscli-1.14.44/awscli/examples/ec2/delete-vpc-endpoint-connection-notifications.rst0000666454262600001440000000043513243367510031404 0ustar pysdk-ciamazon00000000000000**To delete an endpoint connection notification** This example deletes the specified endpoint connection notification. Command:: aws ec2 delete-vpc-endpoint-connection-notifications --connection-notification-ids vpce-nfn-008776de7e03f5abc Output:: { "Unsuccessful": [] }awscli-1.14.44/awscli/examples/ec2/allocate-hosts.rst0000666454262600001440000000057313243367510023457 0ustar pysdk-ciamazon00000000000000**To allocate a Dedicated host to your account** This example allocates a single Dedicated host in a specific Availability Zone, onto which you can launch m3.medium instances, to your account. Command:: aws ec2 allocate-hosts --instance-type m3.medium --availability-zone us-east-1b --quantity 1 Output:: { "HostIds": [ "h-029e7409a337631f" ] } awscli-1.14.44/awscli/examples/ec2/delete-snapshot.rst0000666454262600001440000000036113243367510023627 0ustar pysdk-ciamazon00000000000000**To delete a snapshot** This example command deletes a snapshot with the snapshot ID of ``snap-1234567890abcdef0``. If the command succeeds, no output is returned. Command:: aws ec2 delete-snapshot --snapshot-id snap-1234567890abcdef0 awscli-1.14.44/awscli/examples/ec2/describe-security-groups.rst0000666454262600001440000001142113243367510025471 0ustar pysdk-ciamazon00000000000000**To describe a security group for EC2-Classic** This example displays information about the security group named ``MySecurityGroup``. Command:: aws ec2 describe-security-groups --group-names MySecurityGroup Output:: { "SecurityGroups": [ { "IpPermissionsEgress": [], "Description": "My security group", "IpPermissions": [ { "PrefixListIds": [], "FromPort": 22, "IpRanges": [ { "CidrIp": "203.0.113.0/24" } ], "ToPort": 22, "IpProtocol": "tcp", "UserIdGroupPairs": [] } ], "GroupName": "MySecurityGroup", "OwnerId": "123456789012", "GroupId": "sg-903004f8", } ] } **To describe a security group for EC2-VPC** This example displays information about the security group with the ID sg-903004f8. Note that you can't reference a security group for EC2-VPC by name. Command:: aws ec2 describe-security-groups --group-ids sg-903004f8 Output:: { "SecurityGroups": [ { "IpPermissionsEgress": [ { "IpProtocol": "-1", "IpRanges": [ { "CidrIp": "0.0.0.0/0" } ], "UserIdGroupPairs": [], "PrefixListIds": [] } ], "Description": "My security group", "Tags": [ { "Value": "SG1", "Key": "Name" } ], "IpPermissions": [ { "IpProtocol": "-1", "IpRanges": [], "UserIdGroupPairs": [ { "UserId": "123456789012", "GroupId": "sg-903004f8" } ], "PrefixListIds": [] }, { "PrefixListIds": [], "FromPort": 22, "IpRanges": [ { "Description": "Access from NY office", "CidrIp": "203.0.113.0/24" } ], "ToPort": 22, "IpProtocol": "tcp", "UserIdGroupPairs": [] } ], "GroupName": "MySecurityGroup", "VpcId": "vpc-1a2b3c4d", "OwnerId": "123456789012", "GroupId": "sg-903004f8", } ] } **To describe security groups that have specific rules** (EC2-VPC only) This example uses filters to describe security groups that have a rule that allows SSH traffic (port 22) and a rule that allows traffic from all addresses (``0.0.0.0/0``). The output is filtered to display only the names of the security groups. Security groups must match all filters to be returned in the results; however, a single rule does not have to match all filters. For example, the output returns a security group with a rule that allows SSH traffic from a specific IP address and another rule that allows HTTP traffic from all addresses. Command:: aws ec2 describe-security-groups --filters Name=ip-permission.from-port,Values=22 Name=ip-permission.to-port,Values=22 Name=ip-permission.cidr,Values='0.0.0.0/0' --query 'SecurityGroups[*].{Name:GroupName}' Output:: [ { "Name": "default" }, { "Name": "Test SG" }, { "Name": "SSH-Access-Group" } ] **To describe tagged security groups** This example describes all security groups that include ``test`` in the security group name, and that have the tag ``Test=To-delete``. The output is filtered to display only the names and IDs of the security groups. Command:: aws ec2 describe-security-groups --filters Name=group-name,Values='*test*' Name=tag-key,Values=Test Name=tag-value,Values=To-delete --query 'SecurityGroups[*].{Name:GroupName,ID:GroupId}' Output:: [ { "Name": "testfornewinstance", "ID": "sg-33bb22aa" }, { "Name": "newgrouptest", "ID": "sg-1a2b3c4d" } ] For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*. .. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html awscli-1.14.44/awscli/examples/ec2/describe-launch-templates.rst0000666454262600001440000000276413243367510025565 0ustar pysdk-ciamazon00000000000000**To describe launch templates** This example describes your launch templates. Command:: aws ec2 describe-launch-templates Output:: { "LaunchTemplates": [ { "LatestVersionNumber": 2, "LaunchTemplateId": "lt-0e06d290751193123", "LaunchTemplateName": "TemplateForWebServer", "DefaultVersionNumber": 2, "CreatedBy": "arn:aws:iam::123456789012:root", "CreateTime": "2017-11-27T09:30:23.000Z" }, { "LatestVersionNumber": 6, "LaunchTemplateId": "lt-0c45b5e061ec98456", "LaunchTemplateName": "DBServersTemplate", "DefaultVersionNumber": 1, "CreatedBy": "arn:aws:iam::123456789012:root", "CreateTime": "2017-11-20T09:25:22.000Z" }, { "LatestVersionNumber": 1, "LaunchTemplateId": "lt-0d47d774e8e52dabc", "LaunchTemplateName": "MyLaunchTemplate2", "DefaultVersionNumber": 1, "CreatedBy": "arn:aws:iam::123456789012:root", "CreateTime": "2017-11-02T12:06:21.000Z" }, { "LatestVersionNumber": 3, "LaunchTemplateId": "lt-01e5f948eb4f589d6", "LaunchTemplateName": "testingtemplate2", "DefaultVersionNumber": 1, "CreatedBy": "arn:aws:sts::123456789012:assumed-role/AdminRole/i-03ee35176e2e5aabc", "CreateTime": "2017-12-01T08:19:48.000Z" }, ] }awscli-1.14.44/awscli/examples/ec2/delete-nat-gateway.rst0000666454262600001440000000034713243367510024215 0ustar pysdk-ciamazon00000000000000**To delete a NAT gateway** This example deletes NAT gateway ``nat-04ae55e711cec5680``. Command:: aws ec2 delete-nat-gateway --nat-gateway-id nat-04ae55e711cec5680 Output:: { "NatGatewayId": "nat-04ae55e711cec5680" } awscli-1.14.44/awscli/examples/ec2/describe-spot-instance-requests.rst0000666454262600001440000000463413243367510026755 0ustar pysdk-ciamazon00000000000000**To describe Spot Instance requests** This example describes all of your Spot Instance requests. Command:: aws ec2 describe-spot-instance-requests Output:: { "SpotInstanceRequests": [ { "Status": { "UpdateTime": "2014-04-30T18:16:21.000Z", "Code": "fulfilled", "Message": "Your Spot request is fulfilled." }, "ProductDescription": "Linux/UNIX", "InstanceId": "i-1234567890abcdef0", "SpotInstanceRequestId": "sir-08b93456", "State": "active", "LaunchedAvailabilityZone": "us-west-1b", "LaunchSpecification": { "ImageId": "ami-7aba833f", "KeyName": "May14Key", "BlockDeviceMappings": [ { "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "VolumeType": "standard", "VolumeSize": 8 } } ], "EbsOptimized": false, "SecurityGroups": [ { "GroupName": "launch-wizard-1", "GroupId": "sg-e38f24a7" } ], "InstanceType": "m1.small" }, "Type": "one-time", "CreateTime": "2014-04-30T18:14:55.000Z", "SpotPrice": "0.010000" }, { "Status": { "UpdateTime": "2014-04-30T18:16:21.000Z", "Code": "fulfilled", "Message": "Your Spot request is fulfilled." }, "ProductDescription": "Linux/UNIX", "InstanceId": "i-1234567890abcdef1", "SpotInstanceRequestId": "sir-285b1e56", "State": "active", "LaunchedAvailabilityZone": "us-west-1b", "LaunchSpecification": { "ImageId": "ami-7aba833f", "KeyName": "May14Key", "BlockDeviceMappings": [ { "DeviceName": "/dev/sda1", "Ebs": { "DeleteOnTermination": true, "VolumeType": "standard", "VolumeSize": 8 } } ], "EbsOptimized": false, "SecurityGroups": [ { "GroupName": "launch-wizard-1", "GroupId": "sg-e38f24a7" } ], "InstanceType": "m1.small" }, "Type": "one-time", "CreateTime": "2014-04-30T18:14:55.000Z", "SpotPrice": "0.010000" } ] } awscli-1.14.44/awscli/examples/ec2/create-flow-logs.rst0000666454262600001440000000122613243367510023703 0ustar pysdk-ciamazon00000000000000**To create a flow log** This example creates a flow log that captures all rejected traffic for network interface ``eni-aa22bb33``. The flow logs are delivered to a log group in CloudWatch Logs called ``my-flow-logs`` in account 123456789101, using the IAM role ``publishFlowLogs``. Command:: aws ec2 create-flow-logs --resource-type NetworkInterface --resource-ids eni-aa22bb33 --traffic-type REJECT --log-group-name my-flow-logs --deliver-logs-permission-arn arn:aws:iam::123456789101:role/publishFlowLogs Output:: { "Unsuccessful": [], "FlowLogIds": [ "fl-1a2b3c4d" ], "ClientToken": "lO+mDZGO+HCFEXAMPLEfWNO00bInKkBcLfrC" }awscli-1.14.44/awscli/examples/ec2/describe-vpc-peering-connections.rst0000666454262600001440000000544413243367510027054 0ustar pysdk-ciamazon00000000000000**To describe your VPC peering connections** This example describes all of your VPC peering connections. Command:: aws ec2 describe-vpc-peering-connections Output:: { "VpcPeeringConnections": [ { "Status": { "Message": "Active", "Code": "active" }, "Tags": [ { "Value": "Peering-1", "Key": "Name" } ], "AccepterVpcInfo": { "OwnerId": "111122223333", "VpcId": "vpc-1a2b3c4d", "CidrBlock": "10.0.1.0/28" }, "VpcPeeringConnectionId": "pcx-11122233", "RequesterVpcInfo": { "PeeringOptions": { "AllowEgressFromLocalVpcToRemoteClassicLink": false, "AllowEgressFromLocalClassicLinkToRemoteVpc": false }, "OwnerId": "444455556666", "VpcId": "vpc-123abc45", "CidrBlock": "192.168.0.0/16" } }, { "Status": { "Message": "Pending Acceptance by 444455556666", "Code": "pending-acceptance" }, "Tags": [], "RequesterVpcInfo": { "PeeringOptions": { "AllowEgressFromLocalVpcToRemoteClassicLink": false, "AllowEgressFromLocalClassicLinkToRemoteVpc": false }, "OwnerId": "444455556666", "VpcId": "vpc-11aa22bb", "CidrBlock": "10.0.0.0/28" }, "VpcPeeringConnectionId": "pcx-abababab", "ExpirationTime": "2014-04-03T09:12:43.000Z", "AccepterVpcInfo": { "OwnerId": "444455556666", "VpcId": "vpc-33cc44dd" } } ] } **To describe specific VPC peering connections** This example describes all of your VPC peering connections that are in the pending-acceptance state. Command:: aws ec2 describe-vpc-peering-connections --filters Name=status-code,Values=pending-acceptance This example describes all of your VPC peering connections that have the tag Name=Finance or Name=Accounts. Command:: aws ec2 describe-vpc-peering-connections --filters Name=tag-key,Values=Name Name=tag-value,Values=Finance,Accounts This example describes all of the VPC peering connections you requested for the specified VPC, vpc-1a2b3c4d. Command:: aws ec2 describe-vpc-peering-connections --filters Name=requester-vpc-info.vpc-id,Values=vpc-1a2b3c4d awscli-1.14.44/awscli/examples/ec2/delete-dhcp-options.rst0000666454262600001440000000032113243367510024373 0ustar pysdk-ciamazon00000000000000**To delete a DHCP options set** This example deletes the specified DHCP options set. If the command succeeds, no output is returned. Command:: aws ec2 delete-dhcp-options --dhcp-options-id dopt-d9070ebb awscli-1.14.44/awscli/examples/ec2/delete-volume.rst0000666454262600001440000000036013243367510023276 0ustar pysdk-ciamazon00000000000000**To delete a volume** This example command deletes an available volume with the volume ID of ``vol-049df61146c4d7901``. If the command succeeds, no output is returned. Command:: aws ec2 delete-volume --volume-id vol-049df61146c4d7901 awscli-1.14.44/awscli/examples/ec2/delete-network-acl-entry.rst0000666454262600001440000000041113243367510025351 0ustar pysdk-ciamazon00000000000000**To delete a network ACL entry** This example deletes ingress rule number 100 from the specified network ACL. If the command succeeds, no output is returned. Command:: aws ec2 delete-network-acl-entry --network-acl-id acl-5fb85d36 --ingress --rule-number 100 awscli-1.14.44/awscli/examples/ec2/delete-placement-group.rst0000666454262600001440000000024213243367510025070 0ustar pysdk-ciamazon00000000000000**To delete a placement group** This example command deletes the specified placement group. Command:: aws ec2 delete-placement-group --group-name my-cluster awscli-1.14.44/awscli/examples/ec2/purchase-host-reservation.rst0000666454262600001440000000135113243367510025654 0ustar pysdk-ciamazon00000000000000**To purchase a Dedicated Host Reservation** This example purchases the specified Dedicated Host Reservation offering for the specified Dedicated Host in your account. Command:: aws ec2 purchase-host-reservation --offering-id hro-03f707bf363b6b324 --host-id-set h-013abcd2a00cbd123 Output:: { "TotalHourlyPrice": "1.499", "Purchase": [ { "HourlyPrice": "1.499", "InstanceFamily": "m4", "PaymentOption": "NoUpfront", "HostIdSet": [ "h-013abcd2a00cbd123" ], "HostReservationId": "hr-0d418a3a4ffc669ae", "UpfrontPrice": "0.000", "Duration": 31536000 } ], "TotalUpfrontPrice": "0.000" }awscli-1.14.44/awscli/examples/ec2/delete-internet-gateway.rst0000666454262600001440000000033113243367510025254 0ustar pysdk-ciamazon00000000000000**To delete an Internet gateway** This example deletes the specified Internet gateway. If the command succeeds, no output is returned. Command:: aws ec2 delete-internet-gateway --internet-gateway-id igw-c0a643a9 awscli-1.14.44/awscli/examples/ec2/modify-reserved-instances.rst0000666454262600001440000000377613243367510025636 0ustar pysdk-ciamazon00000000000000**To modify Reserved Instances** This example command moves a Reserved Instance to another Availability Zone in the same region. Command:: aws ec2 modify-reserved-instances --reserved-instances-ids b847fa93-e282-4f55-b59a-1342f5bd7c02 --target-configurations AvailabilityZone=us-west-1c,Platform=EC2-Classic,InstanceCount=10 Output:: { "ReservedInstancesModificationId": "rimod-d3ed4335-b1d3-4de6-ab31-0f13aaf46687" } **To modify the network platform of Reserved Instances** This example command converts EC2-Classic Reserved Instances to EC2-VPC. Command:: aws ec2 modify-reserved-instances --reserved-instances-ids f127bd27-edb7-44c9-a0eb-0d7e09259af0 --target-configurations AvailabilityZone=us-west-1c,Platform=EC2-VPC,InstanceCount=5 Output:: { "ReservedInstancesModificationId": "rimod-82fa9020-668f-4fb6-945d-61537009d291" } For more information, see `Modifying Your Reserved Instances`_ in the *Amazon EC2 User Guide*. **To modify the instance size of Reserved Instances** This example command modifies a Reserved Instance that has 10 m1.small Linux/UNIX instances in us-west-1c so that 8 m1.small instances become 2 m1.large instances, and the remaining 2 m1.small become 1 m1.medium instance in the same Availability Zone. Command:: aws ec2 modify-reserved-instances --reserved-instances-ids 1ba8e2e3-3556-4264-949e-63ee671405a9 --target-configurations AvailabilityZone=us-west-1c,Platform=EC2-Classic,InstanceCount=2,InstanceType=m1.large AvailabilityZone=us-west-1c,Platform=EC2-Classic,InstanceCount=1,InstanceType=m1.medium Output:: { "ReservedInstancesModificationId": "rimod-acc5f240-080d-4717-b3e3-1c6b11fa00b6" } For more information, see `Modifying the Instance Size of Your Reservations`_ in the *Amazon EC2 User Guide*. .. _`Modifying the Instance Size of Your Reservations`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modification-instancemove.html .. _`Modifying Your Reserved Instances`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html awscli-1.14.44/awscli/examples/ec2/copy-image.rst0000666454262600001440000000050313243367510022560 0ustar pysdk-ciamazon00000000000000**To copy an AMI to another region** This example copies the specified AMI from the ``us-east-1`` region to the ``ap-northeast-1`` region. Command:: aws ec2 copy-image --source-image-id ami-5731123e --source-region us-east-1 --region ap-northeast-1 --name "My server" Output:: { "ImageId": "ami-438bea42" }awscli-1.14.44/awscli/examples/ec2/describe-iam-instance-profile-associations.rst0000666454262600001440000000164613243367510031020 0ustar pysdk-ciamazon00000000000000**To describe IAM instance profile associations** This example describes all of your IAM instance profile associations. Command:: aws ec2 describe-iam-instance-profile-associations Output:: { "IamInstanceProfileAssociations": [ { "InstanceId": "i-09eb09efa73ec1dee", "State": "associated", "AssociationId": "iip-assoc-0db249b1f25fa24b8", "IamInstanceProfile": { "Id": "AIPAJVQN4F5WVLGCJDRGM", "Arn": "arn:aws:iam::123456789012:instance-profile/admin-role" } }, { "InstanceId": "i-0402909a2f4dffd14", "State": "associating", "AssociationId": "iip-assoc-0d1ec06278d29f44a", "IamInstanceProfile": { "Id": "AGJAJVQN4F5WVLGCJABCM", "Arn": "arn:aws:iam::123456789012:instance-profile/user1-role" } } ] } awscli-1.14.44/awscli/examples/ec2/create-customer-gateway.rst0000666454262600001440000000070713243367510025275 0ustar pysdk-ciamazon00000000000000**To create a customer gateway** This example creates a customer gateway with the specified IP address for its outside interface. Command:: aws ec2 create-customer-gateway --type ipsec.1 --public-ip 12.1.2.3 --bgp-asn 65534 Output:: { "CustomerGateway": { "CustomerGatewayId": "cgw-0e11f167", "IpAddress": "12.1.2.3", "State": "available", "Type": "ipsec.1", "BgpAsn": "65534" } }awscli-1.14.44/awscli/examples/ec2/disassociate-address.rst0000666454262600001440000000100313243367510024620 0ustar pysdk-ciamazon00000000000000**To disassociate an Elastic IP addresses in EC2-Classic** This example disassociates an Elastic IP address from an instance in EC2-Classic. If the command succeeds, no output is returned. Command:: aws ec2 disassociate-address --public-ip 198.51.100.0 **To disassociate an Elastic IP address in EC2-VPC** This example disassociates an Elastic IP address from an instance in a VPC. If the command succeeds, no output is returned. Command:: aws ec2 disassociate-address --association-id eipassoc-2bebb745 awscli-1.14.44/awscli/examples/ec2/modify-hosts.rst0000666454262600001440000000264513243367510023164 0ustar pysdk-ciamazon00000000000000**To describe Dedicated hosts in your account and generate a machine-readable list** To output a list of Dedicated host IDs in JSON (comma separated). Command:: aws ec2 describe-hosts --query 'Hosts[].HostId' --output json Output:: [ "h-085664df5899941c", "h-056c1b0724170dc38" ] To output a list of Dedicated host IDs in plaintext (comma separated). Command:: aws ec2 describe-hosts --query 'Hosts[].HostId' --output text Output:: h-085664df5899941c h-056c1b0724170dc38 **To describe available Dedicated hosts in your account** Command:: aws ec2 describe-hosts --filter "Name=state,Values=available" Output:: { "Hosts": [ { "HostId": "h-085664df5899941c" "HostProperties: { "Cores": 20, "Sockets": 2, "InstanceType": "m3.medium". "TotalVCpus": 32 }, "Instances": [], "State": "available", "AvailabilityZone": "us-east-1b", "AvailableCapacity": { "AvailableInstanceCapacity": [ { "AvailableCapacity": 32, "InstanceType": "m3.medium", "TotalCapacity": 32 } ], "AvailableVCpus": 32 }, "AutoPlacement": "off" } ] } awscli-1.14.44/awscli/examples/ec2/describe-conversion-tasks.rst0000666454262600001440000000256213243367510025623 0ustar pysdk-ciamazon00000000000000**To view the status of a conversion task** This example returns the status of a conversion task with the ID import-i-ffvko9js. Command:: aws ec2 describe-conversion-tasks --conversion-task-ids import-i-ffvko9js Output:: { "ConversionTasks": [ { "ConversionTaskId": "import-i-ffvko9js", "ImportInstance": { "InstanceId": "i-1234567890abcdef0", "Volumes": [ { "Volume": { "Id": "vol-049df61146c4d7901", "Size": 16 }, "Status": "completed", "Image": { "Size": 1300687360, "ImportManifestUrl": "https://s3.amazonaws.com/myimportbucket/411443cd-d620-4f1c-9d66-13144EXAMPLE/RHEL5.vmdkmanifest.xml?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE&Expires=140EXAMPLE&Signature=XYNhznHNgCqsjDxL9wRL%2FJvEXAMPLE", "Format": "VMDK" }, "BytesConverted": 1300682960, "AvailabilityZone": "us-east-1d" } ] }, "ExpirationTime": "2014-05-14T22:06:23Z", "State": "completed" } ] } awscli-1.14.44/awscli/examples/ec2/create-route-table.rst0000666454262600001440000000106113243367510024212 0ustar pysdk-ciamazon00000000000000**To create a route table** This example creates a route table for the specified VPC. Command:: aws ec2 create-route-table --vpc-id vpc-a01106c2 Output:: { "RouteTable": { "Associations": [], "RouteTableId": "rtb-22574640", "VpcId": "vpc-a01106c2", "PropagatingVgws": [], "Tags": [], "Routes": [ { "GatewayId": "local", "DestinationCidrBlock": "10.0.0.0/16", "State": "active" } ] } }awscli-1.14.44/awscli/examples/ec2/get-host-reservation-purchase-preview.rst0000666454262600001440000000133413243367510030111 0ustar pysdk-ciamazon00000000000000**To get a purchase preview for a Dedicated Host Reservation** This example provides a preview of the costs for a specified Dedicated Host Reservation for the specified Dedicated Host in your account. Command:: aws ec2 get-host-reservation-purchase-preview --offering-id hro-03f707bf363b6b324 --host-id-set h-013abcd2a00cbd123 Output:: { "TotalHourlyPrice": "1.499", "Purchase": [ { "HourlyPrice": "1.499", "InstanceFamily": "m4", "PaymentOption": "NoUpfront", "HostIdSet": [ "h-013abcd2a00cbd123" ], "UpfrontPrice": "0.000", "Duration": 31536000 } ], "TotalUpfrontPrice": "0.000" }awscli-1.14.44/awscli/examples/ec2/get-console-output.rst0000666454262600001440000000046413243367510024311 0ustar pysdk-ciamazon00000000000000**To get the console output** This example gets the console ouput for the specified Linux instance. Command:: aws ec2 get-console-output --instance-id i-1234567890abcdef0 Output:: { "InstanceId": "i-1234567890abcdef0", "Timestamp": "2013-07-25T21:23:53.000Z", "Output": "..." } awscli-1.14.44/awscli/examples/ec2/delete-fpga-image.rst0000666454262600001440000000030013243367510023756 0ustar pysdk-ciamazon00000000000000**To delete an Amazon FPGA image** This example deletes the specified AFI. Command:: aws ec2 delete-fpga-image --fpga-image-id afi-06b12350a123fbabc Output:: { "Return": true } awscli-1.14.44/awscli/examples/ec2/delete-security-group.rst0000666454262600001440000000132313243367510024770 0ustar pysdk-ciamazon00000000000000**[EC2-Classic] To delete a security group** This example deletes the security group named ``MySecurityGroup``. If the command succeeds, no output is returned. Command:: aws ec2 delete-security-group --group-name MySecurityGroup **[EC2-VPC] To delete a security group** This example deletes the security group with the ID ``sg-903004f8``. Note that you can't reference a security group for EC2-VPC by name. If the command succeeds, no output is returned. Command:: aws ec2 delete-security-group --group-id sg-903004f8 For more information, see `Using Security Groups`_ in the *AWS Command Line Interface User Guide*. .. _`Using Security Groups`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-sg.html awscli-1.14.44/awscli/examples/ec2/describe-account-attributes.rst0000666454262600001440000000421313243367510026126 0ustar pysdk-ciamazon00000000000000**To describe all the attributes for your AWS account** This example describes the attributes for your AWS account. Command:: aws ec2 describe-account-attributes Output:: { "AccountAttributes": [ { "AttributeName": "vpc-max-security-groups-per-interface", "AttributeValues": [ { "AttributeValue": "5" } ] }, { "AttributeName": "max-instances", "AttributeValues": [ { "AttributeValue": "20" } ] }, { "AttributeName": "supported-platforms", "AttributeValues": [ { "AttributeValue": "EC2" }, { "AttributeValue": "VPC" } ] }, { "AttributeName": "default-vpc", "AttributeValues": [ { "AttributeValue": "none" } ] }, { "AttributeName": "max-elastic-ips", "AttributeValues": [ { "AttributeValue": "5" } ] }, { "AttributeName": "vpc-max-elastic-ips", "AttributeValues": [ { "AttributeValue": "5" } ] } ] } **To describe a single attribute for your AWS account** This example describes the ``supported-platforms`` attribute for your AWS account. Command:: aws ec2 describe-account-attributes --attribute-names supported-platforms Output:: { "AccountAttributes": [ { "AttributeName": "supported-platforms", "AttributeValues": [ { "AttributeValue": "EC2" }, { "AttributeValue": "VPC" } ] } ] } awscli-1.14.44/awscli/examples/ec2/delete-launch-template-versions.rst0000666454262600001440000000076313243367510026727 0ustar pysdk-ciamazon00000000000000**To delete a launch template version** This example deletes the specified launch template version. Command:: aws ec2 delete-launch-template-versions --launch-template-id lt-0abcd290751193123 --versions 1 Output:: { "UnsuccessfullyDeletedLaunchTemplateVersions": [], "SuccessfullyDeletedLaunchTemplateVersions": [ { "LaunchTemplateName": "TestVersion", "VersionNumber": 1, "LaunchTemplateId": "lt-0abcd290751193123" } ] }awscli-1.14.44/awscli/examples/ec2/allocate-address.rst0000666454262600001440000000106013243367510023734 0ustar pysdk-ciamazon00000000000000**To allocate an Elastic IP address for EC2-Classic** This example allocates an Elastic IP address to use with an instance in EC2-Classic. Command:: aws ec2 allocate-address Output:: { "PublicIp": "198.51.100.0", "Domain": "standard" } **To allocate an Elastic IP address for EC2-VPC** This example allocates an Elastic IP address to use with an instance in a VPC. Command:: aws ec2 allocate-address --domain vpc Output:: { "PublicIp": "203.0.113.0", "Domain": "vpc", "AllocationId": "eipalloc-64d5890a" } awscli-1.14.44/awscli/examples/ec2/detach-volume.rst0000666454262600001440000000065713243367510023275 0ustar pysdk-ciamazon00000000000000**To detach a volume from an instance** This example command detaches the volume (``vol-049df61146c4d7901``) from the instance it is attached to. Command:: aws ec2 detach-volume --volume-id vol-1234567890abcdef0 Output:: { "AttachTime": "2014-02-27T19:23:06.000Z", "InstanceId": "i-1234567890abcdef0", "VolumeId": "vol-049df61146c4d7901", "State": "detaching", "Device": "/dev/sdb" }awscli-1.14.44/awscli/examples/ec2/assign-ipv6-addresses.rst0000666454262600001440000000211613243367510024651 0ustar pysdk-ciamazon00000000000000**To assign specific IPv6 addresses to a network interface** This example assigns the specified IPv6 addresses to the specified network interface. Command:: aws ec2 assign-ipv6-addresses --network-interface-id eni-38664473 --ipv6-addresses 2001:db8:1234:1a00:3304:8879:34cf:4071 2001:db8:1234:1a00:9691:9503:25ad:1761 Output:: { "AssignedIpv6Addresses": [ "2001:db8:1234:1a00:3304:8879:34cf:4071", "2001:db8:1234:1a00:9691:9503:25ad:1761" ], "NetworkInterfaceId": "eni-38664473" } **To assign IPv6 addresses that Amazon selects to a network interface** This example assigns two IPv6 addresses to the specified network interface. Amazon automatically assigns these IPv6 addresses from the available IPv6 addresses in the IPv6 CIDR block range of the subnet. Command:: aws ec2 assign-ipv6-addresses --network-interface-id eni-38664473 --ipv6-address-count 2 Output:: { "AssignedIpv6Addresses": [ "2001:db8:1234:1a00:3304:8879:34cf:4071", "2001:db8:1234:1a00:9691:9503:25ad:1761" ], "NetworkInterfaceId": "eni-38664473" } awscli-1.14.44/awscli/examples/ec2/reject-vpc-endpoint-connections.rst0000666454262600001440000000051613243367510026732 0ustar pysdk-ciamazon00000000000000**To reject an interface endpoint connection request** This example rejects the specified endpoint connection request for the specified endpoint service. Command:: aws ec2 reject-vpc-endpoint-connections --service-id vpce-svc-03d5ebb7d9579a2b3 --vpc-endpoint-ids vpce-0c1308d7312217abc Output:: { "Unsuccessful": [] }awscli-1.14.44/awscli/examples/ec2/bundle-instance.rst0000666454262600001440000000162213243367510023604 0ustar pysdk-ciamazon00000000000000**To bundle an instance** This example bundles instance ``i-1234567890abcdef0`` to a bucket called ``bundletasks``. Before you specify values for your access key IDs, review and follow the guidance in `Best Practices for Managing AWS Access Keys`_. Command:: aws ec2 bundle-instance --instance-id i-1234567890abcdef0 --bucket bundletasks --prefix winami --owner-akid AK12AJEXAMPLE --owner-sak example123example Output:: { "BundleTask": { "UpdateTime": "2015-09-15T13:30:35.000Z", "InstanceId": "i-1234567890abcdef0", "Storage": { "S3": { "Prefix": "winami", "Bucket": "bundletasks" } }, "State": "pending", "StartTime": "2015-09-15T13:30:35.000Z", "BundleId": "bun-294e041f" } } .. _`Best Practices for Managing AWS Access Keys`: http://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.htmlawscli-1.14.44/awscli/examples/ec2/monitor-instances.rst0000666454262600001440000000062313243367510024205 0ustar pysdk-ciamazon00000000000000**To enable detailed monitoring for an instance** This example command enables detailed monitoring for the specified instance. Command:: aws ec2 monitor-instances --instance-ids i-1234567890abcdef0 Output:: { "InstanceMonitorings": [ { "InstanceId": "i-1234567890abcdef0", "Monitoring": { "State": "pending" } } ] } awscli-1.14.44/awscli/examples/ec2/describe-vpc-endpoint-connections.rst0000666454262600001440000000123613243367510027236 0ustar pysdk-ciamazon00000000000000**To describe VPC endpoint connections** This example describes the interface endpoint connections to your endpoint service and filters the results to display endpoints that are ``PendingAcceptance``. Command:: aws ec2 describe-vpc-endpoint-connections --filters Name=vpc-endpoint-state,Values=pendingAcceptance Output:: { "VpcEndpointConnections": [ { "VpcEndpointId": "vpce-0abed31004e618123", "ServiceId": "vpce-svc-0abced088d20def56", "CreationTimestamp": "2017-11-30T10:00:24.350Z", "VpcEndpointState": "pendingAcceptance", "VpcEndpointOwner": "123456789012" } ] }awscli-1.14.44/awscli/examples/ec2/import-key-pair.rst0000666454262600001440000000211513243367510023560 0ustar pysdk-ciamazon00000000000000**To import a public key** First, generate a key pair with the tool of your choice. For example, use this OpenSSL command: Command:: openssl genrsa -out my-key.pem 2048 Next, save the public key to a local file. For example, use this OpenSSL command: Command:: openssl rsa -in my-key.pem -pubout > my-key.pub Finally, this example command imports the specified public key. The public key is the text in the .pub file that is between ``-----BEGIN PUBLIC KEY-----`` and ``-----END PUBLIC KEY-----``. Command:: aws ec2 import-key-pair --key-name my-key --public-key-material MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuhrGNglwb2Zz/Qcz1zV+l12fJOnWmJxC2GMwQOjAX/L7p01o9vcLRoHXxOtcHBx0TmwMo+i85HWMUE7aJtYclVWPMOeepFmDqR1AxFhaIc9jDe88iLA07VK96wY4oNpp8+lICtgCFkuXyunsk4+KhuasN6kOpk7B2w5cUWveooVrhmJprR90FOHQB2Uhe9MkRkFjnbsA/hvZ/Ay0Cflc2CRZm/NG00lbLrV4l/SQnZmP63DJx194T6pI3vAev2+6UMWSwptNmtRZPMNADjmo50KiG2c3uiUIltiQtqdbSBMh9ztL/98AHtn88JG0s8u2uSRTNEHjG55tyuMbLD40QEXAMPLE Output:: { "KeyName": "my-key", "KeyFingerprint": "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca" }awscli-1.14.44/awscli/examples/ec2/attach-volume.rst0000666454262600001440000000076213243367510023306 0ustar pysdk-ciamazon00000000000000**To attach a volume to an instance** This example command attaches a volume (``vol-1234567890abcdef0``) to an instance (``i-01474ef662b89480``) as ``/dev/sdf``. Command:: aws ec2 attach-volume --volume-id vol-1234567890abcdef0 --instance-id i-01474ef662b89480 --device /dev/sdf Output:: { "AttachTime": "YYYY-MM-DDTHH:MM:SS.000Z", "InstanceId": "i-01474ef662b89480", "VolumeId": "vol-1234567890abcdef0", "State": "attaching", "Device": "/dev/sdf" } awscli-1.14.44/awscli/examples/ec2/delete-spot-datafeed-subscription.rst0000666454262600001440000000035213243367510027232 0ustar pysdk-ciamazon00000000000000**To cancel a Spot Instance data feed subscription** This example command deletes a Spot data feed subscription for the account. If the command succeeds, no output is returned. Command:: aws ec2 delete-spot-datafeed-subscription awscli-1.14.44/awscli/examples/ec2/reject-vpc-peering-connection.rst0000666454262600001440000000035713243367510026363 0ustar pysdk-ciamazon00000000000000**To reject a VPC peering connection** This example rejects the specified VPC peering connection request. Command:: aws ec2 reject-vpc-peering-connection --vpc-peering-connection-id pcx-1a2b3c4d Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/describe-snapshots.rst0000666454262600001440000000347213243367510024336 0ustar pysdk-ciamazon00000000000000**To describe a snapshot** This example command describes a snapshot with the snapshot ID of ``snap-1234567890abcdef0``. Command:: aws ec2 describe-snapshots --snapshot-id snap-1234567890abcdef0 Output:: { "Snapshots": [ { "Description": "This is my snapshot.", "VolumeId": "vol-049df61146c4d7901", "State": "completed", "VolumeSize": 8, "Progress": "100%", "StartTime": "2014-02-28T21:28:32.000Z", "SnapshotId": "snap-1234567890abcdef0", "OwnerId": "012345678910" } ] } **To describe snapshots using filters** This example command describes all snapshots owned by the ID 012345678910 that are in the ``pending`` status. Command:: aws ec2 describe-snapshots --owner-ids 012345678910 --filters Name=status,Values=pending Output:: { "Snapshots": [ { "Description": "This is my copied snapshot.", "VolumeId": "vol-1234567890abcdef0", "State": "pending", "VolumeSize": 8, "Progress": "87%", "StartTime": "2014-02-28T21:37:27.000Z", "SnapshotId": "snap-066877671789bd71b", "OwnerId": "012345678910" } ] } **To describe tagged snapshots and filter the output** This example command describes all snapshots that have the tag ``Group=Prod``. The output is filtered to display only the snapshot IDs and the time the snapshot was started. Command:: aws ec2 describe-snapshots --filters Name=tag-key,Values="Group" Name=tag-value,Values="Prod" --query 'Snapshots[*].{ID:SnapshotId,Time:StartTime}' Output:: [ { "ID": "snap-1234567890abcdef0", "Time": "2014-08-04T12:48:18.000Z" } ]awscli-1.14.44/awscli/examples/ec2/delete-vpn-connection-route.rst0000666454262600001440000000046013243367510026064 0ustar pysdk-ciamazon00000000000000**To delete a static route from a VPN connection** This example deletes the specified static route from the specified VPN connection. If the command succeeds, no output is returned. Command:: aws ec2 delete-vpn-connection-route --vpn-connection-id vpn-40f41529 --destination-cidr-block 11.12.0.0/16 awscli-1.14.44/awscli/examples/ec2/delete-key-pair.rst0000666454262600001440000000057113243367510023514 0ustar pysdk-ciamazon00000000000000**To delete a key pair** This example deletes the key pair named ``MyKeyPair``. If the command succeeds, no output is returned. Command:: aws ec2 delete-key-pair --key-name MyKeyPair For more information, see `Using Key Pairs`_ in the *AWS Command Line Interface User Guide*. .. _`Using Key Pairs`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html awscli-1.14.44/awscli/examples/ec2/delete-customer-gateway.rst0000666454262600001440000000033013243367510025264 0ustar pysdk-ciamazon00000000000000**To delete a customer gateway** This example deletes the specified customer gateway. If the command succeeds, no output is returned. Command:: aws ec2 delete-customer-gateway --customer-gateway-id cgw-0e11f167 awscli-1.14.44/awscli/examples/ec2/create-image.rst0000666454262600001440000000244613243367510023061 0ustar pysdk-ciamazon00000000000000**To create an AMI from an Amazon EBS-backed instance** This example creates an AMI from the specified instance. Command:: aws ec2 create-image --instance-id i-1234567890abcdef0 --name "My server" --description "An AMI for my server" Output:: { "ImageId": "ami-5731123e" } This example creates an AMI and sets the --no-reboot parameter, so that the instance is not rebooted before the image is created. Command:: aws ec2 create-image --instance-id i-0b09a25c58929de26 --name "My server" --no-reboot Output:: { "ImageId": "ami-1a2b3c4d" } **To create an AMI using a block device mapping** Add the following parameter to your ``create-image`` command to add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100:: --block-device-mappings "[{\"DeviceName\": \"/dev/sdh\",\"Ebs\":{\"VolumeSize\":100}}]" Add the following parameter to your ``create-image`` command to add ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``:: --block-device-mappings "[{\"DeviceName\": \"/dev/sdc\",\"VirtualName\":\"ephemeral1\"}]" Add the following parameter to your ``create-image`` command to omit a device included on the instance (for example, ``/dev/sdf``):: --block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"NoDevice\":\"\"}]" awscli-1.14.44/awscli/examples/ec2/delete-vpn-gateway.rst0000666454262600001440000000033413243367510024232 0ustar pysdk-ciamazon00000000000000**To delete a virtual private gateway** This example deletes the specified virtual private gateway. If the command succeeds, no output is returned. Command:: aws ec2 delete-vpn-gateway --vpn-gateway-id vgw-9a4cacf3 awscli-1.14.44/awscli/examples/ec2/modify-snapshot-attribute.rst0000666454262600001440000000121713243367510025656 0ustar pysdk-ciamazon00000000000000**To modify a snapshot attribute** This example modifies snapshot ``snap-1234567890abcdef0`` to remove the create volume permission for a user with the account ID ``123456789012``. If the command succeeds, no output is returned. Command:: aws ec2 modify-snapshot-attribute --snapshot-id snap-1234567890abcdef0 --attribute createVolumePermission --operation-type remove --user-ids 123456789012 **To make a snapshot public** This example makes the snapshot ``snap-1234567890abcdef0`` public. Command:: aws ec2 modify-snapshot-attribute --snapshot-id snap-1234567890abcdef0 --attribute createVolumePermission --operation-type add --group-names allawscli-1.14.44/awscli/examples/ec2/describe-dhcp-options.rst0000666454262600001440000000153013243367510024714 0ustar pysdk-ciamazon00000000000000**To describe your DHCP options sets** This example describes your DHCP options sets. Command:: aws ec2 describe-dhcp-options Output:: { "DhcpOptions": [ { "DhcpConfigurations": [ { "Values": [ "10.2.5.2", "10.2.5.1" ], "Key": "domain-name-servers" } ], "DhcpOptionsId": "dopt-d9070ebb" }, { "DhcpConfigurations": [ { "Values": [ "AmazonProvidedDNS" ], "Key": "domain-name-servers" } ], "DhcpOptionsId": "dopt-7a8b9c2d" } ] }awscli-1.14.44/awscli/examples/ec2/create-tags.rst0000666454262600001440000000325413243367510022733 0ustar pysdk-ciamazon00000000000000**To add a tag to a resource** This example adds the tag ``Stack=production`` to the specified image, or overwrites an existing tag for the AMI where the tag key is ``Stack``. If the command succeeds, no output is returned. Command:: aws ec2 create-tags --resources ami-78a54011 --tags Key=Stack,Value=production **To add tags to multiple resources** This example adds (or overwrites) two tags for an AMI and an instance. One of the tags contains just a key (``webserver``), with no value (we set the value to an empty string). The other tag consists of a key (``stack``) and value (``Production``). If the command succeeds, no output is returned. Command:: aws ec2 create-tags --resources ami-1a2b3c4d i-1234567890abcdef0 --tags Key=webserver,Value= Key=stack,Value=Production **To add tags with special characters** This example adds the tag ``[Group]=test`` for an instance. The square brackets ([ and ]) are special characters, and must be escaped. If you are using Windows, surround the value with (\"): Command:: aws ec2 create-tags --resources i-1234567890abcdef0 --tags Key=\"[Group]\",Value=test If you are using Windows PowerShell, break out the characters with a backslash (\\), surround them with double quotes ("), and then surround the entire key and value structure with single quotes ('): Command:: aws ec2 create-tags --resources i-1234567890abcdef0 --tags 'Key=\"[Group]\",Value=test' If you are using Linux or OS X, enclose the entire key and value structure with single quotes ('), and then enclose the element with the special character with double quotes ("): Command:: aws ec2 create-tags --resources i-1234567890abcdef0 --tags 'Key="[Group]",Value=test' awscli-1.14.44/awscli/examples/ec2/associate-subnet-cidr-block.rst0000666454262600001440000000101113243367510026001 0ustar pysdk-ciamazon00000000000000**To associate an IPv6 CIDR block with a subnet** This example associates an IPv6 CIDR block with the specified subnet. Command:: aws ec2 associate-subnet-cidr-block --subnet-id subnet-5f46ec3b --ipv6-cidr-block 2001:db8:1234:1a00::/64 Output:: { "SubnetId": "subnet-5f46ec3b", "Ipv6CidrBlockAssociation": { "Ipv6CidrBlock": "2001:db8:1234:1a00::/64", "AssociationId": "subnet-cidr-assoc-3aa54053", "Ipv6CidrBlockState": { "State": "associating" } } }awscli-1.14.44/awscli/examples/ec2/delete-route-table.rst0000666454262600001440000000030413243367510024210 0ustar pysdk-ciamazon00000000000000**To delete a route table** This example deletes the specified route table. If the command succeeds, no output is returned. Command:: aws ec2 delete-route-table --route-table-id rtb-22574640 awscli-1.14.44/awscli/examples/ec2/describe-moving-addresses.rst0000666454262600001440000000072513243367510025564 0ustar pysdk-ciamazon00000000000000**To describe your moving addresses** This example describes all of your moving Elastic IP addresses. Command:: aws ec2 describe-moving-addresses Output:: { "MovingAddressStatuses": [ { "PublicIp": "198.51.100.0", "MoveStatus": "MovingToVpc" } ] } This example describes all addresses that are moving to the EC2-VPC platform. Command:: aws ec2 describe-moving-addresses --filters Name=moving-status,Values=MovingToVpcawscli-1.14.44/awscli/examples/ec2/describe-network-interface-attribute.rst0000666454262600001440000000360613243367510027743 0ustar pysdk-ciamazon00000000000000**To describe the attachment attribute of a network interface** This example command describes the ``attachment`` attribute of the specified network interface. Command:: aws ec2 describe-network-interface-attribute --network-interface-id eni-686ea200 --attribute attachment Output:: { "NetworkInterfaceId": "eni-686ea200", "Attachment": { "Status": "attached", "DeviceIndex": 0, "AttachTime": "2015-05-21T20:02:20.000Z", "InstanceId": "i-1234567890abcdef0", "DeleteOnTermination": true, "AttachmentId": "eni-attach-43348162", "InstanceOwnerId": "123456789012" } } **To describe the description attribute of a network interface** This example command describes the ``description`` attribute of the specified network interface. Command:: aws ec2 describe-network-interface-attribute --network-interface-id eni-686ea200 --attribute description Output:: { "NetworkInterfaceId": "eni-686ea200", "Description": { "Value": "My description" } } **To describe the groupSet attribute of a network interface** This example command describes the ``groupSet`` attribute of the specified network interface. Command:: aws ec2 describe-network-interface-attribute --network-interface-id eni-686ea200 --attribute groupSet Output:: { "NetworkInterfaceId": "eni-686ea200", "Groups": [ { "GroupName": "my-security-group", "GroupId": "sg-903004f8" } ] } **To describe the sourceDestCheck attribute of a network interface** This example command describes the ``sourceDestCheck`` attribute of the specified network interface. Command:: aws ec2 describe-network-interface-attribute --network-interface-id eni-686ea200 --attribute sourceDestCheck Output:: { "NetworkInterfaceId": "eni-686ea200", "SourceDestCheck": { "Value": true } } awscli-1.14.44/awscli/examples/ec2/describe-scheduled-instances.rst0000666454262600001440000000240213243367510026231 0ustar pysdk-ciamazon00000000000000**To describe your Scheduled Instances** This example describes the specified Scheduled Instance. Command:: aws ec2 describe-scheduled-instances --scheduled-instance-ids sci-1234-1234-1234-1234-123456789012 Output:: { "ScheduledInstanceSet": [ { "AvailabilityZone": "us-west-2b", "ScheduledInstanceId": "sci-1234-1234-1234-1234-123456789012", "HourlyPrice": "0.095", "CreateDate": "2016-01-25T21:43:38.612Z", "Recurrence": { "OccurrenceDaySet": [ 1 ], "Interval": 1, "Frequency": "Weekly", "OccurrenceRelativeToEnd": false, "OccurrenceUnit": "" }, "Platform": "Linux/UNIX", "TermEndDate": "2017-01-31T09:00:00Z", "InstanceCount": 1, "SlotDurationInHours": 32, "TermStartDate": "2016-01-31T09:00:00Z", "NetworkPlatform": "EC2-VPC", "TotalScheduledInstanceHours": 1696, "NextSlotStartTime": "2016-01-31T09:00:00Z", "InstanceType": "c4.large" } ] } This example describes all your Scheduled Instances. Command:: aws ec2 describe-scheduled-instances awscli-1.14.44/awscli/examples/ec2/modify-instance-placement.rst0000666454262600001440000000051413243367510025567 0ustar pysdk-ciamazon00000000000000**To set the instance affinity value for a specific stopped Dedicated Host** To modify the affinity of an instance so it always has affinity with the specified Dedicated Host . Command:: aws ec2 modify-instance-placement --instance-id=i-1234567890abcdef0 --host-id h-029e7409a3350a31f Output:: { "Return": true } awscli-1.14.44/awscli/examples/ec2/reset-instance-attribute.rst0000666454262600001440000000163213243367510025457 0ustar pysdk-ciamazon00000000000000**To reset the sourceDestCheck attribute** This example resets the ``sourceDestCheck`` attribute of the specified instance. The instance must be in a VPC. If the command succeeds, no output is returned. Command:: aws ec2 reset-instance-attribute --instance-id i-1234567890abcdef0 --attribute sourceDestCheck **To reset the kernel attribute** This example resets the ``kernel`` attribute of the specified instance. The instance must be in the ``stopped`` state. If the command succeeds, no output is returned. Command:: aws ec2 reset-instance-attribute --instance-id i-1234567890abcdef0 --attribute kernel **To reset the ramdisk attribute** This example resets the ``ramdisk`` attribute of the specified instance. The instance must be in the ``stopped`` state. If the command succeeds, no output is returned. Command:: aws ec2 reset-instance-attribute --instance-id i-1234567890abcdef0 --attribute ramdisk awscli-1.14.44/awscli/examples/ec2/describe-identity-id-format.rst0000666454262600001440000000211213243367510026013 0ustar pysdk-ciamazon00000000000000**To describe the ID format for an IAM role** This example describes the ID format of the ``instance`` resource for the IAM role ``EC2Role`` in your AWS account. The output indicates that instances are enabled for longer IDs - instances created by this role receive longer IDs. Command:: aws ec2 describe-identity-id-format --principal-arn arn:aws:iam::123456789012:role/EC2Role --resource instance Output:: { "Statuses": [ { "UseLongIds": true, "Resource": "instance" } ] } **To describe the ID format for an IAM user** This example describes the ID format of the ``snapshot`` resource for the IAM user ``AdminUser`` in your AWS account. The output indicates that snapshots are enabled for longer IDs - snapshots created by this user receive longer IDs. Command:: aws ec2 describe-identity-id-format --principal-arn arn:aws:iam::123456789012:user/AdminUser --resource snapshot Output:: { "Statuses": [ { "UseLongIds": true, "Resource": "snapshot" } ] }awscli-1.14.44/awscli/examples/ec2/associate-vpc-cidr-block.rst0000666454262600001440000000162113243367510025300 0ustar pysdk-ciamazon00000000000000**To associate an IPv6 CIDR block with a VPC** This example associates an IPv6 CIDR block with a VPC. Command:: aws ec2 associate-vpc-cidr-block --amazon-provided-ipv6-cidr-block --vpc-id vpc-a034d6c4 Output:: { "Ipv6CidrBlockAssociation": { "Ipv6CidrBlockState": { "State": "associating" }, "AssociationId": "vpc-cidr-assoc-eca54085" }, "VpcId": "vpc-a034d6c4" } **To associate an additional IPv4 CIDR block with a VPC** This example associates the IPv4 CIDR block ``10.2.0.0/16`` with VPC ``vpc-1a2b3c4d``. Command:: aws ec2 associate-vpc-cidr-block --vpc-id vpc-1a2b3c4d --cidr-block 10.2.0.0/16 Output:: { "CidrBlockAssociation": { "AssociationId": "vpc-cidr-assoc-2447724d", "CidrBlock": "10.2.0.0/16", "CidrBlockState": { "State": "associating" } }, "VpcId": "vpc-1a2b3c4d" }awscli-1.14.44/awscli/examples/ec2/describe-addresses.rst0000666454262600001440000000615713243367510024274 0ustar pysdk-ciamazon00000000000000**To describe your Elastic IP addresses** This example describes your Elastic IP addresses. Command:: aws ec2 describe-addresses Output:: { "Addresses": [ { "InstanceId": "i-1234567890abcdef0", "PublicIp": "198.51.100.0", "Domain": "standard" }, { "Domain": "vpc", "InstanceId": "i-1234567890abcdef0", "NetworkInterfaceId": "eni-12345678", "AssociationId": "eipassoc-12345678", "NetworkInterfaceOwnerId": "123456789012", "PublicIp": "203.0.113.0", "AllocationId": "eipalloc-12345678", "PrivateIpAddress": "10.0.1.241" } ] } **To describe your Elastic IP addresses for EC2-VPC** This example describes your Elastic IP addresses for use with instances in a VPC. Command:: aws ec2 describe-addresses --filters "Name=domain,Values=vpc" Output:: { "Addresses": [ { "Domain": "vpc", "InstanceId": "i-1234567890abcdef0", "NetworkInterfaceId": "eni-12345678", "AssociationId": "eipassoc-12345678", "NetworkInterfaceOwnerId": "123456789012", "PublicIp": "203.0.113.0", "AllocationId": "eipalloc-12345678", "PrivateIpAddress": "10.0.1.241" } ] } This example describes the Elastic IP address with the allocation ID ``eipalloc-282d9641``, which is associated with an instance in EC2-VPC. Command:: aws ec2 describe-addresses --allocation-ids eipalloc-282d9641 Output:: { "Addresses": [ { "Domain": "vpc", "InstanceId": "i-1234567890abcdef0", "NetworkInterfaceId": "eni-1a2b3c4d", "AssociationId": "eipassoc-123abc12", "NetworkInterfaceOwnerId": "1234567891012", "PublicIp": "203.0.113.25", "AllocationId": "eipalloc-282d9641", "PrivateIpAddress": "10.251.50.12" } ] } This example describes the Elastic IP address associated with a particular private IP address in EC2-VPC. Command:: aws ec2 describe-addresses --filters "Name=private-ip-address,Values=10.251.50.12" **To describe your Elastic IP addresses in EC2-Classic** This example describes your Elastic IP addresses for use in EC2-Classic. Command:: aws ec2 describe-addresses --filters "Name=domain,Values=standard" Output:: { "Addresses": [ { "InstanceId": "i-1234567890abcdef0", "PublicIp": "203.0.110.25", "Domain": "standard" } ] } This example describes the Elastic IP address with the value ``203.0.110.25``, which is associated with an instance in EC2-Classic. Command:: aws ec2 describe-addresses --public-ips 203.0.110.25 Output:: { "Addresses": [ { "InstanceId": "i-1234567890abcdef0", "PublicIp": "203.0.110.25", "Domain": "standard" } ] } awscli-1.14.44/awscli/examples/ec2/describe-instance-credit-specifications.rst0000666454262600001440000000064513243367510030370 0ustar pysdk-ciamazon00000000000000**To describe the credit option for CPU usage of one or more instances** This example describes the current credit option for CPU usage of the specified instance. Command:: aws ec2 describe-instance-credit-specifications --instance-id i-1234567890abcdef0 Output:: { "InstanceCreditSpecifications": [ { "InstanceId": "i-1234567890abcdef0", "CpuCredits": "unlimited" } ] }awscli-1.14.44/awscli/examples/ec2/describe-elastic-gpus.rst0000666454262600001440000000020213243367510024700 0ustar pysdk-ciamazon00000000000000**To describe an Elastic GPU** Command:: aws ec2 describe-elastic-gpus --elastic-gpu-ids egpu-12345678901234567890abcdefghijklawscli-1.14.44/awscli/examples/ec2/detach-network-interface.rst0000666454262600001440000000041413243367510025404 0ustar pysdk-ciamazon00000000000000**To detach a network interface from your instance** This example detaches the specified network interface from the specified instance. If the command succeeds, no output is returned. Command:: aws ec2 detach-network-interface --attachment-id eni-attach-66c4350a awscli-1.14.44/awscli/examples/ec2/release-address.rst0000666454262600001440000000076213243367510023600 0ustar pysdk-ciamazon00000000000000**To release an Elastic IP addresses for EC2-Classic** This example releases an Elastic IP address for use with instances in EC2-Classic. If the command succeeds, no output is returned. Command:: aws ec2 release-address --public-ip 198.51.100.0 **To release an Elastic IP address for EC2-VPC** This example releases an Elastic IP address for use with instances in a VPC. If the command succeeds, no output is returned. Command:: aws ec2 release-address --allocation-id eipalloc-64d5890a awscli-1.14.44/awscli/examples/ec2/replace-network-acl-entry.rst0000666454262600001440000000062513243367510025531 0ustar pysdk-ciamazon00000000000000**To replace a network ACL entry** This example replaces an entry for the specified network ACL. The new rule 100 allows ingress traffic from 203.0.113.12/24 on UDP port 53 (DNS) into any associated subnet. Command:: aws ec2 replace-network-acl-entry --network-acl-id acl-5fb85d36 --ingress --rule-number 100 --protocol udp --port-range From=53,To=53 --cidr-block 203.0.113.12/24 --rule-action allow awscli-1.14.44/awscli/examples/ec2/attach-internet-gateway.rst0000666454262600001440000000042013243367510025255 0ustar pysdk-ciamazon00000000000000**To attach an Internet gateway to your VPC** This example attaches the specified Internet gateway to the specified VPC. If the command succeeds, no output is returned. Command:: aws ec2 attach-internet-gateway --internet-gateway-id igw-c0a643a9 --vpc-id vpc-a01106c2awscli-1.14.44/awscli/examples/ec2/unassign-ipv6-addresses.rst0000666454262600001440000000066213243367510025220 0ustar pysdk-ciamazon00000000000000**To unassign an IPv6 address from a network interface** This example unassigns the specified IPv6 address from the specified network interface. Command:: aws ec2 unassign-ipv6-addresses --ipv6-addresses 2001:db8:1234:1a00:3304:8879:34cf:4071 --network-interface-id eni-23c49b68 Output:: { "NetworkInterfaceId": "eni-23c49b68", "UnassignedIpv6Addresses": [ "2001:db8:1234:1a00:3304:8879:34cf:4071" ] } awscli-1.14.44/awscli/examples/ec2/disable-vpc-classic-link-dns-support.rst0000666454262600001440000000035413243367510027571 0ustar pysdk-ciamazon00000000000000**To disable ClassicLink DNS support for a VPC** This example disables ClassicLink DNS support for ``vpc-88888888``. Command:: aws ec2 disable-vpc-classic-link-dns-support --vpc-id vpc-88888888 Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/modify-instance-credit-specification.rst0000666454262600001440000000112613243367510027707 0ustar pysdk-ciamazon00000000000000**To modify the credit option for CPU usage of an instance** This example modifies the credit option for CPU usage of the specified instance in the specified region to "unlimited". Valid credit options are "standard" and "unlimited". Command:: aws ec2 modify-instance-credit-specification --region us-east-1 --instance-credit-specification '[{"InstanceId": "i-1234567890abcdef0","CpuCredits": "unlimited"}]' Output:: { "SuccessfulInstanceCreditSpecifications": [ { "InstanceId": "i-1234567890abcdef0" } ], "UnsuccessfulInstanceCreditSpecifications": [] }awscli-1.14.44/awscli/examples/ec2/delete-vpc-endpoint-service-configurations.rst0000666454262600001440000000040513243367510031063 0ustar pysdk-ciamazon00000000000000**To delete an endpoint service configuration** This example deletes the specified endpoint service configuration. Command:: aws ec2 delete-vpc-endpoint-service-configurations --service-ids vpce-svc-03d5ebb7d9579a2b3 Output:: { "Unsuccessful": [] }awscli-1.14.44/awscli/examples/ec2/describe-bundle-tasks.rst0000666454262600001440000000106413243367510024703 0ustar pysdk-ciamazon00000000000000**To describe your bundle tasks** This example describes all of your bundle tasks. Command:: aws ec2 describe-bundle-tasks Output:: { "BundleTasks": [ { "UpdateTime": "2015-09-15T13:26:54.000Z", "InstanceId": "i-1234567890abcdef0", "Storage": { "S3": { "Prefix": "winami", "Bucket": "bundletasks" } }, "State": "bundling", "StartTime": "2015-09-15T13:24:35.000Z", "Progress": "3%", "BundleId": "bun-2a4e041c" } ] }awscli-1.14.44/awscli/examples/ec2/describe-volume-status.rst0000666454262600001440000000274313243367510025144 0ustar pysdk-ciamazon00000000000000**To describe the status of a single volume** This example command describes the status for the volume ``vol-1234567890abcdef0``. Command:: aws ec2 describe-volume-status --volume-ids vol-1234567890abcdef0 Output:: { "VolumeStatuses": [ { "VolumeStatus": { "Status": "ok", "Details": [ { "Status": "passed", "Name": "io-enabled" }, { "Status": "not-applicable", "Name": "io-performance" } ] }, "AvailabilityZone": "us-east-1a", "VolumeId": "vol-1234567890abcdef0", "Actions": [], "Events": [] } ] } **To describe the status of impaired volumes** This example command describes the status for all volumes that are impaired. In this example output, there are no impaired volumes. Command:: aws ec2 describe-volume-status --filters Name=volume-status.status,Values=impaired Output:: { "VolumeStatuses": [] } If you have a volume with a failed status check (status is impaired), see `Working with an Impaired Volume`_ in the *Amazon EC2 User Guide*. .. _`Working with an Impaired Volume`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html#work_volumes_impaired awscli-1.14.44/awscli/examples/ec2/modify-vpc-tenancy.rst0000666454262600001440000000035513243367510024247 0ustar pysdk-ciamazon00000000000000**To modify the tenancy of a VPC** This example modifies the tenancy of VPC ``vpc-1a2b3c4d`` to ``default``. Command:: aws ec2 modify-vpc-tenancy --vpc-id vpc-1a2b3c4d --instance-tenancy default Output:: { "Return": true }awscli-1.14.44/awscli/examples/ec2/create-spot-datafeed-subscription.rst0000666454262600001440000000063513243367510027237 0ustar pysdk-ciamazon00000000000000**To create a Spot Instance datafeed** This example command creates a Spot Instance data feed for the account. Command:: aws ec2 create-spot-datafeed-subscription --bucket --prefix spotdata Output:: { "SpotDatafeedSubscription": { "OwnerId": "", "Prefix": "spotdata", "Bucket": "", "State": "Active" } } awscli-1.14.44/awscli/examples/ec2/create-volume.rst0000666454262600001440000000312413243367510023300 0ustar pysdk-ciamazon00000000000000**To create a new volume** This example command creates an 80 GiB General Purpose (SSD) volume in the Availability Zone ``us-east-1a``. Command:: aws ec2 create-volume --size 80 --region us-east-1 --availability-zone us-east-1a --volume-type gp2 Output:: { "AvailabilityZone": "us-east-1a", "Attachments": [], "Tags": [], "VolumeType": "gp2", "VolumeId": "vol-1234567890abcdef0", "State": "creating", "SnapshotId": null, "CreateTime": "YYYY-MM-DDTHH:MM:SS.000Z", "Size": 80 } **To create a new Provisioned IOPS (SSD) volume from a snapshot** This example command creates a new Provisioned IOPS (SSD) volume with 1000 provisioned IOPS from a snapshot in the Availability Zone ``us-east-1a``. Command:: aws ec2 create-volume --region us-east-1 --availability-zone us-east-1a --snapshot-id snap-066877671789bd71b --volume-type io1 --iops 1000 Output:: { "AvailabilityZone": "us-east-1a", "Attachments": [], "Tags": [], "VolumeType": "io1", "VolumeId": "vol-1234567890abcdef0", "State": "creating", "Iops": 1000, "SnapshotId": "snap-066877671789bd71b", "CreateTime": "YYYY-MM-DDTHH:MM:SS.000Z", "Size": 500 } **To create a volume with tags** This example creates a volume and applies two tags: ``purpose`` = ``production``, and ``cost-center`` = ``cc123``. Command:: aws ec2 create-volume --availability-zone us-east-1a --volume-type gp2 --size 80 --tag-specifications 'ResourceType=volume,Tags=[{Key=purpose,Value=production},{Key=cost-center,Value=cc123}]'awscli-1.14.44/awscli/examples/ec2/modify-fpga-image-attribute.rst0000666454262600001440000000100213243367510026004 0ustar pysdk-ciamazon00000000000000**To modify the attributes of an Amazon FPGA image** This example adds load permissions for account ID ``123456789012`` for the specified AFI. Command:: aws ec2 modify-fpga-image-attribute --attribute loadPermission --fpga-image-id afi-0d123e123bfc85abc --load-permission Add=[{UserId=123456789012} Output:: { "FpgaImageAttribute": { "FpgaImageId": "afi-0d123e123bfc85abc", "LoadPermissions": [ { "UserId": "123456789012" } ] } } awscli-1.14.44/awscli/examples/ec2/modify-subnet-attribute.rst0000666454262600001440000000153613243367510025323 0ustar pysdk-ciamazon00000000000000**To change a subnet's public IPv4 addressing behavior** This example modifies subnet-1a2b3c4d to specify that all instances launched into this subnet are assigned a public IPv4 address. If the command succeeds, no output is returned. Command:: aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --map-public-ip-on-launch **To change a subnet's IPv6 addressing behavior** This example modifies subnet-1a2b3c4d to specify that all instances launched into this subnet are assigned an IPv6 address from the range of the subnet. Command:: aws ec2 modify-subnet-attribute --subnet-id subnet-1a2b3c4d --assign-ipv6-address-on-creation For more information, see `IP Addressing in Your VPC`_ in the *AWS Virtual Private Cloud User Guide*. .. _`IP Addressing in Your VPC`: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-ip-addressing.htmlawscli-1.14.44/awscli/examples/codepipeline/0000777454262600001440000000000013243367512021767 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/codepipeline/disable-stage-transition.rst0000666454262600001440000000047213243367510027416 0ustar pysdk-ciamazon00000000000000**To disable a transition to a stage in a pipeline** This example disables transitions into the Beta stage of the MyFirstPipeline pipeline in AWS CodePipeline. Command:: aws codepipeline disable-stage-transition --pipeline-name MyFirstPipeline --stage-name Beta --transition-type Inbound Output:: None.awscli-1.14.44/awscli/examples/codepipeline/list-action-types.rst0000666454262600001440000000447413243367510026120 0ustar pysdk-ciamazon00000000000000**To view the action types available** Used by itself, the list-action-types command returns the structure of all actions available to your AWS account. This example uses the --action-owner-filter option to return only custom actions. Command:: aws codepipeline list-action-types --action-owner-filter Custom Output:: { "actionTypes": [ { "inputArtifactDetails": { "maximumCount": 5, "minimumCount": 0 }, "actionConfigurationProperties": [ { "secret": false, "required": true, "name": "MyJenkinsExampleBuildProject", "key": true, "queryable": true } ], "outputArtifactDetails": { "maximumCount": 5, "minimumCount": 0 }, "id": { "category": "Build", "owner": "Custom", "version": "1", "provider": "MyJenkinsProviderName" }, "settings": { "entityUrlTemplate": "http://192.0.2.4/job/{Config:ProjectName}", "executionUrlTemplate": "http://192.0.2.4/job/{Config:ProjectName}/{ExternalExecutionId}" } }, { "inputArtifactDetails": { "maximumCount": 5, "minimumCount": 0 }, "actionConfigurationProperties": [ { "secret": false, "required": true, "name": "MyJenkinsExampleTestProject", "key": true, "queryable": true } ], "outputArtifactDetails": { "maximumCount": 5, "minimumCount": 0 }, "id": { "category": "Test", "owner": "Custom", "version": "1", "provider": "MyJenkinsProviderName" }, "settings": { "entityUrlTemplate": "http://192.0.2.4/job/{Config:ProjectName}", "executionUrlTemplate": "http://192.0.2.4/job/{Config:ProjectName}/{ExternalExecutionId}" } } ] }awscli-1.14.44/awscli/examples/codepipeline/create-pipeline.rst0000666454262600001440000000411213243367510025563 0ustar pysdk-ciamazon00000000000000**To create a pipeline** This example creates a pipeline in AWS CodePipeline using an already-created JSON file (here named MySecondPipeline.json) that contains the structure of the pipeline. For more information about the requirements for creating a pipeline, including the structure of the file, see the AWS CodePipeline User Guide. Command:: aws codepipeline create-pipeline --cli-input-json file://MySecondPipeline.json JSON file sample contents:: { "pipeline": { "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service", "stages": [ { "name": "Source", "actions": [ { "inputArtifacts": [], "name": "Source", "actionTypeId": { "category": "Source", "owner": "AWS", "version": "1", "provider": "S3" }, "outputArtifacts": [ { "name": "MyApp" } ], "configuration": { "S3Bucket": "awscodepipeline-demo-bucket", "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip" }, "runOrder": 1 } ] }, { "name": "Beta", "actions": [ { "inputArtifacts": [ { "name": "MyApp" } ], "name": "CodePipelineDemoFleet", "actionTypeId": { "category": "Deploy", "owner": "AWS", "version": "1", "provider": "CodeDeploy" }, "outputArtifacts": [], "configuration": { "ApplicationName": "CodePipelineDemoApplication", "DeploymentGroupName": "CodePipelineDemoFleet" }, "runOrder": 1 } ] } ], "artifactStore": { "type": "S3", "location": "codepipeline-us-east-1-11EXAMPLE11" }, "name": "MySecondPipeline", "version": 1 } } Output:: This command returns the structure of the pipeline.awscli-1.14.44/awscli/examples/codepipeline/create-custom-action-type.rst0000666454262600001440000000262513243367510027531 0ustar pysdk-ciamazon00000000000000**To create a custom action** This example creates a custom action for AWS CodePipeline using an already-created JSON file (here named MyCustomAction.json) that contains the structure of the custom action. For more information about the requirements for creating a custom action, including the structure of the file, see the AWS CodePipeline User Guide. Command:: aws codepipeline create-custom-action-type --cli-input-json file://MyCustomAction.json JSON file sample contents:: { "category": "Build", "provider": "MyJenkinsProviderName", "version": "1", "settings": { "entityUrlTemplate": "https://192.0.2.4/job/{Config:ProjectName}/", "executionUrlTemplate": "https://192.0.2.4/job/{Config:ProjectName}/lastSuccessfulBuild/{ExternalExecutionId}/" }, "configurationProperties": [ { "name": "MyJenkinsExampleBuildProject", "required": true, "key": true, "secret": false, "queryable": false, "description": "The name of the build project must be provided when this action is added to the pipeline.", "type": "String" } ], "inputArtifactDetails": { "maximumCount": 1, "minimumCount": 0 }, "outputArtifactDetails": { "maximumCount": 1, "minimumCount": 0 } } Output:: This command returns the structure of the custom action.awscli-1.14.44/awscli/examples/codepipeline/update-pipeline.rst0000666454262600001440000000700013243367510025601 0ustar pysdk-ciamazon00000000000000**To update the structure of a pipeline** This example updates the structure of a pipeline by using a pre-defined JSON file (MyFirstPipeline.json) to supply the new structure. Command:: aws codepipeline update-pipeline --cli-input-json file://MyFirstPipeline.json Sample JSON file contents:: { "pipeline": { "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service", "stages": [ { "name": "Source", "actions": [ { "inputArtifacts": [], "name": "Source", "actionTypeId": { "category": "Source", "owner": "AWS", "version": "1", "provider": "S3" }, "outputArtifacts": [ { "name": "MyApp" } ], "configuration": { "S3Bucket": "awscodepipeline-demo-bucket2", "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip" }, "runOrder": 1 } ] }, { "name": "Beta", "actions": [ { "inputArtifacts": [ { "name": "MyApp" } ], "name": "CodePipelineDemoFleet", "actionTypeId": { "category": "Deploy", "owner": "AWS", "version": "1", "provider": "CodeDeploy" }, "outputArtifacts": [], "configuration": { "ApplicationName": "CodePipelineDemoApplication", "DeploymentGroupName": "CodePipelineDemoFleet" }, "runOrder": 1 } ] } ], "artifactStore": { "type": "S3", "location": "codepipeline-us-east-1-11EXAMPLE11" }, "name": "MyFirstPipeline", "version": 1 } } Output:: { "pipeline": { "artifactStore": { "location": "codepipeline-us-east-1-11EXAMPLE11", "type": "S3" }, "name": "MyFirstPipeline", "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service", "stages": [ { "actions": [ { "actionTypeId": { "__type": "ActionTypeId", "category": "Source", "owner": "AWS", "provider": "S3", "version": "1" }, "configuration": { "S3Bucket": "awscodepipeline-demo-bucket2", "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip" }, "inputArtifacts": [], "name": "Source", "outputArtifacts": [ { "name": "MyApp" } ], "runOrder": 1 } ], "name": "Source" }, { "actions": [ { "actionTypeId": { "__type": "ActionTypeId", "category": "Deploy", "owner": "AWS", "provider": "CodeDeploy", "version": "1" }, "configuration": { "ApplicationName": "CodePipelineDemoApplication", "DeploymentGroupName": "CodePipelineDemoFleet" }, "inputArtifacts": [ { "name": "MyApp" } ], "name": "CodePipelineDemoFleet", "outputArtifacts": [], "runOrder": 1 } ], "name": "Beta" } ], "version": 3 } }awscli-1.14.44/awscli/examples/codepipeline/get-pipeline-state.rst0000666454262600001440000000255713243367510026230 0ustar pysdk-ciamazon00000000000000**To get information about the state of a pipeline** This example returns the most recent state of a pipeline named MyFirstPipeline. Command:: aws codepipeline get-pipeline-state --name MyFirstPipeline Output:: { "created": 1446137312.204, "pipelineName": "MyFirstPipeline", "pipelineVersion": 1, "stageStates": [ { "actionStates": [ { "actionName": "Source", "entityUrl": "https://console.aws.amazon.com/s3/home?#", "latestExecution": { "lastStatusChange": 1446137358.328, "status": "Succeeded" } } ], "stageName": "Source" }, { "actionStates": [ { "actionName": "CodePipelineDemoFleet", "entityUrl": "https://console.aws.amazon.com/codedeploy/home?#/applications/CodePipelineDemoApplication/deployment-groups/CodePipelineDemoFleet", "latestExecution": { "externalExecutionId": "d-EXAMPLE", "externalExecutionUrl": "https://console.aws.amazon.com/codedeploy/home?#/deployments/d-EXAMPLE", "lastStatusChange": 1446137493.131, "status": "Succeeded", "summary": "Deployment Succeeded" } } ], "inboundTransitionState": { "enabled": true }, "stageName": "Beta" } ], "updated": 1446137312.204 } awscli-1.14.44/awscli/examples/codepipeline/delete-pipeline.rst0000666454262600001440000000043713243367510025570 0ustar pysdk-ciamazon00000000000000**To delete a pipeline** This example deletes a pipeline named MySecondPipeline from AWS CodePipeline. Use the list-pipelines command to view a list of pipelines associated with your AWS account. Command:: aws codepipeline delete-pipeline --name MySecondPipeline Output:: None.awscli-1.14.44/awscli/examples/codepipeline/list-pipelines.rst0000666454262600001440000000103013243367510025452 0ustar pysdk-ciamazon00000000000000**To view a list of pipelines** This example lists all AWS CodePipeline pipelines associated with the user's AWS account. Command:: aws codepipeline list-pipelines Output:: { "pipelines": [ { "updated": 1439504274.641, "version": 1, "name": "MyFirstPipeline", "created": 1439504274.641 }, { "updated": 1436461837.992, "version": 2, "name": "MySecondPipeline", "created": 1436460801.381 } ] }awscli-1.14.44/awscli/examples/codepipeline/enable-stage-transition.rst0000666454262600001440000000046713243367510027245 0ustar pysdk-ciamazon00000000000000**To enable a transition to a stage in a pipeline** This example enables transitions into the Beta stage of the MyFirstPipeline pipeline in AWS CodePipeline. Command:: aws codepipeline enable-stage-transition --pipeline-name MyFirstPipeline --stage-name Beta --transition-type Inbound Output:: None.awscli-1.14.44/awscli/examples/codepipeline/get-pipeline.rst0000666454262600001440000000455713243367510025114 0ustar pysdk-ciamazon00000000000000**To view the structure of a pipeline** This example returns the structure of a pipeline named MyFirstPipeline. Command:: aws codepipeline get-pipeline --name MyFirstPipeline Output:: { "pipeline": { "roleArn": "arn:aws:iam::111111111111:role/AWS-CodePipeline-Service", "stages": [ { "name": "Source", "actions": [ { "inputArtifacts": [], "name": "Source", "actionTypeId": { "category": "Source", "owner": "AWS", "version": "1", "provider": "S3" }, "outputArtifacts": [ { "name": "MyApp" } ], "configuration": { "S3Bucket": "awscodepipeline-demo-bucket", "S3ObjectKey": "aws-codepipeline-s3-aws-codedeploy_linux.zip" }, "runOrder": 1 } ] }, { "name": "Beta", "actions": [ { "inputArtifacts": [ { "name": "MyApp" } ], "name": "CodePipelineDemoFleet", "actionTypeId": { "category": "Deploy", "owner": "AWS", "version": "1", "provider": "CodeDeploy" }, "outputArtifacts": [], "configuration": { "ApplicationName": "CodePipelineDemoApplication", "DeploymentGroupName": "CodePipelineDemoFleet" }, "runOrder": 1 } ] } ], "artifactStore": { "type": "S3", "location": "codepipeline-us-east-1-11EXAMPLE11" }, "name": "MyFirstPipeline", "version": 1 } } awscli-1.14.44/awscli/examples/codepipeline/acknowledge-job.rst0000666454262600001440000000065113243367510025554 0ustar pysdk-ciamazon00000000000000**To retrieve information about a specified job** This example returns information about a specified job, including the status of that job if it exists. This is only used for job workers and custom actions. To determine the value of nonce and the job ID, use aws codepipeline poll-for-jobs. Command:: aws codepipeline acknowledge-job --job-id f4f4ff82-2d11-EXAMPLE --nonce 3 Output:: { "status": "InProgress" }awscli-1.14.44/awscli/examples/codepipeline/start-pipeline-execution.rst0000666454262600001440000000050613243367510027461 0ustar pysdk-ciamazon00000000000000**To run the latest revision through a pipeline** This example runs the latest revision present in the source stage of a pipeline through the pipeline named "MyFirstPipeline". Command:: aws codepipeline start-pipeline-execution --name MyFirstPipeline Output:: { "pipelineExecutionId": "3137f7cb-7cf7-EXAMPLE" }awscli-1.14.44/awscli/examples/codepipeline/poll-for-jobs.rst0000666454262600001440000000625613243367510025215 0ustar pysdk-ciamazon00000000000000**To view any available jobs** This example returns information about any jobs for a job worker to act upon. This example uses a pre-defined JSON file (MyActionTypeInfo.json) to supply information about the action type for which the job worker processes jobs. This command is only used for custom actions. When this command is called, AWS CodePipeline returns temporary credentials for the Amazon S3 bucket used to store artifacts for the pipeline. This command will also return any secret values defined for the action, if any are defined. Command:: aws codepipeline poll-for-jobs --cli-input-json file://MyActionTypeInfo.json JSON file sample contents:: { "actionTypeId": { "category": "Test", "owner": "Custom", "provider": "MyJenkinsProviderName", "version": "1" }, "maxBatchSize": 5, "queryParam": { "ProjectName": "MyJenkinsTestProject" } } Output:: { "jobs": [ { "accountId": "111111111111", "data": { "actionConfiguration": { "__type": "ActionConfiguration", "configuration": { "ProjectName": "MyJenkinsExampleTestProject" } }, "actionTypeId": { "__type": "ActionTypeId", "category": "Test", "owner": "Custom", "provider": "MyJenkinsProviderName", "version": "1" }, "artifactCredentials": { "__type": "AWSSessionCredentials", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "sessionToken": "fICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcNMTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9TrDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpEIbb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0FkbFFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTbNYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE=" }, "inputArtifacts": [ { "__type": "Artifact", "location": { "s3Location": { "bucketName": "codepipeline-us-east-1-11EXAMPLE11", "objectKey": "MySecondPipeline/MyAppBuild/EXAMPLE" }, "type": "S3" }, "name": "MyAppBuild" } ], "outputArtifacts": [], "pipelineContext": { "__type": "PipelineContext", "action": { "name": "MyJenkinsTest-Action" }, "pipelineName": "MySecondPipeline", "stage": { "name": "Testing" } } }, "id": "ef66c259-64f9-EXAMPLE", "nonce": "3" } ] }awscli-1.14.44/awscli/examples/codepipeline/get-job-details.rst0000666454262600001440000000525213243367510025475 0ustar pysdk-ciamazon00000000000000**To get details of a job** This example returns details about a job whose ID is represented by f4f4ff82-2d11-EXAMPLE. This command is only used for custom actions. When this command is called, AWS CodePipeline returns temporary credentials for the Amazon S3 bucket used to store artifacts for the pipeline, if required for the custom action. This command will also return any secret values defined for the action, if any are defined. Command:: aws codepipeline get-job-details --job-id f4f4ff82-2d11-EXAMPLE Output:: { "jobDetails": { "accountId": "111111111111", "data": { "actionConfiguration": { "__type": "ActionConfiguration", "configuration": { "ProjectName": "MyJenkinsExampleTestProject" } }, "actionTypeId": { "__type": "ActionTypeId", "category": "Test", "owner": "Custom", "provider": "MyJenkinsProviderName", "version": "1" }, "artifactCredentials": { "__type": "AWSSessionCredentials", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "sessionToken": "fICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcNMTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9TrDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpEIbb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0FkbFFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTbNYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE=" }, "inputArtifacts": [ { "__type": "Artifact", "location": { "s3Location": { "bucketName": "codepipeline-us-east-1-11EXAMPLE11", "objectKey": "MySecondPipeline/MyAppBuild/EXAMPLE" }, "type": "S3" }, "name": "MyAppBuild" } ], "outputArtifacts": [], "pipelineContext": { "__type": "PipelineContext", "action": { "name": "MyJenkinsTest-Action" }, "pipelineName": "MySecondPipeline", "stage": { "name": "Testing" } } }, "id": "f4f4ff82-2d11-EXAMPLE" } } awscli-1.14.44/awscli/examples/codepipeline/delete-custom-action-type.rst0000666454262600001440000000114113243367510027520 0ustar pysdk-ciamazon00000000000000**To delete a custom action** This example deletes a custom action in AWS CodePipeline by using an already-created JSON file (here named DeleteMyCustomAction.json) that contains the action type, provider name, and version number of the action to be deleted. Use the list-action-types command to view the correct values for category, version, and provider. Command:: aws codepipeline delete-custom-action-type --cli-input-json file://DeleteMyCustomAction.json JSON file sample contents:: { "category": "Build", "version": "1", "provider": "MyJenkinsProviderName" } Output:: None.awscli-1.14.44/awscli/examples/elb/0000777454262600001440000000000013243367512020071 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/elb/create-load-balancer.rst0000666454262600001440000000451413243367510024552 0ustar pysdk-ciamazon00000000000000**To create an HTTP load balancer** This example creates a load balancer with an HTTP listener in a VPC. Command:: aws elb create-load-balancer --load-balancer-name my-load-balancer --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80" --subnets subnet-15aaab61 --security-groups sg-a61988c3 Output:: { "DNSName": "my-load-balancer-1234567890.us-west-2.elb.amazonaws.com" } This example creates a load balancer with an HTTP listener in EC2-Classic. Command:: aws elb create-load-balancer --load-balancer-name my-load-balancer --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80" --availability-zones us-west-2a us-west-2b Output:: { "DNSName": "my-load-balancer-123456789.us-west-2.elb.amazonaws.com" } **To create an HTTPS load balancer** This example creates a load balancer with an HTTPS listener in a VPC. Command:: aws elb create-load-balancer --load-balancer-name my-load-balancer --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80" "Protocol=HTTPS,LoadBalancerPort=443,InstanceProtocol=HTTP,InstancePort=80,SSLCertificateId=arn:aws:iam::123456789012:server-certificate/my-server-cert" --subnets subnet-15aaab61 --security-groups sg-a61988c3 Output:: { "DNSName": "my-load-balancer-1234567890.us-west-2.elb.amazonaws.com" } This example creates a load balancer with an HTTPS listener in EC2-Classic. Command:: aws elb create-load-balancer --load-balancer-name my-load-balancer --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80" "Protocol=HTTPS,LoadBalancerPort=443,InstanceProtocol=HTTP,InstancePort=80,SSLCertificateId=arn:aws:iam::123456789012:server-certificate/my-server-cert" --availability-zones us-west-2a us-west-2b Output:: { "DNSName": "my-load-balancer-123456789.us-west-2.elb.amazonaws.com" } **To create an internal load balancer** This example creates an internal load balancer with an HTTP listener in a VPC. Command:: aws elb create-load-balancer --load-balancer-name my-load-balancer --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80" --scheme internal --subnets subnet-a85db0df --security-groups sg-a61988c3 Output:: { "DNSName": "internal-my-load-balancer-123456789.us-west-2.elb.amazonaws.com" } awscli-1.14.44/awscli/examples/elb/describe-load-balancer-policy-types.rst0000666454262600001440000000657613243367510027540 0ustar pysdk-ciamazon00000000000000**To describe the load balancer policy types defined by Elastic Load Balancing** This example describes the load balancer policy types that you can use to create policy configurations for your load balancer. Command:: aws elb describe-load-balancer-policy-types Output:: { "PolicyTypeDescriptions": [ { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ONE", "AttributeName": "ProxyProtocol", "AttributeType": "Boolean" } ], "PolicyTypeName": "ProxyProtocolPolicyType", "Description": "Policy that controls whether to include the IP address and port of the originating request for TCP messages. This policy operates on TCP/SSL listeners only" }, { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ONE", "AttributeName": "PublicKey", "AttributeType": "String" } ], "PolicyTypeName": "PublicKeyPolicyType", "Description": "Policy containing a list of public keys to accept when authenticating the back-end server(s). This policy cannot be applied directly to back-end servers or listeners but must be part of a BackendServerAuthenticationPolicyType." }, { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ONE", "AttributeName": "CookieName", "AttributeType": "String" } ], "PolicyTypeName": "AppCookieStickinessPolicyType", "Description": "Stickiness policy with session lifetimes controlled by the lifetime of the application-generated cookie. This policy can be associated only with HTTP/HTTPS listeners." }, { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ZERO_OR_ONE", "AttributeName": "CookieExpirationPeriod", "AttributeType": "Long" } ], "PolicyTypeName": "LBCookieStickinessPolicyType", "Description": "Stickiness policy with session lifetimes controlled by the browser (user-agent) or a specified expiration period. This policy can be associated only with HTTP/HTTPS listeners." }, { "PolicyAttributeTypeDescriptions": [ . . . ], "PolicyTypeName": "SSLNegotiationPolicyType", "Description": "Listener policy that defines the ciphers and protocols that will be accepted by the load balancer. This policy can be associated only with HTTPS/SSL listeners." }, { "PolicyAttributeTypeDescriptions": [ { "Cardinality": "ONE_OR_MORE", "AttributeName": "PublicKeyPolicyName", "AttributeType": "PolicyName" } ], "PolicyTypeName": "BackendServerAuthenticationPolicyType", "Description": "Policy that controls authentication to back-end server(s) and contains one or more policies, such as an instance of a PublicKeyPolicyType. This policy can be associated only with back-end servers that are using HTTPS/SSL." } ] } awscli-1.14.44/awscli/examples/elb/create-load-balancer-policy.rst0000666454262600001440000000515613243367510026052 0ustar pysdk-ciamazon00000000000000**To create a policy that enables Proxy Protocol on a load balancer** This example creates a policy that enables Proxy Protocol on the specified load balancer. Command:: aws elb create-load-balancer-policy --load-balancer-name my-load-balancer --policy-name my-ProxyProtocol-policy --policy-type-name ProxyProtocolPolicyType --policy-attributes AttributeName=ProxyProtocol,AttributeValue=true **To create an SSL negotiation policy using the recommended security policy** This example creates an SSL negotiation policy for the specified HTTPS load balancer using the recommended security policy. Command:: aws elb create-load-balancer-policy --load-balancer-name my-load-balancer --policy-name my-SSLNegotiation-policy --policy-type-name SSLNegotiationPolicyType --policy-attributes AttributeName=Reference-Security-Policy,AttributeValue=ELBSecurityPolicy-2015-03 **To create an SSL negotiation policy using a custom security policy** This example creates an SSL negotiation policy for your HTTPS load balancer using a custom security policy by enabling the protocols and the ciphers. Command:: aws elb create-load-balancer-policy --load-balancer-name my-load-balancer --policy-name my-SSLNegotiation-policy --policy-type-name SSLNegotiationPolicyType --policy-attributes AttributeName=Protocol-SSLv3,AttributeValue=true AttributeName=Protocol-TLSv1.1,AttributeValue=true AttributeName=DHE-RSA-AES256-SHA256,AttributeValue=true AttributeName=Server-Defined-Cipher-Order,AttributeValue=true **To create a public key policy** This example creates a public key policy. Command:: aws elb create-load-balancer-policy --load-balancer-name my-load-balancer --policy-name my-PublicKey-policy --policy-type-name PublicKeyPolicyType --policy-attributes AttributeName=PublicKey,AttributeValue=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwAYUjnfyEyXr1pxjhFWBpMlggUcqoi3kl+dS74kj//c6x7ROtusUaeQCTgIUkayttRDWchuqo1pHC1u+n5xxXnBBe2ejbb2WRsKIQ5rXEeixsjFpFsojpSQKkzhVGI6mJVZBJDVKSHmswnwLBdofLhzvllpovBPTHe+o4haAWvDBALJU0pkSI1FecPHcs2hwxf14zHoXy1e2k36A64nXW43wtfx5qcVSIxtCEOjnYRg7RPvybaGfQ+v6Iaxb/+7J5kEvZhTFQId+bSiJImF1FSUT1W1xwzBZPUbcUkkXDj45vC2s3Z8E+Lk7a3uZhvsQHLZnrfuWjBWGWvZ/MhZYgEXAMPLE **To create a backend server authentication policy** This example creates a backend server authentication policy that enables authentication on your backend instance using a public key policy. Command:: aws elb create-load-balancer-policy --load-balancer-name my-load-balancer --policy-name my-authentication-policy --policy-type-name BackendServerAuthenticationPolicyType --policy-attributes AttributeName=PublicKeyPolicyName,AttributeValue=my-PublicKey-policy awscli-1.14.44/awscli/examples/elb/deregister-instances-from-load-balancer.rst0000666454262600001440000000071413243367510030370 0ustar pysdk-ciamazon00000000000000**To deregister instances from a load balancer** This example deregisters the specified instance from the specified load balancer. Command:: aws elb deregister-instances-from-load-balancer --load-balancer-name my-load-balancer --instances i-d6f6fae3 Output:: { "Instances": [ { "InstanceId": "i-207d9717" }, { "InstanceId": "i-afefb49b" } ] } awscli-1.14.44/awscli/examples/elb/set-load-balancer-listener-ssl-certificate.rst0000666454262600001440000000055513243367510031005 0ustar pysdk-ciamazon00000000000000**To update the SSL certificate for an HTTPS load balancer** This example replaces the existing SSL certificate for the specified HTTPS load balancer. Command:: aws elb set-load-balancer-listener-ssl-certificate --load-balancer-name my-load-balancer --load-balancer-port 443 --ssl-certificate-id arn:aws:iam::123456789012:server-certificate/new-server-cert awscli-1.14.44/awscli/examples/elb/set-load-balancer-policies-for-backend-server.rst0000666454262600001440000000134113243367510031357 0ustar pysdk-ciamazon00000000000000**To replace the policies associated with a port for a backend instance** This example replaces the policies that are currently associated with the specified port. Command:: aws elb set-load-balancer-policies-for-backend-server --load-balancer-name my-load-balancer --instance-port 80 --policy-names my-ProxyProtocol-policy **To remove all policies that are currently associated with a port on your backend instance** This example removes all policies associated with the specified port. Command:: aws elb set-load-balancer-policies-for-backend-server --load-balancer-name my-load-balancer --instance-port 80 --policy-names [] To confirm that the policies are removed, use the ``describe-load-balancer-policies`` command. awscli-1.14.44/awscli/examples/elb/add-tags.rst0000666454262600001440000000034713243367510022311 0ustar pysdk-ciamazon00000000000000**To add a tag to a load balancer** This example adds tags to the specified load balancer. Command:: aws elb add-tags --load-balancer-name my-load-balancer --tags "Key=project,Value=lima" "Key=department,Value=digital-media" awscli-1.14.44/awscli/examples/elb/apply-security-groups-to-load-balancer.rst0000666454262600001440000000054413243367510030235 0ustar pysdk-ciamazon00000000000000**To associate a security group with a load balancer in a VPC** This example associates a security group with the specified load balancer in a VPC. Command:: aws elb apply-security-groups-to-load-balancer --load-balancer-name my-load-balancer --security-groups sg-fc448899 Output:: { "SecurityGroups": [ "sg-fc448899" ] } awscli-1.14.44/awscli/examples/elb/describe-load-balancer-attributes.rst0000666454262600001440000000110513243367510027244 0ustar pysdk-ciamazon00000000000000**To describe the attributes of a load balancer** This example describes the attributes of the specified load balancer. Command:: aws elb describe-load-balancer-attributes --load-balancer-name my-load-balancer Output:: { "LoadBalancerAttributes": { "ConnectionDraining": { "Enabled": false, "Timeout": 300 }, "CrossZoneLoadBalancing": { "Enabled": true }, "ConnectionSettings": { "IdleTimeout": 30 }, "AccessLog": { "Enabled": false } } } awscli-1.14.44/awscli/examples/elb/disable-availability-zones-for-load-balancer.rst0000666454262600001440000000062513243367510031301 0ustar pysdk-ciamazon00000000000000**To disable Availability Zones for a load balancer** This example removes the specified Availability Zone from the set of Availability Zones for the specified load balancer. Command:: aws elb disable-availability-zones-for-load-balancer --load-balancer-name my-load-balancer --availability-zones us-west-2a Output:: { "AvailabilityZones": [ "us-west-2b" ] } awscli-1.14.44/awscli/examples/elb/describe-instance-health.rst0000666454262600001440000000303313243367510025445 0ustar pysdk-ciamazon00000000000000**To describe the health of the instances for a load balancer** This example describes the health of the instances for the specified load balancer. Command:: aws elb describe-instance-health --load-balancer-name my-load-balancer Output:: { "InstanceStates": [ { "InstanceId": "i-207d9717", "ReasonCode": "N/A", "State": "InService", "Description": "N/A" }, { "InstanceId": "i-afefb49b", "ReasonCode": "N/A", "State": "InService", "Description": "N/A" } ] } **To describe the health of an instance for a load balancer** This example describes the health of the specified instance for the specified load balancer. Command:: aws elb describe-instance-health --load-balancer-name my-load-balancer --instances i-7299c809 The following is an example response for an instance that is registering. Output:: { "InstanceStates": [ { "InstanceId": "i-7299c809", "ReasonCode": "ELB", "State": "OutOfService", "Description": "Instance registration is still in progress." } ] } The following is an example response for an unhealthy instance. Output:: { "InstanceStates": [ { "InstanceId": "i-7299c809", "ReasonCode": "Instance", "State": "OutOfService", "Description": "Instance has failed at least the UnhealthyThreshold number of health checks consecutively." } ] } awscli-1.14.44/awscli/examples/elb/create-lb-cookie-stickiness-policy.rst0000666454262600001440000000056213243367510027403 0ustar pysdk-ciamazon00000000000000**To generate a duration-based stickiness policy for your HTTPS load balancer** This example generates a stickiness policy with sticky session lifetimes controlled by the specified expiration period. Command:: aws elb create-lb-cookie-stickiness-policy --load-balancer-name my-load-balancer --policy-name my-duration-cookie-policy --cookie-expiration-period 60 awscli-1.14.44/awscli/examples/elb/set-load-balancer-policies-of-listener.rst0000666454262600001440000000133113243367510030126 0ustar pysdk-ciamazon00000000000000**To replace the policies associated with a listener** This example replaces the policies that are currently associated with the specified listener. Command:: aws elb set-load-balancer-policies-of-listener --load-balancer-name my-load-balancer --load-balancer-port 443 --policy-names my-SSLNegotiation-policy **To remove all policies associated with your listener** This example removes all policies that are currently associated with the specified listener. Command:: aws elb set-load-balancer-policies-of-listener --load-balancer-name my-load-balancer --load-balancer-port 443 --policy-names [] To confirm that the policies are removed from the load balancer, use the ``describe-load-balancer-policies`` command. awscli-1.14.44/awscli/examples/elb/describe-tags.rst0000666454262600001440000000114313243367510023334 0ustar pysdk-ciamazon00000000000000**To describe the tags assigned to a load balancer** This example describes the tags assigned to the specified load balancer. Command:: aws elb describe-tags --load-balancer-name my-load-balancer Output:: { "TagDescriptions": [ { "Tags": [ { "Value": "lima", "Key": "project" }, { "Value": "digital-media", "Key": "department" } ], "LoadBalancerName": "my-load-balancer" } ] } awscli-1.14.44/awscli/examples/elb/configure-health-check.rst0000666454262600001440000000107013243367510025116 0ustar pysdk-ciamazon00000000000000**To specify the health check settings for your backend EC2 instances** This example specifies the health check settings used to evaluate the health of your backend EC2 instances. Command:: aws elb configure-health-check --load-balancer-name my-load-balancer --health-check Target=HTTP:80/png,Interval=30,UnhealthyThreshold=2,HealthyThreshold=2,Timeout=3 Output:: { "HealthCheck": { "HealthyThreshold": 2, "Interval": 30, "Target": "HTTP:80/png", "Timeout": 3, "UnhealthyThreshold": 2 } } awscli-1.14.44/awscli/examples/elb/describe-load-balancer-policies.rst0000666454262600001440000000355613243367510026701 0ustar pysdk-ciamazon00000000000000**To describe all policies associated with a load balancer** This example describes all of the policies associated with the specified load balancer. Command:: aws elb describe-load-balancer-policies --load-balancer-name my-load-balancer Output:: { "PolicyDescriptions": [ { "PolicyAttributeDescriptions": [ { "AttributeName": "ProxyProtocol", "AttributeValue": "true" } ], "PolicyName": "my-ProxyProtocol-policy", "PolicyTypeName": "ProxyProtocolPolicyType" }, { "PolicyAttributeDescriptions": [ { "AttributeName": "CookieName", "AttributeValue": "my-app-cookie" } ], "PolicyName": "my-app-cookie-policy", "PolicyTypeName": "AppCookieStickinessPolicyType" }, { "PolicyAttributeDescriptions": [ { "AttributeName": "CookieExpirationPeriod", "AttributeValue": "60" } ], "PolicyName": "my-duration-cookie-policy", "PolicyTypeName": "LBCookieStickinessPolicyType" }, . . . ] } **To describe a specific policy associated with a load balancer** This example describes the specified policy associated with the specified load balancer. Command:: aws elb describe-load-balancer-policies --load-balancer-name my-load-balancer --policy-name my-authentication-policy Output:: { "PolicyDescriptions": [ { "PolicyAttributeDescriptions": [ { "AttributeName": "PublicKeyPolicyName", "AttributeValue": "my-PublicKey-policy" } ], "PolicyName": "my-authentication-policy", "PolicyTypeName": "BackendServerAuthenticationPolicyType" } ] } awscli-1.14.44/awscli/examples/elb/detach-load-balancer-from-subnets.rst0000666454262600001440000000050013243367510027150 0ustar pysdk-ciamazon00000000000000**To detach load balancers from subnets** This example detaches the specified load balancer from the specified subnet. Command:: aws elb detach-load-balancer-from-subnets --load-balancer-name my-load-balancer --subnets subnet-0ecac448 Output:: { "Subnets": [ "subnet-15aaab61" ] } awscli-1.14.44/awscli/examples/elb/delete-load-balancer-listeners.rst0000666454262600001440000000040513243367510026552 0ustar pysdk-ciamazon00000000000000**To delete a listener from your load balancer** This example deletes the listener for the specified port from the specified load balancer. Command:: aws elb delete-load-balancer-listeners --load-balancer-name my-load-balancer --load-balancer-ports 80 awscli-1.14.44/awscli/examples/elb/modify-load-balancer-attributes.rst0000666454262600001440000000173613243367510026765 0ustar pysdk-ciamazon00000000000000**To modify the attributes of a load balancer** This example modifies the ``CrossZoneLoadBalancing`` attribute of the specified load balancer. Command:: aws elb modify-load-balancer-attributes --load-balancer-name my-load-balancer --load-balancer-attributes "{\"CrossZoneLoadBalancing\":{\"Enabled\":true}}" Output:: { "LoadBalancerAttributes": { "CrossZoneLoadBalancing": { "Enabled": true } }, "LoadBalancerName": "my-load-balancer" } This example modifies the ``ConnectionDraining`` attribute of the specified load balancer. Command:: aws elb modify-load-balancer-attributes --load-balancer-name my-load-balancer --load-balancer-attributes "{\"ConnectionDraining\":{\"Enabled\":true,\"Timeout\":300}}" Output:: { "LoadBalancerAttributes": { "ConnectionDraining": { "Enabled": true, "Timeout": 300 } }, "LoadBalancerName": "my-load-balancer" } awscli-1.14.44/awscli/examples/elb/delete-load-balancer.rst0000666454262600001440000000024613243367510024547 0ustar pysdk-ciamazon00000000000000**To delete a load balancer** This example deletes the specified load balancer. Command:: aws elb delete-load-balancer --load-balancer-name my-load-balancer awscli-1.14.44/awscli/examples/elb/enable-availability-zones-for-load-balancer.rst0000666454262600001440000000060613243367510031123 0ustar pysdk-ciamazon00000000000000**To enable Availability Zones for a load balancer** This example adds the specified Availability Zone to the specified load balancer. Command:: aws elb enable-availability-zones-for-load-balancer --load-balancer-name my-load-balancer --availability-zones us-west-2b Output:: { "AvailabilityZones": [ "us-west-2a", "us-west-2b" ] } awscli-1.14.44/awscli/examples/elb/create-load-balancer-listeners.rst0000666454262600001440000000121113243367510026547 0ustar pysdk-ciamazon00000000000000**To create HTTP listeners for a load balancer** This example creates a listener for your load balancer at port 80 using the HTTP protocol. Command:: aws elb create-load-balancer-listeners --load-balancer-name my-load-balancer --listeners "Protocol=HTTP,LoadBalancerPort=80,InstanceProtocol=HTTP,InstancePort=80" **To create HTTPS listeners for a load balancer** This example creates a listener for your load balancer at port 443 using the HTTPS protocol. Command:: aws elb create-load-balancer-listeners --load-balancer-name my-load-balancer --listeners "Protocol=HTTPS,LoadBalancerPort=443,InstanceProtocol=HTTP,InstancePort=80" awscli-1.14.44/awscli/examples/elb/delete-load-balancer-policy.rst0000666454262600001440000000046113243367510026043 0ustar pysdk-ciamazon00000000000000**To delete a policy from your load balancer** This example deletes the specified policy from the specified load balancer. The policy must not be enabled on any listener. Command:: aws elb delete-load-balancer-policy --load-balancer-name my-load-balancer --policy-name my-duration-cookie-policy awscli-1.14.44/awscli/examples/elb/create-app-cookie-stickiness-policy.rst0000666454262600001440000000053513243367510027566 0ustar pysdk-ciamazon00000000000000**To generate a stickiness policy for your HTTPS load balancer** This example generates a stickiness policy that follows the sticky session lifetimes of the application-generated cookie. Command:: aws elb create-app-cookie-stickiness-policy --load-balancer-name my-load-balancer --policy-name my-app-cookie-policy --cookie-name my-app-cookie awscli-1.14.44/awscli/examples/elb/register-instances-with-load-balancer.rst0000666454262600001440000000076113243367510030071 0ustar pysdk-ciamazon00000000000000**To register instances with a load balancer** This example registers the specified instance with the specified load balancer. Command:: aws elb register-instances-with-load-balancer --load-balancer-name my-load-balancer --instances i-d6f6fae3 Output:: { "Instances": [ { "InstanceId": "i-d6f6fae3" }, { "InstanceId": "i-207d9717" }, { "InstanceId": "i-afefb49b" } ] } awscli-1.14.44/awscli/examples/elb/attach-load-balancer-to-subnets.rst0000666454262600001440000000056313243367510026654 0ustar pysdk-ciamazon00000000000000**To attach subnets to a load balancer** This example adds the specified subnet to the set of configured subnets for the specified load balancer. Command:: aws elb attach-load-balancer-to-subnets --load-balancer-name my-load-balancer --subnets subnet-0ecac448 Output:: { "Subnets": [ "subnet-15aaab61", "subnet-0ecac448" ] } awscli-1.14.44/awscli/examples/elb/describe-load-balancers.rst0000666454262600001440000000602213243367510025246 0ustar pysdk-ciamazon00000000000000**To describe your load balancers** This example describes all of your load balancers. Command:: aws elb describe-load-balancers **To describe one of your load balancers** This example describes the specified load balancer. Command:: aws elb describe-load-balancers --load-balancer-name my-load-balancer The following example response is for an HTTPS load balancer in a VPC. Output:: { "LoadBalancerDescriptions": [ { "Subnets": [ "subnet-15aaab61" ], "CanonicalHostedZoneNameID": "Z3DZXE0EXAMPLE", "CanonicalHostedZoneName": "my-load-balancer-1234567890.us-west-2.elb.amazonaws.com", "ListenerDescriptions": [ { "Listener": { "InstancePort": 80, "LoadBalancerPort": 80, "Protocol": "HTTP", "InstanceProtocol": "HTTP" }, "PolicyNames": [] }, { "Listener": { "InstancePort": 443, "SSLCertificateId": "arn:aws:iam::123456789012:server-certificate/my-server-cert", "LoadBalancerPort": 443, "Protocol": "HTTPS", "InstanceProtocol": "HTTPS" }, "PolicyNames": [ "ELBSecurityPolicy-2015-03" ] } ], "HealthCheck": { "HealthyThreshold": 2, "Interval": 30, "Target": "HTTP:80/png", "Timeout": 3, "UnhealthyThreshold": 2 }, "VPCId": "vpc-a01106c2", "BackendServerDescriptions": [ { "InstancePort": 80, "PolicyNames": [ "my-ProxyProtocol-policy" ] } ], "Instances": [ { "InstanceId": "i-207d9717" }, { "InstanceId": "i-afefb49b" } ], "DNSName": "my-load-balancer-1234567890.us-west-2.elb.amazonaws.com", "SecurityGroups": [ "sg-a61988c3" ], "Policies": { "LBCookieStickinessPolicies": [ { "PolicyName": "my-duration-cookie-policy", "CookieExpirationPeriod": 60 } ], "AppCookieStickinessPolicies": [], "OtherPolicies": [ "my-PublicKey-policy", "my-authentication-policy", "my-SSLNegotiation-policy", "my-ProxyProtocol-policy", "ELBSecurityPolicy-2015-03" ] }, "LoadBalancerName": "my-load-balancer", "CreatedTime": "2015-03-19T03:24:02.650Z", "AvailabilityZones": [ "us-west-2a" ], "Scheme": "internet-facing", "SourceSecurityGroup": { "OwnerAlias": "123456789012", "GroupName": "my-elb-sg" } } ] } awscli-1.14.44/awscli/examples/elb/remove-tags.rst0000666454262600001440000000027513243367510023056 0ustar pysdk-ciamazon00000000000000**To remove tags from a load balancer** This example removes a tag from the specified load balancer. Command:: aws elb remove-tags --load-balancer-name my-load-balancer --tags project awscli-1.14.44/awscli/examples/datapipeline/0000777454262600001440000000000013243367512021766 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/datapipeline/list-runs.rst0000666454262600001440000000313613243367510024461 0ustar pysdk-ciamazon00000000000000**To list your pipeline runs** This example lists the runs for the specified pipeline:: aws datapipeline list-runs --pipeline-id df-00627471SOVYZEXAMPLE The following is example output:: Name Scheduled Start Status ID Started Ended ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1. EC2ResourceObj 2015-04-12T17:33:02 CREATING @EC2ResourceObj_2015-04-12T17:33:02 2015-04-12T17:33:10 2. S3InputLocation 2015-04-12T17:33:02 FINISHED @S3InputLocation_2015-04-12T17:33:02 2015-04-12T17:33:09 2015-04-12T17:33:09 3. S3OutputLocation 2015-04-12T17:33:02 WAITING_ON_DEPENDENCIES @S3OutputLocation_2015-04-12T17:33:02 2015-04-12T17:33:09 4. ShellCommandActivityObj 2015-04-12T17:33:02 WAITING_FOR_RUNNER @ShellCommandActivityObj_2015-04-12T17:33:02 2015-04-12T17:33:09 **To list the pipeline runs between the specified dates** Use the ``list-runs`` command with the ``--start-interval`` parameter:: aws datapipeline list-runs`` --pipeline-id {#PIPELINE_ID} --start-interval {#TIME},{#TIME} For example, to list the pipeline runs between 2017-10-07T00:00:00 and 2017-10-08T00:00:00, run:: aws datapipeline list-runs --pipeline-id df-01434553B58A2SHZUKO5 --start-interval 2017-10-07T00:00:00,2017-10-08T00:00:00 awscli-1.14.44/awscli/examples/datapipeline/create-pipeline.rst0000666454262600001440000000035713243367510025571 0ustar pysdk-ciamazon00000000000000**To create a pipeline** This example creates a pipeline:: aws datapipeline create-pipeline --name my-pipeline --unique-id my-pipeline-token The following is example output:: { "pipelineId": "df-00627471SOVYZEXAMPLE" } awscli-1.14.44/awscli/examples/datapipeline/add-tags.rst0000666454262600001440000000123313243367510024201 0ustar pysdk-ciamazon00000000000000**To add a tag to a pipeline** This example adds the specified tag to the specified pipeline:: aws datapipeline add-tags --pipeline-id df-00627471SOVYZEXAMPLE --tags key=environment,value=production key=owner,value=sales To view the tags, use the describe-pipelines command. For example, the tags added in the example command appear as follows in the output for describe-pipelines:: { ... "tags": [ { "value": "production", "key": "environment" }, { "value": "sales", "key": "owner" } ] ... } awscli-1.14.44/awscli/examples/datapipeline/delete-pipeline.rst0000666454262600001440000000022313243367510025560 0ustar pysdk-ciamazon00000000000000**To delete a pipeline** This example deletes the specified pipeline:: aws datapipeline delete-pipeline --pipeline-id df-00627471SOVYZEXAMPLE awscli-1.14.44/awscli/examples/datapipeline/list-pipelines.rst0000666454262600001440000000110213243367510025451 0ustar pysdk-ciamazon00000000000000**To list your pipelines** This example lists your pipelines:: aws datapipeline list-pipelines The following is example output:: { "pipelineIdList": [ { "id": "df-00627471SOVYZEXAMPLE", "name": "my-pipeline" }, { "id": "df-09028963KNVMREXAMPLE", "name": "ImportDDB" }, { "id": "df-0870198233ZYVEXAMPLE", "name": "CrossRegionDDB" }, { "id": "df-00189603TB4MZEXAMPLE", "name": "CopyRedshift" } ] } awscli-1.14.44/awscli/examples/datapipeline/put-pipeline-definition.rst0000666454262600001440000000060213243367510027255 0ustar pysdk-ciamazon00000000000000**To upload a pipeline definition** This example uploads the specified pipeline definition to the specified pipeline:: aws datapipeline put-pipeline-definition --pipeline-id df-00627471SOVYZEXAMPLE --pipeline-definition file://my-pipeline-definition.json The following is example output:: { "validationErrors": [], "errored": false, "validationWarnings": [] } awscli-1.14.44/awscli/examples/datapipeline/deactivate-pipeline.rst0000666454262600001440000000054613243367510026437 0ustar pysdk-ciamazon00000000000000**To deactivate a pipeline** This example deactivates the specified pipeline:: aws datapipeline deactivate-pipeline --pipeline-id df-00627471SOVYZEXAMPLE To deactivate the pipeline only after all running activities finish, use the following command:: aws datapipeline deactivate-pipeline --pipeline-id df-00627471SOVYZEXAMPLE --no-cancel-active awscli-1.14.44/awscli/examples/datapipeline/activate-pipeline.rst0000666454262600001440000000054013243367510026120 0ustar pysdk-ciamazon00000000000000**To activate a pipeline** This example activates the specified pipeline:: aws datapipeline activate-pipeline --pipeline-id df-00627471SOVYZEXAMPLE To activate the pipeline at a specific date and time, use the following command:: aws datapipeline activate-pipeline --pipeline-id df-00627471SOVYZEXAMPLE --start-timestamp 2015-04-07T00:00:00Z awscli-1.14.44/awscli/examples/datapipeline/get-pipeline-definition.rst0000666454262600001440000000543513243367510027235 0ustar pysdk-ciamazon00000000000000**To get a pipeline definition** This example gets the pipeline definition for the specified pipeline:: aws datapipeline get-pipeline-definition --pipeline-id df-00627471SOVYZEXAMPLE The following is example output:: { "parameters": [ { "type": "AWS::S3::ObjectKey", "id": "myS3OutputLoc", "description": "S3 output folder" }, { "default": "s3://us-east-1.elasticmapreduce.samples/pig-apache-logs/data", "type": "AWS::S3::ObjectKey", "id": "myS3InputLoc", "description": "S3 input folder" }, { "default": "grep -rc \"GET\" ${INPUT1_STAGING_DIR}/* > ${OUTPUT1_STAGING_DIR}/output.txt", "type": "String", "id": "myShellCmd", "description": "Shell command to run" } ], "objects": [ { "type": "Ec2Resource", "terminateAfter": "20 Minutes", "instanceType": "t1.micro", "id": "EC2ResourceObj", "name": "EC2ResourceObj" }, { "name": "Default", "failureAndRerunMode": "CASCADE", "resourceRole": "DataPipelineDefaultResourceRole", "schedule": { "ref": "DefaultSchedule" }, "role": "DataPipelineDefaultRole", "scheduleType": "cron", "id": "Default" }, { "directoryPath": "#{myS3OutputLoc}/#{format(@scheduledStartTime, 'YYYY-MM-dd-HH-mm-ss')}", "type": "S3DataNode", "id": "S3OutputLocation", "name": "S3OutputLocation" }, { "directoryPath": "#{myS3InputLoc}", "type": "S3DataNode", "id": "S3InputLocation", "name": "S3InputLocation" }, { "startAt": "FIRST_ACTIVATION_DATE_TIME", "name": "Every 15 minutes", "period": "15 minutes", "occurrences": "4", "type": "Schedule", "id": "DefaultSchedule" }, { "name": "ShellCommandActivityObj", "command": "#{myShellCmd}", "output": { "ref": "S3OutputLocation" }, "input": { "ref": "S3InputLocation" }, "stage": "true", "type": "ShellCommandActivity", "id": "ShellCommandActivityObj", "runsOn": { "ref": "EC2ResourceObj" } } ], "values": { "myS3OutputLoc": "s3://my-s3-bucket/", "myS3InputLoc": "s3://us-east-1.elasticmapreduce.samples/pig-apache-logs/data", "myShellCmd": "grep -rc \"GET\" ${INPUT1_STAGING_DIR}/* > ${OUTPUT1_STAGING_DIR}/output.txt" } } awscli-1.14.44/awscli/examples/datapipeline/describe-pipelines.rst0000666454262600001440000000304213243367510026263 0ustar pysdk-ciamazon00000000000000**To describe your pipelines** This example describes the specified pipeline:: aws datapipeline describe-pipelines --pipeline-ids df-00627471SOVYZEXAMPLE The following is example output:: { "pipelineDescriptionList": [ { "fields": [ { "stringValue": "PENDING", "key": "@pipelineState" }, { "stringValue": "my-pipeline", "key": "name" }, { "stringValue": "2015-04-07T16:05:58", "key": "@creationTime" }, { "stringValue": "df-00627471SOVYZEXAMPLE", "key": "@id" }, { "stringValue": "123456789012", "key": "pipelineCreator" }, { "stringValue": "PIPELINE", "key": "@sphere" }, { "stringValue": "123456789012", "key": "@userId" }, { "stringValue": "123456789012", "key": "@accountId" }, { "stringValue": "my-pipeline-token", "key": "uniqueId" } ], "pipelineId": "df-00627471SOVYZEXAMPLE", "name": "my-pipeline", "tags": [] } ] } awscli-1.14.44/awscli/examples/datapipeline/remove-tags.rst0000666454262600001440000000031013243367510024741 0ustar pysdk-ciamazon00000000000000**To remove a tag from a pipeline** This example removes the specified tag from the specified pipeline:: aws datapipeline remove-tags --pipeline-id df-00627471SOVYZEXAMPLE --tag-keys environment awscli-1.14.44/awscli/examples/devicefarm/0000777454262600001440000000000013243367512021434 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/devicefarm/get-upload.rst0000666454262600001440000000175013243367510024230 0ustar pysdk-ciamazon00000000000000**Viewing an upload** The following command retrieves information about an upload:: aws devicefarm get-upload --arn "arn:aws:devicefarm:us-west-2:123456789012:upload:070fc3ca-7ec1-4741-9c1f-d3e044efc506/dd72723a-ae9e-4087-09e6-f4cea3599514" You can get the upload ARN from the output of ``create-upload``. Output:: { "upload": { "status": "SUCCEEDED", "name": "app.apk", "created": 1505262773.186, "type": "ANDROID_APP", "arn": "arn:aws:devicefarm:us-west-2:123456789012:upload:070fc3ca-7ec1-4741-9c1f-d3e044efc506/dd72723a-ae9e-4087-09e6-f4cea3599514", "metadata": "{\"device_admin\":false,\"activity_name\":\"ccom.example.client.LauncherActivity\",\"version_name\":\"1.0.2.94\",\"screens\":[\"small\",\"normal\",\"large\",\"xlarge\"],\"error_type\":null,\"sdk_version\":\"16\",\"package_name\":\"com.example.client\",\"version_code\":\"20994\",\"native_code\":[\"armeabi-v7a\"],\"target_sdk_version\":\"25\"}" } } awscli-1.14.44/awscli/examples/devicefarm/create-device-pool.rst0000666454262600001440000000203713243367510025635 0ustar pysdk-ciamazon00000000000000**Create a device pool** The following command creates an Android device pool for a project:: aws devicefarm create-device-pool --name pool1 --rules file://device-pool-rules.json --project-arn "arn:aws:devicefarm:us-west-2:123456789012:project:070fc3ca-7ec1-4741-9c1f-d3e044efc506" You can get the project ARN from the output of ``create-project`` or ``list-projects``. The file ``device-pool-rules.json`` is a JSON document in the current folder that specifies the device platform:: [ { "attribute": "PLATFORM", "operator": "EQUALS", "value": "\"ANDROID\"" } ] Output:: { "devicePool": { "rules": [ { "operator": "EQUALS", "attribute": "PLATFORM", "value": "\"ANDROID\"" } ], "type": "PRIVATE", "name": "pool1", "arn": "arn:aws:devicefarm:us-west-2:123456789012:devicepool:070fc3ca-7ec1-4741-9c1f-d3e044efc506/2aa8d2a9-5e73-47ca-b929-659cb34b7dcd" } } awscli-1.14.44/awscli/examples/devicefarm/create-project.rst0000666454262600001440000000055013243367510025073 0ustar pysdk-ciamazon00000000000000**Create a project** The following command creates a new project named ``my-project``:: aws devicefarm create-project --name my-project Output:: { "project": { "name": "myproject", "arn": "arn:aws:devicefarm:us-west-2:123456789012:project:070fc3ca-7ec1-4741-9c1f-d3e044efc506", "created": 1503612890.057 } } awscli-1.14.44/awscli/examples/devicefarm/create-upload.rst0000666454262600001440000000357613243367510024724 0ustar pysdk-ciamazon00000000000000**Create an upload** The following command creates an upload for an Android app:: aws devicefarm create-upload --project-arn "arn:aws:devicefarm:us-west-2:123456789012:project:070fc3ca-7ec1-4741-9c1f-d3e044efc506" --name app.apk --type ANDROID_APP You can get the project ARN from the output of `create-project` or `list-projects`. Output:: { "upload": { "status": "INITIALIZED", "name": "app.apk", "created": 1503614408.769, "url": "https://prod-us-west-2-uploads.s3-us-west-2.amazonaws.com/arn%3Aaws%3Adevicefarm%3Aus-west-2%3A123456789012%3Aproject%3A070fc3ca-c7e1-4471-91cf-d3e4efc50604/uploads/arn%3Aaws%3Adevicefarm%3Aus-west-2%3A123456789012%3Aupload%3A070fc3ca-7ec1-4741-9c1f-d3e044efc506/dd72723a-ae9e-4087-09e6-f4cea3599514/app.apk?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20170824T224008Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=AKIAEXAMPLEPBUMBC3GA%2F20170824%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=05050370c38894ef5bd09f5d009f36fc8f96fa4bb04e1bba9aca71b8dbe49a0f", "type": "ANDROID_APP", "arn": "arn:aws:devicefarm:us-west-2:123456789012:upload:070fc3ca-7ec1-4741-9c1f-d3e044efc506/dd72723a-ae9e-4087-09e6-f4cea3599514" } } Use the signed URL in the output to upload a file to Device Farm:: curl -T app.apk "https://prod-us-west-2-uploads.s3-us-west-2.amazonaws.com/arn%3Aaws%3Adevicefarm%3Aus-west-2%3A123456789012%3Aproject%3A070fc3ca-c7e1-4471-91cf-d3e4efc50604/uploads/arn%3Aaws%3Adevicefarm%3Aus-west-2%3A123456789012%3Aupload%3A070fc3ca-7ec1-4741-9c1f-d3e044efc506/dd72723a-ae9e-4087-09e6-f4cea3599514/app.apk?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20170824T224008Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=AKIAEXAMPLEPBUMBC3GA%2F20170824%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=05050370c38894ef5bd09f5d009f36fc8f96fa4bb04e1bba9aca71b8dbe49a0f"awscli-1.14.44/awscli/examples/devicefarm/list-projects.rst0000666454262600001440000000107213243367510024766 0ustar pysdk-ciamazon00000000000000**Listing projects** The following retrieves a list of projects:: aws devicefarm list-projects Output:: { "projects": [ { "name": "myproject", "arn": "arn:aws:devicefarm:us-west-2:123456789012:project:070fc3ca-7ec1-4741-9c1f-d3e044efc506", "created": 1503612890.057 }, { "name": "otherproject", "arn": "arn:aws:devicefarm:us-west-2:123456789012:project:a5f5b752-8098-49d1-86bf-5f7682c1c77e", "created": 1505257519.337 } ] } awscli-1.14.44/awscli/examples/ssm/0000777454262600001440000000000013243367512020131 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/ssm/create-association.rst0000666454262600001440000000236713243367510024446 0ustar pysdk-ciamazon00000000000000**To associate a document using instance IDs** This example associates a configuration document with an instance, using instance IDs. Command:: aws ssm create-association --instance-id "i-0cb2b964d3e14fd9f" --name "AWS-UpdateSSMAgent" Output:: { "AssociationDescription": { "Status": { "Date": 1487875500.33, "Message": "Associated with AWS-UpdateSSMAgent", "Name": "Associated" }, "Name": "AWS-UpdateSSMAgent", "InstanceId": "i-0cb2b964d3e14fd9f", "Overview": { "Status": "Pending", "DetailedStatus": "Creating" }, "AssociationId": "b7c3266e-a544-44db-877e-b20d3a108189", "DocumentVersion": "$DEFAULT", "LastUpdateAssociationDate": 1487875500.33, "Date": 1487875500.33, "Targets": [ { "Values": [ "i-0cb2b964d3e14fd9f" ], "Key": "InstanceIds" } ] } } **To associate a document using targets** This example associates a configuration document with an instance, using targets. Command:: aws ssm create-association --name "AWS-UpdateSSMAgent" --targets "Key=instanceids,Values=i-0cb2b964d3e14fd9f" awscli-1.14.44/awscli/examples/ssm/describe-maintenance-window-targets.rst0000777454262600001440000000276613243367510027713 0ustar pysdk-ciamazon00000000000000**To list all targets for a maintenance window** This example lists all of the targets for a maintenance window. Command:: aws ssm describe-maintenance-window-targets --window-id "mw-06cf17cbefcb4bf4f" Output:: { "Targets": [ { "ResourceType": "INSTANCE", "OwnerInformation": "Single instance", "WindowId": "mw-06cf17cbefcb4bf4f", "Targets": [ { "Values": [ "i-0000293ffd8c57862" ], "Key": "InstanceIds" } ], "WindowTargetId": "350d44e6-28cc-44e2-951f-4b2c985838f6" }, { "ResourceType": "INSTANCE", "OwnerInformation": "Two instances in a list", "WindowId": "mw-06cf17cbefcb4bf4f", "Targets": [ { "Values": [ "i-0000293ffd8c57862", "i-0cb2b964d3e14fd9f" ], "Key": "InstanceIds" } ], "WindowTargetId": "e078a987-2866-47be-bedd-d9cf49177d3a" } ] } **To list all targets for a maintenance window matching a specific owner information value** This example lists all of the targets for a maintenance window with a specific value. Command:: aws ssm describe-maintenance-window-targets --window-id "mw-ab12cd34ef56gh78" --filters "Key=OwnerInformation,Values=Single instance" awscli-1.14.44/awscli/examples/ssm/list-tags-for-resource.rst0000777454262600001440000000044613243367510025210 0ustar pysdk-ciamazon00000000000000**To list the tags for a patch baseline** This example lists the tags for a patch baseline. Command:: aws ssm list-tags-for-resource --resource-type "PatchBaseline" --resource-id "pb-0869b5cf84fa07081" Output:: { "TagList": [ { "Value": "Project", "Key": "Testing" } ] } awscli-1.14.44/awscli/examples/ssm/describe-effective-instance-associations.rst0000777454262600001440000000340013243367510030676 0ustar pysdk-ciamazon00000000000000**To get details of the effective associations for an instance** This example describes the effective associations for an instance. Command:: aws ssm describe-effective-instance-associations --instance-id "i-0000293ffd8c57862" Output:: { "Associations": [ { "InstanceId": "i-0000293ffd8c57862", "Content": "{\n \"schemaVersion\": \"1.2\",\n \"description\": \"Update the Amazon SSM Agent to the latest version or specified version.\",\n \"parameters\": {\n \"version\": {\n \"default\": \"\",\n \"description\": \"(Optional) A specific version of the Amazon SSM Agent to install. If not specified, the agent will be updated to the latest version.\",\n \"type\": \"String\"\n },\n \"allowDowngrade\": {\n \"default\": \"false\",\n \"description\": \"(Optional) Allow the Amazon SSM Agent service to be downgraded to an earlier version. If set to false, the service can be upgraded to newer versions only (default). If set to true, specify the earlier version.\",\n \"type\": \"String\",\n \"allowedValues\": [\n \"true\",\n \"false\"\n ]\n }\n },\n \"runtimeConfig\": {\n \"aws:updateSsmAgent\": {\n \"properties\": [\n {\n \"agentName\": \"amazon-ssm-agent\",\n \"source\": \"https://s3.{Region}.amazonaws.com/amazon-ssm-{Region}/ssm-agent-manifest.json\",\n \"allowDowngrade\": \"{{ allowDowngrade }}\",\n \"targetVersion\": \"{{ version }}\"\n }\n ]\n }\n }\n}\n", "AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0" } ] } awscli-1.14.44/awscli/examples/ssm/remove-tags-from-resource.rst0000777454262600001440000000042613243367510025705 0ustar pysdk-ciamazon00000000000000**To remove a tag from a patch baseline** This example removes the tags from a patch baseline. There is no output if the command succeeds. Command:: aws ssm remove-tags-from-resource --resource-type "PatchBaseline" --resource-id "pb-0869b5cf84fa07081" --tag-keys "Project" awscli-1.14.44/awscli/examples/ssm/update-document-default-version.rst0000777454262600001440000000036313243367510027071 0ustar pysdk-ciamazon00000000000000**To update the default version of a Document** This updates the default version of a document. There is no output if the command succeeds. Command:: aws ssm update-document-default-version --name "patchWindowsAmi" --document-version "2" awscli-1.14.44/awscli/examples/ssm/get-inventory-schema.rst0000777454262600001440000000221613243367510024735 0ustar pysdk-ciamazon00000000000000**To view your inventory schema** This example returns a list of inventory type names for the account. Command:: aws ssm get-inventory-schema Output:: { "Schemas": [ { "TypeName": "AWS:AWSComponent", "Version": "1.0", "Attributes": [ { "DataType": "STRING", "Name": "Name" }, { "DataType": "STRING", "Name": "ApplicationType" }, { "DataType": "STRING", "Name": "Publisher" }, { "DataType": "STRING", "Name": "Version" }, { "DataType": "STRING", "Name": "InstalledTime" }, { "DataType": "STRING", "Name": "Architecture" }, { "DataType": "STRING", "Name": "URL" } ] }, ... } }awscli-1.14.44/awscli/examples/ssm/describe-instance-associations-status.rst0000777454262600001440000000107713243367510030271 0ustar pysdk-ciamazon00000000000000**To describe the status of an instance's associations** This example shows details of the associations for an instance. Command:: aws ssm describe-instance-associations-status --instance-id "i-0000293ffd8c57862" Output:: { "InstanceAssociationStatusInfos": [ { "Status": "Pending", "DetailedStatus": "Associated", "Name": "AWS-UpdateSSMAgent", "InstanceId": "i-0000293ffd8c57862", "AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0", "DocumentVersion": "1" } ] } awscli-1.14.44/awscli/examples/ssm/describe-activations.rst0000777454262600001440000000106413243367510024767 0ustar pysdk-ciamazon00000000000000**To describe an activation** This example provides details about the activations on your account. Command:: aws ssm describe-activations Output:: { "ActivationList": [ { "IamRole": "AutomationRole", "RegistrationLimit": 10, "ActivationId": "bcf6faa8-83fd-419e-9534-96ad14131eb7", "ExpirationDate": 1487887903.045, "CreatedDate": 1487801503.045, "DefaultInstanceName": "MyWebServers", "Expired": false, "RegistrationsCount": 0 } ] } awscli-1.14.44/awscli/examples/ssm/describe-maintenance-window-execution-tasks.rst0000777454262600001440000000127213243367510031357 0ustar pysdk-ciamazon00000000000000**To list all tasks associated with a Maintenance Window Execution** This example lists the tasks associated with a maintenance window execution. Command:: aws ssm describe-maintenance-window-execution-tasks --window-execution-id "518d5565-5969-4cca-8f0e-da3b2a638355" Output:: { "WindowExecutionTaskIdentities": [ { "Status": "SUCCESS", "TaskArn": "AWS-RunShellScript", "StartTime": 1487692834.684, "TaskType": "RUN_COMMAND", "EndTime": 1487692835.005, "WindowExecutionId": "518d5565-5969-4cca-8f0e-da3b2a638355", "TaskExecutionId": "ac0c6ae1-daa3-4a89-832e-d384503b6586" } ] } awscli-1.14.44/awscli/examples/ssm/describe-patch-groups.rst0000777454262600001440000000103713243367510025057 0ustar pysdk-ciamazon00000000000000**To display patch group registrations** This example lists the patch group registrations. Command:: aws ssm describe-patch-groups Output:: { "Mappings": [ { "PatchGroup": "Production", "BaselineIdentity": { "BaselineName": "Production-Baseline", "DefaultBaseline": false, "BaselineDescription": "Baseline containing all updates approved for production systems", "BaselineId": "pb-045f10b4f382baeda" } } ] } awscli-1.14.44/awscli/examples/ssm/modify-document-permission.rst0000777454262600001440000000041613243367510026156 0ustar pysdk-ciamazon00000000000000**To modify the permissions for a document** This example modifies the permissions for a document. There is no output if the command succeeds. Command:: aws ssm modify-document-permission --name "RunShellScript" --permission-type "Share" --account-ids-to-add "All" awscli-1.14.44/awscli/examples/ssm/start-automation-execution.rst0000777454262600001440000000062513243367510026203 0ustar pysdk-ciamazon00000000000000**To initiate the execution of an Automation document** This example executes a document. Command:: aws ssm start-automation-execution --document-name "AWS-UpdateLinuxAmi" --parameters "AutomationAssumeRole=arn:aws:iam::812345678901:role/SSMAutomationRole,SourceAmiId=ami-f173cc91,InstanceIamRole=EC2InstanceRole" Output:: { "AutomationExecutionId": "4105a4fc-f944-11e6-9d32-8fb2db27a909" } awscli-1.14.44/awscli/examples/ssm/get-document.rst0000666454262600001440000000174613243367510023264 0ustar pysdk-ciamazon00000000000000**To get the contents of a document** This example returns the content of a document. Command:: aws ssm get-document --name "RunShellScript" Output:: { "Content": "{\n \"schemaVersion\":\"2.0\",\n \"description\":\"Run a script\",\n \"parameters\":{\n \"commands\":{\n \"type\":\"StringList\",\n \"description\":\"(Required) Specify a shell script or a command to run.\",\n \"minItems\":1,\n \"displayType\":\"textarea\"\n }\n },\n \"mainSteps\":[\n {\n \"action\":\"aws:runShellScript\",\n \"name\":\"runShellScript\",\n \"inputs\":{\n \"commands\":\"{{ commands }}\"\n }\n },\n {\n \"action\":\"aws:runPowerShellScript\",\n \"name\":\"runPowerShellScript\",\n \"inputs\":{\n \"commands\":\"{{ commands }}\"\n }\n }\n ]\n}\n", "Name": "RunShellScript.json", "DocumentVersion": "1", "DocumentType": "Command" } awscli-1.14.44/awscli/examples/ssm/delete-document.rst0000666454262600001440000000023713243367510023741 0ustar pysdk-ciamazon00000000000000**To delete a document** This example deletes a document. There is no output if the command succeeds. Command:: aws ssm delete-document --name "Config_2" awscli-1.14.44/awscli/examples/ssm/stop-automation-execution.rst0000777454262600001440000000040013243367510026022 0ustar pysdk-ciamazon00000000000000**To stop the execution of an Automation document** This example stops an automation execution. There is no output if the command succeeds. Command:: aws ssm stop-automation-execution --automation-execution-id "4105a4fc-f944-11e6-9d32-8fb2db27a909" awscli-1.14.44/awscli/examples/ssm/delete-activation.rst0000777454262600001440000000031413243367510024263 0ustar pysdk-ciamazon00000000000000**To delete an activation** This example deletes an activation. There is no output if the command succeeds. Command:: aws ssm delete-activation --activation-id "bcf6faa8-83fd-419e-9534-96ad14131eb7" awscli-1.14.44/awscli/examples/ssm/cancel-command.rst0000777454262600001440000000032613243367510023526 0ustar pysdk-ciamazon00000000000000**To attempt to cancel a command** This example attempts to cancel a command. There is no output if the operation succeeds. Command:: aws ssm cancel-command --command-id "662add3d-5831-4a10-b64a-f2ff3a577858" awscli-1.14.44/awscli/examples/ssm/describe-parameters.rst0000777454262600001440000000103613243367510024605 0ustar pysdk-ciamazon00000000000000**To list all Parameters** This example lists all parameters. Command:: aws ssm describe-parameters Output:: { "Parameters": [ { "LastModifiedUser": "arn:aws:iam::809632081692:user/admin", "LastModifiedDate": 1487880325.324, "Type": "String", "Name": "welcome" } ] } **To list all Parameters matching specific metadata** This example lists all parameters matching a filter. Command:: aws ssm describe-parameters --filters "Key=Name,Values=helloWorld" awscli-1.14.44/awscli/examples/ssm/describe-instance-information.rst0000777454262600001440000000243413243367510026574 0ustar pysdk-ciamazon00000000000000**To describe instance information** This example shows details of each of your instances. Command:: aws ssm describe-instance-information Output:: { "InstanceInformationList": [ { "IsLatestVersion": true, "LastSuccessfulAssociationExecutionDate": 1487876123.0, "ComputerName": "ip-172-31-44-222.us-west-2.compute.internal", "PingStatus": "Online", "InstanceId": "i-0cb2b964d3e14fd9f", "IPAddress": "172.31.44.222", "AssociationStatus": "Success", "LastAssociationExecutionDate": 1487876123.0, "ResourceType": "EC2Instance", "AgentVersion": "2.0.672.0", "PlatformVersion": "2016.09", "AssociationOverview": { "InstanceAssociationStatusAggregatedCount": { "Success": 1 } }, "PlatformName": "Amazon Linux AMI", "PlatformType": "Linux", "LastPingDateTime": 1487898903.758 } ] } **To describe information about a specific instance** This example shows details of instance ``i-0cb2b964d3e14fd9f``. Command:: aws ssm describe-instance-information --instance-information-filter-list "key=InstanceIds,valueSet=i-0cb2b964d3e14fd9f" awscli-1.14.44/awscli/examples/ssm/update-association.rst0000777454262600001440000000167113243367510024465 0ustar pysdk-ciamazon00000000000000**To update a document association** This example updates an association with a new document version. Command:: aws ssm update-association --association-id "4cc73e42-d5ae-4879-84f8-57e09c0efcd0" --document-version "\$LATEST" Output:: { "AssociationDescription": { "LastSuccessfulExecutionDate": 1487906247.0, "Name": "AWS-UpdateSSMAgent", "LastExecutionDate": 1487906247.0, "Overview": { "Status": "Success", "AssociationStatusAggregatedCount": { "Success": 1 } }, "AssociationId": "4cc73e42-d5ae-4879-84f8-57e09c0efcd0", "DocumentVersion": "$LATEST", "LastUpdateAssociationDate": 1487906288.447, "Date": 1487906246.999, "Targets": [ { "Values": [ "i-0cb2b964d3e14fd9f" ], "Key": "instanceids" } ] } } awscli-1.14.44/awscli/examples/ssm/delete-association.rst0000666454262600001440000000037413243367510024441 0ustar pysdk-ciamazon00000000000000**To delete an association** This example deletes the association between an instance and a document. There is no output if the command succeeds. Command:: aws ssm delete-association --instance-id "i-0cb2b964d3e14fd9f" --name "AWS-UpdateSSMAgent" awscli-1.14.44/awscli/examples/ssm/get-patch-baseline-for-patch-group.rst0000777454262600001440000000044113243367510027332 0ustar pysdk-ciamazon00000000000000**To display the patch baseline for a patch group** This example displays the patch baseline for a patch group. Command:: aws ssm get-patch-baseline-for-patch-group --patch-group "Production" Output:: { "PatchGroup": "Production", "BaselineId": "pb-045f10b4f382baeda" } awscli-1.14.44/awscli/examples/ssm/describe-maintenance-window-execution-task-invocations.rst0000777454262600001440000000171513243367510033530 0ustar pysdk-ciamazon00000000000000**To get the specific task invocations performed for a task execution** This example lists the invocations for a task executed as part of a maintenance window execution. Command:: aws ssm describe-maintenance-window-execution-task-invocations --window-execution-id "518d5565-5969-4cca-8f0e-da3b2a638355" --task-id "ac0c6ae1-daa3-4a89-832e-d384503b6586" Output:: { "WindowExecutionTaskInvocationIdentities": [ { "Status": "SUCCESS", "Parameters": "{\"documentName\":\"AWS-RunShellScript\",\"instanceIds\":[\"i-0000293ffd8c57862\"],\"parameters\":{\"commands\":[\"df\"]},\"maxConcurrency\":\"1\",\"maxErrors\":\"1\"}", "InvocationId": "e274b6e1-fe56-4e32-bd2a-8073c6381d8b", "StartTime": 1487692834.723, "EndTime": 1487692834.871, "WindowExecutionId": "518d5565-5969-4cca-8f0e-da3b2a638355", "TaskExecutionId": "ac0c6ae1-daa3-4a89-832e-d384503b6586" } ] } awscli-1.14.44/awscli/examples/ssm/update-association-status.rst0000666454262600001440000000240713243367510026001 0ustar pysdk-ciamazon00000000000000**To update the association status** This example updates the association status of the association between an instance and a document. Command:: aws ssm update-association-status --name "AWS-UpdateSSMAgent" --instance-id "i-0000293ffd8c57862" --association-status "Date=1424421071.939,Name=Pending,Message=temp_status_change,AdditionalInfo=Additional-Config-Needed" Output:: { "AssociationDescription": { "Status": { "Date": 1424421071.0, "AdditionalInfo": "Additional-Config-Needed", "Message": "temp_status_change", "Name": "Pending" }, "Name": "AWS-UpdateSSMAgent", "InstanceId": "i-0000293ffd8c57862", "Overview": { "Status": "Pending", "DetailedStatus": "Associated", "AssociationStatusAggregatedCount": { "Pending": 1 } }, "AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0", "DocumentVersion": "$DEFAULT", "LastUpdateAssociationDate": 1487876122.564, "Date": 1487876122.564, "Targets": [ { "Values": [ "i-0000293ffd8c57862" ], "Key": "InstanceIds" } ] } } awscli-1.14.44/awscli/examples/ssm/describe-effective-patches-for-patch-baseline.rst0000777454262600001440000000306513243367510031474 0ustar pysdk-ciamazon00000000000000**To get all patches defined by a patch baseline** This example returns the patches defined by a patch baseline. Command:: aws ssm describe-effective-patches-for-patch-baseline --baseline-id "pb-08b654cf9b9681f04" Output:: { "NextToken": "--token string truncated--": [ { "PatchStatus": { "ApprovalDate": 1292954400.0, "DeploymentStatus": "APPROVED" }, "Patch": { "ContentUrl": "https://support.microsoft.com/en-us/kb/2207559", "ProductFamily": "Windows", "Product": "WindowsServer2008R2", "Vendor": "Microsoft", "Description": "A security issue has been identified that could allow an authenticated remote attacker to cause the affected system to stop responding. You can help protect your system by installing this update from Microsoft. After you install this update, you may have to restart your system.", "Classification": "SecurityUpdates", "Title": "Security Update for Windows Server 2008 R2 x64 Edition (KB2207559)", "ReleaseDate": 1292349600.0, "Language": "All", "MsrcSeverity": "Important", "KbNumber": "KB2207559", "MsrcNumber": "MS10-101", "Id": "79d0c8b2-5b35-4455-bfa3-89e0f08fa980" } }, { "PatchStatus": { "ApprovalDate": 1285088400.0, "DeploymentStatus": "APPROVED" }, ... } } awscli-1.14.44/awscli/examples/ssm/get-inventory.rst0000777454262600001440000000220713243367510023477 0ustar pysdk-ciamazon00000000000000**To view your inventory** This example gets the custom metadata for your inventory. Command:: aws ssm get-inventory Output:: { "Entities": [ { "Data": { "AWS:InstanceInformation": { "Content": [ { "ComputerName": "ip-172-31-44-222.us-west-2.compute.internal", "InstanceId": "i-0cb2b964d3e14fd9f", "IpAddress": "172.31.44.222", "AgentType": "amazon-ssm-agent", "ResourceType": "EC2Instance", "AgentVersion": "2.0.672.0", "PlatformVersion": "2016.09", "PlatformName": "Amazon Linux AMI", "PlatformType": "Linux" } ], "TypeName": "AWS:InstanceInformation", "SchemaVersion": "1.0", "CaptureTime": "2017-02-20T18:03:58Z" } }, "Id": "i-0cb2b964d3e14fd9f" } ] } awscli-1.14.44/awscli/examples/ssm/get-maintenance-window.rst0000777454262600001440000000074013243367510025231 0ustar pysdk-ciamazon00000000000000**To get information about a maintenance window** This example gets details about a maintenance window. Command:: aws ssm get-maintenance-window --window-id "mw-03eb9db42890fb82d" Output:: { "Cutoff": 1, "Name": "TestMaintWin", "Schedule": "cron(0 */30 * * * ? *)", "Enabled": true, "AllowUnassociatedTargets": false, "WindowId": "mw-03eb9db42890fb82d", "ModifiedDate": 1487614445.527, "CreatedDate": 1487614445.527, "Duration": 2 } awscli-1.14.44/awscli/examples/ssm/register-default-patch-baseline.rst0000777454262600001440000000040113243367510027002 0ustar pysdk-ciamazon00000000000000**To set the default patch baseline** This example registers a patch baseline as the default patch baseline. Command:: aws ssm register-default-patch-baseline --baseline-id "pb-08b654cf9b9681f04" Output:: { "BaselineId":"pb-08b654cf9b9681f04" } awscli-1.14.44/awscli/examples/ssm/deregister-task-from-maintenance-window.rst0000777454262600001440000000055613243367510030515 0ustar pysdk-ciamazon00000000000000**To remove a task from a maintenance window** This example removes a task from a maintenance window. Command:: aws ssm deregister-task-from-maintenance-window --window-id "mw-ab12cd34ef56gh78" --window-task-id "1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d5e6c" Output:: { "WindowTaskId":"1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d5e6c", "WindowId":"mw-ab12cd34ef56gh78" } awscli-1.14.44/awscli/examples/ssm/get-parameters.rst0000777454262600001440000000122113243367510023600 0ustar pysdk-ciamazon00000000000000**To list the values for a parameter** This example lists the values for a parameter. Command:: aws ssm get-parameters --names "helloWorld" Output:: { "InvalidParameters": [], "Parameters": [ { "Type": "String", "Name": "helloWorld", "Value": "good day sunshine" } ] } To list the name and value of multiple parameters the --query argument can be used with a list of names. Command:: aws ssm get-parameters --names key1 key2 --query "Parameters[*].{Name:Value,Value:Value}" Output:: [ { "Name": "key1", "Value": "value1" }, { "Name": "key2", "Value": "value2" } ] awscli-1.14.44/awscli/examples/ssm/deregister-patch-baseline-for-patch-group.rst0000777454262600001440000000065513243367510030717 0ustar pysdk-ciamazon00000000000000**To deregister a patch group from a patch baseline** This example deregisters a patch group from a patch baseline. Command:: aws ssm deregister-patch-baseline-for-patch-group --patch-group "Production" --baseline-id "arn:aws:ssm:us-west-1:812345678901:patchbaseline/pb-0ca44a362f8afc725" Output:: { "PatchGroup":"Production", "BaselineId":"arn:aws:ssm:us-west-1:812345678901:patchbaseline/pb-0ca44a362f8afc725" } awscli-1.14.44/awscli/examples/ssm/list-commands.rst0000777454262600001440000000205413243367510023437 0ustar pysdk-ciamazon00000000000000**To list the commands requested by users of an account** This example lists all commands requested. Command:: aws ssm list-commands Output:: { "Commands": [ { "Comment": "IP config", "Status": "Success", "MaxErrors": "0", "Parameters": { "commands": [ "ifconfig" ] }, "ExpiresAfter": 1487798019.876, "ServiceRole": "", "DocumentName": "AWS-RunShellScript", "TargetCount": 1, "OutputS3BucketName": "", "NotificationConfig": { "NotificationArn": "", "NotificationEvents": [], "NotificationType": "" }, "CompletedCount": 1, "Targets": [], "StatusDetails": "Success", "ErrorCount": 0, "OutputS3KeyPrefix": "", "RequestedDateTime": 1487794419.876, "CommandId": "0831e1a8-a1ac-4257-a1fd-c831b48c4107", "InstanceIds": [ "i-0cb2b964d3e14fd9f" ], "MaxConcurrency": "50" }, ... } ] } **To get the status of a specific command** This example gets the status of a command. Command:: aws ssm list-commands --command-id "0831e1a8-a1ac-4257-a1fd-c831b48c4107" awscli-1.14.44/awscli/examples/ssm/describe-maintenance-windows.rst0000777454262600001440000000107513243367510026417 0ustar pysdk-ciamazon00000000000000**To list all maintenance windows** This example lists all maintenance windows on your account. Command:: aws ssm describe-maintenance-windows Output:: { "WindowIdentities": [ { "Duration": 2, "Cutoff": 1, "WindowId": "mw-03eb9db42890fb82d", "Enabled": true, "Name": "TestMaintWin" }, ] } **To list all enabled maintenance windows** This example lists all enabled maintenance windows. Command:: aws ssm describe-maintenance-windows --filters "Key=Enabled,Values=true" awscli-1.14.44/awscli/examples/ssm/describe-maintenance-window-executions.rst0000777454262600001440000000220713243367510030416 0ustar pysdk-ciamazon00000000000000**To list all executions for a Maintenance Window** This example lists all of the executions for a maintenance window. Command:: aws ssm describe-maintenance-window-executions --window-id "mw-ab12cd34ef56gh78" Output:: { "WindowExecutions": [ { "Status": "SUCCESS", "WindowId": "mw-06cf17cbefcb4bf4f", "StartTime": 1487692834.595, "EndTime": 1487692835.051, "WindowExecutionId": "518d5565-5969-4cca-8f0e-da3b2a638355" } ] } **To list all executions for a maintenance window before a specified date** This example lists all of the executions for a maintenance window before a specific date. Command:: aws ssm describe-maintenance-window-executions --window-id "mw-ab12cd34ef56gh78" --filters "Key=ExecutedBefore,Values=2016-11-04T05:00:00Z" **To list all executions for a maintenance window after a specified date** This example lists all of the executions for maintenance window after a specific date. Command:: aws ssm describe-maintenance-window-executions --window-id "mw-ab12cd34ef56gh78" --filters "Key=ExecutedAfter,Values=2016-11-04T17:00:00Z"awscli-1.14.44/awscli/examples/ssm/update-maintenance-window.rst0000777454262600001440000000136313243367510025736 0ustar pysdk-ciamazon00000000000000**To update a maintenance window** This example updates the name of a maintenance window. Command:: aws ssm update-maintenance-window --window-id "mw-1a2b3c4d5e6f7g8h9" --name "My-Renamed-MW" Output:: { "Cutoff": 1, "Name": "My-Renamed-MW", "Schedule": "cron(0 16 ? * TUE *)", "Enabled": true, "AllowUnassociatedTargets": true, "WindowId": "mw-1a2b3c4d5e6f7g8h9", "Duration": 4 } **To enable a maintenance window** This example enables a maintenance window. Command:: aws ssm update-maintenance-window --window-id "mw-1a2b3c4d5e6f7g8h9" --enabled **To disable a maintenance window** This example disables a maintenance window. Command:: aws ssm update-maintenance-window --window-id "mw-1a2b3c4d5e6f7g8h9" --no-enabled awscli-1.14.44/awscli/examples/ssm/update-managed-instance-role.rst0000777454262600001440000000040313243367510026276 0ustar pysdk-ciamazon00000000000000**To update the role of a managed instance** This example updates the role of a managed instance. There is no output if the command succeeds. Command:: aws ssm update-managed-instance-role --instance-id "mi-08ab247cdf1046573" --iam-role "AutomationRole" awscli-1.14.44/awscli/examples/ssm/get-automation-execution.rst0000777454262600001440000000546713243367510025636 0ustar pysdk-ciamazon00000000000000**To display the details of an Automation Execution** This example displays the details of an Automation Execution. Command:: aws ssm get-automation-execution --automation-execution-id "4105a4fc-f944-11e6-9d32-8fb2db27a909" Output:: { "AutomationExecution": { "AutomationExecutionStatus": "Failed", "Parameters": { "SourceAmiId": [ "ami-f173cc91" ], "AutomationAssumeRole": [ "arn:aws:iam::812345678901:role/SSMAutomationRole" ], "InstanceIamRole": [ "EC2InstanceRole" ] }, "Outputs": { "createImage.ImageId": [ "No output available yet because the step is not successfully executed" ] }, "DocumentName": "AWS-UpdateLinuxAmi", "AutomationExecutionId": "4105a4fc-f944-11e6-9d32-8fb2db27a909", "FailureMessage": "Step launchInstance failed maximum allowed times. You are not authorized to perform this operation. Encoded authorization failure message: --truncated-- (Service: AmazonEC2; Status Code: 403; Error Code: UnauthorizedOperation; Request ID: 6a002f94-ba37-43fd-99e6-39517715fce5)", "ExecutionEndTime": 1487798228.456, "DocumentVersion": "1", "ExecutionStartTime": 1487798222.746, "StepExecutions": [ { "Inputs": { "MaxInstanceCount": "1", "UserData": "\"--truncated--\"", "MinInstanceCount": "1", "ImageId": "\"ami-f173cc91\"", "IamInstanceProfileName": "\"EC2InstanceRole\"", "InstanceType": "\"t2.micro\"" }, "StepName": "launchInstance", "FailureMessage": "Step launchInstance failed maximum allowed times. You are not authorized to perform this operation. Encoded authorization failure message: --truncated--)", "ExecutionEndTime": 1487798226.014, "ExecutionStartTime": 1487798223.346, "Action": "aws:runInstances", "StepStatus": "Failed" }, { "Action": "aws:runCommand", "StepName": "updateOSSoftware", "StepStatus": "Pending" }, { "Action": "aws:changeInstanceState", "StepName": "stopInstance", "StepStatus": "Pending" }, { "Action": "aws:createImage", "StepName": "createImage", "StepStatus": "Pending" }, { "Action": "aws:changeInstanceState", "StepName": "terminateInstance", "StepStatus": "Pending" } ] } } awscli-1.14.44/awscli/examples/ssm/describe-instance-patches.rst0000777454262600001440000000212413243367510025672 0ustar pysdk-ciamazon00000000000000**To get the patch compliance details for an instance** This example gets the patch compliance details for an instance. Command:: aws ssm describe-instance-patches --instance-id "i-08ee91c0b17045407" Output:: { "NextToken":"--token string truncated--", "Patches":[ { "KBId":"KB2919355", "Severity":"Critical", "Classification":"SecurityUpdates", "Title":"Windows 8.1 Update for x64-based Systems (KB2919355)", "State":"Installed", "InstalledTime":"2014-03-18T12:00:00Z" }, { "KBId":"KB2977765", "Severity":"Important", "Classification":"SecurityUpdates", "Title":"Security Update for Microsoft .NET Framework 4.5.1 and 4.5.2 on Windows 8.1 and Windows Server 2012 R2 x64-based Systems (KB2977765)", "State":"Installed", "InstalledTime":"2014-10-15T12:00:00Z" }, { "KBId":"KB2978126", "Severity":"Important", "Classification":"SecurityUpdates", "Title":"Security Update for Microsoft .NET Framework 4.5.1 and 4.5.2 on Windows 8.1 (KB2978126)", "State":"Installed", "InstalledTime":"2014-11-18T12:00:00Z" }, ---output truncated--- awscli-1.14.44/awscli/examples/ssm/update-patch-baseline.rst0000777454262600001440000000350013243367510025021 0ustar pysdk-ciamazon00000000000000**To update a patch baseline** This example adds two patches as rejected and one patch as approved to a patch baseline. Command:: aws ssm update-patch-baseline --baseline-id "pb-045f10b4f382baeda" --rejected-patches "KB2032276" "MS10-048" --approved-patches "KB2124261" Output:: { "BaselineId": "pb-045f10b4f382baeda", "Name": "Production-Baseline", "RejectedPatches": [ "KB2032276", "MS10-048" ], "GlobalFilters": { "PatchFilters": [] }, "ApprovalRules": { "PatchRules": [ { "PatchFilterGroup": { "PatchFilters": [ { "Values": [ "Critical", "Important", "Moderate" ], "Key": "MSRC_SEVERITY" }, { "Values": [ "SecurityUpdates", "Updates", "UpdateRollups", "CriticalUpdates" ], "Key": "CLASSIFICATION" } ] }, "ApproveAfterDays": 7 } ] }, "ModifiedDate": 1487872602.453, "CreatedDate": 1487870482.16, "ApprovedPatches": [ "KB2124261" ], "Description": "Baseline containing all updates approved for production systems" } **To rename a patch baseline** This example renames a patch baseline. Command:: aws ssm update-patch-baseline --baseline-id "pb-00dbb759999aa2bc3" --name "Windows-Server-2012-R2-Important-and-Critical-Security-Updates" awscli-1.14.44/awscli/examples/ssm/describe-available-patches.rst0000777454262600001440000000420113243367510026004 0ustar pysdk-ciamazon00000000000000**To get available patches** This example gets all available patches for Windows Server 2012 that have a MSRC severity of Critical. Command:: aws ssm describe-available-patches --filters "Key=PRODUCT,Values=WindowsServer2012" "Key=MSRC_SEVERITY,Values=Critical" Output:: { "Patches": [ { "ContentUrl": "https://support.microsoft.com/en-us/kb/2727528", "ProductFamily": "Windows", "Product": "WindowsServer2012", "Vendor": "Microsoft", "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install this update, you may have to restart your system.", "Classification": "SecurityUpdates", "Title": "Security Update for Windows Server 2012 (KB2727528)", "ReleaseDate": 1352829600.0, "Language": "All", "MsrcSeverity": "Critical", "KbNumber": "KB2727528", "MsrcNumber": "MS12-072", "Id": "1eb507be-2040-4eeb-803d-abc55700b715" }, { "ContentUrl": "https://support.microsoft.com/en-us/kb/2729462", "ProductFamily": "Windows", "Product": "WindowsServer2012", "Vendor": "Microsoft", "Description": "A security issue has been identified that could allow an unauthenticated remote attacker to compromise your system and gain control over it. You can help protect your system by installing this update from Microsoft. After you install this update, you may have to restart your system.", "Classification": "SecurityUpdates", "Title": "Security Update for Microsoft .NET Framework 3.5 on Windows 8 and Windows Server 2012 for x64-based Systems (KB2729462)", "ReleaseDate": 1352829600.0, "Language": "All", "MsrcSeverity": "Critical", "KbNumber": "KB2729462", "MsrcNumber": "MS12-074", "Id": "af873760-c97c-4088-ab7e-5219e120eab4" }, ... } }awscli-1.14.44/awscli/examples/ssm/delete-maintenance-window.rst0000777454262600001440000000033013243367510025707 0ustar pysdk-ciamazon00000000000000**To delete a maintenance window** This example removes a maintenance window. Command:: aws ssm delete-maintenance-window --window-id "mw-1a2b3c4d5e6f7g8h9" Output:: { "WindowId":"mw-1a2b3c4d5e6f7g8h9" } awscli-1.14.44/awscli/examples/ssm/get-command-invocation.rst0000777454262600001440000000134313243367510025227 0ustar pysdk-ciamazon00000000000000**To display the details of a command invocation** This example lists all the invocations of a command on an instance. Command:: aws ssm get-command-invocation --command-id "bca3371c-3fdf-43f1-9323-7a7780b1b4db" --instance-id "i-0000293ffd8c57862" Output:: { "Comment": "Apply association with id at creation time: a052fd99-0852-4df2-ad69-0299f2c82047", "Status": "SUCCESS", "ExecutionEndDateTime": "", "StandardErrorContent": "", "InstanceId": "i-0000293ffd8c57862", "StandardErrorUrl": "", "DocumentName": "AWS-RefreshAssociation", "StandardOutputContent": "", "PluginName": "", "ResponseCode": -1, "CommandId": "bca3371c-3fdf-43f1-9323-7a7780b1b4db", "StandardOutputUrl": "" } awscli-1.14.44/awscli/examples/ssm/deregister-managed-instance.rst0000777454262600001440000000032613243367510026216 0ustar pysdk-ciamazon00000000000000**To deregister a managed instance** This example deregisters a managed instance. There is no output if the command succeeds. Command:: aws ssm deregister-managed-instance --instance-id "mi-08ab247cdf1046573" awscli-1.14.44/awscli/examples/ssm/deregister-target-from-maintenance-window.rst0000777454262600001440000000057413243367510031041 0ustar pysdk-ciamazon00000000000000**To remove a target from a maintenance window** This example removes a target from a maintenance window. Command:: aws ssm deregister-target-from-maintenance-window --window-id "mw-ab12cd34ef56gh78" --window-target-id "1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d-1a2" Output:: { "WindowId":"mw-ab12cd34ef56gh78", "WindowTargetId":"1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d-1a2" } awscli-1.14.44/awscli/examples/ssm/put-inventory.rst0000777454262600001440000000061413243367510023530 0ustar pysdk-ciamazon00000000000000**To assign customer metadata to an instance** This example assigns rack location information to an instance. There is no output if the command succeeds. Command:: aws ssm put-inventory --instance-id "i-0cb2b964d3e14fd9f" --items '[{"CaptureTime": "2016-08-22T10:01:01Z", "TypeName": "Custom:RackInfo", "Content":[{"RackLocation": "Bay B/Row C/Rack D/Shelf E"}], "SchemaVersion": "1.0"}]' awscli-1.14.44/awscli/examples/ssm/register-patch-baseline-for-patch-group.rst0000777454262600001440000000051113243367510030375 0ustar pysdk-ciamazon00000000000000**To register a patch baseline for a patch group** This example registers a patch baseline for a patch group. Command:: aws ssm register-patch-baseline-for-patch-group --baseline-id "pb-045f10b4f382baeda" --patch-group "Production" Output:: { "PatchGroup": "Production", "BaselineId": "pb-045f10b4f382baeda" } awscli-1.14.44/awscli/examples/ssm/describe-instance-patch-states.rst0000777454262600001440000000204213243367510026642 0ustar pysdk-ciamazon00000000000000**To get the patch summary states for instances** This example gets the patch summary states for an instance. Command:: aws ssm describe-instance-patch-states --instance-ids "i-08ee91c0b17045407" "i-09a618aec652973a9" Output:: { "InstancePatchStates": [ { "OperationStartTime":"2016-12-09T05:00:00Z", "FailedCount":0, "InstanceId":"i-08ee91c0b17045407", "OwnerInformation":"", "NotApplicableCount":2077, "OperationEndTime":"2016-12-09T05:02:37Z", "PatchGroup":"Production", "InstalledOtherCount":186, "MissingCount":7, "SnapshotId":"b0e65479-79be-4288-9f88-81c96bc3ed5e", "Operation":"Scan", "InstalledCount":72 }, { "OperationStartTime":"2016-12-09T04:59:09Z", "FailedCount":0, "InstanceId":"i-09a618aec652973a9" "OwnerInformation":"", "NotApplicableCount":1637, "OperationEndTime":"2016-12-09T05:03:57Z", "PatchGroup":"Production", "InstalledOtherCount":388, "MissingCount":2, "SnapshotId":"b0e65479-79be-4288-9f88-81c96bc3ed5e", "Operation":"Scan", "InstalledCount":141 } ] } awscli-1.14.44/awscli/examples/ssm/describe-maintenance-window-tasks.rst0000777454262600001440000000402513243367510027355 0ustar pysdk-ciamazon00000000000000**To list all tasks for a Maintenance Window** This example lists all of the tasks for a maintenance window. Command:: aws ssm describe-maintenance-window-tasks --window-id "mw-06cf17cbefcb4bf4f" Output:: { "Tasks": [ { "ServiceRoleArn": "arn:aws:iam:::role/MaintenanceWindowsRole", "MaxErrors": "1", "TaskArn": "AWS-RunShellScript", "MaxConcurrency": "1", "WindowTaskId": "a23e338d-ff30-4398-8aa3-09cd052ebf17", "TaskParameters": { "commands": { "Values": [ "df" ] } }, "Priority": 10, "WindowId": "mw-06cf17cbefcb4bf4f", "Type": "RUN_COMMAND", "Targets": [ { "Values": [ "i-0000293ffd8c57862" ], "Key": "InstanceIds" } ] } ] } **To list all tasks for a maintenance window that invoke the AWS-RunPowerShellScript Run Command** This example lists all of the tasks for a maintenance window that invoke the ``AWS-RunPowerShellScript`` Run Command. Command:: aws ssm describe-maintenance-window-tasks --window-id "mw-ab12cd34ef56gh78" --filters "Key=TaskArn,Values=AWS-RunPowerShellScript" **To list all tasks for a maintenance window that have a Priority of 3** This example lists all of the tasks for a maintenance window that have a ``Priority`` of ``3``. Command:: aws ssm describe-maintenance-window-tasks --window-id "mw-ab12cd34ef56gh78" --filters "Key=Priority,Values=3" **To list all tasks for a maintenance window that have a Priority of 1 and use Run Command** This example lists all of the tasks for a maintenance window that have a ``Priority`` of ``1`` and use ``Run Command``. Command:: aws ssm describe-maintenance-window-tasks --window-id "mw-ab12cd34ef56gh78" --filters "Key=Priority,Values=1" "Key=TaskType,Values=RUN_COMMAND"awscli-1.14.44/awscli/examples/ssm/get-deployable-patch-snapshot-for-instance.rst0000777454262600001440000000227613243367510031110 0ustar pysdk-ciamazon00000000000000**To retrieve the current snapshot for the patch baseline an instance uses** This example displays the current snapshot for the patch baseline used by an Instance. This command must be run from the instance using the instance credentials. To ensure it uses the instance credentials, run ``aws configure`` and only specify the region of your instance but leave the ``Access Key`` and ``Secret Key`` fields blank. Use ``uuidgen`` to generate a ``snapshot-id``. Command:: aws ssm get-deployable-patch-snapshot-for-instance --instance-id "i-0cb2b964d3e14fd9f" --snapshot-id "4681775b-098f-4435-a956-0ef33373ac11" Output:: { "InstanceId": "i-0cb2b964d3e14fd9f", "SnapshotId": "4681775b-098f-4435-a956-0ef33373ac11", "SnapshotDownloadUrl": "https://patch-baseline-snapshot-us-west-2.s3-us-west-2.amazonaws.com/853d0d3db0f0cafea3699f25b1c7ff101a13e25c3d05e832f613b0d2f79da62f-809632081692/4681775b-098f-4435-a956-0ef33373ac11?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20170224T181926Z&X-Amz-SignedHeaders=host&X-Amz-Expires=86400&X-Amz-Credential=AKIAJI6YDVV7XJKZL7ZA%2F20170224%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=2747799c958ffebf6f44bd698fd2071ccf9a303465febfab71ff29b46631a2d3" } awscli-1.14.44/awscli/examples/ssm/describe-patch-group-state.rst0000777454262600001440000000066213243367510026015 0ustar pysdk-ciamazon00000000000000**To get the state of a patch group** This example gets the high-level patch compliance summary for a patch group. Command:: aws ssm describe-patch-group-state --patch-group "Production" Output:: { "InstancesWithNotApplicablePatches": 0, "InstancesWithMissingPatches": 0, "InstancesWithFailedPatches": 1, "InstancesWithInstalledOtherPatches": 4, "Instances": 4, "InstancesWithInstalledPatches": 3 } awscli-1.14.44/awscli/examples/ssm/list-documents.rst0000666454262600001440000000113613243367510023634 0ustar pysdk-ciamazon00000000000000**To list all the configuration documents in your account** This example lists all the documents in your account. Command:: aws ssm list-documents Output:: { "DocumentIdentifiers": [ { "Name": "AWS-ApplyPatchBaseline", "PlatformTypes": [ "Windows" ], "DocumentVersion": "1", "DocumentType": "Command", "Owner": "Amazon", "SchemaVersion": "1.2" }, { "Name": "AWS-ConfigureAWSPackage", "PlatformTypes": [ "Windows", "Linux" ], "DocumentVersion": "1", "DocumentType": "Command", "Owner": "Amazon", "SchemaVersion": "2.0" }, ... ] } awscli-1.14.44/awscli/examples/ssm/register-target-with-maintenance-window.rst0000777454262600001440000000221113243367510030526 0ustar pysdk-ciamazon00000000000000**To register a single target with a maintenance window** This example registers an instance with a maintenance window. Command:: aws ssm register-target-with-maintenance-window --window-id "mw-ab12cd34ef56gh78" --target "Key=InstanceIds,Values=i-0000293ffd8c57862" --owner-information "Single instance" --resource-type "INSTANCE" Output:: { "WindowTargetId":"1a2b3c4d-1a2b-1a2b-1a2b-1a2b3c4d-1a2" } **To register multiple targets with a maintenance window** This example registers two instances with a maintenance window. Command:: aws ssm register-target-with-maintenance-window --window-id "mw-ab12cd34ef56gh78" --target "Key=InstanceIds,Values=i-0000293ffd8c57862,i-0cb2b964d3e14fd9f" --owner-information "Two instances in a list" --resource-type "INSTANCE" **To register a target with a maintenance window using EC2 tags** This example registers an instance with a maintenance window using EC2 tags. Command:: aws ssm register-target-with-maintenance-window --window-id "mw-06cf17cbefcb4bf4f" --targets "Key=tag:Environment,Values=Prod" "Key=Role,Values=Web" --owner-information "Production Web Servers" --resource-type "INSTANCE" awscli-1.14.44/awscli/examples/ssm/list-document-versions.rst0000777454262600001440000000074513243367510025327 0ustar pysdk-ciamazon00000000000000**To view details about existing document versions** This example lists all the versions for a document. Command:: aws ssm list-document-versions --name "patchWindowsAmi" Output:: { "DocumentVersions": [ { "IsDefaultVersion": false, "Name": "patchWindowsAmi", "DocumentVersion": "2", "CreatedDate": 1475799950.484 }, { "IsDefaultVersion": false, "Name": "patchWindowsAmi", "DocumentVersion": "1", "CreatedDate": 1475799931.064 } ] } awscli-1.14.44/awscli/examples/ssm/describe-patch-baselines.rst0000777454262600001440000000251713243367510025511 0ustar pysdk-ciamazon00000000000000**To list all patch baselines** This example lists all patch baselines. Command:: aws ssm describe-patch-baselines Output:: { "BaselineIdentities": [ { "BaselineName": "AWS-DefaultPatchBaseline", "DefaultBaseline": true, "BaselineDescription": "Default Patch Baseline Provided by AWS.", "BaselineId": "arn:aws:ssm:us-west-2:812345678901:patchbaseline/pb-04fb4ae6142167966" }, { "BaselineName": "Production-Baseline", "DefaultBaseline": false, "BaselineDescription": "Baseline containing all updates approved for production systems", "BaselineId": "pb-045f10b4f382baeda" }, { "BaselineName": "Production-Baseline", "DefaultBaseline": false, "BaselineDescription": "Baseline containing all updates approved for production systems", "BaselineId": "pb-0a2f1059b670ebd31" } ] } **To list all AWS provided patch baselines** This example lists all patch baselines provided by AWS. Command:: aws ssm describe-patch-baselines --filters "Key=OWNER,Values=[AWS]" **To list all patch baselines you own** This example lists all patch baselines with you as the owner. Command:: aws ssm describe-patch-baselines --filters "Key=OWNER,Values=[Self]" awscli-1.14.44/awscli/examples/ssm/describe-association.rst0000666454262600001440000000211213243367510024747 0ustar pysdk-ciamazon00000000000000**To get details of an association** This example describes the association between an instance and a document. Command:: aws ssm describe-association --instance-id "i-0000293ffd8c57862" --name "AWS-UpdateSSMAgent" Output:: { "AssociationDescription": { "Status": { "Date": 1487876122.564, "Message": "Associated with AWS-UpdateSSMAgent", "Name": "Associated" }, "Name": "AWS-UpdateSSMAgent", "InstanceId": "i-0000293ffd8c57862", "Overview": { "Status": "Pending", "DetailedStatus": "Associated", "AssociationStatusAggregatedCount": { "Pending": 1 } }, "AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0", "DocumentVersion": "$DEFAULT", "LastUpdateAssociationDate": 1487876122.564, "Date": 1487876122.564, "Targets": [ { "Values": [ "i-0000293ffd8c57862" ], "Key": "InstanceIds" } ] } } awscli-1.14.44/awscli/examples/ssm/create-maintenance-window.rst0000777454262600001440000000067013243367510025717 0ustar pysdk-ciamazon00000000000000**To create a maintenance window** This example creates a new maintenance window with the specified name that runs at 4 PM on every Tuesday for 4 hours, with a 1 hour cutoff, and that allows unassociated targets. Command:: aws ssm create-maintenance-window --name "My-First-Maintenance-Window" --schedule "cron(0 16 ? * TUE *)" --duration 4 --cutoff 1 --allow-unassociated-targets Output:: { "WindowId": "mw-ab12cd34ef56gh78" } awscli-1.14.44/awscli/examples/ssm/create-activation.rst0000777454262600001440000000050513243367510024266 0ustar pysdk-ciamazon00000000000000**To create an activation** This example creates a managed instance. Command:: aws ssm create-activation --default-instance-name "MyWebServers" --iam-role "AutomationRole" --registration-limit 10 Output:: { "ActivationCode": "Zqr175DJ+sPQRHsmbzzf", "ActivationId": "5b9e0074-65d3-4587-8620-3e0b0938db9e" } awscli-1.14.44/awscli/examples/ssm/delete-parameter.rst0000777454262600001440000000024413243367510024104 0ustar pysdk-ciamazon00000000000000**To delete a parameter** This example deletes a parameter. There is no output if the command succeeds. Command:: aws ssm delete-parameter --name "helloWorld" awscli-1.14.44/awscli/examples/ssm/send-command.rst0000777454262600001440000000310113243367510023224 0ustar pysdk-ciamazon00000000000000**To execute a command on one or more remote instances** This example runs an echo command on a target instance. Command:: aws ssm send-command --document-name "AWS-RunPowerShellScript" --parameters commands=["echo helloWorld"] --targets "Key=instanceids,Values=i-0cb2b964d3e14fd9f" Output:: { "Command": { "Comment": "", "Status": "Pending", "MaxErrors": "0", "Parameters": { "commands": [ "echo helloWorld" ] }, "ExpiresAfter": 1487888845.833, "ServiceRole": "", "DocumentName": "AWS-RunPowerShellScript", "TargetCount": 0, "OutputS3BucketName": "", "NotificationConfig": { "NotificationArn": "", "NotificationEvents": [], "NotificationType": "" }, "CompletedCount": 0, "Targets": [ { "Values": [ "i-0cb2b964d3e14fd9f" ], "Key": "instanceids" } ], "StatusDetails": "Pending", "ErrorCount": 0, "OutputS3KeyPrefix": "", "RequestedDateTime": 1487885245.833, "CommandId": "0d4fc863-2154-4e46-990e-d6a952469e91", "InstanceIds": [], "MaxConcurrency": "50" } } **To get IP information about an instance** This example gets the IP information about an instance. Command:: aws ssm send-command --instance-ids "i-0cb2b964d3e14fd9f" --document-name "AWS-RunShellScript" --comment "IP config" --parameters "commands=ifconfig" --output text awscli-1.14.44/awscli/examples/ssm/create-patch-baseline.rst0000777454262600001440000000114313243367510025003 0ustar pysdk-ciamazon00000000000000**To create a patch baseline** This example creates a patch baseline that approves patches for a production environment seven days after they are released by Microsoft. Command:: aws ssm create-patch-baseline --name "Production-Baseline" --approval-rules "PatchRules=[{PatchFilterGroup={PatchFilters=[{Key=MSRC_SEVERITY,Values=[Critical,Important,Moderate]},{Key=CLASSIFICATION,Values=[SecurityUpdates,Updates,UpdateRollups,CriticalUpdates]}]},ApproveAfterDays=7}]" --description "Baseline containing all updates approved for production systems" Output:: { "BaselineId": "pb-045f10b4f382baeda" } awscli-1.14.44/awscli/examples/ssm/get-maintenance-window-execution-task.rst0000777454262600001440000000205613243367510030174 0ustar pysdk-ciamazon00000000000000**To get information about a Maintenance Window task execution** This example lists information about a task that was part of a maintenance window execution. Command:: aws ssm get-maintenance-window-execution-task --window-execution-id "518d5565-5969-4cca-8f0e-da3b2a638355" --task-id "ac0c6ae1-daa3-4a89-832e-d384503b6586" Output:: { "Status": "SUCCESS", "MaxErrors": "1", "TaskArn": "AWS-RunShellScript", "MaxConcurrency": "1", "ServiceRole": "arn:aws:iam::812345678901:role/MaintenanceWindowsRole", "WindowExecutionId": "518d5565-5969-4cca-8f0e-da3b2a638355", "Priority": 10, "StartTime": 1487692834.684, "EndTime": 1487692835.005, "Type": "RUN_COMMAND", "TaskParameters": [ { "commands": { "Values": [ "df" ] }, "aws:InstanceId": { "Values": [ "i-0000293ffd8c57862" ] } } ], "TaskExecutionId": "ac0c6ae1-daa3-4a89-832e-d384503b6586" } awscli-1.14.44/awscli/examples/ssm/add-tags-to-resource.rst0000777454262600001440000000043513243367510024617 0ustar pysdk-ciamazon00000000000000**To add tags to a resource** This example updates a maintenance window with new tags. There is no output if the command succeeds. Command:: aws ssm add-tags-to-resource --resource-type "MaintenanceWindow" --resource-id "mw-03eb9db42890fb82d" --tags "Key=Stack,Value=Production" awscli-1.14.44/awscli/examples/ssm/create-association-batch.rst0000666454262600001440000000406213243367510025517 0ustar pysdk-ciamazon00000000000000**To create multiple associations** This example associates a configuration document with multiple instances. The output returns a list of successful and failed operations, if applicable. Command:: aws ssm create-association-batch --entries "Name=AWS-UpdateSSMAgent,InstanceId=i-0cb2b964d3e14fd9f" "Name=AWS-UpdateSSMAgent,InstanceId=i-0000293ffd8c57862" Output:: { "Successful": [ { "Status": { "Date": 1487876122.564, "Message": "Associated with AWS-UpdateSSMAgent", "Name": "Associated" }, "Name": "AWS-UpdateSSMAgent", "InstanceId": "i-0000293ffd8c57862", "Overview": { "Status": "Pending", "DetailedStatus": "Creating" }, "AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0", "DocumentVersion": "$DEFAULT", "LastUpdateAssociationDate": 1487876122.564, "Date": 1487876122.564, "Targets": [ { "Values": [ "i-0000293ffd8c57862" ], "Key": "InstanceIds" } ] }, { "Status": { "Date": 1487876122.595, "Message": "Associated with AWS-UpdateSSMAgent", "Name": "Associated" }, "Name": "AWS-UpdateSSMAgent", "InstanceId": "i-0cb2b964d3e14fd9f", "Overview": { "Status": "Pending", "DetailedStatus": "Creating" }, "AssociationId": "2ccfbc46-5fe4-4e5c-ba46-70b56cc93f53", "DocumentVersion": "$DEFAULT", "LastUpdateAssociationDate": 1487876122.595, "Date": 1487876122.595, "Targets": [ { "Values": [ "i-0cb2b964d3e14fd9f" ], "Key": "InstanceIds" } ] } ], "Failed": [] } awscli-1.14.44/awscli/examples/ssm/get-parameter-history.rst0000777454262600001440000000067113243367510025124 0ustar pysdk-ciamazon00000000000000**To get a value history for a parameter** This example lists the value history for a parameter. Command:: aws ssm get-parameter-history --name "welcome" Output:: { "Parameters": [ { "LastModifiedUser": "arn:aws:iam::812345678901:user/admin", "LastModifiedDate": 1487880053.085, "Type": "String", "Name": "welcome", "Value": "helloWorld" } ] } awscli-1.14.44/awscli/examples/ssm/update-document.rst0000777454262600001440000000215413243367510023764 0ustar pysdk-ciamazon00000000000000**To create a new version of a document** This creates a new version of a document. The document must be in JSON format. Note that ``file://`` must be referenced followed by the path of the content file. Command:: aws ssm update-document --name "RunShellScript" --content "file://RunShellScript.json" --document-version "\$LATEST" Output:: { "DocumentDescription": { "Status": "Updating", "Hash": "f775e5df4904c6fa46686c4722fae9de1950dace25cd9608ff8d622046b68d9b", "Name": "RunShellScript", "Parameters": [ { "Type": "StringList", "Name": "commands", "Description": "(Required) Specify a shell script or a command to run." } ], "DocumentType": "Command", "PlatformTypes": [ "Linux" ], "DocumentVersion": "2", "HashType": "Sha256", "CreatedDate": 1487899655.152, "Owner": "809632081692", "SchemaVersion": "2.0", "DefaultVersion": "1", "LatestVersion": "2", "Description": "Run an updated script" } } awscli-1.14.44/awscli/examples/ssm/create-document.rst0000666454262600001440000000245713243367510023750 0ustar pysdk-ciamazon00000000000000**To create a document** This example creates a document in your account. The document must be in JSON format. Note that ``file://`` must be referenced followed by the path of the content file. For more information about writing a configuration document, see `Configuration Document`_ in the *SSM API Reference*. .. _`Configuration Document`: http://docs.aws.amazon.com/ssm/latest/APIReference/aws-ssm-document.html Command:: aws ssm create-document --content "file://RunShellScript.json" --name "RunShellScript" --document-type "Command" Output:: { "DocumentDescription": { "Status": "Creating", "Hash": "95cf32aa8c4c4e6f0eb81c4d0cc9a81aa5d209c2c67c703bdea7a233b5596eb "Name": "RunShellScript", "Parameters": [ { "Type": "StringList", "Name": "commands", "Description": "(Required) Specify a shell script or a command to run." } ], "DocumentType": "Command", "PlatformTypes": [ "Linux" ], "DocumentVersion": "1", "HashType": "Sha256", "CreatedDate": 1487871523.324, "Owner": "809632081692", "SchemaVersion": "2.0", "DefaultVersion": "1", "LatestVersion": "1", "Description": "Run a script" } } awscli-1.14.44/awscli/examples/ssm/get-default-patch-baseline.rst0000777454262600001440000000037213243367510025744 0ustar pysdk-ciamazon00000000000000**To display the default patch baseline** This example displays the default patch baseline. Command:: aws ssm get-default-patch-baseline Output:: { "BaselineId":"arn:aws:ssm:us-west-1:812345678901:patchbaseline/pb-0ca44a362f8afc725" } awscli-1.14.44/awscli/examples/ssm/describe-document-permission.rst0000777454262600001440000000040013243367510026440 0ustar pysdk-ciamazon00000000000000**To get the permissions of a document** This example lists all the versions for a document. Command:: aws ssm describe-document-permission --name "RunShellScript" --permission-type "Share" Output:: { "AccountIds": [ "all" ] } awscli-1.14.44/awscli/examples/ssm/get-maintenance-window-execution.rst0000777454262600001440000000101213243367510027223 0ustar pysdk-ciamazon00000000000000**To get information about a Maintenance Window task execution** This example lists information about a task executed as part of a maintenance window execution. Command:: aws ssm get-maintenance-window-execution --window-execution-id "518d5565-5969-4cca-8f0e-da3b2a638355" Output:: { "Status": "SUCCESS", "TaskIds": [ "ac0c6ae1-daa3-4a89-832e-d384503b6586" ], "StartTime": 1487692834.595, "EndTime": 1487692835.051, "WindowExecutionId": "518d5565-5969-4cca-8f0e-da3b2a638355", } awscli-1.14.44/awscli/examples/ssm/register-task-with-maintenance-window.rst0000777454262600001440000000253413243367510030212 0ustar pysdk-ciamazon00000000000000**To register a task with a maintenance window** This example registers a task to a maintenance window which is targeted at an instance. Command:: aws ssm register-task-with-maintenance-window --window-id "mw-ab12cd34ef56gh78" --task-arn "AWS-RunShellScript" --targets "Key=InstanceIds,Values=i-0000293ffd8c57862" --service-role-arn "arn:aws:iam::812345678901:role/MaintenanceWindowsRole" --task-type "RUN_COMMAND" --task-parameters "{\"commands\":{\"Values\":[\"df\"]}}" --max-concurrency 1 --max-errors 1 --priority 10 Output:: { "WindowTaskId":"44444444-5555-6666-7777-88888888" } **To register a task using a Maintenance Windows target ID** This example registers a task using a maintenance window target ID. The maintenance window target ID was in the output of the ``aws ssm register-target-with-maintenance-window`` command, otherwise you can retrieve it from the output of the ``aws ssm describe-maintenance-window-targets`` command. Command:: aws ssm register-task-with-maintenance-window --targets "Key=WindowTargetIds,Values=350d44e6-28cc-44e2-951f-4b2c985838f6" --task-arn "AWS-RunShellScript" --service-role-arn "arn:aws:iam::812345678901:role/MaintenanceWindowsRole" --window-id "mw-ab12cd34ef56gh78" --task-type "RUN_COMMAND" --task-parameters "{\"commands\":{\"Values\":[\"df\"]}}" --max-concurrency 1 --max-errors 1 --priority 10 awscli-1.14.44/awscli/examples/ssm/list-command-invocations.rst0000777454262600001440000000403713243367510025611 0ustar pysdk-ciamazon00000000000000**To list the invocations of a specific command** This example lists all the invocations of a command. Command:: aws ssm list-command-invocations --command-id "b8eac879-0541-439d-94ec-47a80d554f44" --details Output:: { "CommandInvocations": [ { "Comment": "IP config", "Status": "Success", "CommandPlugins": [ { "Status": "Success", "ResponseStartDateTime": 1487794396.651, "StandardErrorUrl": "", "OutputS3BucketName": "", "OutputS3Region": "us-west-2", "OutputS3KeyPrefix": "", "ResponseCode": 0, "Output": "eth0 Link encap:Ethernet HWaddr 06:41:38:F5:D6:EF \n inet addr:172.31.44.222 Bcast:172.31.47.255 Mask:255.255.240.0\n inet6 addr: fe80::441:38ff:fef5:d6ef/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1\n RX packets:186705 errors:0 dropped:0 overruns:0 frame:0\n TX packets:188811 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:91749280 (87.4 MiB) TX bytes:31721645 (30.2 MiB)\n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:2 errors:0 dropped:0 overruns:0 frame:0\n X packets:2 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1 \n RX bytes:140 (140.0 b) TX bytes:140 (140.0 b)\n\n", "ResponseFinishDateTime": 1487794396.655, "StatusDetails": "Success", "StandardOutputUrl": "", "Name": "aws:runShellScript" } ], "ServiceRole": "", "InstanceId": "i-0cb2b964d3e14fd9f", "DocumentName": "AWS-RunShellScript", "NotificationConfig": { "NotificationArn": "", "NotificationEvents": [], "NotificationType": "" }, "StatusDetails": "Success", "StandardOutputUrl": "", "StandardErrorUrl": "", "InstanceName": "", "CommandId": "b8eac879-0541-439d-94ec-47a80d554f44", "RequestedDateTime": 1487794396.363 } ] } awscli-1.14.44/awscli/examples/ssm/list-inventory-entries.rst0000777454262600001440000000071513243367510025344 0ustar pysdk-ciamazon00000000000000**To view custom inventory entries for an instance** This example lists all the custom inventory entries for an instance. Command:: aws ssm list-inventory-entries --instance-id "i-0cb2b964d3e14fd9f" --type-name "Custom:RackInfo" Output:: { "InstanceId": "i-0cb2b964d3e14fd9f", "TypeName": "Custom:RackInfo", "Entries": [ { "RackLocation": "Bay B/Row C/Rack D/Shelf E" } ], "SchemaVersion": "1.0", "CaptureTime": "2016-08-22T10:01:01Z" } awscli-1.14.44/awscli/examples/ssm/describe-automation-executions.rst0000777454262600001440000000203713243367510027010 0ustar pysdk-ciamazon00000000000000**To get details about all active and terminated Automation executions** This example displays the details of all Automation Execution. Command:: aws ssm describe-automation-executions Output:: { "AutomationExecutionMetadataList": [ { "AutomationExecutionStatus": "Failed", "Outputs": { "createImage.ImageId": [ "No output available yet because the step is not successfully executed" ] }, "DocumentName": "AWS-UpdateLinuxAmi", "AutomationExecutionId": "4105a4fc-f944-11e6-9d32-8fb2db27a909", "ExecutionEndTime": 1487798228.456, "DocumentVersion": "1", "ExecutionStartTime": 1487798222.746, "ExecutedBy": "admin" } ] } **To get details of a specific Automation execution** This example shows the details about a specific Automation Execution. Command:: aws ssm get-automation-execution --automation-execution-id "4105a4fc-f944-11e6-9d32-8fb2db27a909" awscli-1.14.44/awscli/examples/ssm/describe-instance-patch-states-for-patch-group.rst0000777454262600001440000000226013243367510031657 0ustar pysdk-ciamazon00000000000000**To get the instance states for a patch group** This example gets the patch summary states per-instance for a patch group. Command:: aws ssm describe-instance-patch-states-for-patch-group --patch-group "Production" Output:: { "InstancePatchStates": [ { "OperationStartTime":1481259600.0, "FailedCount":0, "InstanceId":"i-08ee91c0b17045407", "OwnerInformation":"", "NotApplicableCount":2077, "OperationEndTime":1481259757.0, "PatchGroup":"Production", "InstalledOtherCount":186, "MissingCount":7, "SnapshotId":"b0e65479-79be-4288-9f88-81c96bc3ed5e", "Operation":"Scan", "InstalledCount":72 }, { "OperationStartTime":1481259602.0, "FailedCount":0, "InstanceId":"i-0fff3aab684d01b23", "OwnerInformation":"", "NotApplicableCount":2692, "OperationEndTime":1481259613.0, "PatchGroup":"Production", "InstalledOtherCount":3, "MissingCount":1, "SnapshotId":"b0e65479-79be-4288-9f88-81c96bc3ed5e", "Operation":"Scan", "InstalledCount":1 }, ... ] } awscli-1.14.44/awscli/examples/ssm/list-associations.rst0000666454262600001440000000455513243367510024342 0ustar pysdk-ciamazon00000000000000**To list your associations for a specific instance** This example lists all the associations for an instance. Command:: aws ssm list-associations --association-filter-list "key=InstanceId,value=i-0000293ffd8c57862" Output:: { "Associations": [ { "InstanceId": "i-0000293ffd8c57862", "Overview": { "Status": "Pending", "DetailedStatus": "Associated", "AssociationStatusAggregatedCount": { "Pending": 1 } }, "AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0", "Name": "AWS-UpdateSSMAgent", "Targets": [ { "Values": [ "i-0000293ffd8c57862" ], "Key": "InstanceIds" } ] } ] } **To list your associations for a specific document** This example lists all associations for the a document. Command:: aws ssm list-associations --association-filter-list "key=Name,value=AWS-UpdateSSMAgent" Output:: { "Associations": [ { "InstanceId": "i-0000293ffd8c57862", "Overview": { "Status": "Pending", "DetailedStatus": "Associated", "AssociationStatusAggregatedCount": { "Pending": 1 } }, "AssociationId": "d8617c07-2079-4c18-9847-1655fc2698b0", "Name": "AWS-UpdateSSMAgent", "Targets": [ { "Values": [ "i-0000293ffd8c57862" ], "Key": "InstanceIds" } ] }, { "Name": "AWS-UpdateSSMAgent", "LastExecutionDate": 1487876123.0, "InstanceId": "i-0cb2b964d3e14fd9f", "Overview": { "Status": "Success", "AssociationStatusAggregatedCount": { "Success": 1 } }, "AssociationId": "2ccfbc46-5fe4-4e5c-ba46-70b56cc93f53", "Targets": [ { "Values": [ "i-0cb2b964d3e14fd9f" ], "Key": "InstanceIds" } ] } ] } awscli-1.14.44/awscli/examples/ssm/describe-document.rst0000666454262600001440000000164013243367510024256 0ustar pysdk-ciamazon00000000000000**To describe a configuration document** This example returns the content of a document. Command:: aws ssm describe-document --name "RunShellScript" Output:: { "Document": { "Status": "Active", "Hash": "95cf32aa8c4c4e6f0eb81c4d0cc9a81aa5d209c2c67c703bdea7a233b5596eba", "Name": "RunShellScript", "Parameters": [ { "Type": "StringList", "Name": "commands", "Description": "(Required) Specify a shell script or a command to run." } ], "DocumentType": "Command", "PlatformTypes": [ "Linux" ], "DocumentVersion": "1", "HashType": "Sha256", "CreatedDate": 1487871400.888, "Owner": "809632081692", "SchemaVersion": "2.0", "DefaultVersion": "1", "LatestVersion": "1", "Description": "Run a script" } } awscli-1.14.44/awscli/examples/ssm/delete-patch-baseline.rst0000777454262600001440000000032413243367510025002 0ustar pysdk-ciamazon00000000000000**To delete a patch baseline** This example deletes a patch baseline. Command:: aws ssm delete-patch-baseline --baseline-id "pb-045f10b4f382baeda" Output:: { "BaselineId": "pb-045f10b4f382baeda" } awscli-1.14.44/awscli/examples/ssm/get-patch-baseline.rst0000777454262600001440000000171113243367510024320 0ustar pysdk-ciamazon00000000000000**To display a patch baseline** This example displays the details for a patch baseline. Command:: aws ssm get-patch-baseline --baseline-id "pb-00dbb759999aa2bc3" Output:: { "BaselineId":"pb-00dbb759999aa2bc3", "Name":"Windows-Server-2012R2", "PatchGroups":[ "Web Servers" ], "RejectedPatches":[ ], "GlobalFilters":{ "PatchFilters":[ ] }, "ApprovalRules":{ "PatchRules":[ { "PatchFilterGroup":{ "PatchFilters":[ { "Values":[ "Important", "Critical" ], "Key":"MSRC_SEVERITY" }, { "Values":[ "SecurityUpdates" ], "Key":"CLASSIFICATION" }, { "Values":[ "WindowsServer2012R2" ], "Key":"PRODUCT" } ] }, "ApproveAfterDays":5 } ] }, "ModifiedDate":1480997823.81, "CreatedDate":1480997823.81, "ApprovedPatches":[ ], "Description":"Windows Server 2012 R2, Important and Critical security updates" } awscli-1.14.44/awscli/examples/ssm/put-parameter.rst0000777454262600001440000000140613243367510023453 0ustar pysdk-ciamazon00000000000000**To create a parameter that uses a String data type** This example creates a parameter. There is no output if the command succeeds. Command:: aws ssm put-parameter --name "welcome" --type "String" --value "helloWorld" **To create a Secure String parameter** This example creates a Secure String parameter. Singles quotes are used so that the literal value is passed. There is no output if the command succeeds. Command:: aws ssm put-parameter --name 'password' --type "SecureString" --value 'a value, for example P@ssW%rd#1' **To change a parameter value** This example changes the value of a parameter. There is no output if the command succeeds. Command:: aws ssm put-parameter --name "welcome" --type "String" --value "good day sunshine" --overwrite awscli-1.14.44/awscli/examples/configservice/0000777454262600001440000000000013243367512022155 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/configservice/put-config-rule.rst0000666454262600001440000000631713243367510025734 0ustar pysdk-ciamazon00000000000000**To add an AWS managed Config rule** The following command provides JSON code to add an AWS managed Config rule:: aws configservice put-config-rule --config-rule file://RequiredTagsForEC2Instances.json ``RequiredTagsForEC2Instances.json`` is a JSON file that contains the rule configuration:: { "ConfigRuleName": "RequiredTagsForEC2Instances", "Description": "Checks whether the CostCenter and Owner tags are applied to EC2 instances.", "Scope": { "ComplianceResourceTypes": [ "AWS::EC2::Instance" ] }, "Source": { "Owner": "AWS", "SourceIdentifier": "REQUIRED_TAGS" }, "InputParameters": "{\"tag1Key\":\"CostCenter\",\"tag2Key\":\"Owner\"}" } For the ``ComplianceResourceTypes`` attribute, this JSON code limits the scope to resources of the ``AWS::EC2::Instance`` type, so AWS Config will evaluate only EC2 instances against the rule. Because the rule is a managed rule, the ``Owner`` attribute is set to ``AWS``, and the ``SourceIdentifier`` attribute is set to the rule identifier, ``REQUIRED_TAGS``. For the ``InputParameters`` attribute, the tag keys that the rule requires, ``CostCenter`` and ``Owner``, are specified. If the command succeeds, AWS Config returns no output. To verify the rule configuration, run the `describe-config-rules`__ command, and specify the rule name. .. __: http://docs.aws.amazon.com/cli/latest/reference/configservice/describe-config-rules.html **To add a customer managed Config rule** The following command provides JSON code to add a customer managed Config rule:: aws configservice put-config-rule --config-rule file://InstanceTypesAreT2micro.json ``InstanceTypesAreT2micro.json`` is a JSON file that contains the rule configuration:: { "ConfigRuleName": "InstanceTypesAreT2micro", "Description": "Evaluates whether EC2 instances are the t2.micro type.", "Scope": { "ComplianceResourceTypes": [ "AWS::EC2::Instance" ] }, "Source": { "Owner": "CUSTOM_LAMBDA", "SourceIdentifier": "arn:aws:lambda:us-east-1:123456789012:function:InstanceTypeCheck", "SourceDetails": [ { "EventSource": "aws.config", "MessageType": "ConfigurationItemChangeNotification" } ] }, "InputParameters": "{\"desiredInstanceType\":\"t2.micro\"}" } For the ``ComplianceResourceTypes`` attribute, this JSON code limits the scope to resources of the ``AWS::EC2::Instance`` type, so AWS Config will evaluate only EC2 instances against the rule. Because this rule is a customer managed rule, the ``Owner`` attribute is set to ``CUSTOM_LAMBDA``, and the ``SourceIdentifier`` attribute is set to the ARN of the AWS Lambda function. The ``SourceDetails`` object is required. The parameters that are specified for the ``InputParameters`` attribute are passed to the AWS Lambda function when AWS Config invokes it to evaluate resources against the rule. If the command succeeds, AWS Config returns no output. To verify the rule configuration, run the `describe-config-rules`__ command, and specify the rule name. .. __: http://docs.aws.amazon.com/cli/latest/reference/configservice/describe-config-rules.html awscli-1.14.44/awscli/examples/configservice/describe-compliance-by-config-rule.rst0000666454262600001440000000243513243367510031421 0ustar pysdk-ciamazon00000000000000**To get compliance information for your AWS Config rules** The following command returns compliance information for each AWS Config rule that is violated by one or more AWS resources:: aws configservice describe-compliance-by-config-rule --compliance-types NON_COMPLIANT In the output, the value for each ``CappedCount`` attribute indicates how many resources do not comply with the related rule. For example, the following output indicates that 3 resources do not comply with the rule named ``InstanceTypesAreT2micro``. Output:: { "ComplianceByConfigRules": [ { "Compliance": { "ComplianceContributorCount": { "CappedCount": 3, "CapExceeded": false }, "ComplianceType": "NON_COMPLIANT" }, "ConfigRuleName": "InstanceTypesAreT2micro" }, { "Compliance": { "ComplianceContributorCount": { "CappedCount": 10, "CapExceeded": false }, "ComplianceType": "NON_COMPLIANT" }, "ConfigRuleName": "RequiredTagsForVolumes" } ] }awscli-1.14.44/awscli/examples/configservice/describe-configuration-recorder-status.rst0000666454262600001440000000107213243367510032456 0ustar pysdk-ciamazon00000000000000**To get status information for the configuration recorder** The following command returns the status of the default configuration recorder:: aws configservice describe-configuration-recorder-status Output:: { "ConfigurationRecordersStatus": [ { "name": "default", "lastStatus": "SUCCESS", "recording": true, "lastStatusChangeTime": 1452193834.344, "lastStartTime": 1441039997.819, "lastStopTime": 1441039992.835 } ] }awscli-1.14.44/awscli/examples/configservice/start-config-rules-evaluation.rst0000777454262600001440000000037013243367510030605 0ustar pysdk-ciamazon00000000000000**To run an on-demand evaluation for AWS Config rules** The following command starts an evaluation for two AWS managed rules:: aws configservice start-config-rules-evaluation --config-rule-names s3-bucket-versioning-enabled cloudtrail-enabledawscli-1.14.44/awscli/examples/configservice/get-status.rst0000666454262600001440000000066313243367510025012 0ustar pysdk-ciamazon00000000000000**To get the status for AWS Config** The following command returns the status of the delivery channel and configuration recorder:: aws configservice get-status Output:: Configuration Recorders: name: default recorder: ON last status: SUCCESS Delivery Channels: name: default last stream delivery status: SUCCESS last history delivery status: SUCCESS last snapshot delivery status: SUCCESSawscli-1.14.44/awscli/examples/configservice/list-discovered-resources.rst0000666454262600001440000000122313243367510030013 0ustar pysdk-ciamazon00000000000000**To list resources that AWS Config has discovered** The following command lists the EC2 instances that AWS Config has discovered:: aws configservice list-discovered-resources --resource-type AWS::EC2::Instance Output:: { "resourceIdentifiers": [ { "resourceType": "AWS::EC2::Instance", "resourceId": "i-1a2b3c4d" }, { "resourceType": "AWS::EC2::Instance", "resourceId": "i-2a2b3c4d" }, { "resourceType": "AWS::EC2::Instance", "resourceId": "i-3a2b3c4d" } ] }awscli-1.14.44/awscli/examples/configservice/start-configuration-recorder.rst0000666454262600001440000000065213243367510030515 0ustar pysdk-ciamazon00000000000000 **To start the configuration recorder** The following command starts the default configuration recorder:: aws configservice start-configuration-recorder --configuration-recorder-name default If the command succeeds, AWS Config returns no output. To verify that AWS Config is recording your resources, run the `get-status`__ command. .. __: http://docs.aws.amazon.com/cli/latest/reference/configservice/get-status.htmlawscli-1.14.44/awscli/examples/configservice/put-configuration-recorder.rst0000666454262600001440000000326713243367510030175 0ustar pysdk-ciamazon00000000000000**To record all supported resources** The following command creates a configuration recorder that tracks changes to all supported resource types, including global resource types:: aws configservice put-configuration-recorder --configuration-recorder name=default,roleARN=arn:aws:iam::123456789012:role/config-role --recording-group allSupported=true,includeGlobalResourceTypes=true **To record specific types of resources** The following command creates a configuration recorder that tracks changes to only those types of resources that are specified in the JSON file for the `--recording-group` option:: aws configservice put-configuration-recorder --configuration-recorder name=default,roleARN=arn:aws:iam::123456789012:role/config-role --recording-group file://recordingGroup.json `recordingGroup.json` is a JSON file that specifies the types of resources that AWS Config will record:: { "allSupported": false, "includeGlobalResourceTypes": false, "resourceTypes": [ "AWS::EC2::EIP", "AWS::EC2::Instance", "AWS::EC2::NetworkAcl", "AWS::EC2::SecurityGroup", "AWS::CloudTrail::Trail", "AWS::EC2::Volume", "AWS::EC2::VPC", "AWS::IAM::User", "AWS::IAM::Policy" ] } Before you can specify resource types for the `resourceTypes` key, you must set the `allSupported` and `includeGlobalResourceTypes` options to false or omit them. If the command succeeds, AWS Config returns no output. To verify the settings of your configuration recorder, run the `describe-configuration-recorders`__ command. .. __: http://docs.aws.amazon.com/cli/latest/reference/configservice/describe-configuration-recorders.htmlawscli-1.14.44/awscli/examples/configservice/describe-delivery-channel-status.rst0000666454262600001440000000163513243367510031242 0ustar pysdk-ciamazon00000000000000**To get status information for the delivery channel** The following command returns the status of the delivery channel:: aws configservice describe-delivery-channel-status Output:: { "DeliveryChannelsStatus": [ { "configStreamDeliveryInfo": { "lastStatusChangeTime": 1452193834.381, "lastStatus": "SUCCESS" }, "configHistoryDeliveryInfo": { "lastSuccessfulTime": 1450317838.412, "lastStatus": "SUCCESS", "lastAttemptTime": 1450317838.412 }, "configSnapshotDeliveryInfo": { "lastSuccessfulTime": 1452185597.094, "lastStatus": "SUCCESS", "lastAttemptTime": 1452185597.094 }, "name": "default" } ] }awscli-1.14.44/awscli/examples/configservice/get-resource-config-history.rst0000666454262600001440000000042613243367510030255 0ustar pysdk-ciamazon00000000000000**To get the configuration history of an AWS resource** The following command returns a list of configuration items for an EC2 instance with an ID of ``i-1a2b3c4d``:: aws configservice get-resource-config-history --resource-type AWS::EC2::Instance --resource-id i-1a2b3c4dawscli-1.14.44/awscli/examples/configservice/stop-configuration-recorder.rst0000666454262600001440000000065213243367510030345 0ustar pysdk-ciamazon00000000000000**To stop the configuration recorder** The following command stops the default configuration recorder:: aws configservice stop-configuration-recorder --configuration-recorder-name default If the command succeeds, AWS Config returns no output. To verify that AWS Config is not recording your resources, run the `get-status`__ command. .. __: http://docs.aws.amazon.com/cli/latest/reference/configservice/get-status.htmlawscli-1.14.44/awscli/examples/configservice/get-compliance-summary-by-resource-type.rst0000666454262600001440000000357013243367510032510 0ustar pysdk-ciamazon00000000000000**To get the compliance summary for all resource types** The following command returns the number of AWS resources that are noncompliant and the number that are compliant:: aws configservice get-compliance-summary-by-resource-type In the output, the value for each ``CappedCount`` attribute indicates how many resources are compliant or noncompliant. Output:: { "ComplianceSummariesByResourceType": [ { "ComplianceSummary": { "NonCompliantResourceCount": { "CappedCount": 16, "CapExceeded": false }, "ComplianceSummaryTimestamp": 1453237464.543, "CompliantResourceCount": { "CappedCount": 10, "CapExceeded": false } } } ] } **To get the compliance summary for a specific resource type** The following command returns the number of EC2 instances that are noncompliant and the number that are compliant:: aws configservice get-compliance-summary-by-resource-type --resource-types AWS::EC2::Instance In the output, the value for each ``CappedCount`` attribute indicates how many resources are compliant or noncompliant. Output:: { "ComplianceSummariesByResourceType": [ { "ResourceType": "AWS::EC2::Instance", "ComplianceSummary": { "NonCompliantResourceCount": { "CappedCount": 3, "CapExceeded": false }, "ComplianceSummaryTimestamp": 1452204923.518, "CompliantResourceCount": { "CappedCount": 7, "CapExceeded": false } } } ] }awscli-1.14.44/awscli/examples/configservice/describe-config-rules.rst0000666454262600001440000000251613243367510027064 0ustar pysdk-ciamazon00000000000000**To get details for an AWS Config rule** The following command returns details for an AWS Config rule named ``InstanceTypesAreT2micro``:: aws configservice describe-config-rules --config-rule-names InstanceTypesAreT2micro Output:: { "ConfigRules": [ { "ConfigRuleState": "ACTIVE", "Description": "Evaluates whether EC2 instances are the t2.micro type.", "ConfigRuleName": "InstanceTypesAreT2micro", "ConfigRuleArn": "arn:aws:config:us-east-1:123456789012:config-rule/config-rule-abcdef", "Source": { "Owner": "CUSTOM_LAMBDA", "SourceIdentifier": "arn:aws:lambda:us-east-1:123456789012:function:InstanceTypeCheck", "SourceDetails": [ { "EventSource": "aws.config", "MessageType": "ConfigurationItemChangeNotification" } ] }, "InputParameters": "{\"desiredInstanceType\":\"t2.micro\"}", "Scope": { "ComplianceResourceTypes": [ "AWS::EC2::Instance" ] }, "ConfigRuleId": "config-rule-abcdef" } ] }awscli-1.14.44/awscli/examples/configservice/subscribe.rst0000666454262600001440000000223213243367510024665 0ustar pysdk-ciamazon00000000000000**To subscribe to AWS Config** The following command creates the default delivery channel and configuration recorder. The command also specifies the Amazon S3 bucket and Amazon SNS topic to which AWS Config will deliver configuration information:: aws configservice subscribe --s3-bucket config-bucket-123456789012 --sns-topic arn:aws:sns:us-east-1:123456789012:config-topic --iam-role arn:aws:iam::123456789012:role/ConfigRole-A1B2C3D4E5F6 Output:: Using existing S3 bucket: config-bucket-123456789012 Using existing SNS topic: arn:aws:sns:us-east-1:123456789012:config-topic Subscribe succeeded: Configuration Recorders: [ { "recordingGroup": { "allSupported": true, "resourceTypes": [], "includeGlobalResourceTypes": false }, "roleARN": "arn:aws:iam::123456789012:role/ConfigRole-A1B2C3D4E5F6", "name": "default" } ] Delivery Channels: [ { "snsTopicARN": "arn:aws:sns:us-east-1:123456789012:config-topic", "name": "default", "s3BucketName": "config-bucket-123456789012" } ]awscli-1.14.44/awscli/examples/configservice/delete-evaluation-results.rst0000777454262600001440000000040013243367510030010 0ustar pysdk-ciamazon00000000000000**To manually delete evaluation results** The following command deletes the current evaluation results for the AWS managed rule s3-bucket-versioning-enabled:: aws configservice delete-evaluation-results --config-rule-name s3-bucket-versioning-enabledawscli-1.14.44/awscli/examples/configservice/describe-compliance-by-resource.rst0000666454262600001440000000254213243367510031035 0ustar pysdk-ciamazon00000000000000**To get compliance information for your AWS resources** The following command returns compliance information for each EC2 instance that is recorded by AWS Config and that violates one or more rules:: aws configservice describe-compliance-by-resource --resource-type AWS::EC2::Instance --compliance-types NON_COMPLIANT In the output, the value for each ``CappedCount`` attribute indicates how many rules the resource violates. For example, the following output indicates that instance ``i-1a2b3c4d`` violates 2 rules. Output:: { "ComplianceByResources": [ { "ResourceType": "AWS::EC2::Instance", "ResourceId": "i-1a2b3c4d", "Compliance": { "ComplianceContributorCount": { "CappedCount": 2, "CapExceeded": false }, "ComplianceType": "NON_COMPLIANT" } }, { "ResourceType": "AWS::EC2::Instance", "ResourceId": "i-2a2b3c4d ", "Compliance": { "ComplianceContributorCount": { "CappedCount": 3, "CapExceeded": false }, "ComplianceType": "NON_COMPLIANT" } } ] }awscli-1.14.44/awscli/examples/configservice/describe-delivery-channels.rst0000666454262600001440000000066013243367510030101 0ustar pysdk-ciamazon00000000000000**To get details about the delivery channel** The following command returns details about the delivery channel:: aws configservice describe-delivery-channels Output:: { "DeliveryChannels": [ { "snsTopicARN": "arn:aws:sns:us-east-1:123456789012:config-topic", "name": "default", "s3BucketName": "config-bucket-123456789012" } ] }awscli-1.14.44/awscli/examples/configservice/get-compliance-details-by-config-rule.rst0000666454262600001440000000410713243367510032041 0ustar pysdk-ciamazon00000000000000**To get the evaluation results for an AWS Config rule** The following command returns the evaluation results for all of the resources that don't comply with an AWS Config rule named ``InstanceTypesAreT2micro``:: aws configservice get-compliance-details-by-config-rule --config-rule-name InstanceTypesAreT2micro --compliance-types NON_COMPLIANT Output:: { "EvaluationResults": [ { "EvaluationResultIdentifier": { "OrderingTimestamp": 1450314635.065, "EvaluationResultQualifier": { "ResourceType": "AWS::EC2::Instance", "ResourceId": "i-1a2b3c4d", "ConfigRuleName": "InstanceTypesAreT2micro" } }, "ResultRecordedTime": 1450314645.261, "ConfigRuleInvokedTime": 1450314642.948, "ComplianceType": "NON_COMPLIANT" }, { "EvaluationResultIdentifier": { "OrderingTimestamp": 1450314635.065, "EvaluationResultQualifier": { "ResourceType": "AWS::EC2::Instance", "ResourceId": "i-2a2b3c4d", "ConfigRuleName": "InstanceTypesAreT2micro" } }, "ResultRecordedTime": 1450314645.18, "ConfigRuleInvokedTime": 1450314642.902, "ComplianceType": "NON_COMPLIANT" }, { "EvaluationResultIdentifier": { "OrderingTimestamp": 1450314635.065, "EvaluationResultQualifier": { "ResourceType": "AWS::EC2::Instance", "ResourceId": "i-3a2b3c4d", "ConfigRuleName": "InstanceTypesAreT2micro" } }, "ResultRecordedTime": 1450314643.346, "ConfigRuleInvokedTime": 1450314643.124, "ComplianceType": "NON_COMPLIANT" } ] }awscli-1.14.44/awscli/examples/configservice/describe-configuration-recorders.rst0000666454262600001440000000113513243367510031320 0ustar pysdk-ciamazon00000000000000**To get details about the configuration recorder** The following command returns details about the default configuration recorder:: aws configservice describe-configuration-recorders Output:: { "ConfigurationRecorders": [ { "recordingGroup": { "allSupported": true, "resourceTypes": [], "includeGlobalResourceTypes": true }, "roleARN": "arn:aws:iam::123456789012:role/config-ConfigRole-A1B2C3D4E5F6", "name": "default" } ] }awscli-1.14.44/awscli/examples/configservice/put-delivery-channel.rst0000666454262600001440000000442013243367510026744 0ustar pysdk-ciamazon00000000000000**To create a delivery channel** The following command provides the settings for the delivery channel as JSON code:: aws configservice put-delivery-channel --delivery-channel file://deliveryChannel.json The ``deliveryChannel.json`` file specifies the delivery channel attributes:: { "name": "default", "s3BucketName": "config-bucket-123456789012", "snsTopicARN": "arn:aws:sns:us-east-1:123456789012:config-topic", "configSnapshotDeliveryProperties": { "deliveryFrequency": "Twelve_Hours" } } This example sets the following attributes: - ``name`` - The name of the delivery channel. By default, AWS Config assigns the name ``default`` to a new delivery channel. You cannot update the delivery channel name with the ``put-delivery-channel`` command. For the steps to change the name, see `Renaming the Delivery Channel`__. .. __: http://docs.aws.amazon.com/config/latest/developerguide/update-dc.html#update-dc-rename - ``s3BucketName`` - The name of the Amazon S3 bucket to which AWS Config delivers configuration snapshots and configuration history files. If you specify a bucket that belongs to another AWS account, that bucket must have policies that grant access permissions to AWS Config. For more information, see `Permissions for the Amazon S3 Bucket`__. .. __: http://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html - ``snsTopicARN`` - The Amazon Resource Name (ARN) of the Amazon SNS topic to which AWS Config sends notifications about configuration changes. If you choose a topic from another account, the topic must have policies that grant access permissions to AWS Config. For more information, see `Permissions for the Amazon SNS Topic`__. .. __: http://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html - ``configSnapshotDeliveryProperties`` - Contains the ``deliveryFrequency`` attribute, which sets how often AWS Config delivers configuration snapshots and how often it invokes evaluations for periodic Config rules. If the command succeeds, AWS Config returns no output. To verify the settings of your delivery channel, run the `describe-delivery-channels`__ command. .. __: http://docs.aws.amazon.com/cli/latest/reference/configservice/describe-delivery-channels.htmlawscli-1.14.44/awscli/examples/configservice/get-compliance-summary-by-config-rule.rst0000666454262600001440000000132213243367510032105 0ustar pysdk-ciamazon00000000000000**To get the compliance summary for your AWS Config rules** The following command returns the number of rules that are compliant and the number that are noncompliant:: aws configservice get-compliance-summary-by-config-rule In the output, the value for each ``CappedCount`` attribute indicates how many rules are compliant or noncompliant. Output:: { "ComplianceSummary": { "NonCompliantResourceCount": { "CappedCount": 3, "CapExceeded": false }, "ComplianceSummaryTimestamp": 1452204131.493, "CompliantResourceCount": { "CappedCount": 2, "CapExceeded": false } } }awscli-1.14.44/awscli/examples/configservice/delete-config-rule.rst0000666454262600001440000000026513243367510026362 0ustar pysdk-ciamazon00000000000000**To delete an AWS Config rule** The following command deletes an AWS Config rule named ``MyConfigRule``:: aws configservice delete-config-rule --config-rule-name MyConfigRuleawscli-1.14.44/awscli/examples/configservice/delete-delivery-channel.rst0000666454262600001440000000025513243367510027400 0ustar pysdk-ciamazon00000000000000**To delete a delivery channel** The following command deletes the default delivery channel:: aws configservice delete-delivery-channel --delivery-channel-name defaultawscli-1.14.44/awscli/examples/configservice/get-compliance-details-by-resource.rst0000666454262600001440000000300113243367510031446 0ustar pysdk-ciamazon00000000000000**To get the evaluation results for an AWS resource** The following command returns the evaluation results for each rule with which the EC2 instance ``i-1a2b3c4d`` does not comply:: aws configservice get-compliance-details-by-resource --resource-type AWS::EC2::Instance --resource-id i-1a2b3c4d --compliance-types NON_COMPLIANT Output:: { "EvaluationResults": [ { "EvaluationResultIdentifier": { "OrderingTimestamp": 1450314635.065, "EvaluationResultQualifier": { "ResourceType": "AWS::EC2::Instance", "ResourceId": "i-1a2b3c4d", "ConfigRuleName": "InstanceTypesAreT2micro" } }, "ResultRecordedTime": 1450314643.288, "ConfigRuleInvokedTime": 1450314643.034, "ComplianceType": "NON_COMPLIANT" }, { "EvaluationResultIdentifier": { "OrderingTimestamp": 1450314635.065, "EvaluationResultQualifier": { "ResourceType": "AWS::EC2::Instance", "ResourceId": "i-1a2b3c4d", "ConfigRuleName": "RequiredTagForEC2Instances" } }, "ResultRecordedTime": 1450314645.261, "ConfigRuleInvokedTime": 1450314642.948, "ComplianceType": "NON_COMPLIANT" } ] }awscli-1.14.44/awscli/examples/configservice/deliver-config-snapshot.rst0000666454262600001440000000052013243367510027434 0ustar pysdk-ciamazon00000000000000**To deliver a configuration snapshot** The following command delivers a configuration snapshot to the Amazon S3 bucket that belongs to the default delivery channel:: aws configservice deliver-config-snapshot --delivery-channel-name default Output:: { "configSnapshotId": "d0333b00-a683-44af-921e-examplefb794" }awscli-1.14.44/awscli/examples/configservice/describe-config-rule-evaluation-status.rst0000666454262600001440000000124513243367510032365 0ustar pysdk-ciamazon00000000000000**To get status information for an AWS Config rule** The following command returns the status information for an AWS Config rule named ``MyConfigRule``:: aws configservice describe-config-rule-evaluation-status --config-rule-names MyConfigRule Output:: { "ConfigRulesEvaluationStatus": [ { "ConfigRuleArn": "arn:aws:config:us-east-1:123456789012:config-rule/config-rule-abcdef", "FirstActivatedTime": 1450311703.844, "ConfigRuleId": "config-rule-abcdef", "LastSuccessfulInvocationTime": 1450314643.156, "ConfigRuleName": "MyConfigRule" } ] }awscli-1.14.44/awscli/examples/cloudformation/0000777454262600001440000000000013243367512022354 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/cloudformation/validate-template.rst0000666454262600001440000000145513243367510026513 0ustar pysdk-ciamazon00000000000000**To validate an AWS CloudFormation template** The following ``validate-template`` command validates the ``sampletemplate.json`` template:: aws cloudformation validate-template --template-body file://sampletemplate.json Output:: { "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.", "Parameters": [], "Capabilities": [] } For more information, see `Working with AWS CloudFormation Templates`_ in the *AWS CloudFormation User Guide*. .. _`Working with AWS CloudFormation Templates`: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-guide.html awscli-1.14.44/awscli/examples/cloudformation/package.rst0000666454262600001440000000051713243367510024502 0ustar pysdk-ciamazon00000000000000Following 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 awscli-1.14.44/awscli/examples/cloudformation/list-stacks.rst0000666454262600001440000000151313243367510025345 0ustar pysdk-ciamazon00000000000000**To list AWS CloudFormation stacks** The following ``list-stacks`` command shows a summary of all stacks that have a status of ``CREATE_COMPLETE``:: aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE Output:: [ { "StackId": "arn:aws:cloudformation:us-east-1:123456789012:stack/myteststack/466df9e0-0dff-08e3-8e2f-5088487c4896", "TemplateDescription": "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.", "StackStatusReason": null, "CreationTime": "2013-08-26T03:27:10.190Z", "StackName": "myteststack", "StackStatus": "CREATE_COMPLETE" } ]awscli-1.14.44/awscli/examples/cloudformation/_package_description.rst0000666454262600001440000000457513243367510027254 0ustar pysdk-ciamazon00000000000000Packages 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 specified by following properties of a resource: - ``BodyS3Location`` property for the ``AWS::ApiGateway::RestApi`` resource - ``Code`` property for the ``AWS::Lambda::Function`` resource - ``CodeUri`` property for the ``AWS::Serverless::Function`` resource - ``DefinitionUri`` property for the ``AWS::Serverless::Api`` resource - ``SourceBundle`` property for the ``AWS::ElasticBeanstalk::ApplicationVersion`` resource - ``TemplateURL`` property for the ``AWS::CloudFormation::Stack`` 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. awscli-1.14.44/awscli/examples/cloudformation/deploy.rst0000666454262600001440000000042713243367510024403 0ustar pysdk-ciamazon00000000000000Following 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 awscli-1.14.44/awscli/examples/cloudformation/update-stack.rst0000666454262600001440000000236213243367510025474 0ustar pysdk-ciamazon00000000000000**To update AWS CloudFormation stacks** The following ``update-stack`` command updates the template and input parameters for the ``mystack`` stack:: aws cloudformation update-stack --stack-name mystack --template-url https://s3.amazonaws.com/sample/updated.template --parameters ParameterKey=KeyPairName,ParameterValue=SampleKeyPair ParameterKey=SubnetIDs,ParameterValue=SampleSubnetID1\\,SampleSubnetID2 The following ``update-stack`` command updates just the ``SubnetIDs`` parameter value for the ``mystack`` stack. If you don't specify a parameter value, the default value that is specified in the template is used:: aws cloudformation update-stack --stack-name mystack --template-url https://s3.amazonaws.com/sample/updated.template --parameters ParameterKey=KeyPairName,UsePreviousValue=true ParameterKey=SubnetIDs,ParameterValue=SampleSubnetID1\\,UpdatedSampleSubnetID2 The following ``update-stack`` command adds two stack notification topics to the ``mystack`` stack:: aws cloudformation update-stack --stack-name mystack --use-previous-template --notification-arns "arn:aws:sns:use-east-1:123456789012:mytopic1" "arn:aws:sns:us-east-1:123456789012:mytopic2" For more information, see `Updating a Stack`_ in the *AWS CloudFormation User Guide*. awscli-1.14.44/awscli/examples/cloudformation/_deploy_description.rst0000666454262600001440000000061013243367510027137 0ustar pysdk-ciamazon00000000000000Deploys 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. awscli-1.14.44/awscli/examples/cloudformation/get-template.rst0000666454262600001440000000206513243367510025477 0ustar pysdk-ciamazon00000000000000**To view the template body for an AWS CloudFormation stack** The following ``get-template`` command shows the template for the ``myteststack`` stack:: aws cloudformation get-template --stack-name myteststack Output:: { "TemplateBody": { "AWSTemplateFormatVersion": "2010-09-09", "Outputs": { "BucketName": { "Description": "Name of S3 bucket to hold website content", "Value": { "Ref": "S3Bucket" } } }, "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.", "Resources": { "S3Bucket": { "Type": "AWS::S3::Bucket", "Properties": { "AccessControl": "PublicRead" } } } } }awscli-1.14.44/awscli/examples/cloudformation/cancel-update-stack.rst0000666454262600001440000000033113243367510026711 0ustar pysdk-ciamazon00000000000000**To cancel a stack update that is in progress** The following ``cancel-update-stack`` command cancels a stack update on the ``myteststack`` stack:: aws cloudformation cancel-update-stack --stack-name myteststack awscli-1.14.44/awscli/examples/cloudformation/describe-stacks.rst0000666454262600001440000000263313243367510026156 0ustar pysdk-ciamazon00000000000000**To describe AWS CloudFormation stacks** The following ``describe-stacks`` command shows summary information for the ``myteststack`` stack:: aws cloudformation describe-stacks --stack-name myteststack Output:: { "Stacks": [ { "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 } ] For more information, see `Stacks`_ in the *AWS CloudFormation User Guide*. .. _`Stacks`: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/concept-stack.html awscli-1.14.44/awscli/examples/cloudformation/create-stack.rst0000666454262600001440000000130613243367510025452 0ustar pysdk-ciamazon00000000000000**To create an AWS CloudFormation stack** 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://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" } For more information, see `Stacks`_ in the *AWS CloudFormation User Guide*. .. _`Stacks`: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/concept-stack.html awscli-1.14.44/awscli/examples/application-autoscaling/0000777454262600001440000000000013243367512024141 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/application-autoscaling/deregister-scalable-target.rst0000666454262600001440000000052613243367510032061 0ustar pysdk-ciamazon00000000000000**To deregister a scalable target** This example deregisters a scalable target for an Amazon ECS service called `web-app` that is running in the `default` cluster. Command:: aws application-autoscaling deregister-scalable-target --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --resource-id service/default/web-app awscli-1.14.44/awscli/examples/application-autoscaling/register-scalable-target.rst0000666454262600001440000000155513243367510031553 0ustar pysdk-ciamazon00000000000000**To register a new scalable target** 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. Command:: 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 Output:: { "cluster": { "status": "ACTIVE", "clusterName": "my_cluster", "registeredContainerInstancesCount": 0, "pendingTasksCount": 0, "runningTasksCount": 0, "activeServicesCount": 0, "clusterArn": "arn:aws:ecs:::cluster/my_cluster" } } awscli-1.14.44/awscli/examples/application-autoscaling/describe-scaling-policies.rst0000666454262600001440000000474013243367510031701 0ustar pysdk-ciamazon00000000000000**To describe scaling policies** This example command describes the scaling policies for the `ecs` service namespace. Command:: aws application-autoscaling describe-scaling-policies --service-namespace ecs Output:: { "ScalingPolicies": [ { "PolicyName": "web-app-cpu-gt-75", "ScalableDimension": "ecs:service:DesiredCount", "ResourceId": "service/default/web-app", "CreationTime": 1462561899.23, "StepScalingPolicyConfiguration": { "Cooldown": 60, "StepAdjustments": [ { "ScalingAdjustment": 200, "MetricIntervalLowerBound": 0.0 } ], "AdjustmentType": "PercentChangeInCapacity" }, "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", "PolicyType": "StepScaling", "Alarms": [ { "AlarmName": "web-app-cpu-gt-75", "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:web-app-cpu-gt-75" } ], "ServiceNamespace": "ecs" }, { "PolicyName": "web-app-cpu-lt-25", "ScalableDimension": "ecs:service:DesiredCount", "ResourceId": "service/default/web-app", "CreationTime": 1462562575.099, "StepScalingPolicyConfiguration": { "Cooldown": 1, "StepAdjustments": [ { "ScalingAdjustment": -50, "MetricIntervalUpperBound": 0.0 } ], "AdjustmentType": "PercentChangeInCapacity" }, "PolicyARN": "arn:aws:autoscaling:us-west-2:012345678910:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/web-app-cpu-lt-25", "PolicyType": "StepScaling", "Alarms": [ { "AlarmName": "web-app-cpu-lt-25", "AlarmARN": "arn:aws:cloudwatch:us-west-2:012345678910:alarm:web-app-cpu-lt-25" } ], "ServiceNamespace": "ecs" } ] } awscli-1.14.44/awscli/examples/application-autoscaling/delete-scaling-policy.rst0000666454262600001440000000053113243367510031045 0ustar pysdk-ciamazon00000000000000**To delete a scaling policy** This example deletes a scaling policy for the Amazon ECS service `web-app` running in the `default` cluster. Command:: aws application-autoscaling delete-scaling-policy --policy-name web-app-cpu-lt-25 --scalable-dimension ecs:service:DesiredCount --resource-id service/default/web-app --service-namespace ecs awscli-1.14.44/awscli/examples/application-autoscaling/put-scaling-policy.rst0000666454262600001440000000211713243367510030415 0ustar pysdk-ciamazon00000000000000**To apply a scaling policy to an Amazon ECS service** 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. Command:: aws application-autoscaling put-scaling-policy --cli-input-json file://scale-out.json 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 } } 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" } awscli-1.14.44/awscli/examples/application-autoscaling/describe-scalable-targets.rst0000666454262600001440000000117213243367510031665 0ustar pysdk-ciamazon00000000000000**To describe scalable targets** This example command describes the scalable targets for the `ecs` service namespace. Command:: 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 } ] } awscli-1.14.44/awscli/examples/application-autoscaling/describe-scaling-activities.rst0000666454262600001440000000175313243367510032237 0ustar pysdk-ciamazon00000000000000**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. Command:: 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" } ] }awscli-1.14.44/awscli/examples/importexport/0000777454262600001440000000000013243367512022103 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/importexport/get-status.rst0000666454262600001440000000227213243367510024736 0ustar pysdk-ciamazon00000000000000The following command returns the status the specified job:: aws importexport get-status --job-id EX1ID The output for the get-status command looks like the following:: 2015-05-27T18:58:21Z manifestVersion:2.0 generator:Text editor bucket:myBucket deviceId:49382 eraseDevice:yes notificationEmail:john.doe@example.com;jane.roe@example.com trueCryptPassword:password123 acl:private serviceLevel:standard returnAddress: name: Jane Roe company: Example Corp. street1: 123 Any Street street2: street3: city: Anytown stateOrProvince: WA postalCode: 91011-1111 country:USA phoneNumber:206-555-1111 0 EX1ID Import NotReceived AWS has not received your device. Pending The specified job has not started. ktKDXpdbEXAMPLEyGFJmQO744UHw= version:2.0 signingMethod:HmacSHA1 jobId:EX1ID signature:ktKDXpdbEXAMPLEyGFJmQO744UHw= When you ship your device, it will be delivered to a sorting facility, and then forwarded on to an AWS data center. Note that when you send a get-status command, the status of your job will not show as ``At AWS`` until the shipment has been received at the AWS data center. awscli-1.14.44/awscli/examples/importexport/create-job.rst0000666454262600001440000000300313243367510024642 0ustar pysdk-ciamazon00000000000000The following command creates an import job from a manifest file:: aws importexport create-job --job-type import --manifest file://manifest --no-validate-only The file ``manifest`` is a YAML formatted text file in the current directory with the following content:: manifestVersion: 2.0; returnAddress: name: Jane Roe company: Example Corp. street1: 123 Any Street city: Anytown stateOrProvince: WA postalCode: 91011-1111 phoneNumber: 206-555-1111 country: USA deviceId: 49382 eraseDevice: yes notificationEmail: john.doe@example.com;jane.roe@example.com bucket: myBucket For more information on the manifest file format, see `Creating Import Manifests`_ in the *AWS Import/Export Developer Guide*. .. _`Creating Import Manifests`: http://docs.aws.amazon.com/AWSImportExport/latest/DG/ImportManifestFile.html You can also pass the manifest as a string in quotes:: aws importexport create-job --job-type import --manifest 'manifestVersion: 2.0; returnAddress: name: Jane Roe company: Example Corp. street1: 123 Any Street city: Anytown stateOrProvince: WA postalCode: 91011-1111 phoneNumber: 206-555-1111 country: USA deviceId: 49382 eraseDevice: yes notificationEmail: john.doe@example.com;jane.roe@example.com bucket: myBucket' For information on quoting string arguments and using files, see `Specifying Parameter Values`_ in the *AWS CLI User Guide*. .. _`Specifying Parameter Values`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html awscli-1.14.44/awscli/examples/importexport/get-shipping-label.rst0000666454262600001440000000165013243367510026310 0ustar pysdk-ciamazon00000000000000The following command creates a pre-paid shipping label for the specified job:: aws importexport get-shipping-label --job-ids EX1ID --name "Jane Roe" --company "Example Corp." --phone-number "206-555-1111" --country "USA" --state-or-province "WA" --city "Anytown" --postal-code "91011-1111" --street-1 "123 Any Street" The output for the get-shipping-label command looks like the following:: https://s3.amazonaws.com/myBucket/shipping-label-EX1ID.pdf The link in the output contains the pre-paid shipping label generated in a PDF. It also contains shipping instructions with a unique bar code to identify and authenticate your device. For more information about using the pre-paid shipping label and shipping your device, see `Shipping Your Storage Device`_ in the *AWS Import/Export Developer Guide*. .. _`Shipping Your Storage Device`: http://docs.aws.amazon.com/AWSImportExport/latest/DG/CHAP_ShippingYourStorageDevice.html awscli-1.14.44/awscli/examples/importexport/update-job.rst0000666454262600001440000000074213243367510024670 0ustar pysdk-ciamazon00000000000000The following command updates the specified job:: aws importexport update-job --job-id EX1ID --job-type import --manifest file://manifest.txt --no-validate-only The output for the update-jobs command looks like the following:: True **** Device will be erased before being returned. **** With this command, you can either modify the original manifest you submitted, or you can start over and create a new manifest file. In either case, the original manifest is discarded. awscli-1.14.44/awscli/examples/importexport/cancel-job.rst0000666454262600001440000000035513243367510024633 0ustar pysdk-ciamazon00000000000000The following command cancels the specified job:: aws importexport cancel-job --job-id EX1ID Only jobs that were created by the AWS account you're currently using can be canceled. Jobs that have already completed cannot be canceled. awscli-1.14.44/awscli/examples/importexport/list-jobs.rst0000666454262600001440000000063013243367510024540 0ustar pysdk-ciamazon00000000000000The following command lists the jobs you've created:: aws importexport list-jobs The output for the list-jobs command looks like the following:: JOBS 2015-05-27T18:58:21Z False EX1ID Import You can only list jobs created by users under the AWS account you are currently using. Listing jobs returns useful information, like job IDs, which are necessary for other AWS Import/Export commands. awscli-1.14.44/awscli/examples/configure/0000777454262600001440000000000013243367512021310 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/configure/get/0000777454262600001440000000000013243367512022067 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/configure/get/_examples.rst0000666454262600001440000000144713243367510024602 0ustar pysdk-ciamazon00000000000000Suppose you had the following config file:: [default] aws_access_key_id=default_access_key aws_secret_access_key=default_secret_key [preview] cloudsearch=true [profile testing] aws_access_key_id=testing_access_key aws_secret_access_key=testing_secret_key region=us-west-2 The following commands would have the corresponding output:: $ aws configure get aws_access_key_id default_access_key $ aws configure get default.aws_access_key_id default_access_key $ aws configure get aws_access_key_id --profile testing testing_access_key $ aws configure get profile.testing.aws_access_key_id testing_access_key $ aws configure get preview.cloudsearch true $ aws configure get preview.does-not-exist $ $ echo $? 1 awscli-1.14.44/awscli/examples/configure/get/_description.rst0000666454262600001440000000362013243367510025302 0ustar pysdk-ciamazon00000000000000Get a configuration value from the config file. The ``aws configure get`` command can be used to print a configuration value in the AWS config file. The ``get`` command supports two types of configuration values, *unqualified* and *qualified* config values. Note that ``aws configure get`` only looks at values in the AWS configuration file. It does **not** resolve configuration variables specified anywhere else, including environment variables, command line arguments, etc. Unqualified Names ----------------- Every value in the AWS configuration file must be placed in a section (denoted by ``[section-name]`` in the config file). To retrieve a value from the config file, the section name and the config name must be known. An unqualified configuration name refers to a name that is not scoped to a specific section in the configuration file. Sections are specified by separating parts with the ``"."`` character (``section.config-name``). An unqualified name will be scoped to the current profile. For example, ``aws configure get aws_access_key_id`` will retrieve the ``aws_access_key_id`` from the current profile, or the ``default`` profile if no profile is specified. You can still provide a ``--profile`` argument to the ``aws configure get`` command. For example, ``aws configure get region --profile testing`` will print the region value for the ``testing`` profile. Qualified Names --------------- A qualified name is a name that has at least one ``"."`` character in the name. This name provides a way to specify the config section from which to retrieve the config variable. When a qualified name is provided to ``aws configure get``, the currently specified profile is ignored. Section names that have the format ``[profile profile-name]`` can be specified by using the ``profile.profile-name.config-name`` syntax, and the default profile can be specified using the ``default.config-name`` syntax. awscli-1.14.44/awscli/examples/configure/set/0000777454262600001440000000000013243367512022103 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/configure/set/_examples.rst0000666454262600001440000000154013243367510024610 0ustar pysdk-ciamazon00000000000000Given an empty config file, the following commands:: $ aws configure set aws_access_key_id default_access_key $ aws configure set aws_secret_access_key default_secret_key $ aws configure set default.region us-west-2 $ aws configure set default.ca_bundle /path/to/ca-bundle.pem $ aws configure set region us-west-1 --profile testing $ aws configure set profile.testing2.region eu-west-1 $ aws configure set preview.cloudsearch true will produce the following config file:: [default] region = us-west-2 ca_bundle = /path/to/ca-bundle.pem [profile testing] region = us-west-1 [profile testing2] region = eu-west-1 [preview] cloudsearch = true and the following ``~/.aws/credentials`` file:: [default] aws_access_key_id = default_access_key aws_secret_access_key = default_secret_key awscli-1.14.44/awscli/examples/configure/set/_description.rst0000666454262600001440000000160013243367510025312 0ustar pysdk-ciamazon00000000000000Set a configuration value from the config file. The ``aws configure set`` command can be used to set a single configuration value in the AWS config file. The ``set`` command supports both the *qualified* and *unqualified* config values documented in the ``get`` command (see ``aws configure get help`` for more information). To set a single value, provide the configuration name followed by the configuration value. If the config file does not exist, one will automatically be created. If the configuration value already exists in the config file, it will updated with the new configuration value. Setting a value for the ``aws_access_key_id``, ``aws_secret_access_key``, or the ``aws_session_token`` will result in the value being writen to the shared credentials file (``~/.aws/credentials``). All other values will be written to the config file (default location is ``~/.aws/config``). awscli-1.14.44/awscli/examples/configure/add-model.rst0000666454262600001440000000066213243367510023672 0ustar pysdk-ciamazon00000000000000**Add a model** The following command adds a service model from a file named ``service.json``:: aws configure add-model --service-model file://service.json Adding a model replaces existing commands for the service defined in the model. To leave existing commands as-is, specify a different service name to use for the new commands:: aws configure add-model --service-model file://service.json --service-name service2 awscli-1.14.44/awscli/examples/configure/_description.rst0000666454262600001440000000375313243367510024532 0ustar pysdk-ciamazon00000000000000Configure AWS CLI options. If this command is run with no arguments, you will be prompted for configuration values such as your AWS Access Key Id and you AWS Secret Access Key. You can configure a named profile using the ``--profile`` argument. If your config file does not exist (the default location is ``~/.aws/config``), the AWS CLI will create it for you. To keep an existing value, hit enter when prompted for the value. When you are prompted for information, the current value will be displayed in ``[brackets]``. If the config item has no value, it be displayed as ``[None]``. Note that the ``configure`` command only work with values from the config file. It does not use any configuration values from environment variables or the IAM role. Note: the values you provide for the AWS Access Key ID and the AWS Secret Access Key will be written to the shared credentials file (``~/.aws/credentials``). ======================= Configuration Variables ======================= The following configuration variables are supported in the config file: * **aws_access_key_id** - The AWS access key part of your credentials * **aws_secret_access_key** - The AWS secret access key part of your credentials * **aws_session_token** - The session token part of your credentials (session tokens only) * **metadata_service_timeout** - The number of seconds to wait until the metadata service request times out. This is used if you are using an IAM role to provide your credentials. * **metadata_service_num_attempts** - The number of attempts to try to retrieve credentials. If you know for certain you will be using an IAM role on an Amazon EC2 instance, you can set this value to ensure any intermittent failures are retried. By default this value is 1. For more information on configuration options, see `Configuring the AWS Command Line Interface`_ in the *AWS CLI User Guide*. .. _`Configuring the AWS Command Line Interface`: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.htmlawscli-1.14.44/awscli/examples/rds/0000777454262600001440000000000013243367512020117 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/rds/create-db-instance.rst0000666454262600001440000000375413243367510024310 0ustar pysdk-ciamazon00000000000000**To create an Amazon RDS DB instance** The following ``create-db-instance`` command launches a new Amazon RDS DB instance:: aws rds create-db-instance --db-instance-identifier sg-cli-test \ --allocated-storage 20 --db-instance-class db.m1.small --engine mysql \ --master-username myawsuser --master-user-password myawsuser In the preceding example, the DB instance is created with 20 Gb of standard storage and has a DB engine class of db.m1.small. The master username and master password are provided. This command outputs a JSON block that indicates that the DB instance was created:: { "DBInstance": { "Engine": "mysql", "MultiAZ": false, "DBSecurityGroups": [ { "Status": "active", "DBSecurityGroupName": "default" } ], "DBInstanceStatus": "creating", "DBParameterGroups": [ { "DBParameterGroupName": "default.mysql5.6", "ParameterApplyStatus": "in-sync" } ], "MasterUsername": "myawsuser", "LicenseModel": "general-public-license", "OptionGroupMemberships": [ { "Status": "in-sync", "OptionGroupName": "default:mysql-5-6" } ], "AutoMinorVersionUpgrade": true, "PreferredBackupWindow": "11:58-12:28", "VpcSecurityGroups": [], "PubliclyAccessible": true, "PreferredMaintenanceWindow": "sat:13:10-sat:13:40", "AllocatedStorage": 20, "EngineVersion": "5.6.13", "DBInstanceClass": "db.m1.small", "ReadReplicaDBInstanceIdentifiers": [], "BackupRetentionPeriod": 1, "DBInstanceIdentifier": "sg-cli-test", "PendingModifiedValues": { "MasterUserPassword": "****" } } } awscli-1.14.44/awscli/examples/rds/describe-db-instances.rst0000666454262600001440000000505313243367510025002 0ustar pysdk-ciamazon00000000000000**To describe Amazon RDS DB instances** The following ``describe-db-instances`` command lists all of the DB instances for an AWS account:: aws rds describe-db-instances This command outputs a JSON block that lists the DB instances:: { "DBInstances": [ { "PubliclyAccessible": false, "MasterUsername": "mymasteruser", "MonitoringInterval": 0, "LicenseModel": "general-public-license", "VpcSecurityGroups": [ { "Status": "active", "VpcSecurityGroupId": "sg-1203dc23" } ], "InstanceCreateTime": "2016-06-13T20:09:43.836Z", "CopyTagsToSnapshot": false, "OptionGroupMemberships": [ { "Status": "in-sync", "OptionGroupName": "default:mysql-5-6" } ], "PendingModifiedValues": {}, "Engine": "mysql", "MultiAZ": false, "LatestRestorableTime": "2016-06-13T21:00:00Z", "DBSecurityGroups": [], "DBParameterGroups": [ { "DBParameterGroupName": "default.mysql5.6", "ParameterApplyStatus": "in-sync" } ], "AutoMinorVersionUpgrade": true, "PreferredBackupWindow": "08:03-08:33", "DBSubnetGroup": { "Subnets": [ { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-6a88c933", "SubnetAvailabilityZone": { "Name": "us-east-1a" } }, { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-98302fa2", "SubnetAvailabilityZone": { "Name": "us-east-1e" } }, { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-159bf13e", "SubnetAvailabilityZone": { "Name": "us-east-1c" } }, { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-67466810", "SubnetAvailabilityZone": { "Name": "us-east-1d" } } ], "DBSubnetGroupName": "default", "VpcId": "vpc-a2b3aab6", "DBSubnetGroupDescription": "default", "SubnetGroupStatus": "Complete" }, "ReadReplicaDBInstanceIdentifiers": [], "AllocatedStorage": 50, "BackupRetentionPeriod": 7, "DBName": "sample", "PreferredMaintenanceWindow": "sat:04:35-sat:05:05", "Endpoint": { "Port": 3306, "Address": "mydbinstance-1.ctrzran0rynq.us-east-1.rds.amazonaws.com" }, "DBInstanceStatus": "stopped", "EngineVersion": "5.6.27", "AvailabilityZone": "us-east-1e", "DomainMemberships": [], "StorageType": "standard", "DbiResourceId": "db-B3COT4JG5UC4IACGJ72IGR34RM", "CACertificateIdentifier": "rds-ca-2015", "StorageEncrypted": false, "DBInstanceClass": "db.t2.micro", "DbInstancePort": 0, "DBInstanceIdentifier": "mydbinstance-1" } ] } awscli-1.14.44/awscli/examples/rds/download-db-log-file-portion.rst0000666454262600001440000000127013243367510026225 0ustar pysdk-ciamazon00000000000000**How to download your log file** By default, this command will only download the latest part of your log file:: aws rds download-db-log-file-portion --db-instance-identifier myinstance \ --log-file-name log.txt --output text > tail.txt In order to download the entire file, you need `--starting-token 0` parameter:: aws rds download-db-log-file-portion --db-instance-identifier myinstance \ --log-file-name log.txt --starting-token 0 --output text > full.txt Note that, the downloaded file may contain several extra blank lines. They appear at the end of each part of the log file while being downloaded. This will generally not cause any trouble in your log file analysis. awscli-1.14.44/awscli/examples/rds/create-db-security-group.rst0000666454262600001440000000126713243367510025502 0ustar pysdk-ciamazon00000000000000**To create an Amazon RDS DB security group** The following ``create-db-security-group`` command creates a new Amazon RDS DB security group:: aws rds create-db-security-group --db-security-group-name mysecgroup --db-security-group-description "My Test Security Group" In the example, the new DB security group is named ``mysecgroup`` and has a description. This command output a JSON block that contains information about the DB security group. For more information, see `Create an Amazon RDS DB Security Group`_ in the *AWS Command Line Interface User Guide*. .. _`Create an Amazon RDS DB Security Group`: http://docs.aws.amazon.com/cli/latest/userguide/cli-rds-create-secgroup.html awscli-1.14.44/awscli/examples/rds/add-tag-to-resource.rst0000666454262600001440000000141413243367510024415 0ustar pysdk-ciamazon00000000000000**To add a tag to an Amazon RDS resource** The following ``add-tags-to-resource`` command adds a tag to an Amazon RDS resource. In the example, a DB instance is identified by the instance's ARN, arn:aws:rds:us-west-2:001234567890:db:mysql-db1. The tag that is added to the DB instance has a key of ``project`` and a value of ``salix``:: aws rds add-tags-to-resource --resource-name arn:aws:rds:us-west-2:001234567890:db:mysql-db1 --tags account=sg01,project=salix This command outputs a JSON block that acknowledges the change to the RDS resource. For more information, see `Tagging an Amazon RDS DB Instance`_ in the *AWS Command Line Interface User Guide*. .. _`Tagging an Amazon RDS DB Instance`: http://docs.aws.amazon.com/cli/latest/userguide/cli-rds-add-tags.html awscli-1.14.44/awscli/examples/rds/create-option-group.rst0000666454262600001440000000141213243367510024550 0ustar pysdk-ciamazon00000000000000**To Create an Amazon RDS option group** The following ``create-option-group`` command creates a new Amazon RDS option group:: aws rds create-option-group --option-group-name MyOptionGroup --engine-name oracle-ee --major-engine-version 11.2 --option-group-description "Oracle Database Manager Database Control" In the example, the option group is created for Oracle Enterprise Edition version *11.2*, is named *MyOptionGroup* and includes a description. This command output a JSON block that contains information on the option group. For more information, see `Create an Amazon RDS Option Group`_ in the *AWS Command Line Interface User Guide*. .. _`Create an Amazon RDS Option Group`: http://docs.aws.amazon.com/cli/latest/userguide/cli-rds-create-option-group.html awscli-1.14.44/awscli/examples/inspector/0000777454262600001440000000000013243367512021335 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/inspector/list-tags-for-resource.rst0000666454262600001440000000133113243367510026403 0ustar pysdk-ciamazon00000000000000**To list tags for resource** The following ``list-tags-for-resource`` command lists all tags associated with the assessment template with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-gcwFliYu``:: aws inspector list-tags-for-resource --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-gcwFliYu Output:: { "tags": [ { "key": "Name", "value": "Example" } ] } For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/list-assessment-targets.rst0000666454262600001440000000077513243367510026703 0ustar pysdk-ciamazon00000000000000**To list assessment targets** The following ``list-assessment-targets`` command lists all existing assessment targets:: aws inspector list-assessment-targets Output:: { "assessmentTargetArns": [ "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq" ] } For more information, see `Amazon Inspector Assessment Targets`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Targets`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html awscli-1.14.44/awscli/examples/inspector/describe-assessment-runs.rst0000666454262600001440000000406313243367510027020 0ustar pysdk-ciamazon00000000000000**To describe assessment runs** The following ``describe-assessment-run`` command describes an assessment run with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE``:: aws inspector describe-assessment-runs --assessment-run-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE Output:: { "assessmentRuns": [ { "arn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", "assessmentTemplateArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw", "completedAt": 1458680301.4, "createdAt": 1458680170.035, "dataCollected": true, "durationInSeconds": 3600, "name": "Run 1 for ExampleAssessmentTemplate", "notifications": [], "rulesPackageArns": [ "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP" ], "startedAt": 1458680170.161, "state": "COMPLETED", "stateChangedAt": 1458680301.4, "stateChanges": [ { "state": "CREATED", "stateChangedAt": 1458680170.035 }, { "state": "START_DATA_COLLECTION_PENDING", "stateChangedAt": 1458680170.065 }, { "state": "START_DATA_COLLECTION_IN_PROGRESS", "stateChangedAt": 1458680170.096 }, { "state": "COLLECTING_DATA", "stateChangedAt": 1458680170.161 }, { "state": "STOP_DATA_COLLECTION_PENDING", "stateChangedAt": 1458680239.883 }, { "state": "DATA_COLLECTED", "stateChangedAt": 1458680299.847 }, { "state": "EVALUATING_RULES", "stateChangedAt": 1458680300.099 }, { "state": "COMPLETED", "stateChangedAt": 1458680301.4 } ], "userAttributesForFindings": [] } ], "failedItems": {} } For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/list-assessment-run-agents.rst0000666454262600001440000000717513243367510027316 0ustar pysdk-ciamazon00000000000000**To list assessment run agents** The following ``list-assessment-run-agents`` command lists the agents of the assessment run with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE``:: aws inspector list-assessment-run-agents --assessment-run-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE Output:: { "assessmentRunAgents": [ { "agentHealth": "HEALTHY", "agentHealthCode": "HEALTHY", "agentId": "i-49113b93", "assessmentRunArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", "telemetryMetadata": [ { "count": 2, "dataSize": 345, "messageType": "InspectorDuplicateProcess" }, { "count": 3, "dataSize": 255, "messageType": "InspectorTimeEventMsg" }, { "count": 4, "dataSize": 1082, "messageType": "InspectorNetworkInterface" }, { "count": 2, "dataSize": 349, "messageType": "InspectorDnsEntry" }, { "count": 11, "dataSize": 2514, "messageType": "InspectorDirectoryInfoMsg" }, { "count": 1, "dataSize": 179, "messageType": "InspectorTcpV6ListeningPort" }, { "count": 101, "dataSize": 10949, "messageType": "InspectorTerminal" }, { "count": 26, "dataSize": 5916, "messageType": "InspectorUser" }, { "count": 282, "dataSize": 32148, "messageType": "InspectorDynamicallyLoadedCodeModule" }, { "count": 18, "dataSize": 10172, "messageType": "InspectorCreateProcess" }, { "count": 3, "dataSize": 8001, "messageType": "InspectorProcessPerformance" }, { "count": 1, "dataSize": 360, "messageType": "InspectorOperatingSystem" }, { "count": 6, "dataSize": 546, "messageType": "InspectorStopProcess" }, { "count": 1, "dataSize": 1553, "messageType": "InspectorInstanceMetaData" }, { "count": 2, "dataSize": 434, "messageType": "InspectorTcpV4Connection" }, { "count": 474, "dataSize": 2960322, "messageType": "InspectorPackageInfo" }, { "count": 3, "dataSize": 2235, "messageType": "InspectorSystemPerformance" }, { "count": 105, "dataSize": 46048, "messageType": "InspectorCodeModule" }, { "count": 1, "dataSize": 182, "messageType": "InspectorUdpV6ListeningPort" }, { "count": 2, "dataSize": 371, "messageType": "InspectorUdpV4ListeningPort" }, { "count": 18, "dataSize": 8362, "messageType": "InspectorKernelModule" }, { "count": 29, "dataSize": 48788, "messageType": "InspectorConfigurationInfo" }, { "count": 1, "dataSize": 79, "messageType": "InspectorMonitoringStart" }, { "count": 5, "dataSize": 0, "messageType": "InspectorSplitMsgBegin" }, { "count": 51, "dataSize": 4593, "messageType": "InspectorGroup" }, { "count": 1, "dataSize": 184, "messageType": "InspectorTcpV4ListeningPort" }, { "count": 1159, "dataSize": 3146579, "messageType": "Total" }, { "count": 5, "dataSize": 0, "messageType": "InspectorSplitMsgEnd" }, { "count": 1, "dataSize": 612, "messageType": "InspectorLoadImageInProcess" } ] } ] } For more information, see `AWS Agents`_ in the *Amazon Inspector* guide. .. _`AWS Agents`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_agents.html awscli-1.14.44/awscli/examples/inspector/describe-resource-groups.rst0000666454262600001440000000147113243367510027012 0ustar pysdk-ciamazon00000000000000**To describe resource groups** The following ``describe-resource-groups`` command describes the resource group with the ARN of ``arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI``:: aws inspector describe-resource-groups --resource-group-arns arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI Output:: { "failedItems": {}, "resourceGroups": [ { "arn": "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI", "createdAt": 1458074191.098, "tags": [ { "key": "Name", "value": "example" } ] } ] } For more information, see `Amazon Inspector Assessment Targets`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Targets`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html awscli-1.14.44/awscli/examples/inspector/delete-assessment-target.rst0000666454262600001440000000104713243367510027000 0ustar pysdk-ciamazon00000000000000**To delete an assessment target** The following ``delete-assessment-target`` command deletes the assessment target with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq``:: aws inspector delete-assessment-target --assessment-target-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq For more information, see `Amazon Inspector Assessment Targets`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Targets`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html awscli-1.14.44/awscli/examples/inspector/stop-assessment-run.rst0000666454262600001440000000120013243367510026030 0ustar pysdk-ciamazon00000000000000**To stop an assessment run** The following ``stop-assessment-run`` command stops the assessment run with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-jOoroxyY``:: aws inspector stop-assessment-run --assessment-run-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-jOoroxyY For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/list-rules-packages.rst0000666454262600001440000000132413243367510025744 0ustar pysdk-ciamazon00000000000000**To list rules packages** The following ``list-rules-packages`` command lists all available Inspector rules packages:: aws inspector list-rules-packages Output:: { "rulesPackageArns": [ "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p", "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc", "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ", "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD" ] } For more information, see `Amazon Inspector Rules Packages and Rules`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Rules Packages and Rules`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_rule-packages.html awscli-1.14.44/awscli/examples/inspector/describe-assessment-targets.rst0000666454262600001440000000161513243367510027502 0ustar pysdk-ciamazon00000000000000**To describe assessment targets** The following ``describe-assessment-targets`` command describes the assessment target with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq``:: aws inspector describe-assessment-targets --assessment-target-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq Output:: { "assessmentTargets": [ { "arn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", "createdAt": 1458074191.459, "name": "ExampleAssessmentTarget", "resourceGroupArn": "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI", "updatedAt": 1458074191.459 } ], "failedItems": {} } For more information, see `Amazon Inspector Assessment Targets`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Targets`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html awscli-1.14.44/awscli/examples/inspector/describe-findings.rst0000666454262600001440000000316113243367510025445 0ustar pysdk-ciamazon00000000000000**To describe findings** The following ``describe-findings`` command describes the finding with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4``:: aws inspector describe-findings --finding-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4 Output:: { "failedItems": {}, "findings": [ { "arn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4", "assetAttributes": { "ipv4Addresses": [], "schemaVersion": 1 }, "assetType": "ec2-instance", "attributes": [], "confidence": 10, "createdAt": 1458680301.37, "description": "Amazon Inspector did not find any potential security issues during this assessment.", "indicatorOfCompromise": false, "numericSeverity": 0, "recommendation": "No remediation needed.", "schemaVersion": 1, "service": "Inspector", "serviceAttributes": { "assessmentRunArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", "rulesPackageArn": "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP", "schemaVersion": 1 }, "severity": "Informational", "title": "No potential security issues found", "updatedAt": 1458680301.37, "userAttributes": [] } ] } For more information, see `Amazon Inspector Findings`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Findings`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_findings.html awscli-1.14.44/awscli/examples/inspector/start-assessment-run.rst0000666454262600001440000000150713243367510026212 0ustar pysdk-ciamazon00000000000000**To start an assessment run** The following ``start-assessment-run`` command starts the assessment run named ``examplerun`` using the assessment template with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T``:: aws inspector start-assessment-run --assessment-run-name examplerun --assessment-template-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T Output:: { "assessmentRunArn": "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-jOoroxyY" } For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/update-assessment-target.rst0000666454262600001440000000145013243367510027016 0ustar pysdk-ciamazon00000000000000**To update an assessment target** The following ``update-assessment-target`` command updates the assessment target with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX`` and the name of ``Example``, and the resource group with the ARN of ``arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt``:: aws inspector update-assessment-target --assessment-target-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX --assessment-target-name Example --resource-group-arn arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt For more information, see `Amazon Inspector Assessment Targets`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Targets`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html awscli-1.14.44/awscli/examples/inspector/set-tags-for-resource.rst0000666454262600001440000000130613243367510026225 0ustar pysdk-ciamazon00000000000000**To set tags for a resource** The following ``set-tags-for-resource`` command sets the tag with the key of ``Example`` and value of ``example`` to the assessment template with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0``:: aws inspector set-tags-for-resource --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0 --tags key=Example,value=example For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/delete-assessment-run.rst0000666454262600001440000000121013243367510026306 0ustar pysdk-ciamazon00000000000000**To delete an assessment run** The following ``delete-assessment-run`` command deletes the assessment run with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe``:: aws inspector delete-assessment-run --assessment-run-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/delete-assessment-template.rst0000666454262600001440000000120313243367510027317 0ustar pysdk-ciamazon00000000000000**To delete an assessment template** The following ``delete-assessment-template`` command deletes the assessment template with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T``:: aws inspector delete-assessment-template --assessment-template-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/describe-cross-account-access-role.rst0000666454262600001440000000107713243367510030631 0ustar pysdk-ciamazon00000000000000**To describe the cross account access role** The following ``describe-cross-account-access-role`` command describes the IAM role that enables Amazon Inspector to access your AWS account:: aws inspector describe-cross-account-access-role Output:: { "registeredAt": 1458069182.826, "roleArn": "arn:aws:iam::123456789012:role/inspector", "valid": true } For more information, see `Setting up Amazon Inspector`_ in the *Amazon Inspector* guide. .. _`Setting up Amazon Inspector`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_settingup.html awscli-1.14.44/awscli/examples/inspector/subscribe-to-event.rst0000666454262600001440000000135413243367510025610 0ustar pysdk-ciamazon00000000000000**To subscribe to an event** The following ``subscribe-to-event`` command enables the process of sending Amazon SNS notifications about the ``ASSESSMENT_RUN_COMPLETED`` event to the topic with the ARN of ``arn:aws:sns:us-west-2:123456789012:exampletopic``:: aws inspector subscribe-to-event --event ASSESSMENT_RUN_COMPLETED --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0 --topic arn:aws:sns:us-west-2:123456789012:exampletopic For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/create-assessment-template.rst0000666454262600001440000000177513243367510027336 0ustar pysdk-ciamazon00000000000000**To create an assessment template** The following ``create-assessment-template`` command creates an assessment template called ``ExampleAssessmentTemplate`` for the assessment target with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX``:: aws inspector create-assessment-template --assessment-target-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX --assessment-template-name ExampleAssessmentTemplate --duration-in-seconds 180 --rules-package-arns arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p --user-attributes-for-findings key=ExampleTag,value=examplevalue Output:: { "assessmentTemplateArn": "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T" } For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/list-assessment-runs.rst0000666454262600001440000000123113243367510026205 0ustar pysdk-ciamazon00000000000000**To list assessment runs** The following ``list-assessment-runs`` command lists all existing assessment runs:: aws inspector list-assessment-runs Output:: { "assessmentRunArns": [ "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-v5D6fI3v" ] } For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/describe-assessment-templates.rst0000666454262600001440000000220613243367510030024 0ustar pysdk-ciamazon00000000000000**To describe assessment templates** The following ``describe-assessment-templates`` command describes the assessment template with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw``:: aws inspector describe-assessment-templates --assessment-template-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw Output:: { "assessmentTemplates": [ { "arn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw", "assessmentTargetArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", "createdAt": 1458074191.844, "durationInSeconds": 3600, "name": "ExampleAssessmentTemplate", "rulesPackageArns": [ "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP" ], "userAttributesForFindings": [] } ], "failedItems": {} } For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/list-findings.rst0000666454262600001440000000115313243367510024637 0ustar pysdk-ciamazon00000000000000**To list findings** The following ``list-findings`` command lists all of the generated findings:: aws inspector list-findings Output:: { "findingArns": [ "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4", "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-v5D6fI3v/finding/0-tyvmqBLy" ] } For more information, see `Amazon Inspector Findings`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Findings`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_findings.html awscli-1.14.44/awscli/examples/inspector/get-telemetry-metadata.rst0000666454262600001440000000572213243367510026440 0ustar pysdk-ciamazon00000000000000**To get the telemetry metadata** The following ``get-telemetry-metadata`` command generates information about the data that is collected for the assessment run with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE``:: aws inspector get-telemetry-metadata --assessment-run-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE Output:: { "telemetryMetadata": [ { "count": 2, "dataSize": 345, "messageType": "InspectorDuplicateProcess" }, { "count": 3, "dataSize": 255, "messageType": "InspectorTimeEventMsg" }, { "count": 4, "dataSize": 1082, "messageType": "InspectorNetworkInterface" }, { "count": 2, "dataSize": 349, "messageType": "InspectorDnsEntry" }, { "count": 11, "dataSize": 2514, "messageType": "InspectorDirectoryInfoMsg" }, { "count": 1, "dataSize": 179, "messageType": "InspectorTcpV6ListeningPort" }, { "count": 101, "dataSize": 10949, "messageType": "InspectorTerminal" }, { "count": 26, "dataSize": 5916, "messageType": "InspectorUser" }, { "count": 282, "dataSize": 32148, "messageType": "InspectorDynamicallyLoadedCodeModule" }, { "count": 18, "dataSize": 10172, "messageType": "InspectorCreateProcess" }, { "count": 3, "dataSize": 8001, "messageType": "InspectorProcessPerformance" }, { "count": 1, "dataSize": 360, "messageType": "InspectorOperatingSystem" }, { "count": 6, "dataSize": 546, "messageType": "InspectorStopProcess" }, { "count": 1, "dataSize": 1553, "messageType": "InspectorInstanceMetaData" }, { "count": 2, "dataSize": 434, "messageType": "InspectorTcpV4Connection" }, { "count": 474, "dataSize": 2960322, "messageType": "InspectorPackageInfo" }, { "count": 3, "dataSize": 2235, "messageType": "InspectorSystemPerformance" }, { "count": 105, "dataSize": 46048, "messageType": "InspectorCodeModule" }, { "count": 1, "dataSize": 182, "messageType": "InspectorUdpV6ListeningPort" }, { "count": 2, "dataSize": 371, "messageType": "InspectorUdpV4ListeningPort" }, { "count": 18, "dataSize": 8362, "messageType": "InspectorKernelModule" }, { "count": 29, "dataSize": 48788, "messageType": "InspectorConfigurationInfo" }, { "count": 1, "dataSize": 79, "messageType": "InspectorMonitoringStart" }, { "count": 5, "dataSize": 0, "messageType": "InspectorSplitMsgBegin" }, { "count": 51, "dataSize": 4593, "messageType": "InspectorGroup" }, { "count": 1, "dataSize": 184, "messageType": "InspectorTcpV4ListeningPort" }, { "count": 1159, "dataSize": 3146579, "messageType": "Total" }, { "count": 5, "dataSize": 0, "messageType": "InspectorSplitMsgEnd" }, { "count": 1, "dataSize": 612, "messageType": "InspectorLoadImageInProcess" } ] } awscli-1.14.44/awscli/examples/inspector/create-assessment-target.rst0000666454262600001440000000141113243367510026774 0ustar pysdk-ciamazon00000000000000**To create an assessment target** The following ``create-assessment-target`` command creates an assessment target named ``ExampleAssessmentTarget`` using the resource group with the ARN of ``arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv``:: aws inspector create-assessment-target --assessment-target-name ExampleAssessmentTarget --resource-group-arn arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv Output:: { "assessmentTargetArn": "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX" } For more information, see `Amazon Inspector Assessment Targets`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Targets`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html awscli-1.14.44/awscli/examples/inspector/register-cross-account-access-role.rst0000666454262600001440000000120013243367510030661 0ustar pysdk-ciamazon00000000000000**To register the cross account access role** The following ``register-cross-account-access-role`` command registers the IAM role with the ARN of ``arn:aws:iam::123456789012:role/inspector`` that Amazon Inspector uses to list your EC2 instances at the start of the assessment run of when you call the preview-agents command:: aws inspector register-cross-account-access-role --role-arn arn:aws:iam::123456789012:role/inspector For more information, see `Setting up Amazon Inspector`_ in the *Amazon Inspector* guide. .. _`Setting up Amazon Inspector`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_settingup.html awscli-1.14.44/awscli/examples/inspector/preview-agents.rst0000666454262600001440000000121413243367510025023 0ustar pysdk-ciamazon00000000000000**To preview agents** The following ``preview-agents`` command previews the agents installed on the EC2 instances that are part of the assessment target with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq``:: aws inspector preview-agents --preview-agents-arn arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq Output:: { "agentPreviews": [ { "agentId": "i-49113b93" } ] } For more information, see `Amazon Inspector Assessment Targets`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Targets`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html awscli-1.14.44/awscli/examples/inspector/describe-rules-packages.rst0000666454262600001440000000315613243367510026556 0ustar pysdk-ciamazon00000000000000**To describe rules packages** The following ``describe-rules-packages`` command describes the rules package with the ARN of ``arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p``:: aws inspector describe-rules-packages --rules-package-arns arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p Output:: { "failedItems": {}, "rulesPackages": [ { "arn": "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p", "description": "The rules in this package help verify whether the EC2 instances in your application are exposed to Common Vulnerabilities and Exposures (CVEs). Attacks can exploit unpatched vulnerabilities to compromise the confidentiality, integrity, or availability of your service or data. The CVE system provides a reference for publicly known information security vulnerabilities and exposures. For more information, see [https://cve.mitre.org/](https://cve.mitre.org/). If a particular CVE appears in one of the produced Findings at the end of a completed Inspector assessment, you can search [https://cve.mitre.org/](https://cve.mitre.org/) using the CVE's ID (for example, \"CVE-2009-0021\") to find detailed information about this CVE, its severity, and how to mitigate it. ", "name": "Common Vulnerabilities and Exposures", "provider": "Amazon Web Services, Inc.", "version": "1.1" } ] } For more information, see `Amazon Inspector Rules Packages and Rules`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Rules Packages and Rules`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_rule-packages.html awscli-1.14.44/awscli/examples/inspector/unsubscribe-from-event.rst0000666454262600001440000000137113243367510026473 0ustar pysdk-ciamazon00000000000000**To unsubscribe from an event** The following ``unsubscribe-from-event`` command disables the process of sending Amazon SNS notifications about the ``ASSESSMENT_RUN_COMPLETED`` event to the topic with the ARN of ``arn:aws:sns:us-west-2:123456789012:exampletopic``:: aws inspector unsubscribe-from-event --event ASSESSMENT_RUN_COMPLETED --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0 --topic arn:aws:sns:us-west-2:123456789012:exampletopic For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/create-resource-group.rst0000666454262600001440000000111113243367510026301 0ustar pysdk-ciamazon00000000000000**To create a resource group** The following ``create-resource-group`` command creates a resource group using the tag key of ``Name`` and value of ``example``:: aws inspector create-resource-group --resource-group-tags key=Name,value=example Output:: { "resourceGroupArn": "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv" } For more information, see `Amazon Inspector Assessment Targets`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Targets`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html awscli-1.14.44/awscli/examples/inspector/remove-attributes-from-findings.rst0000666454262600001440000000142113243367510030304 0ustar pysdk-ciamazon00000000000000**To remove attributes from findings** The following ``remove-attributes-from-finding`` command removes the attribute with the key of ``Example`` and value of ``example`` from the finding with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU``:: aws inspector remove-attributes-from-findings --finding-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU --attribute-keys key=Example,value=example Output:: { "failedItems": {} } For more information, see `Amazon Inspector Findings`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Findings`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_findings.html awscli-1.14.44/awscli/examples/inspector/list-assessment-templates.rst0000666454262600001440000000123313243367510027216 0ustar pysdk-ciamazon00000000000000**To list assessment templates** The following ``list-assessment-templates`` command lists all existing assessment templates:: aws inspector list-assessment-templates Output:: { "assessmentTemplateArns": [ "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw", "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-Uza6ihLh" ] } For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/inspector/add-attributes-to-findings.rst0000666454262600001440000000137613243367510027227 0ustar pysdk-ciamazon00000000000000**To add attributes to findings** The following ``add-attribute-to-finding`` command assigns an attribute with the key of ``Example`` and value of ``example`` to the finding with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU``:: aws inspector add-attributes-to-findings --finding-arns arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU --attributes key=Example,value=example Output:: { "failedItems": {} } For more information, see `Amazon Inspector Findings`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Findings`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_findings.html awscli-1.14.44/awscli/examples/inspector/list-event-subscriptions.rst0000666454262600001440000000173113243367510027066 0ustar pysdk-ciamazon00000000000000**To list event subscriptions** The following ``list-event-subscriptions`` command lists all the event subscriptions for the assessment template with the ARN of ``arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0``:: aws inspector list-event-subscriptions --resource-arn arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0 Output:: { "subscriptions": [ { "eventSubscriptions": [ { "event": "ASSESSMENT_RUN_COMPLETED", "subscribedAt": 1459455440.867 } ], "resourceArn": "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0", "topicArn": "arn:aws:sns:us-west-2:123456789012:exampletopic" } ] } For more information, see `Amazon Inspector Assessment Templates and Assessment Runs`_ in the *Amazon Inspector* guide. .. _`Amazon Inspector Assessment Templates and Assessment Runs`: https://docs.aws.amazon.com/inspector/latest/userguide/inspector_assessments.html awscli-1.14.44/awscli/examples/elasticache/0000777454262600001440000000000013243367512021574 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/elasticache/modify-cache-parameter-group.rst0000666454262600001440000000063013243367510027763 0ustar pysdk-ciamazon00000000000000**To modify cache parameter groups** This example modifies parameters for the specified cache parameter group. Command:: aws elasticache modify-cache-parameter-group \ --cache-parameter-group-name my-redis-28 --parameter-name-values \ ParameterName=close-on-slave-write,ParameterValue=no \ ParameterName=timeout,ParameterValue=60 Output:: { "CacheParameterGroupName": "my-redis-28" } awscli-1.14.44/awscli/examples/elasticache/create-replication-group.rst0000666454262600001440000000160213243367510027227 0ustar pysdk-ciamazon00000000000000**To create an Amazon ElastiCache Replication Group** The following ``create-replication-group`` command launches a new Amazon ElastiCache Redis replication group:: aws elasticache create-replication-group --replication-group-id myRedis \ --replication-group-description "desc of myRedis" \ --automatic-failover-enabled --num-cache-clusters 3 \ --cache-node-type cache.m3.medium \ --engine redis --engine-version 2.8.24 \ --cache-parameter-group-name default.redis2.8 \ --cache-subnet-group-name default --security-group-ids sg-12345678 In the preceding example, the replication group is created with 3 clusters(primary plus 2 replicas) and has a cache node class of cach3.m3.medium. With `--automatic-failover-enabled` option, Multi-AZ and automatic failover are enabled. This command output a JSON block that indicates that the replication group was created. awscli-1.14.44/awscli/examples/elasticache/modify-replication-group.rst0000666454262600001440000000075713243367510027265 0ustar pysdk-ciamazon00000000000000**To promote a cache cluster to the primary role** This example promotes the cache cluster *mycluster-002* to the primary role for the specified replication group. Command:: aws elasticache modify-replication-group --replication-group-id mycluster \ --primary-cluster-id mycluster-002 --apply-immediately The nodes of all other cache clusters in the replication group will be read replicas. If the specified group's *autofailover* is enabled, you cannot mannualy promote cache clusters. awscli-1.14.44/awscli/examples/redshift/0000777454262600001440000000000013243367512021137 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/redshift/delete-cluster.rst0000666454262600001440000000113313243367510024606 0ustar pysdk-ciamazon00000000000000Delete a Cluster with No Final Cluster Snapshot ----------------------------------------------- This example deletes a cluster, forcing data deletion so no final cluster snapshot is created. Command:: aws redshift delete-cluster --cluster-identifier mycluster --skip-final-cluster-snapshot Delete a Cluster, Allowing a Final Cluster Snapshot --------------------------------------------------- This example deletes a cluster, but specifies a final cluster snapshot. Command:: aws redshift delete-cluster --cluster-identifier mycluster --final-cluster-snapshot-identifier myfinalsnapshot awscli-1.14.44/awscli/examples/redshift/describe-reserved-nodes.rst0000666454262600001440000000174213243367510026376 0ustar pysdk-ciamazon00000000000000Describe Reserved Nodes ----------------------- This example shows a reserved node offering that has been purchased. Command:: aws redshift describe-reserved-nodes Result:: { "ResponseMetadata": { "RequestId": "bc29ce2e-7600-11e2-9949-4b361e7420b7" }, "ReservedNodes": [ { "OfferingType": "Heavy Utilization", "FixedPrice": "", "NodeType": "dw.hs1.xlarge", "ReservedNodeId": "1ba8e2e3-bc01-4d65-b35d-a4a3e931547e", "UsagePrice": "", "RecurringCharges": [ { "RecurringChargeAmount": "", "RecurringChargeFrequency": "Hourly" } ], "NodeCount": 1, "State": "payment-pending", "StartTime": "2013-02-13T17:08:39.051Z", "Duration": 31536000, "ReservedNodeOfferingId": "ceb6a579-cf4c-4343-be8b-d832c45ab51c" } ] } awscli-1.14.44/awscli/examples/redshift/revoke-cluster-security-group-ingress.rst0000666454262600001440000000113313243367510031306 0ustar pysdk-ciamazon00000000000000Revoke Access from an EC2 Security Group ---------------------------------------- This example revokes access to a named Amazon EC2 security group. Command:: aws redshift revoke-cluster-security-group-ingress --cluster-security-group-name mysecuritygroup --ec2-security-group-name myec2securitygroup --ec2-security-group-owner-id 123445677890 Revoking Access to a CIDR range ------------------------------- This example revokes access to a CIDR range. Command:: aws redshift revoke-cluster-security-group-ingress --cluster-security-group-name mysecuritygroup --cidrip 192.168.100.100/32 awscli-1.14.44/awscli/examples/redshift/create-cluster-snapshot.rst0000666454262600001440000000165313243367510026453 0ustar pysdk-ciamazon00000000000000Create a Cluster Snapshot ------------------------- This example creates a new cluster snapshot. By default, the output is in JSON format. Command:: aws redshift create-cluster-snapshot --cluster-identifier mycluster --snapshot-identifier my-snapshot-id Result:: { "Snapshot": { "Status": "creating", "SnapshotCreateTime": "2013-01-22T22:20:33.548Z", "AvailabilityZone": "us-east-1a", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "DBName": "dev", "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "SnapshotType": "manual", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "mycluster", "Port": 5439, "NumberOfNodes": "2", "SnapshotIdentifier": "my-snapshot-id" }, "ResponseMetadata": { "RequestId": "f024d1a5-64e1-11e2-88c5-53eb05787dfb" } } awscli-1.14.44/awscli/examples/redshift/modify-cluster.rst0000666454262600001440000000166113243367510024641 0ustar pysdk-ciamazon00000000000000Associate a Security Group with a Cluster ----------------------------------------- This example shows how to associate a cluster security group with the specified cluster. Command:: aws redshift modify-cluster --cluster-identifier mycluster --cluster-security-groups mysecuritygroup Modify the Maintenance Window for a Cluster ------------------------------------------- This shows how to change the weekly preferred maintenance window for a cluster to be the minimum four hour window starting Sundays at 11:15 PM, and ending Mondays at 3:15 AM. Command:: aws redshift modify-cluster --cluster-identifier mycluster --preferred-maintenance-window Sun:23:15-Mon:03:15 Change the Master Password for the Cluster ------------------------------------------ This example shows how to change the master password for a cluster. Command:: aws redshift modify-cluster --cluster-identifier mycluster --master-user-password A1b2c3d4 awscli-1.14.44/awscli/examples/redshift/describe-cluster-snapshots.rst0000666454262600001440000000461513243367510027154 0ustar pysdk-ciamazon00000000000000Get a Description of All Cluster Snapshots ------------------------------------------ This example returns a description of all cluster snapshots for the account. By default, the output is in JSON format. Command:: aws redshift describe-cluster-snapshots Result:: { "Snapshots": [ { "Status": "available", "SnapshotCreateTime": "2013-07-17T22:02:22.852Z", "EstimatedSecondsToCompletion": -1, "AvailabilityZone": "us-east-1a", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "Encrypted": false, "OwnerAccount": "111122223333", "BackupProgressInMegabytes": 20.0, "ElapsedTimeInSeconds": 0, "DBName": "dev", "CurrentBackupRateInMegabytesPerSecond: 0.0, "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "ActualIncrementalBackupSizeInMegabytes"; 20.0 "SnapshotType": "automated", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "mycluster", "Port": 5439, "TotalBackupSizeInMegabytes": 20.0, "NumberOfNodes": "2", "SnapshotIdentifier": "cm:mycluster-2013-01-22-22-04-18" }, { "EstimatedSecondsToCompletion": 0, "OwnerAccount": "111122223333", "CurrentBackupRateInMegabytesPerSecond: 0.1534, "ActualIncrementalBackupSizeInMegabytes"; 11.0, "NumberOfNodes": "2", "Status": "available", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "AccountsWithRestoreAccess": [ { "AccountID": "444455556666" } ], "TotalBackupSizeInMegabytes": 20.0, "DBName": "dev", "BackupProgressInMegabytes": 11.0, "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "ElapsedTimeInSeconds": 0, "ClusterIdentifier": "mycluster", "SnapshotCreateTime": "2013-07-17T22:04:18.947Z", "AvailabilityZone": "us-east-1a", "NodeType": "dw.hs1.xlarge", "Encrypted": false, "SnapshotType": "manual", "Port": 5439, "SnapshotIdentifier": "my-snapshot-id" } ] } (...remaining output omitted...) awscli-1.14.44/awscli/examples/redshift/describe-cluster-versions.rst0000666454262600001440000000105413243367510026774 0ustar pysdk-ciamazon00000000000000Get a Description of All Cluster Versions ----------------------------------------- This example returns a description of all cluster versions. By default, the output is in JSON format. Command:: aws redshift describe-cluster-versions Result:: { "ClusterVersions": [ { "ClusterVersion": "1.0", "Description": "Initial release", "ClusterParameterGroupFamily": "redshift-1.0" } ], "ResponseMetadata": { "RequestId": "16a53de3-64cc-11e2-bec0-17624ad140dd" } } awscli-1.14.44/awscli/examples/redshift/copy-cluster-snapshot.rst0000666454262600001440000000203113243367510026151 0ustar pysdk-ciamazon00000000000000Get a Description of All Cluster Versions ----------------------------------------- This example returns a description of all cluster versions. By default, the output is in JSON format. Command:: aws redshift copy-cluster-snapshot --source-snapshot-identifier cm:examplecluster-2013-01-22-19-27-58 --target-snapshot-identifier my-saved-snapshot-copy Result:: { "Snapshot": { "Status": "available", "SnapshotCreateTime": "2013-01-22T19:27:58.931Z", "AvailabilityZone": "us-east-1c", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "DBName": "dev", "ClusterCreateTime": "2013-01-22T19:23:59.368Z", "SnapshotType": "manual", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "examplecluster", "Port": 5439, "NumberOfNodes": "2", "SnapshotIdentifier": "my-saved-snapshot-copy" }, "ResponseMetadata": { "RequestId": "3b279691-64e3-11e2-bec0-17624ad140dd" } } awscli-1.14.44/awscli/examples/redshift/purchase-reserved-node-offering.rst0000666454262600001440000000211013243367510030030 0ustar pysdk-ciamazon00000000000000Purchase a Reserved Node ------------------------ This example shows how to purchase a reserved node offering. The ``reserved-node-offering-id`` is obtained by calling ``describe-reserved-node-offerings``. Command:: aws redshift purchase-reserved-node-offering --reserved-node-offering-id ceb6a579-cf4c-4343-be8b-d832c45ab51c Result:: { "ReservedNode": { "OfferingType": "Heavy Utilization", "FixedPrice": "", "NodeType": "dw.hs1.xlarge", "ReservedNodeId": "1ba8e2e3-bc01-4d65-b35d-a4a3e931547e", "UsagePrice": "", "RecurringCharges": [ { "RecurringChargeAmount": "", "RecurringChargeFrequency": "Hourly" } ], "NodeCount": 1, "State": "payment-pending", "StartTime": "2013-02-13T17:08:39.051Z", "Duration": 31536000, "ReservedNodeOfferingId": "ceb6a579-cf4c-4343-be8b-d832c45ab51c" }, "ResponseMetadata": { "RequestId": "01bda7bf-7600-11e2-b605-2568d7396e7f" } } awscli-1.14.44/awscli/examples/redshift/create-cluster.rst0000666454262600001440000000264613243367510024621 0ustar pysdk-ciamazon00000000000000Create a Cluster with Minimal Parameters ---------------------------------------- This example creates a cluster with the minimal set of parameters. By default, the output is in JSON format. Command:: aws redshift create-cluster --node-type dw.hs1.xlarge --number-of-nodes 2 --master-username adminuser --master-user-password TopSecret1 --cluster-identifier mycluster Result:: { "Cluster": { "NodeType": "dw.hs1.xlarge", "ClusterVersion": "1.0", "PubliclyAccessible": "true", "MasterUsername": "adminuser", "ClusterParameterGroups": [ { "ParameterApplyStatus": "in-sync", "ParameterGroupName": "default.redshift-1.0" } ], "ClusterSecurityGroups": [ { "Status": "active", "ClusterSecurityGroupName": "default" } ], "AllowVersionUpgrade": true, "VpcSecurityGroups": \[], "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", "AutomatedSnapshotRetentionPeriod": 1, "ClusterStatus": "creating", "ClusterIdentifier": "mycluster", "DBName": "dev", "NumberOfNodes": 2, "PendingModifiedValues": { "MasterUserPassword": "\****" } }, "ResponseMetadata": { "RequestId": "7cf4bcfc-64dd-11e2-bea9-49e0ce183f07" } } awscli-1.14.44/awscli/examples/redshift/describe-reserved-node-offerings.rst0000666454262600001440000000273313243367510030174 0ustar pysdk-ciamazon00000000000000Describe Reserved Node Offerings -------------------------------- This example shows all of the reserved node offerings that are available for purchase. Command:: aws redshift describe-reserved-node-offerings Result:: { "ReservedNodeOfferings": [ { "OfferingType": "Heavy Utilization", "FixedPrice": "", "NodeType": "dw.hs1.xlarge", "UsagePrice": "", "RecurringCharges": [ { "RecurringChargeAmount": "", "RecurringChargeFrequency": "Hourly" } ], "Duration": 31536000, "ReservedNodeOfferingId": "ceb6a579-cf4c-4343-be8b-d832c45ab51c" }, { "OfferingType": "Heavy Utilization", "FixedPrice": "", "NodeType": "dw.hs1.8xlarge", "UsagePrice": "", "RecurringCharges": [ { "RecurringChargeAmount": "", "RecurringChargeFrequency": "Hourly" } ], "Duration": 31536000, "ReservedNodeOfferingId": "e5a2ff3b-352d-4a9c-ad7d-373c4cab5dd2" }, ...remaining output omitted... ], "ResponseMetadata": { "RequestId": "8b1a1a43-75ff-11e2-9666-e142fe91ddd1" } } If you want to purchase a reserved node offering, you can call ``purchase-reserved-node-offering`` using a valid *ReservedNodeOfferingId*. awscli-1.14.44/awscli/examples/redshift/create-cluster-subnet-group.rst0000666454262600001440000000154113243367510027242 0ustar pysdk-ciamazon00000000000000Create a Cluster Subnet Group ----------------------------- This example creates a new cluster subnet group. Command:: aws redshift create-cluster-subnet-group --cluster-subnet-group-name mysubnetgroup --description "My subnet group" --subnet-ids subnet-763fdd1c Result:: { "ClusterSubnetGroup": { "Subnets": [ { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-763fdd1c", "SubnetAvailabilityZone": { "Name": "us-east-1a" } } ], "VpcId": "vpc-7e3fdd14", "SubnetGroupStatus": "Complete", "Description": "My subnet group", "ClusterSubnetGroupName": "mysubnetgroup" }, "ResponseMetadata": { "RequestId": "500b8ce2-698f-11e2-9790-fd67517fb6fd" } } awscli-1.14.44/awscli/examples/redshift/describe-cluster-subnet-groups.rst0000666454262600001440000000164213243367510027744 0ustar pysdk-ciamazon00000000000000Get a Description of All Cluster Subnet Groups ---------------------------------------------- This example returns a description of all cluster subnet groups. By default, the output is in JSON format. Command:: aws redshift describe-cluster-subnet-groups Result:: { "ClusterSubnetGroups": [ { "Subnets": [ { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-763fdd1c", "SubnetAvailabilityZone": { "Name": "us-east-1a" } } ], "VpcId": "vpc-7e3fdd14", "SubnetGroupStatus": "Complete", "Description": "My subnet group", "ClusterSubnetGroupName": "mysubnetgroup" } ], "ResponseMetadata": { "RequestId": "37fa8c89-6990-11e2-8f75-ab4018764c77" } } awscli-1.14.44/awscli/examples/redshift/reboot-cluster.rst0000666454262600001440000000266313243367510024647 0ustar pysdk-ciamazon00000000000000Reboot a Cluster ---------------- This example reboots a cluster. By default, the output is in JSON format. Command:: aws redshift reboot-cluster --cluster-identifier mycluster Result:: { "Cluster": { "NodeType": "dw.hs1.xlarge", "Endpoint": { "Port": 5439, "Address": "mycluster.coqoarplqhsn.us-east-1.redshift.amazonaws.com" }, "ClusterVersion": "1.0", "PubliclyAccessible": "true", "MasterUsername": "adminuser", "ClusterParameterGroups": [ { "ParameterApplyStatus": "in-sync", "ParameterGroupName": "default.redshift-1.0" } ], "ClusterSecurityGroups": [ { "Status": "active", "ClusterSecurityGroupName": "default" } ], "AllowVersionUpgrade": true, "VpcSecurityGroups": \[], "AvailabilityZone": "us-east-1a", "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "PreferredMaintenanceWindow": "sun:23:15-mon:03:15", "AutomatedSnapshotRetentionPeriod": 1, "ClusterStatus": "rebooting", "ClusterIdentifier": "mycluster", "DBName": "dev", "NumberOfNodes": 2, "PendingModifiedValues": {} }, "ResponseMetadata": { "RequestId": "61c8b564-64e8-11e2-8f7d-3b939af52818" } } awscli-1.14.44/awscli/examples/redshift/reset-cluster-parameter-group.rst0000666454262600001440000000043213243367510027577 0ustar pysdk-ciamazon00000000000000Reset Parameters in a Parameter Group ------------------------------------- This example shows how to reset all of the parameters in a parameter group. Command:: aws redshift reset-cluster-parameter-group --parameter-group-name myclusterparametergroup --reset-all-parameters awscli-1.14.44/awscli/examples/redshift/describe-events.rst0000666454262600001440000000165113243367510024754 0ustar pysdk-ciamazon00000000000000Describe All Events ------------------- this example returns all events. By default, the output is in JSON format. Command:: aws redshift describe-events Result:: { "Events": [ { "Date": "2013-01-22T19:17:03.640Z", "SourceIdentifier": "myclusterparametergroup", "Message": "Cluster parameter group myclusterparametergroup has been created.", "SourceType": "cluster-parameter-group" } ], "ResponseMetadata": { "RequestId": "9f056111-64c9-11e2-9390-ff04f2c1e638" } } You can also obtain the same information in text format using the ``--output text`` option. Command:: aws redshift describe-events --output text Result:: 2013-01-22T19:17:03.640Z myclusterparametergroup Cluster parameter group myclusterparametergroup has been created. cluster-parameter-group RESPONSEMETADATA 8e5fe765-64c9-11e2-bce3-e56f52c50e17 awscli-1.14.44/awscli/examples/redshift/authorize-snapshot-access.rst0000666454262600001440000000242513243367510027000 0ustar pysdk-ciamazon00000000000000Authorize an AWS Account to Restore a Snapshot ---------------------------------------------- This example authorizes the AWS account ``444455556666`` to restore the snapshot ``my-snapshot-id``. By default, the output is in JSON format. Command:: aws redshift authorize-snapshot-access --snapshot-id my-snapshot-id --account-with-restore-access 444455556666 Result:: { "Snapshot": { "Status": "available", "SnapshotCreateTime": "2013-07-17T22:04:18.947Z", "EstimatedSecondsToCompletion": 0, "AvailabilityZone": "us-east-1a", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "Encrypted": false, "OwnerAccount": "111122223333", "BackupProgressInMegabytes": 11.0, "ElapsedTimeInSeconds": 0, "DBName": "dev", "CurrentBackupRateInMegabytesPerSecond: 0.1534, "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "ActualIncrementalBackupSizeInMegabytes"; 11.0, "SnapshotType": "manual", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "mycluster", "TotalBackupSizeInMegabytes": 20.0, "Port": 5439, "NumberOfNodes": 2, "SnapshotIdentifier": "my-snapshot-id" } } awscli-1.14.44/awscli/examples/redshift/describe-cluster-security-groups.rst0000666454262600001440000000176213243367510030316 0ustar pysdk-ciamazon00000000000000Get a Description of All Cluster Security Groups ------------------------------------------------ This example returns a description of all cluster security groups for the account. By default, the output is in JSON format. Command:: aws redshift describe-cluster-security-groups Result:: { "ClusterSecurityGroups": [ { "OwnerId": "100447751468", "Description": "default", "ClusterSecurityGroupName": "default", "EC2SecurityGroups": \[], "IPRanges": [ { "Status": "authorized", "CIDRIP": "0.0.0.0/0" } ] }, { "OwnerId": "100447751468", "Description": "This is my cluster security group", "ClusterSecurityGroupName": "mysecuritygroup", "EC2SecurityGroups": \[], "IPRanges": \[] }, (...remaining output omitted...) ] } awscli-1.14.44/awscli/examples/redshift/delete-cluster-parameter-group.rst0000666454262600001440000000033613243367510027722 0ustar pysdk-ciamazon00000000000000Delete a Cluster Parameter Group -------------------------------- This example deletes a cluster parameter group. Command:: aws redshift delete-cluster-parameter-group --parameter-group-name myclusterparametergroup awscli-1.14.44/awscli/examples/redshift/describe-cluster-parameters.rst0000666454262600001440000000425113243367510027271 0ustar pysdk-ciamazon00000000000000Retrieve the Parameters for a Specified Cluster Parameter Group --------------------------------------------------------------- This example retrieves the parameters for the named parameter group. By default, the output is in JSON format. Command:: aws redshift describe-cluster-parameters --parameter-group-name myclusterparametergroup Result:: { "Parameters": [ { "Description": "Sets the display format for date and time values.", "DataType": "string", "IsModifiable": true, "Source": "engine-default", "ParameterValue": "ISO, MDY", "ParameterName": "datestyle" }, { "Description": "Sets the number of digits displayed for floating-point values", "DataType": "integer", "IsModifiable": true, "AllowedValues": "-15-2", "Source": "engine-default", "ParameterValue": "0", "ParameterName": "extra_float_digits" }, (...remaining output omitted...) ] } You can also obtain the same information in text format using the ``--output text`` option. Command:: aws redshift describe-cluster-parameters --parameter-group-name myclusterparametergroup --output text Result:: RESPONSEMETADATA cdac40aa-64cc-11e2-9e70-918437dd236d Sets the display format for date and time values. string True engine-default ISO, MDY datestyle Sets the number of digits displayed for floating-point values integer True -15-2 engine-default 0 extra_float_digits This parameter applies a user-defined label to a group of queries that are run during the same session.. string True engine-default default query_group require ssl for all databaseconnections boolean True true,false engine-default false require_ssl Sets the schema search order for names that are not schema-qualified. string True engine-default $user, public search_path Aborts any statement that takes over the specified number of milliseconds. integer True engine-default 0 statement_timeout wlm json configuration string True engine-default \[{"query_concurrency":5}] wlm_json_configuration awscli-1.14.44/awscli/examples/redshift/modify-cluster-subnet-group.rst0000666454262600001440000000220013243367510027257 0ustar pysdk-ciamazon00000000000000Modify the Subnets in a Cluster Subnet Group -------------------------------------------- This example shows how to modify the list of subnets in a cache subnet group. By default, the output is in JSON format. Command:: aws redshift modify-cluster-subnet-group --cluster-subnet-group-name mysubnetgroup --subnet-ids subnet-763fdd1 subnet-ac830e9 Result:: { "ClusterSubnetGroup": { "Subnets": [ { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-763fdd1c", "SubnetAvailabilityZone": { "Name": "us-east-1a" } }, { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-ac830e9", "SubnetAvailabilityZone": { "Name": "us-east-1b" } } ], "VpcId": "vpc-7e3fdd14", "SubnetGroupStatus": "Complete", "Description": "My subnet group", "ClusterSubnetGroupName": "mysubnetgroup" }, "ResponseMetadata": { "RequestId": "8da93e89-8372-f936-93a8-873918938197a" } } awscli-1.14.44/awscli/examples/redshift/restore-from-cluster-snapshot.rst0000666454262600001440000000240113243367510027624 0ustar pysdk-ciamazon00000000000000Restore a Cluster From a Snapshot --------------------------------- This example restores a cluster from a snapshot. Command:: aws redshift restore-from-cluster-snapshot --cluster-identifier mycluster-clone --snapshot-identifier my-snapshot-id Result:: { "Cluster": { "NodeType": "dw.hs1.xlarge", "ClusterVersion": "1.0", "PubliclyAccessible": "true", "MasterUsername": "adminuser", "ClusterParameterGroups": [ { "ParameterApplyStatus": "in-sync", "ParameterGroupName": "default.redshift-1.0" } ], "ClusterSecurityGroups": [ { "Status": "active", "ClusterSecurityGroupName": "default" } ], "AllowVersionUpgrade": true, "VpcSecurityGroups": \[], "PreferredMaintenanceWindow": "sun:23:15-mon:03:15", "AutomatedSnapshotRetentionPeriod": 1, "ClusterStatus": "creating", "ClusterIdentifier": "mycluster-clone", "DBName": "dev", "NumberOfNodes": 2, "PendingModifiedValues": {} }, "ResponseMetadata": { "RequestId": "77fd512b-64e3-11e2-8f5b-e90bd6c77476" } } awscli-1.14.44/awscli/examples/redshift/modify-cluster-parameter-group.rst0000666454262600001440000000151013243367510027742 0ustar pysdk-ciamazon00000000000000Modify a Parameter in a Parameter Group --------------------------------------- This example shows how to modify the *wlm_json_configuration* parameter for workload management. Command:: aws redshift modify-cluster-parameter-group --parameter-group-name myclusterparametergroup --parameters '{"parameter_name":"wlm_json_configuration","parameter_value":"\[{\\"user_group\\":\[\\"example_user_group1\\"],\\"query_group\\":\[\\"example_query_group1\\"],\\"query_concurrency\\":7},{\\"query_concurrency\\":5}]"}' Result:: { "ParameterGroupStatus": "Your parameter group has been updated but changes won't get applied until you reboot the associated Clusters.", "ParameterGroupName": "myclusterparametergroup", "ResponseMetadata": { "RequestId": "09974cc0-64cd-11e2-bea9-49e0ce183f07" } } awscli-1.14.44/awscli/examples/redshift/revoke-snapshot-access.rst0000666454262600001440000000250713243367510026262 0ustar pysdk-ciamazon00000000000000Revoke the Authorization of an AWS Account to Restore a Snapshot ---------------------------------------------------------------- This example revokes the authorization of the AWS account ``444455556666`` to restore the snapshot ``my-snapshot-id``. By default, the output is in JSON format. Command:: aws redshift revoke-snapshot-access --snapshot-id my-snapshot-id --account-with-restore-access 444455556666 Result:: { "Snapshot": { "Status": "available", "SnapshotCreateTime": "2013-07-17T22:04:18.947Z", "EstimatedSecondsToCompletion": 0, "AvailabilityZone": "us-east-1a", "ClusterVersion": "1.0", "MasterUsername": "adminuser", "Encrypted": false, "OwnerAccount": "111122223333", "BackupProgressInMegabytes": 11.0, "ElapsedTimeInSeconds": 0, "DBName": "dev", "CurrentBackupRateInMegabytesPerSecond: 0.1534, "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "ActualIncrementalBackupSizeInMegabytes"; 11.0, "SnapshotType": "manual", "NodeType": "dw.hs1.xlarge", "ClusterIdentifier": "mycluster", "TotalBackupSizeInMegabytes": 20.0, "Port": 5439, "NumberOfNodes": 2, "SnapshotIdentifier": "my-snapshot-id" } } awscli-1.14.44/awscli/examples/redshift/delete-cluster-snapshot.rst0000666454262600001440000000027013243367510026444 0ustar pysdk-ciamazon00000000000000Delete a Cluster Snapshot ------------------------- This example deletes a cluster snapshot. Command:: aws redshift delete-cluster-snapshot --snapshot-identifier my-snapshot-id awscli-1.14.44/awscli/examples/redshift/describe-cluster-parameter-groups.rst0000666454262600001440000000172513243367510030426 0ustar pysdk-ciamazon00000000000000Get a Description of All Cluster Parameter Groups ------------------------------------------------- This example returns a description of all cluster parameter groups for the account, with column headers. By default, the output is in JSON format. Command:: aws redshift describe-cluster-parameter-groups Result:: { "ParameterGroups": [ { "ParameterGroupFamily": "redshift-1.0", "Description": "My first cluster parameter group", "ParameterGroupName": "myclusterparametergroup" } ], "ResponseMetadata": { "RequestId": "8ceb8f6f-64cc-11e2-bea9-49e0ce183f07" } } You can also obtain the same information in text format using the ``--output text`` option. Command:: aws redshift describe-cluster-parameter-groups --output text Result:: redshift-1.0 My first cluster parameter group myclusterparametergroup RESPONSEMETADATA 9e665a36-64cc-11e2-8f7d-3b939af52818 awscli-1.14.44/awscli/examples/redshift/describe-default-cluster-parameters.rst0000666454262600001440000000243613243367510030716 0ustar pysdk-ciamazon00000000000000Get a Description of Default Cluster Parameters ----------------------------------------------- This example returns a description of the default cluster parameters for the ``redshift-1.0`` family. By default, the output is in JSON format. Command:: aws redshift describe-default-cluster-parameters --parameter-group-family redshift-1.0 Result:: { "DefaultClusterParameters": { "ParameterGroupFamily": "redshift-1.0", "Parameters": [ { "Description": "Sets the display format for date and time values.", "DataType": "string", "IsModifiable": true, "Source": "engine-default", "ParameterValue": "ISO, MDY", "ParameterName": "datestyle" }, { "Description": "Sets the number of digits displayed for floating-point values", "DataType": "integer", "IsModifiable": true, "AllowedValues": "-15-2", "Source": "engine-default", "ParameterValue": "0", "ParameterName": "extra_float_digits" }, (...remaining output omitted...) ] } } .. tip:: To see a list of valid parameter group families, use the ``describe-cluster-parameter-groups`` command. awscli-1.14.44/awscli/examples/redshift/create-cluster-security-group.rst0000666454262600001440000000236413243367510027615 0ustar pysdk-ciamazon00000000000000Creating a Cluster Security Group --------------------------------- This example creates a new cluster security group. By default, the output is in JSON format. Command:: aws redshift create-cluster-security-group --cluster-security-group-name mysecuritygroup --description "This is my cluster security group" Result:: { "create_cluster_security_group_response": { "create_cluster_security_group_result": { "cluster_security_group": { "description": "This is my cluster security group", "owner_id": "300454760768", "cluster_security_group_name": "mysecuritygroup", "ec2_security_groups": \[], "ip_ranges": \[] } }, "response_metadata": { "request_id": "5df486a0-343a-11e2-b0d8-d15d0ef48549" } } } You can also obtain the same information in text format using the ``--output text`` option. Command:: aws redshift create-cluster-security-group --cluster-security-group-name mysecuritygroup --description "This is my cluster security group" --output text Result:: This is my cluster security group 300454760768 mysecuritygroup a0c0bfab-343a-11e2-95d2-c3dc9fe8ab57 awscli-1.14.44/awscli/examples/redshift/describe-orderable-cluster-options.rst0000666454262600001440000000341613243367510030560 0ustar pysdk-ciamazon00000000000000Describing All Orderable Cluster Options ---------------------------------------- This example returns descriptions of all orderable cluster options. By default, the output is in JSON format. Command:: aws redshift describe-orderable-cluster-options Result:: { "OrderableClusterOptions": [ { "NodeType": "dw.hs1.8xlarge", "AvailabilityZones": [ { "Name": "us-east-1a" }, { "Name": "us-east-1b" }, { "Name": "us-east-1c" } ], "ClusterVersion": "1.0", "ClusterType": "multi-node" }, { "NodeType": "dw.hs1.xlarge", "AvailabilityZones": [ { "Name": "us-east-1a" }, { "Name": "us-east-1b" }, { "Name": "us-east-1c" } ], "ClusterVersion": "1.0", "ClusterType": "multi-node" }, { "NodeType": "dw.hs1.xlarge", "AvailabilityZones": [ { "Name": "us-east-1a" }, { "Name": "us-east-1b" }, { "Name": "us-east-1c" } ], "ClusterVersion": "1.0", "ClusterType": "single-node" } ], "ResponseMetadata": { "RequestId": "f6000035-64cb-11e2-9135-ff82df53a51a" } } You can also obtain the same information in text format using the ``--output text`` option. Command:: aws redshift describe-orderable-cluster-options --output text Result:: dw.hs1.8xlarge 1.0 multi-node us-east-1a us-east-1b us-east-1c dw.hs1.xlarge 1.0 multi-node us-east-1a us-east-1b us-east-1c dw.hs1.xlarge 1.0 single-node us-east-1a us-east-1b us-east-1c RESPONSEMETADATA e648696b-64cb-11e2-bec0-17624ad140dd awscli-1.14.44/awscli/examples/redshift/describe-resize.rst0000666454262600001440000000075013243367510024750 0ustar pysdk-ciamazon00000000000000Describe Resize --------------- This example describes the latest resize of a cluster. The request was for 3 nodes of type ``dw.hs1.8xlarge``. Command:: aws redshift describe-resize --cluster-identifier mycluster Result:: { "Status": "NONE", "TargetClusterType": "multi-node", "TargetNodeType": "dw.hs1.8xlarge", "ResponseMetadata": { "RequestId": "9f52b0b4-7733-11e2-aa9b-318b2909bd27" }, "TargetNumberOfNodes": "3" } awscli-1.14.44/awscli/examples/redshift/delete-cluster-security-group.rst0000666454262600001440000000033113243367510027604 0ustar pysdk-ciamazon00000000000000Delete a Cluster Security Group ------------------------------- This example deletes a cluster security group. Command:: aws redshift delete-cluster-security-group --cluster-security-group-name mysecuritygroup awscli-1.14.44/awscli/examples/redshift/describe-clusters.rst0000666454262600001440000000372513243367510025320 0ustar pysdk-ciamazon00000000000000Get a Description of All Clusters --------------------------------- This example returns a description of all clusters for the account. By default, the output is in JSON format. Command:: aws redshift describe-clusters Result:: { "Clusters": [ { "NodeType": "dw.hs1.xlarge", "Endpoint": { "Port": 5439, "Address": "mycluster.coqoarplqhsn.us-east-1.redshift.amazonaws.com" }, "ClusterVersion": "1.0", "PubliclyAccessible": "true", "MasterUsername": "adminuser", "ClusterParameterGroups": [ { "ParameterApplyStatus": "in-sync", "ParameterGroupName": "default.redshift-1.0" } ], "ClusterSecurityGroups": [ { "Status": "active", "ClusterSecurityGroupName": "default" } ], "AllowVersionUpgrade": true, "VpcSecurityGroups": \[], "AvailabilityZone": "us-east-1a", "ClusterCreateTime": "2013-01-22T21:59:29.559Z", "PreferredMaintenanceWindow": "sat:03:30-sat:04:00", "AutomatedSnapshotRetentionPeriod": 1, "ClusterStatus": "available", "ClusterIdentifier": "mycluster", "DBName": "dev", "NumberOfNodes": 2, "PendingModifiedValues": {} } ], "ResponseMetadata": { "RequestId": "65b71cac-64df-11e2-8f5b-e90bd6c77476" } } You can also obtain the same information in text format using the ``--output text`` option. Command:: aws redshift describe-clusters --output text Result:: dw.hs1.xlarge 1.0 true adminuser True us-east-1a 2013-01-22T21:59:29.559Z sat:03:30-sat:04:00 1 available mycluster dev 2 ENDPOINT 5439 mycluster.coqoarplqhsn.us-east-1.redshift.amazonaws.com in-sync default.redshift-1.0 active default PENDINGMODIFIEDVALUES RESPONSEMETADATA 934281a8-64df-11e2-b07c-f7fbdd006c67 awscli-1.14.44/awscli/examples/redshift/delete-cluster-subnet-group.rst0000666454262600001440000000051113243367510027235 0ustar pysdk-ciamazon00000000000000Delete a Cluster subnet Group ----------------------------- This example deletes a cluster subnet group. Command:: aws redshift delete-cluster-subnet-group --cluster-subnet-group-name mysubnetgroup Result:: { "ResponseMetadata": { "RequestId": "253fbffd-6993-11e2-bc3a-47431073908a" } } awscli-1.14.44/awscli/examples/redshift/create-cluster-parameter-group.rst0000666454262600001440000000121213243367510027715 0ustar pysdk-ciamazon00000000000000Create a Cluster Parameter Group -------------------------------- This example creates a new cluster parameter group. Command:: aws redshift create-cluster-parameter-group --parameter-group-name myclusterparametergroup --parameter-group-family redshift-1.0 --description "My first cluster parameter group" Result:: { "ClusterParameterGroup": { "ParameterGroupFamily": "redshift-1.0", "Description": "My first cluster parameter group", "ParameterGroupName": "myclusterparametergroup" }, "ResponseMetadata": { "RequestId": "739448f0-64cc-11e2-8f7d-3b939af52818" } } awscli-1.14.44/awscli/examples/redshift/authorize-cluster-security-group-ingress.rst0000666454262600001440000000116213243367510032027 0ustar pysdk-ciamazon00000000000000Authorizing Access to an EC2 Security Group ------------------------------------------- This example authorizes access to a named Amazon EC2 security group. Command:: aws redshift authorize-cluster-security-group-ingress --cluster-security-group-name mysecuritygroup --ec2-security-group-name myec2securitygroup --ec2-security-group-owner-id 123445677890 Authorizing Access to a CIDR range ---------------------------------- This example authorizes access to a CIDR range. Command:: aws redshift authorize-cluster-security-group-ingress --cluster-security-group-name mysecuritygroup --cidrip 192.168.100.100/32 awscli-1.14.44/awscli/examples/cloudwatch/0000777454262600001440000000000013243367512021464 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/cloudwatch/put-metric-data.rst0000666454262600001440000000214613243367510025217 0ustar pysdk-ciamazon00000000000000**To publish a custom metric to Amazon CloudWatch** The following example uses the ``put-metric-data`` command to publish a custom metric to Amazon CloudWatch:: aws cloudwatch put-metric-data --namespace "Usage Metrics" --metric-data file://metric.json The values for the metric itself are stored in the JSON file, ``metric.json``. Here are the contents of that file:: [ { "MetricName": "New Posts", "Timestamp": "Wednesday, June 12, 2013 8:28:20 PM", "Value": 0.50, "Unit": "Count" } ] For more information, see `Publishing Custom Metrics`_ in the *Amazon CloudWatch Developer Guide*. .. _`Publishing Custom Metrics`: http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/publishingMetrics.html **To specify multiple dimensions** The following example illustrates how to specify multiple dimensions. Each dimension is specified as a Name=Value pair. Multiple dimensions are separated by a comma.:: aws cloudwatch put-metric-data --metric-name Buffers --namespace MyNameSpace --unit Bytes --value 231434333 --dimensions InstanceID=1-23456789,InstanceType=m1.small awscli-1.14.44/awscli/examples/cloudwatch/describe-alarms.rst0000666454262600001440000000332713243367510025256 0ustar pysdk-ciamazon00000000000000**To list information about an alarm** The following example uses the ``describe-alarms`` command to provide information about the alarm named "myalarm":: aws cloudwatch describe-alarms --alarm-names "myalarm" Output:: { "MetricAlarms": [ { "EvaluationPeriods": 2, "AlarmArn": "arn:aws:cloudwatch:us-east-1:123456789012:alarm:myalarm", "StateUpdatedTimestamp": "2014-04-09T18:59:06.442Z", "AlarmConfigurationUpdatedTimestamp": "2012-12-27T00:49:54.032Z", "ComparisonOperator": "GreaterThanThreshold", "AlarmActions": [ "arn:aws:sns:us-east-1:123456789012:myHighCpuAlarm" ], "Namespace": "AWS/EC2", "AlarmDescription": "CPU usage exceeds 70 percent", "StateReasonData": "{\"version\":\"1.0\",\"queryDate\":\"2014-04-09T18:59:06.419+0000\",\"startDate\":\"2014-04-09T18:44:00.000+0000\",\"statistic\":\"Average\",\"period\":300,\"recentDatapoints\":[38.958,40.292],\"threshold\":70.0}", "Period": 300, "StateValue": "OK", "Threshold": 70.0, "AlarmName": "myalarm", "Dimensions": [ { "Name": "InstanceId", "Value": "i-0c986c72" } ], "Statistic": "Average", "StateReason": "Threshold Crossed: 2 datapoints were not greater than the threshold (70.0). The most recent datapoints: [38.958, 40.292].", "InsufficientDataActions": [], "OKActions": [], "ActionsEnabled": true, "MetricName": "CPUUtilization" } ] } awscli-1.14.44/awscli/examples/cloudwatch/get-metric-statistics.rst0000666454262600001440000001146413243367510026452 0ustar pysdk-ciamazon00000000000000**To get the CPU utilization per EC2 instance** The following example uses the ``get-metric-statistics`` command to get the CPU utilization for an EC2 instance with the ID i-abcdef. .. __: http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/US_GetStatistics.html :: aws cloudwatch get-metric-statistics --metric-name CPUUtilization --start-time 2014-04-08T23:18:00Z --end-time 2014-04-09T23:18:00Z --period 3600 --namespace AWS/EC2 --statistics Maximum --dimensions Name=InstanceId,Value=i-abcdef Output:: { "Datapoints": [ { "Timestamp": "2014-04-09T11:18:00Z", "Maximum": 44.79, "Unit": "Percent" }, { "Timestamp": "2014-04-09T20:18:00Z", "Maximum": 47.92, "Unit": "Percent" }, { "Timestamp": "2014-04-09T19:18:00Z", "Maximum": 50.85, "Unit": "Percent" }, { "Timestamp": "2014-04-09T09:18:00Z", "Maximum": 47.92, "Unit": "Percent" }, { "Timestamp": "2014-04-09T03:18:00Z", "Maximum": 76.84, "Unit": "Percent" }, { "Timestamp": "2014-04-09T21:18:00Z", "Maximum": 48.96, "Unit": "Percent" }, { "Timestamp": "2014-04-09T14:18:00Z", "Maximum": 47.92, "Unit": "Percent" }, { "Timestamp": "2014-04-09T08:18:00Z", "Maximum": 47.92, "Unit": "Percent" }, { "Timestamp": "2014-04-09T16:18:00Z", "Maximum": 45.55, "Unit": "Percent" }, { "Timestamp": "2014-04-09T06:18:00Z", "Maximum": 47.92, "Unit": "Percent" }, { "Timestamp": "2014-04-09T13:18:00Z", "Maximum": 45.08, "Unit": "Percent" }, { "Timestamp": "2014-04-09T05:18:00Z", "Maximum": 47.92, "Unit": "Percent" }, { "Timestamp": "2014-04-09T18:18:00Z", "Maximum": 46.88, "Unit": "Percent" }, { "Timestamp": "2014-04-09T17:18:00Z", "Maximum": 52.08, "Unit": "Percent" }, { "Timestamp": "2014-04-09T07:18:00Z", "Maximum": 47.92, "Unit": "Percent" }, { "Timestamp": "2014-04-09T02:18:00Z", "Maximum": 51.23, "Unit": "Percent" }, { "Timestamp": "2014-04-09T12:18:00Z", "Maximum": 47.67, "Unit": "Percent" }, { "Timestamp": "2014-04-08T23:18:00Z", "Maximum": 46.88, "Unit": "Percent" }, { "Timestamp": "2014-04-09T10:18:00Z", "Maximum": 51.91, "Unit": "Percent" }, { "Timestamp": "2014-04-09T04:18:00Z", "Maximum": 47.13, "Unit": "Percent" }, { "Timestamp": "2014-04-09T15:18:00Z", "Maximum": 48.96, "Unit": "Percent" }, { "Timestamp": "2014-04-09T00:18:00Z", "Maximum": 48.16, "Unit": "Percent" }, { "Timestamp": "2014-04-09T01:18:00Z", "Maximum": 49.18, "Unit": "Percent" } ], "Label": "CPUUtilization" } **Specifying multiple dimensions** The following example illustrates how to specify multiple dimensions. Each dimension is specified as a Name/Value pair, with a comma between the name and the value. Multiple dimensions are separated by a space. If a single metric includes multiple dimensions, you must specify a value for every defined dimension. For more examples using the ``get-metric-statistics`` command, see `Get Statistics for a Metric`__ in the *Amazon CloudWatch Developer Guide*. .. __: http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/US_GetStatistics.html :: aws cloudwatch get-metric-statistics --metric-name Buffers --namespace MyNameSpace --dimensions Name=InstanceID,Value=i-abcdef Name=InstanceType,Value=m1.small --start-time 2016-10-15T04:00:00Z --end-time 2016-10-19T07:00:00Z --statistics Average --period 60 awscli-1.14.44/awscli/examples/cloudwatch/set-alarm-state.rst0000666454262600001440000000062113243367510025216 0ustar pysdk-ciamazon00000000000000**To temporarily change the state of an alarm** The following example uses the ``set-alarm-state`` command to temporarily change the state of an Amazon CloudWatch alarm named "myalarm" and set it to the ALARM state for testing purposes:: aws cloudwatch set-alarm-state --alarm-name "myalarm" --state-value ALARM --state-reason "testing purposes" This command returns to the prompt if successful. awscli-1.14.44/awscli/examples/cloudwatch/describe-alarms-for-metric.rst0000666454262600001440000000675213243367510027330 0ustar pysdk-ciamazon00000000000000**To display information about alarms associated with a metric** The following example uses the ``describe-alarms-for-metric`` command to display information about any alarms associated with the Amazon EC2 CPUUtilization metric and the instance with the ID i-0c986c72.:: aws cloudwatch describe-alarms-for-metric --metric-name CPUUtilization --namespace AWS/EC2 --dimensions Name=InstanceId,Value=i-0c986c72 Output:: { "MetricAlarms": [ { "EvaluationPeriods": 10, "AlarmArn": "arn:aws:cloudwatch:us-east-1:111122223333:alarm:myHighCpuAlarm2", "StateUpdatedTimestamp": "2013-10-30T03:03:51.479Z", "AlarmConfigurationUpdatedTimestamp": "2013-10-30T03:03:50.865Z", "ComparisonOperator": "GreaterThanOrEqualToThreshold", "AlarmActions": [ "arn:aws:sns:us-east-1:111122223333:NotifyMe" ], "Namespace": "AWS/EC2", "AlarmDescription": "CPU usage exceeds 70 percent", "StateReasonData": "{\"version\":\"1.0\",\"queryDate\":\"2013-10-30T03:03:51.479+0000\",\"startDate\":\"2013-10-30T02:08:00.000+0000\",\"statistic\":\"Average\",\"period\":300,\"recentDatapoints\":[40.698,39.612,42.432,39.796,38.816,42.28,42.854,40.088,40.760000000000005,41.316],\"threshold\":70.0}", "Period": 300, "StateValue": "OK", "Threshold": 70.0, "AlarmName": "myHighCpuAlarm2", "Dimensions": [ { "Name": "InstanceId", "Value": "i-0c986c72" } ], "Statistic": "Average", "StateReason": "Threshold Crossed: 10 datapoints were not greater than or equal to the threshold (70.0). The most recent datapoints: [40.760000000000005, 41.316].", "InsufficientDataActions": [], "OKActions": [], "ActionsEnabled": true, "MetricName": "CPUUtilization" }, { "EvaluationPeriods": 2, "AlarmArn": "arn:aws:cloudwatch:us-east-1:111122223333:alarm:myHighCpuAlarm", "StateUpdatedTimestamp": "2014-04-09T18:59:06.442Z", "AlarmConfigurationUpdatedTimestamp": "2014-04-09T22:26:05.958Z", "ComparisonOperator": "GreaterThanThreshold", "AlarmActions": [ "arn:aws:sns:us-east-1:111122223333:HighCPUAlarm" ], "Namespace": "AWS/EC2", "AlarmDescription": "CPU usage exceeds 70 percent", "StateReasonData": "{\"version\":\"1.0\",\"queryDate\":\"2014-04-09T18:59:06.419+0000\",\"startDate\":\"2014-04-09T18:44:00.000+0000\",\"statistic\":\"Average\",\"period\":300,\"recentDatapoints\":[38.958,40.292],\"threshold\":70.0}", "Period": 300, "StateValue": "OK", "Threshold": 70.0, "AlarmName": "myHighCpuAlarm", "Dimensions": [ { "Name": "InstanceId", "Value": "i-0c986c72" } ], "Statistic": "Average", "StateReason": "Threshold Crossed: 2 datapoints were not greater than the threshold (70.0). The most recent datapoints: [38.958, 40.292].", "InsufficientDataActions": [], "OKActions": [], "ActionsEnabled": false, "MetricName": "CPUUtilization" } ] } awscli-1.14.44/awscli/examples/cloudwatch/disable-alarm-actions.rst0000666454262600001440000000041613243367510026350 0ustar pysdk-ciamazon00000000000000**To disable actions for an alarm** The following example uses the ``disable-alarm-actions`` command to disable all actions for the alarm named myalarm.:: aws cloudwatch disable-alarm-actions --alarm-names myalarm This command returns to the prompt if successful. awscli-1.14.44/awscli/examples/cloudwatch/list-metrics.rst0000666454262600001440000000473713243367510024646 0ustar pysdk-ciamazon00000000000000**To list the metrics for Amazon EC2** The following example uses the ``list-metrics`` command to list the metrics for Amazon SNS.:: aws cloudwatch list-metrics --namespace "AWS/SNS" Output:: { "Metrics": [ { "Namespace": "AWS/SNS", "Dimensions": [ { "Name": "TopicName", "Value": "NotifyMe" } ], "MetricName": "PublishSize" }, { "Namespace": "AWS/SNS", "Dimensions": [ { "Name": "TopicName", "Value": "CFO" } ], "MetricName": "PublishSize" }, { "Namespace": "AWS/SNS", "Dimensions": [ { "Name": "TopicName", "Value": "NotifyMe" } ], "MetricName": "NumberOfNotificationsFailed" }, { "Namespace": "AWS/SNS", "Dimensions": [ { "Name": "TopicName", "Value": "NotifyMe" } ], "MetricName": "NumberOfNotificationsDelivered" }, { "Namespace": "AWS/SNS", "Dimensions": [ { "Name": "TopicName", "Value": "NotifyMe" } ], "MetricName": "NumberOfMessagesPublished" }, { "Namespace": "AWS/SNS", "Dimensions": [ { "Name": "TopicName", "Value": "CFO" } ], "MetricName": "NumberOfMessagesPublished" }, { "Namespace": "AWS/SNS", "Dimensions": [ { "Name": "TopicName", "Value": "CFO" } ], "MetricName": "NumberOfNotificationsDelivered" }, { "Namespace": "AWS/SNS", "Dimensions": [ { "Name": "TopicName", "Value": "CFO" } ], "MetricName": "NumberOfNotificationsFailed" } ] } awscli-1.14.44/awscli/examples/cloudwatch/describe-alarm-history.rst0000666454262600001440000000355213243367510026572 0ustar pysdk-ciamazon00000000000000**To retrieve history for an alarm** The following example uses the ``describe-alarm-history`` command to retrieve history for the Amazon CloudWatch alarm named "myalarm":: aws cloudwatch describe-alarm-history --alarm-name "myalarm" --history-item-type StateUpdate Output:: { "AlarmHistoryItems": [ { "Timestamp": "2014-04-09T18:59:06.442Z", "HistoryItemType": "StateUpdate", "AlarmName": "myalarm", "HistoryData": "{\"version\":\"1.0\",\"oldState\":{\"stateValue\":\"ALARM\",\"stateReason\":\"testing purposes\"},\"newState\":{\"stateValue\":\"OK\",\"stateReason\":\"Threshold Crossed: 2 datapoints were not greater than the threshold (70.0). The most recent datapoints: [38.958, 40.292].\",\"stateReasonData\":{\"version\":\"1.0\",\"queryDate\":\"2014-04-09T18:59:06.419+0000\",\"startDate\":\"2014-04-09T18:44:00.000+0000\",\"statistic\":\"Average\",\"period\":300,\"recentDatapoints\":[38.958,40.292],\"threshold\":70.0}}}", "HistorySummary": "Alarm updated from ALARM to OK" }, { "Timestamp": "2014-04-09T18:59:05.805Z", "HistoryItemType": "StateUpdate", "AlarmName": "myalarm", "HistoryData": "{\"version\":\"1.0\",\"oldState\":{\"stateValue\":\"OK\",\"stateReason\":\"Threshold Crossed: 2 datapoints were not greater than the threshold (70.0). The most recent datapoints: [38.839999999999996, 39.714].\",\"stateReasonData\":{\"version\":\"1.0\",\"queryDate\":\"2014-03-11T22:45:41.569+0000\",\"startDate\":\"2014-03-11T22:30:00.000+0000\",\"statistic\":\"Average\",\"period\":300,\"recentDatapoints\":[38.839999999999996,39.714],\"threshold\":70.0}},\"newState\":{\"stateValue\":\"ALARM\",\"stateReason\":\"testing purposes\"}}", "HistorySummary": "Alarm updated from OK to ALARM" } ] } awscli-1.14.44/awscli/examples/cloudwatch/put-metric-alarm.rst0000666454262600001440000000260413243367510025401 0ustar pysdk-ciamazon00000000000000**To send an Amazon Simple Notification Service email message when CPU utilization exceeds 70 percent** The following example uses the ``put-metric-alarm`` command to send an Amazon Simple Notification Service email message when CPU utilization exceeds 70 percent:: aws cloudwatch put-metric-alarm --alarm-name cpu-mon --alarm-description "Alarm when CPU exceeds 70 percent" --metric-name CPUUtilization --namespace AWS/EC2 --statistic Average --period 300 --threshold 70 --comparison-operator GreaterThanThreshold --dimensions "Name=InstanceId,Value=i-12345678" --evaluation-periods 2 --alarm-actions arn:aws:sns:us-east-1:111122223333:MyTopic --unit Percent This command returns to the prompt if successful. If an alarm with the same name already exists, it will be overwritten by the new alarm. **To specify multiple dimensions** The following example illustrates how to specify multiple dimensions. Each dimension is specified as a Name/Value pair, with a comma between the name and the value. Multiple dimensions are separated by a space:: aws cloudwatch put-metric-alarm --alarm-name "Default_Test_Alarm3" --alarm-description "The default example alarm" --namespace "CW EXAMPLE METRICS" --metric-name Default_Test --statistic Average --period 60 --evaluation-periods 3 --threshold 50 --comparison-operator GreaterThanOrEqualToThreshold --dimensions Name=key1,Value=value1 Name=key2,Value=value2 awscli-1.14.44/awscli/examples/cloudwatch/enable-alarm-actions.rst0000666454262600001440000000041613243367510026173 0ustar pysdk-ciamazon00000000000000**To enable all actions for an alarm** The following example uses the ``enable-alarm-actions`` command to enable all actions for the alarm named myalarm.:: aws cloudwatch enable-alarm-actions --alarm-names myalarm This command returns to the prompt if successful. awscli-1.14.44/awscli/examples/cloudwatch/delete-alarms.rst0000666454262600001440000000037613243367510024741 0ustar pysdk-ciamazon00000000000000**To delete an alarm** The following example uses the ``delete-alarms`` command to delete the Amazon CloudWatch alarm named "myalarm":: aws cloudwatch delete-alarms --alarm-names myalarm Output:: This command returns to the prompt if successful. awscli-1.14.44/awscli/examples/elbv2/0000777454262600001440000000000013243367512020341 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/elbv2/create-load-balancer.rst0000777454262600001440000001060713243367510025025 0ustar pysdk-ciamazon00000000000000**To create an Internet-facing load balancer** This example creates an Internet-facing Application Load Balancer and enables the Availability Zones for the specified subnets. Command:: aws elbv2 create-load-balancer --name my-load-balancer --subnets subnet-b7d581c0 subnet-8360a9e7 Output:: { "LoadBalancers": [ { "Type": "application", "Scheme": "internet-facing", "IpAddressType": "ipv4", "VpcId": "vpc-3ac0fb5f", "AvailabilityZones": [ { "ZoneName": "us-west-2a", "SubnetId": "subnet-8360a9e7" }, { "ZoneName": "us-west-2b", "SubnetId": "subnet-b7d581c0" } ], "CreatedTime": "2017-08-25T21:26:12.920Z", "CanonicalHostedZoneId": "Z2P70J7EXAMPLE", "DNSName": "my-load-balancer-424835706.us-west-2.elb.amazonaws.com", "SecurityGroups": [ "sg-5943793c" ], "LoadBalancerName": "my-load-balancer", "State": { "Code": "provisioning" }, "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188" } ] } **To create an internal load balancer** This example creates an internal Application Load Balancer and enables the Availability Zones for the specified subnets. Command:: aws elbv2 create-load-balancer --name my-internal-load-balancer --scheme internal --subnets subnet-b7d581c0 subnet-8360a9e7 Output:: { "LoadBalancers": [ { "Type": "application", "Scheme": "internal", "IpAddressType": "ipv4", "VpcId": "vpc-3ac0fb5f", "AvailabilityZones": [ { "ZoneName": "us-west-2a", "SubnetId": "subnet-8360a9e7" }, { "ZoneName": "us-west-2b", "SubnetId": "subnet-b7d581c0" } ], "CreatedTime": "2016-03-25T21:29:48.850Z", "CanonicalHostedZoneId": "Z2P70J7EXAMPLE", "DNSName": "internal-my-internal-load-balancer-1529930873.us-west-2.elb.amazonaws.com", "SecurityGroups": [ "sg-5943793c" ], "LoadBalancerName": "my-internal-load-balancer", "State": { "Code": "provisioning" }, "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-internal-load-balancer/5b49b8d4303115c2" } ] } **To create a Network Load Balancer** This example creates an Internet-facing Network Load Balancer and enables the Availability Zone for the specified subnet. It uses a subnet mapping to associate the specified Elastic IP address with the network interface used by the load balancer nodes for the Availability Zone. Command:: aws elbv2 create-load-balancer --name my-network-load-balancer --type network --subnet-mappings SubnetId=subnet-b7d581c0,AllocationId=eipalloc-64d5890a Output:: { "LoadBalancers": [ { "Type": "network", "Scheme": "internet-facing", "IpAddressType": "ipv4", "VpcId": "vpc-3ac0fb5f", "AvailabilityZones": [ { "LoadBalancerAddresses": [ { "IpAddress": "35.161.207.171", "AllocationId": "eipalloc-64d5890a" } ], "ZoneName": "us-west-2b", "SubnetId": "subnet-5264e837" } ], "CreatedTime": "2017-10-15T22:41:25.657Z", "CanonicalHostedZoneId": "Z2P70J7EXAMPLE", "DNSName": "my-network-load-balancer-5d1b75f4f1cee11e.elb.us-west-2.amazonaws.com", "LoadBalancerName": "my-network-load-balancer", "State": { "Code": "provisioning" }, "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/net/my-network-load-balancer/5d1b75f4f1cee11e" } ] } awscli-1.14.44/awscli/examples/elbv2/set-subnets.rst0000777454262600001440000000116713243367510023355 0ustar pysdk-ciamazon00000000000000**To enable Availability Zones for a load balancer** This example enables the Availability Zone for the specified subnet for the specified load balancer. Command:: aws elbv2 set-subnets --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --subnets subnet-8360a9e7 subnet-b7d581c0 Output:: { "AvailabilityZones": [ { "SubnetId": "subnet-8360a9e7", "ZoneName": "us-west-2a" }, { "SubnetId": "subnet-b7d581c0", "ZoneName": "us-west-2b" } ] } awscli-1.14.44/awscli/examples/elbv2/modify-target-group.rst0000777454262600001440000000241313243367510025001 0ustar pysdk-ciamazon00000000000000**To modify the health check configuration for a target group** This example changes the configuration of the health checks used to evaluate the health of the targets for the specified target group. Command:: aws elbv2 modify-target-group --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-https-targets/2453ed029918f21f --health-check-protocol HTTPS --health-check-port 443 Output:: { "TargetGroups": [ { "HealthCheckIntervalSeconds": 30, "VpcId": "vpc-3ac0fb5f", "Protocol": "HTTPS", "HealthCheckTimeoutSeconds": 5, "HealthCheckProtocol": "HTTPS", "LoadBalancerArns": [ "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188" ], "UnhealthyThresholdCount": 2, "HealthyThresholdCount": 5, "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-https-targets/2453ed029918f21f", "Matcher": { "HttpCode": "200" }, "HealthCheckPort": "443", "Port": 443, "TargetGroupName": "my-https-targets" } ] } awscli-1.14.44/awscli/examples/elbv2/describe-target-group-attributes.rst0000777454262600001440000000136013243367510027456 0ustar pysdk-ciamazon00000000000000**To describe target group attributes** This example describes the attributes of the specified target group. Command:: aws elbv2 describe-target-group-attributes --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "Attributes": [ { "Value": "false", "Key": "stickiness.enabled" }, { "Value": "300", "Key": "deregistration_delay.timeout_seconds" }, { "Value": "lb_cookie", "Key": "stickiness.type" }, { "Value": "86400", "Key": "stickiness.lb_cookie.duration_seconds" } ] } awscli-1.14.44/awscli/examples/elbv2/deregister-targets.rst0000777454262600001440000000125013243367510024676 0ustar pysdk-ciamazon00000000000000**To deregister a target from a target group** This example deregisters the specified instance from the specified target group. Command:: aws elbv2 deregister-targets --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 --targets Id=i-0f76fade **To deregister a target registered using port overrides** This example deregisters an instance that was registered using port overrides. Command:: aws elbv2 deregister-targets --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-internal-targets/3bb63f11dfb0faf9 --targets Id=i-80c8dd94,Port=80 Id=i-80c8dd94,Port=766 awscli-1.14.44/awscli/examples/elbv2/add-tags.rst0000777454262600001440000000051513243367510022561 0ustar pysdk-ciamazon00000000000000**To add tags to a load balancer** This example adds the specified tags to the specified load balancer. Command:: aws elbv2 add-tags --resource-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --tags "Key=project,Value=lima" "Key=department,Value=digital-media" awscli-1.14.44/awscli/examples/elbv2/modify-listener.rst0000777454262600001440000000455513243367510024217 0ustar pysdk-ciamazon00000000000000**To change the default action** This example changes the default action for the specified listener. Command:: aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f Output:: { "Listeners": [ { "Protocol": "HTTP", "DefaultActions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-new-targets/2453ed029918f21f", "Type": "forward" } ], "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "Port": 80, "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2" } ] } **To change the server certificate** This example changes the server certificate for the specified HTTPS listener. Command:: aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65 --certificates CertificateArn=arn:aws:iam::123456789012:server-certificate/my-new-server-cert Output:: { "Listeners": [ { "Protocol": "HTTPS", "DefaultActions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "Type": "forward" } ], "SslPolicy": "ELBSecurityPolicy-2015-05", "Certificates": [ { "CertificateArn": "arn:aws:iam::123456789012:server-certificate/my-new-server-cert" } ], "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "Port": 443, "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65" } ] } awscli-1.14.44/awscli/examples/elbv2/describe-load-balancer-attributes.rst0000777454262600001440000000151213243367510027521 0ustar pysdk-ciamazon00000000000000**To describe load balancer attributes** This example describes the attributes of the specified load balancer. Command:: aws elbv2 describe-load-balancer-attributes --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 Output:: { "Attributes": [ { "Value": "false", "Key": "access_logs.s3.enabled" }, { "Value": "60", "Key": "idle_timeout.timeout_seconds" }, { "Value": "", "Key": "access_logs.s3.prefix" }, { "Value": "false", "Key": "deletion_protection.enabled" }, { "Value": "", "Key": "access_logs.s3.bucket" } ] } awscli-1.14.44/awscli/examples/elbv2/describe-listener-certificates.rst0000666454262600001440000000157713243367510027151 0ustar pysdk-ciamazon00000000000000**To describe the certificates for a secure listener** This example describes the certificates for the specified secure listener. Command:: aws elbv2 describe-listener-certificates --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 Output:: { "Certificates": [ { "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/5cc54884-f4a3-4072-80be-05b9ba72f705", "IsDefault": false }, { "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/3dcb0a41-bd72-4774-9ad9-756919c40557", "IsDefault": false }, { "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/fe59da96-6f58-4a22-8eed-6d0d50477e1d", "IsDefault": true } ] } awscli-1.14.44/awscli/examples/elbv2/register-targets.rst0000777454262600001440000000231013243367510024363 0ustar pysdk-ciamazon00000000000000**To register targets with a target group by instance ID** This example registers the specified instances with the specified target group. Command:: aws elbv2 register-targets --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 --targets Id=i-80c8dd94 Id=i-ceddcd4d **To register targets with a target group by IP address** This example registers the specified IP addresses with the specified target group. The target group must have a target type of ``ip``. Command:: aws elbv2 register-targets --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-tcp-ip-targets/8518e899d173178f --targets Id=10.0.1.15 Id=10.0.1.23 **To register targets with a target group using port overrides** This example registers the specified instance with the specified target group using multiple ports. This enables you to register ECS containers on the same instance as targets in the target group. Command:: aws elbv2 register-targets --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-internal-targets/3bb63f11dfb0faf9 --targets Id=i-80c8dd94,Port=80 Id=i-80c8dd94,Port=766 awscli-1.14.44/awscli/examples/elbv2/delete-rule.rst0000777454262600001440000000037713243367510023312 0ustar pysdk-ciamazon00000000000000**To delete a rule** This example deletes the specified rule. Command:: aws elbv2 delete-rule --rule-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3 awscli-1.14.44/awscli/examples/elbv2/set-ip-address-type.rst0000666454262600001440000000077413243367510024704 0ustar pysdk-ciamazon00000000000000**To set the address type of a load balancer** This example sets the address type of the specified load balancer to ``dualstack``. The load balancer must be an Internet-facing load balancer and its subnets must have associated IPv6 CIDR blocks. Command:: aws elbv2 set-ip-address-type --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --ip-address-type dualstack Output:: { "IpAddressType": "dualstack" } awscli-1.14.44/awscli/examples/elbv2/describe-rules.rst0000777454262600001440000000656213243367510024015 0ustar pysdk-ciamazon00000000000000**To describe a rule** This example describes the specified rule. Command:: aws elbv2 describe-rules --rule-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee Output:: { "Rules": [ { "Priority": "10", "Conditions": [ { "Field": "path-pattern", "Values": [ "/img/*" ] } ], "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee", "IsDefault": false, "Actions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets-2/113872332242cd5b", "Type": "forward" } ] } ] } **To describe the rules for a listener** This example describes the rules for the specified listener. The output includes the default rule and any other rules that you've defined. Command:: aws elbv2 describe-rules --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 Output:: { "Rules": [ { "Priority": "5", "IsDefault": false, "Actions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets-1/b6bba954d1361c78", "Type": "forward" } ], "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/db8b4ff9007785e9", "Conditions": [ { "Field": "host-header", "Values": [ "*.example.com" ] } ] }, { "Priority": "10", "IsDefault": false, "Actions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets-2/113872332242cd5b", "Type": "forward" } ], "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee", "Conditions": [ { "Field": "path-pattern", "Values": [ "/img/*" ] } ] }, { "Priority": "default", "IsDefault": true, "Actions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-default-targets/a8173c00fbbe7b8d", "Type": "forward" } ], "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/fd906cf3d7a9d36d", "Conditions": [] } ] } awscli-1.14.44/awscli/examples/elbv2/add-listener-certificates.rst0000666454262600001440000000121513243367510026106 0ustar pysdk-ciamazon00000000000000**To add a certificate to a secure listener** This example adds the specified certificate to the specified secure listener. Command:: aws elbv2 add-listener-certificates --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 --certificates CertificateArn=arn:aws:acm:us-west-2:123456789012:certificate/5cc54884-f4a3-4072-80be-05b9ba72f705 Output:: { "Certificates": [ { "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/5cc54884-f4a3-4072-80be-05b9ba72f705", "IsDefault": false } ] } awscli-1.14.44/awscli/examples/elbv2/delete-target-group.rst0000777454262600001440000000036113243367510024754 0ustar pysdk-ciamazon00000000000000**To delete a target group** This example deletes the specified target group. Command:: aws elbv2 delete-target-group --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 awscli-1.14.44/awscli/examples/elbv2/describe-account-limits.rst0000666454262600001440000000205113243367510025600 0ustar pysdk-ciamazon00000000000000**To describe your Elastic Load Balancing limits** This example describes the Elastic Load Balancing limits for your AWS account. Command:: aws elbv2 describe-account-limits Output:: { "Limits": [ { "Name": "application-load-balancers", "Max": "20" }, { "Name": "target-groups", "Max": "3000" }, { "Name": "targets-per-application-load-balancer", "Max": "1000" }, { "Name": "listeners-per-application-load-balancer", "Max": "50" }, { "Name": "rules-per-application-load-balancer", "Max": "100" }, { "Name": "network-load-balancers", "Max": "20" }, { "Name": "targets-per-network-load-balancer", "Max": "200" }, { "Name": "listeners-per-network-load-balancer", "Max": "50" } ] } awscli-1.14.44/awscli/examples/elbv2/set-rule-priorities.rst0000777454262600001440000000206613243367510025027 0ustar pysdk-ciamazon00000000000000**To set the rule priority** This example sets the priority of the specified rule. Command:: aws elbv2 set-rule-priorities --rule-priorities RuleArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3,Priority=5 Output:: { "Rules": [ { "Priority": "5", "Conditions": [ { "Field": "path-pattern", "Values": [ "/img/*" ] } ], "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/1291d13826f405c3", "IsDefault": false, "Actions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "Type": "forward" } ] } ] } awscli-1.14.44/awscli/examples/elbv2/create-rule.rst0000777454262600001440000000520713243367510023310 0ustar pysdk-ciamazon00000000000000**To create a rule using a path condition** This example creates a rule that forwards requests to the specified target group if the URL contains the specified pattern (for example, /img/*). Command:: aws elbv2 create-rule --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 --priority 10 --conditions Field=path-pattern,Values='/img/*' --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "Rules": [ { "Actions": [ { "Type": "forward", "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067" } ], "IsDefault": false, "Conditions": [ { "Field": "path-pattern", "Values": [ "/img/*" ] } ], "Priority": "10", "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee" } ] } **To create a rule using a host condition** This example creates a rule that forwards requests to the specified target group if the hostname in the host header matches the specified hostname (for example, *.example.com). Command:: aws elbv2 create-rule --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 --priority 5 --conditions Field=host-header,Values='*.example.com' --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "Rules": [ { "Actions": [ { "Type": "forward", "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067" } ], "IsDefault": false, "Conditions": [ { "Field": "host-header", "Values": [ "*.example.com" ] } ], "Priority": "5", "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/db8b4ff9007785e9" } ] } awscli-1.14.44/awscli/examples/elbv2/modify-target-group-attributes.rst0000777454262600001440000000153213243367510027166 0ustar pysdk-ciamazon00000000000000**To modify the deregistration delay timeout** This example sets the deregistration delay timeout to the specified value for the specified target group. Command:: aws elbv2 modify-target-group-attributes --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 --attributes Key=deregistration_delay.timeout_seconds,Value=600 Output:: { "Attributes": [ { "Value": "false", "Key": "stickiness.enabled" }, { "Value": "600", "Key": "deregistration_delay.timeout_seconds" }, { "Value": "lb_cookie", "Key": "stickiness.type" }, { "Value": "86400", "Key": "stickiness.lb_cookie.duration_seconds" } ] } awscli-1.14.44/awscli/examples/elbv2/describe-tags.rst0000777454262600001440000000142113243367510023606 0ustar pysdk-ciamazon00000000000000**To describe the tags assigned to a load balancer** This example describes the tags assigned to the specified load balancer. Command:: aws elbv2 describe-tags --resource-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 Output:: { "TagDescriptions": [ { "ResourceArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "Tags": [ { "Value": "lima", "Key": "project" }, { "Value": "digital-media", "Key": "department" } ] } ] } awscli-1.14.44/awscli/examples/elbv2/modify-rule.rst0000777454262600001440000000211113243367510023323 0ustar pysdk-ciamazon00000000000000**To modify a rule** This example modifies the condition for the specified rule. Command:: aws elbv2 modify-rule --rule-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee --conditions Field=path-pattern,Values='/images/*' Output:: { "Rules": [ { "Priority": "10", "Conditions": [ { "Field": "path-pattern", "Values": [ "/images/*" ] } ], "RuleArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener-rule/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2/9683b2d02a6cabee", "IsDefault": false, "Actions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "Type": "forward" } ] } ] } awscli-1.14.44/awscli/examples/elbv2/describe-ssl-policies.rst0000777454262600001440000000233013243367510025256 0ustar pysdk-ciamazon00000000000000**To describe a policy used for SSL negotiation** This example describes the specified policy used for SSL negotiation. Command:: aws elbv2 describe-ssl-policies --names ELBSecurityPolicy-2015-05 Output:: { "SslPolicies": [ { "SslProtocols": [ "TLSv1", "TLSv1.1", "TLSv1.2" ], "Ciphers": [ { "Priority": 1, "Name": "ECDHE-ECDSA-AES128-GCM-SHA256" }, { "Priority": 2, "Name": "ECDHE-RSA-AES128-GCM-SHA256" }, { "Priority": 3, "Name": "ECDHE-ECDSA-AES128-SHA256" }, ... { "Priority": 19, "Name": "AES256-SHA" } ], "Name": "ELBSecurityPolicy-2015-05" } ] } **To describe all policies used for SSL negotiation** This example describes all the policies that you can use for SSL negotiation. Command:: aws elbv2 describe-ssl-policies awscli-1.14.44/awscli/examples/elbv2/describe-target-health.rst0000777454262600001440000000611013243367510025401 0ustar pysdk-ciamazon00000000000000**To describe the health of the targets for a target group** This example describes the health of the targets for the specified target group. These targets are healthy. Command:: aws elbv2 describe-target-health --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "TargetHealthDescriptions": [ { "HealthCheckPort": "80", "Target": { "Id": "i-ceddcd4d", "Port": 80 }, "TargetHealth": { "State": "healthy" } }, { "HealthCheckPort": "80", "Target": { "Id": "i-0f76fade", "Port": 80 }, "TargetHealth": { "State": "healthy" } } ] } **To describe the health of a target** This example describes the health of the specified target. This target is healthy. Command:: aws elbv2 describe-target-health --targets Id=i-0f76fade,Port=80 --target-group-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "TargetHealthDescriptions": [ { "HealthCheckPort": "80", "Target": { "Id": "i-0f76fade", "Port": 80 }, "TargetHealth": { "State": "healthy" } } ] } The following is an example response for a target whose target group is not specified in an action for a listener. This target can't receive traffic from the load balancer. Output:: { "TargetHealthDescriptions": [ { "Target": { "Id": "i-0f76fade", "Port": 80 }, "TargetHealth": { "State": "unused", "Reason": "Target.NotInUse", "Description": "Given target group is not configured to receive traffic from ELB" } } ] } The following is an example response for a target who target group was just specified in an action for a listener. The target is still being registered. Output:: { "TargetHealthDescriptions": [ { "Target": { "Id": "i-0f76fade", "Port": 80 }, "TargetHealth": { "State": "initial", "Reason": "Elb.RegistrationInProgress", "Description": "Target registration is in progress" } } ] } The following is an example response for an unhealthy target. Output:: { "TargetHealthDescriptions": [ { "Target": { "Id": "i-0f76fade", "Port": 80 }, "TargetHealth": { "State": "unhealthy", "Reason": "Target.Timeout", "Description": "Connection to target timed out" } } ] } awscli-1.14.44/awscli/examples/elbv2/modify-load-balancer-attributes.rst0000777454262600001440000000557413243367510027244 0ustar pysdk-ciamazon00000000000000**To enable deletion protection** This example enables deletion protection for the specified load balancer. Command:: aws elbv2 modify-load-balancer-attributes --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --attributes Key=deletion_protection.enabled,Value=true Output:: { "Attributes": [ { "Value": "true", "Key": "deletion_protection.enabled" }, { "Value": "false", "Key": "access_logs.s3.enabled" }, { "Value": "60", "Key": "idle_timeout.timeout_seconds" }, { "Value": "", "Key": "access_logs.s3.prefix" }, { "Value": "", "Key": "access_logs.s3.bucket" } ] } **To change the idle timeout** This example changes the idle timeout value for the specified load balancer. Command:: aws elbv2 modify-load-balancer-attributes --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --attributes Key=idle_timeout.timeout_seconds,Value=30 Output:: { "Attributes": [ { "Value": "30", "Key": "idle_timeout.timeout_seconds" }, { "Value": "false", "Key": "access_logs.s3.enabled" }, { "Value": "", "Key": "access_logs.s3.prefix" }, { "Value": "true", "Key": "deletion_protection.enabled" }, { "Value": "", "Key": "access_logs.s3.bucket" } ] } **To enable access logs** This example enables access logs for the specified load balancer. Note that the S3 bucket must exist in the same region as the load balancer and must have a policy attached that grants access to the Elastic Load Balancing service. Command:: aws elbv2 modify-load-balancer-attributes --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --attributes Key=access_logs.s3.enabled,Value=true Key=access_logs.s3.bucket,Value=my-loadbalancer-logs Key=access_logs.s3.prefix,Value=myapp Output:: { "Attributes": [ { "Value": "true", "Key": "access_logs.s3.enabled" }, { "Value": "my-load-balancer-logs", "Key": "access_logs.s3.bucket" }, { "Value": "myapp", "Key": "access_logs.s3.prefix" }, { "Value": "60", "Key": "idle_timeout.timeout_seconds" }, { "Value": "false", "Key": "deletion_protection.enabled" } ] } awscli-1.14.44/awscli/examples/elbv2/create-target-group.rst0000777454262600001440000000530013243367510024753 0ustar pysdk-ciamazon00000000000000**To create a target group for an Application Load Balancer** This example creates a target group that you can use to route traffic to targets using HTTP on port 80. This target group uses the default health check configuration for an HTTP or HTTPS target group. Command:: aws elbv2 create-target-group --name my-targets --protocol HTTP --port 80 --vpc-id vpc-3ac0fb5f Output:: { "TargetGroups": [ { "TargetGroupName": "my-targets", "Protocol": "HTTP", "Port": 80, "VpcId": "vpc-3ac0fb5f", "TargetType": "instance", "HealthyThresholdCount": 5, "Matcher": { "HttpCode": "200" }, "UnhealthyThresholdCount": 2, "HealthCheckPath": "/", "HealthCheckProtocol": "HTTP", "HealthCheckPort": "traffic-port", "HealthCheckIntervalSeconds": 30, "HealthCheckTimeoutSeconds": 5, "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067" } ] } By default, targets are registered by instance ID. To register targets by IP address, create a target group with a target type of ``ip``. Command:: aws elbv2 create-target-group --name my-ip-targets --protocol HTTP --port 80 --target-type ip --vpc-id vpc-3ac0fb5f **To create a target group for a Network Load Balancer** This example creates a target group that you can use to route traffic to targets using TCP on port 80. This target group uses the default health check configuration for a TCP target group. Command:: aws elbv2 create-target-group --name my-tcp-targets --protocol TCP --port 80 --vpc-id vpc-3ac0fb5f Output:: { "TargetGroups": [ { "TargetGroupName": "my-tcp-targets", "Protocol": "TCP", "Port": 80, "VpcId": "vpc-3ac0fb5f", "TargetType": "instance", "HealthyThresholdCount": 3, "Matcher": {}, "UnhealthyThresholdCount": 3, "HealthCheckProtocol": "TCP", "HealthCheckPort": "traffic-port", "HealthCheckIntervalSeconds": 30, "HealthCheckTimeoutSeconds": 10, "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-tcp-targets/b6bba954d1361c78" } ] } By default, targets are registered by instance ID. To register targets by IP address, create a target group with a target type of ``ip``. Command:: aws elbv2 create-target-group --name my-tcp-ip-targets --protocol TCP --port 80 --target-type ip --vpc-id vpc-3ac0fb5f awscli-1.14.44/awscli/examples/elbv2/delete-load-balancer.rst0000777454262600001440000000040013243367510025012 0ustar pysdk-ciamazon00000000000000**To delete a load balancer** This example deletes the specified load balancer. Command:: aws elbv2 delete-load-balancer --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 awscli-1.14.44/awscli/examples/elbv2/create-listener.rst0000777454262600001440000001034313243367510024163 0ustar pysdk-ciamazon00000000000000**To create an HTTP listener** This example creates an HTTP listener for the specified Application Load Balancer that forwards requests to the specified target group. Command:: aws elbv2 create-listener --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --protocol HTTP --port 80 --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "Listeners": [ { "Protocol": "HTTP", "Port": 80, "DefaultActions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "Type": "forward" } ], "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2" } ] } **To create an HTTPS listener** This example creates an HTTPS listener for the specified Application Load Balancer that forwards requests to the specified target group. Note that you must specify an SSL certificate for an HTTPS listener. You can create and manage certificates using AWS Certificate Manager (ACM). Alternatively, you can create a certificate using SSL/TLS tools, get the certificate signed by a certificate authority (CA), and upload the certificate to AWS Identity and Access Management (IAM). Command:: aws elbv2 create-listener --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --protocol HTTPS --port 443 --certificates CertificateArn=arn:aws:acm:us-west-2:123456789012:certificate/3dcb0a41-bd72-4774-9ad9-756919c40557 --ssl-policy ELBSecurityPolicy-2016-08 --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "Listeners": [ { "Protocol": "HTTPS", "Port": 443, "DefaultActions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "Type": "forward" } ], "SslPolicy": "ELBSecurityPolicy-2016-08", "Certificates": [ { "CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/3dcb0a41-bd72-4774-9ad9-756919c40557" } ], "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2" } ] } **To create a TCP listener** This example creates a TCP listener for the specified Network Load Balancer that forwards requests to the specified target group. Command:: aws elbv2 create-listener --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/net/my-network-load-balancer/5d1b75f4f1cee11e --protocol TCP --port 80 --default-actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-tcp-targets/b6bba954d1361c78 Output:: { "Listeners": [ { "Protocol": "TCP", "Port": 80, "DefaultActions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-tcp-targets/b6bba954d1361c78", "Type": "forward" } ], "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/net/my-network-load-balancer/5d1b75f4f1cee11e", "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/net/my-network-load-balancer/5d1b75f4f1cee11e/08f101851e4bca2c" } ] } awscli-1.14.44/awscli/examples/elbv2/remove-listener-certificates.rst0000666454262600001440000000067013243367510026657 0ustar pysdk-ciamazon00000000000000**To remove a certificate from a secure listener** This example removes the specified certificate from the specified secure listener. Command:: aws elbv2 remove-listener-certificates --listener-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 --certificates CertificateArn=arn:aws:acm:us-west-2:123456789012:certificate/5cc54884-f4a3-4072-80be-05b9ba72f705 awscli-1.14.44/awscli/examples/elbv2/set-security-groups.rst0000777454262600001440000000065413243367510025056 0ustar pysdk-ciamazon00000000000000**To associate a security group with a load balancer** This example associates the specified security group with the specified load balancer. Command:: aws elbv2 set-security-groups --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --security-groups sg-5943793c Output:: { "SecurityGroupIds": [ "sg-5943793c" ] } awscli-1.14.44/awscli/examples/elbv2/describe-listeners.rst0000777454262600001440000000532413243367510024666 0ustar pysdk-ciamazon00000000000000**To describe a listener** This example describes the specified listener. Command:: aws elbv2 describe-listeners --listener-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 Output:: { "Listeners": [ { "Port": 80, "Protocol": "HTTP", "DefaultActions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "Type": "forward" } ], "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2" } ] } **To describe the listeners for a load balancer** This example describe the listeners for the specified load balancer. Command:: aws elbv2 describe-listeners --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 Output:: { "Listeners": [ { "Port": 443, "Protocol": "HTTPS", "DefaultActions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "Type": "forward" } ], "SslPolicy": "ELBSecurityPolicy-2015-05", "Certificates": [ { "CertificateArn": "arn:aws:iam::123456789012:server-certificate/my-server-cert" } ], "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/0467ef3c8400ae65" }, { "Port": 80, "Protocol": "HTTP", "DefaultActions": [ { "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "Type": "forward" } ], "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188", "ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2" } ] } awscli-1.14.44/awscli/examples/elbv2/describe-load-balancers.rst0000777454262600001440000000274113243367510025525 0ustar pysdk-ciamazon00000000000000**To describe a load balancer** This example describes the specified load balancer. Command:: aws elbv2 describe-load-balancers --load-balancer-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 Output:: { "LoadBalancers": [ { "Type": "application", "Scheme": "internet-facing", "IpAddressType": "ipv4", "VpcId": "vpc-3ac0fb5f", "AvailabilityZones": [ { "ZoneName": "us-west-2a", "SubnetId": "subnet-8360a9e7" }, { "ZoneName": "us-west-2b", "SubnetId": "subnet-b7d581c0" } ], "CreatedTime": "2016-03-25T21:26:12.920Z", "CanonicalHostedZoneId": "Z2P70J7EXAMPLE", "DNSName": "my-load-balancer-424835706.us-west-2.elb.amazonaws.com", "SecurityGroups": [ "sg-5943793c" ], "LoadBalancerName": "my-load-balancer", "State": { "Code": "active" }, "LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188" } ] } **To describe all load balancers** This example describes all of your load balancers. Command:: aws elbv2 describe-load-balancers awscli-1.14.44/awscli/examples/elbv2/delete-listener.rst0000777454262600001440000000037113243367510024162 0ustar pysdk-ciamazon00000000000000**To delete a listener** This example deletes the specified listener. Command:: aws elbv2 delete-listener --listener-arn arn:aws:elasticloadbalancing:ua-west-2:123456789012:listener/app/my-load-balancer/50dc6c495c0c9188/f2f7dc8efc522ab2 awscli-1.14.44/awscli/examples/elbv2/remove-tags.rst0000777454262600001440000000046313243367510023330 0ustar pysdk-ciamazon00000000000000**To remove tags from a load balancer** This example removes the specified tags from the specified load balancer. Command:: aws elbv2 remove-tags --resource-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 --tag-keys project department awscli-1.14.44/awscli/examples/elbv2/describe-target-groups.rst0000777454262600001440000000314313243367510025456 0ustar pysdk-ciamazon00000000000000**To describe a target group** This example describes the specified target group. Command:: aws elbv2 describe-target-groups --target-group-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 Output:: { "TargetGroups": [ { "TargetGroupName": "my-targets" "Protocol": "HTTP", "Port": 80, "VpcId": "vpc-3ac0fb5f", "TargetType": "instance", "HealthyThresholdCount": 5, "Matcher": { "HttpCode": "200" }, "UnhealthyThresholdCount": 2, "HealthCheckPath": "/", "HealthCheckProtocol": "HTTP", "HealthCheckPort": "traffic-port", "HealthCheckIntervalSeconds": 30, "HealthCheckTimeoutSeconds": 5, "TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "LoadBalancerArns": [ "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188" ] } ] } **To describe all target groups for a load balancer** This example describes all target groups for the specified load balancer. Command:: aws elbv2 describe-target-groups --load-balancer-arn arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/my-load-balancer/50dc6c495c0c9188 **To describe all target groups** This example describes all of your target groups. Command:: aws elbv2 describe-target-groups awscli-1.14.44/awscli/examples/elasticbeanstalk/0000777454262600001440000000000013243367512022640 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-instances-health.rst0000666454262600001440000000400413243367510030376 0ustar pysdk-ciamazon00000000000000**To view environment health** The following command retrieves health information for instances in an environment named ``my-env``:: aws elasticbeanstalk describe-instances-health --environment-name my-env --attribute-names All Output:: { "InstanceHealthList": [ { "InstanceId": "i-08691cc7", "ApplicationMetrics": { "Duration": 10, "Latency": { "P99": 0.006, "P75": 0.002, "P90": 0.004, "P95": 0.005, "P85": 0.003, "P10": 0.0, "P999": 0.006, "P50": 0.001 }, "RequestCount": 48, "StatusCodes": { "Status3xx": 0, "Status2xx": 47, "Status5xx": 0, "Status4xx": 1 } }, "System": { "LoadAverage": [ 0.0, 0.02, 0.05 ], "CPUUtilization": { "SoftIRQ": 0.1, "IOWait": 0.2, "System": 0.3, "Idle": 97.8, "User": 1.5, "IRQ": 0.0, "Nice": 0.1 } }, "Color": "Green", "HealthStatus": "Ok", "LaunchedAt": "2015-08-13T19:17:09Z", "Causes": [] } ], "RefreshedAt": "2015-08-20T21:09:08Z" } Health information is only available for environments with enhanced health reporting enabled. For more information, see `Enhanced Health Reporting and Monitoring`_ in the *AWS Elastic Beanstalk Developer Guide*. .. _`Enhanced Health Reporting and Monitoring`: http://integ-docs-aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced.html awscli-1.14.44/awscli/examples/elasticbeanstalk/list-available-solution-stacks.rst0000666454262600001440000000500013243367510031414 0ustar pysdk-ciamazon00000000000000**To view solution stacks** The following command lists solution stacks for all currently available platform configurations and any that you have used in the past:: aws elasticbeanstalk list-available-solution-stacks Output (abbreviated):: { "SolutionStacks": [ "64bit Amazon Linux 2015.03 v2.0.0 running Node.js", "64bit Amazon Linux 2015.03 v2.0.0 running PHP 5.6", "64bit Amazon Linux 2015.03 v2.0.0 running PHP 5.5", "64bit Amazon Linux 2015.03 v2.0.0 running PHP 5.4", "64bit Amazon Linux 2015.03 v2.0.0 running Python 3.4", "64bit Amazon Linux 2015.03 v2.0.0 running Python 2.7", "64bit Amazon Linux 2015.03 v2.0.0 running Python", "64bit Amazon Linux 2015.03 v2.0.0 running Ruby 2.2 (Puma)", "64bit Amazon Linux 2015.03 v2.0.0 running Ruby 2.2 (Passenger Standalone)", "64bit Amazon Linux 2015.03 v2.0.0 running Ruby 2.1 (Puma)", "64bit Amazon Linux 2015.03 v2.0.0 running Ruby 2.1 (Passenger Standalone)", "64bit Amazon Linux 2015.03 v2.0.0 running Ruby 2.0 (Puma)", "64bit Amazon Linux 2015.03 v2.0.0 running Ruby 2.0 (Passenger Standalone)", "64bit Amazon Linux 2015.03 v2.0.0 running Ruby 1.9.3", "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8", "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 7 Java 7", "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 7 Java 6", "64bit Windows Server Core 2012 R2 running IIS 8.5", "64bit Windows Server 2012 R2 running IIS 8.5", "64bit Windows Server 2012 running IIS 8", "64bit Windows Server 2008 R2 running IIS 7.5", "64bit Amazon Linux 2015.03 v2.0.0 running Docker 1.6.2", "64bit Amazon Linux 2015.03 v2.0.0 running Multi-container Docker 1.6.2 (Generic)", "64bit Debian jessie v2.0.0 running GlassFish 4.1 Java 8 (Preconfigured - Docker)", "64bit Debian jessie v2.0.0 running GlassFish 4.0 Java 7 (Preconfigured - Docker)", "64bit Debian jessie v2.0.0 running Go 1.4 (Preconfigured - Docker)", "64bit Debian jessie v2.0.0 running Go 1.3 (Preconfigured - Docker)", "64bit Debian jessie v2.0.0 running Python 3.4 (Preconfigured - Docker)", ], "SolutionStackDetails": [ { "PermittedFileTypes": [ "zip" ], "SolutionStackName": "64bit Amazon Linux 2015.03 v2.0.0 running Node.js" }, ... ] } awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-environment-resources.rst0000666454262600001440000000173213243367510031525 0ustar pysdk-ciamazon00000000000000**To view information about the AWS resources in your environment** The following command retrieves information about resources in an environment named ``my-env``:: aws elasticbeanstalk describe-environment-resources --environment-name my-env Output:: { "EnvironmentResources": { "EnvironmentName": "my-env", "AutoScalingGroups": [ { "Name": "awseb-e-qu3fyyjyjs-stack-AWSEBAutoScalingGroup-QSB2ZO88SXZT" } ], "Triggers": [], "LoadBalancers": [ { "Name": "awseb-e-q-AWSEBLoa-1EEPZ0K98BIF0" } ], "Queues": [], "Instances": [ { "Id": "i-0c91c786" } ], "LaunchConfigurations": [ { "Name": "awseb-e-qu3fyyjyjs-stack-AWSEBAutoScalingLaunchConfiguration-1UUVQIBC96TQ2" } ] } } awscli-1.14.44/awscli/examples/elasticbeanstalk/swap-environment-cnames.rst0000666454262600001440000000035413243367510030152 0ustar pysdk-ciamazon00000000000000**To swap environment CNAMES** The following command swaps the assigned subdomains of two environments:: aws elasticbeanstalk swap-environment-cnames --source-environment-name my-env-blue --destination-environment-name my-env-green awscli-1.14.44/awscli/examples/elasticbeanstalk/restart-app-server.rst0000666454262600001440000000032213243367510027133 0ustar pysdk-ciamazon00000000000000**To restart application servers** The following command restarts application servers on all instances in an environment named ``my-env``:: aws elasticbeanstalk restart-app-server --environment-name my-env awscli-1.14.44/awscli/examples/elasticbeanstalk/validate-configuration-settings.rst0000666454262600001440000000523013243367510031664 0ustar pysdk-ciamazon00000000000000**To validate configuration settings** The following command validates a CloudWatch custom metrics config document:: aws elasticbeanstalk validate-configuration-settings --application-name my-app --environment-name my-env --option-settings file://options.json ``options.json`` is a JSON document that includes one or more configuration settings to validate:: [ { "Namespace": "aws:elasticbeanstalk:healthreporting:system", "OptionName": "ConfigDocument", "Value": "{\"CloudWatchMetrics\": {\"Environment\": {\"ApplicationLatencyP99.9\": null,\"InstancesSevere\": 60,\"ApplicationLatencyP90\": 60,\"ApplicationLatencyP99\": null,\"ApplicationLatencyP95\": 60,\"InstancesUnknown\": 60,\"ApplicationLatencyP85\": 60,\"InstancesInfo\": null,\"ApplicationRequests2xx\": null,\"InstancesDegraded\": null,\"InstancesWarning\": 60,\"ApplicationLatencyP50\": 60,\"ApplicationRequestsTotal\": null,\"InstancesNoData\": null,\"InstancesPending\": 60,\"ApplicationLatencyP10\": null,\"ApplicationRequests5xx\": null,\"ApplicationLatencyP75\": null,\"InstancesOk\": 60,\"ApplicationRequests3xx\": null,\"ApplicationRequests4xx\": null},\"Instance\": {\"ApplicationLatencyP99.9\": null,\"ApplicationLatencyP90\": 60,\"ApplicationLatencyP99\": null,\"ApplicationLatencyP95\": null,\"ApplicationLatencyP85\": null,\"CPUUser\": 60,\"ApplicationRequests2xx\": null,\"CPUIdle\": null,\"ApplicationLatencyP50\": null,\"ApplicationRequestsTotal\": 60,\"RootFilesystemUtil\": null,\"LoadAverage1min\": null,\"CPUIrq\": null,\"CPUNice\": 60,\"CPUIowait\": 60,\"ApplicationLatencyP10\": null,\"LoadAverage5min\": null,\"ApplicationRequests5xx\": null,\"ApplicationLatencyP75\": 60,\"CPUSystem\": 60,\"ApplicationRequests3xx\": 60,\"ApplicationRequests4xx\": null,\"InstanceHealth\": null,\"CPUSoftirq\": 60}},\"Version\": 1}" } ] If the options that you specify are valid for the specified environment, Elastic Beanstalk returns an empty Messages array:: { "Messages": [] } If validation fails, the response will include information about the error:: { "Messages": [ { "OptionName": "ConfigDocumet", "Message": "Invalid option specification (Namespace: 'aws:elasticbeanstalk:healthreporting:system', OptionName: 'ConfigDocumet'): Unknown configuration setting.", "Namespace": "aws:elasticbeanstalk:healthreporting:system", "Severity": "error" } ] } For more information about namespaces and supported options, see `Option Values`_ in the *AWS Elastic Beanstalk Developer Guide*. .. _`Option Values`: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-applications.rst0000666454262600001440000000237413243367510027642 0ustar pysdk-ciamazon00000000000000**To view a list of applications** The following command retrieves information about applications in the current region:: aws elasticbeanstalk describe-applications Output:: { "Applications": [ { "ApplicationName": "ruby", "ConfigurationTemplates": [], "DateUpdated": "2015-08-13T21:05:44.376Z", "Versions": [ "Sample Application" ], "DateCreated": "2015-08-13T21:05:44.376Z" }, { "ApplicationName": "pythonsample", "Description": "Application created from the EB CLI using \"eb init\"", "Versions": [ "Sample Application" ], "DateCreated": "2015-08-13T19:05:43.637Z", "ConfigurationTemplates": [], "DateUpdated": "2015-08-13T19:05:43.637Z" }, { "ApplicationName": "nodejs-example", "ConfigurationTemplates": [], "DateUpdated": "2015-08-06T17:50:02.486Z", "Versions": [ "add elasticache", "First Release" ], "DateCreated": "2015-08-06T17:50:02.486Z" } ] } awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-configuration-settings.rst0000666454262600001440000000405713243367510031661 0ustar pysdk-ciamazon00000000000000**To view configurations settings for an environment** The following command retrieves configuration settings for an environment named ``my-env``:: aws elasticbeanstalk describe-configuration-settings --environment-name my-env --application-name my-app Output (abbreviated):: { "ConfigurationSettings": [ { "ApplicationName": "my-app", "EnvironmentName": "my-env", "Description": "Environment created from the EB CLI using \"eb create\"", "DeploymentStatus": "deployed", "DateCreated": "2015-08-13T19:16:25Z", "OptionSettings": [ { "OptionName": "Availability Zones", "ResourceName": "AWSEBAutoScalingGroup", "Namespace": "aws:autoscaling:asg", "Value": "Any" }, { "OptionName": "Cooldown", "ResourceName": "AWSEBAutoScalingGroup", "Namespace": "aws:autoscaling:asg", "Value": "360" }, ... { "OptionName": "ConnectionDrainingTimeout", "ResourceName": "AWSEBLoadBalancer", "Namespace": "aws:elb:policies", "Value": "20" }, { "OptionName": "ConnectionSettingIdleTimeout", "ResourceName": "AWSEBLoadBalancer", "Namespace": "aws:elb:policies", "Value": "60" } ], "DateUpdated": "2015-08-13T23:30:07Z", "SolutionStackName": "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8" } ] } For more information about namespaces and supported options, see `Option Values`_ in the *AWS Elastic Beanstalk Developer Guide*. .. _`Option Values`: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html awscli-1.14.44/awscli/examples/elasticbeanstalk/create-storage-location.rst0000666454262600001440000000034213243367510030102 0ustar pysdk-ciamazon00000000000000**To create a storage location** The following command creates a storage location in Amazon S3:: aws elasticbeanstalk create-storage-location Output:: { "S3Bucket": "elasticbeanstalk-us-west-2-0123456789012" } awscli-1.14.44/awscli/examples/elasticbeanstalk/delete-application.rst0000666454262600001440000000024313243367510027132 0ustar pysdk-ciamazon00000000000000**To delete an application** The following command deletes an application named ``my-app``:: aws elasticbeanstalk delete-application --application-name my-app awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-environments.rst0000666454262600001440000000212213243367510027672 0ustar pysdk-ciamazon00000000000000**To view information about an environment** The following command retrieves information about an environment named ``my-env``:: aws elasticbeanstalk describe-environments --environment-names my-env Output:: { "Environments": [ { "ApplicationName": "my-app", "EnvironmentName": "my-env", "VersionLabel": "7f58-stage-150812_025409", "Status": "Ready", "EnvironmentId": "e-rpqsewtp2j", "EndpointURL": "awseb-e-w-AWSEBLoa-1483140XB0Q4L-109QXY8121.us-west-2.elb.amazonaws.com", "SolutionStackName": "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8", "CNAME": "my-env.elasticbeanstalk.com", "Health": "Green", "AbortableOperationInProgress": false, "Tier": { "Version": " ", "Type": "Standard", "Name": "WebServer" }, "DateUpdated": "2015-08-12T18:16:55.019Z", "DateCreated": "2015-08-07T20:48:49.599Z" } ] } awscli-1.14.44/awscli/examples/elasticbeanstalk/update-environment.rst0000666454262600001440000000624213243367510027220 0ustar pysdk-ciamazon00000000000000**To update an environment to a new version** The following command updates an environment named "my-env" to version "v2" of the application to which it belongs:: aws elasticbeanstalk update-environment --environment-name my-env --version-label v2 This command requires that the "my-env" environment already exists and belongs to an application that has a valid application version with the label "v2". Output:: { "ApplicationName": "my-app", "EnvironmentName": "my-env", "VersionLabel": "v2", "Status": "Updating", "EnvironmentId": "e-szqipays4h", "EndpointURL": "awseb-e-i-AWSEBLoa-1RDLX6TC9VUAO-0123456789.us-west-2.elb.amazonaws.com", "SolutionStackName": "64bit Amazon Linux running Tomcat 7", "CNAME": "my-env.elasticbeanstalk.com", "Health": "Grey", "Tier": { "Version": " ", "Type": "Standard", "Name": "WebServer" }, "DateUpdated": "2015-02-03T23:12:29.119Z", "DateCreated": "2015-02-03T23:04:54.453Z" } **To set an environment variable** The following command sets the value of the "PARAM1" variable in the "my-env" environment to "ParamValue":: aws elasticbeanstalk update-environment --environment-name my-env --option-settings Namespace=aws:elasticbeanstalk:application:environment,OptionName=PARAM1,Value=ParamValue The ``option-settings`` parameter takes a namespace in addition to the name and value of the variable. Elastic Beanstalk supports several namespaces for options in addition to environment variables. **To configure option settings from a file** The following command configures several options in the ``aws:elb:loadbalancer`` namespace from a file:: aws elasticbeanstalk update-environment --environment-name my-env --option-settings file://options.json ``options.json`` is a JSON object defining several settings:: [ { "Namespace": "aws:elb:healthcheck", "OptionName": "Interval", "Value": "15" }, { "Namespace": "aws:elb:healthcheck", "OptionName": "Timeout", "Value": "8" }, { "Namespace": "aws:elb:healthcheck", "OptionName": "HealthyThreshold", "Value": "2" }, { "Namespace": "aws:elb:healthcheck", "OptionName": "UnhealthyThreshold", "Value": "3" } ] Output:: { "ApplicationName": "my-app", "EnvironmentName": "my-env", "VersionLabel": "7f58-stage-150812_025409", "Status": "Updating", "EnvironmentId": "e-wtp2rpqsej", "EndpointURL": "awseb-e-w-AWSEBLoa-14XB83101Q4L-104QXY80921.sa-east-1.elb.amazonaws.com", "SolutionStackName": "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8", "CNAME": "my-env.elasticbeanstalk.com", "Health": "Grey", "AbortableOperationInProgress": true, "Tier": { "Version": " ", "Type": "Standard", "Name": "WebServer" }, "DateUpdated": "2015-08-12T18:15:23.804Z", "DateCreated": "2015-08-07T20:48:49.599Z" } For more information about namespaces and supported options, see `Option Values`_ in the *AWS Elastic Beanstalk Developer Guide*. .. _`Option Values`: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html awscli-1.14.44/awscli/examples/elasticbeanstalk/delete-environment-configuration.rst0000666454262600001440000000035413243367510032043 0ustar pysdk-ciamazon00000000000000**To delete a draft configuration** The following command deletes a draft configuration for an environment named ``my-env``:: aws elasticbeanstalk delete-environment-configuration --environment-name my-env --application-name my-app awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-application-versions.rst0000666454262600001440000000224213243367510031317 0ustar pysdk-ciamazon00000000000000**To view information about an application version** The following command retrieves information about an application version labeled ``v2``:: aws elasticbeanstalk describe-application-versions --application-name my-app --version-label "v2" Output:: { "ApplicationVersions": [ { "ApplicationName": "my-app", "VersionLabel": "v2", "Description": "update cover page", "DateCreated": "2015-07-23T01:32:26.079Z", "DateUpdated": "2015-07-23T01:32:26.079Z", "SourceBundle": { "S3Bucket": "elasticbeanstalk-us-west-2-015321684451", "S3Key": "my-app/5026-stage-150723_224258.war" } }, { "ApplicationName": "my-app", "VersionLabel": "v1", "Description": "initial version", "DateCreated": "2015-07-23T22:26:10.816Z", "DateUpdated": "2015-07-23T22:26:10.816Z", "SourceBundle": { "S3Bucket": "elasticbeanstalk-us-west-2-015321684451", "S3Key": "my-app/5026-stage-150723_222618.war" } } ] } awscli-1.14.44/awscli/examples/elasticbeanstalk/terminate-environment.rst0000666454262600001440000000152713243367510027727 0ustar pysdk-ciamazon00000000000000**To terminate an environment** The following command terminates an Elastic Beanstalk environment named ``my-env``:: aws elasticbeanstalk terminate-environment --environment-name my-env Output:: { "ApplicationName": "my-app", "EnvironmentName": "my-env", "Status": "Terminating", "EnvironmentId": "e-fh2eravpns", "EndpointURL": "awseb-e-f-AWSEBLoa-1I9XUMP4-8492WNUP202574.us-west-2.elb.amazonaws.com", "SolutionStackName": "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8", "CNAME": "my-env.elasticbeanstalk.com", "Health": "Grey", "AbortableOperationInProgress": false, "Tier": { "Version": " ", "Type": "Standard", "Name": "WebServer" }, "DateUpdated": "2015-08-12T19:05:54.744Z", "DateCreated": "2015-08-12T18:52:53.622Z" } awscli-1.14.44/awscli/examples/elasticbeanstalk/create-configuration-template.rst0000666454262600001440000000112013243367510031303 0ustar pysdk-ciamazon00000000000000**To create a configuration template** The following command creates a configuration template named ``my-app-v1`` from the settings applied to an environment with the id ``e-rpqsewtp2j``:: aws elasticbeanstalk create-configuration-template --application-name my-app --template-name my-app-v1 --environment-id e-rpqsewtp2j Output:: { "ApplicationName": "my-app", "TemplateName": "my-app-v1", "DateCreated": "2015-08-12T18:40:39Z", "DateUpdated": "2015-08-12T18:40:39Z", "SolutionStackName": "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8" } awscli-1.14.44/awscli/examples/elasticbeanstalk/rebuild-environment.rst0000666454262600001440000000030713243367510027360 0ustar pysdk-ciamazon00000000000000**To rebuild an environment** The following command terminates and recreates the resources in an environment named ``my-env``:: aws elasticbeanstalk rebuild-environment --environment-name my-env awscli-1.14.44/awscli/examples/elasticbeanstalk/update-application-version.rst0000666454262600001440000000141513243367510030637 0ustar pysdk-ciamazon00000000000000**To change an application version's description** The following command updates the description of an application version named ``22a0-stage-150819_185942``:: aws elasticbeanstalk update-application-version --version-label 22a0-stage-150819_185942 --application-name my-app --description "new description" Output:: { "ApplicationVersion": { "ApplicationName": "my-app", "VersionLabel": "22a0-stage-150819_185942", "Description": "new description", "DateCreated": "2015-08-19T18:59:17.646Z", "DateUpdated": "2015-08-20T22:53:28.871Z", "SourceBundle": { "S3Bucket": "elasticbeanstalk-us-west-2-0123456789012", "S3Key": "my-app/22a0-stage-150819_185942.war" } } }awscli-1.14.44/awscli/examples/elasticbeanstalk/delete-application-version.rst0000666454262600001440000000043213243367510030615 0ustar pysdk-ciamazon00000000000000**To delete an application version** The following command deletes an application version named ``22a0-stage-150819_182129`` for an application named ``my-app``:: aws elasticbeanstalk delete-application-version --version-label 22a0-stage-150819_182129 --application-name my-app awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-events.rst0000666454262600001440000000306213243367510026453 0ustar pysdk-ciamazon00000000000000**To view events for an environment** The following command retrieves events for an environment named ``my-env``:: aws elasticbeanstalk describe-events --environment-name my-env Output (abbreviated):: { "Events": [ { "ApplicationName": "my-app", "EnvironmentName": "my-env", "Message": "Environment health has transitioned from Info to Ok.", "EventDate": "2015-08-20T07:06:53.535Z", "Severity": "INFO" }, { "ApplicationName": "my-app", "EnvironmentName": "my-env", "Severity": "INFO", "RequestId": "b7f3960b-4709-11e5-ba1e-07e16200da41", "Message": "Environment update completed successfully.", "EventDate": "2015-08-20T07:06:02.049Z" }, ... { "ApplicationName": "my-app", "EnvironmentName": "my-env", "Severity": "INFO", "RequestId": "ca8dfbf6-41ef-11e5-988b-651aa638f46b", "Message": "Using elasticbeanstalk-us-west-2-012445113685 as Amazon S3 storage bucket for environment data.", "EventDate": "2015-08-13T19:16:27.561Z" }, { "ApplicationName": "my-app", "EnvironmentName": "my-env", "Severity": "INFO", "RequestId": "cdfba8f6-41ef-11e5-988b-65638f41aa6b", "Message": "createEnvironment is starting.", "EventDate": "2015-08-13T19:16:26.581Z" } ] } awscli-1.14.44/awscli/examples/elasticbeanstalk/create-application.rst0000666454262600001440000000150013243367510027130 0ustar pysdk-ciamazon00000000000000**To create a new application** The following command creates a new application named "MyApp":: aws elasticbeanstalk create-application --application-name MyApp --description "my application" The ``create-application`` command only configures the application's name and description. To upload source code for the application, create an initial version of the application using ``create-application-version``. ``create-application-version`` also has an ``auto-create-application`` option that lets you create the application and the application version in one step. Output:: { "Application": { "ApplicationName": "MyApp", "ConfigurationTemplates": [], "DateUpdated": "2015-02-12T18:32:21.181Z", "Description": "my application", "DateCreated": "2015-02-12T18:32:21.181Z" } } awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-configuration-options.rst0000666454262600001440000000357413243367510031517 0ustar pysdk-ciamazon00000000000000**To view configuration options for an environment** The following command retrieves descriptions of all available configuration options for an environment named ``my-env``:: aws elasticbeanstalk describe-configuration-options --environment-name my-env --application-name my-app Output (abbreviated):: { "Options": [ { "Name": "JVMOptions", "UserDefined": false, "DefaultValue": "Xms=256m,Xmx=256m,XX:MaxPermSize=64m,JVM Options=", "ChangeSeverity": "RestartApplicationServer", "Namespace": "aws:cloudformation:template:parameter", "ValueType": "KeyValueList" }, { "Name": "Interval", "UserDefined": false, "DefaultValue": "30", "ChangeSeverity": "NoInterruption", "Namespace": "aws:elb:healthcheck", "MaxValue": 300, "MinValue": 5, "ValueType": "Scalar" }, ... { "Name": "LowerThreshold", "UserDefined": false, "DefaultValue": "2000000", "ChangeSeverity": "NoInterruption", "Namespace": "aws:autoscaling:trigger", "MinValue": 0, "ValueType": "Scalar" }, { "Name": "ListenerEnabled", "UserDefined": false, "DefaultValue": "true", "ChangeSeverity": "Unknown", "Namespace": "aws:elb:listener", "ValueType": "Boolean" } ] } Available configuration options vary per platform and configuration version. For more information about namespaces and supported options, see `Option Values`_ in the *AWS Elastic Beanstalk Developer Guide*. .. _`Option Values`: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html awscli-1.14.44/awscli/examples/elasticbeanstalk/delete-configuration-template.rst0000666454262600001440000000040713243367510031311 0ustar pysdk-ciamazon00000000000000**To delete a configuration template** The following command deletes a configuration template named ``my-template`` for an application named ``my-app``:: aws elasticbeanstalk delete-configuration-template --template-name my-template --application-name my-app awscli-1.14.44/awscli/examples/elasticbeanstalk/create-environment.rst0000666454262600001440000000331113243367510027173 0ustar pysdk-ciamazon00000000000000**To create a new environment for an application** The following command creates a new environment for version "v1" of a java application named "my-app":: aws elasticbeanstalk create-environment --application-name my-app --environment-name my-env --cname-prefix my-app --version-label v1 --solution-stack-name "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8" Output:: { "ApplicationName": "my-app", "EnvironmentName": "my-env", "VersionLabel": "v1", "Status": "Launching", "EnvironmentId": "e-izqpassy4h", "SolutionStackName": "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8", "CNAME": "my-app.elasticbeanstalk.com", "Health": "Grey", "Tier": { "Type": "Standard", "Name": "WebServer", "Version": " " }, "DateUpdated": "2015-02-03T23:04:54.479Z", "DateCreated": "2015-02-03T23:04:54.479Z" } ``v1`` is the label of an application version previously uploaded with `create-application-version`_. .. _`create-application-version`: http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/create-application-version.html **To specify a JSON file to define environment configuration options** The following ``create-environment`` command specifies that a JSON file with the name ``myoptions.json`` should be used to override values obtained from the solution stack or the configuration template:: aws elasticbeanstalk create-environment --environment-name sample-env --application-name sampleapp --option-settings file://myoptions.json For more information, see `Option Values`_ in the *AWS Elastic Beanstalk Developer Guide*. .. _`Option Values`: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.htmlawscli-1.14.44/awscli/examples/elasticbeanstalk/update-application.rst0000666454262600001440000000137613243367510027162 0ustar pysdk-ciamazon00000000000000**To change an application's description** The following command updates the description of an application named ``my-app``:: aws elasticbeanstalk update-application --application-name my-app --description "my Elastic Beanstalk application" Output:: { "Application": { "ApplicationName": "my-app", "Description": "my Elastic Beanstalk application", "Versions": [ "2fba-stage-150819_234450", "bf07-stage-150820_214945", "93f8", "fd7c-stage-150820_000431", "22a0-stage-150819_185942" ], "DateCreated": "2015-08-13T19:15:50.449Z", "ConfigurationTemplates": [], "DateUpdated": "2015-08-20T22:34:56.195Z" } } awscli-1.14.44/awscli/examples/elasticbeanstalk/create-application-version.rst0000666454262600001440000000164413243367510030624 0ustar pysdk-ciamazon00000000000000**To create a new application version** The following command creates a new version, "v1" of an application named "MyApp":: aws elasticbeanstalk create-application-version --application-name MyApp --version-label v1 --description MyAppv1 --source-bundle S3Bucket="my-bucket",S3Key="sample.war" --auto-create-application The application will be created automatically if it does not already exist, due to the auto-create-application option. The source bundle is a .war file stored in an s3 bucket named "my-bucket" that contains the Apache Tomcat sample application. Output:: { "ApplicationVersion": { "ApplicationName": "MyApp", "VersionLabel": "v1", "Description": "MyAppv1", "DateCreated": "2015-02-03T23:01:25.412Z", "DateUpdated": "2015-02-03T23:01:25.412Z", "SourceBundle": { "S3Bucket": "my-bucket", "S3Key": "sample.war" } } } awscli-1.14.44/awscli/examples/elasticbeanstalk/check-dns-availability.rst0000666454262600001440000000047513243367510027705 0ustar pysdk-ciamazon00000000000000**To check the availability of a CNAME** The following command checks the availability of the subdomain ``my-cname.elasticbeanstalk.com``:: aws elasticbeanstalk check-dns-availability --cname-prefix my-cname Output:: { "Available": true, "FullyQualifiedCNAME": "my-cname.elasticbeanstalk.com" } awscli-1.14.44/awscli/examples/elasticbeanstalk/describe-environment-health.rst0000666454262600001440000000273313243367510030762 0ustar pysdk-ciamazon00000000000000**To view environment health** The following command retrieves overall health information for an environment named ``my-env``:: aws elasticbeanstalk describe-environment-health --environment-name my-env --attribute-names All Output:: { "Status": "Ready", "EnvironmentName": "my-env", "Color": "Green", "ApplicationMetrics": { "Duration": 10, "Latency": { "P99": 0.004, "P75": 0.002, "P90": 0.003, "P95": 0.004, "P85": 0.003, "P10": 0.001, "P999": 0.004, "P50": 0.001 }, "RequestCount": 45, "StatusCodes": { "Status3xx": 0, "Status2xx": 45, "Status5xx": 0, "Status4xx": 0 } }, "RefreshedAt": "2015-08-20T21:09:18Z", "HealthStatus": "Ok", "InstancesHealth": { "Info": 0, "Ok": 1, "Unknown": 0, "Severe": 0, "Warning": 0, "Degraded": 0, "NoData": 0, "Pending": 0 }, "Causes": [] } Health information is only available for environments with enhanced health reporting enabled. For more information, see `Enhanced Health Reporting and Monitoring`_ in the *AWS Elastic Beanstalk Developer Guide*. .. _`Enhanced Health Reporting and Monitoring`: http://integ-docs-aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced.html awscli-1.14.44/awscli/examples/elasticbeanstalk/update-configuration-template.rst0000666454262600001440000000162313243367510031332 0ustar pysdk-ciamazon00000000000000**To update a configuration template** The following command removes the configured CloudWatch custom health metrics configuration ``ConfigDocument`` from a saved configuration template named ``my-template``:: aws elasticbeanstalk update-configuration-template --template-name my-template --application-name my-app --options-to-remove Namespace=aws:elasticbeanstalk:healthreporting:system,OptionName=ConfigDocument Output:: { "ApplicationName": "my-app", "TemplateName": "my-template", "DateCreated": "2015-08-20T22:39:31Z", "DateUpdated": "2015-08-20T22:43:11Z", "SolutionStackName": "64bit Amazon Linux 2015.03 v2.0.0 running Tomcat 8 Java 8" } For more information about namespaces and supported options, see `Option Values`_ in the *AWS Elastic Beanstalk Developer Guide*. .. _`Option Values`: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html awscli-1.14.44/awscli/examples/elasticbeanstalk/abort-environment-update.rst0000666454262600001440000000032213243367510030316 0ustar pysdk-ciamazon00000000000000**To abort a deployment** The following command aborts a running application version deployment for an environment named ``my-env``:: aws elasticbeanstalk abort-environment-update --environment-name my-env awscli-1.14.44/awscli/examples/elasticbeanstalk/request-environment-info.rst0000666454262600001440000000063013243367510030352 0ustar pysdk-ciamazon00000000000000**To request tailed logs** The following command requests logs from an environment named ``my-env``:: aws elasticbeanstalk request-environment-info --environment-name my-env --info-type tail After requesting logs, retrieve their location with `retrieve-environment-info`_. .. _`retrieve-environment-info`: http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/retrieve-environment-info.html awscli-1.14.44/awscli/examples/elasticbeanstalk/retrieve-environment-info.rst0000666454262600001440000000165213243367510030514 0ustar pysdk-ciamazon00000000000000**To retrieve tailed logs** The following command retrieves a link to logs from an environment named ``my-env``:: aws elasticbeanstalk retrieve-environment-info --environment-name my-env --info-type tail Output:: { "EnvironmentInfo": [ { "SampleTimestamp": "2015-08-20T22:23:17.703Z", "Message": "https://elasticbeanstalk-us-west-2-0123456789012.s3.amazonaws.com/resources/environments/logs/tail/e-fyqyju3yjs/i-09c1c867/TailLogs-1440109397703.out?AWSAccessKeyId=AKGPT4J56IAJ2EUBL5CQ&Expires=1440195891&Signature=n%2BEalOV6A2HIOx4Rcfb7LT16bBM%3D", "InfoType": "tail", "Ec2InstanceId": "i-09c1c867" } ] } View the link in a browser. Prior to retrieval, logs must be requested with `request-environment-info`_. .. _`request-environment-info`: http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/retrieve-environment-info.html awscli-1.14.44/awscli/examples/directconnect/0000777454262600001440000000000013243367512022153 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/directconnect/describe-locations.rst0000666454262600001440000000103713243367510026455 0ustar pysdk-ciamazon00000000000000**To list AWS Direct Connect partners and locations** The following ``describe-locations`` command lists AWS Direct Connect partners and locations in the current region:: aws directconnect describe-locations Output:: { "locations": [ { "locationName": "NAP do Brasil, Barueri, Sao Paulo", "locationCode": "TNDB" }, { "locationName": "Tivit - Site Transamerica (Sao Paulo)", "locationCode": "TIVIT" } ] }awscli-1.14.44/awscli/examples/directconnect/untag-resource.rst0000666454262600001440000000054213243367510025647 0ustar pysdk-ciamazon00000000000000**To remove a tag from an AWS Direct Connect resource** The following command removes the tag with the key ``Name`` from connection ``dxcon-abcabc12``. If the command succeeds, no output is returned. Command:: aws directconnect untag-resource --resource-arn arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12 --tag-keys Name awscli-1.14.44/awscli/examples/directconnect/describe-connections.rst0000666454262600001440000000111113243367510026775 0ustar pysdk-ciamazon00000000000000**To list all connections in the current region** The following ``describe-connections`` command lists all connections in the current region:: aws directconnect describe-connections Output:: { "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-fg31dyv6", "connectionState": "requested", "bandwidth": "1Gbps", "location": "TIVIT", "connectionName": "Connection to AWS", "region": "sa-east-1" } ] }awscli-1.14.44/awscli/examples/directconnect/describe-interconnect-loa.rst0000666454262600001440000000322213243367510027724 0ustar pysdk-ciamazon00000000000000**To describe your LOA-CFA for an interconnect using Linux or Mac OS X** The following example describes your LOA-CFA for interconnect ``dxcon-fh6ayh1d``. The contents of the LOA-CFA are base64-encoded. This command uses the ``--output`` and ``--query`` parameters to control the output and extract the contents of the ``loaContent`` structure. The final part of the command decodes the content using the ``base64`` utility, and sends the output to a PDF file. .. code:: aws directconnect describe-interconnect-loa --interconnect-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf **To describe your LOA-CFA for an interconnect using Windows** The previous example requires the use of the ``base64`` utility to decode the output. On a Windows computer, you can use ``certutil`` instead. In the following example, the first command describes your LOA-CFA for interconnect ``dxcon-fh6ayh1d`` and uses the ``--output`` and ``--query`` parameters to control the output and extract the contents of the ``loaContent`` structure to a file called ``myLoaCfa.base64``. The second command uses the ``certutil`` utility to decode the file and send the output to a PDF file. .. code:: aws directconnect describe-interconnect-loa --interconnect-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64 .. code:: certutil -decode myLoaCfa.base64 myLoaCfa.pdf For more information about controlling AWS CLI output, see `Controlling Command Output from the AWS Command Line Interface `_ in the *AWS Command Line Interface User Guide*.awscli-1.14.44/awscli/examples/directconnect/create-private-virtual-interface.rst0000666454262600001440000000264313243367510031245 0ustar pysdk-ciamazon00000000000000**To create a private virtual interface** The following ``create-private-virtual-interface`` command creates a private virtual interface:: aws directconnect create-private-virtual-interface --connection-id dxcon-ffjrkx17 --new-private-virtual-interface virtualInterfaceName=PrivateVirtualInterface,vlan=101,asn=65000,authKey=asdf34example,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,virtualGatewayId=vgw-aba37db6 Output:: { "virtualInterfaceState": "pending", "asn": 65000, "vlan": 101, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "vgw-aba37db6", "virtualInterfaceId": "dxvif-ffhhk74f", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "\n\n 101\n 192.168.1.2/30\n 192.168.1.1/30\n 65000\n asdf34example\n 7224\n private\n\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" }awscli-1.14.44/awscli/examples/directconnect/allocate-connection-on-interconnect.rst0000666454262600001440000000125713243367510031734 0ustar pysdk-ciamazon00000000000000**To create a hosted connection on an interconnect** The following ``allocate-connection-on-interconnect`` command creates a hosted connection on an interconnect:: aws directconnect allocate-connection-on-interconnect --bandwidth 500Mbps --connection-name mydcinterconnect --owner-account 123456789012 --interconnect-id dxcon-fgktov66 --vlan 101 Output:: { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }awscli-1.14.44/awscli/examples/directconnect/allocate-hosted-connection.rst0000666454262600001440000000122213243367510030105 0ustar pysdk-ciamazon00000000000000**To create a hosted connection on an interconnect** The following example creates a hosted connection on the specified interconnect. Command:: aws directconnect allocate-hosted-conection --bandwidth 500Mbps --connection-name mydcinterconnect --owner-account 123456789012 --connection-id dxcon-fgktov66 --vlan 101 Output:: { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }awscli-1.14.44/awscli/examples/directconnect/delete-direct-connect-gateway.rst0000666454262600001440000000110313243367510030476 0ustar pysdk-ciamazon00000000000000**To delete a Direct Connect gateway** The following example deletes Direct Connect gateway ``5f294f92-bafb-4011-916d-9b0bexample``. Command:: aws directconnect delete-direct-connect-gateway --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample Output:: { "directConnectGateway": { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "deleting" } }awscli-1.14.44/awscli/examples/directconnect/delete-bgp-peer.rst0000666454262600001440000000424113243367510025645 0ustar pysdk-ciamazon00000000000000**To delete a BGP peer from a virtual interface** The following example deletes the IPv6 BGP peer from virtual interface ``dxvif-fg1vuj3d``. Command:: aws directconnect delete-bgp-peer --virtual-interface-id dxvif-fg1vuj3d --asn 64600 --customer-address 2001:db8:1100:2f0:0:1:9cb4:4216/125 Output:: { "virtualInterface": { "virtualInterfaceState": "available", "asn": 65000, "vlan": 125, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-fguhmqlc", "addressFamily": "ipv4", "virtualGatewayId": "vgw-f9eb0c90", "virtualInterfaceId": "dxvif-fg1vuj3d", "authKey": "0xC_ukbCerl6EYA0example", "routeFilterPrefixes": [], "location": "EqDC2", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0xC_ukbCerl6EYA0uexample", "bgpPeerState": "available", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "2001:db8:1100:2f0:0:1:9cb4:4216/125", "addressFamily": "ipv6", "authKey": "0xS27kAIU_VHPjjAexample", "bgpPeerState": "deleting", "amazonAddress": "2001:db8:1100:2f0:0:1:9cb4:4211/125", "asn": 64600 } ], "customerRouterConfig": "\n\n 125\n 169.254.255.2/30\n 169.254.255.1/30\n 65000\n 0xC_ukbCerl6EYA0example\n 7224\n private\n\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "Test" } }awscli-1.14.44/awscli/examples/directconnect/confirm-private-virtual-interface.rst0000666454262600001440000000060713243367510031435 0ustar pysdk-ciamazon00000000000000**To accept ownership of a private virtual interface** The following ``confirm-private-virtual-interface`` command accepts ownership of a private virtual interface created by another customer:: aws directconnect confirm-private-virtual-interface --virtual-interface-id dxvif-fgy8orxu --virtual-gateway-id vgw-e4a47df9 Output:: { "virtualInterfaceState": "pending" }awscli-1.14.44/awscli/examples/directconnect/allocate-public-virtual-interface.rst0000666454262600001440000000317413243367510031372 0ustar pysdk-ciamazon00000000000000**To provision a public virtual interface** The following ``allocate-public-virtual-interface`` command provisions a public virtual interface to be owned by a different customer:: aws directconnect allocate-public-virtual-interface --connection-id dxcon-ffjrkx17 --owner-account 123456789012 --new-public-virtual-interface-allocation virtualInterfaceName=PublicVirtualInterface,vlan=2000,asn=65000,authKey=asdf34example,amazonAddress=203.0.113.1/30,customerAddress=203.0.113.2/30,routeFilterPrefixes=[{cidr=203.0.113.0/30},{cidr=203.0.113.4/30}] Output:: { "virtualInterfaceState": "confirming", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fg9xo9vp", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.0/30" }, { "cidr": "203.0.113.4/30" } ], "location": "TIVIT", "customerRouterConfig": "\n\n 2000\n 203.0.113.2/30\n 203.0.113.1/30\n 65000\n asdf34example\n 7224\n public\n\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" }awscli-1.14.44/awscli/examples/directconnect/describe-connection-loa.rst0000666454262600001440000000320013243367510027364 0ustar pysdk-ciamazon00000000000000**To describe your LOA-CFA for a connection using Linux or Mac OS X** The following example describes your LOA-CFA for connection ``dxcon-fh6ayh1d``. The contents of the LOA-CFA are base64-encoded. This command uses the ``--output`` and ``--query`` parameters to control the output and extract the contents of the ``loaContent`` structure. The final part of the command decodes the content using the ``base64`` utility, and sends the output to a PDF file. .. code:: aws directconnect describe-connection-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf **To describe your LOA-CFA for a connection using Windows** The previous example requires the use of the ``base64`` utility to decode the output. On a Windows computer, you can use ``certutil`` instead. In the following example, the first command describes your LOA-CFA for connection ``dxcon-fh6ayh1d`` and uses the ``--output`` and ``--query`` parameters to control the output and extract the contents of the ``loaContent`` structure to a file called ``myLoaCfa.base64``. The second command uses the ``certutil`` utility to decode the file and send the output to a PDF file. .. code:: aws directconnect describe-connection-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64 .. code:: certutil -decode myLoaCfa.base64 myLoaCfa.pdf For more information about controlling AWS CLI output, see `Controlling Command Output from the AWS Command Line Interface `_ in the *AWS Command Line Interface User Guide*.awscli-1.14.44/awscli/examples/directconnect/disassociate-connection-from-lag.rst0000666454262600001440000000100613243367510031212 0ustar pysdk-ciamazon00000000000000**To disassociate a connection from a LAG** The following example disassociates the specified connection from the specified LAG. Command:: aws directconnect disassociate-connection-from-lag --lag-id dxlag-fhccu14t --connection-id dxcon-fg9607vm Output:: { "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Con2ForLag", "region": "us-east-1" } awscli-1.14.44/awscli/examples/directconnect/describe-direct-connect-gateway-attachments.rst0000666454262600001440000000167713243367510033345 0ustar pysdk-ciamazon00000000000000**To describe Direct Connect gateway attachments** The following example describes the virtual interfaces that are attached to Direct Connect gateway ``5f294f92-bafb-4011-916d-9b0bexample``. Command:: aws directconnect describe-direct-connect-gateway-attachments --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample Output:: { "directConnectGatewayAttachments": [ { "virtualInterfaceOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualInterfaceRegion": "us-east-2", "attachmentState": "attaching", "virtualInterfaceId": "dxvif-fg9zyabc" } ], "nextToken": "eyJ2IjoxLCJzIjoxLCJpIjoibEhXdlNpUXF5RzhoL1JyUW52SlV2QT09IiwiYyI6Im5wQjFHQ0RyQUdRS3puNnNXcUlINCtkTTA4dTk3KzBiU0xtb05JQmlaczZ6NXRIYmk3c3VESUxFTTd6a2FzVHM0VTFwaGJkZGNxTytqWmQ3QzMzOGRQaTVrTThrOG1zelRsV3gyMWV3VTNFPSJ9" }awscli-1.14.44/awscli/examples/directconnect/tag-resource.rst0000666454262600001440000000061613243367510025306 0ustar pysdk-ciamazon00000000000000**To add a tag to an AWS Direct Connect resource** The following command adds a tag with a key of ``Name`` and a value of ``VAConnection`` to the connection ``dxcon-abcabc12``. If the command succeeds, no output is returned. Command:: aws directconnect tag-resource --resource-arn arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12 --tags "key=Name,value=VAConnection" awscli-1.14.44/awscli/examples/directconnect/create-connection.rst0000666454262600001440000000112313243367510026300 0ustar pysdk-ciamazon00000000000000**To create a connection from your network to an AWS Direct Connect location** The following ``create-connection`` command creates a connection from your network to an AWS Direct Connect location:: aws directconnect create-connection --location TIVIT --bandwidth 1Gbps --connection-name "Connection to AWS" Output:: { "ownerAccount": "123456789012", "connectionId": "dxcon-fg31dyv6", "connectionState": "requested", "bandwidth": "1Gbps", "location": "TIVIT", "connectionName": "Connection to AWS", "region": "sa-east-1" }awscli-1.14.44/awscli/examples/directconnect/allocate-private-virtual-interface.rst0000666454262600001440000000267113243367510031567 0ustar pysdk-ciamazon00000000000000**To provision a private virtual interface** The following ``allocate-private-virtual-interface`` command provisions a private virtual interface to be owned by a different customer:: aws directconnect allocate-private-virtual-interface --connection-id dxcon-ffjrkx17 --owner-account 123456789012 --new-private-virtual-interface-allocation virtualInterfaceName=PrivateVirtualInterface,vlan=1000,asn=65000,authKey=asdf34example,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30 Output:: { "virtualInterfaceState": "confirming", "asn": 65000, "vlan": 1000, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fgy8orxu", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "\n \n 1000\n 192.168.1.2/30\n 192.168.1.1/30\n 65000\n asdf34example\n 7224\n private\n\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" } awscli-1.14.44/awscli/examples/directconnect/confirm-public-virtual-interface.rst0000666454262600001440000000054313243367510031240 0ustar pysdk-ciamazon00000000000000**To accept ownership of a public virtual interface** The following ``confirm-public-virtual-interface`` command accepts ownership of a public virtual interface created by another customer:: aws directconnect confirm-public-virtual-interface --virtual-interface-id dxvif-fg9xo9vp Output:: { "virtualInterfaceState": "verifying" }awscli-1.14.44/awscli/examples/directconnect/delete-direct-connect-gateway-association.rst0000666454262600001440000000131613243367510033016 0ustar pysdk-ciamazon00000000000000**To delete a Direct Connect gateway association** The following example disassociates virtual private gateway ``vgw-6efe725e`` from Direct Connect gateway ``5f294f92-bafb-4011-916d-9b0bexample``. Command:: aws directconnect delete-direct-connect-gateway-association --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample --virtual-gateway-id vgw-6efe725e Output:: { "directConnectGatewayAssociation": { "associationState": "disassociating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-6efe725e", "virtualGatewayRegion": "us-east-2" } }awscli-1.14.44/awscli/examples/directconnect/create-public-virtual-interface.rst0000666454262600001440000000304513243367510031046 0ustar pysdk-ciamazon00000000000000**To create a public virtual interface** The following ``create-public-virtual-interface`` command creates a public virtual interface:: aws directconnect create-public-virtual-interface --connection-id dxcon-ffjrkx17 --new-public-virtual-interface virtualInterfaceName=PublicVirtualInterface,vlan=2000,asn=65000,authKey=asdf34example,amazonAddress=203.0.113.1/30,customerAddress=203.0.113.2/30,routeFilterPrefixes=[{cidr=203.0.113.0/30},{cidr=203.0.113.4/30}] Output:: { "virtualInterfaceState": "verifying", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualInterfaceId": "dxvif-fgh0hcrk", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.0/30" }, { "cidr": "203.0.113.4/30" } ], "location": "TIVIT", "customerRouterConfig": "\n\n 2000\n 203.0.113.2/30\n 203.0.113.1/30\n 65000\n asdf34example\n 7224\n public\n\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" }awscli-1.14.44/awscli/examples/directconnect/describe-tags.rst0000666454262600001440000000113513243367510025417 0ustar pysdk-ciamazon00000000000000**To describe tags for your AWS Direct Connect resources** The following command describes the tags for the connection ``dxcon-abcabc12``. Command:: aws directconnect describe-tags --resource-arns arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12 Output:: { "resourceTags": [ { "resourceArn": "arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-abcabc12", "tags": [ { "value": "VAConnection", "key": "Name" } ] } ] }awscli-1.14.44/awscli/examples/directconnect/create-direct-connect-gateway.rst0000666454262600001440000000105013243367510030500 0ustar pysdk-ciamazon00000000000000**To create a Direct Connect gateway** The following example creates a Direct Connect gateway with the name ``DxGateway1``. Command:: aws directconnect create-direct-connect-gateway --direct-connect-gateway-name "DxGateway1" Output:: { "directConnectGateway": { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bdexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "available" } }awscli-1.14.44/awscli/examples/directconnect/describe-virtual-gateways.rst0000666454262600001440000000060413243367510027771 0ustar pysdk-ciamazon00000000000000**To list virtual private gateways** The following ``describe-virtual-gateways`` command lists virtual private gateways owned by your AWS account:: aws directconnect describe-virtual-gateways Output:: { "virtualGateways": [ { "virtualGatewayId": "vgw-aba37db6", "virtualGatewayState": "available" } ] }awscli-1.14.44/awscli/examples/directconnect/describe-lags.rst0000666454262600001440000000310713243367510025410 0ustar pysdk-ciamazon00000000000000**To describe your LAGs** The following command describes all of your LAGs for the current region. Command:: aws directconnect describe-lags Output:: { "lags": [ { "awsDevice": "EqDC2-19y7z3m17xpuz", "numberOfConnections": 2, "lagState": "down", "ownerAccount": "123456789012", "lagName": "DA-LAG", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-ffnikghc", "lagId": "dxlag-fgsu9erb", "connectionState": "requested", "bandwidth": "10Gbps", "location": "EqDC2", "connectionName": "Requested Connection 1 for Lag dxlag-fgsu9erb", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fglgbdea", "lagId": "dxlag-fgsu9erb", "connectionState": "requested", "bandwidth": "10Gbps", "location": "EqDC2", "connectionName": "Requested Connection 2 for Lag dxlag-fgsu9erb", "region": "us-east-1" } ], "lagId": "dxlag-fgsu9erb", "minimumLinks": 0, "connectionsBandwidth": "10Gbps", "region": "us-east-1", "location": "EqDC2" } ] }awscli-1.14.44/awscli/examples/directconnect/describe-hosted-connections.rst0000666454262600001440000000127313243367510030272 0ustar pysdk-ciamazon00000000000000**To list connections on an interconnect** The following example lists connections that have been provisioned on the given interconnect. Command:: aws directconnect describe-hosted-connections --connection-id dxcon-fgktov66 Output:: { "connections": [ { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" } ] }awscli-1.14.44/awscli/examples/directconnect/describe-direct-connect-gateways.rst0000666454262600001440000000151213243367510031203 0ustar pysdk-ciamazon00000000000000**To describe your Direct Connect gateways** The following example describe all of your Direct Connect gateways. Command:: aws directconnect describe-direct-connect-gateways Output:: { "directConnectGateways": [ { "amazonSideAsn": 64512, "directConnectGatewayId": "cf68415c-f4ae-48f2-87a7-3b52cexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway2", "directConnectGatewayState": "available" }, { "amazonSideAsn": 64512, "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bdexample", "ownerAccount": "123456789012", "directConnectGatewayName": "DxGateway1", "directConnectGatewayState": "available" } ] }awscli-1.14.44/awscli/examples/directconnect/associate-virtual-interface.rst0000666454262600001440000000414613243367510030305 0ustar pysdk-ciamazon00000000000000**To associate a virtual interface with a connection** The following example associates the specified virtual interface with the specified LAG. Alternatively, to associate the virtual interface with a connection, specify the ID of an AWS Direct Connect connection for ``--connection-id``; for example, ``dxcon-ffnikghc``. Command:: aws directconnect associate-virtual-interface --connection-id dxlag-ffjhj9lx --virtual-interface-id dxvif-fgputw0j Output:: { "virtualInterfaceState": "pending", "asn": 65000, "vlan": 123, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxlag-ffjhj9lx", "addressFamily": "ipv4", "virtualGatewayId": "vgw-38e90b51", "virtualInterfaceId": "dxvif-fgputw0j", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "routeFilterPrefixes": [], "location": "CSVA1", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "bgpPeerState": "deleting", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0x123pK5_VBqv.UQ3kJ4123_", "bgpPeerState": "pending", "amazonAddress": "169.254.255.1/30", "asn": 65000 } ], "customerRouterConfig": "\n\n 123\n 169.254.255.2/30\n 169.254.255.1/30\n 65000\n 0x123pK5_VBqv.UQ3kJ4123_\n 7224\n private\n\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "VIF1A" }awscli-1.14.44/awscli/examples/directconnect/associate-hosted-connection.rst0000666454262600001440000000115513243367510030301 0ustar pysdk-ciamazon00000000000000**To associate a hosted connection with a LAG** The following example associates the specified hosted connection with the specified LAG. Command:: aws directconnect associate-hosted-connection --parent-connection-id dxlag-fhccu14t --connection-id dxcon-fg9607vm Output:: { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "lagId": "dxlag-fhccu14t", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" }awscli-1.14.44/awscli/examples/directconnect/delete-lag.rst0000666454262600001440000000077613243367510024720 0ustar pysdk-ciamazon00000000000000**To delete a LAG** The following example deletes the specified LAG. Command:: aws directconnect delete-lag --lag-id dxlag-ffrhowd9 Output:: { "awsDevice": "EqDC2-4h6ce2r1bes6", "numberOfConnections": 0, "lagState": "deleted", "ownerAccount": "123456789012", "lagName": "TestLAG", "connections": [], "lagId": "dxlag-ffrhowd9", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "EqDC2" }awscli-1.14.44/awscli/examples/directconnect/describe-loa.rst0000666454262600001440000000315213243367510025235 0ustar pysdk-ciamazon00000000000000**To describe your LOA-CFA for a connection using Linux or Mac OS X** The following example describes your LOA-CFA for connection ``dxcon-fh6ayh1d``. The contents of the LOA-CFA are base64-encoded. This command uses the ``--output`` and ``--query`` parameters to control the output and extract the contents of the ``loaContent`` structure. The final part of the command decodes the content using the ``base64`` utility, and sends the output to a PDF file. .. code:: aws directconnect describe-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent|base64 --decode > myLoaCfa.pdf **To describe your LOA-CFA for a connection using Windows** The previous example requires the use of the ``base64`` utility to decode the output. On a Windows computer, you can use ``certutil`` instead. In the following example, the first command describes your LOA-CFA for connection ``dxcon-fh6ayh1d`` and uses the ``--output`` and ``--query`` parameters to control the output and extract the contents of the ``loaContent`` structure to a file called ``myLoaCfa.base64``. The second command uses the ``certutil`` utility to decode the file and send the output to a PDF file. .. code:: aws directconnect describe-loa --connection-id dxcon-fh6ayh1d --output text --query loa.loaContent > myLoaCfa.base64 .. code:: certutil -decode myLoaCfa.base64 myLoaCfa.pdf For more information about controlling AWS CLI output, see `Controlling Command Output from the AWS Command Line Interface `_ in the *AWS Command Line Interface User Guide*.awscli-1.14.44/awscli/examples/directconnect/delete-connection.rst0000666454262600001440000000071313243367510026303 0ustar pysdk-ciamazon00000000000000**To delete a connection** The following ``delete-connection`` command deletes the specified connection:: aws directconnect delete-connection --connection-id dxcon-fg31dyv6 Output:: { "ownerAccount": "123456789012", "connectionId": "dxcon-fg31dyv6", "connectionState": "deleted", "bandwidth": "1Gbps", "location": "TIVIT", "connectionName": "Connection to AWS", "region": "sa-east-1" }awscli-1.14.44/awscli/examples/directconnect/create-interconnect.rst0000666454262600001440000000113613243367510026640 0ustar pysdk-ciamazon00000000000000**To create an interconnect between a partner's network and AWS** The following ``create-interconnect`` command creates an interconnect between an AWS Direct Connect partner's network and a specific AWS Direct Connect location:: aws directconnect create-interconnect --interconnect-name "1G Interconnect to AWS" --bandwidth 1Gbps --location TIVIT Output:: { "region": "sa-east-1", "bandwidth": "1Gbps", "location": "TIVIT", "interconnectName": "1G Interconnect to AWS", "interconnectId": "dxcon-fgktov66", "interconnectState": "requested" }awscli-1.14.44/awscli/examples/directconnect/describe-connections-on-interconnect.rst0000666454262600001440000000134313243367510032107 0ustar pysdk-ciamazon00000000000000**To list connections on an interconnect** The following ``describe-connections-on-interconnect`` command lists connections that have been provisioned on the given interconnect:: aws directconnect describe-connections-on-interconnect --interconnect-id dxcon-fgktov66 Output:: { "connections": [ { "partnerName": "TIVIT", "vlan": 101, "ownerAccount": "123456789012", "connectionId": "dxcon-ffzc51m1", "connectionState": "ordering", "bandwidth": "500Mbps", "location": "TIVIT", "connectionName": "mydcinterconnect", "region": "sa-east-1" } ] }awscli-1.14.44/awscli/examples/directconnect/create-bgp-peer.rst0000666454262600001440000000474113243367510025653 0ustar pysdk-ciamazon00000000000000**To create an IPv6 BGP peering session** The following example creates an IPv6 BGP peering session on private virtual interface ``dxvif-fg1vuj3d``. The peer IPv6 addresses are automatically allocated by Amazon. Command:: aws directconnect create-bgp-peer --virtual-interface-id dxvif-fg1vuj3d --new-bgp-peer asn=64600,addressFamily=ipv6 Output:: { "virtualInterface": { "virtualInterfaceState": "available", "asn": 65000, "vlan": 125, "customerAddress": "169.254.255.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-fguhmqlc", "addressFamily": "ipv4", "virtualGatewayId": "vgw-f9eb0c90", "virtualInterfaceId": "dxvif-fg1vuj3d", "authKey": "0xC_ukbCerl6EYA0example", "routeFilterPrefixes": [], "location": "EqDC2", "bgpPeers": [ { "bgpStatus": "down", "customerAddress": "169.254.255.2/30", "addressFamily": "ipv4", "authKey": "0xC_ukbCerl6EYA0uexample", "bgpPeerState": "available", "amazonAddress": "169.254.255.1/30", "asn": 65000 }, { "bgpStatus": "down", "customerAddress": "2001:db8:1100:2f0:0:1:9cb4:4216/125", "addressFamily": "ipv6", "authKey": "0xS27kAIU_VHPjjAexample", "bgpPeerState": "pending", "amazonAddress": "2001:db8:1100:2f0:0:1:9cb4:4211/125", "asn": 64600 } ], "customerRouterConfig": "\n\n 125\n 169.254.255.2/30\n 169.254.255.1/30\n 65000\n 0xC_ukbCerl6EYA0uexample\n 2001:db8:1100:2f0:0:1:9cb4:4216/125\n 2001:db8:1100:2f0:0:1:9cb4:4211/125\n 64600\n 0xS27kAIU_VHPjjAexample\n 7224\n private\n\n", "amazonAddress": "169.254.255.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "Test" } }awscli-1.14.44/awscli/examples/directconnect/associate-connection-with-lag.rst0000666454262600001440000000103313243367510030522 0ustar pysdk-ciamazon00000000000000**To associate a connection with a LAG** The following example associates the specified connection with the specified LAG. Command:: aws directconnect associate-connection-with-lag --lag-id dxlag-fhccu14t --connection-id dxcon-fg9607vm Output:: { "ownerAccount": "123456789012", "connectionId": "dxcon-fg9607vm", "lagId": "dxlag-fhccu14t", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Con2ForLag", "region": "us-east-1" }awscli-1.14.44/awscli/examples/directconnect/update-lag.rst0000666454262600001440000000246313243367510024733 0ustar pysdk-ciamazon00000000000000**To update a LAG** The following example changes the name of the specified LAG. Command:: aws directconnect update-lag --lag-id dxlag-ffjhj9lx --lag-name 2ConnLag Output:: { "awsDevice": "CSVA1-23u8tlpaz8iks", "numberOfConnections": 2, "lagState": "down", "ownerAccount": "123456789012", "lagName": "2ConnLag", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-fflqyj95", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 2 for Lag dxlag-ffjhj9lx", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-ffqr6x5q", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 1 for Lag dxlag-ffjhj9lx", "region": "us-east-1" } ], "lagId": "dxlag-ffjhj9lx", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "CSVA1" } awscli-1.14.44/awscli/examples/directconnect/create-lag.rst0000666454262600001440000000567113243367510024720 0ustar pysdk-ciamazon00000000000000**To create a LAG with new connections** The following example creates a LAG and requests two new AWS Direct Connect connections for the LAG with a bandwidth of 1 Gbps. Command:: aws directconnect create-lag --location CSVA1 --number-of-connections 2 --connections-bandwidth 1Gbps --lag-name 1GBLag Output:: { "awsDevice": "CSVA1-23u8tlpaz8iks", "numberOfConnections": 2, "lagState": "pending", "ownerAccount": "123456789012", "lagName": "1GBLag", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-ffqr6x5q", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 1 for Lag dxlag-ffjhj9lx", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fflqyj95", "lagId": "dxlag-ffjhj9lx", "connectionState": "requested", "bandwidth": "1Gbps", "location": "CSVA1", "connectionName": "Requested Connection 2 for Lag dxlag-ffjhj9lx", "region": "us-east-1" } ], "lagId": "dxlag-ffjhj9lx", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "CSVA1" } **To create a LAG using an existing connection** The following example creates a LAG from an existing connection in your account, and requests a second new connection for the LAG with the same bandwidth and location as the existing connection. Command:: aws directconnect create-lag --location EqDC2 --number-of-connections 2 --connections-bandwidth 1Gbps --lag-name 2ConnLAG --connection-id dxcon-fgk145dr Output:: { "awsDevice": "EqDC2-4h6ce2r1bes6", "numberOfConnections": 2, "lagState": "pending", "ownerAccount": "123456789012", "lagName": "2ConnLAG", "connections": [ { "ownerAccount": "123456789012", "connectionId": "dxcon-fh6ljcvo", "lagId": "dxlag-fhccu14t", "connectionState": "requested", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "Requested Connection 1 for Lag dxlag-fhccu14t", "region": "us-east-1" }, { "ownerAccount": "123456789012", "connectionId": "dxcon-fgk145dr", "lagId": "dxlag-fhccu14t", "connectionState": "down", "bandwidth": "1Gbps", "location": "EqDC2", "connectionName": "VAConn1", "region": "us-east-1" } ], "lagId": "dxlag-fhccu14t", "minimumLinks": 0, "connectionsBandwidth": "1Gbps", "region": "us-east-1", "location": "EqDC2" }awscli-1.14.44/awscli/examples/directconnect/delete-virtual-interface.rst0000666454262600001440000000043213243367510027566 0ustar pysdk-ciamazon00000000000000**To delete a virtual interface** The following ``delete-virtual-interface`` command deletes the specified virtual interface:: aws directconnect delete-virtual-interface --virtual-interface-id dxvif-ffhhk74f Output:: { "virtualInterfaceState": "deleting" }awscli-1.14.44/awscli/examples/directconnect/delete-interconnect.rst0000666454262600001440000000037513243367510026643 0ustar pysdk-ciamazon00000000000000**To delete an interconnect** The following ``delete-interconnect`` command deletes the specified interconnect:: aws directconnect delete-interconnect --interconnect-id dxcon-fgktov66 Output:: { "interconnectState": "deleted" }awscli-1.14.44/awscli/examples/directconnect/confirm-connection.rst0000666454262600001440000000047613243367510026504 0ustar pysdk-ciamazon00000000000000**To confirm the creation of a hosted connection on an interconnect** The following ``confirm-connection`` command confirms the creation of a hosted connection on an interconnect:: aws directconnect confirm-connection --connection-id dxcon-fg2wi7hy Output:: { "connectionState": "pending" } awscli-1.14.44/awscli/examples/directconnect/describe-direct-connect-gateway-associations.rst0000666454262600001440000000234513243367510033522 0ustar pysdk-ciamazon00000000000000**To describe Direct Connect gateway associations** The following example describes all the associations with Direct Connect gateway ``5f294f92-bafb-4011-916d-9b0bexample``. Command:: aws directconnect describe-direct-connect-gateway-associations --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample Output:: { "nextToken": "eyJ2IjoxLCJzIjoxLCJpIjoiOU83OTFodzdycnZCbkN4MExHeHVwQT09IiwiYyI6InIxTEN0UEVHV0I1UFlkaWFnNlUxanJkRWF6eW1iOElHM0FRVW1MdHRJK0dxcnN1RWtvcFBKWFE2ZjRNRGdGTkhCa0tDZmVINEtZOEYwZ0dEYWZpbmU0ZnZMYVhKRjdXRVdENmdQZ1Y4d2w0PSJ9", "directConnectGatewayAssociations": [ { "associationState": "associating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-6efe725e", "virtualGatewayRegion": "us-east-2" }, { "associationState": "disassociating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-ebaa27db", "virtualGatewayRegion": "us-east-2" } ] }awscli-1.14.44/awscli/examples/directconnect/create-direct-connect-gateway-association.rst0000666454262600001440000000146613243367510033025 0ustar pysdk-ciamazon00000000000000**To associate a virtual private gateway with a Direct Connect gateway** The following example associates virtual private gateway ``vgw-6efe725e`` with Direct Connect gateway ``5f294f92-bafb-4011-916d-9b0bexample``. You must run the command in the region in which the virtual private gateway is located. Command:: aws directconnect create-direct-connect-gateway-association --direct-connect-gateway-id 5f294f92-bafb-4011-916d-9b0bexample --virtual-gateway-id vgw-6efe725e Output:: { "directConnectGatewayAssociation": { "associationState": "associating", "virtualGatewayOwnerAccount": "123456789012", "directConnectGatewayId": "5f294f92-bafb-4011-916d-9b0bexample", "virtualGatewayId": "vgw-6efe725e", "virtualGatewayRegion": "us-east-2" } }awscli-1.14.44/awscli/examples/directconnect/describe-interconnects.rst0000666454262600001440000000102313243367510027333 0ustar pysdk-ciamazon00000000000000**To list interconnects** The following ``describe-interconnects`` command lists the interconnects owned by your AWS account:: aws directconnect describe-interconnects Output:: { "interconnects": [ { "region": "sa-east-1", "bandwidth": "1Gbps", "location": "TIVIT", "interconnectName": "1G Interconnect to AWS", "interconnectId": "dxcon-fgktov66", "interconnectState": "down" } ] }awscli-1.14.44/awscli/examples/directconnect/describe-virtual-interfaces.rst0000666454262600001440000000531613243367510030275 0ustar pysdk-ciamazon00000000000000**To list all virtual interfaces** The following ``describe-virtual-interfaces`` command lists the information about all virtual interfaces associated with your AWS account:: aws directconnect describe-virtual-interfaces --connection-id dxcon-ffjrkx17 Output:: { "virtualInterfaces": [ { "virtualInterfaceState": "down", "asn": 65000, "vlan": 101, "customerAddress": "192.168.1.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "vgw-aba37db6", "virtualInterfaceId": "dxvif-ffhhk74f", "authKey": "asdf34example", "routeFilterPrefixes": [], "location": "TIVIT", "customerRouterConfig": "\n\n 101\n 192.168.1.2/30\n 192.168.1.1/30\n 65000\n asdf34example\n 7224\n private\n\n", "amazonAddress": "192.168.1.1/30", "virtualInterfaceType": "private", "virtualInterfaceName": "PrivateVirtualInterface" }, { "virtualInterfaceState": "verifying", "asn": 65000, "vlan": 2000, "customerAddress": "203.0.113.2/30", "ownerAccount": "123456789012", "connectionId": "dxcon-ffjrkx17", "virtualGatewayId": "", "virtualInterfaceId": "dxvif-fgh0hcrk", "authKey": "asdf34example", "routeFilterPrefixes": [ { "cidr": "203.0.113.4/30" }, { "cidr": "203.0.113.0/30" } ], "location": "TIVIT", "customerRouterConfig": "\n\n 2000\n 203.0.113.2/30\n 203.0.113.1/30\n 65000\n asdf34example\n 7224\n public\n\n", "amazonAddress": "203.0.113.1/30", "virtualInterfaceType": "public", "virtualInterfaceName": "PublicVirtualInterface" } ] }awscli-1.14.44/awscli/examples/dynamodb/0000777454262600001440000000000013243367512021124 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/dynamodb/query.rst0000666454262600001440000000166613243367510023032 0ustar pysdk-ciamazon00000000000000**To query an item** This example queries items in the *MusicCollection* table. The table has a hash-and-range primary key (*Artist* and *SongTitle*), but this query only specifies the hash key value. It returns song titles by the artist named "No One You Know". Command:: aws dynamodb query --table-name MusicCollection --projection-expression "SongTitle" --key-condition-expression "Artist = :v1" --expression-attribute-values file://expression-attributes.json The arguments for ``--expression-attribute-values`` are stored in a JSON file named ``expression-attributes.json``:: { ":v1": {"S": "No One You Know"} } Output:: { "Count": 2, "Items": [ { "SongTitle": { "S": "Call Me Today" }, "SongTitle": { "S": "Scared of My Shadow" } } ], "ScannedCount": 2, "ConsumedCapacity": null } awscli-1.14.44/awscli/examples/dynamodb/batch-write-item.rst0000666454262600001440000000247113243367510025025 0ustar pysdk-ciamazon00000000000000**To add multiple items to a table** This example adds three new items to the *MusicCollection* table using a batch of three PutItem requests. Command:: aws dynamodb batch-write-item --request-items file://request-items.json The arguments for ``--request-items`` are stored in a JSON file, ``request-items.json``. Here are the contents of that file:: { "MusicCollection": [ { "PutRequest": { "Item": { "Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Call Me Today"}, "AlbumTitle": {"S": "Somewhat Famous"} } } }, { "PutRequest": { "Item": { "Artist": {"S": "Acme Band"}, "SongTitle": {"S": "Happy Day"}, "AlbumTitle": {"S": "Songs About Life"} } } }, { "PutRequest": { "Item": { "Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Scared of My Shadow"}, "AlbumTitle": {"S": "Blue Sky Blues"} } } } ] } Output:: { "UnprocessedItems": {} } awscli-1.14.44/awscli/examples/dynamodb/update-item.rst0000666454262600001440000000264313243367510024077 0ustar pysdk-ciamazon00000000000000**To update an item in a table** This example updates an item in the *MusicCollection* table. It adds a new attribute (*Year*) and modifies the *AlbumTitle* attribute. All of the attributes in the item, as they appear after the update, are returned in the response. Command:: aws dynamodb update-item --table-name MusicCollection --key file://key.json --update-expression "SET #Y = :y, #AT = :t" --expression-attribute-names file://expression-attribute-names.json --expression-attribute-values file://expression-attribute-values.json --return-values ALL_NEW The arguments for ``--key`` are stored in a JSON file, ``key.json``. Here are the contents of that file:: { "Artist": {"S": "Acme Band"}, "SongTitle": {"S": "Happy Day"} } The arguments for ``--expression-attribute-names`` are stored in a JSON file, ``expression-attribute-names.json``. Here are the contents of that file:: { "#Y":"Year", "#AT":"AlbumTitle" } The arguments for ``--expression-attribute-values`` are stored in a JSON file, ``expression-attribute-values.json``. Here are the contents of that file:: { ":y":{"N": "2015"}, ":t":{"S": "Louder Than Ever"} } Output:: { "Item": { "AlbumTitle": { "S": "Songs About Life" }, "SongTitle": { "S": "Happy Day" }, "Artist": { "S": "Acme Band" } } } awscli-1.14.44/awscli/examples/dynamodb/delete-table.rst0000666454262600001440000000077313243367510024212 0ustar pysdk-ciamazon00000000000000**To delete a table** This example deletes the *MusicCollection* table. Command:: aws dynamodb delete-table --table-name MusicCollection Output:: { "TableDescription": { "TableStatus": "DELETING", "TableSizeBytes": 0, "ItemCount": 0, "TableName": "MusicCollection", "ProvisionedThroughput": { "NumberOfDecreasesToday": 0, "WriteCapacityUnits": 5, "ReadCapacityUnits": 5 } } } awscli-1.14.44/awscli/examples/dynamodb/list-tables.rst0000666454262600001440000000044013243367510024075 0ustar pysdk-ciamazon00000000000000**To list tables** This example lists all of the tables associated with the current AWS account and endpoint Command:: aws dynamodb list-tables Output:: { "TableNames": [ "Forum", "ProductCatalog", "Reply", "Thread", ] } awscli-1.14.44/awscli/examples/dynamodb/scan.rst0000666454262600001440000000261713243367510022606 0ustar pysdk-ciamazon00000000000000**To scan a table** This example scans the entire *MusicCollection* table, and then narrows the results to songs by the artist "No One You Know". For each item, only the album title and song title are returned. Command:: aws dynamodb scan --table-name MusicCollection --filter-expression "Artist = :a" --projection-expression "#ST, #AT" --expression-attribute-names file://expression-attribute-names.json --expression-attribute-values file://expression-attribute-values.json The arguments for ``--expression-attribute-names`` are stored in a JSON file, ``expression-attribute-names.json``. Here are the contents of that file:: { "#ST": "SongTitle", "#AT":"AlbumTitle" } The arguments for ``--expression-attribute-values`` are stored in a JSON file, ``expression-attribute-values.json``. Here are the contents of that file:: { ":a": {"S": "No One You Know"} } Output:: { "Count": 2, "Items": [ { "SongTitle": { "S": "Call Me Today" }, "AlbumTitle": { "S": "Somewhat Famous" } }, { "SongTitle": { "S": "Scared of My Shadow" }, "AlbumTitle": { "S": "Blue Sky Blues" } } ], "ScannedCount": 3, "ConsumedCapacity": null } awscli-1.14.44/awscli/examples/dynamodb/delete-item.rst0000666454262600001440000000100013243367510024041 0ustar pysdk-ciamazon00000000000000**To delete an item** This example deletes an item from the *MusicCollection* table. Command:: aws dynamodb delete-item --table-name MusicCollection --key file://key.json The arguments for ``--key`` are stored in a JSON file, ``key.json``. Here are the contents of that file:: { "Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Scared of My Shadow"} } Output:: { "ConsumedCapacity": { "CapacityUnits": 1.0, "TableName": "MusicCollection" } } awscli-1.14.44/awscli/examples/dynamodb/batch-get-item.rst0000666454262600001440000000267613243367510024461 0ustar pysdk-ciamazon00000000000000**To retrieve multiple items from a table** This example reads multiple items from the *MusicCollection* table using a batch of three GetItem requests. Only the *AlbumTitle* attribute is returned. Command:: aws dynamodb batch-get-item --request-items file://request-items.json The arguments for ``--request-items`` are stored in a JSON file, ``request-items.json``. Here are the contents of that file:: { "MusicCollection": { "Keys": [ { "Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Call Me Today"} }, { "Artist": {"S": "Acme Band"}, "SongTitle": {"S": "Happy Day"} }, { "Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Scared of My Shadow"} } ], "ProjectionExpression":"AlbumTitle" } } Output:: { "UnprocessedKeys": {}, "Responses": { "MusicCollection": [ { "AlbumTitle": { "S": "Somewhat Famous" } }, { "AlbumTitle": { "S": "Blue Sky Blues" } }, { "AlbumTitle": { "S": "Louder Than Ever" } } ] } } awscli-1.14.44/awscli/examples/dynamodb/update-table.rst0000666454262600001440000000243613243367510024230 0ustar pysdk-ciamazon00000000000000**To modify a table's provisioned throughput** This example increases the provisioned read and write capacity on the *MusicCollection* table. Command:: aws dynamodb update-table --table-name MusicCollection --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=10 Output:: { "TableDescription": { "AttributeDefinitions": [ { "AttributeName": "Artist", "AttributeType": "S" }, { "AttributeName": "SongTitle", "AttributeType": "S" } ], "ProvisionedThroughput": { "NumberOfDecreasesToday": 0, "WriteCapacityUnits": 1, "LastIncreaseDateTime": 1421874759.194, "ReadCapacityUnits": 1 }, "TableSizeBytes": 0, "TableName": "MusicCollection", "TableStatus": "UPDATING", "KeySchema": [ { "KeyType": "HASH", "AttributeName": "Artist" }, { "KeyType": "RANGE", "AttributeName": "SongTitle" } ], "ItemCount": 0, "CreationDateTime": 1421866952.062 } } awscli-1.14.44/awscli/examples/dynamodb/get-item.rst0000666454262600001440000000135613243367510023374 0ustar pysdk-ciamazon00000000000000**To read an item in a table** This example retrieves an item from the *MusicCollection* table. The table has a hash-and-range primary key (*Artist* and *SongTitle*), so you must specify both of these attributes. Command:: aws dynamodb get-item --table-name MusicCollection --key file://key.json The arguments for ``--key`` are stored in a JSON file, ``key.json``. Here are the contents of that file:: { "Artist": {"S": "Acme Band"}, "SongTitle": {"S": "Happy Day"} } Output:: { "Item": { "AlbumTitle": { "S": "Songs About Life" }, "SongTitle": { "S": "Happy Day" }, "Artist": { "S": "Acme Band" } } } awscli-1.14.44/awscli/examples/dynamodb/put-item.rst0000666454262600001440000000224613243367510023424 0ustar pysdk-ciamazon00000000000000**To add an item to a table** This example adds a new item to the *MusicCollection* table. Command:: aws dynamodb put-item --table-name MusicCollection --item file://item.json --return-consumed-capacity TOTAL The arguments for ``--item`` are stored in a JSON file, ``item.json``. Here are the contents of that file:: { "Artist": {"S": "No One You Know"}, "SongTitle": {"S": "Call Me Today"}, "AlbumTitle": {"S": "Somewhat Famous"} } Output:: { "ConsumedCapacity": { "CapacityUnits": 1.0, "TableName": "MusicCollection" } } **Conditional Expressions** This example shows how to perform a one-line conditional expression operation. This put-item call to the table *MusicCollection* table will only succeed if the artist "Obscure Indie Band" does not exist in the table. Command:: aws dynamodb put-item --table-name MusicCollection --item '{"Artist": {"S": "Obscure Indie Band"}}' --condition-expression "attribute_not_exists(Artist)" If the key already exists, you should see: Output:: A client error (ConditionalCheckFailedException) occurred when calling the PutItem operation: The conditional request failed awscli-1.14.44/awscli/examples/dynamodb/create-table.rst0000666454262600001440000000253513243367510024211 0ustar pysdk-ciamazon00000000000000**To create a table** This example creates a table named *MusicCollection*. Command:: aws dynamodb create-table --table-name MusicCollection --attribute-definitions AttributeName=Artist,AttributeType=S AttributeName=SongTitle,AttributeType=S --key-schema AttributeName=Artist,KeyType=HASH AttributeName=SongTitle,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 Output:: { "TableDescription": { "AttributeDefinitions": [ { "AttributeName": "Artist", "AttributeType": "S" }, { "AttributeName": "SongTitle", "AttributeType": "S" } ], "ProvisionedThroughput": { "NumberOfDecreasesToday": 0, "WriteCapacityUnits": 5, "ReadCapacityUnits": 5 }, "TableSizeBytes": 0, "TableName": "MusicCollection", "TableStatus": "CREATING", "KeySchema": [ { "KeyType": "HASH", "AttributeName": "Artist" }, { "KeyType": "RANGE", "AttributeName": "SongTitle" } ], "ItemCount": 0, "CreationDateTime": 1421866952.062 } } awscli-1.14.44/awscli/examples/dynamodb/describe-table.rst0000666454262600001440000000212513243367510024521 0ustar pysdk-ciamazon00000000000000**To describe a table** This example describes the *MusicCollection* table. Command:: aws dynamodb describe-table --table-name MusicCollection Output:: { "Table": { "AttributeDefinitions": [ { "AttributeName": "Artist", "AttributeType": "S" }, { "AttributeName": "SongTitle", "AttributeType": "S" } ], "ProvisionedThroughput": { "NumberOfDecreasesToday": 0, "WriteCapacityUnits": 5, "ReadCapacityUnits": 5 }, "TableSizeBytes": 0, "TableName": "MusicCollection", "TableStatus": "ACTIVE", "KeySchema": [ { "KeyType": "HASH", "AttributeName": "Artist" }, { "KeyType": "RANGE", "AttributeName": "SongTitle" } ], "ItemCount": 0, "CreationDateTime": 1421866952.062 } } awscli-1.14.44/awscli/examples/apigateway/0000777454262600001440000000000013243367512021462 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/apigateway/get-domain-names.rst0000666454262600001440000000061513243367510025341 0ustar pysdk-ciamazon00000000000000**To get a list of custom domain names** Command:: aws apigateway get-domain-names Output:: { "items": [ { "distributionDomainName": "d9511k3l09bkd.cloudfront.net", "certificateUploadDate": 1452812505, "certificateName": "my_custom_domain-certificate", "domainName": "subdomain.domain.tld" } ] } awscli-1.14.44/awscli/examples/apigateway/get-model-template.rst0000666454262600001440000000035713243367510025705 0ustar pysdk-ciamazon00000000000000**To get the mapping template for a model defined under a REST API** Command:: aws apigateway get-model-template --rest-api-id 1234123412 --model-name Empty Output:: { "value": "#set($inputRoot = $input.path('$'))\n{ }" } awscli-1.14.44/awscli/examples/apigateway/get-model.rst0000666454262600001440000000071613243367510024073 0ustar pysdk-ciamazon00000000000000**To get the configuration for a model defined under a REST API** Command:: aws apigateway get-model --rest-api-id 1234123412 --model-name Empty Output:: { "contentType": "application/json", "description": "This is a default empty schema model", "name": "Empty", "id": "etd5w5", "schema": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"title\" : \"Empty Schema\",\n \"type\" : \"object\"\n}" } awscli-1.14.44/awscli/examples/apigateway/get-api-keys.rst0000666454262600001440000000101313243367510024504 0ustar pysdk-ciamazon00000000000000**To get the list of API keys** Command:: aws apigateway get-api-keys Output:: { "items": [ { "description": "My first key", "enabled": true, "stageKeys": [ "a1b2c3d4e5/dev", "e5d4c3b2a1/dev" ], "lastUpdatedDate": 1456184515, "createdDate": 1456184452, "id": "8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk", "name": "My key" } ] } awscli-1.14.44/awscli/examples/apigateway/get-method-response.rst0000666454262600001440000000054713243367510026111 0ustar pysdk-ciamazon00000000000000**To get the method response resource configuration for a HTTP method defined under a REST API's resource** Command:: aws apigateway get-method-response --rest-api-id 1234123412 --resource-id y9h6rt --http-method GET --status-code 200 Output:: { "responseModels": { "application/json": "Empty" }, "statusCode": "200" } awscli-1.14.44/awscli/examples/apigateway/update-integration.rst0000666454262600001440000000222313243367510026014 0ustar pysdk-ciamazon00000000000000**To add the 'Content-Type: application/json' Mapping Template configured with Input Passthrough** Command:: 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"}' **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' **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' awscli-1.14.44/awscli/examples/apigateway/update-method-response.rst0000666454262600001440000000116313243367510026607 0ustar pysdk-ciamazon00000000000000**To create a new method response header for the 200 response in a method and define it as not required (default)** 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" **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" awscli-1.14.44/awscli/examples/apigateway/delete-api-key.rst0000666454262600001440000000017013243367510025007 0ustar pysdk-ciamazon00000000000000**To delete an API key** Command:: aws apigateway delete-api-key --api-key 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk awscli-1.14.44/awscli/examples/apigateway/flush-stage-authorizers-cache.rst0000666454262600001440000000023213243367510030047 0ustar pysdk-ciamazon00000000000000**To flush all authorizer cache entries on a stage** Command:: aws apigateway flush-stage-authorizers-cache --rest-api-id 1234123412 --stage-name dev awscli-1.14.44/awscli/examples/apigateway/update-domain-name.rst0000666454262600001440000000066013243367510025661 0ustar pysdk-ciamazon00000000000000**To change the certificate name for a custom domain name** Command:: aws apigateway update-domain-name --domain-name api.domain.tld --patch-operations op='replace',path='/certificateName',value='newDomainCertName' Output:: { "domainName": "api.domain.tld", "distributionDomainName": "d123456789012.cloudfront.net", "certificateName": "newDomainCertName", "certificateUploadDate": 1462565487 } awscli-1.14.44/awscli/examples/apigateway/delete-stage.rst0000666454262600001440000000016613243367510024560 0ustar pysdk-ciamazon00000000000000**To delete a stage in an API** Command:: aws apigateway delete-stage --rest-api-id 1234123412 --stage-name 'dev' awscli-1.14.44/awscli/examples/apigateway/put-integration.rst0000666454262600001440000000147213243367510025347 0ustar pysdk-ciamazon00000000000000**To create a MOCK integration request** Command:: 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' **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' awscli-1.14.44/awscli/examples/apigateway/get-usage-plan-key.rst0000666454262600001440000000027313243367510025613 0ustar pysdk-ciamazon00000000000000**To get the details of an API key associated with a Usage Plan** Command:: aws apigateway get-usage-plan-key --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu awscli-1.14.44/awscli/examples/apigateway/delete-model.rst0000666454262600001440000000020513243367510024547 0ustar pysdk-ciamazon00000000000000**To delete a model in the given API** Command:: aws apigateway delete-model --rest-api-id 1234123412 --model-name 'customModel' awscli-1.14.44/awscli/examples/apigateway/delete-rest-api.rst0000666454262600001440000000013313243367510025173 0ustar pysdk-ciamazon00000000000000**To delete an API** Command:: aws apigateway delete-rest-api --rest-api-id 1234123412 awscli-1.14.44/awscli/examples/apigateway/get-resources.rst0000666454262600001440000000064413243367510025005 0ustar pysdk-ciamazon00000000000000**To get a list of resources for a REST API** Command:: aws apigateway get-resources --rest-api-id 1234123412 Output:: { "items": [ { "path": "/resource/subresource", "resourceMethods": { "POST": {} }, "id": "024ace", "pathPart": "subresource", "parentId": "ai5b02" } ] } awscli-1.14.44/awscli/examples/apigateway/create-stage.rst0000666454262600001440000000077413243367510024566 0ustar pysdk-ciamazon00000000000000**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 **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' awscli-1.14.44/awscli/examples/apigateway/update-method.rst0000666454262600001440000000070613243367510024755 0ustar pysdk-ciamazon00000000000000**To modify a method to require an API Key** Command:: 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" awscli-1.14.44/awscli/examples/apigateway/get-authorizers.rst0000666454262600001440000000111713243367510025346 0ustar pysdk-ciamazon00000000000000**To get the list of authorizers for a REST API** Command:: aws apigateway get-authorizers --rest-api-id 1234123412 Output:: { "items": [ { "name": "MyAuthorizer", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:My_Authorizer_Function/invocations", "authorizerResultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", "type": "TOKEN", "id": "gfi4n3" } ] } awscli-1.14.44/awscli/examples/apigateway/flush-stage-cache.rst0000666454262600001440000000020313243367510025470 0ustar pysdk-ciamazon00000000000000**To flush the cache for an API's stage** Command:: aws apigateway flush-stage-cache --rest-api-id 1234123412 --stage-name dev awscli-1.14.44/awscli/examples/apigateway/get-stages.rst0000666454262600001440000000174313243367510024262 0ustar pysdk-ciamazon00000000000000**To get the list of stages for a REST API** Command:: aws apigateway get-stages --rest-api-id 1234123412 Output:: { "item": [ { "stageName": "dev", "cacheClusterSize": "0.5", "cacheClusterEnabled": true, "cacheClusterStatus": "AVAILABLE", "deploymentId": "123h64", "lastUpdatedDate": 1456185138, "createdDate": 1453589092, "methodSettings": { "~1resource~1subresource/POST": { "cacheTtlInSeconds": 300, "loggingLevel": "INFO", "dataTraceEnabled": true, "metricsEnabled": true, "throttlingRateLimit": 500.0, "cacheDataEncrypted": false, "cachingEnabled": false, "throttlingBurstLimit": 1000 } } } ] } awscli-1.14.44/awscli/examples/apigateway/get-usage-plan.rst0000666454262600001440000000015213243367510025021 0ustar pysdk-ciamazon00000000000000**To get the details of a Usage Plan** Command:: aws apigateway get-usage-plan --usage-plan-id a1b2c3 awscli-1.14.44/awscli/examples/apigateway/get-domain-name.rst0000666454262600001440000000052213243367510025153 0ustar pysdk-ciamazon00000000000000**To get information about a custom domain name** Command:: aws apigateway get-domain-name --domain-name api.domain.tld Output:: { "domainName": "api.domain.tld", "distributionDomainName": "d1a2f3a4c5o6d.cloudfront.net", "certificateName": "uploadedCertificate", "certificateUploadDate": 1462565487 } awscli-1.14.44/awscli/examples/apigateway/create-domain-name.rst0000666454262600001440000000040313243367510025635 0ustar pysdk-ciamazon00000000000000**To create the custom domain name** Command:: 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' awscli-1.14.44/awscli/examples/apigateway/update-deployment.rst0000666454262600001440000000051313243367510025651 0ustar pysdk-ciamazon00000000000000**To change the description of a deployment** Command:: aws apigateway update-deployment --rest-api-id 1234123412 --deployment-id ztt4m2 --patch-operations op='replace',path='/description',value='newDescription' Output:: { "description": "newDescription", "id": "ztt4m2", "createdDate": 1455218022 } awscli-1.14.44/awscli/examples/apigateway/delete-integration.rst0000666454262600001440000000026713243367510026002 0ustar pysdk-ciamazon00000000000000**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 awscli-1.14.44/awscli/examples/apigateway/get-rest-apis.rst0000666454262600001440000000040013243367510024670 0ustar pysdk-ciamazon00000000000000**To get a list of REST APIs** Command:: aws apigateway get-rest-apis Output:: { "items": [ { "createdDate": 1438884790, "id": "12s44z21rb", "name": "My First API" } ] } awscli-1.14.44/awscli/examples/apigateway/get-sdk.rst0000666454262600001440000000220413243367510023546 0ustar pysdk-ciamazon00000000000000**To get the Android SDK for a REST API stage** Command:: aws apigateway get-sdk --rest-api-id 1234123412 --stage-name dev --sdk-type android --parameters groupId='com.mycompany',invokerPackage='com.mycompany.clientsdk',artifactId='Mycompany-client',artifactVersion='1.0.0' /path/to/android_sdk.zip Output:: { "contentType": "application/octet-stream", "contentDisposition": "attachment; filename=\"android_2016-02-22_23-52Z.zip\"" } **To get the IOS SDK for a REST API stage** Command:: aws apigateway get-sdk --rest-api-id 1234123412 --stage-name dev --sdk-type objectivec --parameters classPrefix='myprefix' /path/to/iOS_sdk.zip Output:: { "contentType": "application/octet-stream", "contentDisposition": "attachment; filename=\"objectivec_2016-02-22_23-52Z.zip\"" } **To get the Javascript SDK for a REST API stage** Command:: aws apigateway get-sdk --rest-api-id 1234123412 --stage-name dev --sdk-type javascript /path/to/javascript_sdk.zip Output:: { "contentType": "application/octet-stream", "contentDisposition": "attachment; filename=\"javascript_2016-02-22_23-52Z.zip\"" } awscli-1.14.44/awscli/examples/apigateway/update-base-path-mapping.rst0000666454262600001440000000047013243367510026770 0ustar pysdk-ciamazon00000000000000**To change the base path for a custom domain name** Command:: aws apigateway update-base-path-mapping --domain-name api.domain.tld --base-path prod --patch-operations op='replace',path='/basePath',value='v1' Output:: { "basePath": "v1", "restApiId": "1234123412", "stage": "api" } awscli-1.14.44/awscli/examples/apigateway/update-client-certificate.rst0000666454262600001440000000033313243367510027227 0ustar pysdk-ciamazon00000000000000**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' awscli-1.14.44/awscli/examples/apigateway/create-usage-plan-key.rst0000666454262600001440000000024713243367510026300 0ustar pysdk-ciamazon00000000000000**Associate an existing API key with a Usage Plan** Command:: aws apigateway create-usage-plan-key --usage-plan-id a1b2c3 --key-type "API_KEY" --key-id 4vq3yryqm5 awscli-1.14.44/awscli/examples/apigateway/put-rest-api.rst0000666454262600001440000000057213243367510024550 0ustar pysdk-ciamazon00000000000000**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' **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' awscli-1.14.44/awscli/examples/apigateway/update-authorizer.rst0000666454262600001440000000254613243367510025675 0ustar pysdk-ciamazon00000000000000**To change the name of the Custom Authorizer** Command:: aws apigateway update-authorizer --rest-api-id 1234123412 --authorizer-id gfi4n3 --patch-operations op='replace',path='/name',value='testAuthorizer' Output:: { "authType": "custom", "name": "testAuthorizer", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthorizer/invocations", "authorizerResultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", "type": "TOKEN", "id": "gfi4n3" } **To change the Lambda Function that is invoked by the Custom Authorizer** 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' Output:: { "authType": "custom", "name": "testAuthorizer", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:newAuthorizer/invocations", "authorizerResultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", "type": "TOKEN", "id": "gfi4n3" } awscli-1.14.44/awscli/examples/apigateway/get-integration.rst0000666454262600001440000000127013243367510025312 0ustar pysdk-ciamazon00000000000000**To get the integration configuration for a HTTP method defined under a REST API's resource** Command:: aws apigateway get-integration --rest-api-id 1234123412 --resource-id y9h6rt --http-method GET Output:: { "httpMethod": "POST", "integrationResponses": { "200": { "responseTemplates": { "application/json": null }, "statusCode": "200" } }, "cacheKeyParameters": [], "type": "AWS", "uri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:My_Function/invocations", "cacheNamespace": "y9h6rt" } awscli-1.14.44/awscli/examples/apigateway/get-usage.rst0000666454262600001440000000023613243367510024074 0ustar pysdk-ciamazon00000000000000**To get the usage details for a Usage Plan** Command:: aws apigateway get-usage --usage-plan-id a1b2c3 --start-date "2016-08-16" --end-date "2016-08-17" awscli-1.14.44/awscli/examples/apigateway/test-invoke-authorizer.rst0000666454262600001440000000034013243367510026651 0ustar pysdk-ciamazon00000000000000**To test invoke a request to a Custom Authorizer including the required header and value** Command:: aws apigateway test-invoke-authorizer --rest-api-id 1234123412 --authorizer-id 5yid1t --headers Authorization='Value' awscli-1.14.44/awscli/examples/apigateway/update-integration-response.rst0000666454262600001440000000143213243367510027651 0ustar pysdk-ciamazon00000000000000**To change an integration response header to have a static mapping of '*'** Command:: aws apigateway update-integration-response --rest-api-id 1234123412 --resource-id 3gapai --http-method GET --status-code 200 --patch-operations op='replace',path='/responseParameters/method.response.header.Access-Control-Allow-Origin',value='"'"'*'"'"' Output:: { "statusCode": "200", "responseParameters": { "method.response.header.Access-Control-Allow-Origin": "'*'" } } **To remove an integration response header** Command:: aws apigateway update-integration-response --rest-api-id 1234123412 --resource-id 3gapai --http-method GET --status-code 200 --patch-operations op='remove',path='/responseParameters/method.response.header.Access-Control-Allow-Origin' awscli-1.14.44/awscli/examples/apigateway/delete-domain-name.rst0000666454262600001440000000016213243367510025636 0ustar pysdk-ciamazon00000000000000**To delete a custom domain name** Command:: aws apigateway delete-domain-name --domain-name 'api.domain.tld' awscli-1.14.44/awscli/examples/apigateway/create-base-path-mapping.rst0000666454262600001440000000031313243367510026745 0ustar pysdk-ciamazon00000000000000**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 awscli-1.14.44/awscli/examples/apigateway/get-deployments.rst0000666454262600001440000000050613243367510025333 0ustar pysdk-ciamazon00000000000000**To get a list of deployments for a REST API** Command:: aws apigateway get-deployments --rest-api-id 1234123412 Output:: { "items": [ { "createdDate": 1453797217, "id": "0a2b4c", "description": "Deployed my API for the first time" } ] } awscli-1.14.44/awscli/examples/apigateway/get-client-certificates.rst0000666454262600001440000000072613243367510026715 0ustar pysdk-ciamazon00000000000000**To get a list of client certificates** Command:: aws apigateway get-client-certificates Output:: { "items": [ { "pemEncodedCertificate": "-----BEGIN CERTIFICATE----- -----END CERTIFICATE-----", "clientCertificateId": "a1b2c3", "expirationDate": 1483556561, "description": "My Client Certificate", "createdDate": 1452020561 } ] } awscli-1.14.44/awscli/examples/apigateway/create-model.rst0000666454262600001440000000144413243367510024556 0ustar pysdk-ciamazon00000000000000**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" } } } } }' Output:: { "contentType": "application/json", "description": "The First Model", "name": "firstModel", "id": "2rzg0l", "schema": "{ \"$schema\": \"http://json-schema.org/draft-04/schema#\", \"title\": \"firstModel\", \"type\": \"object\", \"properties\": { \"firstProperty\" : { \"type\": \"object\", \"properties\": { \"key\": { \"type\": \"string\" } } } } }" } awscli-1.14.44/awscli/examples/apigateway/put-integration-response.rst0000666454262600001440000000124113243367510027175 0ustar pysdk-ciamazon00000000000000**To create an integration response as the default response with a mapping template defined** 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\"}"}' **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'"'"'"}' awscli-1.14.44/awscli/examples/apigateway/delete-base-path-mapping.rst0000666454262600001440000000024213243367510026745 0ustar pysdk-ciamazon00000000000000**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' awscli-1.14.44/awscli/examples/apigateway/get-export.rst0000666454262600001440000000121213243367510024304 0ustar pysdk-ciamazon00000000000000**To get the JSON Swagger template for a stage** Command:: aws apigateway get-export --rest-api-id a1b2c3d4e5 --stage-name dev --export-type swagger /path/to/filename.json **To get the JSON Swagger template + API Gateway Extentions for a stage** Command:: aws apigateway get-export --parameters extensions='integrations' --rest-api-id a1b2c3d4e5 --stage-name dev --export-type swagger /path/to/filename.json **To get the JSON Swagger template + Postman Extensions for a stage** Command:: aws apigateway get-export --parameters extensions='postman' --rest-api-id a1b2c3d4e5 --stage-name dev --export-type swagger /path/to/filename.json awscli-1.14.44/awscli/examples/apigateway/get-account.rst0000666454262600001440000000044113243367510024422 0ustar pysdk-ciamazon00000000000000**To get API Gateway account settings** Command:: aws apigateway get-account Output:: { "cloudwatchRoleArn": "arn:aws:iam::123412341234:role/APIGatewayToCloudWatchLogsRole", "throttleSettings": { "rateLimit": 500.0, "burstLimit": 1000 } } awscli-1.14.44/awscli/examples/apigateway/delete-authorizer.rst0000666454262600001440000000021313243367510025642 0ustar pysdk-ciamazon00000000000000**To delete a Custom Authorizer in an API** Command:: aws apigateway delete-authorizer --rest-api-id 1234123412 --authorizer-id 7gkfbo awscli-1.14.44/awscli/examples/apigateway/get-usage-plans.rst0000666454262600001440000000012713243367510025206 0ustar pysdk-ciamazon00000000000000**To get the details of all Usage Plans** Command:: aws apigateway get-usage-plans awscli-1.14.44/awscli/examples/apigateway/get-base-path-mapping.rst0000666454262600001440000000040213243367510026260 0ustar pysdk-ciamazon00000000000000**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 Output:: { "basePath": "v1", "restApiId": "1234w4321e", "stage": "api" } awscli-1.14.44/awscli/examples/apigateway/update-stage.rst0000666454262600001440000000104113243367510024571 0ustar pysdk-ciamazon00000000000000**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 **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 awscli-1.14.44/awscli/examples/apigateway/create-api-key.rst0000666454262600001440000000035313243367510025013 0ustar pysdk-ciamazon00000000000000**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' awscli-1.14.44/awscli/examples/apigateway/delete-integration-response.rst0000666454262600001440000000035113243367510027630 0ustar pysdk-ciamazon00000000000000**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 awscli-1.14.44/awscli/examples/apigateway/get-authorizer.rst0000666454262600001440000000100613243367510025160 0ustar pysdk-ciamazon00000000000000**To get the API Gateway per-API Authorizer settings** Command:: aws apigateway get-authorizer --rest-api-id 1234123412 --authorizer-id gfi4n3 Output:: { "authorizerResultTtlInSeconds": 300, "name": "MyAuthorizer", "type": "TOKEN", "identitySource": "method.request.header.Authorization", "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" } awscli-1.14.44/awscli/examples/apigateway/get-deployment.rst0000666454262600001440000000036413243367510025152 0ustar pysdk-ciamazon00000000000000**To get information about a deployment** Command:: aws apigateway get-deployment --rest-api-id 1234123412 --deployment-id ztt4m2 Output:: { "description": "myDeployment", "id": "ztt4m2", "createdDate": 1455218022 } awscli-1.14.44/awscli/examples/apigateway/delete-resource.rst0000666454262600001440000000017613243367510025305 0ustar pysdk-ciamazon00000000000000**To delete a resource in an API** Command:: aws apigateway delete-resource --rest-api-id 1234123412 --resource-id a1b2c3 awscli-1.14.44/awscli/examples/apigateway/get-base-path-mappings.rst0000666454262600001440000000070413243367510026450 0ustar pysdk-ciamazon00000000000000**To get the base path mappings for a custom domain name** Command:: aws apigateway get-base-path-mappings --domain-name subdomain.domain.tld Output:: { "items": [ { "basePath": "(none)", "restApiId": "1234w4321e", "stage": "dev" }, { "basePath": "v1", "restApiId": "1234w4321e", "stage": "api" } ] } awscli-1.14.44/awscli/examples/apigateway/generate-client-certificate.rst0000666454262600001440000000022113243367510027533 0ustar pysdk-ciamazon00000000000000**To create a Client-Side SSL Certificate** Command:: aws apigateway generate-client-certificate --description 'My First Client Certificate' awscli-1.14.44/awscli/examples/apigateway/update-usage-plan.rst0000666454262600001440000000141713243367510025531 0ustar pysdk-ciamazon00000000000000**To change the period defined in a Usage Plan** Command:: 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" **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" **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" awscli-1.14.44/awscli/examples/apigateway/update-model.rst0000666454262600001440000000100113243367510024562 0ustar pysdk-ciamazon00000000000000**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' **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\" }"' awscli-1.14.44/awscli/examples/apigateway/get-usage-plan-keys.rst0000666454262600001440000000020513243367510025771 0ustar pysdk-ciamazon00000000000000**To get the list of API keys associated with a Usage Plan** Command:: aws apigateway get-usage-plan-keys --usage-plan-id a1b2c3 awscli-1.14.44/awscli/examples/apigateway/delete-client-certificate.rst0000666454262600001440000000017113243367510027207 0ustar pysdk-ciamazon00000000000000**To delete a client certificate** Command:: aws apigateway delete-client-certificate --client-certificate-id a1b2c3 awscli-1.14.44/awscli/examples/apigateway/create-resource.rst0000666454262600001440000000022713243367510025303 0ustar pysdk-ciamazon00000000000000**To create a resource in an API** Command:: aws apigateway create-resource --rest-api-id 1234123412 --parent-id a1b2c3 --path-part 'new-resource' awscli-1.14.44/awscli/examples/apigateway/update-resource.rst0000666454262600001440000000130213243367510025315 0ustar pysdk-ciamazon00000000000000**To move a resource and place it under a different parent resource in an API** Command:: aws apigateway update-resource --rest-api-id 1234123412 --resource-id 1a2b3c --patch-operations op=replace,path=/parentId,value='3c2b1a' Output:: { "path": "/resource", "pathPart": "resource", "id": "1a2b3c", "parentId": "3c2b1a" } **To rename a resource (pathPart) in an API** Command:: aws apigateway update-resource --rest-api-id 1234123412 --resource-id 1a2b3c --patch-operations op=replace,path=/pathPart,value=newresourcename Output:: { "path": "/newresourcename", "pathPart": "newresourcename", "id": "1a2b3c", "parentId": "3c2b1a" } awscli-1.14.44/awscli/examples/apigateway/test-invoke-method.rst0000666454262600001440000000072613243367510025745 0ustar pysdk-ciamazon00000000000000**To test invoke the root resource in an API by making a GET request** Command:: 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' awscli-1.14.44/awscli/examples/apigateway/import-rest-api.rst0000666454262600001440000000022313243367510025243 0ustar pysdk-ciamazon00000000000000**To import a Swagger template and create an API** Command:: aws apigateway import-rest-api --body 'file:///path/to/API_Swagger_template.json' awscli-1.14.44/awscli/examples/apigateway/put-method.rst0000666454262600001440000000052113243367510024276 0ustar pysdk-ciamazon00000000000000**To create a method for a resource in an API with no authorization, no API key, and a custom method request header** 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" awscli-1.14.44/awscli/examples/apigateway/get-client-certificate.rst0000666454262600001440000000016313243367510026525 0ustar pysdk-ciamazon00000000000000**To get a client certificate** Command:: aws apigateway get-client-certificate --client-certificate-id a1b2c3 awscli-1.14.44/awscli/examples/apigateway/get-integration-response.rst0000666454262600001440000000055013243367510027146 0ustar pysdk-ciamazon00000000000000**To get the integration response configuration for a HTTP method defined under a REST API's resource** Command:: aws apigateway get-integration-response --rest-api-id 1234123412 --resource-id y9h6rt --http-method GET --status-code 200 Output:: { "statusCode": "200", "responseTemplates": { "application/json": null } } awscli-1.14.44/awscli/examples/apigateway/update-account.rst0000666454262600001440000000066313243367510025133 0ustar pysdk-ciamazon00000000000000**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' Output:: { "cloudwatchRoleArn": "arn:aws:iam::123412341234:role/APIGatewayToCloudWatchLogs", "throttleSettings": { "rateLimit": 1000.0, "burstLimit": 2000 } } awscli-1.14.44/awscli/examples/apigateway/delete-method.rst0000666454262600001440000000024313243367510024731 0ustar pysdk-ciamazon00000000000000**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 awscli-1.14.44/awscli/examples/apigateway/delete-method-response.rst0000666454262600001440000000034013243367510026563 0ustar pysdk-ciamazon00000000000000**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 awscli-1.14.44/awscli/examples/apigateway/create-rest-api.rst0000666454262600001440000000050313243367510025175 0ustar pysdk-ciamazon00000000000000**To create an API** Command:: aws apigateway create-rest-api --name 'My First API' --description 'This is my first API' **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 awscli-1.14.44/awscli/examples/apigateway/get-models.rst0000666454262600001440000000165613243367510024262 0ustar pysdk-ciamazon00000000000000**To get a list of models for a REST API** Command:: aws apigateway get-models --rest-api-id 1234123412 Output:: { "items": [ { "description": "This is a default error schema model", "schema": "{\n \"$schema\" : \"http://json-schema.org/draft-04/schema#\",\n \"title\" : \"Error Schema\",\n \"type\" : \"object\",\n \"properties\" : {\n \"message\" : { \"type\" : \"string\" }\n }\n}", "contentType": "application/json", "id": "7tpbze", "name": "Error" }, { "description": "This is a default empty schema model", "schema": "{\n \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n \"title\" : \"Empty Schema\",\n \"type\" : \"object\"\n}", "contentType": "application/json", "id": "etd5w5", "name": "Empty" } ] } awscli-1.14.44/awscli/examples/apigateway/update-usage.rst0000666454262600001440000000042313243367510024575 0ustar pysdk-ciamazon00000000000000**To temporarily modify the quota on an API key for the current period defined in the Usage Plan** Command:: aws apigateway update-usage --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu --patch-operations op="replace",path="/remaining",value="50" awscli-1.14.44/awscli/examples/apigateway/update-api-key.rst0000666454262600001440000000172713243367510025040 0ustar pysdk-ciamazon00000000000000**To change the name for an API Key** Command:: aws apigateway update-api-key --api-key sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu --patch-operations op='replace',path='/description',value='newName' Output:: { "description": "currentDescription", "enabled": true, "stageKeys": [ "41t2j324r5/dev" ], "lastUpdatedDate": 1470086052, "createdDate": 1445460347, "id": "sNvjQDMReA1vEQPNzW8r3dXsU2rrD7fcjm2SiMnu", "name": "newName" } **To disable the API Key** Command:: aws apigateway update-api-key --api-key sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu --patch-operations op='replace',path='/enabled',value='false' Output:: { "description": "currentDescription", "enabled": false, "stageKeys": [ "41t2j324r5/dev" ], "lastUpdatedDate": 1470086052, "createdDate": 1445460347, "id": "sNvjQDMReA1vEQPNzW8r3dXsU2rrD7fcjm2SiMnu", "name": "newName" } awscli-1.14.44/awscli/examples/apigateway/get-rest-api.rst0000666454262600001440000000031513243367510024512 0ustar pysdk-ciamazon00000000000000**To get information about an API** Command:: aws apigateway get-rest-api --rest-api-id 1234123412 Output:: { "name": "myAPI", "id": "o1y243m4f5", "createdDate": 1453416433 } awscli-1.14.44/awscli/examples/apigateway/update-rest-api.rst0000666454262600001440000000053013243367510025214 0ustar pysdk-ciamazon00000000000000**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' **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' awscli-1.14.44/awscli/examples/apigateway/create-authorizer.rst0000666454262600001440000000305713243367510025654 0ustar pysdk-ciamazon00000000000000**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 Output:: { "authType": "custom", "name": "First_Token_Custom_Authorizer", "authorizerUri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:customAuthFunction/invocations", "authorizerResultTtlInSeconds": 300, "identitySource": "method.request.header.Authorization", "type": "TOKEN", "id": "z40xj0" } **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' Output:: { "authType": "cognito_user_pools", "identitySource": "method.request.header.Authorization", "name": "First_Cognito_Custom_Authorizer", "providerARNs": [ "arn:aws:cognito-idp:us-east-1:342398297714:userpool/us-east-1_qWbZzQhzE" ], "type": "COGNITO_USER_POOLS", "id": "5yid1t" } awscli-1.14.44/awscli/examples/apigateway/put-method-response.rst0000666454262600001440000000045313243367510026136 0ustar pysdk-ciamazon00000000000000**To create a method response under the specified status code with a custom method response header** 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" awscli-1.14.44/awscli/examples/apigateway/get-resource.rst0000666454262600001440000000037413243367510024622 0ustar pysdk-ciamazon00000000000000**To get information about a resource** Command:: aws apigateway get-resource --rest-api-id 1234123412 --resource-id zwo0y3 Output:: { "path": "/path", "pathPart": "path", "id": "zwo0y3", "parentId": "uyokt6ij2g" } awscli-1.14.44/awscli/examples/apigateway/get-stage.rst0000666454262600001440000000267213243367510024101 0ustar pysdk-ciamazon00000000000000**To get information about an API's stage** Command:: aws apigateway get-stage --rest-api-id 1234123412 --stage-name dev Output:: { "stageName": "dev", "cacheClusterSize": "0.5", "cacheClusterEnabled": false, "cacheClusterStatus": "NOT_AVAILABLE", "deploymentId": "rbh1fj", "lastUpdatedDate": 1466802961, "createdDate": 1460682074, "methodSettings": { "*/*": { "cacheTtlInSeconds": 300, "loggingLevel": "INFO", "dataTraceEnabled": false, "metricsEnabled": true, "unauthorizedCacheControlHeaderStrategy": "SUCCEED_WITH_RESPONSE_HEADER", "throttlingRateLimit": 500.0, "cacheDataEncrypted": false, "cachingEnabled": false, "throttlingBurstLimit": 1000, "requireAuthorizationForCacheControl": true }, "~1resource/GET": { "cacheTtlInSeconds": 300, "loggingLevel": "INFO", "dataTraceEnabled": false, "metricsEnabled": true, "unauthorizedCacheControlHeaderStrategy": "SUCCEED_WITH_RESPONSE_HEADER", "throttlingRateLimit": 500.0, "cacheDataEncrypted": false, "cachingEnabled": false, "throttlingBurstLimit": 1000, "requireAuthorizationForCacheControl": true } } } awscli-1.14.44/awscli/examples/apigateway/delete-usage-plan-key.rst0000666454262600001440000000024713243367510026277 0ustar pysdk-ciamazon00000000000000**To remove an API key from a Usage Plan** Command:: aws apigateway delete-usage-plan-key --usage-plan-id a1b2c3 --key-id 1NbjQzMReAkeEQPNAW8r3dXsU2rDD7fc7f2Sipnu awscli-1.14.44/awscli/examples/apigateway/delete-deployment.rst0000666454262600001440000000020413243367510025626 0ustar pysdk-ciamazon00000000000000**To delete a deployment in an API** Command:: aws apigateway delete-deployment --rest-api-id 1234123412 --deployment-id a1b2c3 awscli-1.14.44/awscli/examples/apigateway/delete-usage-plan.rst0000666454262600001440000000014113243367510025502 0ustar pysdk-ciamazon00000000000000**To delete a Usage Plan** Command:: aws apigateway delete-usage-plan --usage-plan-id a1b2c3 awscli-1.14.44/awscli/examples/apigateway/create-usage-plan.rst0000666454262600001440000000043113243367510025505 0ustar pysdk-ciamazon00000000000000**To create a usage plan with throttle and quota limits that resets at the beginning of the month** 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 awscli-1.14.44/awscli/examples/apigateway/create-deployment.rst0000666454262600001440000000132413243367510025633 0ustar pysdk-ciamazon00000000000000**To deploy the configured resources for an API to a new Stage** Command:: aws apigateway create-deployment --rest-api-id 1234123412 --stage-name dev --stage-description 'Development Stage' --description 'First deployment to the dev stage' **To deploy the configured resources for an API to an existing stage** Command:: aws apigateway create-deployment --rest-api-id 1234123412 --stage-name dev --description 'Second deployment to the dev stage' **To deploy the configured resources for an API to an existing stage with Stage Variables** aws apigateway create-deployment --rest-api-id 1234123412 --stage-name dev --description 'Third deployment to the dev stage' --variables key='value',otherKey='otherValue' awscli-1.14.44/awscli/examples/apigateway/get-api-key.rst0000666454262600001440000000072013243367510024325 0ustar pysdk-ciamazon00000000000000**To get the information about a specific API key** Command:: aws apigateway get-api-key --api-key 8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk Output:: { "description": "My first key", "enabled": true, "stageKeys": [ "a1b2c3d4e5/dev", "e5d4c3b2a1/dev" ], "lastUpdatedDate": 1456184515, "createdDate": 1456184452, "id": "8bklk8bl1k3sB38D9B3l0enyWT8c09B30lkq0blk", "name": "My key" } awscli-1.14.44/awscli/examples/apigateway/get-method.rst0000666454262600001440000000213013243367510024243 0ustar pysdk-ciamazon00000000000000**To get the method resource configuration for a HTTP method defined under a REST API's resource** Command:: aws apigateway get-method --rest-api-id 1234123412 --resource-id y9h6rt --http-method GET Output:: { "apiKeyRequired": false, "httpMethod": "GET", "methodIntegration": { "integrationResponses": { "200": { "responseTemplates": { "application/json": null }, "statusCode": "200" } }, "cacheKeyParameters": [], "uri": "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:123412341234:function:My_Function/invocations", "httpMethod": "POST", "cacheNamespace": "y9h6rt", "type": "AWS" }, "requestParameters": {}, "methodResponses": { "200": { "responseModels": { "application/json": "Empty" }, "statusCode": "200" } }, "authorizationType": "NONE" } awscli-1.14.44/awscli/examples/dms/0000777454262600001440000000000013243367512020112 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/dms/describe-connections.rst0000666454262600001440000000116113243367510024741 0ustar pysdk-ciamazon00000000000000The following command describes connections for an endpoint specified by ARN:: aws dms describe-connections --filters Name="endpoint-arn",Values="arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE" Output:: { "Connections": [ { "Status": "successful", "ReplicationInstanceIdentifier": "test", "EndpointArn": "arn:aws:dms:us-east-arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE", "EndpointIdentifier": "testsrc1", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ" } ] } awscli-1.14.44/awscli/examples/dms/describe-endpoints.rst0000666454262600001440000000210513243367510024421 0ustar pysdk-ciamazon00000000000000The following command describes source endpoints in your account:: aws dms describe-endpoints --filters Name="endpoint-type",Values="source" Output:: { "Endpoints": [{ "Username": "dms", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:SF2WOFLWYWKVEOHID2EKLP3SJI", "ServerName": "ec2-52-32-48-61.us-west-2.compute.amazonaws.com", "EndpointType": "SOURCE", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/94d5c4e7-4e4c-44be-b58a-c8da7adf57cd", "DatabaseName": "test", "EngineName": "mysql", "EndpointIdentifier": "pri100", "Port": 8193 }, { "Username": "admin", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:TJJZCIH3CJ24TJRU4VC32WEWFR", "ServerName": "test.example.com", "EndpointType": "SOURCE", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/2431021b-1cf2-a2d4-77b2-59a9e4bce323", "DatabaseName": "EMPL", "EngineName": "oracle", "EndpointIdentifier": "test", "Port": 1521 }] } awscli-1.14.44/awscli/examples/dms/create-endpoint.rst0000666454262600001440000000150713243367510023726 0ustar pysdk-ciamazon00000000000000The following command creates a source endpoint for a MySQL RDS DB instance named ``mydb.cx1llnox7iyx.uswest-2.rds.amazonaws.com``:: aws dms create-endpoint --endpoint-identifier test-endpoint-1 --endpoint-type source --engine-name mysql --username username --password password --server-name mydb.cx1llnox7iyx.uswest-2.rds.amazonaws.com --port 3306 Output:: { "Endpoint": { "Username": "username", "Status": "active", "EndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:RAAR3R22XSH46S3PWLC3NJAWKM", "ServerName": "mydb.cx1llnox7iyx.us-west-2.rds.amazonaws.com", "EndpointType": "SOURCE", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/4c1731d6-5435-ed4d-be13-d53411a7cfbd", "EngineName": "mysql", "EndpointIdentifier": "test-endpoint-1", "Port": 3306 } } awscli-1.14.44/awscli/examples/dms/create-replication-task.rst0000666454262600001440000000534513243367510025363 0ustar pysdk-ciamazon00000000000000The following command creates a replication task to copy data from one DB instance behind a DMS endpoint to another using a replication instance:: aws dms create-replication-task --replicationtask-identifier my-replication-task --target-endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:HTWNT57CLN2WGVBUJQXJZASXWE --source-endpoint-arn arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE --replication-instance-arn arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ --migration-type full-load --table-mappings 'file://table-mappings.json' The file ``table-mappings.json`` is a JSON document in the current folder that specifies table mappings:: { "TableMappings": [ { "Type": "Include", "SourceSchema": "company", "SourceTable": "emp%" }, { "Type": "Include", "SourceSchema": "employees", "SourceTable": "%" }, { "Type": "Exclude", "SourceSchema": "source101", "SourceTable": "dep%" }, { "Type": "Exclude", "SourceSchema": "source102", "SourceTable": "%" }, { "Type": "Explicit", "SourceSchema": "company", "SourceTable": "managers" }, { "Type": "Explicit", "SourceSchema": "company", "SourceTable": "locations" } ] } Output:: { "ReplicationTask": { "SourceEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:ZW5UAN6P4E77EC7YWHK4RZZ3BE", "ReplicationTaskIdentifier": "task1", "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ", "TableMappings": "{\n \"TableMappings\": [\n {\n \"Type\":\"Include\",\n \"SourceSchema\": \"/\",\n \"SourceTable\": \"/\"\n}\n ]\n}\n\n", "Status": "creating", "ReplicationTaskArn": "arn:aws:dms:us-east-1:123456789012:task:OEAMB3NXSTZ6LFYZFEPPBBXPYM", "ReplicationTaskCreationDate": 1457658407.492, "MigrationType": "full-load", "TargetEndpointArn": "arn:aws:dms:us-east-1:123456789012:endpoint:ASXWXJZLNWNT5HTWCGV2BUJQ7E", "ReplicationTaskSettings": "{\"TargetMetadata\":{\"TargetSchema\":\"\",\"SupportLobs\":true,\"FullLobMode\":true,\"LobChunkSize\":64,\"LimitedSizeLobMode\":false,\"LobMaxSize\":0},\"FullLoadSettings\":{\"FullLoadEnabled\":true,\"ApplyChangesEnabled\":false,\"TargetTablePrepMode\":\"DROP_AND_CREATE\",\"CreatePkAfterFullLoad\":false,\"StopTaskCachedChangesApplied\":false,\"StopTaskCachedChangesNotApplied\":false,\"ResumeEnabled\":false,\"ResumeMinTableSize\":100000,\"ResumeOnlyClusteredPKTables\":true,\"MaxFullLoadSubTasks\":8,\"TransactionConsistencyTimeout\":600,\"CommitRate\":10000},\"Logging\":{\"EnableLogging\":false}}" } } awscli-1.14.44/awscli/examples/dms/create-replication-instance.rst0000666454262600001440000000350413243367510026220 0ustar pysdk-ciamazon00000000000000The following command creates a replication instance named ``my-replication-db`` with 5GB of storage:: aws dms create-replication-instance --replication-instance-identifier my-replication-db --replication-instance-class dms.t2.micro --allocated-storage 5 Output:: { "ReplicationInstance": { "PubliclyAccessible": true, "ReplicationInstanceArn": "arn:aws:dms:us-east-1:123456789012:rep:6UTDJGBOUS3VI3SUWA66XFJCJQ ", "ReplicationInstanceClass": "dms.t2.micro", "ReplicationSubnetGroup": { "ReplicationSubnetGroupDescription": "default", "Subnets": [{ "SubnetStatus": "Active", "SubnetIdentifier": "subnet-f6dd91af", "SubnetAvailabilityZone": { "Name": "us-east-1d" } }, { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-3605751d", "SubnetAvailabilityZone": { "Name": "us-east-1b" } }, { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-c2daefb5", "SubnetAvailabilityZone": { "Name": "us-east-1c" } }, { "SubnetStatus": "Active", "SubnetIdentifier": "subnet-85e90cb8", "SubnetAvailabilityZone": { "Name": "us-east-1e" } }], "VpcId": "vpc-6741a603", "SubnetGroupStatus": "Complete", "ReplicationSubnetGroupIdentifier": "default" }, "AutoMinorVersionUpgrade": true, "ReplicationInstanceStatus": "creating", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/4c1731d6-5435-ed4d-be13-d53411a7cfbd", "AllocatedStorage": 5, "EngineVersion": "1.5.0", "ReplicationInstanceIdentifier": "test-rep-1", "PreferredMaintenanceWindow": "sun:06:00-sun:14:00", "PendingModifiedValues": {} } } awscli-1.14.44/awscli/examples/batch/0000777454262600001440000000000013243367512020410 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/batch/describe-job-queues.rst0000666454262600001440000000134113243367510024774 0ustar pysdk-ciamazon00000000000000**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" } ] } awscli-1.14.44/awscli/examples/batch/describe-job-definitions.rst0000666454262600001440000000163513243367510026006 0ustar pysdk-ciamazon00000000000000**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 } ] } awscli-1.14.44/awscli/examples/batch/create-job-queue.rst0000666454262600001440000000276113243367510024303 0ustar pysdk-ciamazon00000000000000**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" } awscli-1.14.44/awscli/examples/batch/update-compute-environment.rst0000666454262600001440000000057513243367510026445 0ustar pysdk-ciamazon00000000000000**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" } awscli-1.14.44/awscli/examples/batch/submit-job.rst0000666454262600001440000000050113243367510023207 0ustar pysdk-ciamazon00000000000000**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" } awscli-1.14.44/awscli/examples/batch/update-job-queue.rst0000666454262600001440000000043513243367510024316 0ustar pysdk-ciamazon00000000000000**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 DISABLE Output:: { "jobQueueArn": "arn:aws:batch:us-east-1:012345678910:job-queue/GPGPU", "jobQueueName": "GPGPU" } awscli-1.14.44/awscli/examples/batch/describe-jobs.rst0000666454262600001440000000171013243367510023652 0ustar pysdk-ciamazon00000000000000**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 } ] } awscli-1.14.44/awscli/examples/batch/register-job-definition.rst0000666454262600001440000000072413243367510025665 0ustar pysdk-ciamazon00000000000000**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 } awscli-1.14.44/awscli/examples/batch/describe-compute-environments.rst0000666454262600001440000000276213243367510027126 0ustar pysdk-ciamazon00000000000000**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" } ] } awscli-1.14.44/awscli/examples/batch/delete-job-queue.rst0000666454262600001440000000020013243367510024264 0ustar pysdk-ciamazon00000000000000**To delete a job queue** This example deletes the GPGPU job queue. Command:: aws batch delete-job-queue --job-queue GPGPU awscli-1.14.44/awscli/examples/batch/deregister-job-definition.rst0000666454262600001440000000025213243367510026172 0ustar pysdk-ciamazon00000000000000**To deregister a job definition** This example deregisters a job definition called sleep10. Command:: aws batch deregister-job-definition --job-definition sleep10 awscli-1.14.44/awscli/examples/batch/cancel-job.rst0000666454262600001440000000026713243367510023142 0ustar pysdk-ciamazon00000000000000**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." awscli-1.14.44/awscli/examples/batch/list-jobs.rst0000666454262600001440000000131213243367510023043 0ustar pysdk-ciamazon00000000000000**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" } ] } awscli-1.14.44/awscli/examples/batch/terminate-job.rst0000666454262600001440000000030113243367510023672 0ustar pysdk-ciamazon00000000000000**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." awscli-1.14.44/awscli/examples/batch/delete-compute-environment.rst0000666454262600001440000000026413243367510026420 0ustar pysdk-ciamazon00000000000000**To delete a compute environment** This example deletes the `P2OnDemand` compute environment. Command:: aws batch delete-compute-environment --compute-environment P2OnDemand awscli-1.14.44/awscli/examples/batch/create-compute-environment.rst0000666454262600001440000000505713243367510026426 0ustar pysdk-ciamazon00000000000000**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" } awscli-1.14.44/awscli/examples/autoscaling/0000777454262600001440000000000013243367512021640 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/autoscaling/create-auto-scaling-group.rst0000666454262600001440000000306113243367510027351 0ustar pysdk-ciamazon00000000000000**To create an Auto Scaling group** This example creates an Auto Scaling group in a VPC:: 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 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 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:: 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 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 awscli-1.14.44/awscli/examples/autoscaling/describe-scaling-process-types.rst0000666454262600001440000000207713243367510030412 0ustar pysdk-ciamazon00000000000000**To describe the Auto Scaling process types** This example describes the Auto Scaling process types:: aws autoscaling describe-scaling-process-types The following is example output:: { "Processes": [ { "ProcessName": "AZRebalance" }, { "ProcessName": "AddToLoadBalancer" }, { "ProcessName": "AlarmNotification" }, { "ProcessName": "HealthCheck" }, { "ProcessName": "Launch" }, { "ProcessName": "ReplaceUnhealthy" }, { "ProcessName": "ScheduledActions" }, { "ProcessName": "Terminate" } ] } For more information, see `Suspend and Resume Auto Scaling Processes`_ in the *Auto Scaling Developer Guide*. .. _`Suspend and Resume Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html awscli-1.14.44/awscli/examples/autoscaling/set-desired-capacity.rst0000666454262600001440000000041113243367510026367 0ustar pysdk-ciamazon00000000000000**To set the desired capacity for an Auto Scaling group** This example sets the desired capacity for the specified Auto Scaling group:: aws autoscaling set-desired-capacity --auto-scaling-group-name my-auto-scaling-group --desired-capacity 2 --honor-cooldown awscli-1.14.44/awscli/examples/autoscaling/detach-load-balancers.rst0000666454262600001440000000042613243367510026467 0ustar pysdk-ciamazon00000000000000**To detach a load balancer from an Auto Scaling group** This example detaches the specified load balancer from the specified Auto Scaling group:: aws autoscaling detach-load-balancers --load-balancer-names my-load-balancer --auto-scaling-group-name my-auto-scaling-group awscli-1.14.44/awscli/examples/autoscaling/describe-lifecycle-hooks.rst0000666454262600001440000000147413243367510027234 0ustar pysdk-ciamazon00000000000000**To describe your lifecycle hooks** This example describes the lifecycle hooks for the specified Auto Scaling group:: aws autoscaling describe-lifecycle-hooks --auto-scaling-group-name my-auto-scaling-group The following is example output:: { "LifecycleHooks": [ { "GlobalTimeout": 172800, "HeartbeatTimeout": 3600, "RoleARN": "arn:aws:iam::123456789012:role/my-auto-scaling-role", "AutoScalingGroupName": "my-auto-scaling-group", "LifecycleHookName": "my-lifecycle-hook", "DefaultResult": "ABANDON", "NotificationTargetARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic", "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING" } ] } awscli-1.14.44/awscli/examples/autoscaling/describe-notification-configurations.rst0000666454262600001440000000371313243367510031670 0ustar pysdk-ciamazon00000000000000**To describe the Auto Scaling notification configurations** This example describes the notification configurations for the specified Auto Scaling group:: aws autoscaling describe-notification-configurations --auto-scaling-group-name my-auto-scaling-group The following is example output:: { "NotificationConfigurations": [ { "AutoScalingGroupName": "my-auto-scaling-group", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" }, { "AutoScalingGroupName": "my-auto-scaling-group", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic" } ] } To return a specific number of notification configurations, use the ``max-items`` parameter:: aws autoscaling describe-notification-configurations --auto-scaling-group-name my-auto-scaling-group --max-items 1 The following is example output:: { "NextToken": "Z3M3LMPEXAMPLE", "NotificationConfigurations": [ { "AutoScalingGroupName": "my-auto-scaling-group", "NotificationType": "autoscaling:TEST_NOTIFICATION", "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" } ] } Use the ``NextToken`` field with the ``starting-token`` parameter in a subsequent call to get additional notification configurations:: 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*. .. _`Getting Notifications When Your Auto Scaling Group Changes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html awscli-1.14.44/awscli/examples/autoscaling/describe-termination-policy-types.rst0000666454262600001440000000137213243367510031141 0ustar pysdk-ciamazon00000000000000**To describe termination policy types** This example describes the available termination policy types:: aws autoscaling describe-termination-policy-types The following is example output:: { "TerminationPolicyTypes": [ "ClosestToNextInstanceHour", "Default", "NewestInstance", "OldestInstance", "OldestLaunchConfiguration" ] } For more information, see `Controlling Which Instances Auto Scaling Terminates During Scale In`_ in the *Auto Scaling Developer Guide*. .. _`Controlling Which Instances Auto Scaling Terminates During Scale In`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/AutoScalingBehavior.InstanceTermination.html#your-termination-policy awscli-1.14.44/awscli/examples/autoscaling/describe-policies.rst0000666454262600001440000000521613243367510025761 0ustar pysdk-ciamazon00000000000000**To describe Auto Scaling policies** This example describes the policies for the specified Auto Scaling group:: aws autoscaling describe-policies --auto-scaling-group-name my-auto-scaling-group The following is example output:: { "ScalingPolicies": [ { "PolicyName": "ScaleIn", "AutoScalingGroupName": "my-auto-scaling-group", "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn", "AdjustmentType": "ChangeInCapacity", "Alarms": [], "ScalingAdjustment": -1 }, { "PolicyName": "ScalePercentChange", "MinAdjustmentStep": 2, "AutoScalingGroupName": "my-auto-scaling-group", "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2b435159-cf77-4e89-8c0e-d63b497baad7:autoScalingGroupName/my-auto-scaling-group:policyName/ScalePercentChange", "Cooldown": 60, "AdjustmentType": "PercentChangeInCapacity", "Alarms": [], "ScalingAdjustment": 25 } ] } To return specific scaling policies, use the ``policy-names`` parameter:: aws autoscaling describe-policies --auto-scaling-group-name my-auto-scaling-group --policy-names ScaleIn To return a specific number of policies, use the ``max-items`` parameter:: aws autoscaling describe-policies --auto-scaling-group-name my-auto-scaling-group --max-items 1 The following is example output:: { "ScalingPolicies": [ { "PolicyName": "ScaleIn", "AutoScalingGroupName": "my-auto-scaling-group", "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn", "AdjustmentType": "ChangeInCapacity", "Alarms": [], "ScalingAdjustment": -1 } ], "NextToken": "Z3M3LMPEXAMPLE" } If the output includes a ``NextToken`` field, use the value of this field with the ``starting-token`` parameter in a subsequent call to get the additional policies:: 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*. .. _`Dynamic Scaling`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html awscli-1.14.44/awscli/examples/autoscaling/describe-metric-collection-types.rst0000666454262600001440000000231413243367510030724 0ustar pysdk-ciamazon00000000000000**To describe the Auto Scaling metric collection types** This example describes the available metric collection types:: aws autoscaling describe-metric-collection-types The following is example output:: { "Metrics": [ { "Metric": "GroupMinSize" }, { "Metric": "GroupMaxSize" }, { "Metric": "GroupDesiredCapacity" }, { "Metric": "GroupInServiceInstances" }, { "Metric": "GroupPendingInstances" }, { "Metric": "GroupTerminatingInstances" }, { "Metric": "GroupStandbyInstances" }, { "Metric": "GroupTotalInstances" } ], "Granularities": [ { "Granularity": "1Minute" } ] } For more information, see `Enable Auto Scaling Group Metrics`_ in the *Auto Scaling Developer Guide*. .. _`Enable Auto Scaling Group Metrics`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-instance-monitoring.html#as-group-metrics awscli-1.14.44/awscli/examples/autoscaling/attach-load-balancers.rst0000666454262600001440000000042213243367510026477 0ustar pysdk-ciamazon00000000000000**To attach a load balancer to an Auto Scaling group** This example attaches the specified load balancer to the specified Auto Scaling group:: aws autoscaling attach-load-balancers --load-balancer-names my-load-balancer --auto-scaling-group-name my-auto-scaling-group awscli-1.14.44/awscli/examples/autoscaling/detach-load-balancer-target-groups.rst0000777454262600001440000000055213243367510031110 0ustar pysdk-ciamazon00000000000000**To detach a target group from an Auto Scaling group** This example detaches the specified target group from the specified Auto Scaling group:: aws autoscaling detach-load-balancer-target-groups --auto-scaling-group-name my-auto-scaling-group --target-group-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 awscli-1.14.44/awscli/examples/autoscaling/detach-instances.rst0000666454262600001440000000166513243367510025615 0ustar pysdk-ciamazon00000000000000**To detach an instance from an Auto Scaling group** This example detaches the specified instance from the specified Auto Scaling group:: aws autoscaling detach-instances --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group --should-decrement-desired-capacity The following is example output:: { "Activities": [ { "Description": "Detaching EC2 instance: i-93633f9b", "AutoScalingGroupName": "my-auto-scaling-group", "ActivityId": "5091cb52-547a-47ce-a236-c9ccbc2cb2c9", "Details": {"Availability Zone": "us-west-2a"}, "StartTime": "2015-04-12T15:02:16.179Z", "Progress": 50, "Cause": "At 2015-04-12T15:02:16Z instance i-93633f9b was detached in response to a user request, shrinking the capacity from 2 to 1.", "StatusCode": "InProgress" } ] } awscli-1.14.44/awscli/examples/autoscaling/set-instance-health.rst0000666454262600001440000000033213243367510026226 0ustar pysdk-ciamazon00000000000000**To set the health status of an instance** This example sets the health status of the specified instance to ``Unhealthy``:: aws autoscaling set-instance-health --instance-id i-93633f9b --health-status Unhealthy awscli-1.14.44/awscli/examples/autoscaling/execute-policy.rst0000666454262600001440000000071113243367510025326 0ustar pysdk-ciamazon00000000000000**To execute an Auto Scaling policy** This example executes the specified Auto Scaling policy for the specified Auto Scaling group:: 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*. .. _`Dynamic Scaling`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html awscli-1.14.44/awscli/examples/autoscaling/describe-auto-scaling-instances.rst0000666454262600001440000000312713243367510030524 0ustar pysdk-ciamazon00000000000000**To describe one or more instances** This example describes the specified instance:: aws autoscaling describe-auto-scaling-instances --instance-ids i-4ba0837f The following is example output:: { "AutoScalingInstances": [ { "ProtectedFromScaleIn": false, "AvailabilityZone": "us-west-2c", "InstanceId": "i-4ba0837f", "AutoScalingGroupName": "my-auto-scaling-group", "HealthStatus": "HEALTHY", "LifecycleState": "InService", "LaunchConfigurationName": "my-launch-config" } ] } This example uses the ``max-items`` parameter to specify how many instances to return with this call:: aws autoscaling describe-auto-scaling-instances --max-items 1 The following is example output:: { "NextToken": "Z3M3LMPEXAMPLE", "AutoScalingInstances": [ { "ProtectedFromScaleIn": false, "AvailabilityZone": "us-west-2c", "InstanceId": "i-4ba0837f", "AutoScalingGroupName": "my-auto-scaling-group", "HealthStatus": "HEALTHY", "LifecycleState": "InService", "LaunchConfigurationName": "my-launch-config" } ] } If the output includes a ``NextToken`` field, there are more instances. To get the additional instances, use the value of this field with the ``starting-token`` parameter in a subsequent call as follows:: aws autoscaling describe-auto-scaling-instances --starting-token Z3M3LMPEXAMPLE awscli-1.14.44/awscli/examples/autoscaling/disable-metrics-collection.rst0000666454262600001440000000107313243367510027571 0ustar pysdk-ciamazon00000000000000**To disable metrics collection for an Auto Scaling group** This example disables collecting data for the ``GroupDesiredCapacity`` metric for the specified Auto Scaling group:: 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*. .. _`Monitoring Your Auto Scaling Instances and Groups`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-instance-monitoring.html awscli-1.14.44/awscli/examples/autoscaling/delete-launch-configuration.rst0000666454262600001440000000064313243367510027752 0ustar pysdk-ciamazon00000000000000**To delete a launch configuration** This example deletes the specified launch configuration:: 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*. .. _`Shut Down Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-process-shutdown.html awscli-1.14.44/awscli/examples/autoscaling/put-lifecycle-hook.rst0000666454262600001440000000113713243367510026075 0ustar pysdk-ciamazon00000000000000**To create a lifecycle hook** This example creates a lifecycle hook:: 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*. .. _`Adding Lifecycle Hooks`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/adding-lifecycle-hooks.html awscli-1.14.44/awscli/examples/autoscaling/delete-auto-scaling-group.rst0000666454262600001440000000122513243367510027350 0ustar pysdk-ciamazon00000000000000**To delete an Auto Scaling group** This example deletes the specified Auto Scaling group:: aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group To delete the Auto Scaling group without waiting for the instances in the group to terminate, use the ``--force-delete`` parameter:: 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*. .. _`Shut Down Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-process-shutdown.html awscli-1.14.44/awscli/examples/autoscaling/describe-account-limits.rst0000666454262600001440000000111413243367510027076 0ustar pysdk-ciamazon00000000000000**To describe your Auto Scaling account limits** This example describes the Auto Scaling limits for your AWS account:: aws autoscaling describe-account-limits The following is example output:: { "NumberOfLaunchConfigurations": 5, "MaxNumberOfLaunchConfigurations": 100, "NumberOfAutoScalingGroups": 3, "MaxNumberOfAutoScalingGroups": 20 } For more information, see `Auto Scaling Limits`_ in the *Auto Scaling Developer Guide*. .. _`Auto Scaling Limits`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-account-limits.html awscli-1.14.44/awscli/examples/autoscaling/describe-auto-scaling-notification-types.rst0000666454262600001440000000147213243367510032366 0ustar pysdk-ciamazon00000000000000**To describe the Auto Scaling notification types** This example describes the available notification types:: aws autoscaling describe-auto-scaling-notification-types The following is example output:: { "AutoScalingNotificationTypes": [ "autoscaling:EC2_INSTANCE_LAUNCH", "autoscaling:EC2_INSTANCE_LAUNCH_ERROR", "autoscaling:EC2_INSTANCE_TERMINATE", "autoscaling:EC2_INSTANCE_TERMINATE_ERROR", "autoscaling:TEST_NOTIFICATION" ] } For more information, see `Configure Your Auto Scaling Group to Send Notifications`_ in the *Auto Scaling Developer Guide*. .. _`Configure Your Auto Scaling Group to Send Notifications`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html#as-configure-asg-for-sns awscli-1.14.44/awscli/examples/autoscaling/put-scheduled-update-group-action.rst0000666454262600001440000000172713243367510031032 0ustar pysdk-ciamazon00000000000000**To add a scheduled action to an Auto Scaling group** This example adds the specified scheduled action to the specified Auto Scaling group:: aws autoscaling put-scheduled-update-group-action --auto-scaling-group-name my-auto-scaling-group --scheduled-action-name my-scheduled-action --start-time "2014-05-12T08:00:00Z" --end-time "2014-05-12T08:00:00Z" --min-size 2 --max-size 6 --desired-capacity 4 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 For more information, see `Scheduled Scaling`__ in the *Auto Scaling Developer Guide*. .. __: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/schedule_time.html awscli-1.14.44/awscli/examples/autoscaling/describe-tags.rst0000666454262600001440000000343213243367510025106 0ustar pysdk-ciamazon00000000000000**To describe tags** This example describes all your tags:: aws autoscaling describe-tags The following is example output:: { "Tags": [ { "ResourceType": "auto-scaling-group", "ResourceId": "my-auto-scaling-group", "PropagateAtLaunch": true, "Value": "Research", "Key": "Dept" }, { "ResourceType": "auto-scaling-group", "ResourceId": "my-auto-scaling-group", "PropagateAtLaunch": true, "Value": "WebServer", "Key": "Role" } ] } To describe tags for a specific Auto Scaling group, use the ``filters`` parameter:: aws autoscaling describe-tags --filters Name=auto-scaling-group,Values=my-auto-scaling-group To return a specific number of tags, use the ``max-items`` parameter:: aws autoscaling describe-tags --max-items 1 The following is example output:: { "NextToken": "Z3M3LMPEXAMPLE", "Tags": [ { "ResourceType": "auto-scaling-group", "ResourceId": "my-auto-scaling-group", "PropagateAtLaunch": true, "Value": "Research", "Key": "Dept" } ] } Use the ``NextToken`` field with the ``starting-token`` parameter in a subsequent call to get the additional tags:: 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*. .. _`Tagging Auto Scaling Groups and Instances`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html awscli-1.14.44/awscli/examples/autoscaling/describe-auto-scaling-groups.rst0000666454262600001440000000416413243367510030056 0ustar pysdk-ciamazon00000000000000**To get a description of an Auto Scaling group** This example describes the specified Auto Scaling group:: aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name my-auto-scaling-group The following is example output:: { "AutoScalingGroups": [ { "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-auto-scaling-group", "HealthCheckGracePeriod": 300, "SuspendedProcesses": [], "DesiredCapacity": 1, "Tags": [], "EnabledMetrics": [], "LoadBalancerNames": [], "AutoScalingGroupName": "my-auto-scaling-group", "DefaultCooldown": 300, "MinSize": 0, "Instances": [ { "InstanceId": "i-4ba0837f", "AvailabilityZone": "us-west-2c", "HealthStatus": "Healthy", "LifecycleState": "InService", "LaunchConfigurationName": "my-launch-config" } ], "MaxSize": 1, "VPCZoneIdentifier": null, "TerminationPolicies": [ "Default" ], "LaunchConfigurationName": "my-launch-config", "CreatedTime": "2013-08-19T20:53:25.584Z", "AvailabilityZones": [ "us-west-2c" ], "HealthCheckType": "EC2", "NewInstancesProtectedFromScaleIn": false } ] } To return a specific number of Auto Scaling groups, use the ``max-items`` parameter:: aws autoscaling describe-auto-scaling-groups --max-items 1 If the output includes a ``NextToken`` field, there are more groups. To get the additional groups, use the value of this field with the ``starting-token`` parameter in a subsequent call as follows:: aws autoscaling describe-auto-scaling-groups --starting-token Z3M3LMPEXAMPLE awscli-1.14.44/awscli/examples/autoscaling/describe-adjustment-types.rst0000666454262600001440000000133113243367510027464 0ustar pysdk-ciamazon00000000000000**To describe the Auto Scaling adjustment types** This example describes the available adjustment types:: aws autoscaling describe-adjustment-types The following is example output:: { "AdjustmentTypes": [ { "AdjustmentType": "ChangeInCapacity" }, { "AdjustmentType": "ExactCapcity" }, { "AdjustmentType": "PercentChangeInCapacity" } ] } For more information, see `Scaling Adjustment Types`_ in the *Auto Scaling Developer Guide*. .. _`Scaling Adjustment Types`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html#as-scaling-adjustment awscli-1.14.44/awscli/examples/autoscaling/record-lifecycle-action-heartbeat.rst0000666454262600001440000000052513243367510031015 0ustar pysdk-ciamazon00000000000000**To record a lifecycle action heartbeat** This example records a lifecycle action heartbeat to keep the instance in a pending state:: aws autoscaling record-lifecycle-action-heartbeat --lifecycle-hook-name my-lifecycle-hook --auto-scaling-group-name my-auto-scaling-group --lifecycle-action-token bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635 awscli-1.14.44/awscli/examples/autoscaling/exit-standby.rst0000666454262600001440000000161013243367510025001 0ustar pysdk-ciamazon00000000000000**To move instances out of standby mode** This example moves the specified instance out of standby mode:: aws autoscaling exit-standby --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group The following is example output:: { "Activities": [ { "Description": "Moving EC2 instance out of Standby: i-93633f9b", "AutoScalingGroupName": "my-auto-scaling-group", "ActivityId": "142928e1-a2dc-453a-9b24-b85ad6735928", "Details": {"Availability Zone": "us-west-2a"}, "StartTime": "2015-04-12T15:14:29.886Z", "Progress": 30, "Cause": "At 2015-04-12T15:14:29Z instance i-93633f9b was moved out of standby in response to a user request, increasing the capacity from 1 to 2.", "StatusCode": "PreInService" } ] } awscli-1.14.44/awscli/examples/autoscaling/put-scaling-policy.rst0000666454262600001440000000244513243367510026120 0ustar pysdk-ciamazon00000000000000**To add a scaling policy to an Auto Scaling group** This example adds the specified 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 To change the size of the Auto Scaling group by a specific number of instances, set the ``adjustment-type`` parameter to ``PercentChangeInCapacity``. Then, assign a value to the ``min-adjustment-step`` parameter, where the value represents the number of instances the policy adds or removes from the Auto Scaling group:: aws autoscaling put-scaling-policy --auto-scaling-group-name my-auto-scaling-group --policy-name ScalePercentChange --scaling-adjustment 25 --adjustment-type PercentChangeInCapacity --cooldown 60 --min-adjustment-step 2 The output includes the ARN of the policy. The following is example output:: { "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*. .. _`Dynamic Scaling`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-scale-based-on-demand.html awscli-1.14.44/awscli/examples/autoscaling/delete-policy.rst0000666454262600001440000000031013243367510025121 0ustar pysdk-ciamazon00000000000000**To delete an Auto Scaling policy** This example deletes the specified Auto Scaling policy:: aws autoscaling delete-policy --auto-scaling-group-name my-auto-scaling-group --policy-name ScaleIn awscli-1.14.44/awscli/examples/autoscaling/update-auto-scaling-group.rst0000666454262600001440000000262413243367510027374 0ustar pysdk-ciamazon00000000000000**To update an Auto Scaling group** This example updates the specified Auto Scaling group to use Elastic Load Balancing health checks:: aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --health-check-type ELB --health-check-grace-period 60 This example updates the launch configuration, minimum and maximum size of the group, and which subnet to use:: aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --launch-configuration-name new-launch-config --min-size 1 --max-size 3 --vpc-zone-identifier subnet-41767929 This example updates the desired capacity, default cooldown, placement group, termination policy, and which Availability Zone to use:: aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --default-cooldown 600 --placement-group my-placement-group --termination-policies "OldestInstance" --availability-zones us-west-2c This example enables the instance protection setting for the specified Auto Scaling group:: aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --new-instances-protected-from-scale-in This example disables the instance protection setting for the specified Auto Scaling group:: aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --no-new-instances-protected-from-scale-in awscli-1.14.44/awscli/examples/autoscaling/put-notification-configuration.rst0000666454262600001440000000117513243367510030535 0ustar pysdk-ciamazon00000000000000**To add an Auto Scaling notification** This example adds the specified notification to the specified Auto Scaling group:: 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*. .. _`Configure Your Auto Scaling Group to Send Notifications`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html#as-configure-asg-for-sns awscli-1.14.44/awscli/examples/autoscaling/delete-scheduled-action.rst0000666454262600001440000000044213243367510027043 0ustar pysdk-ciamazon00000000000000**To delete a scheduled action from an Auto Scaling group** This example deletes the specified scheduled action from the specified Auto Scaling group:: aws autoscaling delete-scheduled-action --auto-scaling-group-name my-auto-scaling-group --scheduled-action-name my-scheduled-action awscli-1.14.44/awscli/examples/autoscaling/delete-tags.rst0000666454262600001440000000075513243367510024575 0ustar pysdk-ciamazon00000000000000**To delete a tag from an Auto Scaling group** This example deletes the specified tag from the specified Auto Scaling group:: 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*. .. _`Tagging Auto Scaling Groups and Instances`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASTagging.html awscli-1.14.44/awscli/examples/autoscaling/attach-load-balancer-target-groups.rst0000777454262600001440000000054613243367510031127 0ustar pysdk-ciamazon00000000000000**To attach a target group to an Auto Scaling group** This example attaches the specified target group to the specified Auto Scaling group:: aws autoscaling attach-load-balancer-target-groups --auto-scaling-group-name my-auto-scaling-group --target-group-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 awscli-1.14.44/awscli/examples/autoscaling/enter-standby.rst0000666454262600001440000000163513243367510025154 0ustar pysdk-ciamazon00000000000000**To move instances into standby mode** This example puts the specified instance into standby mode:: aws autoscaling enter-standby --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group --should-decrement-desired-capacity The following is example output:: { "Activities": [ { "Description": "Moving EC2 instance to Standby: i-93633f9b", "AutoScalingGroupName": "my-auto-scaling-group", "ActivityId": "ffa056b4-6ed3-41ba-ae7c-249dfae6eba1", "Details": {"Availability Zone": "us-west-2a"}, "StartTime": "2015-04-12T15:10:23.640Z", "Progress": 50, "Cause": "At 2015-04-12T15:10:23Z instance i-93633f9b was moved to standby in response to a user request, shrinking the capacity from 2 to 1.", "StatusCode": "InProgress" } ] } awscli-1.14.44/awscli/examples/autoscaling/create-or-update-tags.rst0000666454262600001440000000061413243367510026466 0ustar pysdk-ciamazon00000000000000**To create or update tags for an Auto Scaling group** This example adds two tags to the specified Auto Scaling group:: aws autoscaling create-or-update-tags --tags ResourceId=my-auto-scaling-group,ResourceType=auto-scaling-group,Key=Role,Value=WebServer,PropagateAtLaunch=true ResourceId=my-auto-scaling-group,ResourceType=auto-scaling-group,Key=Dept,Value=Research,PropagateAtLaunch=true awscli-1.14.44/awscli/examples/autoscaling/terminate-instance-in-auto-scaling-group.rst0000666454262600001440000000061213243367510032303 0ustar pysdk-ciamazon00000000000000**To terminate an instance in an Auto Scaling group** This example terminates the specified instance from the specified Auto Scaling group without updating the size of the group:: aws autoscaling terminate-instance-in-auto-scaling-group --instance-id i-93633f9b --no-should-decrement-desired-capacity Auto Scaling launches a replacement instance after the specified instance terminates. awscli-1.14.44/awscli/examples/autoscaling/delete-lifecycle-hook.rst0000666454262600001440000000032713243367510026527 0ustar pysdk-ciamazon00000000000000**To delete a lifecycle hook** This example deletes the specified lifecycle hook:: aws autoscaling delete-lifecycle-hook --lifecycle-hook-name my-lifecycle-hook --auto-scaling-group-name my-auto-scaling-group awscli-1.14.44/awscli/examples/autoscaling/suspend-processes.rst0000666454262600001440000000076313243367510026063 0ustar pysdk-ciamazon00000000000000**To suspend Auto Scaling processes** This example suspends the specified scaling process for the specified Auto Scaling group:: 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*. .. _`Suspend and Resume Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html awscli-1.14.44/awscli/examples/autoscaling/describe-scheduled-actions.rst0000666454262600001440000000573413243367510027555 0ustar pysdk-ciamazon00000000000000**To describe scheduled actions** This example describes all your scheduled actions:: aws autoscaling describe-scheduled-actions The following is example output:: { "ScheduledUpdateGroupActions": [ { "MinSize": 2, "DesiredCapacity": 4, "AutoScalingGroupName": "my-auto-scaling-group", "MaxSize": 6, "Recurrence": "30 0 1 12 0", "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", "Time": "2019-12-01T00:30:00Z" } ] } To describe the scheduled actions for a specific Auto Scaling group, use the ``auto-scaling-group-name`` parameter:: aws autoscaling describe-scheduled-actions --auto-scaling-group-name my-auto-scaling-group To describe a specific scheduled action, use the ``scheduled-action-names`` parameter:: aws autoscaling describe-scheduled-actions --scheduled-action-names my-scheduled-action To describe the scheduled actions that start at a specific time, use the ``start-time`` parameter:: aws autoscaling describe-scheduled-actions --start-time "2019-12-01T00:30:00Z" To describe the scheduled actions that end at a specific time, use the ``end-time`` parameter:: aws autoscaling describe-scheduled-actions --end-time "2022-12-01T00:30:00Z" To return a specific number of scheduled actions, use the ``max-items`` parameter:: aws autoscaling describe-scheduled-actions --auto-scaling-group-name my-auto-scaling-group --max-items 1 The following is example output:: { "NextToken": "Z3M3LMPEXAMPLE", "ScheduledUpdateGroupActions": [ { "MinSize": 2, "DesiredCapacity": 4, "AutoScalingGroupName": "my-auto-scaling-group", "MaxSize": 6, "Recurrence": "30 0 1 12 0", "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", "Time": "2019-12-01T00:30:00Z" } ] } Use the ``NextToken`` field with the ``starting-token`` parameter in a subsequent call to get the additional scheduled actions:: 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*. .. _`Scheduled Scaling`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/schedule_time.html awscli-1.14.44/awscli/examples/autoscaling/set-instance-protection.rst0000666454262600001440000000076213243367510027156 0ustar pysdk-ciamazon00000000000000**To change the instance protection setting for an instance** This example enables instance protection for the specified instance:: aws autoscaling set-instance-protection --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group --protected-from-scale-in This example disables instance protection for the specified instance:: aws autoscaling set-instance-protection --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group --no-protected-from-scale-in awscli-1.14.44/awscli/examples/autoscaling/describe-lifecycle-hook-types.rst0000666454262600001440000000054613243367510030212 0ustar pysdk-ciamazon00000000000000**To describe the available types of lifecycle hooks** This example describes the available lifecycle hook types:: aws autoscaling describe-lifecycle-hook-types The following is example output:: { "LifecycleHookTypes": [ "autoscaling:EC2_INSTANCE_LAUNCHING", "autoscaling:EC2_INSTANCE_TERMINATING" ] } awscli-1.14.44/awscli/examples/autoscaling/describe-load-balancer-target-groups.rst0000777454262600001440000000101513243367510031433 0ustar pysdk-ciamazon00000000000000**To describe the target groups for an Auto Scaling group** This example describes the target groups attached to the specified Auto Scaling group:: aws autoscaling describe-load-balancer-target-groups --auto-scaling-group-name my-auto-scaling-group The following is example output:: { "LoadBalancerTargetGroups": [ { "LoadBalancerTargetGroupARN": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", "State": "Added" } ] } awscli-1.14.44/awscli/examples/autoscaling/describe-scaling-activities.rst0000666454262600001440000000330013243367510027724 0ustar pysdk-ciamazon00000000000000**To get a description of the scaling activities for an Auto Scaling group** This example describes the scaling activities for the specified Auto Scaling group:: aws autoscaling describe-scaling-activities --auto-scaling-group-name my-auto-scaling-group The following is example output:: { "Activities": [ { "Description": "Launching a new EC2 instance: i-4ba0837f", "AutoScalingGroupName": "my-auto-scaling-group", "ActivityId": "f9f2d65b-f1f2-43e7-b46d-d86756459699", "Details": "{"Availability Zone":"us-west-2c"}", "StartTime": "2013-08-19T20:53:29.930Z", "Progress": 100, "EndTime": "2013-08-19T20:54:02Z", "Cause": "At 2013-08-19T20:53:25Z a user request created an AutoScalingGroup changing the desired capacity from 0 to 1. At 2013-08-19T20:53:29Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.", "StatusCode": "Successful" } ] } To describe a specific scaling activity, use the ``activity-ids`` parameter:: aws autoscaling describe-scaling-activities --activity-ids b55c7b67-c8aa-4d10-b240-730ff91d8895 To return a specific number of activities, use the ``max-items`` parameter:: aws autoscaling describe-scaling-activities --max-items 1 If the output includes a ``NextToken`` field, there are more activities. To get the additional activities, use the value of this field with the ``starting-token`` parameter in a subsequent call as follows:: aws autoscaling describe-scaling-activities --starting-token Z3M3LMPEXAMPLE awscli-1.14.44/awscli/examples/autoscaling/describe-launch-configurations.rst0000666454262600001440000000513213243367510030451 0ustar pysdk-ciamazon00000000000000**To describe Auto Scaling launch configurations** This example describes the specified launch configuration:: aws autoscaling describe-launch-configurations --launch-configuration-names my-launch-config The following is example output:: { "LaunchConfigurations": [ { "UserData": null, "EbsOptimized": false, "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config", "InstanceMonitoring": { "Enabled": true }, "ImageId": "ami-043a5034", "CreatedTime": "2014-05-07T17:39:28.599Z", "BlockDeviceMappings": [], "KeyName": null, "SecurityGroups": [ "sg-67ef0308" ], "LaunchConfigurationName": "my-launch-config", "KernelId": null, "RamdiskId": null, "InstanceType": "t1.micro", "AssociatePublicIpAddress": true } ] } To return a specific number of launch configurations, use the ``max-items`` parameter:: aws autoscaling describe-launch-configurations --max-items 1 The following is example output:: { "NextToken": "Z3M3LMPEXAMPLE", "LaunchConfigurations": [ { "UserData": null, "EbsOptimized": false, "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config", "InstanceMonitoring": { "Enabled": true }, "ImageId": "ami-043a5034", "CreatedTime": "2014-05-07T17:39:28.599Z", "BlockDeviceMappings": [], "KeyName": null, "SecurityGroups": [ "sg-67ef0308" ], "LaunchConfigurationName": "my-launch-config", "KernelId": null, "RamdiskId": null, "InstanceType": "t1.micro", "AssociatePublicIpAddress": true } ] } If the output includes a ``NextToken`` field, there are more launch configurations. To get the additional launch configurations, use the value of this field with the ``starting-token`` parameter in a subsequent call as follows:: aws autoscaling describe-launch-configurations --starting-token Z3M3LMPEXAMPLE awscli-1.14.44/awscli/examples/autoscaling/complete-lifecycle-action.rst0000666454262600001440000000063713243367510027416 0ustar pysdk-ciamazon00000000000000**To complete the lifecycle action** This example notifies Auto Scaling that the specified lifecycle action is complete so that it can finish launching or terminating the instance:: aws autoscaling complete-lifecycle-action --lifecycle-hook-name my-lifecycle-hook --auto-scaling-group-name my-auto-scaling-group --lifecycle-action-result CONTINUE --lifecycle-action-token bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635 awscli-1.14.44/awscli/examples/autoscaling/resume-processes.rst0000666454262600001440000000077213243367510025702 0ustar pysdk-ciamazon00000000000000**To resume Auto Scaling processes** This example resumes the specified suspended scaling process for the specified Auto Scaling group:: 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*. .. _`Suspend and Resume Auto Scaling Processes`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/US_SuspendResume.html awscli-1.14.44/awscli/examples/autoscaling/attach-instances.rst0000666454262600001440000000036713243367510025627 0ustar pysdk-ciamazon00000000000000**To attach an instance to an Auto Scaling group** This example attaches the specified instance to the specified Auto Scaling group:: aws autoscaling attach-instances --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group awscli-1.14.44/awscli/examples/autoscaling/create-launch-configuration.rst0000666454262600001440000000373513243367510027760 0ustar pysdk-ciamazon00000000000000**To create a launch configuration** This example creates a launch configuration:: 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 This example creates a launch configuration based on an existing instance. In addition, it also specifies launch configuration attributes such as a security group, tenancy, Amazon EBS optimization, and a bootstrapping script:: aws autoscaling create-launch-configuration --launch-configuration-name my-launch-config --key-name my-key-pair --instance-id i-7e13c876 --security-groups sg-eb2af88e --instance-type m1.small --user-data file://myuserdata.txt --instance-monitoring Enabled=true --no-ebs-optimized --no-associate-public-ip-address --placement-tenancy dedicated --iam-instance-profile my-autoscaling-role Add the following parameter to add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100. Parameter:: --block-device-mappings "[{\"DeviceName\": \"/dev/sdh\",\"Ebs\":{\"VolumeSize\":100}}]" Add the following parameter to add ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``. Parameter:: --block-device-mappings "[{\"DeviceName\": \"/dev/sdc\",\"VirtualName\":\"ephemeral1\"}]" Add the following parameter to omit a device included on the instance (for example, ``/dev/sdf``). Parameter:: --block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"NoDevice\":\"\"}]" awscli-1.14.44/awscli/examples/autoscaling/describe-load-balancers.rst0000666454262600001440000000066613243367510027025 0ustar pysdk-ciamazon00000000000000**To describe the load balancers for an Auto Scaling group** This example describes the load balancers for the specified Auto Scaling group:: aws autoscaling describe-load-balancers --auto-scaling-group-name my-auto-scaling-group The following is example output:: { "LoadBalancers": [ { "State": "Added", "LoadBalancerName": "my-load-balancer" } ] } awscli-1.14.44/awscli/examples/autoscaling/delete-notification-configuration.rst0000666454262600001440000000106713243367510031167 0ustar pysdk-ciamazon00000000000000**To delete an Auto Scaling notification** This example deletes the specified notification from the specified Auto Scaling group:: 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*. .. _`Delete the Notification Configuration`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/ASGettingNotifications.html#delete-settingupnotifications awscli-1.14.44/awscli/examples/autoscaling/enable-metrics-collection.rst0000666454262600001440000000134713243367510027420 0ustar pysdk-ciamazon00000000000000**To enable metrics collection for an Auto Scaling group** This example enables data collection for the specified Auto Scaling group:: aws autoscaling enable-metrics-collection --auto-scaling-group-name my-auto-scaling-group --granularity "1Minute" To collect data for a specific metric, use the ``metrics`` parameter:: 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*. .. _`Monitoring Your Auto Scaling Instances and Groups`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-instance-monitoring.html awscli-1.14.44/awscli/examples/s3api/0000777454262600001440000000000013243367512020346 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/s3api/put-object-acl.rst0000666454262600001440000000105213243367510023705 0ustar pysdk-ciamazon00000000000000The following command grants ``full control`` to two AWS users (*user1@example.com* and *user2@example.com*) and ``read`` permission to everyone:: aws s3api put-object-acl --bucket MyBucket --key file.txt --grant-full-control emailaddress=user1@example.com,emailaddress=user2@example.com --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTacl.html for details on custom ACLs (the s3api ACL commands, such as ``put-object-acl``, use the same shorthand argument notation). awscli-1.14.44/awscli/examples/s3api/head-object.rst0000666454262600001440000000064113243367510023244 0ustar pysdk-ciamazon00000000000000The following command retrieves metadata for an object in a bucket named ``my-bucket``:: aws s3api head-object --bucket my-bucket --key index.html Output:: { "AcceptRanges": "bytes", "ContentType": "text/html", "LastModified": "Thu, 16 Apr 2015 18:19:14 GMT", "ContentLength": 77, "VersionId": "null", "ETag": "\"30a6ec7e1a9ad79c203d05a589c8b400\"", "Metadata": {} }awscli-1.14.44/awscli/examples/s3api/get-bucket-replication.rst0000666454262600001440000000123313243367510025436 0ustar pysdk-ciamazon00000000000000The following command retrieves the replication configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-replication --bucket my-bucket Output:: { "ReplicationConfiguration": { "Rules": [ { "Status": "Enabled", "Prefix": "", "Destination": { "Bucket": "arn:aws:s3:::my-bucket-backup", "StorageClass": "STANDARD" }, "ID": "ZmUwNzE4ZmQ4tMjVhOS00MTlkLOGI4NDkzZTIWJjNTUtYTA1" } ], "Role": "arn:aws:iam::123456789012:role/s3-replication-role" } }awscli-1.14.44/awscli/examples/s3api/head-bucket.rst0000666454262600001440000000050613243367510023253 0ustar pysdk-ciamazon00000000000000The following command verifies access to a bucket named ``my-bucket``:: aws s3api head-bucket --bucket my-bucket If the bucket exists and you have access to it, no output is returned. Otherwise, an error message will be shown. For example:: A client error (404) occurred when calling the HeadBucket operation: Not Foundawscli-1.14.44/awscli/examples/s3api/get-bucket-location.rst0000666454262600001440000000034113243367510024734 0ustar pysdk-ciamazon00000000000000The following command retrieves the location constraint for a bucket named ``my-bucket``, if a constraint exists:: aws s3api get-bucket-location --bucket my-bucket Output:: { "LocationConstraint": "us-west-2" }awscli-1.14.44/awscli/examples/s3api/delete-bucket-tagging.rst0000666454262600001440000000022013243367510025223 0ustar pysdk-ciamazon00000000000000The following command deletes a tagging configuration from a bucket named ``my-bucket``:: aws s3api delete-bucket-tagging --bucket my-bucket awscli-1.14.44/awscli/examples/s3api/put-bucket-versioning.rst0000666454262600001440000000054413243367510025345 0ustar pysdk-ciamazon00000000000000The following command enables versioning on a bucket named ``my-bucket``:: aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=Enabled The following command enables versioning, and uses an mfa code :: aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=Enabled --mfa "SERIAL 123456" awscli-1.14.44/awscli/examples/s3api/list-multipart-uploads.rst0000666454262600001440000000201313243367510025531 0ustar pysdk-ciamazon00000000000000The following command lists all of the active multipart uploads for a bucket named ``my-bucket``:: aws s3api list-multipart-uploads --bucket my-bucket Output:: { "Uploads": [ { "Initiator": { "DisplayName": "username", "ID": "arn:aws:iam::0123456789012:user/username" }, "Initiated": "2015-06-02T18:01:30.000Z", "UploadId": "dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R", "StorageClass": "STANDARD", "Key": "multipart/01", "Owner": { "DisplayName": "aws-account-name", "ID": "100719349fc3b6dcd7c820a124bf7aecd408092c3d7b51b38494939801fc248b" } } ], "CommonPrefixes": [] } In progress multipart uploads incur storage costs in Amazon S3. Complete or abort an active multipart upload to remove its parts from your account.awscli-1.14.44/awscli/examples/s3api/create-multipart-upload.rst0000666454262600001440000000112413243367510025640 0ustar pysdk-ciamazon00000000000000The following command creates a multipart upload in the bucket ``my-bucket`` with the key ``multipart/01``:: aws s3api create-multipart-upload --bucket my-bucket --key 'multipart/01' Output:: { "Bucket": "my-bucket", "UploadId": "dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R", "Key": "multipart/01" } The completed file will be named ``01`` in a folder called ``multipart`` in the bucket ``my-bucket``. Save the upload ID, key and bucket name for use with the ``upload-part`` command.awscli-1.14.44/awscli/examples/s3api/get-bucket-notification-configuration.rst0000666454262600001440000000075113243367510030464 0ustar pysdk-ciamazon00000000000000The following command retrieves the notification configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-notification-configuration --bucket my-bucket Output:: { "TopicConfigurations": [ { "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl", "TopicArn": "arn:aws:sns:us-west-2:123456789012:my-notification-topic", "Events": [ "s3:ObjectCreated:*" ] } ] } awscli-1.14.44/awscli/examples/s3api/abort-multipart-upload.rst0000666454262600001440000000071713243367510025513 0ustar pysdk-ciamazon00000000000000The following command aborts a multipart upload for the key ``multipart/01`` in the bucket ``my-bucket``:: aws s3api abort-multipart-upload --bucket my-bucket --key 'multipart/01' --upload-id dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R The upload ID required by this command is output by ``create-multipart-upload`` and can also be retrieved with ``list-multipart-uploads``.awscli-1.14.44/awscli/examples/s3api/put-bucket-lifecycle-configuration.rst0000666454262600001440000000257513243367510027774 0ustar pysdk-ciamazon00000000000000The following command applies a lifecycle configuration to a bucket named ``my-bucket``:: aws s3api put-bucket-lifecycle-configuration --bucket my-bucket --lifecycle-configuration file://lifecycle.json The file ``lifecycle.json`` is a JSON document in the current folder that specifies two rules:: { "Rules": [ { "ID": "Move rotated logs to Glacier", "Prefix": "rotated/", "Status": "Enabled", "Transitions": [ { "Date": "2015-11-10T00:00:00.000Z", "StorageClass": "GLACIER" } ] }, { "Status": "Enabled", "Prefix": "", "NoncurrentVersionTransitions": [ { "NoncurrentDays": 2, "StorageClass": "GLACIER" } ], "ID": "Move old versions to Glacier" } ] } The first rule moves files with the prefix ``rotated`` to Glacier on the specified date. The second rule moves old object versions to Glacier when they are no longer current. For information on acceptable timestamp formats, see `Specifying Parameter Values`_ in the *AWS CLI User Guide*. .. _`Specifying Parameter Values`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.htmlawscli-1.14.44/awscli/examples/s3api/upload-part.rst0000666454262600001440000000151513243367510023330 0ustar pysdk-ciamazon00000000000000The following command uploads the first part in a multipart upload initiated with the ``create-multipart-upload`` command:: aws s3api upload-part --bucket my-bucket --key 'multipart/01' --part-number 1 --body part01 --upload-id "dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R" The ``body`` option takes the name or path of a local file for upload (do not use the file:// prefix). The minimum part size is 5 MB. Upload ID is returned by ``create-multipart-upload`` and can also be retrieved with ``list-multipart-uploads``. Bucket and key are specified when you create the multipart upload. Output:: { "ETag": "\"e868e0f4719e394144ef36531ee6824c\"" } Save the ETag value of each part for later. They are required to complete the multipart upload.awscli-1.14.44/awscli/examples/s3api/put-bucket-notification-configuration.rst0000666454262600001440000000212513243367510030512 0ustar pysdk-ciamazon00000000000000The applies a notification configuration to a bucket named ``my-bucket``:: aws s3api put-bucket-notification-configuration --bucket my-bucket --notification-configuration file://notification.json The file ``notification.json`` is a JSON document in the current folder that specifies an SNS topic and an event type to monitor:: { "TopicConfigurations": [ { "TopicArn": "arn:aws:sns:us-west-2:123456789012:s3-notification-topic", "Events": [ "s3:ObjectCreated:*" ] } ] } The SNS topic must have an IAM policy attached to it that allows Amazon S3 to publish to it:: { "Version": "2008-10-17", "Id": "example-ID", "Statement": [ { "Sid": "example-statement-ID", "Effect": "Allow", "Principal": { "Service": "s3.amazonaws.com" }, "Action": [ "SNS:Publish" ], "Resource": "arn:aws:sns:us-west-2:123456789012:my-bucket", "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:s3:*:*:my-bucket" } } } ] }awscli-1.14.44/awscli/examples/s3api/get-bucket-website.rst0000666454262600001440000000045413243367510024573 0ustar pysdk-ciamazon00000000000000The following command retrieves the static website configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-website --bucket my-bucket Output:: { "IndexDocument": { "Suffix": "index.html" }, "ErrorDocument": { "Key": "error.html" } } awscli-1.14.44/awscli/examples/s3api/put-bucket-acl.rst0000666454262600001440000000102313243367510023712 0ustar pysdk-ciamazon00000000000000This example grants ``full control`` to two AWS users (*user1@example.com* and *user2@example.com*) and ``read`` permission to everyone:: aws s3api put-bucket-acl --bucket MyBucket --grant-full-control emailaddress=user1@example.com,emailaddress=user2@example.com --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTacl.html for details on custom ACLs (the s3api ACL commands, such as ``put-bucket-acl``, use the same shorthand argument notation). awscli-1.14.44/awscli/examples/s3api/put-bucket-cors.rst0000666454262600001440000000127513243367510024132 0ustar pysdk-ciamazon00000000000000The following example enables ``PUT``, ``POST``, and ``DELETE`` requests from *www.example.com*, and enables ``GET`` requests from any domain:: aws s3api put-bucket-cors --bucket MyBucket --cors-configuration file://cors.json cors.json: { "CORSRules": [ { "AllowedOrigins": ["http://www.example.com"], "AllowedHeaders": ["*"], "AllowedMethods": ["PUT", "POST", "DELETE"], "MaxAgeSeconds": 3000, "ExposeHeaders": ["x-amz-server-side-encryption"] }, { "AllowedOrigins": ["*"], "AllowedHeaders": ["Authorization"], "AllowedMethods": ["GET"], "MaxAgeSeconds": 3000 } ] } awscli-1.14.44/awscli/examples/s3api/put-bucket-replication.rst0000666454262600001440000000233713243367510025475 0ustar pysdk-ciamazon00000000000000The following command applies a replication configuration to a bucket named ``my-bucket``:: aws s3api put-bucket-replication --bucket my-bucket --replication-configuration file://replication.json The file ``replication.json`` is a JSON document in the current folder that specifies a replication rule:: { "Role": "arn:aws:iam::123456789012:role/s3-replication-role", "Rules": [ { "Prefix": "", "Status": "Enabled", "Destination": { "Bucket": "arn:aws:s3:::my-bucket-backup", "StorageClass": "STANDARD" } } ] } The destination bucket must be in a different region and have versioning enabled. The service role must have permission to write to the destination bucket and have a trust relationship that allows Amazon S3 to assume it. Example service role permissions:: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "s3:*", "Resource": "*" } ] } Trust relationship:: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "s3.amazonaws.com" }, "Action": "sts:AssumeRole" } ] } awscli-1.14.44/awscli/examples/s3api/put-bucket-policy.rst0000666454262600001440000000175713243367510024470 0ustar pysdk-ciamazon00000000000000This example allows all users to retrieve any object in *MyBucket* except those in the *MySecretFolder*. It also grants ``put`` and ``delete`` permission to the root user of the AWS account ``1234-5678-9012``:: aws s3api put-bucket-policy --bucket MyBucket --policy file://policy.json policy.json: { "Statement": [ { "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::MyBucket/*" }, { "Effect": "Deny", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::MyBucket/MySecretFolder/*" }, { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012:root" }, "Action": [ "s3:DeleteObject", "s3:PutObject" ], "Resource": "arn:aws:s3:::MyBucket/*" } ] } awscli-1.14.44/awscli/examples/s3api/get-bucket-acl.rst0000666454262600001440000000110613243367510023663 0ustar pysdk-ciamazon00000000000000The following command retrieves the access control list for a bucket named ``my-bucket``:: aws s3api get-bucket-acl --bucket my-bucket Output:: { "Owner": { "DisplayName": "my-username", "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32" }, "Grants": [ { "Grantee": { "DisplayName": "my-username", "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32" }, "Permission": "FULL_CONTROL" } ] } awscli-1.14.44/awscli/examples/s3api/get-bucket-versioning.rst0000666454262600001440000000030313243367510025305 0ustar pysdk-ciamazon00000000000000The following command retrieves the versioning configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-versioning --bucket my-bucket Output:: { "Status": "Enabled" } awscli-1.14.44/awscli/examples/s3api/get-object-torrent.rst0000666454262600001440000000060713243367510024617 0ustar pysdk-ciamazon00000000000000The following command creates a torrent for an object in a bucket named ``my-bucket``:: aws s3api get-object-torrent --bucket my-bucket --key large-video-file.mp4 large-video-file.torrent The torrent file is saved locally in the current folder. Note that the output filename (``large-video-file.torrent``) is specified without an option name and must be the last argument in the command.awscli-1.14.44/awscli/examples/s3api/delete-bucket-lifecycle.rst0000666454262600001440000000022413243367510025546 0ustar pysdk-ciamazon00000000000000The following command deletes a lifecycle configuration from a bucket named ``my-bucket``:: aws s3api delete-bucket-lifecycle --bucket my-bucket awscli-1.14.44/awscli/examples/s3api/delete-bucket-replication.rst0000666454262600001440000000023013243367510026115 0ustar pysdk-ciamazon00000000000000The following command deletes a replication configuration from a bucket named ``my-bucket``:: aws s3api delete-bucket-replication --bucket my-bucket awscli-1.14.44/awscli/examples/s3api/list-objects.rst0000666454262600001440000000106013243367510023475 0ustar pysdk-ciamazon00000000000000The following example uses the ``list-objects`` command to display the names of all the objects in the specified bucket:: aws s3api list-objects --bucket text-content --query 'Contents[].{Key: Key, Size: Size}' The example uses the ``--query`` argument to filter the output of ``list-objects`` down to the key value and size for each object For more information about objects, see `Working with Amazon S3 Objects`_ in the *Amazon S3 Developer Guide*. .. _`Working with Amazon S3 Objects`: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingObjects.html awscli-1.14.44/awscli/examples/s3api/get-object-acl.rst0000666454262600001440000000142613243367510023661 0ustar pysdk-ciamazon00000000000000The following command retrieves the access control list for an object in a bucket named ``my-bucket``:: aws s3api get-object-acl --bucket my-bucket --key index.html Output:: { "Owner": { "DisplayName": "my-username", "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32" }, "Grants": [ { "Grantee": { "DisplayName": "my-username", "ID": "7009a8971cd538e11f6b6606438875e7c86c5b672f46db45460ddcd087d36c32" }, "Permission": "FULL_CONTROL" }, { "Grantee": { "URI": "http://acs.amazonaws.com/groups/global/AllUsers" }, "Permission": "READ" } ] }awscli-1.14.44/awscli/examples/s3api/get-bucket-tagging.rst0000666454262600001440000000043513243367510024550 0ustar pysdk-ciamazon00000000000000The following command retrieves the tagging configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-tagging --bucket my-bucket Output:: { "TagSet": [ { "Value": "marketing", "Key": "organization" } ] } awscli-1.14.44/awscli/examples/s3api/get-bucket-cors.rst0000666454262600001440000000170013243367510024072 0ustar pysdk-ciamazon00000000000000The following command retrieves the Cross-Origin Resource Sharing configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-cors --bucket my-bucket Output:: { "CORSRules": [ { "AllowedHeaders": [ "*" ], "ExposeHeaders": [ "x-amz-server-side-encryption" ], "AllowedMethods": [ "PUT", "POST", "DELETE" ], "MaxAgeSeconds": 3000, "AllowedOrigins": [ "http://www.example.com" ] }, { "AllowedHeaders": [ "Authorization" ], "MaxAgeSeconds": 3000, "AllowedMethods": [ "GET" ], "AllowedOrigins": [ "*" ] } ] } awscli-1.14.44/awscli/examples/s3api/delete-objects.rst0000666454262600001440000000105613243367510023771 0ustar pysdk-ciamazon00000000000000The following command deletes an object from a bucket named ``my-bucket``:: aws s3api delete-objects --bucket my-bucket --delete file://delete.json ``delete.json`` is a JSON document in the current directory that specifies the object to delete:: { "Objects": [ { "Key": "test1.txt" } ], "Quiet": false } Output:: { "Deleted": [ { "DeleteMarkerVersionId": "mYAT5Mc6F7aeUL8SS7FAAqUPO1koHwzU", "Key": "test1.txt", "DeleteMarker": true } ] }awscli-1.14.44/awscli/examples/s3api/get-bucket-policy.rst0000666454262600001440000000206313243367510024426 0ustar pysdk-ciamazon00000000000000The following command retrieves the bucket policy for a bucket named ``my-bucket``:: aws s3api get-bucket-policy --bucket my-bucket Output:: { "Policy": "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::my-bucket/*\"},{\"Sid\":\"\",\"Effect\":\"Deny\",\"Principal\":\"*\",\"Action\":\"s3:GetObject\",\"Resource\":\"arn:aws:s3:::my-bucket/secret/*\"}]}" } Get and put a bucket policy --------------------------- The following example shows how you can download an Amazon S3 bucket policy, make modifications to the file, and then use ``put-bucket-policy`` to apply the modified bucket policy. To download the bucket policy to a file, you can run:: aws s3api get-bucket-policy --bucket mybucket --query Policy --output text > policy.json You can then modify the ``policy.json`` file as needed. Finally you can apply this modified policy back to the S3 bucket by running:: aws s3api put-bucket-policy --bucket mybucket --policy file://policy.json awscli-1.14.44/awscli/examples/s3api/list-parts.rst0000666454262600001440000000245713243367510023210 0ustar pysdk-ciamazon00000000000000The following command lists all of the parts that have been uploaded for a multipart upload with key ``multipart/01`` in the bucket ``my-bucket``:: aws s3api list-parts --bucket my-bucket --key 'multipart/01' --upload-id dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R Output:: { "Owner": { "DisplayName": "aws-account-name", "ID": "100719349fc3b6dcd7c820a124bf7aecd408092c3d7b51b38494939801fc248b" }, "Initiator": { "DisplayName": "username", "ID": "arn:aws:iam::0123456789012:user/username" }, "Parts": [ { "LastModified": "2015-06-02T18:07:35.000Z", "PartNumber": 1, "ETag": "\"e868e0f4719e394144ef36531ee6824c\"", "Size": 5242880 }, { "LastModified": "2015-06-02T18:07:42.000Z", "PartNumber": 2, "ETag": "\"6bb2b12753d66fe86da4998aa33fffb0\"", "Size": 5242880 }, { "LastModified": "2015-06-02T18:07:47.000Z", "PartNumber": 3, "ETag": "\"d0a0112e841abec9c9ec83406f0159c8\"", "Size": 5242880 } ], "StorageClass": "STANDARD" }awscli-1.14.44/awscli/examples/s3api/delete-object.rst0000666454262600001440000000103213243367510023600 0ustar pysdk-ciamazon00000000000000The following command deletes an object named ``test.txt`` from a bucket named ``my-bucket``:: aws s3api delete-object --bucket my-bucket --key test.txt If bucket versioning is enabled, the output will contain the version ID of the delete marker:: { "VersionId": "9_gKg5vG56F.TTEUdwkxGpJ3tNDlWlGq", "DeleteMarker": true } For more information about deleting objects, see `Deleting Objects`_ in the *Amazon S3 Developer Guide*. .. _`Deleting Objects`: http://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingObjects.html awscli-1.14.44/awscli/examples/s3api/get-object.rst0000666454262600001440000000146213243367510023124 0ustar pysdk-ciamazon00000000000000The following example uses the ``get-object`` command to download an object from Amazon S3:: aws s3api get-object --bucket text-content --key dir/my_images.tar.bz2 my_images.tar.bz2 Note that the outfile parameter is specified without an option name such as "--outfile". The name of the output file must be the last parameter in the command. The example below demonstrates the use of ``--range`` to download a specific byte range from an object. Note the byte ranges needs to be prefixed with "bytes=":: aws s3api get-object --bucket text-content --key dir/my_data --range bytes=8888-9999 my_data_range For more information about retrieving objects, see `Getting Objects`_ in the *Amazon S3 Developer Guide*. .. _`Getting Objects`: http://docs.aws.amazon.com/AmazonS3/latest/dev/GettingObjectsUsingAPIs.html awscli-1.14.44/awscli/examples/s3api/get-bucket-lifecycle-configuration.rst0000666454262600001440000000156013243367510027734 0ustar pysdk-ciamazon00000000000000The following command retrieves the lifecycle configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-lifecycle-configuration --bucket my-bucket Output:: { "Rules": [ { "ID": "Move rotated logs to Glacier", "Prefix": "rotated/", "Status": "Enabled", "Transitions": [ { "Date": "2015-11-10T00:00:00.000Z", "StorageClass": "GLACIER" } ] }, { "Status": "Enabled", "Prefix": "", "NoncurrentVersionTransitions": [ { "NoncurrentDays": 0, "StorageClass": "GLACIER" } ], "ID": "Move old versions to Glacier" } ] }awscli-1.14.44/awscli/examples/s3api/complete-multipart-upload.rst0000666454262600001440000000301613243367510026207 0ustar pysdk-ciamazon00000000000000The following command completes a multipart upload for the key ``multipart/01`` in the bucket ``my-bucket``:: aws s3api complete-multipart-upload --multipart-upload file://mpustruct --bucket my-bucket --key 'multipart/01' --upload-id dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R The upload ID required by this command is output by ``create-multipart-upload`` and can also be retrieved with ``list-multipart-uploads``. The multipart upload option in the above command takes a JSON structure that describes the parts of the multipart upload that should be reassembled into the complete file. In this example, the ``file://`` prefix is used to load the JSON structure from a file in the local folder named ``mpustruct``. mpustruct:: { "Parts": [ { "ETag": "e868e0f4719e394144ef36531ee6824c", "PartNumber": 1 }, { "ETag": "6bb2b12753d66fe86da4998aa33fffb0", "PartNumber": 2 }, { "ETag": "d0a0112e841abec9c9ec83406f0159c8", "PartNumber": 3 } ] } The ETag value for each part is upload is output each time you upload a part using the ``upload-part`` command and can also be retrieved by calling ``list-parts`` or calculated by taking the MD5 checksum of each part. Output:: { "ETag": "\"3944a9f7a4faab7f78788ff6210f63f0-3\"", "Bucket": "my-bucket", "Location": "https://my-bucket.s3.amazonaws.com/multipart%2F01", "Key": "multipart/01" } awscli-1.14.44/awscli/examples/s3api/delete-bucket-cors.rst0000666454262600001440000000024313243367510024556 0ustar pysdk-ciamazon00000000000000The following command deletes a Cross-Origin Resource Sharing configuration from a bucket named ``my-bucket``:: aws s3api delete-bucket-cors --bucket my-bucket awscli-1.14.44/awscli/examples/s3api/get-bucket-lifecycle.rst0000666454262600001440000000116713243367510025072 0ustar pysdk-ciamazon00000000000000The following command retrieves the lifecycle configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-lifecycle --bucket my-bucket Output:: { "Rules": [ { "ID": "Move to Glacier after sixty days (objects in logs/2015/)", "Prefix": "logs/2015/", "Status": "Enabled", "Transition": { "Days": 60, "StorageClass": "GLACIER" } }, { "Expiration": { "Date": "2016-01-01T00:00:00.000Z" }, "ID": "Delete 2014 logs in 2016.", "Prefix": "logs/2014/", "Status": "Enabled" } ] } awscli-1.14.44/awscli/examples/s3api/put-bucket-notification.rst0000666454262600001440000000177313243367510025655 0ustar pysdk-ciamazon00000000000000The applies a notification configuration to a bucket named ``my-bucket``:: aws s3api put-bucket-notification --bucket my-bucket --notification-configuration file://notification.json The file ``notification.json`` is a JSON document in the current folder that specifies an SNS topic and an event type to monitor:: { "TopicConfiguration": { "Event": "s3:ObjectCreated:*", "Topic": "arn:aws:sns:us-west-2:123456789012:s3-notification-topic" } } The SNS topic must have an IAM policy attached to it that allows Amazon S3 to publish to it:: { "Version": "2008-10-17", "Id": "example-ID", "Statement": [ { "Sid": "example-statement-ID", "Effect": "Allow", "Principal": { "Service": "s3.amazonaws.com" }, "Action": [ "SNS:Publish" ], "Resource": "arn:aws:sns:us-west-2:123456789012:my-bucket", "Condition": { "ArnLike": { "aws:SourceArn": "arn:aws:s3:*:*:my-bucket" } } } ] }awscli-1.14.44/awscli/examples/s3api/put-bucket-tagging.rst0000666454262600001440000000106313243367510024577 0ustar pysdk-ciamazon00000000000000The following command applies a tagging configuration to a bucket named ``my-bucket``:: aws s3api put-bucket-tagging --bucket my-bucket --tagging file://tagging.json The file ``tagging.json`` is a JSON document in the current folder that specifies tags:: { "TagSet": [ { "Key": "organization", "Value": "marketing" } ] } Or apply a tagging configuration to ``my-bucket`` directly from the command line:: aws s3api put-bucket-tagging --bucket my-bucket --tagging 'TagSet=[{Key=organization,Value=marketing}]' awscli-1.14.44/awscli/examples/s3api/delete-bucket-website.rst0000666454262600001440000000022013243367510025245 0ustar pysdk-ciamazon00000000000000The following command deletes a website configuration from a bucket named ``my-bucket``:: aws s3api delete-bucket-website --bucket my-bucket awscli-1.14.44/awscli/examples/s3api/copy-object.rst0000666454262600001440000000060213243367510023312 0ustar pysdk-ciamazon00000000000000The following command copies an object from ``bucket-1`` to ``bucket-2``:: aws s3api copy-object --copy-source bucket-1/test.txt --key test.txt --bucket bucket-2 Output:: { "CopyObjectResult": { "LastModified": "2015-11-10T01:07:25.000Z", "ETag": "\"589c8b79c230a6ecd5a7e1d040a9a030\"" }, "VersionId": "YdnYvTCVDqRRFA.NFJjy36p0hxifMlkA" } awscli-1.14.44/awscli/examples/s3api/put-bucket-logging.rst0000666454262600001440000000244613243367510024613 0ustar pysdk-ciamazon00000000000000The example below sets the logging policy for *MyBucket*. The AWS user *user@example.com* will have full control over the log files, and all users will have access to them. First, grant S3 permission with ``put-bucket-acl``:: aws s3api put-bucket-acl --bucket MyBucket --grant-write URI=http://acs.amazonaws.com/groups/s3/LogDelivery --grant-read-acp URI=http://acs.amazonaws.com/groups/s3/LogDelivery Then apply the logging policy:: aws s3api put-bucket-logging --bucket MyBucket --bucket-logging-status file://logging.json ``logging.json`` is a JSON document in the current folder that contains the logging policy:: { "LoggingEnabled": { "TargetBucket": "MyBucket", "TargetPrefix": "MyBucketLogs/", "TargetGrants": [ { "Grantee": { "Type": "AmazonCustomerByEmail", "EmailAddress": "user@example.com" }, "Permission": "FULL_CONTROL" }, { "Grantee": { "Type": "Group", "URI": "http://acs.amazonaws.com/groups/global/AllUsers" }, "Permission": "READ" } ] } } .. note:: the ``put-bucket-acl`` command is required to grant S3's log delivery system the necessary permissions (write and read-acp permissions). awscli-1.14.44/awscli/examples/s3api/list-object-versions.rst0000666454262600001440000000503313243367510025164 0ustar pysdk-ciamazon00000000000000The following command retrieves version information for an object in a bucket named ``my-bucket``:: aws s3api list-object-versions --bucket my-bucket --prefix index.html Output:: { "DeleteMarkers": [ { "Owner": { "DisplayName": "my-username", "ID": "7009a8971cd660687538875e7c86c5b672fe116bd438f46db45460ddcd036c32" }, "IsLatest": true, "VersionId": "B2VsEK5saUNNHKcOAJj7hIE86RozToyq", "Key": "index.html", "LastModified": "2015-11-10T00:57:03.000Z" }, { "Owner": { "DisplayName": "my-username", "ID": "7009a8971cd660687538875e7c86c5b672fe116bd438f46db45460ddcd036c32" }, "IsLatest": false, "VersionId": ".FLQEZscLIcfxSq.jsFJ.szUkmng2Yw6", "Key": "index.html", "LastModified": "2015-11-09T23:32:20.000Z" } ], "Versions": [ { "LastModified": "2015-11-10T00:20:11.000Z", "VersionId": "Rb_l2T8UHDkFEwCgJjhlgPOZC0qJ.vpD", "ETag": "\"0622528de826c0df5db1258a23b80be5\"", "StorageClass": "STANDARD", "Key": "index.html", "Owner": { "DisplayName": "my-username", "ID": "7009a8971cd660687538875e7c86c5b672fe116bd438f46db45460ddcd036c32" }, "IsLatest": false, "Size": 38 }, { "LastModified": "2015-11-09T23:26:41.000Z", "VersionId": "rasWWGpgk9E4s0LyTJgusGeRQKLVIAFf", "ETag": "\"06225825b8028de826c0df5db1a23be5\"", "StorageClass": "STANDARD", "Key": "index.html", "Owner": { "DisplayName": "my-username", "ID": "7009a8971cd660687538875e7c86c5b672fe116bd438f46db45460ddcd036c32" }, "IsLatest": false, "Size": 38 }, { "LastModified": "2015-11-09T22:50:50.000Z", "VersionId": "null", "ETag": "\"d1f45267a863c8392e07d24dd592f1b9\"", "StorageClass": "STANDARD", "Key": "index.html", "Owner": { "DisplayName": "my-username", "ID": "7009a8971cd660687538875e7c86c5b672fe116bd438f46db45460ddcd036c32" }, "IsLatest": false, "Size": 533823 } ] } awscli-1.14.44/awscli/examples/s3api/get-bucket-notification.rst0000666454262600001440000000072413243367510025617 0ustar pysdk-ciamazon00000000000000The following command retrieves the notification configuration for a bucket named ``my-bucket``:: aws s3api get-bucket-notification --bucket my-bucket Output:: { "TopicConfiguration": { "Topic": "arn:aws:sns:us-west-2:123456789012:my-notification-topic", "Id": "YmQzMmEwM2EjZWVlI0NGItNzVtZjI1MC00ZjgyLWZDBiZWNl", "Event": "s3:ObjectCreated:*", "Events": [ "s3:ObjectCreated:*" ] } } awscli-1.14.44/awscli/examples/s3api/create-bucket.rst0000666454262600001440000000116213243367510023614 0ustar pysdk-ciamazon00000000000000The following command creates a bucket named ``my-bucket``:: aws s3api create-bucket --bucket my-bucket --region us-east-1 Output:: { "Location": "/my-bucket" } The following command creates a bucket named ``my-bucket`` in the ``eu-west-1`` region. Regions outside of ``us-east-1`` require the appropriate ``LocationConstraint`` to be specified in order to create the bucket in the desired region:: $ aws s3api create-bucket --bucket my-bucket --region eu-west-1 --create-bucket-configuration LocationConstraint=eu-west-1 Output:: { "Location": "http://my-bucket.s3.amazonaws.com/" } awscli-1.14.44/awscli/examples/s3api/put-bucket-lifecycle.rst0000666454262600001440000000307613243367510025124 0ustar pysdk-ciamazon00000000000000The following command applies a lifecycle configuration to the bucket ``my-bucket``:: aws s3api put-bucket-lifecycle --bucket my-bucket --lifecycle-configuration file://lifecycle.json The file ``lifecycle.json`` is a JSON document in the current folder that specifies two rules:: { "Rules": [ { "ID": "Move to Glacier after sixty days (objects in logs/2015/)", "Prefix": "logs/2015/", "Status": "Enabled", "Transition": { "Days": 60, "StorageClass": "GLACIER" } }, { "Expiration": { "Date": "2016-01-01T00:00:00.000Z" }, "ID": "Delete 2014 logs in 2016.", "Prefix": "logs/2014/", "Status": "Enabled" } ] } The first rule moves files to Amazon Glacier after sixty days. The second rule deletes files from Amazon S3 on the specified date. For information on acceptable timestamp formats, see `Specifying Parameter Values`_ in the *AWS CLI User Guide*. Each rule in the above example specifies a policy (``Transition`` or ``Expiration``) and file prefix (folder name) to which it applies. You can also create a rule that applies to an entire bucket by specifying a blank prefix:: { "Rules": [ { "ID": "Move to Glacier after sixty days (all objects in bucket)", "Prefix": "", "Status": "Enabled", "Transition": { "Days": 60, "StorageClass": "GLACIER" } } ] } .. _`Specifying Parameter Values`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html awscli-1.14.44/awscli/examples/s3api/put-bucket-website.rst0000666454262600001440000000066213243367510024625 0ustar pysdk-ciamazon00000000000000The applies a static website configuration to a bucket named ``my-bucket``:: aws s3api put-bucket-website --bucket my-bucket --website-configuration file://website.json The file ``website.json`` is a JSON document in the current folder that specifies index and error pages for the website:: { "IndexDocument": { "Suffix": "index.html" }, "ErrorDocument": { "Key": "error.html" } } awscli-1.14.44/awscli/examples/s3api/list-buckets.rst0000666454262600001440000000074313243367510023513 0ustar pysdk-ciamazon00000000000000The following command uses the ``list-buckets`` command to display the names of all your Amazon S3 buckets (across all regions):: aws s3api list-buckets --query "Buckets[].Name" The query option filters the output of ``list-buckets`` down to only the bucket names. For more information about buckets, see `Working with Amazon S3 Buckets`_ in the *Amazon S3 Developer Guide*. .. _`Working with Amazon S3 Buckets`: http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html awscli-1.14.44/awscli/examples/s3api/delete-bucket.rst0000666454262600001440000000017613243367510023617 0ustar pysdk-ciamazon00000000000000The following command deletes a bucket named ``my-bucket``:: aws s3api delete-bucket --bucket my-bucket --region us-east-1 awscli-1.14.44/awscli/examples/s3api/put-object.rst0000666454262600001440000000120713243367510023152 0ustar pysdk-ciamazon00000000000000The following example uses the ``put-object`` command to upload an object to Amazon S3:: aws s3api put-object --bucket text-content --key dir-1/my_images.tar.bz2 --body my_images.tar.bz2 The following example shows an upload of a video file (The video file is specified using Windows file system syntax.):: aws s3api put-object --bucket text-content --key dir-1/big-video-file.mp4 --body e:\media\videos\f-sharp-3-data-services.mp4 For more information about uploading objects, see `Uploading Objects`_ in the *Amazon S3 Developer Guide*. .. _`Uploading Objects`: http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html awscli-1.14.44/awscli/examples/s3api/delete-bucket-policy.rst0000666454262600001440000000020713243367510025107 0ustar pysdk-ciamazon00000000000000The following command deletes a bucket policy from a bucket named ``my-bucket``:: aws s3api delete-bucket-policy --bucket my-bucket awscli-1.14.44/awscli/examples/route53/0000777454262600001440000000000013243367512020635 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/route53/list-hosted-zones-by-name.rst0000666454262600001440000000263213243367510026311 0ustar pysdk-ciamazon00000000000000The following command lists up to 100 hosted zones ordered by domain name:: aws route53 list-hosted-zones-by-name Output:: { "HostedZones": [ { "ResourceRecordSetCount": 2, "CallerReference": "test20150527-2", "Config": { "Comment": "test2", "PrivateZone": false }, "Id": "/hostedzone/Z119WBBTVP5WFX", "Name": "2.example.com." }, { "ResourceRecordSetCount": 2, "CallerReference": "test20150527-1", "Config": { "Comment": "test", "PrivateZone": false }, "Id": "/hostedzone/Z3P5QSUBK4POTI", "Name": "www.example.com." } ], "IsTruncated": false, "MaxItems": "100" } The following command lists hosted zones ordered by name, beginning with ``www.example.com``:: aws route53 list-hosted-zones-by-name --dns-name www.example.com Output:: { "HostedZones": [ { "ResourceRecordSetCount": 2, "CallerReference": "mwunderl20150527-1", "Config": { "Comment": "test", "PrivateZone": false }, "Id": "/hostedzone/Z3P5QSUBK4POTI", "Name": "www.example.com." } ], "DNSName": "www.example.com", "IsTruncated": false, "MaxItems": "100" }awscli-1.14.44/awscli/examples/route53/change-tags-for-resource.rst0000666454262600001440000000071313243367510026160 0ustar pysdk-ciamazon00000000000000The following command adds a tag named ``owner`` to a healthcheck resource specified by ID:: aws route53 change-tags-for-resource --resource-type healthcheck --resource-id 6233434j-18c1-34433-ba8e-3443434 --add-tags Key=owner,Value=myboss The following command removes a tag named ``owner`` from a hosted zone resource specified by ID:: aws route53 change-tags-for-resource --resource-type hostedzone --resource-id Z1523434445 --remove-tag-keys owner awscli-1.14.44/awscli/examples/route53/create-health-check.rst0000666454262600001440000000255613243367510025156 0ustar pysdk-ciamazon00000000000000**To create a health check** The following ``create-health-check`` command creates a health check using the caller reference ``2014-04-01-18:47`` and the JSON-formatted configuration in the file ``C:\awscli\route53\create-health-check.json``:: aws route53 create-health-check --caller-reference 2014-04-01-18:47 --health-check-config file://C:\awscli\route53\create-health-check.json JSON syntax:: { "IPAddress": "IP address of the endpoint to check", "Port": port on the endpoint to check--required when Type is "TCP", "Type": "HTTP"|"HTTPS"|"HTTP_STR_MATCH"|"HTTPS_STR_MATCH"|"TCP", "ResourcePath": "path of the file that you want Amazon Route 53 to request--all Types except TCP", "FullyQualifiedDomainName": "domain name of the endpoint to check--all Types except TCP", "SearchString": "if Type is HTTP_STR_MATCH or HTTPS_STR_MATCH, the string to search for in the response body from the specified resource", "RequestInterval": 10 | 30, "FailureThreshold": integer between 1 and 10 } To add the health check to a Route 53 resource record set, use the ``change-resource-record-sets`` command. For more information, see `Amazon Route 53 Health Checks and DNS Failover`_ in the *Amazon Route 53 Developer Guide*. .. _`Amazon Route 53 Health Checks and DNS Failover`: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover.html awscli-1.14.44/awscli/examples/route53/get-health-check.rst0000666454262600001440000000044513243367510024465 0ustar pysdk-ciamazon00000000000000**To get information about a health check** The following ``get-health-check`` command gets information about the health check that has a ``health-check-id`` of ``02ec8401-9879-4259-91fa-04e66d094674``:: aws route53 get-health-check --health-check-id 02ec8401-9879-4259-91fa-04e66d094674 awscli-1.14.44/awscli/examples/route53/delete-hosted-zone.rst0000666454262600001440000000030113243367510025056 0ustar pysdk-ciamazon00000000000000**To delete a hosted zone** The following ``delete-hosted-zone`` command deletes the hosted zone with an ``id`` of ``Z36KTIQEXAMPLE``:: aws route53 delete-hosted-zone --id Z36KTIQEXAMPLE awscli-1.14.44/awscli/examples/route53/create-hosted-zone.rst0000666454262600001440000000113213243367510025062 0ustar pysdk-ciamazon00000000000000**To create a hosted zone** The following ``create-hosted-zone`` command adds a hosted zone named ``example.com`` using the caller reference ``2014-04-01-18:47``. The optional comment includes a space, so it must be enclosed in quotation marks:: aws route53 create-hosted-zone --name example.com --caller-reference 2014-04-01-18:47 --hosted-zone-config Comment="command-line version" For more information, see `Working with Hosted Zones`_ in the *Amazon Route 53 Developer Guide*. .. _`Working with Hosted Zones`: http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/AboutHZWorkingWith.html awscli-1.14.44/awscli/examples/route53/change-resource-record-sets.rst0000666454262600001440000001672113243367510026676 0ustar pysdk-ciamazon00000000000000**To create, update, or delete a resource record set** The following ``change-resource-record-sets`` command creates a resource record set using the ``hosted-zone-id`` ``Z1R8UBAEXAMPLE`` and the JSON-formatted configuration in the file ``C:\awscli\route53\change-resource-record-sets.json``:: aws route53 change-resource-record-sets --hosted-zone-id Z1R8UBAEXAMPLE --change-batch file://C:\awscli\route53\change-resource-record-sets.json For more information, see `POST ChangeResourceRecordSets`_ in the *Amazon Route 53 API Reference*. .. _`POST ChangeResourceRecordSets`: http://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html The configuration in the JSON file depends on the kind of resource record set you want to create: - Basic - Weighted - Alias - Weighted Alias - Latency - Latency Alias - Failover - Failover Alias **Basic Syntax**:: { "Comment": "optional comment about the changes in this change batch request", "Changes": [ { "Action": "CREATE"|"DELETE"|"UPSERT", "ResourceRecordSet": { "Name": "DNS domain name", "Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA", "TTL": time to live in seconds, "ResourceRecords": [ { "Value": "applicable value for the record type" }, {...} ] } }, {...} ] } **Weighted Syntax**:: { "Comment": "optional comment about the changes in this change batch request", "Changes": [ { "Action": "CREATE"|"DELETE"|"UPSERT", "ResourceRecordSet": { "Name": "DNS domain name", "Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA", "SetIdentifier": "unique description for this resource record set", "Weight": value between 0 and 255, "TTL": time to live in seconds, "ResourceRecords": [ { "Value": "applicable value for the record type" }, {...} ], "HealthCheckId": "optional ID of an Amazon Route 53 health check" } }, {...} ] } **Alias Syntax**:: { "Comment": "optional comment about the changes in this change batch request", "Changes": [ { "Action": "CREATE"|"DELETE"|"UPSERT", "ResourceRecordSet": { "Name": "DNS domain name", "Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA", "AliasTarget": { "HostedZoneId": "hosted zone ID for your CloudFront distribution, Amazon S3 bucket, Elastic Load Balancing load balancer, or Amazon Route 53 hosted zone", "DNSName": "DNS domain name for your CloudFront distribution, Amazon S3 bucket, Elastic Load Balancing load balancer, or another resource record set in this hosted zone", "EvaluateTargetHealth": true|false }, "HealthCheckId": "optional ID of an Amazon Route 53 health check" } }, {...} ] } **Weighted Alias Syntax**:: { "Comment": "optional comment about the changes in this change batch request", "Changes": [ { "Action": "CREATE"|"DELETE"|"UPSERT", "ResourceRecordSet": { "Name": "DNS domain name", "Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA", "SetIdentifier": "unique description for this resource record set", "Weight": value between 0 and 255, "AliasTarget": { "HostedZoneId": "hosted zone ID for your CloudFront distribution, Amazon S3 bucket, Elastic Load Balancing load balancer, or Amazon Route 53 hosted zone", "DNSName": "DNS domain name for your CloudFront distribution, Amazon S3 bucket, Elastic Load Balancing load balancer, or another resource record set in this hosted zone", "EvaluateTargetHealth": true|false }, "HealthCheckId": "optional ID of an Amazon Route 53 health check" } }, {...} ] } **Latency Syntax**:: { "Comment": "optional comment about the changes in this change batch request", "Changes": [ { "Action": "CREATE"|"DELETE"|"UPSERT", "ResourceRecordSet": { "Name": "DNS domain name", "Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA", "SetIdentifier": "unique description for this resource record set", "Region": "Amazon EC2 region name", "TTL": time to live in seconds, "ResourceRecords": [ { "Value": "applicable value for the record type" }, {...} ], "HealthCheckId": "optional ID of an Amazon Route 53 health check" } }, {...} ] } **Latency Alias Syntax**:: { "Comment": "optional comment about the changes in this change batch request", "Changes": [ { "Action": "CREATE"|"DELETE"|"UPSERT", "ResourceRecordSet": { "Name": "DNS domain name", "Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA", "SetIdentifier": "unique description for this resource record set", "Region": "Amazon EC2 region name", "AliasTarget": { "HostedZoneId": "hosted zone ID for your CloudFront distribution, Amazon S3 bucket, Elastic Load Balancing load balancer, or Amazon Route 53 hosted zone", "DNSName": "DNS domain name for your CloudFront distribution, Amazon S3 bucket, Elastic Load Balancing load balancer, or another resource record set in this hosted zone", "EvaluateTargetHealth": true|false }, "HealthCheckId": "optional ID of an Amazon Route 53 health check" } }, {...} ] } **Failover Syntax**:: { "Comment": "optional comment about the changes in this change batch request", "Changes": [ { "Action": "CREATE"|"DELETE"|"UPSERT", "ResourceRecordSet": { "Name": "DNS domain name", "Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA", "SetIdentifier": "unique description for this resource record set", "Failover": "PRIMARY" | "SECONDARY", "TTL": time to live in seconds, "ResourceRecords": [ { "Value": "applicable value for the record type" }, {...} ], "HealthCheckId": "ID of an Amazon Route 53 health check" } }, {...} ] } **Failover Alias Syntax**:: { "Comment": "optional comment about the changes in this change batch request", "Changes": [ { "Action": "CREATE"|"DELETE"|"UPSERT", "ResourceRecordSet": { "Name": "DNS domain name", "Type": "SOA"|"A"|"TXT"|"NS"|"CNAME"|"MX"|"PTR"|"SRV"|"SPF"|"AAAA", "SetIdentifier": "unique description for this resource record set", "Failover": "PRIMARY" | "SECONDARY", "AliasTarget": { "HostedZoneId": "hosted zone ID for your CloudFront distribution, Amazon S3 bucket, Elastic Load Balancing load balancer, or Amazon Route 53 hosted zone", "DNSName": "DNS domain name for your CloudFront distribution, Amazon S3 bucket, Elastic Load Balancing load balancer, or another resource record set in this hosted zone", "EvaluateTargetHealth": true|false }, "HealthCheckId": "optional ID of an Amazon Route 53 health check" } }, {...} ] } awscli-1.14.44/awscli/examples/route53/list-hosted-zones.rst0000666454262600001440000000142513243367510024762 0ustar pysdk-ciamazon00000000000000**To list the hosted zones associated with the current AWS account** The following ``list-hosted-zones`` command lists summary information about the first 100 hosted zones that are associated with the current AWS account.:: aws route53 list-hosted-zones If you have more than 100 hosted zones, or if you want to list them in groups smaller than 100, include the ``--maxitems`` parameter. For example, to list hosted zones one at a time, use the following command:: aws route53 list-hosted-zones --max-items 1 To view information about the next hosted zone, take the value of ``NextToken`` from the response to the previous command, and include it in the ``--starting-token`` parameter, for example:: aws route53 list-hosted-zones --max-items 1 --starting-token Z3M3LMPEXAMPLE awscli-1.14.44/awscli/examples/route53/get-change.rst0000666454262600001440000000044013243367510023365 0ustar pysdk-ciamazon00000000000000**To get the status of a change to resource record sets** The following ``get-change`` command gets the status and other information about the ``change-resource-record-sets`` request that has an ``Id`` of ``/change/CWPIK4URU2I5S``:: aws route53 get-change --id /change/CWPIK4URU2I5S awscli-1.14.44/awscli/examples/route53/list-health-checks.rst0000666454262600001440000000141613243367510025043 0ustar pysdk-ciamazon00000000000000**To list the health checks associated with the current AWS account** The following ``list-health-checks`` command lists detailed information about the first 100 health checks that are associated with the current AWS account.:: aws route53 list-health-checks If you have more than 100 health checks, or if you want to list them in groups smaller than 100, include the ``--maxitems`` parameter. For example, to list health checks one at a time, use the following command:: aws route53 list-health-checks --max-items 1 To view the next health check, take the value of ``NextToken`` from the response to the previous command, and include it in the ``--starting-token`` parameter, for example:: aws route53 list-health-checks --max-items 1 --starting-token Z3M3LMPEXAMPLE awscli-1.14.44/awscli/examples/route53/delete-health-check.rst0000666454262600001440000000041013243367510025140 0ustar pysdk-ciamazon00000000000000**To delete a health check** The following ``delete-health-check`` command deletes the health check with a ``health-check-id`` of ``e75b48d9-547a-4c3d-88a5-ae4002397608``:: aws route53 delete-health-check --health-check-id e75b48d9-547a-4c3d-88a5-ae4002397608 awscli-1.14.44/awscli/examples/route53/list-resource-record-sets.rst0000666454262600001440000000226113243367510026416 0ustar pysdk-ciamazon00000000000000**To list the resource record sets in a hosted zone** The following ``list-resource-record-sets`` command lists summary information about the first 100 resource record sets in a specified hosted zone.:: aws route53 list-resource-record-sets --hosted-zone-id Z2LD58HEXAMPLE If the hosted zone contains more than 100 resource record sets, or if you want to list them in groups smaller than 100, include the ``--maxitems`` parameter. For example, to list resource record sets one at a time, use the following command:: aws route53 list-resource-record-sets --hosted-zone-id Z2LD58HEXAMPLE --max-items 1 To view information about the next resource record set in the hosted zone, take the value of ``NextToken`` from the response to the previous command, and include it in the ``--starting-token`` parameter, for example:: aws route53 list-resource-record-sets --hosted-zone-id Z2LD58HEXAMPLE --max-items 1 --starting-token Z3M3LMPEXAMPLE To view all the resource record sets of a particular name, use the ``--query`` parameter to filter them out. For example:: aws route53 list-resource-record-sets --hosted-zone-id Z2LD58HEXAMPLE --query "ResourceRecordSets[?Name == 'example.domain.']" awscli-1.14.44/awscli/examples/route53/get-hosted-zone.rst0000666454262600001440000000032713243367510024403 0ustar pysdk-ciamazon00000000000000**To get information about a hosted zone** The following ``get-hosted-zone`` command gets information about the hosted zone with an ``id`` of ``Z1R8UBAEXAMPLE``:: aws route53 get-hosted-zone --id Z1R8UBAEXAMPLE awscli-1.14.44/awscli/examples/organizations/0000777454262600001440000000000013243367512022216 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/organizations/delete-organization.rst0000777454262600001440000000052113243367510026713 0ustar pysdk-ciamazon00000000000000**To delete an organization** The following example shows how to delete an organization. To perform this operation, you must be an admin of the master account in the organization. The example assumes that you previously removed all the member accounts, OUs, and policies from the organization: :: aws organizations delete-organizationawscli-1.14.44/awscli/examples/organizations/disable-policy-type.rst0000777454262600001440000000102313243367510026624 0ustar pysdk-ciamazon00000000000000**To disable a policy type in a root** The following example shows how to disable the service control policy (SCP) policy type in a root: :: aws organizations disable-policy-type --root-id r-examplerootid111 --policy-type SERVICE_CONTROL_POLICY The output shows that the PolicyTypes response element no longer includes SERVICE_CONTROL_POLICY: :: { "Root": { "PolicyTypes": [], "Name": "Root", "Id": "r-examplerootid111", "Arn": "arn:aws:organizations::111111111111:root/o-exampleorgid/r-examplerootid111" } }awscli-1.14.44/awscli/examples/organizations/describe-organizational-unit.rst0000777454262600001440000000101113243367510030516 0ustar pysdk-ciamazon00000000000000**To get information about an OU** The following example shows how to request details about an OU: :: aws organizations describe-organizational-unit --organizational-unit-id ou-examplerootid111-exampleouid111 The output includes an OrganizationUnit object that contains the details about the OU: :: { "OrganizationalUnit": { "Name": "Accounting Group", "Arn": "arn:aws:organizations::o-exampleorgid:ou/o-exampleorgid/ou-examplerootid111-exampleouid111", "Id": "ou-examplerootid111-exampleouid111" } }awscli-1.14.44/awscli/examples/organizations/cancel-handshake.rst0000777454262600001440000000266613243367510026134 0ustar pysdk-ciamazon00000000000000**To cancel a handshake sent from another account** Bill previously sent an invitation to Susan's account to join his organization. He changes his mind and decides to cancel the invitation before Susan accepts it. The following example shows Bill's cancellation: :: aws organizations cancel-handshake --handshake-id h-examplehandshakeid111 The output includes a handshake object that shows that the state is now ``CANCELED``: :: { "Handshake": { "Id": "h-examplehandshakeid111", "State":"CANCELED", "Action": "INVITE", "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111", "Parties": [ { "Id": "o-exampleorgid", "Type": "ORGANIZATION" }, { "Id": "susan@example.com", "Type": "EMAIL" } ], "Resources": [ { "Type": "ORGANIZATION", "Value": "o-exampleorgid", "Resources": [ { "Type": "MASTER_EMAIL", "Value": "bill@example.com" }, { "Type": "MASTER_NAME", "Value": "Master Account" }, { "Type": "ORGANIZATION_FEATURE_SET", "Value": "CONSOLIDATED_BILLING" } ] }, { "Type": "EMAIL", "Value": "anika@example.com" }, { "Type": "NOTES", "Value": "This is a request for Susan's account to join Bob's organization." } ], "RequestedTimestamp": 1.47008383521E9, "ExpirationTimestamp": 1.47137983521E9 } }awscli-1.14.44/awscli/examples/organizations/create-account.rst0000777454262600001440000000266013243367510025652 0ustar pysdk-ciamazon00000000000000**To create a member account that is automatically part of the organization** The following example shows how to create a member account in an organization. The member account is configured with the name Production Account and the email address of susan@example.com. Organizations automatically creates an IAM role using the default name of OrganizationAccountAccessRole because the roleName parameter is not specified. Also, the setting that allows IAM users or roles with sufficient permissions to access account billing data is set to the default value of ALLOW because the IamUserAccessToBilling parameter is not specified. Organizations automatically sends Susan a "Welcome to AWS" email: :: aws organizations create-account --email susan@example.com --account-name "Production Account" The output includes a request object that shows that the status is now ``IN_PROGRESS``: :: { "CreateAccountStatus": { "State": "IN_PROGRESS", "Id": "car-examplecreateaccountrequestid111" } } You can later query the current status of the request by providing the Id response value to the describe-create-account-status command as the value for the create-account-request-id parameter. For more information, see `Creating an AWS Account in Your Organization`_ in the *AWS Organizations Users Guide*. .. _`Creating an AWS Account in Your Organization`: http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html awscli-1.14.44/awscli/examples/organizations/remove-account-from-organization.rst0000777454262600001440000000032313243367510031341 0ustar pysdk-ciamazon00000000000000**To remove an account from an organization as the master account** The following example shows you how to remove an account from an organization: :: aws organizations remove-account --account-id 333333333333awscli-1.14.44/awscli/examples/organizations/create-organization.rst0000777454262600001440000000357413243367510026727 0ustar pysdk-ciamazon00000000000000**Example 1: To create a new organization** Bill wants to create an organization using credentials from account 111111111111. The following example shows that the account becomes the master account in the new organization. Because he does not specify a features set, the new organization defaults to all features enabled and service control policies are enabled on the root. :: aws organizations create-organization The output includes an organization object with details about the new organization: :: { "Organization": { "AvailablePolicyTypes": [ { "Status": "ENABLED", "Type": "SERVICE_CONTROL_POLICY" } ], "MasterAccountId": "111111111111", "MasterAccountArn": "arn:aws:organizations::111111111111:account/o-exampleorgid/111111111111", "MasterAccountEmail": "bill@example.com", "FeatureSet": "ALL", "Id": "o-exampleorgid", "Arn": "arn:aws:organizations::111111111111:organization/o-exampleorgid" } } **Example 2: To create a new organization with only consolidated billing features enabled** The following example creates an organization that supports only the consolidated billing features: :: aws organizations create-organization --feature-set CONSOLIDATED_BILLING The output includes an organization object with details about the new organization: :: { "Organization": { "Arn": "arn:aws:organizations::111111111111:organization/o-exampleorgid", "AvailablePolicyTypes": [], "Id": "o-exampleorgid", "MasterAccountArn": "arn:aws:organizations::111111111111:account/o-exampleorgid/111111111111", "MasterAccountEmail": "bill@example.com", "MasterAccountId": "111111111111", "FeatureSet": "CONSOLIDATED_BILLING" } } For more information, see `Creating an Organization`_ in the *AWS Organizations Users Guide*. .. _`Creating an Organization`: http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html awscli-1.14.44/awscli/examples/organizations/list-children.rst0000777454262600001440000000106213243367510025511 0ustar pysdk-ciamazon00000000000000**To retrieve the child accounts and OUs of a parent OU or root** The following example you how to list the root or OU that contains that account 444444444444: :: aws organizations list-children --child-type ORGANIZATIONAL_UNIT --parent-id ou-examplerootid111-exampleouid111 The output shows the two child OUs that are contained by the parent: :: { "Children": [ { "Id": "ou-examplerootid111-exampleouid111", "Type":"ORGANIZATIONAL_UNIT" }, { "Id":"ou-examplerootid111-exampleouid222", "Type":"ORGANIZATIONAL_UNIT" } ] }awscli-1.14.44/awscli/examples/organizations/list-handshakes-for-organization.rst0000777454262600001440000000461713243367510031331 0ustar pysdk-ciamazon00000000000000**To retrieve a list of the handshakes associated with an organization** The following example shows how to get a list of handshakes that are associated with the current organization: :: aws organizations list-handshakes-for-organization The output shows two handshakes. The first one is an invitation to Juan's account and shows a state of OPEN. The second is an invitation to Anika's account and shows a state of ACCEPTED: :: { "Handshakes": [ { "Action": "INVITE", "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111", "ExpirationTimestamp": 1482952459.257, "Id": "h-examplehandshakeid111", "Parties": [ { "Id": "o-exampleorgid", "Type": "ORGANIZATION" }, { "Id": "juan@example.com", "Type": "EMAIL" } ], "RequestedTimestamp": 1481656459.257, "Resources": [ { "Resources": [ { "Type": "MASTER_EMAIL", "Value": "bill@amazon.com" }, { "Type": "MASTER_NAME", "Value": "Org Master Account" }, { "Type": "ORGANIZATION_FEATURE_SET", "Value": "FULL" } ], "Type": "ORGANIZATION", "Value": "o-exampleorgid" }, { "Type": "EMAIL", "Value": "juan@example.com" }, { "Type":"NOTES", "Value":"This is an invitation to Juan's account to join Bill's organization." } ], "State": "OPEN" }, { "Action": "INVITE", "State":"ACCEPTED", "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111", "ExpirationTimestamp": 1.471797437427E9, "Id": "h-examplehandshakeid222", "Parties": [ { "Id": "o-exampleorgid", "Type": "ORGANIZATION" }, { "Id": "anika@example.com", "Type": "EMAIL" } ], "RequestedTimestamp": 1.469205437427E9, "Resources": [ { "Resources": [ { "Type":"MASTER_EMAIL", "Value":"bill@example.com" }, { "Type":"MASTER_NAME", "Value":"Master Account" } ], "Type":"ORGANIZATION", "Value":"o-exampleorgid" }, { "Type":"EMAIL", "Value":"anika@example.com" }, { "Type":"NOTES", "Value":"This is an invitation to Anika's account to join Bill's organization." } ] } ] }awscli-1.14.44/awscli/examples/organizations/list-accounts.rst0000777454262600001440000000257313243367510025550 0ustar pysdk-ciamazon00000000000000**To retrieve a list of all of the accounts in an organization** The following example shows you how to request a list of the accounts in an organization: :: aws organizations list-accounts The output includes a list of account summary objects. :: { "Accounts": [ { "Arn": "arn:aws:organizations::111111111111:account/o-exampleorgid/111111111111", "JoinedMethod": "INVITED", "JoinedTimestamp": 1481830215.45, "Id": "111111111111", "Name": "Master Account", "Email": "bill@example.com", "Status": "ACTIVE" }, { "Arn": "arn:aws:organizations::111111111111:account/o-exampleorgid/222222222222", "JoinedMethod": "INVITED", "JoinedTimestamp": 1481835741.044, "Id": "222222222222", "Name": "Production Account", "Email": "alice@example.com", "Status": "ACTIVE" }, { "Arn": "arn:aws:organizations::111111111111:account/o-exampleorgid/333333333333", "JoinedMethod": "INVITED", "JoinedTimestamp": 1481835795.536, "Id": "333333333333", "Name": "Development Account", "Email": "juan@example.com", "Status": "ACTIVE" }, { "Arn": "arn:aws:organizations::111111111111:account/o-exampleorgid/444444444444", "JoinedMethod": "INVITED", "JoinedTimestamp": 1481835812.143, "Id": "444444444444", "Name": "Test Account", "Email": "anika@example.com", "Status": "ACTIVE" } ] }awscli-1.14.44/awscli/examples/organizations/list-targets-for-policy.rst0000777454262600001440000000201313243367510027450 0ustar pysdk-ciamazon00000000000000**To retrieve a list of the roots, OUs, and accounts that a policy is attached to** The following example shows how to get a list of the roots, OUs, and accounts that the specified policy is attached to: :: aws organizations list-targets-for-policy --policy-id p-FullAWSAccess The output includes a list of attachment objects with summary information about the roots, OUs, and accounts the policy is attached to: :: { "Targets": [ { "Arn": "arn:aws:organizations::111111111111:root/o-exampleorgid/r-examplerootid111", "Name": "Root", "TargetId":"r-examplerootid111", "Type":"ROOT" }, { "Arn": "arn:aws:organizations::111111111111:account/o-exampleorgid/333333333333;", "Name": "Developer Test Account", "TargetId": "333333333333", "Type": "ACCOUNT" }, { "Arn":"arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111", "Name":"Accounting", "TargetId":"ou-examplerootid111-exampleouid111", "Type":"ORGANIZATIONAL_UNIT" } ] }awscli-1.14.44/awscli/examples/organizations/leave-organization.rst0000777454262600001440000000034013243367510026544 0ustar pysdk-ciamazon00000000000000 **To leave an organization as a member account** The following example shows the administrator of a member account requesting to leave the organization it is currently a member of: :: aws organizations leave-organizationawscli-1.14.44/awscli/examples/organizations/describe-organization.rst0000777454262600001440000000132013243367510027227 0ustar pysdk-ciamazon00000000000000**To get information about the current organization** The following example shows you how to request details about an organization: :: aws organizations describe-organization The output includes an organization object that has the details about the organization: :: { "Organization": { "MasterAccountArn": "arn:aws:organizations::111111111111:account/o-exampleorgid/111111111111", "MasterAccountEmail": "bill@example.com", "MasterAccountId": "111111111111", "Id": "o-exampleorgid", "FeatureSet": "ALL", "Arn": "arn:aws:organizations::111111111111:organization/o-exampleorgid", "AvailablePolicyTypes": [ { "Status": "ENABLED", "Type": "SERVICE_CONTROL_POLICY" } ] } }awscli-1.14.44/awscli/examples/organizations/list-create-account-status.rst0000777454262600001440000000234213243367510030141 0ustar pysdk-ciamazon00000000000000**Example 1: To retrieve a list of the account creation requests made in the current organization** The following example shows how to request a list of account creation requests for an organization that have completed successfully: :: aws organizations list-create-account-status --states SUCCEEDED The output includes an array of objects with information about each request. :: { "CreateAccountStatuses": [ { "AccountId": "444444444444", "AccountName": "Developer Test Account", "CompletedTimeStamp": 1481835812.143, "Id": "car-examplecreateaccountrequestid111", "RequestedTimeStamp": 1481829432.531, "State": "SUCCEEDED" } ] } **Example 2: To retrieve a list of the in progress account creation requests made in the current organization** The following example gets a list of in-progress account creation requests for an organization: :: aws organizations list-create-account-status --states IN_PROGRESS The output includes an array of objects with information about each request. :: { "CreateAccountStatuses": [ { "State": "IN_PROGRESS", "Id": "car-examplecreateaccountrequestid111", "RequestedTimeStamp": 1481829432.531, "AccountName": "Production Account" } ] }awscli-1.14.44/awscli/examples/organizations/update-organizational-unit.rst0000777454262600001440000000075513243367510030236 0ustar pysdk-ciamazon00000000000000**To rename an OU** This example shows you how to rename an OU: In this example, the OU is renamed "AccountingOU": :: aws organizations update-organizational-unit --organizational-unit-id ou-examplerootid111-exampleouid111 --name AccountingOU The output shows the new name: :: { "OrganizationalUnit": { "Id": "ou-examplerootid111-exampleouid111" "Name": "AccountingOU", "Arn": "arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111"" } }awscli-1.14.44/awscli/examples/organizations/list-policies-for-target.rst0000777454262600001440000000167413243367510027611 0ustar pysdk-ciamazon00000000000000**To retrieve a list of the SCPs attached directly to an account** The following example shows how to get a list of all service control policies (SCPs), as specified by the Filter parameter, that are directly attached to an account: :: aws organizations list-policies-for-target --filter SERVICE_CONTROL_POLICY --target-id 444444444444 The output includes a list of policy structures with summary information about the policies. The list does not include policies that apply to the account because of inheritance from its location in an OU hierarchy: :: { "Policies": [ { "Type": "SERVICE_CONTROL_POLICY", "Name": "AllowAllEC2Actions", "AwsManaged", false, "Id": "p-examplepolicyid222", "Arn": "arn:aws:organizations::o-exampleorgid:policy/service_control_policy/p-examplepolicyid222", "Description": "Enables account admins to delegate permissions for any EC2 actions to users and roles in their accounts." } ] }awscli-1.14.44/awscli/examples/organizations/invite-account-to-organization.rst0000777454262600001440000000252713243367510031031 0ustar pysdk-ciamazon00000000000000**To invite an account to join an organization** The following example shows the master account owned by bill@example.com inviting the account owned by juan@example.com to join an organization: :: aws organizations invite-account-to-organization --target '{"Type": "EMAIL", "Id": "juan@example.com"}' --notes "This is a request for Juan's account to join Bill's organization." The output includes a handshake structure that shows what is sent to the invited account: :: { "Handshake": { "Action": "INVITE", "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111", "ExpirationTimestamp": 1482952459.257, "Id": "h-examplehandshakeid111", "Parties": [ { "Id": "o-exampleorgid", "Type": "ORGANIZATION" }, { "Id": "juan@example.com", "Type": "EMAIL" } ], "RequestedTimestamp": 1481656459.257, "Resources": [ { "Resources": [ { "Type": "MASTER_EMAIL", "Value": "bill@amazon.com" }, { "Type": "MASTER_NAME", "Value": "Org Master Account" }, { "Type": "ORGANIZATION_FEATURE_SET", "Value": "FULL" } ], "Type": "ORGANIZATION", "Value": "o-exampleorgid" }, { "Type": "EMAIL", "Value": "juan@example.com" } ], "State": "OPEN" } }awscli-1.14.44/awscli/examples/organizations/create-organizational-unit.rst0000777454262600001440000000100513243367510030204 0ustar pysdk-ciamazon00000000000000**To create an OU in a root or parent OU** The following example shows how to create an OU that is named AccountingOU: :: aws organizations create-organizational-unit --parent-id r-examplerootid111 --name AccountingOU The output includes an organizationalUnit object with details about the new OU: :: { "OrganizationalUnit": { "Id": "ou-examplerootid111-exampleouid111", "Arn": "arn:aws:organizations::111111111111:ou/o-exampleorgid/ou-examplerootid111-exampleouid111", "Name": "AccountingOU" } }awscli-1.14.44/awscli/examples/organizations/describe-create-account-status.rst0000777454262600001440000000147713243367510030756 0ustar pysdk-ciamazon00000000000000**To get the latest status about a request to create an account** The following example shows how to request the latest status for a previous request to create an account in an organization. The specified --request-id comes from the response of the original call to create-account. The account creation request shows by the status field that Organizations successfully completed the creation of the account. Command:: aws organizations describe-create-account-status --create-account-request-id car-examplecreateaccountrequestid111 Output:: { "CreateAccountStatus": { "State": "SUCCEEDED", "AccountId": "555555555555", "AccountName": "Beta account", "RequestedTimestamp": 1470684478.687, "CompletedTimestamp": 1470684532.472, "Id": "car-examplecreateaccountrequestid111" } } awscli-1.14.44/awscli/examples/organizations/update-policy.rst0000777454262600001440000000333513243367510025534 0ustar pysdk-ciamazon00000000000000**Example 1: To rename a policy** The following example shows you how to rename a policy and give it a new description: :: aws organizations update-policy --policy-id p-examplepolicyid111 --name Renamed-Policy --description "This description replaces the original." The output shows the new name and description: :: { "Policy": { "Content": "{\n \"Version\":\"2012-10-17\",\n \"Statement\":{\n \"Effect\":\"Allow\",\n \"Action\":\"ec2:*\",\n \"Resource\":\"*\"\n }\n}\n", "PolicySummary": { "Id": "p-examplepolicyid111", "AwsManaged": false, "Arn":"arn:aws:organizations::111111111111:policy/o-exampleorgid/service_control_policy/p-examplepolicyid111", "Description": "This description replaces the original.", "Name": "Renamed-Policy", "Type": "SERVICE_CONTROL_POLICY" } } } **Example 2: To replace a policy's JSON text content** The following example shows you how to replace the JSON text of the SCP in the previous example with a new JSON policy text string that allows S3 instead of EC2: :: aws organizations --policy-id p-examplepolicyid111, --content "{\"Version\":\"2012-10-17\",\"Statement\":{\"Effect\":\"Allow\",\"Action\":\"s3:*\",\"Resource\":\"*\"}}" The output shows the new content: :: { "Policy": { "Content": "{ \"Version\": \"2012-10-17\", \"Statement\": { \"Effect\": \"Allow\", \"Action\": \"s3:*\", \"Resource\": \"*\" } }", "PolicySummary": { "Arn": "arn:aws:organizations::111111111111:policy/o-exampleorgid/service_control_policy/p-examplepolicyid111", "AwsManaged": false; "Description": "This description replaces the original.", "Id": "p-examplepolicyid111", "Name": "Renamed-Policy", "Type": "SERVICE_CONTROL_POLICY" } } }awscli-1.14.44/awscli/examples/organizations/list-organizational-units-for-parent.rst0000777454262600001440000000123013243367510032152 0ustar pysdk-ciamazon00000000000000**To retrieve a list of the OUs in a parent OU or root** The following example shows you how to get a list of OUs in a specified root: :: aws organizations list-organizational-units-for-parent --parent-id r-examplerootid111 The output shows that the specified root contains two OUs and shows details of each: :: { "OrganizationalUnits": [ { "Name": "AccountingDepartment", "Arn": "arn:aws:organizations::o-exampleorgid:ou/r-examplerootid111/ou-examplerootid111-exampleouid111" }, { "Name": "ProductionDepartment", "Arn": "arn:aws:organizations::o-exampleorgid:ou/r-examplerootid111/ou-examplerootid111-exampleouid222" } ] }awscli-1.14.44/awscli/examples/organizations/list-accounts-for-parent.rst0000777454262600001440000000160313243367510027614 0ustar pysdk-ciamazon00000000000000**To retrieve a list of all of the accounts in a specified parent root or OU** The following example shows how to request a list of the accounts in an OU: :: aws organizations list-accounts-for-parent --parent-id ou-examplerootid111-exampleouid111 The output includes a list of account summary objects. :: { "Accounts": [ { "Arn": "arn:aws:organizations::111111111111:account/o-exampleorgid/333333333333", "JoinedMethod": "INVITED", "JoinedTimestamp": 1481835795.536, "Id": "333333333333", "Name": "Development Account", "Email": "juan@example.com", "Status": "ACTIVE" }, { "Arn": "arn:aws:organizations::111111111111:account/o-exampleorgid/444444444444", "JoinedMethod": "INVITED", "JoinedTimestamp": 1481835812.143, "Id": "444444444444", "Name": "Test Account", "Email": "anika@example.com", "Status": "ACTIVE" } ] }awscli-1.14.44/awscli/examples/organizations/enable-all-features.rst0000777454262600001440000000235613243367510026567 0ustar pysdk-ciamazon00000000000000**To enable all features in an organization** This example shows the administrator asking all the invited accounts in the organization to approve enabled all features in the organization. AWS Organizations sends an email to the address that is registered with every invited member account asking the owner to approve the change to all features by accepting the handshake that is sent. After all invited member accounts accept the handshake, the organization administrator can finalize the change to all features, and those with appropriate permissions can create policies and apply them to roots, OUs, and accounts: :: aws organizations enable-all-features The output is a handshake object that is sent to all invited member accounts for approval: :: { "Handshake": { "Action": "ENABLE_ALL_FEATURES", "Arn":"arn:aws:organizations::111111111111:handshake/o-exampleorgid/enable_all_features/h-examplehandshakeid111", "ExpirationTimestamp":1.483127868609E9, "Id":"h-examplehandshakeid111", "Parties": [ { "id":"o-exampleorgid", "type":"ORGANIZATION" } ], "requestedTimestamp":1.481831868609E9, "resources": [ { "type":"ORGANIZATION", "value":"o-exampleorgid" } ], "state":"REQUESTED" } }awscli-1.14.44/awscli/examples/organizations/decline-handshake.rst0000777454262600001440000000256413243367510026307 0ustar pysdk-ciamazon00000000000000**To decline a handshake sent from another account** The following example shows that Susan, an admin who is the owner of account 222222222222, declines an invitation to join Bill's organization. The DeclineHandshake operation returns a handshake object, showing that the state is now DECLINED: :: aws organizations decline-handshake --handshake-id h-examplehandshakeid111 The output includes a handshake object that shows the new state of ``DECLINED``: :: { "Handshake": { "Id": "h-examplehandshakeid111", "State": "DECLINED", "Resources": [ { "Type": "ORGANIZATION", "Value": "o-exampleorgid", "Resources": [ { "Type": "MASTER_EMAIL", "Value": "bill@example.com" }, { "Type": "MASTER_NAME", "Value": "Master Account" } ] }, { "Type": "EMAIL", "Value": "susan@example.com" }, { "Type": "NOTES", "Value": "This is an invitation to Susan's account to join the Bill's organization." } ], "Parties": [ { "Type": "EMAIL", "Id": "susan@example.com" }, { "Type": "ORGANIZATION", "Id": "o-exampleorgid" } ], "Action": "INVITE", "RequestedTimestamp": 1470684478.687, "ExpirationTimestamp": 1471980478.687, "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111" } }awscli-1.14.44/awscli/examples/organizations/describe-handshake.rst0000777454262600001440000000237513243367510026464 0ustar pysdk-ciamazon00000000000000**To get information about a handshake** The following example shows you how to request details about a handshake. The handshake ID comes either from the original call to ``InviteAccountToOrganization``, or from a call to ``ListHandshakesForAccount`` or ``ListHandshakesForOrganization``: :: aws organizations describe-handshake --handshake-id h-examplehandshakeid111 The output includes a handshake object that has all the details about the requested handshake: :: { "Handshake": { "Id": "h-examplehandshakeid111", "State": "OPEN", "Resources": [ { "Type": "ORGANIZATION", "Value": "o-exampleorgid", "Resources": [ { "Type": "MASTER_EMAIL", "Value": "bill@example.com" }, { "Type": "MASTER_NAME", "Value": "Master Account" } ] }, { "Type": "EMAIL", "Value": "anika@example.com" } ], "Parties": [ { "Type": "ORGANIZATION", "Id": "o-exampleorgid" }, { "Type": "EMAIL", "Id": "anika@example.com" } ], "Action": "INVITE", "RequestedTimestamp": 1470158698.046, "ExpirationTimestamp": 1471454698.046, "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111" } }awscli-1.14.44/awscli/examples/organizations/delete-policy.rst0000777454262600001440000000036513243367510025514 0ustar pysdk-ciamazon00000000000000**To delete a policy** The following example shows how to delete a policy from an organization. The example assumes that you previously detached the policy from all entities: :: aws organizations delete-policy --policy-id p-examplepolicyid111awscli-1.14.44/awscli/examples/organizations/move-account.rst0000777454262600001440000000046613243367510025357 0ustar pysdk-ciamazon00000000000000**To move an account between roots or OUs** The following example shows you how to move the master account in the organization from the root to an OU: :: aws organizations move-account --account-id 333333333333 --source-parent-id r-examplerootid111 --destination-parent-id ou-examplerootid111-exampleouid111awscli-1.14.44/awscli/examples/organizations/list-roots.rst0000777454262600001440000000101113243367510025061 0ustar pysdk-ciamazon00000000000000**To retrieve a list of the roots in an organization** This example shows you how to get the list of roots for an organization: :: aws organizations list-roots The output includes a list of root structures with summary information: :: { "Roots": [ { "Name": "Root", "Arn": "arn:aws:organizations::111111111111:root/o-exampleorgid/r-examplerootid111", "Id": "r-examplerootid111", "PolicyTypes": [ { "Status":"ENABLED", "Type":"SERVICE_CONTROL_POLICY" } ] } ] }awscli-1.14.44/awscli/examples/organizations/create-policy.rst0000777454262600001440000000350713243367510025516 0ustar pysdk-ciamazon00000000000000**Example 1: To create a policy with a text source file for the JSON policy** The following example shows you how to create an service control policy (SCP) named ``AllowAllS3Actions``. The policy contents are taken from a file on the local computer called ``policy.json``. :: aws organizations create-policy --content file://policy.json --name AllowAllS3Actions, --type SERVICE_CONTROL_POLICY --description "Allows delegation of all S3 actions" The output includes a policy object with details about the new policy: :: { "Policy": { "Content": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"s3:*\"],\"Resource\":[\"*\"]}]}", "PolicySummary": { "Arn": "arn:aws:organizations::o-exampleorgid:policy/service_control_policy/p-examplepolicyid111", "Description": "Allows delegation of all S3 actions", "Name": "AllowAllS3Actions", "Type":"SERVICE_CONTROL_POLICY" } } } **Example 2: To create a policy with a JSON policy as a parameter** The following example shows you how to create the same SCP, this time by embedding the policy contents as a JSON string in the parameter. The string must be escaped with backslashes before the double quotes to ensure that they are treated as literals in the parameter, which itself is surrounded by double quotes: :: aws organizations create-policy --content "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"s3:*\"],\"Resource\":[\"*\"]}]}" --name AllowAllS3Actions --type SERVICE_CONTROL_POLICY --description "Allows delegation of all S3 actions" For more information about creating and using policies in your organization, see `Managing Organization Policies`_ in the *AWS Organizations User Guide*. .. _`Managing Organization Policies`: http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.htmlawscli-1.14.44/awscli/examples/organizations/list-parents.rst0000777454262600001440000000065113243367510025400 0ustar pysdk-ciamazon00000000000000**To list the parent OUs or roots for an account or child OU** The following example you how to list the root or parent OU that contains that account 444444444444: :: aws organizations list-parents --child-id 444444444444 The output shows that the specified account is in the OU with specified ID: :: { "Parents": [ { "Id": "ou-examplerootid111-exampleouid111", "Type": "ORGANIZATIONAL_UNIT" } ] }awscli-1.14.44/awscli/examples/organizations/list-handshakes-for-account.rst0000777454262600001440000000240413243367510030251 0ustar pysdk-ciamazon00000000000000**To retrieve a list of the handshakes sent to an account** The following example shows how to get a list of all handshakes that are associated with the account of the credentials that were used to call the operation: :: aws organizations list-handshakes-for-account The output includes a list of handshake structures with information about each handshake including its current state: :: { "Handshake": { "Action": "INVITE", "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111", "ExpirationTimestamp": 1482952459.257, "Id": "h-examplehandshakeid111", "Parties": [ { "Id": "o-exampleorgid", "Type": "ORGANIZATION" }, { "Id": "juan@example.com", "Type": "EMAIL" } ], "RequestedTimestamp": 1481656459.257, "Resources": [ { "Resources": [ { "Type": "MASTER_EMAIL", "Value": "bill@amazon.com" }, { "Type": "MASTER_NAME", "Value": "Org Master Account" }, { "Type": "ORGANIZATION_FEATURE_SET", "Value": "FULL" } ], "Type": "ORGANIZATION", "Value": "o-exampleorgid" }, { "Type": "EMAIL", "Value": "juan@example.com" } ], "State": "OPEN" } }awscli-1.14.44/awscli/examples/organizations/enable-policy-type.rst0000777454262600001440000000115713243367510026457 0ustar pysdk-ciamazon00000000000000**To enable the use of a policy type in a root** The following example shows how to enable the service control policy (SCP) policy type in a root: :: aws organizations enable-policy-type --root-id r-examplerootid111 --policy-type SERVICE_CONTROL_POLICY The output shows a root object with a policyTypes response element showing that SCPs are now enabled: :: { "Root": { "PolicyTypes": [ { "Status":"ENABLED", "Type":"SERVICE_CONTROL_POLICY" } ], "Id": "r-examplerootid111", "Name": "Root", "Arn": "arn:aws:organizations::111111111111:root/o-exampleorgid/r-examplerootid111" } }awscli-1.14.44/awscli/examples/organizations/attach-policy.rst0000777454262600001440000000074513243367510025520 0ustar pysdk-ciamazon00000000000000**To attach a policy to a root, OU, or account** **Example 1** The following example shows how to attach a service control policy (SCP) to an OU: :: aws organizations attach-policy --policy-id p-examplepolicyid111 --target-id ou-examplerootid111-exampleouid111 **Example 2** The following example shows how to attach a service control policy directly to an account: :: aws organizations attach-policy --policy-id p-examplepolicyid111 --target-id = 333333333333awscli-1.14.44/awscli/examples/organizations/list-policies.rst0000777454262600001440000000250313243367510025531 0ustar pysdk-ciamazon00000000000000**To retrieve a list of all policies in an organization of a certain type** The following example shows you how to get a list of SCPs, as specified by the filter parameter: :: aws organizations list-policies --filter SERVICE_CONTROL_POLICY The output includes a list of policies with summary information: :: { "Policies": [ { "Type": "SERVICE_CONTROL_POLICY", "Name": "AllowAllS3Actions", "AwsManaged": false, "Id": "p-examplepolicyid111", "Arn": "arn:aws:organizations::111111111111:policy/service_control_policy/p-examplepolicyid111", "Description": "Enables account admins to delegate permissions for any S3 actions to users and roles in their accounts." }, { "Type": "SERVICE_CONTROL_POLICY", "Name": "AllowAllEC2Actions", "AwsManaged": false, "Id": "p-examplepolicyid222", "Arn": "arn:aws:organizations::111111111111:policy/service_control_policy/p-examplepolicyid222", "Description": "Enables account admins to delegate permissions for any EC2 actions to users and roles in their accounts." }, { "AwsManaged": true, "Description": "Allows access to every operation", "Type": "SERVICE_CONTROL_POLICY", "Id": "p-FullAWSAccess", "Arn": "arn:aws:organizations::aws:policy/service_control_policy/p-FullAWSAccess", "Name": "FullAWSAccess" } ] }awscli-1.14.44/awscli/examples/organizations/detach-policy.rst0000777454262600001440000000035213243367510025476 0ustar pysdk-ciamazon00000000000000**To detach a policy from a root, OU, or account** The following example shows how to detach a policy from an OU: :: aws organizations detach-policy --target-id ou-examplerootid111-exampleouid111 --policy-id p-examplepolicyid111 awscli-1.14.44/awscli/examples/organizations/accept-handshake.rst0000777454262600001440000000235313243367510026137 0ustar pysdk-ciamazon00000000000000**To accept a handshake from another account** Bill, the owner of an organization, has previously invited Juan's account to join his organization. The following example shows Juan's account accepting the handshake and thus agreeing to the invitation. :: aws organizations accept-handshake --handshake-id h-examplehandshakeid111 The output shows the following: :: { "Handshake": { "Action": "INVITE", "Arn": "arn:aws:organizations::111111111111:handshake/o-exampleorgid/invite/h-examplehandshakeid111", "RequestedTimestamp": 1481656459.257, "ExpirationTimestamp": 1482952459.257, "Id": "h-examplehandshakeid111", "Parties": [ { "Id": "o-exampleorgid", "Type": "ORGANIZATION" }, { "Id": "juan@example.com", "Type": "EMAIL" } ], "Resources": [ { "Resources": [ { "Type": "MASTER_EMAIL", "Value": "bill@amazon.com" }, { "Type": "MASTER_NAME", "Value": "Org Master Account" }, { "Type": "ORGANIZATION_FEATURE_SET", "Value": "ALL" } ], "Type": "ORGANIZATION", "Value": "o-exampleorgid" }, { "Type": "EMAIL", "Value": "juan@example.com" } ], "State": "ACCEPTED" } }awscli-1.14.44/awscli/examples/organizations/delete-organizational-unit.rst0000777454262600001440000000041413243367510030206 0ustar pysdk-ciamazon00000000000000**To delete an OU** The following example shows how to delete an OU. The example assumes that you previously removed all accounts and other OUs from the OU: :: aws organizations delete-organizational-unit --organizational-unit-id ou-examplerootid111-exampleouid111 awscli-1.14.44/awscli/examples/organizations/describe-account.rst0000777454262600001440000000103513243367510026162 0ustar pysdk-ciamazon00000000000000**To get the details about an account** The following example shows you how to request details about an account: :: aws organizations describe-account --account-id 555555555555 The output shows an account object with the details about the account: :: { "Account": { "Id": "555555555555", "Arn": "arn:aws:organizations::111111111111:account/o-exampleorgid/555555555555", "Name": "Beta account", "Email": "anika@example.com", "JoinedMethod": "INVITED", "JoinedTimeStamp": 1481756563.134, "Status": "ACTIVE" } }awscli-1.14.44/awscli/examples/organizations/describe-policy.rst0000777454262600001440000000143713243367510026033 0ustar pysdk-ciamazon00000000000000**To get information about a policy** The following example shows how to request information about a policy: :: aws organizations describe-policy --policy-id p-examplepolicyid111 The output includes a policy object that contains details about the policy: :: { "Policy": { "Content": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Effect\": \"Allow\",\n \"Action\": \"*\",\n \"Resource\": \"*\"\n }\n ]\n}", "PolicySummary": { "Arn": "arn:aws:organizations::111111111111:policy/o-exampleorgid/service_control_policy/p-examplepolicyid111", "Type": "SERVICE_CONTROL_POLICY", "Id": "p-examplepolicyid111", "AwsManaged": false, "Name": "AllowAllS3Actions", "Description": "Enables admins to delegate S3 permissions" } } }awscli-1.14.44/awscli/examples/swf/0000777454262600001440000000000013243367512020126 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/swf/register-workflow-type.rst0000666454262600001440000000166413243367510025340 0ustar pysdk-ciamazon00000000000000Registering a Workflow Type --------------------------- To register a Workflow type with the AWS CLI, use the ``swf register-workflow-type`` command:: aws swf register-workflow-type --domain DataFrobtzz --name "MySimpleWorkflow" --workflow-version "v1" If successful, the command returns no result. On an error (for example, if you try to register the same workflow type twice, or specify a domain that doesn't exist) you will get a response in JSON:: { "message": "WorkflowType=[name=MySimpleWorkflow, version=v1]", "__type": "com.amazonaws.swf.base.model#TypeAlreadyExistsFault" } The ``--domain``, ``--name`` and ``--workflow-version`` are required. You can also set the workflow description, timeouts, and child workflow policy. See Also -------- - `RegisterWorkflowType ` in the *Amazon Simple Workflow Service API Reference* awscli-1.14.44/awscli/examples/swf/count-open-workflow-executions.rst0000666454262600001440000000245113243367510027003 0ustar pysdk-ciamazon00000000000000**Counting Open Workflow Executions** You can use ``swf count-open-workflow-executions`` to retrieve the number of open workflow executions for a given domain. You can specify filters to count specific classes of executions. The ``--domain`` and ``--start-time-filter`` arguments are required. All other arguments are optional. Here is a basic example:: aws swf count-open-workflow-executions --domain DataFrobtzz --start-time-filter "{ \"latestDate\" : 1377129600, \"oldestDate\" : 1370044800 }" Result:: { "count": 4, "truncated": false } If "truncated" is ``true``, then "count" represents the maximum number that can be returned by Amazon SWF. Any further results are truncated. To reduce the number of results returned, you can: - modify the ``--start-time-filter`` values to narrow the time range that is searched. - use the ``--close-status-filter``, ``--execution-filter``, ``--tag-filter`` or ``--type-filter`` arguments to further filter the results. Each of these is mutually exclusive: You can specify *only one of these* in a request. For more information, see `CountOpenWorkflowExecutions`_ in the *Amazon Simple Workflow Service API Reference* .. _`CountOpenWorkflowExecutions`: http://docs.aws.amazon.com/amazonswf/latest/apireference/API_CountOpenWorkflowExecutions.html awscli-1.14.44/awscli/examples/swf/describe-domain.rst0000666454262600001440000000210613243367510023702 0ustar pysdk-ciamazon00000000000000Getting Information About a Domain ---------------------------------- To get detailed information about a particular domain, use the ``swf describe-domain`` command. There is one required parameter: ``--name``, which takes the name of the domain you want information about. For example: :: $ aws swf describe-domain --name DataFrobotz { "domainInfo": { "status": "REGISTERED", "name": "DataFrobotz" }, "configuration": { "workflowExecutionRetentionPeriodInDays": "1" } } You can also use ``describe-domain`` to get information about deprecated domains: :: $ aws swf describe-domain --name MyNeatNewDomain { "domainInfo": { "status": "DEPRECATED", "name": "MyNeatNewDomain" }, "configuration": { "workflowExecutionRetentionPeriodInDays": "0" } } See Also -------- - `DescribeDomain `__ in the *Amazon Simple Workflow Service API Reference* awscli-1.14.44/awscli/examples/swf/deprecate-domain.rst0000666454262600001440000000333713243367510024065 0ustar pysdk-ciamazon00000000000000Deprecating a Domain -------------------- To deprecate a domain (you can still see it, but cannot create new workflow executions or register types on it), use ``swf deprecate-domain``. It has a sole required parameter, ``--name``, which takes the name of the domain to deprecate. :: $ aws swf deprecate-domain --name MyNeatNewDomain "" As with ``register-domain``, no output is returned. If you use ``list-domains`` to view the registered domains, however, you will see that the domain has been deprecated and no longer appears in the returned data: :: $ aws swf list-domains --registration-status REGISTERED { "domainInfos": [ { "status": "REGISTERED", "name": "DataFrobotz" }, { "status": "REGISTERED", "name": "erontest" } ] } If you use ``--registration-status DEPRECATED`` with ``list-domains``, you will see your deprecated domain: :: $ aws swf list-domains --registration-status DEPRECATED { "domainInfos": [ { "status": "DEPRECATED", "name": "MyNeatNewDomain" } ] } You can still use ``describe-domain`` to get information about a deprecated domain: :: $ aws swf describe-domain --name MyNeatNewDomain { "domainInfo": { "status": "DEPRECATED", "name": "MyNeatNewDomain" }, "configuration": { "workflowExecutionRetentionPeriodInDays": "0" } } See Also -------- - `DeprecateDomain `__ in the *Amazon Simple Workflow Service API Reference* awscli-1.14.44/awscli/examples/swf/list-domains.rst0000666454262600001440000000524013243367510023262 0ustar pysdk-ciamazon00000000000000Listing your Domains -------------------- To list the SWF domains that you have registered for your account, you can use ``swf list-domains``. There is only one required parameter: ``--registration-status``, which you can set to either ``REGISTERED`` or ``DEPRECATED``. Here's a typical example:: aws swf list-domains --registration-status REGISTERED Result:: { "domainInfos": [ { "status": "REGISTERED", "name": "DataFrobotz" }, { "status": "REGISTERED", "name": "erontest" } ] } If you set ``--registration-status`` to ``DEPRECATED``, you will see deprecated domains (domains that can not register new workflows or activities, but that can still be queried). For example:: aws swf list-domains --registration-status DEPRECATED Result:: { "domainInfos": [ { "status": "DEPRECATED", "name": "MyNeatNewDomain" } ] } If you have many domains, you can set the ``--maximum-page-size`` option to limit the number of results returned. If there are more results to return than the maximum number that you specified, you will receive a ``nextPageToken`` that you can send to the next call to ``list-domains`` to retrieve additional entries. Here's an example of using ``--maximum-page-size``:: aws swf list-domains --registration-status REGISTERED --maximum-page-size 1 Result:: { "domainInfos": [ { "status": "REGISTERED", "name": "DataFrobotz" } ], "nextPageToken": "AAAAKgAAAAEAAAAAAAAAA2QJKNtidVgd49TTeNwYcpD+QKT2ynuEbibcQWe2QKrslMGe63gpS0MgZGpcpoKttL4OCXRFn98Xif557it+wSZUsvUDtImjDLvguyuyyFdIZtvIxIKEOPm3k2r4OjAGaFsGOuVbrKljvla7wdU7FYH3OlkNCP8b7PBj9SBkUyGoiAghET74P93AuVIIkdKGtQ==" } When you make the call again, this time supplying the value of ``nextPageToken`` in the ``--next-page-token`` argument, you'll get another page of results:: aws swf list-domains --registration-status REGISTERED --maximum-page-size 1 --next-page-token "AAAAKgAAAAEAAAAAAAAAA2QJKNtidVgd49TTeNwYcpD+QKT2ynuEbibcQWe2QKrslMGe63gpS0MgZGpcpoKttL4OCXRFn98Xif557it+wSZUsvUDtImjDLvguyuyyFdIZtvIxIKEOPm3k2r4OjAGaFsGOuVbrKljvla7wdU7FYH3OlkNCP8b7PBj9SBkUyGoiAghET74P93AuVIIkdKGtQ==" Result:: { "domainInfos": [ { "status": "REGISTERED", "name": "erontest" } ] } When there are no further pages of results to retrieve, ``nextPageToken`` will not be returned in the results. See Also -------- - `ListDomains `__ in the *Amazon Simple Workflow Service API Reference* awscli-1.14.44/awscli/examples/swf/count-closed-workflow-executions.rst0000666454262600001440000000266613243367510027323 0ustar pysdk-ciamazon00000000000000Counting Closed Workflow Executions ----------------------------------- You can use ``swf count-closed-workflow-executions`` to retrieve the number of closed workflow executions for a given domain. You can specify filters to count specific classes of executions. The ``--domain`` and *either* ``--close-time-filter`` or ``--start-time-filter`` arguments are required. All other arguments are optional. Here is a basic example:: aws swf count-closed-workflow-executions --domain DataFrobtzz --close-time-filter "{ \"latestDate\" : 1377129600, \"oldestDate\" : 1370044800 }" Result:: { "count": 2, "truncated": false } If "truncated" is ``true``, then "count" represents the maximum number that can be returned by Amazon SWF. Any further results are truncated. To reduce the number of results returned, you can: - modify the ``--close-time-filter`` or ``--start-time-filter`` values to narrow the time range that is searched. Each of these is mutually exclusive: You can specify *only one of these* in a request. - use the ``--close-status-filter``, ``--execution-filter``, ``--tag-filter`` or ``--type-filter`` arguments to further filter the results. However, these arguments are also mutually exclusive. See Also -------- - `CountClosedWorkflowExecutions `_ in the *Amazon Simple Workflow Service API Reference* awscli-1.14.44/awscli/examples/swf/list-workflow-types.rst0000666454262600001440000000222713243367510024646 0ustar pysdk-ciamazon00000000000000Listing Workflow Types ---------------------- To get a list of the workflow types for a domain, use ``swf list-workflow-types``. The ``--domain`` and ``--registration-status`` arguments are required. Here's a simple example:: aws swf list-workflow-types --domain DataFrobtzz --registration-status REGISTERED Results:: { "typeInfos": [ { "status": "REGISTERED", "creationDate": 1371454149.598, "description": "DataFrobtzz subscribe workflow", "workflowType": { "version": "v3", "name": "subscribe" } } ] } As with ``list-activity-types``, you can use the ``--name`` argument to select only workflow types with a particular name, and use the ``--maximum-page-size`` argument in coordination with ``--next-page-token`` to page results. To reverse the order in which results are returned, use ``--reverse-order``. See Also -------- - `ListWorkflowTypes `_ in the *Amazon Simple Workflow Service API Reference* awscli-1.14.44/awscli/examples/swf/register-domain.rst0000666454262600001440000000343413243367510023753 0ustar pysdk-ciamazon00000000000000Registering a Domain -------------------- You can use the AWS CLI to register new domains. Use the ``swf register-domain`` command. There are two required parameters, ``--name``, which takes the domain name, and ``--workflow-execution-retention-period-in-days``, which takes an integer to specify the number of days to retain workflow execution data on this domain, up to a maxium period of 90 days (for more information, see the `SWF FAQ `). Workflow execution data will not be retained after the specified number of days have passed. Here's an example of registering a new domain: :: $ aws swf register-domain --name MyNeatNewDomain --workflow-execution-retention-period-in-days 0 "" When you register a domain, nothing is returned (""), but you can use ``swf list-domains`` or ``swf describe-domain`` to see the new domain. For example: :: $ aws swf list-domains --registration-status REGISTERED { "domainInfos": [ { "status": "REGISTERED", "name": "DataFrobotz" }, { "status": "REGISTERED", "name": "MyNeatNewDomain" }, { "status": "REGISTERED", "name": "erontest" } ] } Using ``swf describe-domain``: :: aws swf describe-domain --name MyNeatNewDomain { "domainInfo": { "status": "REGISTERED", "name": "MyNeatNewDomain" }, "configuration": { "workflowExecutionRetentionPeriodInDays": "0" } } See Also -------- - `RegisterDomain `__ in the *Amazon Simple Workflow Service API Reference* awscli-1.14.44/awscli/examples/swf/list-activity-types.rst0000666454262600001440000001574713243367510024643 0ustar pysdk-ciamazon00000000000000Listing Activity Types ---------------------- To get a list of the activity types for a domain, use ``swf list-activity-types``. The ``--domain`` and ``--registration-status`` arguments are required. Here's a simple example:: aws swf list-activity-types --domain DataFrobtzz --registration-status REGISTERED Results:: { "typeInfos": [ { "status": "REGISTERED", "creationDate": 1371454150.451, "activityType": { "version": "1", "name": "confirm-user-email" }, "description": "subscribe confirm-user-email activity" }, { "status": "REGISTERED", "creationDate": 1371454150.709, "activityType": { "version": "1", "name": "confirm-user-phone" }, "description": "subscribe confirm-user-phone activity" }, { "status": "REGISTERED", "creationDate": 1371454149.871, "activityType": { "version": "1", "name": "get-subscription-info" }, "description": "subscribe get-subscription-info activity" }, { "status": "REGISTERED", "creationDate": 1371454150.909, "activityType": { "version": "1", "name": "send-subscription-success" }, "description": "subscribe send-subscription-success activity" }, { "status": "REGISTERED", "creationDate": 1371454150.085, "activityType": { "version": "1", "name": "subscribe-user-sns" }, "description": "subscribe subscribe-user-sns activity" } ] } You can use the ``--name`` argument to select only activity types with a particular name:: aws swf list-activity-types --domain DataFrobtzz --registration-status REGISTERED --name "send-subscription-success" Results:: { "typeInfos": [ { "status": "REGISTERED", "creationDate": 1371454150.909, "activityType": { "version": "1", "name": "send-subscription-success" }, "description": "subscribe send-subscription-success activity" } ] } To retrieve results in pages, you can set the ``--maximum-page-size`` argument. If more results are returned than will fit in a page of results, a "nextPageToken" will be returned in the result set:: aws swf list-activity-types --domain DataFrobtzz --registration-status REGISTERED --maximum-page-size 2 Results:: { "nextPageToken": "AAAAKgAAAAEAAAAAAAAAA1Gp1BelJq+PmHvAnDxJYbup8+0R4LVtbXLDl7QNY7C3OpHo9Sz06D/GuFz1OyC73umBQ1tOPJ/gC/aYpzDMqUIWIA1T9W0s2DryyZX4OC/6Lhk9/o5kdsuWMSBkHhgaZjgwp3WJINIFJFdaSMxY2vYAX7AtRtpcqJuBDDRE9RaRqDGYqIYUMltarkiqpSY1ZVveBasBvlvyUb/WGAaqehiDz7/JzLT/wWNNUMOd+Nhe", "typeInfos": [ { "status": "REGISTERED", "creationDate": 1371454150.451, "activityType": { "version": "1", "name": "confirm-user-email" }, "description": "subscribe confirm-user-email activity" }, { "status": "REGISTERED", "creationDate": 1371454150.709, "activityType": { "version": "1", "name": "confirm-user-phone" }, "description": "subscribe confirm-user-phone activity" } ] } You can pass the nextPageToken value to the next call to ``list-activity-types`` in the ``--next-page-token`` argument, retrieving the next page of results:: aws swf list-activity-types --domain DataFrobtzz --registration-status REGISTERED --maximum-page-size 2 --next-page-token "AAAAKgAAAAEAAAAAAAAAA1Gp1BelJq+PmHvAnDxJYbup8+0R4LVtbXLDl7QNY7C3OpHo9Sz06D/GuFz1OyC73umBQ1tOPJ/gC/aYpzDMqUIWIA1T9W0s2DryyZX4OC/6Lhk9/o5kdsuWMSBkHhgaZjgwp3WJINIFJFdaSMxY2vYAX7AtRtpcqJuBDDRE9RaRqDGYqIYUMltarkiqpSY1ZVveBasBvlvyUb/WGAaqehiDz7/JzLT/wWNNUMOd+Nhe" Result:: { "nextPageToken": "AAAAKgAAAAEAAAAAAAAAAw+7LZ4GRZPzTqBHsp2wBxWB8m1sgLCclgCuq3J+h/m3+vOfFqtkcjLwV5cc4OjNAzTCuq/XcylPumGwkjbajtqpZpbqOcVNfjFxGoi0LB2Olbvv0krbUISBvlpFPmSWpDSZJsxg5UxCcweteSlFn1PNSZ/MoinBZo8OTkjMuzcsTuKOzH9wCaR8ITcALJ3SaqHU3pyIRS5hPmFA3OLIc8zaAepjlaujo6hntNSCruB4" "typeInfos": [ { "status": "REGISTERED", "creationDate": 1371454149.871, "activityType": { "version": "1", "name": "get-subscription-info" }, "description": "subscribe get-subscription-info activity" }, { "status": "REGISTERED", "creationDate": 1371454150.909, "activityType": { "version": "1", "name": "send-subscription-success" }, "description": "subscribe send-subscription-success activity" } ] } If there are still more results to return, "nextPageToken" will be returned with the results. When there are no more pages of results to return, "nextPageToken" will *not* be returned in the result set. You can use the ``--reverse-order`` argument to reverse the order of the returned results. This also affects paged results:: aws swf list-activity-types --domain DataFrobtzz --registration-status REGISTERED --maximum-page-size 2 --reverse-order Results:: { "nextPageToken": "AAAAKgAAAAEAAAAAAAAAAwXcpu5ePSyQkrC+8WMbmSrenuZC2ZkIXQYBPB/b9xIOVkj+bMEFhGj0KmmJ4rF7iddhjf7UMYCsfGkEn7mk+yMCgVc1JxDWmB0EH46bhcmcLmYNQihMDmUWocpr7To6/R7CLu0St1gkFayxOidJXErQW0zdNfQaIWAnF/cwioBbXlkz1fQzmDeU3M5oYGMPQIrUqkPq7pMEW0q0lK5eDN97NzFYdZZ/rlcLDWPZhUjY", "typeInfos": [ { "status": "REGISTERED", "creationDate": 1371454150.085, "activityType": { "version": "1", "name": "subscribe-user-sns" }, "description": "subscribe subscribe-user-sns activity" }, { "status": "REGISTERED", "creationDate": 1371454150.909, "activityType": { "version": "1", "name": "send-subscription-success" }, "description": "subscribe send-subscription-success activity" } ] } See Also -------- - `ListActivityTypes `_ in the *Amazon Simple Workflow Service API Reference* awscli-1.14.44/awscli/examples/ses/0000777454262600001440000000000013243367512020121 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/ses/delete-identity.rst0000666454262600001440000000102113243367510023734 0ustar pysdk-ciamazon00000000000000**To delete an identity** The following example uses the ``delete-identity`` command to delete an identity from the list of identities verified with Amazon SES:: aws ses delete-identity --identity user@example.com For more information about verified identities, see `Verifying Email Addresses and Domains in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Verifying Email Addresses and Domains in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html awscli-1.14.44/awscli/examples/ses/get-send-quota.rst0000666454262600001440000000235413243367510023512 0ustar pysdk-ciamazon00000000000000**To get your Amazon SES sending limits** The following example uses the ``get-send-quota`` command to return your Amazon SES sending limits:: aws ses get-send-quota Output:: { "Max24HourSend": 200.0, "SentLast24Hours": 1.0, "MaxSendRate": 1.0 } Max24HourSend is your sending quota, which is the maximum number of emails that you can send in a 24-hour period. The sending quota reflects a rolling time period. Every time you try to send an email, Amazon SES checks how many emails you sent in the previous 24 hours. As long as the total number of emails that you have sent is less than your quota, your send request will be accepted and your email will be sent. SentLast24Hours is the number of emails that you have sent in the previous 24 hours. MaxSendRate is the maximum number of emails that you can send per second. Note that sending limits are based on recipients rather than on messages. For example, an email that has 10 recipients counts as 10 against your sending quota. For more information, see `Managing Your Amazon SES Sending Limits`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Managing Your Amazon SES Sending Limits`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/manage-sending-limits.html awscli-1.14.44/awscli/examples/ses/get-identity-notification-attributes.rst0000666454262600001440000000253113243367510030130 0ustar pysdk-ciamazon00000000000000**To get the Amazon SES notification attributes for a list of identities** The following example uses the ``get-identity-notification-attributes`` command to retrieve the Amazon SES notification attributes for a list of identities:: aws ses get-identity-notification-attributes --identities "user1@example.com" "user2@example.com" Output:: { "NotificationAttributes": { "user1@example.com": { "ForwardingEnabled": false, "ComplaintTopic": "arn:aws:sns:us-east-1:EXAMPLE65304:MyTopic", "BounceTopic": "arn:aws:sns:us-east-1:EXAMPLE65304:MyTopic", "DeliveryTopic": "arn:aws:sns:us-east-1:EXAMPLE65304:MyTopic" }, "user2@example.com": { "ForwardingEnabled": true } } } This command returns the status of email feedback forwarding and, if applicable, the Amazon Resource Names (ARNs) of the Amazon SNS topics that bounce, complaint, and delivery notifications are sent to. If you call this command with an identity that you have never submitted for verification, that identity won't appear in the output. For more information about notifications, see `Using Notifications With Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Using Notifications With Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.html awscli-1.14.44/awscli/examples/ses/get-send-statistics.rst0000666454262600001440000000224413243367510024551 0ustar pysdk-ciamazon00000000000000**To get your Amazon SES sending statistics** The following example uses the ``get-send-statistics`` command to return your Amazon SES sending statistics :: aws ses get-send-statistics Output:: { "SendDataPoints": [ { "Complaints": 0, "Timestamp": "2013-06-12T19:32:00Z", "DeliveryAttempts": 2, "Bounces": 0, "Rejects": 0 }, { "Complaints": 0, "Timestamp": "2013-06-12T00:47:00Z", "DeliveryAttempts": 1, "Bounces": 0, "Rejects": 0 } ] } The result is a list of data points, representing the last two weeks of sending activity. Each data point in the list contains statistics for a 15-minute interval. In this example, there are only two data points because the only emails that the user sent in the last two weeks fell within two 15-minute intervals. For more information, see `Monitoring Your Amazon SES Usage Statistics`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Monitoring Your Amazon SES Usage Statistics`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-usage-statistics.html awscli-1.14.44/awscli/examples/ses/send-email.rst0000666454262600001440000000435613243367510022677 0ustar pysdk-ciamazon00000000000000**To send a formatted email using Amazon SES** The following example uses the ``send-email`` command to send a formatted email:: aws ses send-email --from sender@example.com --destination file://destination.json --message file://message.json Output:: { "MessageId": "EXAMPLEf3a5efcd1-51adec81-d2a4-4e3f-9fe2-5d85c1b23783-000000" } The destination and the message are JSON data structures saved in .json files in the current directory. These files are as follows: ``destination.json``:: { "ToAddresses": ["recipient1@example.com", "recipient2@example.com"], "CcAddresses": ["recipient3@example.com"], "BccAddresses": [] } ``message.json``:: { "Subject": { "Data": "Test email sent using the AWS CLI", "Charset": "UTF-8" }, "Body": { "Text": { "Data": "This is the message body in text format.", "Charset": "UTF-8" }, "Html": { "Data": "This message body contains HTML formatting. It can, for example, contain links like this one: Amazon SES Developer Guide.", "Charset": "UTF-8" } } } Replace the sender and recipient email addresses with the ones you want to use. Note that the sender's email address must be verified with Amazon SES. Until you are granted production access to Amazon SES, you must also verify the email address of each recipient unless the recipient is the Amazon SES mailbox simulator. For more information on verification, see `Verifying Email Addresses and Domains in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. The Message ID in the output indicates that the call to send-email was successful. If you don't receive the email, check your Junk box. For more information on sending formatted email, see `Sending Formatted Email Using the Amazon SES API`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Verifying Email Addresses and Domains in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html .. _`Sending Formatted Email Using the Amazon SES API`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-formatted.html awscli-1.14.44/awscli/examples/ses/set-identity-feedback-forwarding-enabled.rst0000666454262600001440000000157213243367510030552 0ustar pysdk-ciamazon00000000000000**To enable or disable bounce and complaint email feedback forwarding for an Amazon SES verified identity** The following example uses the ``set-identity-feedback-forwarding-enabled`` command to enable a verified email address to receive bounce and complaint notifications by email:: aws ses set-identity-feedback-forwarding-enabled --identity user@example.com --forwarding-enabled You are required to receive bounce and complaint notifications via either Amazon SNS or email feedback forwarding, so you can only disable email feedback forwarding if you select an Amazon SNS topic for both bounce and complaint notifications. For more information about notifications, see `Using Notifications With Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Using Notifications With Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.html awscli-1.14.44/awscli/examples/ses/send-raw-email.rst0000666454262600001440000000402413243367510023456 0ustar pysdk-ciamazon00000000000000**To send a raw email using Amazon SES** The following example uses the ``send-raw-email`` command to send an email with a TXT attachment:: aws ses send-raw-email --raw-message file://message.json Output:: { "MessageId": "EXAMPLEf3f73d99b-c63fb06f-d263-41f8-a0fb-d0dc67d56c07-000000" } The raw message is a JSON data structure saved in a file named ``message.json`` in the current directory. It contains the following:: { "Data": "From: sender@example.com\nTo: recipient@example.com\nSubject: Test email sent using the AWS CLI (contains an attachment)\nMIME-Version: 1.0\nContent-type: Multipart/Mixed; boundary=\"NextPart\"\n\n--NextPart\nContent-Type: text/plain\n\nThis is the message body.\n\n--NextPart\nContent-Type: text/plain;\nContent-Disposition: attachment; filename=\"attachment.txt\"\n\nThis is the text in the attachment.\n\n--NextPart--" } As you can see, "Data" is one long string that contains the entire raw email content in MIME format, including an attachment called attachment.txt. Replace sender@example.com and recipient@example.com with the addresses you want to use. Note that the sender's email address must be verified with Amazon SES. Until you are granted production access to Amazon SES, you must also verify the email address of the recipient unless the recipient is the Amazon SES mailbox simulator. For more information on verification, see `Verifying Email Addresses and Domains in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. The Message ID in the output indicates that the call to send-raw-email was successful. If you don't receive the email, check your Junk box. For more information on sending raw email, see `Sending Raw Email Using the Amazon SES API`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Sending Raw Email Using the Amazon SES API`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html .. _`Verifying Email Addresses and Domains in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html awscli-1.14.44/awscli/examples/ses/verify-domain-identity.rst0000666454262600001440000000116613243367510025255 0ustar pysdk-ciamazon00000000000000**To verify a domain with Amazon SES** The following example uses the ``verify-domain-identity`` command to verify a domain:: aws ses verify-domain-identity --domain example.com Output:: { "VerificationToken": "eoEmxw+YaYhb3h3iVJHuXMJXqeu1q1/wwmvjuEXAMPLE" } To complete domain verification, you must add a TXT record with the returned verification token to your domain's DNS settings. For more information, see `Verifying Domains in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Verifying Domains in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html awscli-1.14.44/awscli/examples/ses/verify-domain-dkim.rst0000666454262600001440000000146413243367510024351 0ustar pysdk-ciamazon00000000000000**To generate a verified domain's DKIM tokens for DKIM signing with Amazon SES** The following example uses the ``verify-domain-dkim`` command to generate DKIM tokens for a domain that has been verified with Amazon SES:: aws ses verify-domain-dkim --domain example.com Output:: { "DkimTokens": [ "EXAMPLEq76owjnks3lnluwg65scbemvw", "EXAMPLEi3dnsj67hstzaj673klariwx2", "EXAMPLEwfbtcukvimehexktmdtaz6naj" ] } To set up DKIM, you must use the returned DKIM tokens to update your domain's DNS settings with CNAME records that point to DKIM public keys hosted by Amazon SES. For more information, see `Easy DKIM in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Easy DKIM in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html awscli-1.14.44/awscli/examples/ses/set-identity-notification-topic.rst0000666454262600001440000000133013243367510027070 0ustar pysdk-ciamazon00000000000000**To set the Amazon SNS topic to which Amazon SES will publish bounce, complaint, and/or delivery notifications for a verified identity** The following example uses the ``set-identity-notification-topic`` command to specify the Amazon SNS topic to which a verified email address will receive bounce notifications:: aws ses set-identity-notification-topic --identity user@example.com --notification-type Bounce --sns-topic arn:aws:sns:us-east-1:EXAMPLE65304:MyTopic For more information about notifications, see `Using Notifications With Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Using Notifications With Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications.html awscli-1.14.44/awscli/examples/ses/verify-email-identity.rst0000666454262600001440000000171213243367510025072 0ustar pysdk-ciamazon00000000000000**To verify an email address with Amazon SES** The following example uses the ``verify-email-identity`` command to verify an email address:: aws ses verify-email-identity --email-address user@example.com Before you can send an email using Amazon SES, you must verify the address or domain that you are sending the email from to prove that you own it. If you do not have production access yet, you also need to verify any email addresses that you send emails to except for email addresses provided by the Amazon SES mailbox simulator. After verify-email-identity is called, the email address will receive a verification email. The user must click on the link in the email to complete the verification process. For more information, see `Verifying Email Addresses in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Verifying Email Addresses in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses.html awscli-1.14.44/awscli/examples/ses/list-identities.rst0000666454262600001440000000161213243367510023763 0ustar pysdk-ciamazon00000000000000**To list all identities (email addresses and domains) for a specific AWS account** The following example uses the ``list-identities`` command to list all identities that have been submitted for verification with Amazon SES:: aws ses list-identities Output:: { "Identities": [ "user@example.com", "example.com" ] } The list that is returned contains all identities regardless of verification status (verified, pending verification, failure, etc.). In this example, email addresses *and* domains are returned because we did not specify the identity-type parameter. For more information about verification, see `Verifying Email Addresses and Domains in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Verifying Email Addresses and Domains in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html awscli-1.14.44/awscli/examples/ses/get-identity-dkim-attributes.rst0000666454262600001440000000220013243367510026357 0ustar pysdk-ciamazon00000000000000**To get the Amazon SES Easy DKIM attributes for a list of identities** The following example uses the ``get-identity-dkim-attributes`` command to retrieve the Amazon SES Easy DKIM attributes for a list of identities:: aws ses get-identity-dkim-attributes --identities "example.com" "user@example.com" Output:: { "DkimAttributes": { "example.com": { "DkimTokens": [ "EXAMPLEjcs5xoyqytjsotsijas7236gr", "EXAMPLEjr76cvoc6mysspnioorxsn6ep", "EXAMPLEkbmkqkhlm2lyz77ppkulerm4k" ], "DkimEnabled": true, "DkimVerificationStatus": "Success" }, "user@example.com": { "DkimEnabled": false, "DkimVerificationStatus": "NotStarted" } } } If you call this command with an identity that you have never submitted for verification, that identity won't appear in the output. For more information about Easy DKIM, see `Easy DKIM in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Easy DKIM in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html awscli-1.14.44/awscli/examples/ses/get-identity-verification-attributes.rst0000666454262600001440000000174513243367510030132 0ustar pysdk-ciamazon00000000000000**To get the Amazon SES verification status for a list of identities** The following example uses the ``get-identity-verification-attributes`` command to retrieve the Amazon SES verification status for a list of identities:: aws ses get-identity-verification-attributes --identities "user1@example.com" "user2@example.com" Output:: { "VerificationAttributes": { "user1@example.com": { "VerificationStatus": "Success" }, "user2@example.com": { "VerificationStatus": "Pending" } } } If you call this command with an identity that you have never submitted for verification, that identity won't appear in the output. For more information about verified identities, see `Verifying Email Addresses and Domains in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Verifying Email Addresses and Domains in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-addresses-and-domains.html awscli-1.14.44/awscli/examples/ses/set-identity-dkim-enabled.rst0000666454262600001440000000076213243367510025612 0ustar pysdk-ciamazon00000000000000**To enable or disable Easy DKIM for an Amazon SES verified identity** The following example uses the ``set-identity-dkim-enabled`` command to disable DKIM for a verified email address:: aws ses set-identity-dkim-enabled --identity user@example.com --no-dkim-enabled For more information about Easy DKIM, see `Easy DKIM in Amazon SES`_ in the *Amazon Simple Email Service Developer Guide*. .. _`Easy DKIM in Amazon SES`: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html awscli-1.14.44/awscli/examples/ecs/0000777454262600001440000000000013243367512020101 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/ecs/deregister-task-definition.rst0000666454262600001440000000212313243367510026052 0ustar pysdk-ciamazon00000000000000**To deregister a task definition** This example deregisters the first revision of the ``curler`` task definition in your default region. Note that in the resulting output, the task definition status becomes ``INACTIVE``. Command:: aws ecs deregister-task-definition --task-definition curler:1 Output:: { "taskDefinition": { "status": "INACTIVE", "family": "curler", "volumes": [], "taskDefinitionArn": "arn:aws:ecs:us-west-2::task-definition/curler:1", "containerDefinitions": [ { "environment": [], "name": "curler", "mountPoints": [], "image": "curl:latest", "cpu": 100, "portMappings": [], "entryPoint": [], "memory": 256, "command": [ "curl -v http://example.com/" ], "essential": true, "volumesFrom": [] } ], "revision": 1 } }awscli-1.14.44/awscli/examples/ecs/delete-cluster.rst0000666454262600001440000000076113243367510023556 0ustar pysdk-ciamazon00000000000000**To delete an empty cluster** This example command deletes an empty cluster in your default region. Command:: aws ecs delete-cluster --cluster my_cluster Output:: { "cluster": { "status": "INACTIVE", "clusterName": "my_cluster", "registeredContainerInstancesCount": 0, "pendingTasksCount": 0, "runningTasksCount": 0, "activeServicesCount": 0, "clusterArn": "arn:aws:ecs:::cluster/my_cluster" } } awscli-1.14.44/awscli/examples/ecs/list-tasks.rst0000666454262600001440000000143213243367510022727 0ustar pysdk-ciamazon00000000000000**To list the tasks in a cluster** This example command lists all of the tasks in a cluster. Command:: aws ecs list-tasks --cluster default Output:: { "taskArns": [ "arn:aws:ecs:us-east-1::task/0cc43cdb-3bee-4407-9c26-c0e6ea5bee84", "arn:aws:ecs:us-east-1::task/6b809ef6-c67e-4467-921f-ee261c15a0a1" ] } **To list the tasks on a particular container instance** This example command lists the tasks of a specified container instance, using the container instance UUID as a filter. Command:: aws ecs list-tasks --cluster default --container-instance f6bbb147-5370-4ace-8c73-c7181ded911f Output:: { "taskArns": [ "arn:aws:ecs:us-east-1::task/0cc43cdb-3bee-4407-9c26-c0e6ea5bee84" ] }awscli-1.14.44/awscli/examples/ecs/describe-task-definition.rst0000666454262600001440000000301613243367510025477 0ustar pysdk-ciamazon00000000000000**To describe a task definition** This example command provides a description of the specified task definition. Command:: aws ecs describe-task-definition --task-definition hello_world:8 Output:: { "taskDefinition": { "volumes": [], "taskDefinitionArn": "arn:aws:ecs:us-east-1::task-definition/hello_world:8", "containerDefinitions": [ { "environment": [], "name": "wordpress", "links": [ "mysql" ], "mountPoints": [], "image": "wordpress", "essential": true, "portMappings": [ { "containerPort": 80, "hostPort": 80 } ], "memory": 500, "cpu": 10, "volumesFrom": [] }, { "environment": [ { "name": "MYSQL_ROOT_PASSWORD", "value": "password" } ], "name": "mysql", "mountPoints": [], "image": "mysql", "cpu": 10, "portMappings": [], "memory": 500, "essential": true, "volumesFrom": [] } ], "family": "hello_world", "revision": 8 } } awscli-1.14.44/awscli/examples/ecs/create-cluster.rst0000666454262600001440000000076213243367510023560 0ustar pysdk-ciamazon00000000000000**To create a new cluster** This example command creates a cluster in your default region. Command:: aws ecs create-cluster --cluster-name "my_cluster" Output:: { "cluster": { "status": "ACTIVE", "clusterName": "my_cluster", "registeredContainerInstancesCount": 0, "pendingTasksCount": 0, "runningTasksCount": 0, "activeServicesCount": 0, "clusterArn": "arn:aws:ecs:::cluster/my_cluster" } } awscli-1.14.44/awscli/examples/ecs/describe-container-instances.rst0000666454262600001440000000542613243367510026365 0ustar pysdk-ciamazon00000000000000**To describe container instance** This example command provides a description of the specified container instance in the ``update`` cluster, using the container instance UUID as an identifier. Command:: aws ecs describe-container-instances --cluster update --container-instances 53ac7152-dcd1-4102-81f5-208962864132 Output:: { "failures": [], "containerInstances": [ { "status": "ACTIVE", "registeredResources": [ { "integerValue": 2048, "longValue": 0, "type": "INTEGER", "name": "CPU", "doubleValue": 0.0 }, { "integerValue": 3955, "longValue": 0, "type": "INTEGER", "name": "MEMORY", "doubleValue": 0.0 }, { "name": "PORTS", "longValue": 0, "doubleValue": 0.0, "stringSetValue": [ "22", "2376", "2375", "51678" ], "type": "STRINGSET", "integerValue": 0 } ], "ec2InstanceId": "i-f3c1de3a", "agentConnected": true, "containerInstanceArn": "arn:aws:ecs:us-west-2::container-instance/53ac7152-dcd1-4102-81f5-208962864132", "pendingTasksCount": 0, "remainingResources": [ { "integerValue": 2048, "longValue": 0, "type": "INTEGER", "name": "CPU", "doubleValue": 0.0 }, { "integerValue": 3955, "longValue": 0, "type": "INTEGER", "name": "MEMORY", "doubleValue": 0.0 }, { "name": "PORTS", "longValue": 0, "doubleValue": 0.0, "stringSetValue": [ "22", "2376", "2375", "51678" ], "type": "STRINGSET", "integerValue": 0 } ], "runningTasksCount": 0, "versionInfo": { "agentVersion": "1.0.0", "agentHash": "4023248", "dockerVersion": "DockerVersion: 1.5.0" } } ] }awscli-1.14.44/awscli/examples/ecs/update-container-agent.rst0000666454262600001440000000117413243367510025172 0ustar pysdk-ciamazon00000000000000**To update the container agent on an Amazon ECS container instance** This example command updates the container agent on the container instance ``a3e98c65-2a40-4452-a63c-62beb4d9be9b`` in the default cluster. Command:: aws ecs update-container-agent --cluster default --container-instance a3e98c65-2a40-4452-a63c-62beb4d9be9b Output:: { "containerInstance": { "status": "ACTIVE", ... "agentUpdateStatus": "PENDING", "versionInfo": { "agentVersion": "1.0.0", "agentHash": "4023248", "dockerVersion": "DockerVersion: 1.5.0" } } }awscli-1.14.44/awscli/examples/ecs/list-services.rst0000666454262600001440000000040713243367510023426 0ustar pysdk-ciamazon00000000000000**To list the services in a cluster** This example command lists the services running in a cluster. Command:: aws ecs list-services Output:: { "serviceArns": [ "arn:aws:ecs:::service/my-http-service" ] } awscli-1.14.44/awscli/examples/ecs/describe-tasks.rst0000666454262600001440000000330413243367510023534 0ustar pysdk-ciamazon00000000000000**To describe a task** This example command provides a description of the specified task, using the task UUID as an identifier. Command:: aws ecs describe-tasks --tasks c5cba4eb-5dad-405e-96db-71ef8eefe6a8 Output:: { "failures": [], "tasks": [ { "taskArn": "arn:aws:ecs:::task/c5cba4eb-5dad-405e-96db-71ef8eefe6a8", "overrides": { "containerOverrides": [ { "name": "ecs-demo" } ] }, "lastStatus": "RUNNING", "containerInstanceArn": "arn:aws:ecs:::container-instance/18f9eda5-27d7-4c19-b133-45adc516e8fb", "clusterArn": "arn:aws:ecs:::cluster/default", "desiredStatus": "RUNNING", "taskDefinitionArn": "arn:aws:ecs:::task-definition/amazon-ecs-sample:1", "startedBy": "ecs-svc/9223370608528463088", "containers": [ { "containerArn": "arn:aws:ecs:::container/7c01765b-c588-45b3-8290-4ba38bd6c5a6", "taskArn": "arn:aws:ecs:::task/c5cba4eb-5dad-405e-96db-71ef8eefe6a8", "lastStatus": "RUNNING", "name": "ecs-demo", "networkBindings": [ { "bindIP": "0.0.0.0", "containerPort": 80, "hostPort": 80 } ] } ] } ] } awscli-1.14.44/awscli/examples/ecs/register-task-definition.rst0000666454262600001440000000544113243367510025547 0ustar pysdk-ciamazon00000000000000**To register a task definition with a JSON file** This example registers a task definition to the specified family with container definitions that are saved in JSON format at the specified file location. Command:: aws ecs register-task-definition --cli-input-json file:///sleep360.json JSON file format:: { "containerDefinitions": [ { "name": "sleep", "image": "busybox", "cpu": 10, "command": [ "sleep", "360" ], "memory": 10, "essential": true } ], "family": "sleep360" } Output:: { "taskDefinition": { "volumes": [], "taskDefinitionArn": "arn:aws:ecs:us-east-1::task-definition/sleep360:19", "containerDefinitions": [ { "environment": [], "name": "sleep", "mountPoints": [], "image": "busybox", "cpu": 10, "portMappings": [], "command": [ "sleep", "360" ], "memory": 10, "essential": true, "volumesFrom": [] } ], "family": "sleep360", "revision": 1 } } **To register a task definition with a JSON string** This example registers a the same task definition from the previous example, but the container definitions are in a string format with the double quotes escaped. Command:: aws ecs register-task-definition --family sleep360 --container-definitions "[{\"name\":\"sleep\",\"image\":\"busybox\",\"cpu\":10,\"command\":[\"sleep\",\"360\"],\"memory\":10,\"essential\":true}]" **To use data volumes in a task definition** This example task definition creates a data volume called `webdata` that exists at `/ecs/webdata` on the container instance. The volume is mounted read-only as `/usr/share/nginx/html` on the `web` container, and read-write as `/nginx/` on the `timer` container. Task Definition:: { "family": "web-timer", "containerDefinitions": [ { "name": "web", "image": "nginx", "cpu": 99, "memory": 100, "portMappings": [{ "containerPort": 80, "hostPort": 80 }], "essential": true, "mountPoints": [{ "sourceVolume": "webdata", "containerPath": "/usr/share/nginx/html", "readOnly": true }] }, { "name": "timer", "image": "busybox", "cpu": 10, "memory": 20, "entryPoint": ["sh", "-c"], "command": ["while true; do date > /nginx/index.html; sleep 1; done"], "mountPoints": [{ "sourceVolume": "webdata", "containerPath": "/nginx/" }] }], "volumes": [{ "name": "webdata", "host": { "sourcePath": "/ecs/webdata" }} ] } awscli-1.14.44/awscli/examples/ecs/update-service.rst0000666454262600001440000000074413243367510023556 0ustar pysdk-ciamazon00000000000000**To change the task definition used in a service** This example command updates the ``my-http-service`` service to use the ``amazon-ecs-sample`` task definition. Command:: aws ecs update-service --service my-http-service --task-definition amazon-ecs-sample **To change the number of tasks in a service** This example command updates the desired count of the ``my-http-service`` service to 10. Command:: aws ecs update-service --service my-http-service --desired-count 10awscli-1.14.44/awscli/examples/ecs/run-task.rst0000666454262600001440000000240713243367510022400 0ustar pysdk-ciamazon00000000000000**To run a task on your default cluster** This example command runs the specified task definition on your default cluster. Command:: aws ecs run-task --cluster default --task-definition sleep360:1 Output:: { "tasks": [ { "taskArn": "arn:aws:ecs:us-east-1::task/a9f21ea7-c9f5-44b1-b8e6-b31f50ed33c0", "overrides": { "containerOverrides": [ { "name": "sleep" } ] }, "lastStatus": "PENDING", "containerInstanceArn": "arn:aws:ecs:us-east-1::container-instance/ffe3d344-77e2-476c-a4d0-bf560ad50acb", "desiredStatus": "RUNNING", "taskDefinitionArn": "arn:aws:ecs:us-east-1::task-definition/sleep360:1", "containers": [ { "containerArn": "arn:aws:ecs:us-east-1::container/58591c8e-be29-4ddf-95aa-ee459d4c59fd", "taskArn": "arn:aws:ecs:us-east-1::task/a9f21ea7-c9f5-44b1-b8e6-b31f50ed33c0", "lastStatus": "PENDING", "name": "sleep" } ] } ] } awscli-1.14.44/awscli/examples/ecs/delete-service.rst0000666454262600001440000000035613243367510023535 0ustar pysdk-ciamazon00000000000000**To delete a service** This example command deletes the ``my-http-service`` service. The service must have a desired count and running count of 0 before you can delete it. Command:: aws ecs delete-service --service my-http-service awscli-1.14.44/awscli/examples/ecs/list-task-definitions.rst0000666454262600001440000000235113243367510025056 0ustar pysdk-ciamazon00000000000000**To list your registered task definitions** This example command lists all of your registered task definitions. Command:: aws ecs list-task-definitions Output:: { "taskDefinitionArns": [ "arn:aws:ecs:us-east-1::task-definition/sleep300:2", "arn:aws:ecs:us-east-1::task-definition/sleep360:1", "arn:aws:ecs:us-east-1::task-definition/wordpress:3", "arn:aws:ecs:us-east-1::task-definition/wordpress:4", "arn:aws:ecs:us-east-1::task-definition/wordpress:5", "arn:aws:ecs:us-east-1::task-definition/wordpress:6" ] } **To list the registered task definitions in a family** This example command lists the task definition revisions of a specified family. Command:: aws ecs list-task-definitions --family-prefix wordpress Output:: { "taskDefinitionArns": [ "arn:aws:ecs:us-east-1::task-definition/wordpress:3", "arn:aws:ecs:us-east-1::task-definition/wordpress:4", "arn:aws:ecs:us-east-1::task-definition/wordpress:5", "arn:aws:ecs:us-east-1::task-definition/wordpress:6" ] }awscli-1.14.44/awscli/examples/ecs/list-clusters.rst0000666454262600001440000000051313243367510023445 0ustar pysdk-ciamazon00000000000000**To list your available clusters** This example command lists all of your available clusters in your default region. Command:: aws ecs list-clusters Output:: { "clusterArns": [ "arn:aws:ecs:us-east-1::cluster/test", "arn:aws:ecs:us-east-1::cluster/default" ] } awscli-1.14.44/awscli/examples/ecs/create-service.rst0000666454262600001440000000676113243367510023544 0ustar pysdk-ciamazon00000000000000**To create a new service** This example command creates a service in your default region called ``ecs-simple-service``. The service uses the ``ecs-demo`` task definition and it maintains 10 instantiations of that task. Command:: aws ecs create-service --service-name ecs-simple-service --task-definition ecs-demo --desired-count 10 Output:: { "service": { "status": "ACTIVE", "taskDefinition": "arn:aws:ecs:::task-definition/ecs-demo:1", "pendingCount": 0, "loadBalancers": [], "desiredCount": 10, "serviceName": "ecs-simple-service", "clusterArn": "arn:aws:ecs:::cluster/default", "serviceArn": "arn:aws:ecs:::service/ecs-simple-service", "deployments": [ { "status": "PRIMARY", "pendingCount": 0, "createdAt": 1428096748.604, "desiredCount": 10, "taskDefinition": "arn:aws:ecs:::task-definition/ecs-demo:1", "updatedAt": 1428096748.604, "id": "ecs-svc/", "runningCount": 0 } ], "events": [], "runningCount": 0 } } **To create a new service behind a load balancer** This example command creates a service in your default region called ``ecs-simple-service-elb``. The service uses the ``ecs-demo`` task definition and it maintains 10 instantiations of that task. You must have a load balancer configured in the same region as your container instances. This example uses the ``--cli-input-json`` option and a JSON input file called ``ecs-simple-service-elb.json`` with the below format. Input file:: { "serviceName": "ecs-simple-service-elb", "taskDefinition": "ecs-demo", "loadBalancers": [ { "loadBalancerName": "EC2Contai-EcsElast-S06278JGSJCM", "containerName": "simple-demo", "containerPort": 80 } ], "desiredCount": 10, "role": "ecsServiceRole" } Command:: aws ecs create-service --service-name ecs-simple-service-elb --cli-input-json file://ecs-simple-service-elb.json Output:: { "service": { "status": "ACTIVE", "taskDefinition": "arn:aws:ecs:::task-definition/ecs-demo:1", "pendingCount": 0, "loadBalancers": [ { "containerName": "ecs-demo", "containerPort": 80, "loadBalancerName": "EC2Contai-EcsElast-S06278JGSJCM" } ], "roleArn": "arn:aws:iam:::role/ecsServiceRole", "desiredCount": 10, "serviceName": "ecs-simple-service-elb", "clusterArn": "arn:aws:ecs:::cluster/default", "serviceArn": "arn:aws:ecs:::service/ecs-simple-service-elb", "deployments": [ { "status": "PRIMARY", "pendingCount": 0, "createdAt": 1428100239.123, "desiredCount": 10, "taskDefinition": "arn:aws:ecs:::task-definition/ecs-demo:1", "updatedAt": 1428100239.123, "id": "ecs-svc/", "runningCount": 0 } ], "events": [], "runningCount": 0 } }awscli-1.14.44/awscli/examples/ecs/list-container-instances.rst0000666454262600001440000000102313243367510025545 0ustar pysdk-ciamazon00000000000000**To list your available container instances in a cluster** This example command lists all of your available container instances in the specified cluster (`my_cluster`) in your default region. Command:: aws ecs list-container-instances --cluster my_cluster Output:: { "containerInstanceArns": [ "arn:aws:ecs:us-east-1::container-instance/f6bbb147-5370-4ace-8c73-c7181ded911f", "arn:aws:ecs:us-east-1::container-instance/ffe3d344-77e2-476c-a4d0-bf560ad50acb" ] } awscli-1.14.44/awscli/examples/ecs/deregister-container-instance.rst0000666454262600001440000000064013243367510026550 0ustar pysdk-ciamazon00000000000000**To deregister a container instance from a cluster** This example deregisters a container instance from the specified cluster in your default region. If there are still tasks running on the container instance, you must either stop those tasks before deregistering, or use the force option. Command:: aws ecs deregister-container-instance --cluster default --container-instance --forceawscli-1.14.44/awscli/examples/ecs/list-task-definition-families.rst0000666454262600001440000000114513243367510026462 0ustar pysdk-ciamazon00000000000000**To list your registered task definition families** This example command lists all of your registered task definition families. Command:: aws ecs list-task-definition-families Output:: { "families": [ "node-js-app", "web-timer", "hpcc", "hpcc-c4-8xlarge" ] } **To filter your registered task definition families** This example command lists the task definition revisions that start with "hpcc". Command:: aws ecs list-task-definition-families --family-prefix hpcc Output:: { "families": [ "hpcc", "hpcc-c4-8xlarge" ] } awscli-1.14.44/awscli/examples/ecs/describe-services.rst0000666454262600001440000000315213243367510024233 0ustar pysdk-ciamazon00000000000000**To describe a service** This example command provides descriptive information about the ``my-http-service``. Command:: aws ecs describe-services --service my-http-service Output:: { "services": [ { "status": "ACTIVE", "taskDefinition": "arn:aws:ecs:::task-definition/amazon-ecs-sample:1", "pendingCount": 0, "loadBalancers": [], "desiredCount": 10, "createdAt": 1466801808.595, "serviceName": "my-http-service", "clusterArn": "arn:aws:ecs:::cluster/default", "serviceArn": "arn:aws:ecs:::service/my-http-service", "deployments": [ { "status": "PRIMARY", "pendingCount": 0, "createdAt": 1466801808.595, "desiredCount": 10, "taskDefinition": "arn:aws:ecs:::task-definition/amazon-ecs-sample:1", "updatedAt": 1428326312.703, "id": "ecs-svc/9223370608528463088", "runningCount": 10 } ], "events": [ { "message": "(service my-http-service) has reached a steady state.", "id": "97c8a8e0-16a5-4d30-80bd-9e5413f8951b", "createdAt": 1466801812.435 } ], "runningCount": 10 } ], "failures": [] } awscli-1.14.44/awscli/examples/ecs/describe-clusters.rst0000666454262600001440000000111213243367510024246 0ustar pysdk-ciamazon00000000000000**To describe a cluster** This example command provides a description of the specified cluster in your default region. Command:: aws ecs describe-clusters --cluster default Output:: { "clusters": [ { "status": "ACTIVE", "clusterName": "default", "registeredContainerInstancesCount": 0, "pendingTasksCount": 0, "runningTasksCount": 0, "activeServicesCount": 1, "clusterArn": "arn:aws:ecs:us-west-2::cluster/default" } ], "failures": [] } awscli-1.14.44/awscli/examples/s3/0000777454262600001440000000000013243367512017654 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/s3/rm.rst0000666454262600001440000000252713243367510021030 0ustar pysdk-ciamazon00000000000000The following ``rm`` command deletes a single s3 object:: aws s3 rm s3://mybucket/test2.txt Output:: delete: s3://mybucket/test2.txt The following ``rm`` command recursively deletes all objects under a specified bucket and prefix when passed with the parameter ``--recursive``. In this example, the bucket ``mybucket`` contains the objects ``test1.txt`` and ``test2.txt``:: aws s3 rm s3://mybucket --recursive Output:: delete: s3://mybucket/test1.txt delete: s3://mybucket/test2.txt The following ``rm`` command recursively deletes all objects under a specified bucket and prefix when passed with the parameter ``--recursive`` while excluding some objects by using an ``--exclude`` parameter. In this example, the bucket ``mybucket`` has the objects ``test1.txt`` and ``test2.jpg``:: aws s3 rm s3://mybucket/ --recursive --exclude "*.jpg" Output:: delete: s3://mybucket/test1.txt The following ``rm`` command recursively deletes all objects under a specified bucket and prefix when passed with the parameter ``--recursive`` while excluding all objects under a particular prefix by using an ``--exclude`` parameter. In this example, the bucket ``mybucket`` has the objects ``test1.txt`` and ``another/test.txt``:: aws s3 rm s3://mybucket/ --recursive --exclude "another/*" Output:: delete: s3://mybucket/test1.txt awscli-1.14.44/awscli/examples/s3/cp.rst0000666454262600001440000001170613243367510021013 0ustar pysdk-ciamazon00000000000000**Copying a local file to S3** The following ``cp`` command copies a single file to a specified bucket and key:: aws s3 cp test.txt s3://mybucket/test2.txt Output:: upload: test.txt to s3://mybucket/test2.txt **Copying a file from S3 to S3** The following ``cp`` command copies a single s3 object to a specified bucket and key:: aws s3 cp s3://mybucket/test.txt s3://mybucket/test2.txt Output:: copy: s3://mybucket/test.txt to s3://mybucket/test2.txt **Copying an S3 object to a local file** The following ``cp`` command copies a single object to a specified file locally:: aws s3 cp s3://mybucket/test.txt test2.txt Output:: download: s3://mybucket/test.txt to test2.txt **Copying an S3 object from one bucket to another** The following ``cp`` command copies a single object to a specified bucket while retaining its original name:: aws s3 cp s3://mybucket/test.txt s3://mybucket2/ Output:: copy: s3://mybucket/test.txt to s3://mybucket2/test.txt **Recursively copying S3 objects to a local directory** When passed with the parameter ``--recursive``, the following ``cp`` command recursively copies all objects under a specified prefix and bucket to a specified directory. In this example, the bucket ``mybucket`` has the objects ``test1.txt`` and ``test2.txt``:: aws s3 cp s3://mybucket . --recursive Output:: download: s3://mybucket/test1.txt to test1.txt download: s3://mybucket/test2.txt to test2.txt **Recursively copying local files to S3** When passed with the parameter ``--recursive``, the following ``cp`` command recursively copies all files under a specified directory to a specified bucket and prefix while excluding some files by using an ``--exclude`` parameter. In this example, the directory ``myDir`` has the files ``test1.txt`` and ``test2.jpg``:: aws s3 cp myDir s3://mybucket/ --recursive --exclude "*.jpg" Output:: upload: myDir/test1.txt to s3://mybucket/test1.txt **Recursively copying S3 objects to another bucket** When passed with the parameter ``--recursive``, the following ``cp`` command recursively copies all objects under a specified bucket to another bucket while excluding some objects by using an ``--exclude`` parameter. In this example, the bucket ``mybucket`` has the objects ``test1.txt`` and ``another/test1.txt``:: aws s3 cp s3://mybucket/ s3://mybucket2/ --recursive --exclude "another/*" Output:: copy: s3://mybucket/test1.txt to s3://mybucket2/test1.txt You can combine ``--exclude`` and ``--include`` options to copy only objects that match a pattern, excluding all others:: aws s3 cp s3://mybucket/logs/ s3://mybucket2/logs/ --recursive --exclude "*" --include "*.log" Output:: copy: s3://mybucket/test/test.log to s3://mybucket2/test/test.log copy: s3://mybucket/test3.log to s3://mybucket2/test3.log **Setting the Access Control List (ACL) while copying an S3 object** The following ``cp`` command copies a single object to a specified bucket and key while setting the ACL to ``public-read-write``:: aws s3 cp s3://mybucket/test.txt s3://mybucket/test2.txt --acl public-read-write Output:: copy: s3://mybucket/test.txt to s3://mybucket/test2.txt Note that if you're using the ``--acl`` option, ensure that any associated IAM policies include the ``"s3:PutObjectAcl"`` action:: aws iam get-user-policy --user-name myuser --policy-name mypolicy Output:: { "UserName": "myuser", "PolicyName": "mypolicy", "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:PutObject", "s3:PutObjectAcl" ], "Resource": [ "arn:aws:s3:::mybucket/*" ], "Effect": "Allow", "Sid": "Stmt1234567891234" } ] } } **Granting permissions for an S3 object** The following ``cp`` command illustrates the use of the ``--grants`` option to grant read access to all users and full control to a specific user identified by their email address:: aws s3 cp file.txt s3://mybucket/ --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=emailaddress=user@example.com Output:: upload: file.txt to s3://mybucket/file.txt **Uploading a local file stream to S3** WARNING:: PowerShell may alter the encoding of or add a CRLF to piped input. The following ``cp`` command uploads a local file stream from standard input to a specified bucket and key:: aws s3 cp - s3://mybucket/stream.txt **Downloading an S3 object as a local file stream** WARNING:: PowerShell may alter the encoding of or add a CRLF to piped or redirected output. The following ``cp`` command downloads an S3 object locally as a stream to standard output. Downloading as a stream is not currently compatible with the ``--recursive`` parameter:: aws s3 cp s3://mybucket/stream.txt - awscli-1.14.44/awscli/examples/s3/mb.rst0000666454262600001440000000102713243367510021002 0ustar pysdk-ciamazon00000000000000The following ``mb`` command creates a bucket. In this example, the user makes the bucket ``mybucket``. The bucket is created in the region specified in the user's configuration file:: aws s3 mb s3://mybucket Output:: make_bucket: s3://mybucket The following ``mb`` command creates a bucket in a region specified by the ``--region`` parameter. In this example, the user makes the bucket ``mybucket`` in the region ``us-west-1``:: aws s3 mb s3://mybucket --region us-west-1 Output:: make_bucket: s3://mybucket awscli-1.14.44/awscli/examples/s3/website.rst0000666454262600001440000000156313243367510022053 0ustar pysdk-ciamazon00000000000000The following command configures a bucket named ``my-bucket`` as a static website:: aws s3 website s3://my-bucket/ --index-document index.html --error-document error.html The index document option specifies the file in ``my-bucket`` that visitors will be directed to when they navigate to the website URL. In this case, the bucket is in the us-west-2 region, so the site would appear at ``http://my-bucket.s3-website-us-west-2.amazonaws.com``. All files in the bucket that appear on the static site must be configured to allow visitors to open them. File permissions are configured separately from the bucket website configuration. For information on hosting a static website in Amazon S3, see `Hosting a Static Website`_ in the *Amazon Simple Storage Service Developer Guide*. .. _`Hosting a Static Website`: http://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.htmlawscli-1.14.44/awscli/examples/s3/sync.rst0000666454262600001440000001122113243367510021355 0ustar pysdk-ciamazon00000000000000The following ``sync`` command syncs objects under a specified prefix and bucket to files in a local directory by uploading the local files to s3. A local file will require uploading if the size of the local file is different than the size of the s3 object, the last modified time of the local file is newer than the last modified time of the s3 object, or the local file does not exist under the specified bucket and prefix. In this example, the user syncs the bucket ``mybucket`` to the local current directory. The local current directory contains the files ``test.txt`` and ``test2.txt``. The bucket ``mybucket`` contains no objects:: aws s3 sync . s3://mybucket Output:: upload: test.txt to s3://mybucket/test.txt upload: test2.txt to s3://mybucket/test2.txt The following ``sync`` command syncs objects under a specified prefix and bucket to objects under another specified prefix and bucket by copying s3 objects. A s3 object will require copying if the sizes of the two s3 objects differ, the last modified time of the source is newer than the last modified time of the destination, or the s3 object does not exist under the specified bucket and prefix destination. In this example, the user syncs the bucket ``mybucket`` to the bucket ``mybucket2``. The bucket ``mybucket`` contains the objects ``test.txt`` and ``test2.txt``. The bucket ``mybucket2`` contains no objects:: aws s3 sync s3://mybucket s3://mybucket2 Output:: copy: s3://mybucket/test.txt to s3://mybucket2/test.txt copy: s3://mybucket/test2.txt to s3://mybucket2/test2.txt The following ``sync`` command syncs files in a local directory to objects under a specified prefix and bucket by downloading s3 objects. A s3 object will require downloading if the size of the s3 object differs from the size of the local file, the last modified time of the s3 object is newer than the last modified time of the local file, or the s3 object does not exist in the local directory. Take note that when objects are downloaded from s3, the last modified time of the local file is changed to the last modified time of the s3 object. In this example, the user syncs the current local directory to the bucket ``mybucket``. The bucket ``mybucket`` contains the objects ``test.txt`` and ``test2.txt``. The current local directory has no files:: aws s3 sync s3://mybucket . Output:: download: s3://mybucket/test.txt to test.txt download: s3://mybucket/test2.txt to test2.txt The following ``sync`` command syncs objects under a specified prefix and bucket to files in a local directory by uploading the local files to s3. Because the ``--delete`` parameter flag is thrown, any files existing under the specified prefix and bucket but not existing in the local directory will be deleted. In this example, the user syncs the bucket ``mybucket`` to the local current directory. The local current directory contains the files ``test.txt`` and ``test2.txt``. The bucket ``mybucket`` contains the object ``test3.txt``:: aws s3 sync . s3://mybucket --delete Output:: upload: test.txt to s3://mybucket/test.txt upload: test2.txt to s3://mybucket/test2.txt delete: s3://mybucket/test3.txt The following ``sync`` command syncs objects under a specified prefix and bucket to files in a local directory by uploading the local files to s3. Because the ``--exclude`` parameter flag is thrown, all files matching the pattern existing both in s3 and locally will be excluded from the sync. In this example, the user syncs the bucket ``mybucket`` to the local current directory. The local current directory contains the files ``test.jpg`` and ``test2.txt``. The bucket ``mybucket`` contains the object ``test.jpg`` of a different size than the local ``test.jpg``:: aws s3 sync . s3://mybucket --exclude "*.jpg" Output:: upload: test2.txt to s3://mybucket/test2.txt The following ``sync`` command syncs files under a local directory to objects under a specified prefix and bucket by downloading s3 objects. This example uses the ``--exclude`` parameter flag to exclude a specified directory and s3 prefix from the ``sync`` command. In this example, the user syncs the local current directory to the bucket ``mybucket``. The local current directory contains the files ``test.txt`` and ``another/test2.txt``. The bucket ``mybucket`` contains the objects ``another/test5.txt`` and ``test1.txt``:: aws s3 sync s3://mybucket/ . --exclude "*another/*" Output:: download: s3://mybucket/test1.txt to test1.txt The following ``sync`` command syncs files between two buckets in different regions:: aws s3 sync s3://my-us-west-2-bucket s3://my-us-east-1-bucket --source-region us-west-2 --region us-east-1 awscli-1.14.44/awscli/examples/s3/_concepts.rst0000666454262600001440000001556513243367510022375 0ustar pysdk-ciamazon00000000000000This section explains prominent concepts and notations in the set of high-level S3 commands provided. Path Argument Type ++++++++++++++++++ Whenever using a command, at least one path argument must be specified. There are two types of path arguments: ``LocalPath`` and ``S3Uri``. ``LocalPath``: represents the path of a local file or directory. It can be written as an absolute path or relative path. ``S3Uri``: represents the location of a S3 object, prefix, or bucket. This must be written in the form ``s3://mybucket/mykey`` where ``mybucket`` is the specified S3 bucket, ``mykey`` is the specified S3 key. The path argument must begin with ``s3://`` in order to denote that the path argument refers to a S3 object. Note that prefixes are separated by forward slashes. For example, if the S3 object ``myobject`` had the prefix ``myprefix``, the S3 key would be ``myprefix/myobject``, and if the object was in the bucket ``mybucket``, the ``S3Uri`` would be ``s3://mybucket/myprefix/myobject``. Order of Path Arguments +++++++++++++++++++++++ Every command takes one or two positional path arguments. The first path argument represents the source, which is the local file/directory or S3 object/prefix/bucket that is being referenced. If there is a second path argument, it represents the destination, which is the local file/directory or S3 object/prefix/bucket that is being operated on. Commands with only one path argument do not have a destination because the operation is being performed only on the source. Single Local File and S3 Object Operations ++++++++++++++++++++++++++++++++++++++++++ Some commands perform operations only on single files and S3 objects. The following commands are single file/object operations if no ``--recursive`` flag is provided. * ``cp`` * ``mv`` * ``rm`` For this type of operation, the first path argument, the source, must exist and be a local file or S3 object. The second path argument, the destination, can be the name of a local file, local directory, S3 object, S3 prefix, or S3 bucket. The destination is indicated as a local directory, S3 prefix, or S3 bucket if it ends with a forward slash or back slash. The use of slash depends on the path argument type. If the path argument is a ``LocalPath``, the type of slash is the separator used by the operating system. If the path is a ``S3Uri``, the forward slash must always be used. If a slash is at the end of the destination, the destination file or object will adopt the name of the source file or object. Otherwise, if there is no slash at the end, the file or object will be saved under the name provided. See examples in ``cp`` and ``mv`` to illustrate this description. Directory and S3 Prefix Operations ++++++++++++++++++++++++++++++++++ Some commands only perform operations on the contents of a local directory or S3 prefix/bucket. Adding or omitting a forward slash or back slash to the end of any path argument, depending on its type, does not affect the results of the operation. The following commands will always result in a directory or S3 prefix/bucket operation: * ``sync`` * ``mb`` * ``rb`` * ``ls`` Use of Exclude and Include Filters ++++++++++++++++++++++++++++++++++ Currently, there is no support for the use of UNIX style wildcards in a command's path arguments. However, most commands have ``--exclude ""`` and ``--include ""`` parameters that can achieve the desired result. These parameters perform pattern matching to either exclude or include a particular file or object. The following pattern symbols are supported. * ``*``: Matches everything * ``?``: Matches any single character * ``[sequence]``: Matches any character in ``sequence`` * ``[!sequence]``: Matches any character not in ``sequence`` Any number of these parameters can be passed to a command. You can do this by providing an ``--exclude`` or ``--include`` argument multiple times, e.g. ``--include "*.txt" --include "*.png"``. When there are multiple filters, the rule is the filters that appear later in the command take precedence over filters that appear earlier in the command. For example, if the filter parameters passed to the command were :: --exclude "*" --include "*.txt" All files will be excluded from the command except for files ending with ``.txt`` However, if the order of the filter parameters was changed to :: --include "*.txt" --exclude "*" All files will be excluded from the command. Each filter is evaluated against the **source directory**. If the source location is a file instead of a directory, the directory containing the file is used as the source directory. For example, suppose you had the following directory structure:: /tmp/foo/ .git/ |---config |---description foo.txt bar.txt baz.jpg In the command ``aws s3 sync /tmp/foo s3://bucket/`` the source directory is ``/tmp/foo``. Any include/exclude filters will be evaluated with the source directory prepended. Below are several examples to demonstrate this. Given the directory structure above and the command ``aws s3 cp /tmp/foo s3://bucket/ --recursive --exclude ".git/*"``, the files ``.git/config`` and ``.git/description`` will be excluded from the files to upload because the exclude filter ``.git/*`` will have the source prepended to the filter. This means that:: /tmp/foo/.git/* -> /tmp/foo/.git/config (matches, should exclude) /tmp/foo/.git/* -> /tmp/foo/.git/description (matches, should exclude) /tmp/foo/.git/* -> /tmp/foo/foo.txt (does not match, should include) /tmp/foo/.git/* -> /tmp/foo/bar.txt (does not match, should include) /tmp/foo/.git/* -> /tmp/foo/baz.jpg (does not match, should include) The command ``aws s3 cp /tmp/foo/ s3://bucket/ --recursive --exclude "ba*"`` will exclude ``/tmp/foo/bar.txt`` and ``/tmp/foo/baz.jpg``:: /tmp/foo/ba* -> /tmp/foo/.git/config (does not match, should include) /tmp/foo/ba* -> /tmp/foo/.git/description (does not match, should include) /tmp/foo/ba* -> /tmp/foo/foo.txt (does not match, should include) /tmp/foo/ba* -> /tmp/foo/bar.txt (matches, should exclude) /tmp/foo/ba* -> /tmp/foo/baz.jpg (matches, should exclude) Note that, by default, *all files are included*. This means that providing **only** an ``--include`` filter will not change what files are transferred. ``--include`` will only re-include files that have been excluded from an ``--exclude`` filter. If you only want to upload files with a particular extension, you need to first exclude all files, then re-include the files with the particular extension. This command will upload **only** files ending with ``.jpg``:: aws s3 cp /tmp/foo/ s3://bucket/ --recursive --exclude "*" --include "*.jpg" If you wanted to include both ``.jpg`` files as well as ``.txt`` files you can run:: aws s3 cp /tmp/foo/ s3://bucket/ --recursive \ --exclude "*" --include "*.jpg" --include "*.txt" awscli-1.14.44/awscli/examples/s3/rb.rst0000666454262600001440000000120113243367510021001 0ustar pysdk-ciamazon00000000000000The following ``rb`` command removes a bucket. In this example, the user's bucket is ``mybucket``. Note that the bucket must be empty in order to remove:: aws s3 rb s3://mybucket Output:: remove_bucket: mybucket The following ``rb`` command uses the ``--force`` parameter to first remove all of the objects in the bucket and then remove the bucket itself. In this example, the user's bucket is ``mybucket`` and the objects in ``mybucket`` are ``test1.txt`` and ``test2.txt``:: aws s3 rb s3://mybucket --force Output:: delete: s3://mybucket/test1.txt delete: s3://mybucket/test2.txt remove_bucket: mybucket awscli-1.14.44/awscli/examples/s3/mv.rst0000666454262600001440000000542213243367510021031 0ustar pysdk-ciamazon00000000000000The following ``mv`` command moves a single file to a specified bucket and key:: aws s3 mv test.txt s3://mybucket/test2.txt Output:: move: test.txt to s3://mybucket/test2.txt The following ``mv`` command moves a single s3 object to a specified bucket and key:: aws s3 mv s3://mybucket/test.txt s3://mybucket/test2.txt Output:: move: s3://mybucket/test.txt to s3://mybucket/test2.txt The following ``mv`` command moves a single object to a specified file locally:: aws s3 mv s3://mybucket/test.txt test2.txt Output:: move: s3://mybucket/test.txt to test2.txt The following ``mv`` command moves a single object to a specified bucket while retaining its original name:: aws s3 mv s3://mybucket/test.txt s3://mybucket2/ Output:: move: s3://mybucket/test.txt to s3://mybucket2/test.txt When passed with the parameter ``--recursive``, the following ``mv`` command recursively moves all objects under a specified prefix and bucket to a specified directory. In this example, the bucket ``mybucket`` has the objects ``test1.txt`` and ``test2.txt``:: aws s3 mv s3://mybucket . --recursive Output:: move: s3://mybucket/test1.txt to test1.txt move: s3://mybucket/test2.txt to test2.txt When passed with the parameter ``--recursive``, the following ``mv`` command recursively moves all files under a specified directory to a specified bucket and prefix while excluding some files by using an ``--exclude`` parameter. In this example, the directory ``myDir`` has the files ``test1.txt`` and ``test2.jpg``:: aws s3 mv myDir s3://mybucket/ --recursive --exclude "*.jpg" Output:: move: myDir/test1.txt to s3://mybucket2/test1.txt When passed with the parameter ``--recursive``, the following ``mv`` command recursively moves all objects under a specified bucket to another bucket while excluding some objects by using an ``--exclude`` parameter. In this example, the bucket ``mybucket`` has the objects ``test1.txt`` and ``another/test1.txt``:: aws s3 mv s3://mybucket/ s3://mybucket2/ --recursive --exclude "mybucket/another/*" Output:: move: s3://mybucket/test1.txt to s3://mybucket2/test1.txt The following ``mv`` command moves a single object to a specified bucket and key while setting the ACL to ``public-read-write``:: aws s3 mv s3://mybucket/test.txt s3://mybucket/test2.txt --acl public-read-write Output:: move: s3://mybucket/test.txt to s3://mybucket/test2.txt The following ``mv`` command illustrates the use of the ``--grants`` option to grant read access to all users and full control to a specific user identified by their email address:: aws s3 mv file.txt s3://mybucket/ --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=emailaddress=user@example.com Output:: move: file.txt to s3://mybucket/file.txt awscli-1.14.44/awscli/examples/s3/ls.rst0000666454262600001440000000547313243367510021033 0ustar pysdk-ciamazon00000000000000The following ``ls`` command lists all of the bucket owned by the user. In this example, the user owns the buckets ``mybucket`` and ``mybucket2``. The timestamp is the date the bucket was created, shown in your machine's time zone. Note if ``s3://`` is used for the path argument ````, it will list all of the buckets as well:: aws s3 ls Output:: 2013-07-11 17:08:50 mybucket 2013-07-24 14:55:44 mybucket2 The following ``ls`` command lists objects and common prefixes under a specified bucket and prefix. In this example, the user owns the bucket ``mybucket`` with the objects ``test.txt`` and ``somePrefix/test.txt``. The ``LastWriteTime`` and ``Length`` are arbitrary. Note that since the ``ls`` command has no interaction with the local filesystem, the ``s3://`` URI scheme is not required to resolve ambiguity and may be omitted:: aws s3 ls s3://mybucket Output:: PRE somePrefix/ 2013-07-25 17:06:27 88 test.txt The following ``ls`` command lists objects and common prefixes under a specified bucket and prefix. However, there are no objects nor common prefixes under the specified bucket and prefix:: aws s3 ls s3://mybucket/noExistPrefix Output:: None The following ``ls`` command will recursively list objects in a bucket. Rather than showing ``PRE dirname/`` in the output, all the content in a bucket will be listed in order:: aws s3 ls s3://mybucket --recursive Output:: 2013-09-02 21:37:53 10 a.txt 2013-09-02 21:37:53 2863288 foo.zip 2013-09-02 21:32:57 23 foo/bar/.baz/a 2013-09-02 21:32:58 41 foo/bar/.baz/b 2013-09-02 21:32:57 281 foo/bar/.baz/c 2013-09-02 21:32:57 73 foo/bar/.baz/d 2013-09-02 21:32:57 452 foo/bar/.baz/e 2013-09-02 21:32:57 896 foo/bar/.baz/hooks/bar 2013-09-02 21:32:57 189 foo/bar/.baz/hooks/foo 2013-09-02 21:32:57 398 z.txt The following ``ls`` command demonstrates the same command using the --human-readable and --summarize options. --human-readable displays file size in Bytes/MiB/KiB/GiB/TiB/PiB/EiB. --summarize displays the total number of objects and total size at the end of the result listing:: aws s3 ls s3://mybucket --recursive --human-readable --summarize Output:: 2013-09-02 21:37:53 10 Bytes a.txt 2013-09-02 21:37:53 2.9 MiB foo.zip 2013-09-02 21:32:57 23 Bytes foo/bar/.baz/a 2013-09-02 21:32:58 41 Bytes foo/bar/.baz/b 2013-09-02 21:32:57 281 Bytes foo/bar/.baz/c 2013-09-02 21:32:57 73 Bytes foo/bar/.baz/d 2013-09-02 21:32:57 452 Bytes foo/bar/.baz/e 2013-09-02 21:32:57 896 Bytes foo/bar/.baz/hooks/bar 2013-09-02 21:32:57 189 Bytes foo/bar/.baz/hooks/foo 2013-09-02 21:32:57 398 Bytes z.txt Total Objects: 10 Total Size: 2.9 MiB awscli-1.14.44/awscli/examples/iot/0000777454262600001440000000000013243367512020122 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/iot/create-certificate-from-csr.rst0000666454262600001440000000277413243367510026135 0ustar pysdk-ciamazon00000000000000Create Batches of Certificates from Batches of CSRs --------------------------------------------------- The following example shows how to create a batch of certificates given a batch of CSRs. Assuming a set of CSRs are located inside of the directory ``my-csr-directory``:: $ ls my-csr-directory/ csr.pem csr2.pem a certificate can be created for each CSR in that directory using a single command. On Linux and OSX, this command is:: $ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/{} This command lists all of the CSRs in ``my-csr-directory`` and pipes each CSR filename to the ``aws iot create-certificate-from-csr`` AWS CLI command to create a certificate for the corresponding CSR. The ``aws iot create-certificate-from-csr`` part of the command can also be ran in parallel to speed up the certificate creation process:: $ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/{} On Windows PowerShell, the command to create certificates for all CSRs in ``my-csr-directory`` is:: > ls -Name my-csr-directory | %{aws iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/$_} On Windows Command Prompt, the command to create certificates for all CSRs in ``my-csr-directory`` is:: > forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request file://@path" awscli-1.14.44/awscli/examples/acm/0000777454262600001440000000000013243367512020067 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/acm/delete-certificate.rst0000666454262600001440000000042513243367510024342 0ustar pysdk-ciamazon00000000000000**To delete an ACM certificate from your account** The following ``delete-certificate`` command deletes the certificate with the specified ARN:: aws acm delete-certificate --certificate-arn arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012awscli-1.14.44/awscli/examples/acm/request-certificate.rst0000666454262600001440000000233613243367510024573 0ustar pysdk-ciamazon00000000000000**To request a new ACM certificate** 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 --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 --validation-method DNS --idempotency-token 91adc45q You can enter an alternative name that can be used to reach your website:: aws acm request-certificate --domain-name www.example.com --validation-method DNS --idempotency-token 91adc45q --subject-alternative-names www.example.net You can also enter multiple alternative names:: aws acm request-certificate --domain-name a.example.com --validation-method DNS --subject-alternative-names b.example.com c.example.com d.example.com *.e.example.com *.f.example.com 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 DNS --subject-alternative-names www.example.com --domain-validation-options DomainName=www.example.com,ValidationDomain=example.com awscli-1.14.44/awscli/examples/acm/resend-validation-email.rst0000666454262600001440000000062413243367510025316 0ustar pysdk-ciamazon00000000000000**To resend validation email for your ACM certificate request** The following ``resend-validation-email`` command tells the Amazon certificate authority to send validation email to the appropriate addresses:: aws acm resend-validation-email --certificate-arn arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012 --domain www.example.com --validation-domain example.com awscli-1.14.44/awscli/examples/acm/list-tags-for-certificate.rst0000666454262600001440000000105213243367510025570 0ustar pysdk-ciamazon00000000000000**To list the tags applied to an ACM Certificate** The following ``list-tags-for-certificate`` command lists the tags applied to a certificate in your account:: aws acm list-tags-for-certificate --certificate-arn arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012 The preceding command produces ouput similar to the following:: { "Tags": [ { "Value": "Website", "Key": "Purpose" }, { "Value": "Alice", "Key": "Admin" } ] } awscli-1.14.44/awscli/examples/acm/remove-tags-from-certificate.rst0000666454262600001440000000060513243367510026272 0ustar pysdk-ciamazon00000000000000**To remove a tag from an ACM Certificate** The following ``remove-tags-from-certificate`` command removes two tags from the specified certificate. Use a space to separate multiple tags:: aws acm remove-tags-from-certificate --certificate-arn arn:aws:acm:us-east-1:1234567890122:certificate/12345678-1234-1234-1234-123456789012 --tags Key=Admin,Value=Alice Key=Purpose,Value=Website awscli-1.14.44/awscli/examples/acm/list-certificates.rst0000666454262600001440000000500613243367510024236 0ustar pysdk-ciamazon00000000000000**To list the ACM certificates for an AWS account** The following ``list-certificates`` command lists the ARNs of the certificates in your account:: aws acm list-certificates The preceding command produces output similar to the following:: { "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" } ] } 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: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 awscli-1.14.44/awscli/examples/acm/get-certificate.rst0000666454262600001440000001027213243367510023660 0ustar pysdk-ciamazon00000000000000**To retrieve an ACM certificate** The following ``get-certificate`` command retrieves the certificate for the specified ARN and the certificate chain:: aws acm get-certificate --certificate-arn arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012 Output similar to the following is displayed:: { "Certificate": "-----BEGIN CERTIFICATE----- MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6 b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ 21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4 nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE= -----END CERTIFICATE-----", "CertificateChain": "-----BEGIN CERTIFICATE----- MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6 b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ 21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4 nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE= -----END CERTIFICATE-----", "-----BEGIN CERTIFICATE----- MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6 b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ 21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4 nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE= -----END CERTIFICATE-----", "-----BEGIN CERTIFICATE----- MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6 b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAd BgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcN MTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYD VQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25z b2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFt YXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ 21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9T rDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpE Ibb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4 nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0Fkb FFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTb NYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE= -----END CERTIFICATE-----" } awscli-1.14.44/awscli/examples/acm/add-tags-to-certificate.rst0000666454262600001440000000057013243367510025205 0ustar pysdk-ciamazon00000000000000**To add tags to an existing ACM Certificate** The following ``add-tags-to-certificate`` command adds two tags to the specified certificate. Use a space to separate multiple tags:: aws acm add-tags-to-certificate --certificate-arn arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012 --tags Key=Admin,Value=Alice Key=Purpose,Value=Website awscli-1.14.44/awscli/examples/acm/describe-certificate.rst0000666454262600001440000000413013243367510024655 0ustar pysdk-ciamazon00000000000000**To retrieve the fields contained in an ACM certificate** The following ``describe-certificate`` command retrieves all of the fields for the certificate with the specified ARN:: aws acm describe-certificate --certificate-arn arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012 Output similar to the following is displayed:: { "Certificate": { "CertificateArn": "arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012", "CreatedAt": 1446835267.0, "DomainName": "www.example.com", "DomainValidationOptions": [ { "DomainName": "www.example.com", "ValidationDomain": "www.example.com", "ValidationEmails": [ "hostmaster@example.com", "admin@example.com", "owner@example.com.whoisprivacyservice.org", "tech@example.com.whoisprivacyservice.org", "admin@example.com.whoisprivacyservice.org", "postmaster@example.com", "webmaster@example.com", "administrator@example.com" ] }, { "DomainName": "www.example.net", "ValidationDomain": "www.example.net", "ValidationEmails": [ "postmaster@example.net", "admin@example.net", "owner@example.net.whoisprivacyservice.org", "tech@example.net.whoisprivacyservice.org", "admin@example.net.whoisprivacyservice.org", "hostmaster@example.net", "administrator@example.net", "webmaster@example.net" ] } ], "InUseBy": [], "IssuedAt": 1446835815.0, "Issuer": "Amazon", "KeyAlgorithm": "RSA-2048", "NotAfter": 1478433600.0, "NotBefore": 1446768000.0, "Serial": "0f:ac:b0:a3:8d:ea:65:52:2d:7d:01:3a:39:36:db:d6", "SignatureAlgorithm": "SHA256WITHRSA", "Status": "ISSUED", "Subject": "CN=www.example.com", "SubjectAlternativeNames": [ "www.example.com", "www.example.net" ] } } awscli-1.14.44/awscli/examples/opsworks/0000777454262600001440000000000013243367512021216 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/opsworks/register-elastic-ip.rst0000666454262600001440000000127113243367510025623 0ustar pysdk-ciamazon00000000000000**To register an Elastic IP address with a stack** The following example registers an Elastic IP address, identified by its IP address, with a specified stack. **Note:** The Elastic IP address must be in the same region as the stack. :: aws opsworks register-elastic-ip --region us-east-1 --stack-id d72553d4-8727-448c-9b00-f024f0ba1b06 --elastic-ip 54.148.130.96 *Output* :: { "ElasticIp": "54.148.130.96" } **More Information** For more information, see `Registering Elastic IP Addresses with a Stack`_ in the *OpsWorks User Guide*. .. _`Registering Elastic IP Addresses with a Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-reg.html#resources-reg-eip awscli-1.14.44/awscli/examples/opsworks/start-instance.rst0000666454262600001440000000152313243367510024706 0ustar pysdk-ciamazon00000000000000**To start an instance** The following ``start-instance`` command starts a specified 24/7 instance. :: aws opsworks start-instance --instance-id f705ee48-9000-4890-8bd3-20eb05825aaf *Output*: None. Use describe-instances_ to check the instance's status. .. _describe-instances: http://docs.aws.amazon.com/cli/latest/reference/opsworks/describe-instances.html **Tip** You can start every offline instance in a stack with one command by calling start-stack_. .. _start-stack: http://docs.aws.amazon.com/cli/latest/reference/opsworks/start-stack.html **More Information** For more information, see `Manually Starting, Stopping, and Rebooting 24/7 Instances`_ in the *AWS OpsWorks User Guide*. .. _`Manually Starting, Stopping, and Rebooting 24/7 Instances`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-starting.html awscli-1.14.44/awscli/examples/opsworks/unassign-instance.rst0000666454262600001440000000101413243367510025373 0ustar pysdk-ciamazon00000000000000**To unassign a registered instance from its layers** The following ``unassign-instance`` command unassigns an instance from its attached layers. :: aws opsworks --region us-east-1 unassign-instance --instance-id 4d6d1710-ded9-42a1-b08e-b043ad7af1e2 **Output**: None. **More Information** For more information, see `Unassigning a Registered Instance`_ in the *AWS OpsWorks User Guide*. .. _`Unassigning a Registered Instance`: http://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-unassign.html awscli-1.14.44/awscli/examples/opsworks/update-volume.rst0000666454262600001440000000136613243367510024543 0ustar pysdk-ciamazon00000000000000**To update a registered volume** The following example updates a registered Amazon Elastic Block Store (Amazon EBS) volume's mount point. The volume is identified by its volume ID, which is the GUID that AWS OpsWorks assigns to the volume when you register it with a stack, not the Amazon Elastic Compute Cloud (Amazon EC2) volume ID.:: aws opsworks --region us-east-1 update-volume --volume-id 8430177d-52b7-4948-9c62-e195af4703df --mount-point /mnt/myvol *Output*: None. **More Information** For more information, see `Assigning Amazon EBS Volumes to an Instance`_ in the *AWS OpsWorks User Guide*. .. _`Assigning Amazon EBS Volumes to an Instance`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-attach.html#resources-attach-ebs awscli-1.14.44/awscli/examples/opsworks/stop-stack.rst0000666454262600001440000000100713243367510024034 0ustar pysdk-ciamazon00000000000000**To stop a stack's instances** The following example stops all of a stack's 24/7 instances. To stop a particular instance, use ``stop-instance``. :: aws opsworks --region us-east-1 stop-stack --stack-id 8c428b08-a1a1-46ce-a5f8-feddc43771b8 *Output*: No output. **More Information** For more information, see `Stopping an Instance`_ in the *AWS OpsWorks User Guide*. .. _`Stopping an Instance`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-starting.html#workinginstances-starting-stop awscli-1.14.44/awscli/examples/opsworks/describe-instances.rst0000666454262600001440000000651413243367510025521 0ustar pysdk-ciamazon00000000000000**To describe instances** The following ``describe-instances`` commmand describes the instances in a specified stack:: aws opsworks --region us-east-1 describe-instances --stack-id 8c428b08-a1a1-46ce-a5f8-feddc43771b8 *Output*: The following output example is for a stack with two instances. The first is a registered EC2 instance, and the second was created by AWS OpsWorks. :: { "Instances": [ { "StackId": "71c7ca72-55ae-4b6a-8ee1-a8dcded3fa0f", "PrivateDns": "ip-10-31-39-66.us-west-2.compute.internal", "LayerIds": [ "26cf1d32-6876-42fa-bbf1-9cadc0bff938" ], "EbsOptimized": false, "ReportedOs": { "Version": "14.04", "Name": "ubuntu", "Family": "debian" }, "Status": "online", "InstanceId": "4d6d1710-ded9-42a1-b08e-b043ad7af1e2", "SshKeyName": "US-West-2", "InfrastructureClass": "ec2", "RootDeviceVolumeId": "vol-d08ec6c1", "SubnetId": "subnet-b8de0ddd", "InstanceType": "t1.micro", "CreatedAt": "2015-02-24T20:52:49+00:00", "AmiId": "ami-35501205", "Hostname": "ip-192-0-2-0", "Ec2InstanceId": "i-5cd23551", "PublicDns": "ec2-192-0-2-0.us-west-2.compute.amazonaws.com", "SecurityGroupIds": [ "sg-c4d3f0a1" ], "Architecture": "x86_64", "RootDeviceType": "ebs", "InstallUpdatesOnBoot": true, "Os": "Custom", "VirtualizationType": "paravirtual", "AvailabilityZone": "us-west-2a", "PrivateIp": "10.31.39.66", "PublicIp": "192.0.2.06", "RegisteredBy": "arn:aws:iam::123456789102:user/AWS/OpsWorks/OpsWorks-EC2Register-i-5cd23551" }, { "StackId": "71c7ca72-55ae-4b6a-8ee1-a8dcded3fa0f", "PrivateDns": "ip-10-31-39-158.us-west-2.compute.internal", "SshHostRsaKeyFingerprint": "69:6b:7b:8b:72:f3:ed:23:01:00:05:bc:9f:a4:60:c1", "LayerIds": [ "26cf1d32-6876-42fa-bbf1-9cadc0bff938" ], "EbsOptimized": false, "ReportedOs": {}, "Status": "booting", "InstanceId": "9b137a0d-2f5d-4cc0-9704-13da4b31fdcb", "SshKeyName": "US-West-2", "InfrastructureClass": "ec2", "RootDeviceVolumeId": "vol-e09dd5f1", "SubnetId": "subnet-b8de0ddd", "InstanceProfileArn": "arn:aws:iam::123456789102:instance-profile/aws-opsworks-ec2-role", "InstanceType": "c3.large", "CreatedAt": "2015-02-24T21:29:33+00:00", "AmiId": "ami-9fc29baf", "SshHostDsaKeyFingerprint": "fc:87:95:c3:f5:e1:3b:9f:d2:06:6e:62:9a:35:27:e8", "Ec2InstanceId": "i-8d2dca80", "PublicDns": "ec2-192-0-2-1.us-west-2.compute.amazonaws.com", "SecurityGroupIds": [ "sg-b022add5", "sg-b122add4" ], "Architecture": "x86_64", "RootDeviceType": "ebs", "InstallUpdatesOnBoot": true, "Os": "Amazon Linux 2014.09", "VirtualizationType": "paravirtual", "AvailabilityZone": "us-west-2a", "Hostname": "custom11", "PrivateIp": "10.31.39.158", "PublicIp": "192.0.2.0" } ] } **More Information** For more information, see `Instances`_ in the *AWS OpsWorks User Guide*. .. _`Instances`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances.html awscli-1.14.44/awscli/examples/opsworks/describe-my-user-profile.rst0000666454262600001440000000150613243367510026565 0ustar pysdk-ciamazon00000000000000**To obtain a user's profile** The following example shows how to obtain the profile of the AWS Identity and Access Management (IAM) user that is running the command. :: aws opsworks --region us-east-1 describe-user-profile *Output*: For brevity, most of the user's SSH public key is replaced by an ellipsis (...). :: { "UserProfile": { "IamUserArn": "arn:aws:iam::123456789012:user/myusername", "SshPublicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQ...3LQ4aX9jpxQw== rsa-key-20141104", "Name": "myusername", "SshUsername": "myusername" } } **More Information** For more information, see `Importing Users into AWS OpsWorks`_ in the *AWS OpsWorks User Guide*. .. _`Importing Users into AWS OpsWorks`: http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users-manage-import.html awscli-1.14.44/awscli/examples/opsworks/describe-timebased-auto-scaling.rst0000666454262600001440000000231413243367510030045 0ustar pysdk-ciamazon00000000000000**To describe the time-based scaling configuration of an instance** The following example describes a specified instance's time-based scaling configuration. The instance is identified by its instance ID, which you can find on the instances's details page or by running ``describe-instances``. :: aws opsworks describe-time-based-auto-scaling --region us-east-1 --instance-ids 701f2ffe-5d8e-4187-b140-77b75f55de8d *Output*: The example has a single time-based instance. :: { "TimeBasedAutoScalingConfigurations": [ { "InstanceId": "701f2ffe-5d8e-4187-b140-77b75f55de8d", "AutoScalingSchedule": { "Monday": { "11": "on", "10": "on", "13": "on", "12": "on" }, "Tuesday": { "11": "on", "10": "on", "13": "on", "12": "on" } } } ] } **More Information** For more information, see `How Automatic Time-based Scaling Works`_ in the *AWS OpsWorks User Guide*. .. _`How Automatic Time-based Scaling Works`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-autoscaling.html#workinginstances-autoscaling-timebased awscli-1.14.44/awscli/examples/opsworks/delete-instance.rst0000666454262600001440000000210413243367510025007 0ustar pysdk-ciamazon00000000000000**To delete an instance** The following example deletes a specified instance, which is identified by its instance ID. It also deletes any attached Amazon Elastic Block Store (Amazon EBS) volumes or Elastic IP addresses. You can obtain an instance ID by going to the instance's details page on the AWS OpsWorks console or by running the ``describe-instances`` command. If the instance is online, you must first stop the instance by calling ``stop-instance``, and then wait until the instance has stopped. You can use ``describe-instances`` to check the instance status. :: aws opsworks delete-instance --region us-east-1 --instance-id 3a21cfac-4a1f-4ce2-a921-b2cfba6f7771 To retain the instance's Amazon EBS volumes or Elastic IP addresses, use the ``--no-delete-volumes`` or ``--no-delete-elastic-ip`` arguments, respectively. *Output*: None. **More Information** For more information, see `Deleting AWS OpsWorks Instances`_ in the *AWS OpsWorks User Guide*. .. _`Deleting AWS OpsWorks Instances`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-delete.html awscli-1.14.44/awscli/examples/opsworks/delete-stack.rst0000666454262600001440000000133513243367510024315 0ustar pysdk-ciamazon00000000000000**To delete a stack** The following example deletes a specified stack, which is identified by its stack ID. You can obtain a stack ID by clicking **Stack Settings** on the AWS OpsWorks console or by running the ``describe-stacks`` command. **Note:** Before deleting a layer, you must use ``delete-app``, ``delete-instance``, and ``delete-layer`` to delete all of the stack's apps, instances, and layers. :: aws opsworks delete-stack --region us-east-1 --stack-id 154a9d89-7e9e-433b-8de8-617e53756c84 *Output*: None. **More Information** For more information, see `Shut Down a Stack`_ in the *AWS OpsWorks User Guide*. .. _`Shut Down a Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-shutting.html awscli-1.14.44/awscli/examples/opsworks/set-load-based-auto-scaling.rst0000666454262600001440000000250613243367510027121 0ustar pysdk-ciamazon00000000000000**To set the load-based scaling configuration for a layer** The following example enables load-based scaling for a specified layer and sets the configuration for that layer. You must use ``create-instance`` to add load-based instances to the layer. :: aws opsworks --region us-east-1 set-load-based-auto-scaling --layer-id 523569ae-2faf-47ac-b39e-f4c4b381f36d --enable --up-scaling file://upscale.json --down-scaling file://downscale.json The example puts the upscaling threshold settings in a separate file in the working directory named ``upscale.json``, which contains the following. :: { "InstanceCount": 2, "ThresholdsWaitTime": 3, "IgnoreMetricsTime": 3, "CpuThreshold": 85, "MemoryThreshold": 85, "LoadThreshold": 85 } The example puts the downscaling threshold settings in a separate file in the working directory named ``downscale.json``, which contains the following. :: { "InstanceCount": 2, "ThresholdsWaitTime": 3, "IgnoreMetricsTime": 3, "CpuThreshold": 35, "MemoryThreshold": 30, "LoadThreshold": 30 } *Output*: None. **More Information** For more information, see `Using Automatic Load-based Scaling`_ in the *AWS OpsWorks User Guide*. .. _`Using Automatic Load-based Scaling`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-autoscaling-loadbased.html awscli-1.14.44/awscli/examples/opsworks/create-instance.rst0000666454262600001440000000202213243367510025007 0ustar pysdk-ciamazon00000000000000**To create an instance** The following ``create-instance`` command creates an m1.large Amazon Linux instance named myinstance1 in a specified stack. The instance is assigned to one layer. :: aws opsworks --region us-east-1 create-instance --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --layer-ids 5c8c272a-f2d5-42e3-8245-5bf3927cb65b --hostname myinstance1 --instance-type m1.large --os "Amazon Linux" To use an autogenerated name, call `get-hostname-suggestion`_, which generates a hostname based on the theme that you specified when you created the stack. Then pass that name to the `hostname` argument. .. _get-hostname-suggestion: http://docs.aws.amazon.com/cli/latest/reference/opsworks/get-hostname-suggestion.html *Output*:: { "InstanceId": "5f9adeaa-c94c-42c6-aeef-28a5376002cd" } **More Information** For more information, see `Adding an Instance to a Layer`_ in the *AWS OpsWorks User Guide*. .. _`Adding an Instance to a Layer`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html awscli-1.14.44/awscli/examples/opsworks/deregister-volume.rst0000666454262600001440000000117613243367510025415 0ustar pysdk-ciamazon00000000000000**To deregister an Amazon EBS volume** The following example deregisters an EBS volume from its stack. The volume is identified by its volume ID, which is the GUID that AWS OpsWorks assigned when you registered the volume with the stack, not the EC2 volume ID. :: aws opsworks deregister-volume --region us-east-1 --volume-id 5c48ef52-3144-4bf5-beaa-fda4deb23d4d *Output*: None. **More Information** For more information, see `Deregistering Amazon EBS Volumes`_ in the *AWS OpsWorks User Guide*. .. _`Deregistering Amazon EBS Volumes`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-dereg.html#resources-dereg-ebs awscli-1.14.44/awscli/examples/opsworks/describe-user-profiles.rst0000666454262600001440000000163213243367510026325 0ustar pysdk-ciamazon00000000000000**To describe user profiles** The following ``describe-user-profiles`` command describes the account's user profiles. :: aws opsworks --region us-east-1 describe-user-profiles *Output*:: { "UserProfiles": [ { "IamUserArn": "arn:aws:iam::123456789012:user/someuser", "SshPublicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAkOuP7i80q3Cko...", "AllowSelfManagement": true, "Name": "someuser", "SshUsername": "someuser" }, { "IamUserArn": "arn:aws:iam::123456789012:user/cli-user-test", "AllowSelfManagement": true, "Name": "cli-user-test", "SshUsername": "myusername" } ] } **More Information** For more information, see `Managing AWS OpsWorks Users`_ in the *AWS OpsWorks User Guide*. .. _`Managing AWS OpsWorks Users`: http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users-manage.html awscli-1.14.44/awscli/examples/opsworks/describe-rds-db-instances.rst0000666454262600001440000000176513243367510026675 0ustar pysdk-ciamazon00000000000000**To describe a stack's registered Amazon RDS instances** The following example describes the Amazon RDS instances registered with a specified stack. :: aws opsworks --region us-east-1 describe-rds-db-instances --stack-id d72553d4-8727-448c-9b00-f024f0ba1b06 *Output*: The following is the output for a stack with one registered RDS instance. :: { "RdsDbInstances": [ { "Engine": "mysql", "StackId": "d72553d4-8727-448c-9b00-f024f0ba1b06", "MissingOnRds": false, "Region": "us-west-2", "RdsDbInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:clitestdb", "DbPassword": "*****FILTERED*****", "Address": "clitestdb.cdlqlk5uwd0k.us-west-2.rds.amazonaws.com", "DbUser": "cliuser", "DbInstanceIdentifier": "clitestdb" } ] } For more information, see `Resource Management`_ in the *AWS OpsWorks User Guide*. .. _`Resource Management`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html awscli-1.14.44/awscli/examples/opsworks/update-elastic-ip.rst0000666454262600001440000000066413243367510025266 0ustar pysdk-ciamazon00000000000000**To update an Elastic IP address name** The following example updates the name of a specified Elastic IP address. :: aws opsworks --region us-east-1 update-elastic-ip --elastic-ip 54.148.130.96 --name NewIPName *Output*: None. **More Information** For more information, see `Resource Management`_ in the *AWS OpsWorks User Guide*. .. _`Resource Management`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html awscli-1.14.44/awscli/examples/opsworks/set-permission.rst0000666454262600001440000000236413243367510024734 0ustar pysdk-ciamazon00000000000000**To grant per-stack AWS OpsWorks permission levels** When you import an AWS Identity and Access Management (IAM) user into AWS OpsWorks by calling ``create-user-profile``, the user has only those permissions that are granted by the attached IAM policies. You can grant AWS OpsWorks permissions by modifying a user's policies. However, it is often easier to import a user and then use the ``set-permission`` command to grant the user one of the standard permission levels for each stack to which the user will need access. The following example grants permission for the specified stack for a user, who is identified by Amazon Resource Name (ARN). The example grants the user a Manage permissions level, with sudo and SSH privileges on the stack's instances. :: aws opsworks set-permission --region us-east-1 --stack-id 71c7ca72-55ae-4b6a-8ee1-a8dcded3fa0f --level manage --iam-user-arn arn:aws:iam::123456789102:user/cli-user-test --allow-ssh --allow-sudo *Output*: None. **More Information** For more information, see `Granting AWS OpsWorks Users Per-Stack Permissions`_ in the *AWS OpsWorks User Guide*. .. _`Granting AWS OpsWorks Users Per-Stack Permissions`: http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users-console.html awscli-1.14.44/awscli/examples/opsworks/update-layer.rst0000666454262600001440000000100713243367510024340 0ustar pysdk-ciamazon00000000000000**To update a layer** The following example updates a specified layer to use Amazon EBS-optimized instances. :: aws opsworks --region us-east-1 update-layer --layer-id 888c5645-09a5-4d0e-95a8-812ef1db76a4 --use-ebs-optimized-instances *Output*: None. **More Information** For more information, see `Editing an OpsWorks Layer's Configuration`_ in the *AWS OpsWorks User Guide*. .. _`Editing an OpsWorks Layer's Configuration`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html awscli-1.14.44/awscli/examples/opsworks/describe-commands.rst0000666454262600001440000000370413243367510025331 0ustar pysdk-ciamazon00000000000000**To describe commands** The following ``describe-commands`` commmand describes the commands in a specified instance. :: aws opsworks --region us-east-1 describe-commands --instance-id 8c2673b9-3fe5-420d-9cfa-78d875ee7687 *Output*:: { "Commands": [ { "Status": "successful", "CompletedAt": "2013-07-25T18:57:47+00:00", "InstanceId": "8c2673b9-3fe5-420d-9cfa-78d875ee7687", "DeploymentId": "6ed0df4c-9ef7-4812-8dac-d54a05be1029", "AcknowledgedAt": "2013-07-25T18:57:41+00:00", "LogUrl": "https://s3.amazonaws.com/prod_stage-log/logs/008c1a91-ec59-4d51-971d-3adff54b00cc?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE &Expires=1375394373&Signature=HkXil6UuNfxTCC37EPQAa462E1E%3D&response-cache-control=private&response-content-encoding=gzip&response-content- type=text%2Fplain", "Type": "undeploy", "CommandId": "008c1a91-ec59-4d51-971d-3adff54b00cc", "CreatedAt": "2013-07-25T18:57:34+00:00", "ExitCode": 0 }, { "Status": "successful", "CompletedAt": "2013-07-25T18:55:40+00:00", "InstanceId": "8c2673b9-3fe5-420d-9cfa-78d875ee7687", "DeploymentId": "19d3121e-d949-4ff2-9f9d-94eac087862a", "AcknowledgedAt": "2013-07-25T18:55:32+00:00", "LogUrl": "https://s3.amazonaws.com/prod_stage-log/logs/899d3d64-0384-47b6-a586-33433aad117c?AWSAccessKeyId=AKIAIOSFODNN7EXAMPLE &Expires=1375394373&Signature=xMsJvtLuUqWmsr8s%2FAjVru0BtRs%3D&response-cache-control=private&response-content-encoding=gzip&response-conten t-type=text%2Fplain", "Type": "deploy", "CommandId": "899d3d64-0384-47b6-a586-33433aad117c", "CreatedAt": "2013-07-25T18:55:29+00:00", "ExitCode": 0 } ] } **More Information** For more information, see `AWS OpsWorks Lifecycle Events`_ in the *AWS OpsWorks User Guide*. .. _`AWS OpsWorks Lifecycle Events`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-events.html awscli-1.14.44/awscli/examples/opsworks/update-instance.rst0000666454262600001440000000074513243367510025040 0ustar pysdk-ciamazon00000000000000**To update an instance** The following example updates a specified instance's type. :: aws opsworks --region us-east-1 update-instance --instance-id dfe18b02-5327-493d-91a4-c5c0c448927f --instance-type c3.xlarge *Output*: None. **More Information** For more information, see `Editing the Instance Configuration`_ in the *AWS OpsWorks User Guide*. .. _`Editing the Instance Configuration`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-properties.html awscli-1.14.44/awscli/examples/opsworks/describe-stack-summary.rst0000666454262600001440000000140213243367510026321 0ustar pysdk-ciamazon00000000000000**To describe a stack's configuration** The following ``describe-stack-summary`` command returns a summary of the specified stack's configuration. :: aws opsworks --region us-east-1 describe-stack-summary --stack-id 8c428b08-a1a1-46ce-a5f8-feddc43771b8 *Output*:: { "StackSummary": { "StackId": "8c428b08-a1a1-46ce-a5f8-feddc43771b8", "InstancesCount": { "Booting": 1 }, "Name": "CLITest", "AppsCount": 1, "LayersCount": 1, "Arn": "arn:aws:opsworks:us-west-2:123456789012:stack/8c428b08-a1a1-46ce-a5f8-feddc43771b8/" } } **More Information** For more information, see `Stacks`_ in the *AWS OpsWorks User Guide*. .. _`Stacks`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks.html awscli-1.14.44/awscli/examples/opsworks/get-hostname-suggestion.rst0000666454262600001440000000126713243367510026534 0ustar pysdk-ciamazon00000000000000**To get the next hostname for a layer** The following example gets the next generated hostname for a specified layer. The layer used for this example is a Java Application Server layer with one instance. The stack's hostname theme is the default, Layer_Dependent. :: aws opsworks --region us-east-1 get-hostname-suggestion --layer-id 888c5645-09a5-4d0e-95a8-812ef1db76a4 *Output*:: { "Hostname": "java-app2", "LayerId": "888c5645-09a5-4d0e-95a8-812ef1db76a4" } **More Information** For more information, see `Create a New Stack`_ in the *AWS OpsWorks User Guide*. .. _`Create a New Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html awscli-1.14.44/awscli/examples/opsworks/create-user-profile.rst0000666454262600001440000000222513243367510025624 0ustar pysdk-ciamazon00000000000000**To create a user profile** You import an AWS Identity and Access Manager (IAM) user into AWS OpsWorks by calling `create-user-profile` to create a user profile. The following example creates a user profile for the cli-user-test IAM user, who is identified by Amazon Resource Name (ARN). The example assigns the user an SSH username of ``myusername`` and enables self management, which allows the user to specify an SSH public key. :: aws opsworks --region us-east-1 create-user-profile --iam-user-arn arn:aws:iam::123456789102:user/cli-user-test --ssh-username myusername --allow-self-management *Output*:: { "IamUserArn": "arn:aws:iam::123456789102:user/cli-user-test" } **Tip**: This command imports an IAM user into AWS OpsWorks, but only with the permissions that are granted by the attached policies. You can grant per-stack AWS OpsWorks permissions by using the ``set-permissions`` command. **More Information** For more information, see `Importing Users into AWS OpsWorks`_ in the *AWS OpsWorks User Guide*. .. _`Importing Users into AWS OpsWorks`: http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users-manage-import.html awscli-1.14.44/awscli/examples/opsworks/describe-layers.rst0000666454262600001440000001321513243367510025025 0ustar pysdk-ciamazon00000000000000**To describe a stack's layers** The following ``describe-layers`` commmand describes the layers in a specified stack:: aws opsworks --region us-east-1 describe-layers --stack-id 38ee91e2-abdc-4208-a107-0b7168b3cc7a *Output*:: { "Layers": [ { "StackId": "38ee91e2-abdc-4208-a107-0b7168b3cc7a", "Type": "db-master", "DefaultSecurityGroupNames": [ "AWS-OpsWorks-DB-Master-Server" ], "Name": "MySQL", "Packages": [], "DefaultRecipes": { "Undeploy": [], "Setup": [ "opsworks_initial_setup", "ssh_host_keys", "ssh_users", "mysql::client", "dependencies", "ebs", "opsworks_ganglia::client", "mysql::server", "dependencies", "deploy::mysql" ], "Configure": [ "opsworks_ganglia::configure-client", "ssh_users", "agent_version", "deploy::mysql" ], "Shutdown": [ "opsworks_shutdown::default", "mysql::stop" ], "Deploy": [ "deploy::default", "deploy::mysql" ] }, "CustomRecipes": { "Undeploy": [], "Setup": [], "Configure": [], "Shutdown": [], "Deploy": [] }, "EnableAutoHealing": false, "LayerId": "41a20847-d594-4325-8447-171821916b73", "Attributes": { "MysqlRootPasswordUbiquitous": "true", "RubygemsVersion": null, "RailsStack": null, "HaproxyHealthCheckMethod": null, "RubyVersion": null, "BundlerVersion": null, "HaproxyStatsPassword": null, "PassengerVersion": null, "MemcachedMemory": null, "EnableHaproxyStats": null, "ManageBundler": null, "NodejsVersion": null, "HaproxyHealthCheckUrl": null, "MysqlRootPassword": "*****FILTERED*****", "GangliaPassword": null, "GangliaUser": null, "HaproxyStatsUrl": null, "GangliaUrl": null, "HaproxyStatsUser": null }, "Shortname": "db-master", "AutoAssignElasticIps": false, "CustomSecurityGroupIds": [], "CreatedAt": "2013-07-25T18:11:19+00:00", "VolumeConfigurations": [ { "MountPoint": "/vol/mysql", "Size": 10, "NumberOfDisks": 1 } ] }, { "StackId": "38ee91e2-abdc-4208-a107-0b7168b3cc7a", "Type": "custom", "DefaultSecurityGroupNames": [ "AWS-OpsWorks-Custom-Server" ], "Name": "TomCustom", "Packages": [], "DefaultRecipes": { "Undeploy": [], "Setup": [ "opsworks_initial_setup", "ssh_host_keys", "ssh_users", "mysql::client", "dependencies", "ebs", "opsworks_ganglia::client" ], "Configure": [ "opsworks_ganglia::configure-client", "ssh_users", "agent_version" ], "Shutdown": [ "opsworks_shutdown::default" ], "Deploy": [ "deploy::default" ] }, "CustomRecipes": { "Undeploy": [], "Setup": [ "tomcat::setup" ], "Configure": [ "tomcat::configure" ], "Shutdown": [], "Deploy": [ "tomcat::deploy" ] }, "EnableAutoHealing": true, "LayerId": "e6cbcd29-d223-40fc-8243-2eb213377440", "Attributes": { "MysqlRootPasswordUbiquitous": null, "RubygemsVersion": null, "RailsStack": null, "HaproxyHealthCheckMethod": null, "RubyVersion": null, "BundlerVersion": null, "HaproxyStatsPassword": null, "PassengerVersion": null, "MemcachedMemory": null, "EnableHaproxyStats": null, "ManageBundler": null, "NodejsVersion": null, "HaproxyHealthCheckUrl": null, "MysqlRootPassword": null, "GangliaPassword": null, "GangliaUser": null, "HaproxyStatsUrl": null, "GangliaUrl": null, "HaproxyStatsUser": null }, "Shortname": "tomcustom", "AutoAssignElasticIps": false, "CustomSecurityGroupIds": [], "CreatedAt": "2013-07-25T18:12:53+00:00", "VolumeConfigurations": [] } ] } **More Information** For more information, see Layers_ in the *AWS OpsWorks User Guide*. .. _Layers: http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers.html awscli-1.14.44/awscli/examples/opsworks/unassign-volume.rst0000666454262600001440000000131713243367510025104 0ustar pysdk-ciamazon00000000000000**To unassign a volume from its instance** The following example unassigns a registered Amazon Elastic Block Store (Amazon EBS) volume from its instance. The volume is identified by its volume ID, which is the GUID that AWS OpsWorks assigns when you register the volume with a stack, not the Amazon Elastic Compute Cloud (Amazon EC2) volume ID. :: aws opsworks --region us-east-1 unassign-volume --volume-id 8430177d-52b7-4948-9c62-e195af4703df *Output*: None. **More Information** For more information, see `Unassigning Amazon EBS Volumes`_ in the *AWS OpsWorks User Guide*. .. _`Unassigning Amazon EBS Volumes`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-detach.html#resources-detach-ebs awscli-1.14.44/awscli/examples/opsworks/register-volume.rst0000666454262600001440000000117713243367510025105 0ustar pysdk-ciamazon00000000000000**To register an Amazon EBS volume with a stack** The following example registers an Amazon EBS volume, identified by its volume ID, with a specified stack. :: aws opsworks register-volume --region us-east-1 --stack-id d72553d4-8727-448c-9b00-f024f0ba1b06 --ec-2-volume-id vol-295c1638 *Output*:: { "VolumeId": "ee08039c-7cb7-469f-be10-40fb7f0c05e8" } **More Information** For more information, see `Registering Amazon EBS Volumes with a Stack`_ in the *AWS OpsWorks User Guide*. .. _`Registering Amazon EBS Volumes with a Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-reg.html#resources-reg-ebs awscli-1.14.44/awscli/examples/opsworks/associate-elastic-ip.rst0000666454262600001440000000076013243367510025754 0ustar pysdk-ciamazon00000000000000**To associate an Elastic IP address with an instance** The following example associates an Elastic IP address with a specified instance. :: aws opsworks --region us-east-1 associate-elastic-ip --instance-id dfe18b02-5327-493d-91a4-c5c0c448927f --elastic-ip 54.148.130.96 *Output*: None. **More Information** For more information, see `Resource Management`_ in the *AWS OpsWorks User Guide*. .. _`Resource Management`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html awscli-1.14.44/awscli/examples/opsworks/assign-volume.rst0000666454262600001440000000161113243367510024536 0ustar pysdk-ciamazon00000000000000**To assign a registered volume to an instance** The following example assigns a registered Amazon Elastic Block Store (Amazon EBS) volume to an instance. The volume is identified by its volume ID, which is the GUID that AWS OpsWorks assigns when you register the volume with a stack, not the Amazon Elastic Compute Cloud (Amazon EC2) volume ID. Before you run ``assign-volume``, you must first run ``update-volume`` to assign a mount point to the volume. :: aws opsworks --region us-east-1 assign-volume --instance-id 4d6d1710-ded9-42a1-b08e-b043ad7af1e2 --volume-id 26cf1d32-6876-42fa-bbf1-9cadc0bff938 *Output*: None. **More Information** For more information, see `Assigning Amazon EBS Volumes to an Instance`_ in the *AWS OpsWorks User Guide*. .. _`Assigning Amazon EBS Volumes to an Instance`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-attach.html#resources-attach-ebs awscli-1.14.44/awscli/examples/opsworks/describe-permissions.rst0000666454262600001440000000160713243367510026103 0ustar pysdk-ciamazon00000000000000**To obtain a user's per-stack AWS OpsWorks permission level** The following example shows how to to obtain an AWS Identity and Access Management (IAM) user's permission level on a specified stack. :: aws opsworks --region us-east-1 describe-permissions --iam-user-arn arn:aws:iam::123456789012:user/cli-user-test --stack-id d72553d4-8727-448c-9b00-f024f0ba1b06 *Output*:: { "Permissions": [ { "StackId": "d72553d4-8727-448c-9b00-f024f0ba1b06", "IamUserArn": "arn:aws:iam::123456789012:user/cli-user-test", "Level": "manage", "AllowSudo": true, "AllowSsh": true } ] } **More Information** For more information, see `Granting Per-Stack Permissions Levels`_ in the *AWS OpsWorks User Guide*. .. _`Granting Per-Stack Permissions Levels`: http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users-console.html awscli-1.14.44/awscli/examples/opsworks/stop-instance.rst0000666454262600001440000000137213243367510024540 0ustar pysdk-ciamazon00000000000000**To stop an instance** The following example stops a specified instance, which is identified by its instance ID. You can obtain an instance ID by going to the instance's details page on the AWS OpsWorks console or by running the ``describe-instances`` command. :: aws opsworks stop-instance --region us-east-1 --instance-id 3a21cfac-4a1f-4ce2-a921-b2cfba6f7771 You can restart a stopped instance by calling ``start-instance`` or by deleting the instance by calling ``delete-instance``. *Output*: None. **More Information** For more information, see `Stopping an Instance`_ in the *AWS OpsWorks User Guide*. .. _`Stopping an Instance`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-starting.html#workinginstances-starting-stop awscli-1.14.44/awscli/examples/opsworks/disassociate-elastic-ip.rst0000666454262600001440000000070613243367510026454 0ustar pysdk-ciamazon00000000000000**To disassociate an Elastic IP address from an instance** The following example disassociates an Elastic IP address from a specified instance. :: aws opsworks --region us-east-1 disassociate-elastic-ip --elastic-ip 54.148.130.96 *Output*: None. **More Information** For more information, see `Resource Management`_ in the *AWS OpsWorks User Guide*. .. _`Resource Management`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html awscli-1.14.44/awscli/examples/opsworks/describe-volumes.rst0000666454262600001440000000150313243367510025215 0ustar pysdk-ciamazon00000000000000**To describe a stack's volumes** The following example describes a stack's EBS volumes. :: aws opsworks --region us-east-1 describe-volumes --stack-id 8c428b08-a1a1-46ce-a5f8-feddc43771b8 *Output*:: { "Volumes": [ { "Status": "in-use", "AvailabilityZone": "us-west-2a", "Name": "CLITest", "InstanceId": "dfe18b02-5327-493d-91a4-c5c0c448927f", "VolumeType": "standard", "VolumeId": "56b66fbd-e1a1-4aff-9227-70f77118d4c5", "Device": "/dev/sdi", "Ec2VolumeId": "vol-295c1638", "MountPoint": "/mnt/myvolume", "Size": 1 } ] } **More Information** For more information, see `Resource Management`_ in the *AWS OpsWorks User Guide*. .. _`Resource Management`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources.html awscli-1.14.44/awscli/examples/opsworks/register-rds-db-instance.rst0000666454262600001440000000162613243367510026552 0ustar pysdk-ciamazon00000000000000**To register an Amazon RDS instance with a stack** The following example registers an Amazon RDS DB instance, identified by its Amazon Resource Name (ARN), with a specified stack. It also specifies the instance's master username and password. Note that AWS OpsWorks does not validate either of these values. If either one is incorrect, your application will not be able to connect to the database. :: aws opsworks register-rds-db-instance --region us-east-1 --stack-id d72553d4-8727-448c-9b00-f024f0ba1b06 --rds-db-instance-arn arn:aws:rds:us-west-2:123456789012:db:clitestdb --db-user cliuser --db-password some23!pwd *Output*: None. **More Information** For more information, see `Registering Amazon RDS Instances with a Stack`_ in the *AWS OpsWorks User Guide*. .. _`Registering Amazon RDS Instances with a Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-reg.html#resources-reg-rds awscli-1.14.44/awscli/examples/opsworks/create-layer.rst0000666454262600001440000000111213243367510024316 0ustar pysdk-ciamazon00000000000000**To create a layer** The following ``create-layer`` command creates a PHP App Server layer named MyPHPLayer in a specified stack. :: aws opsworks create-layer --region us-east-1 --stack-id f6673d70-32e6-4425-8999-265dd002fec7 --type php-app --name MyPHPLayer --shortname myphplayer *Output*:: { "LayerId": "0b212672-6b4b-40e4-8a34-5a943cf2e07a" } **More Information** For more information, see `How to Create a Layer`_ in the *AWS OpsWorks User Guide*. .. _`How to Create a Layer`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-create.html awscli-1.14.44/awscli/examples/opsworks/start-stack.rst0000666454262600001440000000101013243367510024176 0ustar pysdk-ciamazon00000000000000**To start a stack's instances** The following example starts all of a stack's 24/7 instances. To start a particular instance, use ``start-instance``. :: aws opsworks --region us-east-1 start-stack --stack-id 8c428b08-a1a1-46ce-a5f8-feddc43771b8 *Output*: None. **More Information** For more information, see `Starting an Instance`_ in the *AWS OpsWorks User Guide*. .. _`Starting an Instance`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-starting.html#workinginstances-starting-start awscli-1.14.44/awscli/examples/opsworks/describe-elastic-load-balancers.rst0000666454262600001440000000217613243367510030023 0ustar pysdk-ciamazon00000000000000**To describe a stack's elastic load balancers** The following ``describe-elastic-load-balancers`` command describes a specified stack's load balancers. :: aws opsworks --region us-west-2 describe-elastic-load-balancers --stack-id 6f4660e5-37a6-4e42-bfa0-1358ebd9c182 *Output*: This particular stack has one load balancer. :: { "ElasticLoadBalancers": [ { "SubnetIds": [ "subnet-60e4ea04", "subnet-66e1c110" ], "Ec2InstanceIds": [], "ElasticLoadBalancerName": "my-balancer", "Region": "us-west-2", "LayerId": "344973cb-bf2b-4cd0-8d93-51cd819bab04", "AvailabilityZones": [ "us-west-2a", "us-west-2b" ], "VpcId": "vpc-b319f9d4", "StackId": "6f4660e5-37a6-4e42-bfa0-1358ebd9c182", "DnsName": "my-balancer-2094040179.us-west-2.elb.amazonaws.com" } ] } **More Information** For more information, see Apps_ in the *AWS OpsWorks User Guide*. .. _Apps: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps.html awscli-1.14.44/awscli/examples/opsworks/delete-user-profile.rst0000666454262600001440000000137513243367510025630 0ustar pysdk-ciamazon00000000000000**To delete a user profile and remove an IAM user from AWS OpsWorks** The following example deletes the user profile for a specified AWS Identity and Access Management (IAM) user, who is identified by Amazon Resource Name (ARN). The operation removes the user from AWS OpsWorks, but does not delete the IAM user. You must use the IAM console, CLI, or API for that task. :: aws opsworks --region us-east-1 delete-user-profile --iam-user-arn arn:aws:iam::123456789102:user/cli-user-test *Output*: None. **More Information** For more information, see `Importing Users into AWS OpsWorks`_ in the *AWS OpsWorks User Guide*. .. _`Importing Users into AWS OpsWorks`: http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users-manage-import.html awscli-1.14.44/awscli/examples/opsworks/attach-elastic-load-balancer.rst0000666454262600001440000000101313243367510027311 0ustar pysdk-ciamazon00000000000000**To attach a load balancer to a layer** The following example attaches a load balancer, identified by its name, to a specified layer. :: aws opsworks --region us-east-1 attach-elastic-load-balancer --elastic-load-balancer-name Java-LB --layer-id 888c5645-09a5-4d0e-95a8-812ef1db76a4 *Output*: None. **More Information** For more information, see `Elastic Load Balancing`_ in the *AWS OpsWorks User Guide*. .. _`Elastic Load Balancing`: http://docs.aws.amazon.com/opsworks/latest/userguide/load-balancer-elb.html awscli-1.14.44/awscli/examples/opsworks/deregister-elastic-ip.rst0000666454262600001440000000101013243367510026123 0ustar pysdk-ciamazon00000000000000**To deregister an Elastic IP address from a stack** The following example deregisters an Elastic IP address, identified by its IP address, from its stack. :: aws opsworks deregister-elastic-ip --region us-east-1 --elastic-ip 54.148.130.96 *Output*: None. **More Information** For more information, see `Deregistering Elastic IP Addresses`_ in the *AWS OpsWorks User Guide*. .. _`Deregistering Elastic IP Addresses`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-dereg.html#resources-dereg-eip awscli-1.14.44/awscli/examples/opsworks/deregister-rds-db-instance.rst0000666454262600001440000000142713243367510027062 0ustar pysdk-ciamazon00000000000000**To deregister an Amazon RDS DB instance from a stack** The following example deregisters an RDS DB instance, identified by its ARN, from its stack. :: aws opsworks deregister-rds-db-instance --region us-east-1 --rds-db-instance-arn arn:aws:rds:us-west-2:123456789012:db:clitestdb *Output*: None. **More Information** For more information, see `Deregistering Amazon RDS Instances`_ in the *ASW OpsWorks User Guide*. .. _`Deregistering Amazon RDS Instances`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-dereg.html#resources-dereg-rds .. instance ID: clitestdb Master usernams: cliuser Master PWD: some23!pwd DB Name: mydb aws opsworks deregister-rds-db-instance --region us-east-1 --rds-db-instance-arn arn:aws:rds:us-west-2:645732743964:db:clitestdbawscli-1.14.44/awscli/examples/opsworks/describe-apps.rst0000666454262600001440000000205213243367510024466 0ustar pysdk-ciamazon00000000000000**To describe apps** The following ``describe-apps`` command describes the apps in a specified stack. :: aws opsworks --region us-east-1 describe-apps --stack-id 38ee91e2-abdc-4208-a107-0b7168b3cc7a *Output*: This particular stack has one app. :: { "Apps": [ { "StackId": "38ee91e2-abdc-4208-a107-0b7168b3cc7a", "AppSource": { "Url": "https://s3-us-west-2.amazonaws.com/opsworks-tomcat/simplejsp.zip", "Type": "archive" }, "Name": "SimpleJSP", "EnableSsl": false, "SslConfiguration": {}, "AppId": "da1decc1-0dff-43ea-ad7c-bb667cd87c8b", "Attributes": { "RailsEnv": null, "AutoBundleOnDeploy": "true", "DocumentRoot": "ROOT" }, "Shortname": "simplejsp", "Type": "other", "CreatedAt": "2013-08-01T21:46:54+00:00" } ] } **More Information** For more information, see Apps_ in the *AWS OpsWorks User Guide*. .. _Apps: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps.html awscli-1.14.44/awscli/examples/opsworks/describe-load-based-auto-scaling.rst0000666454262600001440000000234513243367510030107 0ustar pysdk-ciamazon00000000000000**To describe a layer's load-based scaling configuration** The following example describes a specified layer's load-based scaling configuration. The layer is identified by its layer ID, which you can find on the layer's details page or by running ``describe-layers``. :: aws opsworks describe-load-based-auto-scaling --region us-east-1 --layer-ids 6bec29c9-c866-41a0-aba5-fa3e374ce2a1 *Output*: The example layer has a single load-based instance. :: { "LoadBasedAutoScalingConfigurations": [ { "DownScaling": { "IgnoreMetricsTime": 10, "ThresholdsWaitTime": 10, "InstanceCount": 1, "CpuThreshold": 30.0 }, "Enable": true, "UpScaling": { "IgnoreMetricsTime": 5, "ThresholdsWaitTime": 5, "InstanceCount": 1, "CpuThreshold": 80.0 }, "LayerId": "6bec29c9-c866-41a0-aba5-fa3e374ce2a1" } ] } **More Information** For more information, see `How Automatic Load-based Scaling Works`_ in the *AWS OpsWorks User Guide*. .. _`How Automatic Load-based Scaling Works`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-autoscaling.html#workinginstances-autoscaling-loadbased awscli-1.14.44/awscli/examples/opsworks/describe-deployments.rst0000666454262600001440000000326513243367510026075 0ustar pysdk-ciamazon00000000000000**To describe deployments** The following ``describe-deployments`` commmand describes the deployments in a specified stack. :: aws opsworks --region us-east-1 describe-deployments --stack-id 38ee91e2-abdc-4208-a107-0b7168b3cc7a *Output*:: { "Deployments": [ { "StackId": "38ee91e2-abdc-4208-a107-0b7168b3cc7a", "Status": "successful", "CompletedAt": "2013-07-25T18:57:49+00:00", "DeploymentId": "6ed0df4c-9ef7-4812-8dac-d54a05be1029", "Command": { "Args": {}, "Name": "undeploy" }, "CreatedAt": "2013-07-25T18:57:34+00:00", "Duration": 15, "InstanceIds": [ "8c2673b9-3fe5-420d-9cfa-78d875ee7687", "9e588a25-35b2-4804-bd43-488f85ebe5b7" ] }, { "StackId": "38ee91e2-abdc-4208-a107-0b7168b3cc7a", "Status": "successful", "CompletedAt": "2013-07-25T18:56:41+00:00", "IamUserArn": "arn:aws:iam::123456789012:user/someuser", "DeploymentId": "19d3121e-d949-4ff2-9f9d-94eac087862a", "Command": { "Args": {}, "Name": "deploy" }, "InstanceIds": [ "8c2673b9-3fe5-420d-9cfa-78d875ee7687", "9e588a25-35b2-4804-bd43-488f85ebe5b7" ], "Duration": 72, "CreatedAt": "2013-07-25T18:55:29+00:00" } ] } **More Information** For more information, see `Deploying Apps`_ in the *AWS OpsWorks User Guide*. .. _`Deploying Apps`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-deploying.html awscli-1.14.44/awscli/examples/opsworks/describe-stacks.rst0000666454262600001440000000433713243367510025023 0ustar pysdk-ciamazon00000000000000**To describe stacks** The following ``describe-stacks`` command describes an account's stacks. :: aws opsworks --region us-east-1 describe-stacks *Output*:: { "Stacks": [ { "ServiceRoleArn": "arn:aws:iam::444455556666:role/aws-opsworks-service-role", "StackId": "aeb7523e-7c8b-49d4-b866-03aae9d4fbcb", "DefaultRootDeviceType": "instance-store", "Name": "TomStack-sd", "ConfigurationManager": { "Version": "11.4", "Name": "Chef" }, "UseCustomCookbooks": true, "CustomJson": "{\n \"tomcat\": {\n \"base_version\": 7,\n \"java_opts\": \"-Djava.awt.headless=true -Xmx256m\"\n },\n \"datasources\": {\n \"ROOT\": \"jdbc/mydb\"\n }\n}", "Region": "us-east-1", "DefaultInstanceProfileArn": "arn:aws:iam::444455556666:instance-profile/aws-opsworks-ec2-role", "CustomCookbooksSource": { "Url": "git://github.com/example-repo/tomcustom.git", "Type": "git" }, "DefaultAvailabilityZone": "us-east-1a", "HostnameTheme": "Layer_Dependent", "Attributes": { "Color": "rgb(45, 114, 184)" }, "DefaultOs": "Amazon Linux", "CreatedAt": "2013-08-01T22:53:42+00:00" }, { "ServiceRoleArn": "arn:aws:iam::444455556666:role/aws-opsworks-service-role", "StackId": "40738975-da59-4c5b-9789-3e422f2cf099", "DefaultRootDeviceType": "instance-store", "Name": "MyStack", "ConfigurationManager": { "Version": "11.4", "Name": "Chef" }, "UseCustomCookbooks": false, "Region": "us-east-1", "DefaultInstanceProfileArn": "arn:aws:iam::444455556666:instance-profile/aws-opsworks-ec2-role", "CustomCookbooksSource": {}, "DefaultAvailabilityZone": "us-east-1a", "HostnameTheme": "Layer_Dependent", "Attributes": { "Color": "rgb(45, 114, 184)" }, "DefaultOs": "Amazon Linux", "CreatedAt": "2013-10-25T19:24:30+00:00" } ] } **More Information** For more information, see `Stacks`_ in the *AWS OpsWorks User Guide*. .. _`Stacks`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks.html awscli-1.14.44/awscli/examples/opsworks/describe-elastic-ips.rst0000666454262600001440000000114013243367510025735 0ustar pysdk-ciamazon00000000000000**To describe Elastic IP instances** The following ``describe-elastic-ips`` commmand describes the Elastic IP addresses in a specified instance. :: aws opsworks --region us-east-1 describe-elastic-ips --instance-id b62f3e04-e9eb-436c-a91f-d9e9a396b7b0 *Output*:: { "ElasticIps": [ { "Ip": "192.0.2.0", "Domain": "standard", "Region": "us-west-2" } ] } **More Information** For more information, see Instances_ in the *AWS OpsWorks User Guide*. .. _Instances: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances.html awscli-1.14.44/awscli/examples/opsworks/update-app.rst0000666454262600001440000000064113243367510024007 0ustar pysdk-ciamazon00000000000000**To update an app** The following example updates a specified app to change its name. :: aws opsworks --region us-east-1 update-app --app-id 26a61ead-d201-47e3-b55c-2a7c666942f8 --name NewAppName *Output*: None. **More Information** For more information, see `Editing Apps`_ in the *AWS OpsWorks User Guide*. .. _`Editing Apps`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-editing.html awscli-1.14.44/awscli/examples/opsworks/register.rst0000666454262600001440000001571313243367510023601 0ustar pysdk-ciamazon00000000000000**To register instances with a stack** The following examples show a variety of ways to register instances with a stack that were created outside of AWS Opsworks. You can run ``register`` from the instance to be registered, or from a separate workstation. For more information, see `Registering Amazon EC2 and On-premises Instances`_ in the *AWS OpsWorks User Guide*. .. _`Registering Amazon EC2 and On-premises Instances`: http://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-register-registering.html **Note**: For brevity, the examples omit the ``region`` argument. AWS OpsWorks CLI commands should set ``region`` to us-east-1 regardless of the stack's location. *To register an Amazon EC2 instance* To indicate that you are registering an EC2 instance, set the ``--infrastructure-class`` argument to ``ec2``. The following example registers an EC2 instance with the specified stack from a separate workstation. The instance is identified by its EC2 ID, ``i-12345678``. The example uses the workstation's default SSH username and attempts to log in to the instance using authentication techniques that do not require a password, such as a default private SSH key. If that fails, ``register`` queries for the password. :: aws opsworks register --infrastructure-class=ec2 --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb i-12345678 The following example registers an EC2 instance with the specifed stack from a separate workstation. It uses the ``--ssh-username`` and ``--ssh-private-key`` arguments to explicitly specify the SSH username and private key file that the command uses to log into the instance. ``ec2-user`` is the standard username for Amazon Linux instances. Use ``ubuntu`` for Ubuntu instances. :: aws opsworks register --infrastructure-class=ec2 --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --ssh-username ec2-user --ssh-private-key ssh_private_key i-12345678 The following example registers the EC2 instance that is running the ``register`` command. Log in to the instance with SSH and run ``register`` with the ``--local`` argument instead of an instance ID or hostname. :: aws opsworks register --infrastructure-class ec2 --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --local *To register an on-premises instance* To indicate that you are registering an on-premises instance, set the ``--infrastructure-class`` argument to ``on-premises``. The following example registers an existing on-premises instance with a specified stack from a separate workstation. The instance is identified by its IP address, ``192.0.2.3``. The example uses the workstation's default SSH username and attempts to log in to the instance using authentication techniques that do not require a password, such as a default private SSH key. If that fails, ``register`` queries for the password. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb 192.0.2.3 The following example registers an on-premises instance with a specified stack from a separate workstation. The instance is identified by its hostname, ``host1``. The ``--override-...`` arguments direct AWS OpsWorks to display ``webserver1`` as the host name and ``192.0.2.3`` and ``10.0.0.2`` as the instance's public and private IP addresses, respectively. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --override-hostname webserver1 --override-public-ip 192.0.2.3 --override-private-ip 10.0.0.2 host1 The following example registers an on-premises instance with a specified stack from a separate workstation. The instance is identified by its IP address. ``register`` logs into the instance using the specified SSH username and private key file. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --ssh-username admin --ssh-private-key ssh_private_key 192.0.2.3 The following example registers an existing on-premises instance with a specified stack from a separate workstation. The command logs into the instance using a custom SSH command string that specifies the SSH password and the instance's IP address. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --override-ssh "sshpass -p 'mypassword' ssh your-user@192.0.2.3" The following example registers the on-premises instance that is running the ``register`` command. Log in to the instance with SSH and run ``register`` with the ``--local`` argument instead of an instance ID or hostname. :: aws opsworks register --infrastructure-class on-premises --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --local *Output*: The following is typical output for registering an EC2 instance. :: Warning: Permanently added '52.11.41.206' (ECDSA) to the list of known hosts. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6403k 100 6403k 0 0 2121k 0 0:00:03 0:00:03 --:--:-- 2121k [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Initializing AWS OpsWorks environment [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Running on Ubuntu [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Checking if OS is supported [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Running on supported OS [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Setup motd [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Executing: ln -sf --backup /etc/motd.opsworks-static /etc/motd [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Enabling multiverse repositories [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Customizing APT environment [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Installing system packages [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Executing: dpkg --configure -a [Tue, 24 Feb 2015 20:48:37 +0000] opsworks-init: Executing with retry: apt-get update [Tue, 24 Feb 2015 20:49:13 +0000] opsworks-init: Executing: apt-get install -y ruby ruby-dev libicu-dev libssl-dev libxslt-dev libxml2-dev libyaml-dev monit [Tue, 24 Feb 2015 20:50:13 +0000] opsworks-init: Using assets bucket from environment: 'opsworks-instance-assets-us-east-1.s3.amazonaws.com'. [Tue, 24 Feb 2015 20:50:13 +0000] opsworks-init: Installing Ruby for the agent [Tue, 24 Feb 2015 20:50:13 +0000] opsworks-init: Executing: /tmp/opsworks-agent-installer.YgGq8wF3UUre6yDy/opsworks-agent-installer/opsworks-agent/bin/installer_wrapper.sh -r -R opsworks-instance-assets-us-east-1.s3.amazonaws.com [Tue, 24 Feb 2015 20:50:44 +0000] opsworks-init: Starting the installer Instance successfully registered. Instance ID: 4d6d1710-ded9-42a1-b08e-b043ad7af1e2 Connection to 52.11.41.206 closed. **More Information** For more information, see `Registering an Instance with an AWS OpsWorks Stack`_ in the *AWS OpsWorks User Guide*. .. _`Registering an Instance with an AWS OpsWorks Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-register.html awscli-1.14.44/awscli/examples/opsworks/create-stack.rst0000666454262600001440000000207113243367510024314 0ustar pysdk-ciamazon00000000000000**To create a stack** The following ``create-stack`` command creates a stack named CLI Stack. :: aws opsworks create-stack --name "CLI Stack" --stack-region "us-east-1" --service-role-arn arn:aws:iam::123456789012:role/aws-opsworks-service-role --default-instance-profile-arn arn:aws:iam::123456789012:instance-profile/aws-opsworks-ec2-role --region us-east-1 The ``service-role-arn`` and ``default-instance-profile-arn`` parameters are required. You typically use the ones that AWS OpsWorks creates for you when you create your first stack. To get the Amazon Resource Names (ARNs) for your account, go to the `IAM console`_, choose ``Roles`` in the navigation panel, choose the role or profile, and choose the ``Summary`` tab. .. _`IAM console`: https://console.aws.amazon.com/iam/home *Output*:: { "StackId": "f6673d70-32e6-4425-8999-265dd002fec7" } **More Information** For more information, see `Create a New Stack`_ in the *AWS OpsWorks User Guide*. .. _`Create a New Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html awscli-1.14.44/awscli/examples/opsworks/update-rds-db-instance.rst0000666454262600001440000000136613243367510026211 0ustar pysdk-ciamazon00000000000000**To update a registered Amazon RDS DB instance** The following example updates an Amazon RDS instance's master password value. Note that this command does not change the RDS instance's master password, just the password that you provide to AWS OpsWorks. If this password does not match the RDS instance's password, your application will not be able to connect to the database. :: aws opsworks --region us-east-1 update-rds-db-instance --db-password 123456789 *Output*: None. **More Information** For more information, see `Registering Amazon RDS Instances with a Stack`_ in the *AWS OpsWorks User Guide*. .. _`Registering Amazon RDS Instances with a Stack`: http://docs.aws.amazon.com/opsworks/latest/userguide/resources-reg.html#resources-reg-rds awscli-1.14.44/awscli/examples/opsworks/update-my-user-profile.rst0000666454262600001440000000132313243367510026264 0ustar pysdk-ciamazon00000000000000**To update a user's profile** The following example updates the ``development`` user's profile to use a specified SSH public key. The user's AWS credentials are represented by the ``development`` profile in the ``credentials`` file (``~\.aws\credentials``), and the key is in a ``.pem`` file in the working directory. :: aws opsworks --region us-east-1 --profile development update-my-user-profile --ssh-public-key file://development_key.pem *Output*: None. **More Information** For more information, see `Editing AWS OpsWorks User Settings`_ in the *AWS OpsWorks User Guide*. .. _`Editing AWS OpsWorks User Settings`: http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users-manage-edit.html awscli-1.14.44/awscli/examples/opsworks/detach-elastic-load-balancer.rst0000666454262600001440000000101113243367510027273 0ustar pysdk-ciamazon00000000000000**To detach a load balancer from its layer** The following example detaches a load balancer, identified by its name, from its layer. :: aws opsworks --region us-east-1 detach-elastic-load-balancer --elastic-load-balancer-name Java-LB --layer-id 888c5645-09a5-4d0e-95a8-812ef1db76a4 *Output*: None. **More Information** For more information, see `Elastic Load Balancing`_ in the *AWS OpsWorks User Guide*. .. _`Elastic Load Balancing`: http://docs.aws.amazon.com/opsworks/latest/userguide/load-balancer-elb.html awscli-1.14.44/awscli/examples/opsworks/deregister-instance.rst0000666454262600001440000000102313243367510025701 0ustar pysdk-ciamazon00000000000000**To deregister a registered instance from a stack** The following ``deregister-instance`` command deregisters a registered instance from its stack. :: aws opsworks --region us-east-1 deregister-instance --instance-id 4d6d1710-ded9-42a1-b08e-b043ad7af1e2 *Output*: None. **More Information** For more information, see `Deregistering a Registered Instance`_ in the *AWS OpsWorks User Guide*. .. _`Deregistering a Registered Instance`: http://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-unassign.html awscli-1.14.44/awscli/examples/opsworks/create-app.rst0000666454262600001440000000372513243367510023776 0ustar pysdk-ciamazon00000000000000**To create an app** The following example creates a PHP app named SimplePHPApp from code stored in a GitHub repository. The command uses the shorthand form of the application source definition. :: aws opsworks --region us-east-1 create-app --stack-id f6673d70-32e6-4425-8999-265dd002fec7 --name SimplePHPApp --type php --app-source Type=git,Url=git://github.com/amazonwebservices/opsworks-demo-php-simple-app.git,Revision=version1 *Output*:: { "AppId": "6cf5163c-a951-444f-a8f7-3716be75f2a2" } **To create an app with an attached database** The following example creates a JSP app from code stored in .zip archive in a public S3 bucket. It attaches an RDS DB instance to serve as the app's data store. The application and database sources are defined in separate JSON files that are in the directory from which you run the command. :: aws opsworks --region us-east-1 create-app --stack-id 8c428b08-a1a1-46ce-a5f8-feddc43771b8 --name SimpleJSP --type java --app-source file://appsource.json --data-sources file://datasource.json The application source information is in ``appsource.json`` and contains the following. :: { "Type": "archive", "Url": "https://s3.amazonaws.com/jsp_example/simplejsp.zip" } The database source information is in ``datasource.json`` and contains the following. :: [ { "Type": "RdsDbInstance", "Arn": "arn:aws:rds:us-west-2:123456789012:db:clitestdb", "DatabaseName": "mydb" } ] **Note**: For an RDS DB instance, you must first use ``register-rds-db-instance`` to register the instance with the stack. For MySQL App Server instances, set ``Type`` to ``OpsworksMysqlInstance``. These instances are created by AWS OpsWorks, so they do not have to be registered. *Output*:: { "AppId": "26a61ead-d201-47e3-b55c-2a7c666942f8" } For more information, see `Adding Apps`_ in the *AWS OpsWorks User Guide*. .. _`Adding Apps`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html awscli-1.14.44/awscli/examples/opsworks/delete-layer.rst0000666454262600001440000000131013243367510024315 0ustar pysdk-ciamazon00000000000000**To delete a layer** The following example deletes a specified layer, which is identified by its layer ID. You can obtain a layer ID by going to the layer's details page on the AWS OpsWorks console or by running the ``describe-layers`` command. **Note:** Before deleting a layer, you must use ``delete-instance`` to delete all of the layer's instances. :: aws opsworks delete-layer --region us-east-1 --layer-id a919454e-b816-4598-b29a-5796afb498ed *Output*: None. **More Information** For more information, see `Deleting AWS OpsWorks Instances`_ in the *AWS OpsWorks User Guide*. .. _`Deleting AWS OpsWorks Instances`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-delete.html awscli-1.14.44/awscli/examples/opsworks/delete-app.rst0000666454262600001440000000101513243367510023763 0ustar pysdk-ciamazon00000000000000**To delete an app** The following example deletes a specified app, which is identified by its app ID. You can obtain an app ID by going to the app's details page on the AWS OpsWorks console or by running the ``describe-apps`` command. :: aws opsworks delete-app --region us-east-1 --app-id 577943b9-2ec1-4baf-a7bf-1d347601edc5 *Output*: None. **More Information** For more information, see `Apps`_ in the *AWS OpsWorks User Guide*. .. _`Apps`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps.html awscli-1.14.44/awscli/examples/opsworks/reboot-instance.rst0000666454262600001440000000070013243367510025037 0ustar pysdk-ciamazon00000000000000**To reboot an instance** The following example reboots an instance. :: aws opsworks --region us-east-1 reboot-instance --instance-id dfe18b02-5327-493d-91a4-c5c0c448927f *Output*: None. **More Information** For more information, see `Rebooting an Instance`_ in the *AWS OpsWorks User Guide*. .. _`Rebooting an Instance`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-starting.html#workinginstances-starting-reboot awscli-1.14.44/awscli/examples/opsworks/create-deployment.rst0000666454262600001440000000472113243367510025373 0ustar pysdk-ciamazon00000000000000**To deploy apps and run stack commands** The following examples show how to use the ``create-deployment`` command to deploy apps and run stack commands. Notice that the quote (``"``) characters in the JSON object that specifies the command are all preceded by escape characters (\). Without the escape characters, the command might return an invalid JSON error. **Deploy an App** The following ``create-deployment`` command deploys an app to a specified stack. :: aws opsworks --region us-east-1 create-deployment --stack-id cfb7e082-ad1d-4599-8e81-de1c39ab45bf --app-id 307be5c8-d55d-47b5-bd6e-7bd417c6c7eb --command "{\"Name\":\"deploy\"}" *Output*:: { "DeploymentId": "5746c781-df7f-4c87-84a7-65a119880560" } **Deploy a Rails App and Migrate the Database** The following ``create-deployment`` command deploys a Ruby on Rails app to a specified stack and migrates the database. :: aws opsworks --region us-east-1 create-deployment --stack-id cfb7e082-ad1d-4599-8e81-de1c39ab45bf --app-id 307be5c8-d55d-47b5-bd6e-7bd417c6c7eb --command "{\"Name\":\"deploy\", \"Args\":{\"migrate\":[\"true\"]}}" *Output*:: { "DeploymentId": "5746c781-df7f-4c87-84a7-65a119880560" } For more information on deployment, see `Deploying Apps`_ in the *AWS OpsWorks User Guide*. **Execute a Recipe** The following ``create-deployment`` command runs a custom recipe, ``phpapp::appsetup``, on the instances in a specified stack. :: aws opsworks --region ap-south-1 create-deployment --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --command "{\"Name\":\"execute_recipes\", \"Args\":{\"recipes\":[\"phpapp::appsetup\"]}} *Output*:: { "DeploymentId": "5cbaa7b9-4e09-4e53-aa1b-314fbd106038" } For more information, see `Run Stack Commands`_ in the *AWS OpsWorks User Guide*. **Install Dependencies** The following ``create-deployment`` command installs dependencies, such as packages or Ruby gems, on the instances in a specified stack. :: aws opsworks --region ap-south-1 create-deployment --stack-id 935450cc-61e0-4b03-a3e0-160ac817d2bb --command "{\"Name\":\"install_dependencies\"}" *Output*:: { "DeploymentId": "aef5b255-8604-4928-81b3-9b0187f962ff" } **More Information** For more information, see `Run Stack Commands`_ in the *AWS OpsWorks User Guide*. .. _`Deploying Apps`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-deploying.html .. _`Run Stack Commands`: http://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-commands.html awscli-1.14.44/awscli/examples/opsworks/assign-instance.rst0000666454262600001440000000105513243367510025035 0ustar pysdk-ciamazon00000000000000**To assign a registered instance to a layer** The following example assigns a registered instance to a custom layer. :: aws opsworks --region us-east-1 assign-instance --instance-id 4d6d1710-ded9-42a1-b08e-b043ad7af1e2 --layer-ids 26cf1d32-6876-42fa-bbf1-9cadc0bff938 *Output*: None. **More Information** For more information, see `Assigning a Registered Instance to a Layer`_ in the *AWS OpsWorks User Guide*. .. _`Assigning a Registered Instance to a Layer`: http://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-assign.html awscli-1.14.44/awscli/examples/opsworks/set-time-based-auto-scaling.rst0000666454262600001440000000207213243367510027136 0ustar pysdk-ciamazon00000000000000**To set the time-based scaling configuration for a layer** The following example sets the time-based configuration for a specified instance. You must first use ``create-instance`` to add the instance to the layer. :: aws opsworks --region us-east-1 set-time-based-auto-scaling --instance-id 69b6237c-08c0-4edb-a6af-78f3d01cedf2 --auto-scaling-schedule file://schedule.json The example puts the schedule in a separate file in the working directory named ``schedule.json``. For this example, the instance is on for a few hours around midday UTC (Coordinated Universal Time) on Monday and Tuesday. :: { "Monday": { "10": "on", "11": "on", "12": "on", "13": "on" }, "Tuesday": { "10": "on", "11": "on", "12": "on", "13": "on" } } *Output*: None. **More Information** For more information, see `Using Automatic Time-based Scaling`_ in the *AWS OpsWorks User Guide*. .. _`Using Automatic Time-based Scaling`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-autoscaling-timebased.html awscli-1.14.44/awscli/examples/opsworks/describe-raid-arrays.rst0000666454262600001440000000206113243367510025741 0ustar pysdk-ciamazon00000000000000**To describe RAID arrays** The following example describes the RAID arrays attached to the instances in a specified stack. :: aws opsworks --region us-east-1 describe-raid-arrays --stack-id d72553d4-8727-448c-9b00-f024f0ba1b06 *Output*: The following is the output for a stack with one RAID array. :: { "RaidArrays": [ { "StackId": "d72553d4-8727-448c-9b00-f024f0ba1b06", "AvailabilityZone": "us-west-2a", "Name": "Created for php-app1", "NumberOfDisks": 2, "InstanceId": "9f14adbc-ced5-43b6-bf01-e7d0db6cf2f7", "RaidLevel": 0, "VolumeType": "standard", "RaidArrayId": "f2d4e470-5972-4676-b1b8-bae41ec3e51c", "Device": "/dev/md0", "MountPoint": "/mnt/workspace", "CreatedAt": "2015-02-26T23:53:09+00:00", "Size": 100 } ] } For more information, see `EBS Volumes`_ in the *AWS OpsWorks User Guide*. .. _`EBS Volumes`: http://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html#workinglayers-basics-edit-ebs awscli-1.14.44/awscli/examples/glacier/0000777454262600001440000000000013243367512020735 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/glacier/list-multipart-uploads.rst0000666454262600001440000000104213243367510026121 0ustar pysdk-ciamazon00000000000000The following command shows all of the in-progress multipart uploads for a vault named ``my-vault``:: aws glacier list-multipart-uploads --account-id - --vault-name my-vault Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. For more information on multipart uploads to Amazon Glacier using the AWS CLI, see `Using Amazon Glacier`_ in the *AWS CLI User Guide*. .. _`Using Amazon Glacier`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-glacier.htmlawscli-1.14.44/awscli/examples/glacier/abort-multipart-upload.rst0000666454262600001440000000150513243367510026076 0ustar pysdk-ciamazon00000000000000The following command deletes an in-progress multipart upload to a vault named ``my-vault``:: aws glacier abort-multipart-upload --account-id - --vault-name my-vault --upload-id 19gaRezEXAMPLES6Ry5YYdqthHOC_kGRCT03L9yetr220UmPtBYKk-OssZtLqyFu7sY1_lR7vgFuJV6NtcV5zpsJ This command does not produce any output. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. The upload ID is returned by the ``aws glacier initiate-multipart-upload`` command and can also be obtained by using ``aws glacier list-multipart-uploads``. For more information on multipart uploads to Amazon Glacier using the AWS CLI, see `Using Amazon Glacier`_ in the *AWS CLI User Guide*. .. _`Using Amazon Glacier`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-glacier.htmlawscli-1.14.44/awscli/examples/glacier/get-job-output.rst0000666454262600001440000000226113243367510024353 0ustar pysdk-ciamazon00000000000000The following command saves the output from a vault inventory job to a file in the current directory named ``output.json``:: aws glacier get-job-output --account-id - --vault-name my-vault --job-id zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW output.json The ``job-id`` is available in the output of ``aws glacier list-jobs``. Note that the output file name is a positional argument that is not prefixed by an option name. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. Output:: { "status": 200, "acceptRanges": "bytes", "contentType": "application/json" } ``output.json``:: {"VaultARN":"arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault","InventoryDate":"2015-04-07T00:26:18Z","ArchiveList":[{"ArchiveId":"kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw","ArchiveDescription":"multipart upload test","CreationDate":"2015-04-06T22:24:34Z","Size":3145728,"SHA256TreeHash":"9628195fcdbcbbe76cdde932d4646fa7de5f219fb39823836d81f0cc0e18aa67"}]}awscli-1.14.44/awscli/examples/glacier/describe-vault.rst0000666454262600001440000000041613243367510024377 0ustar pysdk-ciamazon00000000000000The following command retrieves data about a vault named ``my-vault``:: aws glacier describe-vault --vault-name my-vault --account-id - Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.awscli-1.14.44/awscli/examples/glacier/add-tags-to-vault.rst0000666454262600001440000000045313243367510024724 0ustar pysdk-ciamazon00000000000000The following command adds two tags to a vault named ``my-vault``:: aws glacier add-tags-to-vault --account-id - --vault-name my-vault --tags id=1234,date=july2015 Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. awscli-1.14.44/awscli/examples/glacier/initiate-job.rst0000666454262600001440000000351513243367510024047 0ustar pysdk-ciamazon00000000000000The following command initiates a job to get an inventory of the vault ``my-vault``:: aws glacier initiate-job --account-id - --vault-name my-vault --job-parameters '{"Type": "inventory-retrieval"}' Output:: { "location": "/0123456789012/vaults/my-vault/jobs/zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW", "jobId": "zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW" } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. The following command initiates a job to retrieve an archive from the vault ``my-vault``:: aws glacier initiate-job --account-id - --vault-name my-vault --job-parameters file://job-archive-retrieval.json ``job-archive-retrieval.json`` is a JSON file in the local folder that specifies the type of job, archive ID, and some optional parameters:: { "Type": "archive-retrieval", "ArchiveId": "kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw", "Description": "Retrieve archive on 2015-07-17", "SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-topic" } Archive IDs are available in the output of ``aws glacier upload-archive`` and ``aws glacier get-job-output``. Output:: { "location": "/011685312445/vaults/mwunderl/jobs/l7IL5-EkXyEY9Ws95fClzIbk2O5uLYaFdAYOi-azsX_Z8V6NH4yERHzars8wTKYQMX6nBDI9cMNHzyZJO59-8N9aHWav", "jobId": "l7IL5-EkXy2O5uLYaFdAYOiEY9Ws95fClzIbk-azsX_Z8V6NH4yERHzars8wTKYQMX6nBDI9cMNHzyZJO59-8N9aHWav" } See `Initiate Job`_ in the *Amazon Glacier API Reference* for details on the job parameters format. .. _`Initiate Job`: http://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.htmlawscli-1.14.44/awscli/examples/glacier/upload-archive.rst0000666454262600001440000000176313243367510024377 0ustar pysdk-ciamazon00000000000000The following command uploads an archive in the current folder named ``archive.zip`` to a vault named ``my-vault``:: aws glacier upload-archive --account-id - --vault-name my-vault --body archive.zip Output:: { "archiveId": "kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw", "checksum": "969fb39823836d81f0cc028195fcdbcbbe76cdde932d4646fa7de5f21e18aa67", "location": "/0123456789012/vaults/my-vault/archives/kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw" } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. To retrieve an uploaded archive, initiate a retrieval job with the `aws glacier initiate-job`_ command. .. _`aws glacier initiate-job`: http://docs.aws.amazon.com/cli/latest/reference/glacier/initiate-job.htmlawscli-1.14.44/awscli/examples/glacier/list-vaults.rst0000666454262600001440000000117713243367510023762 0ustar pysdk-ciamazon00000000000000The following command lists the vaults in the default account and region:: aws glacier list-vaults --account-id - Output:: { "VaultList": [ { "SizeInBytes": 3178496, "VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault", "LastInventoryDate": "2015-04-07T00:26:19.028Z", "VaultName": "my-vault", "NumberOfArchives": 1, "CreationDate": "2015-04-06T21:23:45.708Z" } ] } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.awscli-1.14.44/awscli/examples/glacier/upload-multipart-part.rst0000666454262600001440000000177413243367510025745 0ustar pysdk-ciamazon00000000000000The following command uploads the first 1 MiB (1024 x 1024 bytes) part of an archive:: aws glacier upload-multipart-part --body part1 --range 'bytes 0-1048575/*' --account-id - --vault-name my-vault --upload-id 19gaRezEXAMPLES6Ry5YYdqthHOC_kGRCT03L9yetr220UmPtBYKk-OssZtLqyFu7sY1_lR7vgFuJV6NtcV5zpsJ Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. The body parameter takes a path to a part file on the local filesystem. The range parameter takes an HTTP content range indicating the bytes that the part occupies in the completed archive. The upload ID is returned by the ``aws glacier initiate-multipart-upload`` command and can also be obtained by using ``aws glacier list-multipart-uploads``. For more information on multipart uploads to Amazon Glacier using the AWS CLI, see `Using Amazon Glacier`_ in the *AWS CLI User Guide*. .. _`Using Amazon Glacier`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-glacier.htmlawscli-1.14.44/awscli/examples/glacier/initiate-multipart-upload.rst0000666454262600001440000000152313243367510026575 0ustar pysdk-ciamazon00000000000000The following command initiates a multipart upload to a vault named ``my-vault`` with a part size of 1 MiB (1024 x 1024 bytes) per file:: aws glacier initiate-multipart-upload --account-id - --part-size 1048576 --vault-name my-vault --archive-description "multipart upload test" The archive description parameter is optional. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. This command outputs an upload ID when successful. Use the upload ID when uploading each part of your archive with ``aws glacier upload-multipart-part``. For more information on multipart uploads to Amazon Glacier using the AWS CLI, see `Using Amazon Glacier`_ in the *AWS CLI User Guide*. .. _`Using Amazon Glacier`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-glacier.htmlawscli-1.14.44/awscli/examples/glacier/set-data-retrieval-policy.rst0000666454262600001440000000170513243367510026462 0ustar pysdk-ciamazon00000000000000The following command configures a data retrieval policy for the in-use account:: aws glacier set-data-retrieval-policy --account-id - --policy file://data-retrieval-policy.json ``data-retrieval-policy.json`` is a JSON file in the current folder that specifies a data retrieval policy:: { "Rules":[ { "Strategy":"BytesPerHour", "BytesPerHour":10737418240 } ] } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. The following command sets the data retrieval policy to ``FreeTier`` using inline JSON:: aws glacier set-data-retrieval-policy --account-id - --policy '{"Rules":[{"Strategy":"FreeTier"}]}' See `Set Data Retrieval Policy`_ in the *Amazon Glacier API Reference* for details on the policy format. .. _`Set Data Retrieval Policy`: http://docs.aws.amazon.com/amazonglacier/latest/dev/api-SetDataRetrievalPolicy.html awscli-1.14.44/awscli/examples/glacier/set-vault-notifications.rst0000666454262600001440000000115413243367510026261 0ustar pysdk-ciamazon00000000000000The following command configures SNS notifications for a vault named ``my-vault``:: aws glacier set-vault-notifications --account-id - --vault-name my-vault --vault-notification-config file://notificationconfig.json ``notificationconfig.json`` is a JSON file in the current folder that specifies an SNS topic and the events to publish:: { "SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-vault", "Events": ["ArchiveRetrievalCompleted", "InventoryRetrievalCompleted"] } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.awscli-1.14.44/awscli/examples/glacier/create-vault.rst0000666454262600001440000000040313243367510024056 0ustar pysdk-ciamazon00000000000000The following command creates a new vault named ``my-vault``:: aws glacier create-vault --vault-name my-vault --account-id - Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.awscli-1.14.44/awscli/examples/glacier/list-parts.rst0000666454262600001440000000243313243367510023571 0ustar pysdk-ciamazon00000000000000The following command lists the uploaded parts for a multipart upload to a vault named ``my-vault``:: aws glacier list-parts --account-id - --vault-name my-vault --upload-id "SYZi7qnL-YGqGwAm8Kn3BLP2ElNCvnB-5961R09CSaPmPwkYGHOqeN_nX3-Vhnd2yF0KfB5FkmbnBU9GubbdrCs8ut-D" Output:: { "MultipartUploadId": "SYZi7qnL-YGqGwAm8Kn3BLP2ElNCvnB-5961R09CSaPmPwkYGHOqeN_nX3-Vhnd2yF0KfB5FkmbnBU9GubbdrCs8ut-D", "Parts": [ { "RangeInBytes": "0-1048575", "SHA256TreeHash": "e1f2a7cd6e047350f69b9f8cfa60fa606fe2f02802097a9a026360a7edc1f553" }, { "RangeInBytes": "1048576-2097151", "SHA256TreeHash": "43cf3061fb95796aed99a11a6aa3cd8f839eed15e655ab0a597126210636aee6" } ], "VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault", "CreationDate": "2015-07-18T00:05:23.830Z", "PartSizeInBytes": 1048576 } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. For more information on multipart uploads to Amazon Glacier using the AWS CLI, see `Using Amazon Glacier`_ in the *AWS CLI User Guide*. .. _`Using Amazon Glacier`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-glacier.htmlawscli-1.14.44/awscli/examples/glacier/delete-vault.rst0000666454262600001440000000045113243367510024060 0ustar pysdk-ciamazon00000000000000The following command deletes a vault named ``my-vault``:: aws glacier delete-vault --vault-name my-vault --account-id - This command does not produce any output. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.awscli-1.14.44/awscli/examples/glacier/list-tags-for-vault.rst0000666454262600001440000000057113243367510025314 0ustar pysdk-ciamazon00000000000000The following command lists the tags applied to a vault named ``my-vault``:: aws glacier list-tags-for-vault --account-id - --vault-name my-vault Output:: { "Tags": { "date": "july2015", "id": "1234" } } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. awscli-1.14.44/awscli/examples/glacier/get-vault-notifications.rst0000666454262600001440000000120713243367510026244 0ustar pysdk-ciamazon00000000000000The following command gets a description of the notification configuration for a vault named ``my-vault``:: aws glacier get-vault-notifications --account-id - --vault-name my-vault Output:: { "vaultNotificationConfig": { "Events": [ "InventoryRetrievalCompleted", "ArchiveRetrievalCompleted" ], "SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-vault" } } If no notifications have been configured for the vault, an error is returned. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. awscli-1.14.44/awscli/examples/glacier/describe-job.rst0000666454262600001440000000165313243367510024022 0ustar pysdk-ciamazon00000000000000The following command retrieves information about an inventory retrieval job on a vault named ``my-vault``:: aws glacier describe-job --account-id - --vault-name my-vault --job-id zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW Output:: { "InventoryRetrievalParameters": { "Format": "JSON" }, "VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault", "Completed": false, "JobId": "zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW", "Action": "InventoryRetrieval", "CreationDate": "2015-07-17T20:23:41.616Z", "StatusCode": "InProgress" } The job ID can be found in the output of ``aws glacier initiate-job`` and ``aws glacier list-jobs``. Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. awscli-1.14.44/awscli/examples/glacier/get-data-retrieval-policy.rst0000666454262600001440000000072413243367510026446 0ustar pysdk-ciamazon00000000000000The following command gets the data retrieval policy for the in-use account:: aws glacier get-data-retrieval-policy --account-id - Output:: { "Policy": { "Rules": [ { "BytesPerHour": 10737418240, "Strategy": "BytesPerHour" } ] } } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. awscli-1.14.44/awscli/examples/glacier/complete-multipart-upload.rst0000666454262600001440000000175713243367510026610 0ustar pysdk-ciamazon00000000000000The following command completes multipart upload for a 3 MiB archive:: aws glacier complete-multipart-upload --archive-size 3145728 --checksum 9628195fcdbcbbe76cdde456d4646fa7de5f219fb39823836d81f0cc0e18aa67 --upload-id 19gaRezEXAMPLES6Ry5YYdqthHOC_kGRCT03L9yetr220UmPtBYKk-OssZtLqyFu7sY1_lR7vgFuJV6NtcV5zpsJ --account-id - --vault-name my-vault Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. The upload ID is returned by the ``aws glacier initiate-multipart-upload`` command and can also be obtained by using ``aws glacier list-multipart-uploads``. The checksum parameter takes a SHA-256 tree hash of the archive in hexadecimal. For more information on multipart uploads to Amazon Glacier using the AWS CLI, including instructions on calculating a tree hash, see `Using Amazon Glacier`_ in the *AWS CLI User Guide*. .. _`Using Amazon Glacier`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-glacier.htmlawscli-1.14.44/awscli/examples/glacier/remove-tags-from-vault.rst0000666454262600001440000000047313243367510026014 0ustar pysdk-ciamazon00000000000000The following command removes a tag with the key ``date`` from a vault named ``my-vault``:: aws glacier remove-tags-from-vault --account-id - --vault-name my-vault --tag-keys date Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. awscli-1.14.44/awscli/examples/glacier/list-jobs.rst0000666454262600001440000000351213243367510023374 0ustar pysdk-ciamazon00000000000000The following command lists in-progress and recently completed jobs for a vault named ``my-vault``:: aws glacier list-jobs --account-id - --vault-name my-vault Output:: { "JobList": [ { "VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault", "RetrievalByteRange": "0-3145727", "SNSTopic": "arn:aws:sns:us-west-2:0123456789012:my-vault", "Completed": false, "SHA256TreeHash": "9628195fcdbcbbe76cdde932d4646fa7de5f219fb39823836d81f0cc0e18aa67", "JobId": "l7IL5-EkXyEY9Ws95fClzIbk2O5uLYaFdAYOi-azsX_Z8V6NH4yERHzars8wTKYQMX6nBDI9cMNHzyZJO59-8N9aHWav", "ArchiveId": "kKB7ymWJVpPSwhGP6ycSOAekp9ZYe_--zM_mw6k76ZFGEIWQX-ybtRDvc2VkPSDtfKmQrj0IRQLSGsNuDp-AJVlu2ccmDSyDUmZwKbwbpAdGATGDiB3hHO0bjbGehXTcApVud_wyDw", "JobDescription": "Retrieve archive on 2015-07-17", "ArchiveSizeInBytes": 3145728, "Action": "ArchiveRetrieval", "ArchiveSHA256TreeHash": "9628195fcdbcbbe76cdde932d4646fa7de5f219fb39823836d81f0cc0e18aa67", "CreationDate": "2015-07-17T21:16:13.840Z", "StatusCode": "InProgress" }, { "InventoryRetrievalParameters": { "Format": "JSON" }, "VaultARN": "arn:aws:glacier:us-west-2:0123456789012:vaults/my-vault", "Completed": false, "JobId": "zbxcm3Z_3z5UkoroF7SuZKrxgGoDc3RloGduS7Eg-RO47Yc6FxsdGBgf_Q2DK5Ejh18CnTS5XW4_XqlNHS61dsO4CnMW", "Action": "InventoryRetrieval", "CreationDate": "2015-07-17T20:23:41.616Z", "StatusCode": ""InProgress"" } ] } Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account. awscli-1.14.44/awscli/examples/storagegateway/0000777454262600001440000000000013243367512022355 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/storagegateway/list-gateways.rst0000666454262600001440000000040413243367510025700 0ustar pysdk-ciamazon00000000000000**To list gateways for an account** The following ``list-gateways`` command lists all the gateways defined for an account:: aws storagegateway list-gateways This command outputs a JSON block that contains a list of gateway Amazon Resource Names (ARNs). awscli-1.14.44/awscli/examples/storagegateway/list-volumes.rst0000666454262600001440000000110113243367510025541 0ustar pysdk-ciamazon00000000000000**To list the volumes configured for a gateway** The following ``list-volumes`` command returns a list of volumes configured for the specified gateway. To specify which gateway to describe, use the Amazon Resource Name (ARN) of the gateway in the command. This examples specifies a gateway with the id ``sgw-12A3456B`` in account ``123456789012``:: aws storagegateway list-volumes --gateway-arn "arn:aws:storagegateway:us-west-2:123456789012:gateway/sgw-12A3456B" This command outputs a JSON block that a list of volumes that includes the type and ARN for each volume. awscli-1.14.44/awscli/examples/storagegateway/describe-gateway-information.rst0000666454262600001440000000122113243367510030643 0ustar pysdk-ciamazon00000000000000**To describe a gateway** The following ``describe-gateway-information`` command returns metadata about the specified gateway. To specify which gateway to describe, use the Amazon Resource Name (ARN) of the gateway in the command. This examples specifies a gateway with the id ``sgw-12A3456B`` in account ``123456789012``:: aws storagegateway describe-gateway-information --gateway-arn "arn:aws:storagegateway:us-west-2:123456789012:gateway/sgw-12A3456B" This command outputs a JSON block that contains metadata about about the gateway such as its name, network interfaces, configured time zone, and the state (whether the gateway is running or not). awscli-1.14.44/awscli/examples/sns/0000777454262600001440000000000013243367512020132 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/sns/confirm-subscription.rst0000666454262600001440000000121313243367510025036 0ustar pysdk-ciamazon00000000000000The following command confirms a subscription to an SNS topic named ``my-topic``:: aws sns confirm-subscription --topic-arn arn:aws:sns:us-west-2:0123456789012:my-topic --token 2336412f37fb687f5d51e6e241d7700ae02f7124d8268910b858cb4db727ceeb2474bb937929d3bdd7ce5d0cce19325d036bc858d3c217426bcafa9c501a2cace93b83f1dd3797627467553dc438a8c974119496fc3eff026eaa5d14472ded6f9a5c43aec62d83ef5f49109da7176391 The token is included in the confirmation message sent to the notification endpoint specified in the subscribe call. Output:: { "SubscriptionArn": "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f" } awscli-1.14.44/awscli/examples/sns/list-subscriptions.rst0000666454262600001440000000074413243367510024547 0ustar pysdk-ciamazon00000000000000The following command retrieves a list of SNS subscriptions:: aws sns list-subscriptions Output:: { "Subscriptions": [ { "Owner": "0123456789012", "Endpoint": "my-email@example.com", "Protocol": "email", "TopicArn": "arn:aws:sns:us-west-2:0123456789012:my-topic", "SubscriptionArn": "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f" } ] } awscli-1.14.44/awscli/examples/sns/list-topics.rst0000666454262600001440000000033413243367510023134 0ustar pysdk-ciamazon00000000000000The following command retrieves a list of SNS topics:: aws sns list-topics Output:: { "Topics": [ { "TopicArn": "arn:aws:sns:us-west-2:0123456789012:my-topic" } ] } awscli-1.14.44/awscli/examples/sns/create-topic.rst0000666454262600001440000000111313243367510023235 0ustar pysdk-ciamazon00000000000000The following command creates an SNS topic named ``my-topic``:: aws sns create-topic --name my-topic Output:: { "ResponseMetadata": { "RequestId": "1469e8d7-1642-564e-b85d-a19b4b341f83" }, "TopicArn": "arn:aws:sns:us-west-2:0123456789012:my-topic" } For more information, see `Using the AWS Command Line Interface with Amazon SQS and Amazon SNS`_ in the *AWS Command Line Interface User Guide*. .. _`Using the AWS Command Line Interface with Amazon SQS and Amazon SNS`: http://docs.aws.amazon.com/cli/latest/userguide/cli-sqs-queue-sns-topic.html awscli-1.14.44/awscli/examples/sns/get-subscription-attributes.rst0000666454262600001440000000136613243367510026355 0ustar pysdk-ciamazon00000000000000The following command gets the attributes of a subscription to a topic named ``my-topic``:: aws sns get-subscription-attributes --subscription-arn "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f" The ``subscription-arn`` is available in the output of ``aws sns list-subscriptions``. Output:: { "Attributes": { "Endpoint": "my-email@example.com", "Protocol": "email", "RawMessageDelivery": "false", "ConfirmationWasAuthenticated": "false", "Owner": "0123456789012", "SubscriptionArn": "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f", "TopicArn": "arn:aws:sns:us-west-2:0123456789012:my-topic" } }awscli-1.14.44/awscli/examples/sns/list-subscriptions-by-topic.rst0000666454262600001440000000105013243367510026262 0ustar pysdk-ciamazon00000000000000The following command retrieves a list of SNS subscriptions:: aws sns list-subscriptions-by-topic --topic-arn "arn:aws:sns:us-west-2:0123456789012:my-topic" Output:: { "Subscriptions": [ { "Owner": "0123456789012", "Endpoint": "my-email@example.com", "Protocol": "email", "TopicArn": "arn:aws:sns:us-west-2:0123456789012:my-topic", "SubscriptionArn": "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f" } ] } awscli-1.14.44/awscli/examples/sns/subscribe.rst0000666454262600001440000000041613243367510022644 0ustar pysdk-ciamazon00000000000000The following command subscribes an email address to a topic:: aws sns subscribe --topic-arn arn:aws:sns:us-west-2:0123456789012:my-topic --protocol email --notification-endpoint my-email@example.com Output:: { "SubscriptionArn": "pending confirmation" } awscli-1.14.44/awscli/examples/sns/delete-topic.rst0000666454262600001440000000022213243367510023234 0ustar pysdk-ciamazon00000000000000The following command deletes an SNS topic named ``my-topic``:: aws sns delete-topic --topic-arn "arn:aws:sns:us-west-2:0123456789012:my-topic"awscli-1.14.44/awscli/examples/sns/unsubscribe.rst0000666454262600001440000000025513243367510023210 0ustar pysdk-ciamazon00000000000000The following command deletes a subscription:: aws sns unsubscribe --subscription-arn "arn:aws:sns:us-west-2:0123456789012:my-topic:8a21d249-4329-4871-acc6-7be709c6ea7f" awscli-1.14.44/awscli/examples/sns/publish.rst0000666454262600001440000000054113243367510022330 0ustar pysdk-ciamazon00000000000000The following command publishes a message to an SNS topic named ``my-topic``:: aws sns publish --topic-arn "arn:aws:sns:us-west-2:0123456789012:my-topic" --message file://message.txt ``message.txt`` is a text file containing the message to publish:: Hello World Second Line Putting the message in a text file allows you to include line breaks.awscli-1.14.44/awscli/examples/sns/get-topic-attributes.rst0000666454262600001440000000243013243367510024740 0ustar pysdk-ciamazon00000000000000The following command gets the attributes of a topic named ``my-topic``:: aws sns get-topic-attributes --topic-arn "arn:aws:sns:us-west-2:0123456789012:my-topic" Output:: { "Attributes": { "SubscriptionsConfirmed": "1", "DisplayName": "my-topic", "SubscriptionsDeleted": "0", "EffectiveDeliveryPolicy": "{\"http\":{\"defaultHealthyRetryPolicy\":{\"minDelayTarget\":20,\"maxDelayTarget\":20,\"numRetries\":3,\"numMaxDelayRetries\":0,\"numNoDelayRetries\":0,\"numMinDelayRetries\":0,\"backoffFunction\":\"linear\"},\"disableSubscriptionOverrides\":false}}", "Owner": "0123456789012", "Policy": "{\"Version\":\"2008-10-17\",\"Id\":\"__default_policy_ID\",\"Statement\":[{\"Sid\":\"__default_statement_ID\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Action\":[\"SNS:Subscribe\",\"SNS:ListSubscriptionsByTopic\",\"SNS:DeleteTopic\",\"SNS:GetTopicAttributes\",\"SNS:Publish\",\"SNS:RemovePermission\",\"SNS:AddPermission\",\"SNS:Receive\",\"SNS:SetTopicAttributes\"],\"Resource\":\"arn:aws:sns:us-west-2:0123456789012:my-topic\",\"Condition\":{\"StringEquals\":{\"AWS:SourceOwner\":\"0123456789012\"}}}]}", "TopicArn": "arn:aws:sns:us-west-2:0123456789012:my-topic", "SubscriptionsPending": "0" } } awscli-1.14.44/awscli/examples/ecr/0000777454262600001440000000000013243367512020100 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/ecr/start-lifecycle-policy-preview.rst0000666454262600001440000000271513243367510026703 0ustar pysdk-ciamazon00000000000000**To create a lifecycle policy preview** This example creates a lifecycle policy preview defined by ``policy.json` for a repository called ``project-a/amazon-ecs-sample`` in the default registry for an account. Command:: aws ecr start-lifecycle-policy-preview --repository-name "project-a/amazon-ecs-sample" --lifecycle-policy-text "file://policy.json" JSON file format:: { "rules": [ { "rulePriority": 1, "description": "Expire images older than 14 days", "selection": { "tagStatus": "untagged", "countType": "sinceImagePushed", "countUnit": "days", "countNumber": 14 }, "action": { "type": "expire" } } ] } Output:: { "registryId": "", "repositoryName": "project-a/amazon-ecs-sample", "lifecyclePolicyText": "{\n \"rules\": [\n {\n \"rulePriority\": 1,\n \"description\": \"Expire images older than 14 days\",\n \"selection\": {\n \"tagStatus\": \"untagged\",\n \"countType\": \"sinceImagePushed\",\n \"countUnit\": \"days\",\n \"countNumber\": 14\n },\n \"action\": {\n \"type\": \"expire\"\n }\n }\n ]\n}\n", "status": "IN_PROGRESS" } awscli-1.14.44/awscli/examples/ecr/get-login_description.rst0000666454262600001440000000147013243367510025122 0ustar pysdk-ciamazon00000000000000Log in to an Amazon ECR registry. This command retrieves a token that is valid for a specified registry for 12 hours, and then it prints a ``docker login`` command with that authorization token. You can execute the printed command to log in to your registry with Docker. After you have logged in to an Amazon ECR registry with this command, you can use the Docker CLI to push and pull images from that registry until the token expires. .. note:: This command writes displays ``docker login`` commands to stdout with authentication credentials. Your credentials could be visible by other users on your system in a process list display or a command history. If you are not on a secure system, you should consider this risk and login interactively. For more information, see ``get-authorization-token``. awscli-1.14.44/awscli/examples/ecr/create-repository.rst0000666454262600001440000000075713243367510024321 0ustar pysdk-ciamazon00000000000000**To create a repository** This example creates a repository called ``nginx-web-app`` inside the ``project-a`` namespace in the default registry for an account. Command:: aws ecr create-repository --repository-name project-a/nginx-web-app Output:: { "repository": { "registryId": "", "repositoryName": "project-a/nginx-web-app", "repositoryArn": "arn:aws:ecr:us-west-2::repository/project-a/nginx-web-app" } } awscli-1.14.44/awscli/examples/ecr/batch-get-image.rst0000666454262600001440000000037113243367510023547 0ustar pysdk-ciamazon00000000000000**To describe an image** This example describes an image with the tag ``precise`` in a repository called ``ubuntu`` in the default registry for an account. Command:: aws ecr batch-get-image --repository-name ubuntu --image-ids imageTag=precise awscli-1.14.44/awscli/examples/ecr/delete-repository.rst0000666454262600001440000000075313243367510024314 0ustar pysdk-ciamazon00000000000000**To delete a repository** This example command force deletes a repository named ``ubuntu`` in the default registry for an account. The ``--force`` flag is required if the repository contains images. Command:: aws ecr delete-repository --force --repository-name ubuntu Output:: { "repository": { "registryId": "", "repositoryName": "ubuntu", "repositoryArn": "arn:aws:ecr:us-west-2::repository/ubuntu" } } awscli-1.14.44/awscli/examples/ecr/get-lifecycle-policy-preview.rst0000666454262600001440000000202613243367510026320 0ustar pysdk-ciamazon00000000000000**To retrieve details for a lifecycle policy preview** This example retrieves the result of a lifecycle policy preview for a repository called ``project-a/amazon-ecs-sample`` in the default registry for an account. Command:: aws ecr get-lifecycle-policy --repository-name "project-a/amazon-ecs-sample" Output:: { "registryId": "", "repositoryName": "project-a/amazon-ecs-sample", "lifecyclePolicyText": "{\n \"rules\": [\n {\n \"rulePriority\": 1,\n \"description\": \"Expire images older than 14 days\",\n \"selection\": {\n \"tagStatus\": \"untagged\",\n \"countType\": \"sinceImagePushed\",\n \"countUnit\": \"days\",\n \"countNumber\": 14\n },\n \"action\": {\n \"type\": \"expire\"\n }\n }\n ]\n}\n", "status": "COMPLETE", "previewResults": [], "summary": { "expiringImageTotalCount": 0 } } awscli-1.14.44/awscli/examples/ecr/get-login.rst0000666454262600001440000000125313243367510022516 0ustar pysdk-ciamazon00000000000000**To retrieve a Docker login command to your default registry** This example prints a command that you can use to log in to your default Amazon ECR registry. Command:: aws ecr get-login Output:: docker login -u AWS -p -e none https://.dkr.ecr..amazonaws.com **To log in to another account's registry** This example prints one or more commands that you can use to log in to Amazon ECR registries associated with other accounts. Command:: aws ecr get-login --registry-ids 012345678910 023456789012 Output:: docker login -u -p -e none docker login -u -p -e none awscli-1.14.44/awscli/examples/ecr/batch-delete-image.rst0000666454262600001440000000074113243367510024233 0ustar pysdk-ciamazon00000000000000**To delete an image** This example deletes an image with the tag ``precise`` in a repository called ``ubuntu`` in the default registry for an account. Command:: aws ecr batch-delete-image --repository-name ubuntu --image-ids imageTag=precise Output:: { "failures": [], "imageIds": [ { "imageTag": "precise", "imageDigest": "sha256:19665f1e6d1e504117a1743c0a3d3753086354a38375961f2e665416ef4b1b2f" } ] } awscli-1.14.44/awscli/examples/ecr/get-authorization-token.rst0000666454262600001440000000313413243367510025424 0ustar pysdk-ciamazon00000000000000**To get an authorization token for your default registry** This example command gets an authorization token for your default registry. Command:: aws ecr get-authorization-token Output:: { "authorizationData": [ { "authorizationToken": "QVdTOkN...", "expiresAt": 1448875853.241, "proxyEndpoint": "https://.dkr.ecr.us-west-2.amazonaws.com" } ] } **To get the decoded password for your default registry** This example command gets an authorization token for your default registry and returns the decoded password for you to use in a ``docker login`` command. .. note:: Mac OSX users should use the ``-D`` option to ``base64`` to decode the token data. Command:: aws ecr get-authorization-token --output text \ --query 'authorizationData[].authorizationToken' \ | base64 -D | cut -d: -f2 **To `docker login` with your decoded password** This example command uses your decoded password to add authentication information to your Docker installation by using the ``docker login`` command. The user name is ``AWS``, and you can use any email you want (Amazon ECR does nothing with this information, but ``docker login`` required the email field). .. note:: The final argument is the ``proxyEndpoint`` returned from ``get-authorization-token`` without the ``https://`` prefix. Command:: docker login -u AWS -p -e .dkr.ecr.us-west-2.amazonaws.com Output:: WARNING: login credentials saved in $HOME/.docker/config.json Login Succeeded awscli-1.14.44/awscli/examples/ecr/describe-repositories.rst0000666454262600001440000000114413243367510025135 0ustar pysdk-ciamazon00000000000000**To describe the repositories in a registry** This example describes the repositories in the default registry for an account. Command:: aws ecr describe-repositories Output:: { "repositories": [ { "registryId": "012345678910", "repositoryName": "ubuntu", "repositoryArn": "arn:aws:ecr:us-west-2:012345678910:repository/ubuntu" }, { "registryId": "012345678910", "repositoryName": "test", "repositoryArn": "arn:aws:ecr:us-west-2:012345678910:repository/test" } ] } awscli-1.14.44/awscli/examples/ecr/put-lifecycle-policy.rst0000666454262600001440000000225613243367510024677 0ustar pysdk-ciamazon00000000000000**To create a lifecycle policy** This example creates a lifecycle policy defined by ``policy.json` for a repository called ``project-a/amazon-ecs-sample`` in the default registry for an account. Command:: aws ecr put-lifecycle-policy --repository-name "project-a/amazon-ecs-sample" --lifecycle-policy-text "file://policy.json" JSON file format:: { "rules": [ { "rulePriority": 1, "description": "Expire images older than 14 days", "selection": { "tagStatus": "untagged", "countType": "sinceImagePushed", "countUnit": "days", "countNumber": 14 }, "action": { "type": "expire" } } ] } Output:: { "registryId": "", "repositoryName": "project-a/amazon-ecs-sample", "lifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Expire images older than 14 days\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countUnit\":\"days\",\"countNumber\":14},\"action\":{\"type\":\"expire\"}}]}" } awscli-1.14.44/awscli/examples/ecr/get-lifecycle-policy.rst0000666454262600001440000000127213243367510024643 0ustar pysdk-ciamazon00000000000000**To retrieve a lifecycle policy** This example retrieves the lifecycle policy for a repository called ``project-a/amazon-ecs-sample`` in the default registry for an account. Command:: aws ecr get-lifecycle-policy --repository-name "project-a/amazon-ecs-sample" Output:: { "registryId": "", "repositoryName": "project-a/amazon-ecs-sample", "lifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Expire images older than 14 days\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countUnit\":\"days\",\"countNumber\":14},\"action\":{\"type\":\"expire\"}}]}", "lastEvaluatedAt": 1504295007.0 } awscli-1.14.44/awscli/examples/cloudtrail/0000777454262600001440000000000013243367512021471 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/cloudtrail/stop-logging.rst0000666454262600001440000000023113243367510024626 0ustar pysdk-ciamazon00000000000000**To stop logging a trail** The following ``stop-logging`` command turns off logging for ``Trail1``:: aws cloudtrail stop-logging --name Trail1 awscli-1.14.44/awscli/examples/cloudtrail/get-trail-status.rst0000666454262600001440000000147113243367510025435 0ustar pysdk-ciamazon00000000000000**To get the status of a trail** The following ``get-trail-status`` command returns the delivery and logging details for ``Trail1``:: aws cloudtrail get-trail-status --name Trail1 Output:: { "LatestNotificationTime": 1454022144.869, "LatestNotificationAttemptSucceeded": "2016-01-28T23:02:24Z", "LatestDeliveryAttemptTime": "2016-01-28T23:02:24Z", "LatestDeliveryTime": 1454022144.869, "TimeLoggingStarted": "2015-11-06T18:36:38Z", "LatestDeliveryAttemptSucceeded": "2016-01-28T23:02:24Z", "IsLogging": true, "LatestCloudWatchLogsDeliveryTime": 1454022144.918, "StartLoggingTime": 1446834998.695, "StopLoggingTime": 1446834996.933, "LatestNotificationAttemptTime": "2016-01-28T23:02:24Z", "TimeLoggingStopped": "2015-11-06T18:36:36Z" }awscli-1.14.44/awscli/examples/cloudtrail/delete-trail.rst0000666454262600001440000000022513243367510024573 0ustar pysdk-ciamazon00000000000000**To delete a trail** The following ``delete-trail`` command deletes a trail named ``Trail1``:: aws cloudtrail delete-trail --name Trail1 awscli-1.14.44/awscli/examples/cloudtrail/add-tags.rst0000666454262600001440000000036413243367510023710 0ustar pysdk-ciamazon00000000000000**To add tags to trail** The following ``add-tags`` command adds tags for ``Trail1``:: aws cloudtrail add-tags --resource-id arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1 --tags-list Key=name,Value=Alice Key=location,Value=us awscli-1.14.44/awscli/examples/cloudtrail/describe-trails.rst0000666454262600001440000000247413243367510025304 0ustar pysdk-ciamazon00000000000000**To describe a trail** The following ``describe-trails`` command returns the settings for ``Trail1`` and ``Trail2``:: aws cloudtrail describe-trails --trail-name-list Trail1 Trail2 Output:: { "trailList": [ { "IncludeGlobalServiceEvents": true, "Name": "Trail1", "TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", "LogFileValidationEnabled": false, "IsMultiRegionTrail": false, "S3BucketName": "my-bucket", "CloudWatchLogsRoleArn": "arn:aws:iam::123456789012:role/CloudTrail_CloudWatchLogs_Role", "CloudWatchLogsLogGroupArn": "arn:aws:logs:us-east-1:123456789012:log-group:CloudTrail:*", "SnsTopicName": "my-topic", "HomeRegion": "us-east-1" }, { "IncludeGlobalServiceEvents": true, "Name": "Trail2", "S3KeyPrefix": "my-prefix", "TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail2", "LogFileValidationEnabled": false, "IsMultiRegionTrail": false, "S3BucketName": "my-bucket", "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/4c5ae5ac-3c13-421e-8335-c7868ef6a769", "HomeRegion": "us-east-1" } ] }awscli-1.14.44/awscli/examples/cloudtrail/validate-logs.rst0000666454262600001440000000110713243367510024753 0ustar pysdk-ciamazon00000000000000**To validate a log file** The following ``validate-logs`` command validates the logs for ``Trail1``:: aws cloudtrail validate-logs --trail-arn arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1 --start-time 20160129T19:00:00Z Output:: Validating log files for trail arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1 between 2016-01-29T19:00:00Z and 2016-01-29T22:15:43Z Results requested for 2016-01-29T19:00:00Z to 2016-01-29T22:15:43Z Results found for 2016-01-29T19:24:57Z to 2016-01-29T21:24:57Z: 3/3 digest files valid 15/15 log files validawscli-1.14.44/awscli/examples/cloudtrail/create-trail.rst0000666454262600001440000000100113243367510024565 0ustar pysdk-ciamazon00000000000000**To create a trail** The following ``create-trail`` command creates a multi-region trail named ``Trail1`` and specifies an S3 bucket:: aws cloudtrail create-trail --name Trail1 --s3-bucket-name my-bucket --is-multi-region-trail Output:: { "IncludeGlobalServiceEvents": true, "Name": "Trail1", "TrailARN": "arn:aws:cloudtrail:us-west-2:123456789012:trail/Trail1", "LogFileValidationEnabled": false, "IsMultiRegionTrail": true, "S3BucketName": "my-bucket" } awscli-1.14.44/awscli/examples/cloudtrail/list-public-keys.rst0000666454262600001440000000157213243367510025426 0ustar pysdk-ciamazon00000000000000**To list all public keys for a trail** The following ``list-public-keys`` command returns all public keys whose private keys were used to sign the digest files within the specified time range:: aws cloudtrail list-public-keys --start-time 2016-01-01T20:30:00.000Z Output:: { "PublicKeyList": [ { "ValidityStartTime": 1453076702.0, "ValidityEndTime": 1455668702.0, "Value": "MIIBCgKCAQEAlSS3cl92HDycr/MTj0moOhas8habjrraXw+KzlWF0axSI2tcF+3iJ9BKQAVSKxGwxwu3m0wG3J+kUl1xboEcEPHYoIYMbgfSw7KGnuDKwkLzsQWhUJ0cIbOHASox1vv/5fNXkrHhGbDCHeVXm804c83nvHUEFYThr1PfyP/8HwrCtR3FX5OANtQCP61C1nJtSSkC8JSQUOrIP4CuwJjc+4WGDk+BGH5m9iuiAKkipEHWmUl8/P7XpfpWQuk4h8g3pXZOrNXr08lbh4d39svj7UqdhvOXoBISp9t/EXYuePGEtBdrKD9Dz+VHwyUPtBQvYr9BnkF88qBnaPNhS44rzwIDAQAB", "Fingerprint": "7f3f401420072e50a65a141430817ab3" } ] }awscli-1.14.44/awscli/examples/cloudtrail/start-logging.rst0000666454262600001440000000023713243367510025004 0ustar pysdk-ciamazon00000000000000**To start logging for a trail** The following ``start-logging`` command turns on logging for ``Trail1``:: aws cloudtrail start-logging --name Trail1 awscli-1.14.44/awscli/examples/cloudtrail/update-trail.rst0000666454262600001440000000073013243367510024614 0ustar pysdk-ciamazon00000000000000**To update a trail** The following ``update-trail`` command updates a trail to use an existing bucket for log delivery:: aws cloudtrail update-trail --name Trail1 --s3-bucket-name my-bucket Output:: { "IncludeGlobalServiceEvents": true, "Name": "Trail1", "TrailARN": "arn:aws:cloudtrail:us-west-2:123456789012:trail/Trail1", "LogFileValidationEnabled": false, "IsMultiRegionTrail": true, "S3BucketName": "my-bucket" }awscli-1.14.44/awscli/examples/cloudtrail/lookup-events.rst0000666454262600001440000000323213243367510025034 0ustar pysdk-ciamazon00000000000000**To look up events for a trail** The following ``lookup-events`` command looks up API activity events by the attribute ``EventName``:: aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=ConsoleLogin Output:: { "Events": [ { "EventId": "654ccbc0-ba0d-486a-9076-dbf7274677a7", "Username": "my-session-name", "EventTime": 1453844532.0, "CloudTrailEvent": "{\"eventVersion\":\"1.02\",\"userIdentity\":{\"type\":\"AssumedRole\",\"principalId\":\"AROAJIKPFTA72SWU4L7T4:my-session-name\",\"arn\":\"arn:aws:sts::123456789012:assumed-role/my-role/my-session-name\",\"accountId\":\"123456789012\",\"sessionContext\":{\"attributes\":{\"mfaAuthenticated\":\"false\",\"creationDate\":\"2016-01-26T21:42:12Z\"},\"sessionIssuer\":{\"type\":\"Role\",\"principalId\":\"AROAJIKPFTA72SWU4L7T4\",\"arn\":\"arn:aws:iam::123456789012:role/my-role\",\"accountId\":\"123456789012\",\"userName\":\"my-role\"}}},\"eventTime\":\"2016-01-26T21:42:12Z\",\"eventSource\":\"signin.amazonaws.com\",\"eventName\":\"ConsoleLogin\",\"awsRegion\":\"us-east-1\",\"sourceIPAddress\":\"72.21.198.70\",\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36\",\"requestParameters\":null,\"responseElements\":{\"ConsoleLogin\":\"Success\"},\"additionalEventData\":{\"MobileVersion\":\"No\",\"MFAUsed\":\"No\"},\"eventID\":\"654ccbc0-ba0d-486a-9076-dbf7274677a7\",\"eventType\":\"AwsConsoleSignIn\",\"recipientAccountId\":\"123456789012\"}", "EventName": "ConsoleLogin", "Resources": [] } ] }awscli-1.14.44/awscli/examples/cloudtrail/create-subscription.rst0000666454262600001440000000175413243367510026215 0ustar pysdk-ciamazon00000000000000**To create and configure AWS resources for a trail** The following ``create-subscription`` command creates a new S3 bucket and SNS topic for ``Trail1``:: aws cloudtrail create-subscription --name Trail1 --s3-new-bucket my-bucket --sns-new-topic my-topic Output:: Setting up new S3 bucket my-bucket... Setting up new SNS topic my-topic... Creating/updating CloudTrail configuration... CloudTrail configuration: { "trailList": [ { "IncludeGlobalServiceEvents": true, "Name": "Trail1", "TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", "LogFileValidationEnabled": false, "IsMultiRegionTrail": false, "S3BucketName": "my-bucket", "SnsTopicName": "my-topic", "HomeRegion": "us-east-1" } ], "ResponseMetadata": { "HTTPStatusCode": 200, "RequestId": "f39e51f6-c615-11e5-85bd-d35ca21ee3e2" } } Starting CloudTrail service... Logs will be delivered to my-bucketawscli-1.14.44/awscli/examples/cloudtrail/list-tags.rst0000666454262600001440000000167113243367510024135 0ustar pysdk-ciamazon00000000000000**To list the tags for a trail** The following ``list-tags`` command lists the tags for ``Trail1`` and ``Trail2``:: aws cloudtrail list-tags --resource-id-list arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1 arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail2 Output:: { "ResourceTagList": [ { "ResourceId": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", "TagsList": [ { "Value": "Alice", "Key": "name" }, { "Value": "us", "Key": "location" } ] }, { "ResourceId": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail2", "TagsList": [ { "Value": "Bob", "Key": "name" } ] } ] }awscli-1.14.44/awscli/examples/cloudtrail/get-event-selectors.rst0000777454262600001440000000070313243367510026123 0ustar pysdk-ciamazon00000000000000**To view the event selector settings for a trail** The following ``get-event-selectors`` command returns the settings for ``Trail1``:: aws cloudtrail get-event-selectors --trail-name Trail1 Output:: { "EventSelectors": [ { "IncludeManagementEvents": true, "DataResources": [], "ReadWriteType": "All" } ], "TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1" } awscli-1.14.44/awscli/examples/cloudtrail/put-event-selectors.rst0000777454262600001440000000150013243367510026150 0ustar pysdk-ciamazon00000000000000**To configure event selectors for a trail** The following ``put-event-selectors`` command configures an event selector for ``Trail1``:: aws cloudtrail put-event-selectors --trail-name Trail1 --event-selectors '[{ "ReadWriteType": "All", "IncludeManagementEvents":true, "DataResources": [{ "Type": "AWS::S3::Object", "Values": ["arn:aws:s3:::mybucket/prefix"] }] }]' Output:: { "EventSelectors": [ { "IncludeManagementEvents": true, "DataResources": [ { "Values": [ "arn:aws:s3:::mybucket/prefix" ], "Type": "AWS::S3::Object" } ], "ReadWriteType": "All" } ], "TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1" } awscli-1.14.44/awscli/examples/cloudtrail/update-subscription.rst0000666454262600001440000000167713243367510026240 0ustar pysdk-ciamazon00000000000000**To update the configuration settings for a trail** The following ``update-subscription`` command updates the trail to specify a new S3 bucket and SNS topic:: aws cloudtrail update-subscription --name Trail1 --s3-new-bucket my-bucket-new --sns-new-topic my-topic-new Output:: Setting up new S3 bucket my-bucket-new... Setting up new SNS topic my-topic-new... Creating/updating CloudTrail configuration... CloudTrail configuration: { "trailList": [ { "IncludeGlobalServiceEvents": true, "Name": "Trail1", "TrailARN": "arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1", "LogFileValidationEnabled": false, "IsMultiRegionTrail": false, "S3BucketName": "my-bucket-new", "SnsTopicName": "my-topic-new", "HomeRegion": "us-east-1" } ], "ResponseMetadata": { "HTTPStatusCode": 200, "RequestId": "31126f8a-c616-11e5-9cc6-2fd637936879" } }awscli-1.14.44/awscli/examples/cloudtrail/remove-tags.rst0000666454262600001440000000037413243367510024456 0ustar pysdk-ciamazon00000000000000**To remove tags for a trail** The following ``remove-tags`` command removes the specified tags for ``Trail1``:: aws cloudtrail remove-tags --resource-id arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1 --tags-list Key=name Key=location awscli-1.14.44/awscli/examples/opsworkscm/0000777454262600001440000000000013243367512021536 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/opsworkscm/update-server.rst0000666454262600001440000000343013243367510025054 0ustar pysdk-ciamazon00000000000000**To update a server** The following ``update-server`` command updates the maintenance start time of a Chef Automate server named ``automate-06`` in your default region. The ``--preferred-maintenance-window`` parameter is added to change the start day and time of server maintenance to Mondays at 9:15 a.m. UTC.:: aws opsworks-cm update-server --server-name "automate-06" --preferred-maintenance-window "Mon:09:15" The output shows you information similar to the following about the updated server. *Output*:: { "Server": { "BackupRetentionCount": 8, "CreatedAt": 2016-07-29T13:38:47.520Z, "DisableAutomatedBackup": TRUE, "Endpoint": "https://opsworks-cm.us-east-1.amazonaws.com", "Engine": "Chef", "EngineAttributes": [ { "Name": "CHEF_DELIVERY_ADMIN_PASSWORD", "Value": "1Password1" } ], "EngineModel": "Single", "EngineVersion": "12", "InstanceProfileArn": "arn:aws:iam::1019881987024:instance-profile/automate-06-1010V4UU2WRM2", "InstanceType": "m4.large", "KeyPair": "", "MaintenanceStatus": "OK", "PreferredBackupWindow": "Mon:09:15", "PreferredMaintenanceWindow": "03:00", "SecurityGroupIds": [ "sg-1a24c270" ], "ServerArn": "arn:aws:iam::1019881987024:instance/automate-06-1010V4UU2WRM2", "ServerName": "automate-06", "ServiceRoleArn": "arn:aws:iam::1019881987024:role/aws-opsworks-cm-service-role.1114810729735", "Status": "HEALTHY", "StatusReason": "", "SubnetIds": [ "subnet-49436a18" ] } } **More Information** For more information, see `UpdateServer`_ in the *AWS OpsWorks for Chef Automate API Reference*. .. _`UpdateServer`: http://docs.aws.amazon.com/opsworks-cm/latest/APIReference/API_UpdateServer.html awscli-1.14.44/awscli/examples/opsworkscm/describe-node-association-status.rst0000666454262600001440000000150613243367510030626 0ustar pysdk-ciamazon00000000000000**To describe node association status** The following ``describe-node-association-status`` command returns the status of a request to associate a node with a Chef Automate server named ``automate-06``.:: aws opsworks-cm describe-node-association-status --server-name "automate-06" --node-association-status-token "AflJKl+/GoKLZJBdDQEx0O65CDi57blQe9nKM8joSok0pQ9xr8DqApBN9/1O6sLdSvlfDEKkEx+eoCHvjoWHaOs=" The output for each account attribute entry returned by the command resembles the following. *Output*:: { "NodeAssociationStatus": "IN_PROGRESS" } **More Information** For more information, see `DescribeNodeAssociationStatus`_ in the *AWS OpsWorks for Chef Automate API Reference*. .. _`DescribeNodeAssociationStatus`: http://docs.aws.amazon.com/opsworks-cm/latest/APIReference/API_DescribeNodeAssociationStatus.html awscli-1.14.44/awscli/examples/opsworkscm/describe-backups.rst0000666454262600001440000000324713243367510025502 0ustar pysdk-ciamazon00000000000000**To describe backups** The following ``describe-backups`` command returns information about all backups associated with your account in your default region.:: aws opsworks-cm describe-backups The output for each backup entry returned by the command resembles the following. *Output*:: { "Backups": [ { "BackupArn": "string", "BackupId": "automate-06-20160729133847520", "BackupType": "MANUAL", "CreatedAt": 2016-07-29T13:38:47.520Z, "Description": "state of my infrastructure at launch", "Engine": "Chef", "EngineModel": "Single", "EngineVersion": "12", "InstanceProfileArn": "arn:aws:iam::1019881987024:instance-profile/automate-06-1010V4UU2WRM2", "InstanceType": "m4.large", "KeyPair": "", "PreferredBackupWindow": "", "PreferredMaintenanceWindow": "", "S3LogUrl": "https://s3.amazonaws.com/automate-06/automate-06-20160729133847520", "SecurityGroupIds": [ "sg-1a24c270" ], "ServerName": "automate-06", "ServiceRoleArn": "arn:aws:iam::1019881987024:role/aws-opsworks-cm-service-role.1114810729735", "Status": "Successful", "StatusDescription": "", "SubnetIds": [ "subnet-49436a18" ], "ToolsVersion": "string", "UserArn": "arn:aws:iam::1019881987024:user/opsworks-user" } ], } **More Information** For more information, see `Back Up and Restore an AWS OpsWorks for Chef Automate Server`_ in the *AWS OpsWorks User Guide*. .. _`Back Up and Restore an AWS OpsWorks for Chef Automate Server`: http://docs.aws.amazon.com/opsworks/latest/userguide/opscm-backup-restore.html awscli-1.14.44/awscli/examples/opsworkscm/delete-server.rst0000666454262600001440000000113313243367510025032 0ustar pysdk-ciamazon00000000000000**To delete servers** The following ``delete-server`` command deletes a Chef Automate server, identified by the server's name. After the server is deleted, it is no longer returned by ``DescribeServer`` requests.:: aws opsworks-cm delete-server --server-name "automate-06" The output shows whether the server deletion succeeded. **More Information** For more information, see `Delete an AWS OpsWorks for Chef Automate Server`_ in the *AWS OpsWorks User Guide*. .. _`Delete an AWS OpsWorks for Chef Automate Server`: http://docs.aws.amazon.com/opsworks/latest/userguide/opscm-delete-server.html awscli-1.14.44/awscli/examples/opsworkscm/associate-node.rst0000666454262600001440000000212413243367510025163 0ustar pysdk-ciamazon00000000000000**To associate nodes** The following ``associate-node`` command associates a node named ``i-44de882p`` with a Chef Automate server named ``automate-06``, meaning that the ``automate-06`` server manages the node, and communicates recipe commands to the node through ``chef-client`` agent software that is installed on the node by the associate-node command. Valid node names are EC2 instance IDs.:: aws opsworks-cm associate-node --server-name "automate-06" --node-name "i-43de882p" --engine-attributes "Name=CHEF_ORGANIZATION,Value='MyOrganization' Name=CHEF_NODE_PUBLIC_KEY,Value='Public_key_contents'" The output returned by the command resembles the following. *Output*:: { "NodeAssociationStatusToken": "AHUY8wFe4pdXtZC5DiJa5SOLp5o14DH//rHRqHDWXxwVoNBxcEy4V7R0NOFymh7E/1HumOBPsemPQFE6dcGaiFk" } **More Information** For more information, see `Adding Nodes Automatically in AWS OpsWorks for Chef Automate`_ in the *AWS OpsWorks User Guide*. .. _`Adding Nodes Automatically in AWS OpsWorks for Chef Automate`: http://docs.aws.amazon.com/opsworks/latest/userguide/opscm-unattend-assoc.html awscli-1.14.44/awscli/examples/opsworkscm/create-server.rst0000666454262600001440000000426513243367510025044 0ustar pysdk-ciamazon00000000000000**To create a server** The following ``create-server`` command creates a new Chef Automate server named ``automate-06`` in your default region. Note that defaults are used for most other settings, such as number of backups to retain, and maintenance and backup start times. Before you run a ``create-server`` command, complete prerequisites in .. _`Getting Started with AWS OpsWorks for Chef Automate`: http://docs.aws.amazon.com/opsworks/latest/userguide/gettingstarted-opscm.html .:: aws opsworks-cm create-server --engine "Chef" --engine-model "Single" --engine-version "12" --server-name "automate-06" --instance-profile-arn "arn:aws:iam::1019881987024:instance-profile/aws-opsworks-cm-ec2-role" --instance-type "t2.medium" --key-pair "amazon-test" --service-role-arn "arn:aws:iam::044726508045:role/aws-opsworks-cm-service-role" The output shows you information similar to the following about the new server. *Output*:: { "Server": { "BackupRetentionCount": 10, "CreatedAt": 2016-07-29T13:38:47.520Z, "DisableAutomatedBackup": FALSE, "Endpoint": "https://opsworks-cm.us-east-1.amazonaws.com", "Engine": "Chef", "EngineAttributes": [ { "Name": "CHEF_DELIVERY_ADMIN_PASSWORD", "Value": "1Password1" } ], "EngineModel": "Single", "EngineVersion": "12", "InstanceProfileArn": "arn:aws:iam::1019881987024:instance-profile/aws-opsworks-cm-ec2-role", "InstanceType": "t2.medium", "KeyPair": "amazon-test", "MaintenanceStatus": "", "PreferredBackupWindow": "Sun:02:00", "PreferredMaintenanceWindow": "00:00", "SecurityGroupIds": [ "sg-1a24c270" ], "ServerArn": "arn:aws:iam::1019881987024:instance/automate-06-1010V4UU2WRM2", "ServerName": "automate-06", "ServiceRoleArn": "arn:aws:iam::1019881987024:role/aws-opsworks-cm-service-role", "Status": "CREATING", "StatusReason": "", "SubnetIds": [ "subnet-49436a18" ] } } **More Information** For more information, see `UpdateServer`_ in the *AWS OpsWorks for Chef Automate API Reference*. .. _`UpdateServer`: http://docs.aws.amazon.com/opsworks-cm/latest/APIReference/API_UpdateServer.html awscli-1.14.44/awscli/examples/opsworkscm/restore-server.rst0000666454262600001440000000151213243367510025254 0ustar pysdk-ciamazon00000000000000**To restore a server** The following ``restore-server`` command performs an in-place restoration of a Chef Automate server named ``automate-06`` in your default region from a backup with an ID of ``automate-06-2016-11-22T16:13:27.998Z``. Restoring a server restores connections to the nodes that the Chef Automate server was managing at the time that the specified backup was performed. aws opsworks-cm restore-server --backup-id "automate-06-2016-11-22T16:13:27.998Z" --server-name "automate-06" The output is the command ID only. *Output*:: (None) **More Information** For more information, see `Restore a Failed AWS OpsWorks for Chef Automate Server`_ in the *AWS OpsWorks User Guide*. .. _`Restore a Failed AWS OpsWorks for Chef Automate Server`: http://docs.aws.amazon.com/opsworks/latest/userguide/opscm-chef-restore.html awscli-1.14.44/awscli/examples/opsworkscm/describe-events.rst0000666454262600001440000000152213243367510025350 0ustar pysdk-ciamazon00000000000000**To describe events** The following ``describe-events`` command returns information about all events that are associated with a Chef Automate server named ``automate-06``.:: aws opsworks-cm describe-events --server-name 'automate-06' The output for each event entry returned by the command resembles the following. *Output*:: { "ServerEvents": [ { "CreatedAt": 2016-07-29T13:38:47.520Z, "LogUrl": "https://s3.amazonaws.com/automate-06/automate-06-20160729133847520", "Message": "Updates successfully installed.", "ServerName": "automate-06" } ] } **More Information** For more information, see `General Troubleshooting Tips`_ in the *AWS OpsWorks User Guide*. .. _`General Troubleshooting Tips`: http://docs.aws.amazon.com/opsworks/latest/userguide/troubleshoot-opscm.html#d0e4561 awscli-1.14.44/awscli/examples/opsworkscm/disassociate-node.rst0000666454262600001440000000163213243367510025666 0ustar pysdk-ciamazon00000000000000**To disassociate nodes** The following ``disassociate-node`` command disassociates a node named ``i-44de882p``, removing the node from management by a Chef Automate server named ``automate-06``. Valid node names are EC2 instance IDs.:: aws opsworks-cm disassociate-node --server-name "automate-06" --node-name "i-43de882p" --engine-attributes "Name=CHEF_ORGANIZATION,Value='MyOrganization' Name=CHEF_NODE_PUBLIC_KEY,Value='Public_key_contents'" The output returned by the command resembles the following. *Output*:: { "NodeAssociationStatusToken": "AHUY8wFe4pdXtZC5DiJa5SOLp5o14DH//rHRqHDWXxwVoNBxcEy4V7R0NOFymh7E/1HumOBPsemPQFE6dcGaiFk" } **More Information** For more information, see `Delete an AWS OpsWorks for Chef Automate Server`_ in the *AWS OpsWorks User Guide*. .. _`Delete an AWS OpsWorks for Chef Automate Server`: http://docs.aws.amazon.com/opsworks/latest/userguide/opscm-delete-server.html awscli-1.14.44/awscli/examples/opsworkscm/update-server-engine-attributes.rst0000666454262600001440000000353013243367510030504 0ustar pysdk-ciamazon00000000000000**To update server engine attributes** The following ``update-server-engine-attributes`` command updates the value of the ``CHEF_PIVOTAL_KEY`` engine attribute for a Chef Automate server named ``automate-06``. It is currently not possible to change the value of other engine attributes.:: aws opsworks-cm update-server-engine-attributes --attribute-name CHEF_PIVOTAL_KEY --attribute-value "new key value" --server-name "automate-06" The output shows you information similar to the following about the updated server. *Output*:: { "Server": { "BackupRetentionCount": 2, "CreatedAt": 2016-07-29T13:38:47.520Z, "DisableAutomatedBackup": FALSE, "Endpoint": "https://opsworks-cm.us-east-1.amazonaws.com", "Engine": "Chef", "EngineAttributes": [ { "Name": "CHEF_PIVOTAL_KEY", "Value": "new key value" } ], "EngineModel": "Single", "EngineVersion": "12", "InstanceProfileArn": "arn:aws:iam::1019881987024:instance-profile/automate-06-1010V4UU2WRM2", "InstanceType": "m4.large", "KeyPair": "", "MaintenanceStatus": "SUCCESS", "PreferredBackupWindow": "Mon:09:15", "PreferredMaintenanceWindow": "03:00", "SecurityGroupIds": [ "sg-1a24c270" ], "ServerArn": "arn:aws:iam::1019881987024:instance/automate-06-1010V4UU2WRM2", "ServerName": "automate-06", "ServiceRoleArn": "arn:aws:iam::1019881987024:role/aws-opsworks-cm-service-role.1114810729735", "Status": "HEALTHY", "StatusReason": "", "SubnetIds": [ "subnet-49436a18" ] } } **More Information** For more information, see `UpdateServerEngineAttributes`_ in the *AWS OpsWorks for Chef Automate API Reference*. .. _`UpdateServerEngineAttributes`: http://docs.aws.amazon.com/opsworks-cm/latest/APIReference/API_UpdateServerEngineAttributes.html awscli-1.14.44/awscli/examples/opsworkscm/delete-backup.rst0000666454262600001440000000135213243367510024774 0ustar pysdk-ciamazon00000000000000**To delete backups** The following ``delete-backup`` command deletes a manual or automated backup of a Chef Automate server, identified by the backup ID. This command is useful when you are approaching the maximum number of backups that you can save, or you want to minimize your Amazon S3 storage costs.:: aws opsworks-cm delete-backup --backup-id "automate-06-2016-11-19T23:42:40.240Z" The output shows whether the backup deletion succeeded. **More Information** For more information, see `Back Up and Restore an AWS OpsWorks for Chef Automate Server`_ in the *AWS OpsWorks User Guide*. .. _`Back Up and Restore an AWS OpsWorks for Chef Automate Server`: http://docs.aws.amazon.com/opsworks/latest/userguide/opscm-backup-restore.html awscli-1.14.44/awscli/examples/opsworkscm/start-maintenance.rst0000666454262600001440000000337713243367510025715 0ustar pysdk-ciamazon00000000000000**To start maintenance** The following ``start-maintenance`` command manually starts maintenance on a Chef Automate server named ``automate-06`` in your default region. This command can be useful if an earlier, automated maintenance attempt failed, and the underlying cause of maintenance failure has been resolved.:: aws opsworks-cm start-maintenance --server-name 'automate-06' The output shows you information similar to the following about the maintenance request. *Output*:: { "Server": { "BackupRetentionCount": 8, "CreatedAt": 2016-07-29T13:38:47.520Z, "DisableAutomatedBackup": TRUE, "Endpoint": "https://opsworks-cm.us-east-1.amazonaws.com", "Engine": "Chef", "EngineAttributes": [ { "Name": "CHEF_DELIVERY_ADMIN_PASSWORD", "Value": "1Password1" } ], "EngineModel": "Single", "EngineVersion": "12", "InstanceProfileArn": "arn:aws:iam::1019881987024:instance-profile/automate-06-1010V4UU2WRM2", "InstanceType": "m4.large", "KeyPair": "", "MaintenanceStatus": "SUCCESS", "PreferredBackupWindow": "", "PreferredMaintenanceWindow": "", "SecurityGroupIds": [ "sg-1a24c270" ], "ServerArn": "arn:aws:iam::1019881987024:instance/automate-06-1010V4UU2WRM2", "ServerName": "automate-06", "ServiceRoleArn": "arn:aws:iam::1019881987024:role/aws-opsworks-cm-service-role.1114810729735", "Status": "HEALTHY", "StatusReason": "", "SubnetIds": [ "subnet-49436a18" ] } } **More Information** For more information, see `StartMaintenance`_ in the *AWS OpsWorks for Chef Automate API Reference*. .. _`StartMaintenance`: http://docs.aws.amazon.com/opsworks-cm/latest/APIReference/API_StartMaintenance.html awscli-1.14.44/awscli/examples/opsworkscm/create-backup.rst0000666454262600001440000000351013243367510024773 0ustar pysdk-ciamazon00000000000000**To create backups** The following ``create-backup`` command starts a manual backup of a Chef Automate server named ``automate-06`` in the ``us-east-1`` region. The command adds a descriptive message to the backup in the ``--description`` parameter.:: aws opsworks-cm create-backup --server-name 'automate-06' --description "state of my infrastructure at launch" The output shows you information similar to the following about the new backup. *Output*:: { "Backups": [ { "BackupArn": "string", "BackupId": "automate-06-20160729133847520", "BackupType": "MANUAL", "CreatedAt": 2016-07-29T13:38:47.520Z, "Description": "state of my infrastructure at launch", "Engine": "Chef", "EngineModel": "Single", "EngineVersion": "12", "InstanceProfileArn": "arn:aws:iam::1019881987024:instance-profile/automate-06-1010V4UU2WRM2", "InstanceType": "m4.large", "KeyPair": "", "PreferredBackupWindow": "", "PreferredMaintenanceWindow": "", "S3LogUrl": "https://s3.amazonaws.com/automate-06/automate-06-20160729133847520", "SecurityGroupIds": [ "sg-1a24c270" ], "ServerName": "automate-06", "ServiceRoleArn": "arn:aws:iam::1019881987024:role/aws-opsworks-cm-service-role.1114810729735", "Status": "OK", "StatusDescription": "", "SubnetIds": [ "subnet-49436a18" ], "ToolsVersion": "string", "UserArn": "arn:aws:iam::1019881987024:user/opsworks-user" } ], } **More Information** For more information, see `Back Up and Restore an AWS OpsWorks for Chef Automate Server`_ in the *AWS OpsWorks User Guide*. .. _`Back Up and Restore an AWS OpsWorks for Chef Automate Server`: http://docs.aws.amazon.com/opsworks/latest/userguide/opscm-backup-restore.html awscli-1.14.44/awscli/examples/opsworkscm/describe-servers.rst0000666454262600001440000000326313243367510025541 0ustar pysdk-ciamazon00000000000000**To describe servers** The following ``describe-servers`` command returns information about all servers that are associated with your account, and in your default region.:: aws opsworks-cm describe-servers The output for each server entry returned by the command resembles the following. *Output*:: { "Servers": [ { "BackupRetentionCount": 8, "CreatedAt": 2016-07-29T13:38:47.520Z, "DisableAutomatedBackup": FALSE, "Endpoint": "https://opsworks-cm.us-east-1.amazonaws.com", "Engine": "Chef", "EngineAttributes": [ { "Name": "CHEF_DELIVERY_ADMIN_PASSWORD", "Value": "1Password1" } ], "EngineModel": "Single", "EngineVersion": "12", "InstanceProfileArn": "arn:aws:iam::1019881987024:instance-profile/automate-06-1010V4UU2WRM2", "InstanceType": "m4.large", "KeyPair": "", "MaintenanceStatus": "SUCCESS", "PreferredBackupWindow": "03:00", "PreferredMaintenanceWindow": "Mon:09:00", "SecurityGroupIds": [ "sg-1a24c270" ], "ServerArn": "arn:aws:iam::1019881987024:instance/automate-06-1010V4UU2WRM2", "ServerName": "automate-06", "ServiceRoleArn": "arn:aws:iam::1019881987024:role/aws-opsworks-cm-service-role.1114810729735", "Status": "HEALTHY", "StatusReason": "", "SubnetIds": [ "subnet-49436a18" ] } ] } **More Information** For more information, see `DescribeServers`_ in the *AWS OpsWorks for Chef Automate API Guide*. .. _`DescribeServers`: http://docs.aws.amazon.com/opsworks-cm/latest/APIReference/API_DescribeServers.html awscli-1.14.44/awscli/examples/opsworkscm/describe-account-attributes.rst0000666454262600001440000000132313243367510027663 0ustar pysdk-ciamazon00000000000000**To describe account attributes** The following ``describe-account-attributes`` command returns information about your account's usage of AWS OpsWorks for Chef Automate resources.:: aws opsworks-cm describe-account-attributes The output for each account attribute entry returned by the command resembles the following. *Output*:: { "Attributes": [ { "Maximum": 5, "Name": "ServerLimit", "Used": 2 } ] } **More Information** For more information, see `DescribeAccountAttributes`_ in the *AWS OpsWorks for Chef Automate API Reference*. .. _`DescribeAccountAttributes`: http://docs.aws.amazon.com/opsworks-cm/latest/APIReference/API_DescribeAccountAttributes.html awscli-1.14.44/awscli/examples/events/0000777454262600001440000000000013243367512020633 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/events/disable-rule.rst0000666454262600001440000000026513243367510023736 0ustar pysdk-ciamazon00000000000000**To disable a CloudWatch Events rule** This example disables the rule named DailyLambdaFunction. The rule is not deleted:: aws events disable-rule --name "DailyLambdaFunction" awscli-1.14.44/awscli/examples/events/test-event-pattern.rst0000666454262600001440000000073713243367510025143 0ustar pysdk-ciamazon00000000000000**To check whether an event pattern matches a specified event** This example tests whether the pattern "source:com.mycompany.myapp" matches the specified event. In this example, the output would be "true":: aws events test-event-pattern --event-pattern "{\"source\":[\"com.mycompany.myapp\"]}" --event "{\"id\":\"1\",\"source\":\"com.mycompany.myapp\",\"detail-type\":\"myDetailType\",\"account\":\"123456789012\",\"region\":\"us-east-1\",\"time\":\"2017-04-11T20:11:04Z\"}" awscli-1.14.44/awscli/examples/events/delete-rule.rst0000666454262600001440000000024113243367510023567 0ustar pysdk-ciamazon00000000000000**To delete a CloudWatch Events rule** This example deletes the rule named EC2InstanceStateChanges:: aws events delete-rule --name "EC2InstanceStateChanges" awscli-1.14.44/awscli/examples/events/describe-rule.rst0000666454262600001440000000030113243367510024102 0ustar pysdk-ciamazon00000000000000**To display information about a CloudWatch Events rule** This example displays information about the rule named DailyLambdaFunction:: aws events describe-rule --name "DailyLambdaFunction" awscli-1.14.44/awscli/examples/events/enable-rule.rst0000666454262600001440000000027513243367510023562 0ustar pysdk-ciamazon00000000000000**To enable a CloudWatch Events rule** This example enables the rule named DailyLambdaFunction, which had been previously disabled:: aws events enable-rule --name "DailyLambdaFunction" awscli-1.14.44/awscli/examples/events/list-rules.rst0000666454262600001440000000057513243367510023475 0ustar pysdk-ciamazon00000000000000**To display a list of all CloudWatch Events rules** This example displays all CloudWatch Events rules in the region:: aws events list-rules **To display a list of CloudWatch Events rules beginning with a certain string.** This example displays all CloudWatch Events rules in the region that have a name starting with "Daily":: aws events list-rules --name-prefix "Daily" awscli-1.14.44/awscli/examples/events/remove-targets.rst0000666454262600001440000000050113243367510024323 0ustar pysdk-ciamazon00000000000000**To remove a target for an event** This example removes the Amazon Kinesis stream named MyStream1 from being a target of the rule DailyLambdaFunction. When DailyLambdaFunction was created, this stream was set as a target with an ID of Target1:: aws events remove-targets --rule "DailyLambdaFunction" --ids "Target1" awscli-1.14.44/awscli/examples/events/list-rule-names-by-target.rst0000666454262600001440000000042513243367510026301 0ustar pysdk-ciamazon00000000000000**To display all the rules that have a specified target** This example displays all rules that have the Lambda function named "MyFunctionName" as the target:: aws events list-rule-names-by-target --target-arn "arn:aws:lambda:us-east-1:123456789012:function:MyFunctionName" awscli-1.14.44/awscli/examples/events/put-rule.rst0000666454262600001440000000205313243367510023140 0ustar pysdk-ciamazon00000000000000**To create CloudWatch Events rules** This example creates a rule that triggers every day at 9:00am (UTC). If you use put-targets to add a Lambda function as a target of this rule, you could run the Lambda function every day at the specified time:: aws events put-rule --name "DailyLambdaFunction" --schedule-expression "cron(0 9 * * ? *)" This example creates a rule that triggers when any EC2 instance in the region changes state:: aws events put-rule --name "EC2InstanceStateChanges" --event-pattern "{\"source\":[\"aws.ec2\"],\"detail-type\":[\"EC2 Instance State-change Notification\"]}" --role-arn "arn:aws:iam::123456789012:role/MyRoleForThisRule" This example creates a rule that triggers when any EC2 instance in the region is stopped or terminated:: aws events put-rule --name "EC2InstanceStateChangeStopOrTerminate" --event-pattern "{\"source\":[\"aws.ec2\"],\"detail-type\":[\"EC2 Instance State-change Notification\"],\"detail\":{\"state\":[\"stopped\",\"terminated\"]}}" --role-arn "arn:aws:iam::123456789012:role/MyRoleForThisRule" awscli-1.14.44/awscli/examples/events/list-targets-by-rule.rst0000666454262600001440000000031413243367510025360 0ustar pysdk-ciamazon00000000000000**To display all the targets for a CloudWatch Events rule** This example displays all the targets of the rule named DailyLambdaFunction:: aws events list-targets-by-rule --rule "DailyLambdaFunction" awscli-1.14.44/awscli/examples/events/put-events.rst0000666454262600001440000000134313243367510023476 0ustar pysdk-ciamazon00000000000000**To send a custom event to CloudWatch Events** This example sends a custom event to CloudWatch Events. The event is contained within the putevents.json file:: aws events put-events --entries file://putevents.json Here are the contents of the putevents.json file:: [ { "Source": "com.mycompany.myapp", "Detail": "{ \"key1\": \"value1\", \"key2\": \"value2\" }", "Resources": [ "resource1", "resource2" ], "DetailType": "myDetailType" }, { "Source": "com.mycompany.myapp", "Detail": "{ \"key1\": \"value3\", \"key2\": \"value4\" }", "Resources": [ "resource1", "resource2" ], "DetailType": "myDetailType" } ] awscli-1.14.44/awscli/examples/events/put-targets.rst0000666454262600001440000000174713243367510023653 0ustar pysdk-ciamazon00000000000000**To add targets for CloudWatch Events rules** This example adds a Lambda function as the target of a rule:: aws events put-targets --rule DailyLambdaFunction --targets "Id"="1","Arn"="arn:aws:lambda:us-east-1:123456789012:function:MyFunctionName" This example sets an Amazon Kinesis stream as the target, so that events caught by this rule are relayed to the stream:: aws events put-targets --rule EC2InstanceStateChanges --targets "Id"="1","Arn"="arn:aws:kinesis:us-east-1:123456789012:stream/MyStream","RoleArn"="arn:aws:iam::123456789012:role/MyRoleForThisRule" This example sets two Amazon Kinesis streams as targets for one rule:: aws events put-targets --rule DailyLambdaFunction --targets "Id"="Target1","Arn"="arn:aws:kinesis:us-east-1:379642911888:stream/MyStream1","RoleArn"="arn:aws:iam::379642911888:role/ MyRoleToAccessLambda" "Id"="Target2"," Arn"="arn:aws:kinesis:us-east-1:379642911888:stream/MyStream2","RoleArn"="arn:aws:iam::379642911888:role/MyRoleToAccessLambda" awscli-1.14.44/awscli/examples/cloud9/0000777454262600001440000000000013243367512020526 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/cloud9/describe-environments.rst0000666454262600001440000000167513243367510025574 0ustar pysdk-ciamazon00000000000000**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": [ { "description": "Created from CodeStar.", "ownerArn": "arn:aws:iam::123456789012:user/MyDemoUser", "type": "ec2", "id": "685f892f431b45c2b28cb69eadcdb0EX", "arn": "arn:aws:cloud9:us-east-1:123456789012:environment:685f892f431b45c2b28cb69eadcdb0EX", "name": "my-demo-ec2-env" }, { "ownerArn": "arn:aws:iam::123456789012:user/MyDemoUser", "type": "ssh", "id": "349c86d4579e4e7298d500ff57a6b2EX", "arn": "arn:aws:cloud9:us-east-1:123456789012:environment:349c86d4579e4e7298d500ff57a6b2EX", "name": my-demo-ssh-env" } ] }awscli-1.14.44/awscli/examples/cloud9/create-environment-membership.rst0000666454262600001440000000114413243367510027214 0ustar pysdk-ciamazon00000000000000**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" } }awscli-1.14.44/awscli/examples/cloud9/delete-environment.rst0000666454262600001440000000050513243367510025062 0ustar pysdk-ciamazon00000000000000**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.awscli-1.14.44/awscli/examples/cloud9/update-environment.rst0000666454262600001440000000060513243367510025103 0ustar pysdk-ciamazon00000000000000**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.awscli-1.14.44/awscli/examples/cloud9/describe-environment-status.rst0000666454262600001440000000054113243367510026721 0ustar pysdk-ciamazon00000000000000**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" }awscli-1.14.44/awscli/examples/cloud9/update-environment-membership.rst0000666454262600001440000000123413243367510027233 0ustar pysdk-ciamazon00000000000000**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" } }awscli-1.14.44/awscli/examples/cloud9/list-environments.rst0000666454262600001440000000052313243367510024756 0ustar pysdk-ciamazon00000000000000**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" ] }awscli-1.14.44/awscli/examples/cloud9/describe-environment-memberships.rst0000666454262600001440000000431013243367510027712 0ustar pysdk-ciamazon00000000000000**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" } ] }awscli-1.14.44/awscli/examples/cloud9/delete-environment-membership.rst0000666454262600001440000000056213243367510027216 0ustar pysdk-ciamazon00000000000000**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.awscli-1.14.44/awscli/examples/cloud9/create-environment-ec2.rst0000666454262600001440000000113413243367510025531 0ustar pysdk-ciamazon00000000000000**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" }awscli-1.14.44/awscli/examples/kms/0000777454262600001440000000000013243367512020121 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/kms/create-alias.rst0000666454262600001440000000063413243367510023206 0ustar pysdk-ciamazon00000000000000The following command creates an alias named ``example-alias`` for the customer master key (CMK) identified by key ID ``1234abcd-12ab-34cd-56ef-1234567890ab``. .. code:: aws kms create-alias --alias-name alias/example-alias --target-key-id 1234abcd-12ab-34cd-56ef-1234567890ab Alias names must begin with ``alias/``. Do not use alias names that begin with ``alias/aws``; these are reserved for use by AWS.awscli-1.14.44/awscli/examples/kms/decrypt.rst0000666454262600001440000000517113243367510022327 0ustar pysdk-ciamazon00000000000000The following command demonstrates the recommended way to decrypt data with the AWS CLI. .. code:: aws kms decrypt --ciphertext-blob fileb://ExampleEncryptedFile --output text --query Plaintext | base64 --decode > ExamplePlaintextFile The command does several things: #. Uses the ``fileb://`` prefix to specify the ``--ciphertext-blob`` parameter. The ``fileb://`` prefix instructs the CLI to read the encrypted data, called the *ciphertext*, from a file and pass the file's contents to the command's ``--ciphertext-blob`` parameter. If the file is not in the current directory, type the full path to file. For example: ``fileb:///var/tmp/ExampleEncryptedFile`` or ``fileb://C:\Temp\ExampleEncryptedFile``. For more information about reading AWS CLI parameter values from a file, see `Loading Parameters from a File `_ in the *AWS Command Line Interface User Guide* and `Best Practices for Local File Parameters `_ on the AWS Command Line Tool Blog. The command assumes the ciphertext in ``ExampleEncryptedFile`` is binary data. The `encrypt examples `_ demonstrate how to save a ciphertext this way. #. Uses the ``--output`` and ``--query`` parameters to control the command's output. These parameters extract the decrypted data, called the *plaintext*, from the command's output. For more information about controlling output, see `Controlling Command Output `_ in the *AWS Command Line Interface User Guide*. #. Uses the ``base64`` utility. This utility decodes the extracted plaintext to binary data. The plaintext that is returned by a successful ``decrypt`` command is base64-encoded text. You must decode this text to obtain the original plaintext. #. Saves the binary plaintext to a file. The final part of the command (``> ExamplePlaintextFile``) saves the binary plaintext data to a file. **Example: Using the AWS CLI to decrypt data from the Windows command prompt** The preceding example assumes the ``base64`` utility is available, which is commonly the case on Linux and Mac OS X. For the Windows command prompt, use ``certutil`` instead of ``base64``. This requires two commands, as shown in the following examples. .. code:: aws kms decrypt --ciphertext-blob fileb://ExampleEncryptedFile --output text --query Plaintext > ExamplePlaintextFile.base64 .. code:: certutil -decode ExamplePlaintextFile.base64 ExamplePlaintextFileawscli-1.14.44/awscli/examples/kms/encrypt.rst0000666454262600001440000000535013243367510022340 0ustar pysdk-ciamazon00000000000000The following command demonstrates the recommended way to encrypt data with the AWS CLI. .. code:: aws kms encrypt --key-id 1234abcd-12ab-34cd-56ef-1234567890ab --plaintext fileb://ExamplePlaintextFile --output text --query CiphertextBlob | base64 --decode > ExampleEncryptedFile The command does several things: #. Uses the ``fileb://`` prefix to specify the ``--plaintext`` parameter. The ``fileb://`` prefix instructs the CLI to read the data to encrypt, called the *plaintext*, from a file and pass the file's contents to the command's ``--plaintext`` parameter. If the file is not in the current directory, type the full path to file. For example: ``fileb:///var/tmp/ExamplePlaintextFile`` or ``fileb://C:\Temp\ExamplePlaintextFile``. For more information about reading AWS CLI parameter values from a file, see `Loading Parameters from a File `_ in the *AWS Command Line Interface User Guide* and `Best Practices for Local File Parameters `_ on the AWS Command Line Tool Blog. #. Uses the ``--output`` and ``--query`` parameters to control the command's output. These parameters extract the encrypted data, called the *ciphertext*, from the command's output. For more information about controlling output, see `Controlling Command Output `_ in the *AWS Command Line Interface User Guide*. #. Uses the ``base64`` utility to decode the extracted output. This utility decodes the extracted ciphertext to binary data. The ciphertext that is returned by a successful ``encrypt`` command is base64-encoded text. You must decode this text before you can use the AWS CLI to decrypt it. #. Saves the binary ciphertext to a file. The final part of the command (``> ExampleEncryptedFile``) saves the binary ciphertext to a file to make decryption easier. For an example command that uses the AWS CLI to decrypt data, see the `decrypt examples `_. **Example: Using the AWS CLI to encrypt data from the Windows command prompt** The preceding example assumes the ``base64`` utility is available, which is commonly the case on Linux and Mac OS X. For the Windows command prompt, use ``certutil`` instead of ``base64``. This requires two commands, as shown in the following examples. .. code:: aws kms encrypt --key-id 1234abcd-12ab-34cd-56ef-1234567890ab --plaintext fileb://ExamplePlaintextFile --output text --query CiphertextBlob > C:\Temp\ExampleEncryptedFile.base64 .. code:: certutil -decode C:\Temp\ExampleEncryptedFile.base64 C:\Temp\ExampleEncryptedFileawscli-1.14.44/awscli/examples/emr/0000777454262600001440000000000013243367512020112 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/emr/delete-security-configuration.rst0000666454262600001440000000025513243367510026620 0ustar pysdk-ciamazon00000000000000**To delete a security configuration in the current region** - Command:: aws emr delete-security-configuration --name MySecurityConfig - Output:: None awscli-1.14.44/awscli/examples/emr/list-instances.rst0000666454262600001440000000630313243367510023604 0ustar pysdk-ciamazon00000000000000The following command lists all of the instances in a cluster with the cluster ID ``j-3C6XNQ39VR9WL``:: aws emr list-instances --cluster-id j-3C6XNQ39VR9WL Output:: For a uniform instance group based cluster { "Instances": [ { "Status": { "Timeline": { "ReadyDateTime": 1433200400.03, "CreationDateTime": 1433199960.152 }, "State": "RUNNING", "StateChangeReason": {} }, "Ec2InstanceId": "i-f19ecfee", "PublicDnsName": "ec2-52-52-41-150.us-west-2.compute.amazonaws.com", "PrivateDnsName": "ip-172-21-11-216.us-west-2.compute.internal", "PublicIpAddress": "52.52.41.150", "Id": "ci-3NNHQUQ2TWB6Y", "PrivateIpAddress": "172.21.11.216" }, { "Status": { "Timeline": { "ReadyDateTime": 1433200400.031, "CreationDateTime": 1433199949.102 }, "State": "RUNNING", "StateChangeReason": {} }, "Ec2InstanceId": "i-1feee4c2", "PublicDnsName": "ec2-52-63-246-32.us-west-2.compute.amazonaws.com", "PrivateDnsName": "ip-172-31-24-130.us-west-2.compute.internal", "PublicIpAddress": "52.63.246.32", "Id": "ci-GAOCMKNKDCV7", "PrivateIpAddress": "172.21.11.215" }, { "Status": { "Timeline": { "ReadyDateTime": 1433200400.031, "CreationDateTime": 1433199949.102 }, "State": "RUNNING", "StateChangeReason": {} }, "Ec2InstanceId": "i-15cfeee3", "PublicDnsName": "ec2-52-25-246-63.us-west-2.compute.amazonaws.com", "PrivateDnsName": "ip-172-31-24-129.us-west-2.compute.internal", "PublicIpAddress": "52.25.246.63", "Id": "ci-2W3TDFFB47UAD", "PrivateIpAddress": "172.21.11.214" } ] } For a fleet based cluster: { "Instances": [ { "Status": { "Timeline": { "ReadyDateTime": 1487810810.878, "CreationDateTime": 1487810588.367, "EndDateTime": 1488022990.924 }, "State": "TERMINATED", "StateChangeReason": { "Message": "Instance was terminated." } }, "Ec2InstanceId": "i-xxxxx", "InstanceFleetId": "if-xxxxx", "EbsVolumes": [], "PublicDnsName": "ec2-xx-xxx-xxx-xxx.compute-1.amazonaws.com", "InstanceType": "m3.xlarge", "PrivateDnsName": "ip-xx-xx-xxx-xx.ec2.internal", "Market": "SPOT", "PublicIpAddress": "xx.xx.xxx.xxx", "Id": "ci-xxxxx", "PrivateIpAddress": "10.47.191.80" } ] } awscli-1.14.44/awscli/examples/emr/schedule-hbase-backup.rst0000666454262600001440000000124613243367510024764 0ustar pysdk-ciamazon00000000000000**Note: This command can only be used with HBase on AMI version 2.x and 3.x** **1. To schedule a full HBase backup** >>>>>>> 06ab6d6e13564b5733d75abaf3b599f93cf39a23 - Command:: aws emr schedule-hbase-backup --cluster-id j-XXXXXXYY --type full --dir s3://myBucket/backup --interval 10 --unit hours --start-time 2014-04-21T05:26:10Z --consistent - Output:: None **2. To schedule an incremental HBase backup** - Command:: aws emr schedule-hbase-backup --cluster-id j-XXXXXXYY --type incremental --dir s3://myBucket/backup --interval 30 --unit minutes --start-time 2014-04-21T05:26:10Z --consistent - Output:: None awscli-1.14.44/awscli/examples/emr/add-tags.rst0000666454262600001440000000121013243367510022320 0ustar pysdk-ciamazon00000000000000**1. To add tags to a cluster** - Command:: aws emr add-tags --resource-id j-xxxxxxx --tags name="John Doe" age=29 sex=male address="123 East NW Seattle" - Output:: None **2. To list tags of a cluster** --Command:: aws emr describe-cluster --cluster-id j-XXXXXXYY --query Cluster.Tags - Output:: [ { "Value": "male", "Key": "sex" }, { "Value": "123 East NW Seattle", "Key": "address" }, { "Value": "John Doe", "Key": "name" }, { "Value": "29", "Key": "age" } ] awscli-1.14.44/awscli/examples/emr/add-steps.rst0000666454262600001440000001057513243367510022536 0ustar pysdk-ciamazon00000000000000**1. To add Custom JAR steps to a cluster** - Command:: aws emr add-steps --cluster-id j-XXXXXXXX --steps Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://mybucket/mytest.jar,Args=arg1,arg2,arg3 Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://mybucket/mytest.jar,MainClass=mymainclass,Args=arg1,arg2,arg3 - Required parameters:: Jar - Optional parameters:: Type, Name, ActionOnFailure, Args - Output:: { "StepIds":[ "s-XXXXXXXX", "s-YYYYYYYY" ] } **2. To add Streaming steps to a cluster** - Command:: aws emr add-steps --cluster-id j-XXXXXXXX --steps Type=STREAMING,Name='Streaming Program',ActionOnFailure=CONTINUE,Args=[-files,s3://elasticmapreduce/samples/wordcount/wordSplitter.py,-mapper,wordSplitter.py,-reducer,aggregate,-input,s3://elasticmapreduce/samples/wordcount/input,-output,s3://mybucket/wordcount/output] - Required parameters:: Type, Args - Optional parameters:: Name, ActionOnFailure - JSON equivalent (contents of step.json):: [ { "Name": "JSON Streaming Step", "Args": ["-files","s3://elasticmapreduce/samples/wordcount/wordSplitter.py","-mapper","wordSplitter.py","-reducer","aggregate","-input","s3://elasticmapreduce/samples/wordcount/input","-output","s3://mybucket/wordcount/output"], "ActionOnFailure": "CONTINUE", "Type": "STREAMING" } ] NOTE: JSON arguments must include options and values as their own items in the list. - Command (using step.json):: aws emr add-steps --cluster-id j-XXXXXXXX --steps file://./step.json - Output:: { "StepIds":[ "s-XXXXXXXX", "s-YYYYYYYY" ] } **3. To add a Streaming step with multiple files to a cluster (JSON only)** - JSON (multiplefiles.json):: [ { "Name": "JSON Streaming Step", "Type": "STREAMING", "ActionOnFailure": "CONTINUE", "Args": [ "-files", "s3://mybucket/mapper.py,s3://mybucket/reducer.py", "-mapper", "mapper.py", "-reducer", "reducer.py", "-input", "s3://mybucket/input", "-output", "s3://mybucket/output"] } ] - Command:: aws emr add-steps --cluster-id j-XXXXXXXX --steps file://./multiplefiles.json - Required parameters:: Type, Args - Optional parameters:: Name, ActionOnFailure - Output:: { "StepIds":[ "s-XXXXXXXX", ] } **4. To add Hive steps to a cluster** - Command:: aws emr add-steps --cluster-id j-XXXXXXXX --steps Type=HIVE,Name='Hive program',ActionOnFailure=CONTINUE,Args=[-f,s3://mybucket/myhivescript.q,-d,INPUT=s3://mybucket/myhiveinput,-d,OUTPUT=s3://mybucket/myhiveoutput,arg1,arg2] Type=HIVE,Name='Hive steps',ActionOnFailure=TERMINATE_CLUSTER,Args=[-f,s3://elasticmapreduce/samples/hive-ads/libs/model-build.q,-d,INPUT=s3://elasticmapreduce/samples/hive-ads/tables,-d,OUTPUT=s3://mybucket/hive-ads/output/2014-04-18/11-07-32,-d,LIBS=s3://elasticmapreduce/samples/hive-ads/libs] - Required parameters:: Type, Args - Optional parameters:: Name, ActionOnFailure - Output:: { "StepIds":[ "s-XXXXXXXX", "s-YYYYYYYY" ] } **5. To add Pig steps to a cluster** - Command:: aws emr add-steps --cluster-id j-XXXXXXXX --steps Type=PIG,Name='Pig program',ActionOnFailure=CONTINUE,Args=[-f,s3://mybucket/mypigscript.pig,-p,INPUT=s3://mybucket/mypiginput,-p,OUTPUT=s3://mybucket/mypigoutput,arg1,arg2] Type=PIG,Name='Pig program',Args=[-f,s3://elasticmapreduce/samples/pig-apache/do-reports2.pig,-p,INPUT=s3://elasticmapreduce/samples/pig-apache/input,-p,OUTPUT=s3://mybucket/pig-apache/output,arg1,arg2] - Required parameters:: Type, Args - Optional parameters:: Name, ActionOnFailure - Output:: { "StepIds":[ "s-XXXXXXXX", "s-YYYYYYYY" ] } **6. To add Impala steps to a cluster** - Command:: aws emr add-steps --cluster-id j-XXXXXXXX --steps Type=IMPALA,Name='Impala program',ActionOnFailure=CONTINUE,Args=--impala-script,s3://myimpala/input,--console-output-path,s3://myimpala/output - Required parameters:: Type, Args - Optional parameters:: Name, ActionOnFailure - Output:: { "StepIds":[ "s-XXXXXXXX", "s-YYYYYYYY" ] } awscli-1.14.44/awscli/examples/emr/describe-step.rst0000666454262600001440000000217213243367510023375 0ustar pysdk-ciamazon00000000000000The following command describes a step with the step ID ``s-3LZC0QUT43AM`` in a cluster with the cluster ID ``j-3SD91U2E1L2QX``:: aws emr describe-step --cluster-id j-3SD91U2E1L2QX --step-id s-3LZC0QUT43AM Output:: { "Step": { "Status": { "Timeline": { "EndDateTime": 1433200470.481, "CreationDateTime": 1433199926.597, "StartDateTime": 1433200404.959 }, "State": "COMPLETED", "StateChangeReason": {} }, "Config": { "Args": [ "s3://us-west-2.elasticmapreduce/libs/hive/hive-script", "--base-path", "s3://us-west-2.elasticmapreduce/libs/hive/", "--install-hive", "--hive-versions", "0.13.1" ], "Jar": "s3://us-west-2.elasticmapreduce/libs/script-runner/script-runner.jar", "Properties": {} }, "Id": "s-3LZC0QUT43AM", "ActionOnFailure": "TERMINATE_CLUSTER", "Name": "Setup hive" } } awscli-1.14.44/awscli/examples/emr/modify-instance-fleet.rst0000666454262600001440000000051513243367510025031 0ustar pysdk-ciamazon00000000000000**To change the target capacites of an instance fleet** This example changes the On-Demand and Spot target capacities to 1 for the instance fleet specified. Command:: aws emr modify-instance-fleet --cluster-id 'j-12ABCDEFGHI34JK' --instance-fleet InstanceFleetId='if-2ABC4DEFGHIJ4',TargetOnDemandCapacity=1,TargetSpotCapacity=1 awscli-1.14.44/awscli/examples/emr/ssh.rst0000666454262600001440000000266613243367510021451 0ustar pysdk-ciamazon00000000000000The following command opens an ssh connection with the master instance in a cluster with the cluster ID ``j-3SD91U2E1L2QX``:: aws emr ssh --cluster-id j-3SD91U2E1L2QX --key-pair-file ~/.ssh/mykey.pem The key pair file option takes a local path to a private key file. Output:: ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=10 -i /home/local/user/.ssh/mykey.pem hadoop@ec2-52-52-41-150.us-west-2.compute.amazonaws.com Warning: Permanently added 'ec2-52-52-41-150.us-west-2.compute.amazonaws.com,52.52.41.150' (ECDSA) to the list of known hosts. Last login: Mon Jun 1 23:15:38 2015 __| __|_ ) _| ( / Amazon Linux AMI ___|\___|___| https://aws.amazon.com/amazon-linux-ami/2015.03-release-notes/ 26 package(s) needed for security, out of 39 available Run "sudo yum update" to apply all updates. -------------------------------------------------------------------------------- Welcome to Amazon Elastic MapReduce running Hadoop and Amazon Linux. Hadoop is installed in /home/hadoop. Log files are in /mnt/var/log/hadoop. Check /mnt/var/log/hadoop/steps for diagnosing step failures. The Hadoop UI can be accessed via the following commands: ResourceManager lynx http://ip-172-21-11-216:9026/ NameNode lynx http://ip-172-21-11-216:9101/ -------------------------------------------------------------------------------- [hadoop@ip-172-31-16-216 ~]$ awscli-1.14.44/awscli/examples/emr/put.rst0000666454262600001440000000043713243367510021456 0ustar pysdk-ciamazon00000000000000The following command uploads a file named ``healthcheck.sh`` to the master instance in a cluster with the cluster ID ``j-3SD91U2E1L2QX``:: aws emr put --cluster-id j-3SD91U2E1L2QX --key-pair-file ~/.ssh/mykey.pem --src ~/scripts/healthcheck.sh --dest /home/hadoop/bin/healthcheck.sh awscli-1.14.44/awscli/examples/emr/modify-cluster-attributes.rst0000666454262600001440000000030413243367510025771 0ustar pysdk-ciamazon00000000000000The following command sets the visibility of an EMR cluster with the ID ``j-301CDNY0J5XM4`` to all users:: aws emr modify-cluster-attributes --cluster-id j-301CDNY0J5XM4 --visible-to-all-users awscli-1.14.44/awscli/examples/emr/socks.rst0000666454262600001440000000042113243367510021761 0ustar pysdk-ciamazon00000000000000The following command opens a socks connection with the master instance in a cluster with the cluster ID ``j-3SD91U2E1L2QX``:: aws emr socks --cluster-id j-3SD91U2E1L2QX --key-pair-file ~/.ssh/mykey.pem The key pair file option takes a local path to a private key file.awscli-1.14.44/awscli/examples/emr/list-security-configurations.rst0000666454262600001440000000054513243367510026516 0ustar pysdk-ciamazon00000000000000**To list security configurations in the current region** - Command:: aws emr list-security-configurations - Output:: { "SecurityConfigurations": [ { "CreationDateTime": 1473889697.417, "Name": "MySecurityConfig-1" }, { "CreationDateTime": 1473889697.417, "Name": "MySecurityConfig-2" } ] }awscli-1.14.44/awscli/examples/emr/create-cluster-examples.rst0000666454262600001440000005004013243367510025377 0ustar pysdk-ciamazon00000000000000Note: some of these examples assume that you have specified your Amazon EMR service role and Amazon EC2 instance profile in the AWS CLI configuration file. If you have not done this, you must specify each required IAM role or use the --use-default-roles parameter when creating your cluster. You can learn more about specifying parameter values for Amazon EMR commands here: http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/emr-aws-cli-config.html **1. Quick start: to create an Amazon EMR cluster** - Command:: aws emr create-cluster --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate **2. Create an Amazon EMR cluster with default ServiceRole and InstanceProfile roles** - Create an Amazon EMR cluster that uses the --instance-groups configuration:: aws emr create-cluster --release-label emr-5.3.1 --service-role EMR_DefaultRole --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge - Create an Amazon EMR cluster that uses the --instance-fleets configuration, specifying two instance types for each fleet and two EC2 Subnets:: aws emr create-cluster --release-label emr-5.3.1 --service-role EMR_DefaultRole --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole,SubnetIds=['subnet-ab12345c','subnet-de67890f'] --instance-fleets InstanceFleetType=MASTER,TargetOnDemandCapacity=1,InstanceTypeConfigs=['{InstanceType=m3.xlarge}'] InstanceFleetType=CORE,TargetSpotCapacity=11,InstanceTypeConfigs=['{InstanceType=m3.xlarge,BidPrice=0.5,WeightedCapacity=3}','{InstanceType=m4.2xlarge,BidPrice=0.9,WeightedCapacity=5}'],LaunchSpecifications={SpotSpecification='{TimeoutDurationMinutes=120,TimeoutAction=SWITCH_TO_ON_DEMAND}'} **3. Create an Amazon EMR cluster with default roles** - Command:: aws emr create-cluster --release-label emr-5.3.1 --use-default-roles --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate **4. Create an Amazon EMR cluster with applications** - Create an Amazon EMR cluster with Hadoop, Hive and Pig installed:: aws emr create-cluster --applications Name=Hadoop Name=Hive Name=Pig --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate - Create an Amazon EMR cluster with Spark installed: aws emr create-cluster --release-label emr-5.3.1 --applications Name=Spark --ec2-attributes KeyName=myKey --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate **5. Change configuration for Hadoop MapReduce** The following example changes the maximum number of map tasks and sets the NameNode heap size: - Specifying configurations from a local file:: aws emr create-cluster --configurations file://configurations.json --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate - Specifying configurations from a file in Amazon S3:: aws emr create-cluster --configurations https://s3.amazonaws.com/myBucket/configurations.json --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate - Contents of configurations.json:: [ { "Classification": "mapred-site", "Properties": { "mapred.tasktracker.map.tasks.maximum": 2 } }, { "Classification": "hadoop-env", "Properties": {}, "Configurations": [ { "Classification": "export", "Properties": { "HADOOP_DATANODE_HEAPSIZE": 2048, "HADOOP_NAMENODE_OPTS": "-XX:GCTimeRatio=19" } } ] } ] **6. Create an Amazon EMR cluster with MASTER, CORE, and TASK instance groups** - Command:: aws emr create-cluster --release-label emr-5.3.1 --auto-terminate --instance-groups Name=Master,InstanceGroupType=MASTER,InstanceType=m3.xlarge,InstanceCount=1 Name=Core,InstanceGroupType=CORE,InstanceType=m3.xlarge,InstanceCount=2 Name=Task,InstanceGroupType=TASK,InstanceType=m3.xlarge,InstanceCount=2 **7. Specify whether the cluster should terminate after completing all the steps** - Create an Amazon EMR cluster that terminates after completing all the steps:: aws emr create-cluster --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate **8. Specify EC2 Attributes** - Create an Amazon EMR cluster with the Amazon EC2 key pair "myKey" and instance profile "myProfile":: aws emr create-cluster --ec2-attributes KeyName=myKey,InstanceProfile=myProfile --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate - Create an Amazon EMR cluster in an Amazon VPC subnet:: aws emr create-cluster --ec2-attributes SubnetId=subnet-xxxxx --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate - Create an Amazon EMR cluster in an Availability Zone. For example, us-east-1b:: aws emr create-cluster --ec2-attributes AvailabilityZone=us-east-1b --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge - Create an Amazon EMR cluster specifying the Amazon EC2 security groups:: aws emr create-cluster --release-label emr-5.3.1 --service-role myServiceRole --ec2-attributes InstanceProfile=myRole,EmrManagedMasterSecurityGroup=sg-master1,EmrManagedSlaveSecurityGroup=sg-slave1,AdditionalMasterSecurityGroups=[sg-addMaster1,sg-addMaster2,sg-addMaster3,sg-addMaster4],AdditionalSlaveSecurityGroups=[sg-addSlave1,sg-addSlave2,sg-addSlave3,sg-addSlave4] --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge - Create an Amazon EMR cluster specifying only the Amazon EMR-managed Amazon EC2 security groups:: aws emr create-cluster --release-label emr-5.3.1 --service-role myServiceRole --ec2-attributes InstanceProfile=myRole,EmrManagedMasterSecurityGroup=sg-master1,EmrManagedSlaveSecurityGroup=sg-slave1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge - Create an Amazon EMR cluster specifying only the additional Amazon EC2 security groups:: aws emr create-cluster --release-label emr-5.3.1 --service-role myServiceRole --ec2-attributes InstanceProfile=myRole,AdditionalMasterSecurityGroups=[sg-addMaster1,sg-addMaster2,sg-addMaster3,sg-addMaster4],AdditionalSlaveSecurityGroups=[sg-addSlave1,sg-addSlave2,sg-addSlave3,sg-addSlave4] --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge - Create an Amazon EMR cluster in a VPC private subnet and use a specific Amazon EC2 security group to enable the Amazon EMR service access (required for clusters in private subnets):: aws emr create-cluster --release-label emr-5.3.1 --service-role myServiceRole --ec2-attributes InstanceProfile=myRole,ServiceAccessSecurityGroup=sg-service-access,EmrManagedMasterSecurityGroup=sg-master,EmrManagedSlaveSecurityGroup=sg-slave --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge - JSON equivalent (contents of ec2_attributes.json):: [ { "SubnetId": "subnet-xxxxx", "KeyName": "myKey", "InstanceProfile":"myRole", "EmrManagedMasterSecurityGroup": "sg-master1", "EmrManagedSlaveSecurityGroup": "sg-slave1", "ServiceAccessSecurityGroup": "sg-service-access" "AdditionalMasterSecurityGroups": ["sg-addMaster1","sg-addMaster2","sg-addMaster3","sg-addMaster4"], "AdditionalSlaveSecurityGroups": ["sg-addSlave1","sg-addSlave2","sg-addSlave3","sg-addSlave4"] } ] NOTE: JSON arguments must include options and values as their own items in the list. - Command (using ec2_attributes.json):: aws emr create-cluster --release-label emr-5.3.1 --service-role myServiceRole --ec2-attributes file://./ec2_attributes.json --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge **9. Enable debugging and specify a Log URI** - Command:: aws emr create-cluster --enable-debugging --log-uri s3://myBucket/myLog --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate **10. Add tags when creating an Amazon EMR cluster** - Add a list of tags:: aws emr create-cluster --tags name="John Doe" age=29 address="123 East NW Seattle" --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate - List tags of an Amazon EMR cluster:: aws emr describe-cluster --cluster-id j-XXXXXXYY --query Cluster.Tags **11. Use a security configuration to enable encryption** - Command:: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.3.1 --security-configuration mySecurityConfiguration **12. To create an Amazon EMR cluster with EBS volumes configured to the instance groups** - Create a cluster with multiple EBS volumes attached to the CORE instance group. EBS volumes can be attached to MASTER, CORE, and TASK instance groups. For instance groups with EBS configurations, which have an embedded JSON structure, you should enclose the entire instance group argument with single quotes. For instance groups with no EBS configuration, using single quotes is optional. - Command:: aws emr create-cluster --release-label emr-5.3.1 --use-default-roles --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=d2.xlarge 'InstanceGroupType=CORE,InstanceCount=2,InstanceType=d2.xlarge,EbsConfiguration={EbsOptimized=true,EbsBlockDeviceConfigs=[{VolumeSpecification={VolumeType=gp2,SizeInGB=100}},{VolumeSpecification={VolumeType=io1,SizeInGB=100,Iops=100},VolumesPerInstance=4}]}' --auto-terminate - Create a cluster with multiple EBS volumes attached to the MASTER instance group. - Command:: aws emr create-cluster --release-label emr-5.3.1 --use-default-roles --instance-groups 'InstanceGroupType=MASTER, InstanceCount=1, InstanceType=d2.xlarge, EbsConfiguration={EbsOptimized=true, EbsBlockDeviceConfigs=[{VolumeSpecification={VolumeType=io1, SizeInGB=100, Iops=100}},{VolumeSpecification={VolumeType=standard,SizeInGB=50},VolumesPerInstance=3}]}' InstanceGroupType=CORE,InstanceCount=2,InstanceType=d2.xlarge --auto-terminate - Required parameters:: VolumeType, SizeInGB if EbsBlockDeviceConfigs specified - Create a cluster with an Auto Scaling policy attached to the CORE instance group. The Auto Scaling policy can be attached to CORE and TASK instance groups. For instance groups with an Auto Scaling policy attached, you should enclose the entire instance group argument with single quotes. For instance groups with no Auto Scaling policy, using single quotes is optional. - Command:: aws emr create-cluster --release-label emr-5.3.1 --use-default-roles --auto-scaling-role EMR_AutoScaling_DefaultRole --instance-groups InstanceGroupType=MASTER,InstanceType=d2.xlarge,InstanceCount=1 'InstanceGroupType=CORE,InstanceType=d2.xlarge,InstanceCount=2,AutoScalingPolicy={Constraints={MinCapacity=1,MaxCapacity=5},Rules=[{Name=TestRule,Description=TestDescription,Action={Market=ON_DEMAND,SimpleScalingPolicyConfiguration={AdjustmentType=EXACT_CAPACITY,ScalingAdjustment=2}},Trigger={CloudWatchAlarmDefinition={ComparisonOperator=GREATER_THAN,EvaluationPeriods=5,MetricName=TestMetric,Namespace=EMR,Period=3,Statistic=MAXIMUM,Threshold=4.5,Unit=NONE,Dimensions=[{Key=TestKey,Value=TestValue}]}}}]}' **13. To add custom JAR steps to a cluster when creating an Amazon EMR cluster** - Command:: aws emr create-cluster --steps Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://myBucket/mytest.jar,Args=arg1,arg2,arg3 Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://myBucket/mytest.jar,MainClass=mymainclass,Args=arg1,arg2,arg3 --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate - Custom JAR steps required parameters:: Jar - Custom JAR steps optional parameters:: Type, Name, ActionOnFailure, Args **14. To add streaming steps when creating an Amazon EMR cluster** - Command:: aws emr create-cluster --steps Type=STREAMING,Name='Streaming Program',ActionOnFailure=CONTINUE,Args=[-files,s3://elasticmapreduce/samples/wordcount/wordSplitter.py,-mapper,wordSplitter.py,-reducer,aggregate,-input,s3://elasticmapreduce/samples/wordcount/input,-output,s3://mybucket/wordcount/output] --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate - Streaming steps required parameters:: Type, Args - Streaming steps optional parameters:: Name, ActionOnFailure - JSON equivalent (contents of step.json):: [ { "Name": "JSON Streaming Step", "Args": ["-files","s3://elasticmapreduce/samples/wordcount/wordSplitter.py","-mapper","wordSplitter.py","-reducer","aggregate","-input","s3://elasticmapreduce/samples/wordcount/input","-output","s3://mybucket/wordcount/output"], "ActionOnFailure": "CONTINUE", "Type": "STREAMING" } ] NOTE: JSON arguments must include options and values as their own items in the list. - Command (using step.json):: aws emr create-cluster --steps file://./step.json --release-label emr-4.0.0 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate **15. To use multiple files in a streaming step (JSON only)** - JSON (multiplefiles.json):: [ { "Name": "JSON Streaming Step", "Type": "STREAMING", "ActionOnFailure": "CONTINUE", "Args": [ "-files", "s3://mybucket/mapper.py,s3://mybucket/reducer.py", "-mapper", "mapper.py", "-reducer", "reducer.py", "-input", "s3://mybucket/input", "-output", "s3://mybucket/output"] } ] - Command:: aws emr create-cluster --steps file://./multiplefiles.json --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate **16. To add Hive steps when creating an Amazon EMR cluster** - Command:: aws emr create-cluster --steps Type=HIVE,Name='Hive program',ActionOnFailure=CONTINUE,ActionOnFailure=TERMINATE_CLUSTER,Args=[-f,s3://elasticmapreduce/samples/hive-ads/libs/model-build.q,-d,INPUT=s3://elasticmapreduce/samples/hive-ads/tables,-d,OUTPUT=s3://mybucket/hive-ads/output/2014-04-18/11-07-32,-d,LIBS=s3://elasticmapreduce/samples/hive-ads/libs] --applications Name=Hive --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge - Hive steps required parameters:: Type, Args - Hive steps optional parameters:: Name, ActionOnFailure **17. To add Pig steps when creating an Amazon EMR cluster** - Command:: aws emr create-cluster --steps Type=PIG,Name='Pig program',ActionOnFailure=CONTINUE,Args=[-f,s3://elasticmapreduce/samples/pig-apache/do-reports2.pig,-p,INPUT=s3://elasticmapreduce/samples/pig-apache/input,-p,OUTPUT=s3://mybucket/pig-apache/output] --applications Name=Pig --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge - Pig steps required parameters:: Type, Args - Pig steps optional parameters:: Name, ActionOnFailure **18. Add a list of bootstrap actions when creating an Amazon EMR Cluster** - Command:: aws emr create-cluster --bootstrap-actions Path=s3://mybucket/myscript1,Name=BootstrapAction1,Args=[arg1,arg2] Path=s3://mybucket/myscript2,Name=BootstrapAction2,Args=[arg1,arg2] --release-label emr-5.3.1 --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m3.xlarge InstanceGroupType=CORE,InstanceCount=2,InstanceType=m3.xlarge --auto-terminate **19. To enable consistent view in EMRFS and change the RetryCount and Retry Period settings when creating an Amazon EMR cluster** - Command:: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.3.1 --emrfs Consistent=true,RetryCount=5,RetryPeriod=30 - Required parameters:: Consistent=true - JSON equivalent (contents of emrfs.json):: { "Consistent": true, "RetryCount": 5, "RetryPeriod": 30 } - Command (Using emrfs.json):: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.3.1 --emrfs file://emrfs.json **20. To enable consistent view with arguments e.g. change the DynamoDB read and write capacity when creating an Amazon EMR cluster** - Command:: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.3.1 --emrfs Consistent=true,RetryCount=5,RetryPeriod=30,Args=[fs.s3.consistent.metadata.read.capacity=600,fs.s3.consistent.metadata.write.capacity=300] - Required parameters:: Consistent=true - JSON equivalent (contents of emrfs.json):: { "Consistent": true, "RetryCount": 5, "RetryPeriod": 30, "Args":["fs.s3.consistent.metadata.read.capacity=600", "fs.s3.consistent.metadata.write.capacity=300"] } - Command (Using emrfs.json):: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.3.1 --emrfs file://emrfs.json - Command (Using custom ami id):: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.3.1 --custom-ami-id ami-9be6f38c - Command (Using custom EBS root volume):: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.3.1 --ebs-root-volume-size 20 - Command (Repo upgrade option on instance boot. This can be used only with custom AMIs):: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.3.1 --repo-upgrade-on-boot ${RepoUpgrade} RepoUpgrade { SECURITY, NONE } **21. To create an Amazon EMR cluster with Kerberos configured** - Command:: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.10.0 --service-role EMR_DefaultRole --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole --security-configuration mySecurityConfiguration --kerberos-attributes Realm=EC2.INTERNAL,KdcAdminPassword=123,CrossRealmTrustPrincipalPassword=123 - JSON equivalent (contents of kerberos_attributes.json):: { "Realm": "EC2.INTERNAL", "KdcAdminPassword": "123", "CrossRealmTrustPrincipalPassword": "123", } - Command (Using kerberos_attributes.json):: aws emr create-cluster --instance-type m3.xlarge --release-label emr-5.10.0 --service-role EMR_DefaultRole --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole --security-configuration mySecurityConfiguration --kerberos-attributes file://kerberos_attributes.json awscli-1.14.44/awscli/examples/emr/list-instance-fleets.rst0000666454262600001440000000375713243367510024713 0ustar pysdk-ciamazon00000000000000**To get configuration details of instance fleets in a cluster** This example lists the details of instance fleets in the cluster specified. Command:: list-instance-fleets --cluster-id 'j-12ABCDEFGHI34JK' Output:: { "InstanceFleets": [ { "Status": { "Timeline": { "ReadyDateTime": 1488759094.637, "CreationDateTime": 1488758719.817 }, "State": "RUNNING", "StateChangeReason": { "Message": "" } }, "ProvisionedSpotCapacity": 6, "Name": "CORE", "InstanceFleetType": "CORE", "LaunchSpecifications": { "SpotSpecification": { "TimeoutDurationMinutes": 60, "TimeoutAction": "TERMINATE_CLUSTER" } }, "ProvisionedOnDemandCapacity": 2, "InstanceTypeSpecifications": [ { "BidPrice": "0.5", "InstanceType": "m3.xlarge", "WeightedCapacity": 2 } ], "Id": "if-1ABC2DEFGHIJ3" }, { "Status": { "Timeline": { "ReadyDateTime": 1488759058.598, "CreationDateTime": 1488758719.811 }, "State": "RUNNING", "StateChangeReason": { "Message": "" } }, "ProvisionedSpotCapacity": 0, "Name": "MASTER", "InstanceFleetType": "MASTER", "ProvisionedOnDemandCapacity": 1, "InstanceTypeSpecifications": [ { "BidPriceAsPercentageOfOnDemandPrice": 100.0, "InstanceType": "m3.xlarge", "WeightedCapacity": 1 } ], "Id": "if-2ABC4DEFGHIJ4" } ] } awscli-1.14.44/awscli/examples/emr/get.rst0000666454262600001440000000040213243367510021415 0ustar pysdk-ciamazon00000000000000The following downloads the ``hadoop-examples.jar`` archive from the master instance in a cluster with the cluster ID ``j-3SD91U2E1L2QX``:: aws emr get --cluster-id j-3SD91U2E1L2QX --key-pair-file ~/.ssh/mykey.pem --src /home/hadoop-examples.jar --dest ~ awscli-1.14.44/awscli/examples/emr/create-security-configuration.rst0000666454262600001440000000764313243367510026631 0ustar pysdk-ciamazon00000000000000**1. To create a security configuration with in-transit encryption enabled with PEM for certificate provider, and at-rest encryption enabled with SSE-S3 for S3 encryption and AWS-KMS for local disk key provider** - Command:: aws emr create-security-configuration --name MySecurityConfig --security-configuration '{ "EncryptionConfiguration": { "EnableInTransitEncryption" : true, "EnableAtRestEncryption" : true, "InTransitEncryptionConfiguration" : { "TLSCertificateConfiguration" : { "CertificateProviderType" : "PEM", "S3Object" : "s3://mycertstore/artifacts/MyCerts.zip" } }, "AtRestEncryptionConfiguration" : { "S3EncryptionConfiguration" : { "EncryptionMode" : "SSE-S3" }, "LocalDiskEncryptionConfiguration" : { "EncryptionKeyProviderType" : "AwsKms", "AwsKmsKey" : "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012" } } } }' - Output:: { "CreationDateTime": 1474070889.129, "Name": "MySecurityConfig" } - JSON equivalent (contents of security_configuration.json):: { "EncryptionConfiguration": { "EnableInTransitEncryption": true, "EnableAtRestEncryption": true, "InTransitEncryptionConfiguration": { "TLSCertificateConfiguration": { "CertificateProviderType": "PEM", "S3Object": "s3://mycertstore/artifacts/MyCerts.zip" } }, "AtRestEncryptionConfiguration": { "S3EncryptionConfiguration": { "EncryptionMode": "SSE-S3" }, "LocalDiskEncryptionConfiguration": { "EncryptionKeyProviderType": "AwsKms", "AwsKmsKey": "arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012" } } } } - Command (using security_configuration.json):: aws emr create-security-configuration --name "MySecurityConfig" --security-configuration file://./security_configuration.json - Output:: { "CreationDateTime": 1474070889.129, "Name": "MySecurityConfig" } **2. To create a security configuration with Kerberos enabled using cluster-dedicated KDC and cross-realm trust** - Command:: aws emr create-security-configuration --name MySecurityConfig --security-configuration '{ "AuthenticationConfiguration": { "KerberosConfiguration": { "Provider": "ClusterDedicatedKdc", "ClusterDedicatedKdcConfiguration": { "TicketLifetimeInHours": 24, "CrossRealmTrustConfiguration": { "Realm": "AD.DOMAIN.COM", "Domain": "ad.domain.com", "AdminServer": "ad.domain.com", "KdcServer": "ad.domain.com" } } } } }' - Output:: { "CreationDateTime": 1490225558.982, "Name": "MySecurityConfig" } - JSON equivalent (contents of security_configuration.json):: { "AuthenticationConfiguration": { "KerberosConfiguration": { "Provider": "ClusterDedicatedKdc", "ClusterDedicatedKdcConfiguration": { "TicketLifetimeInHours": 24, "CrossRealmTrustConfiguration": { "Realm": "AD.DOMAIN.COM", "Domain": "ad.domain.com", "AdminServer": "ad.domain.com", "KdcServer": "ad.domain.com" } } } } } - Command (using security_configuration.json):: aws emr create-security-configuration --name "MySecurityConfig" --security-configuration file://./security_configuration.json - Output:: { "CreationDateTime": 1490225558.982, "Name": "MySecurityConfig" } awscli-1.14.44/awscli/examples/emr/list-clusters.rst0000666454262600001440000000123613243367510023461 0ustar pysdk-ciamazon00000000000000The following command lists all active EMR clusters in the current region:: aws emr list-clusters --active Output:: { "Clusters": [ { "Status": { "Timeline": { "ReadyDateTime": 1433200405.353, "CreationDateTime": 1433199926.596 }, "State": "WAITING", "StateChangeReason": { "Message": "Waiting after step completed" } }, "NormalizedInstanceHours": 6, "Id": "j-3SD91U2E1L2QX", "Name": "my-cluster" } ] } awscli-1.14.44/awscli/examples/emr/list-steps.rst0000666454262600001440000000022713243367510022752 0ustar pysdk-ciamazon00000000000000The following command lists all of the steps in a cluster with the cluster ID ``j-3SD91U2E1L2QX``:: aws emr list-steps --cluster-id j-3SD91U2E1L2QX awscli-1.14.44/awscli/examples/emr/describe-cluster.rst0000666454262600001440000002257313243367510024112 0ustar pysdk-ciamazon00000000000000- Command:: aws emr describe-cluster --cluster-id j-XXXXXXXX - Output:: For release-label based uniform instance groups cluster: { "Cluster": { "Status": { "Timeline": { "ReadyDateTime": 1436475075.199, "CreationDateTime": 1436474656.563, }, "State": "WAITING", "StateChangeReason": { "Message": "Waiting for steps to run" } }, "Ec2InstanceAttributes": { "ServiceAccessSecurityGroup": "sg-xxxxxxxx", "EmrManagedMasterSecurityGroup": "sg-xxxxxxxx", "IamInstanceProfile": "EMR_EC2_DefaultRole", "Ec2KeyName": "myKey", "Ec2AvailabilityZone": "us-east-1c", "EmrManagedSlaveSecurityGroup": "sg-yyyyyyyyy" }, "Name": "My Cluster", "ServiceRole": "EMR_DefaultRole", "Tags": [], "TerminationProtected": true, "ReleaseLabel": "emr-4.0.0", "NormalizedInstanceHours": 96, "InstanceGroups": [ { "RequestedInstanceCount": 2, "Status": { "Timeline": { "ReadyDateTime": 1436475074.245, "CreationDateTime": 1436474656.564, "EndDateTime": 1436638158.387 }, "State": "RUNNING", "StateChangeReason": { "Message": "", } }, "Name": "CORE", "InstanceGroupType": "CORE", "Id": "ig-YYYYYYY", "Configurations": [], "InstanceType": "m3.large", "Market": "ON_DEMAND", "RunningInstanceCount": 2 }, { "RequestedInstanceCount": 1, "Status": { "Timeline": { "ReadyDateTime": 1436475074.245, "CreationDateTime": 1436474656.564, "EndDateTime": 1436638158.387 }, "State": "RUNNING", "StateChangeReason": { "Message": "", } }, "Name": "MASTER", "InstanceGroupType": "MASTER", "Id": "ig-XXXXXXXXX", "Configurations": [], "InstanceType": "m3.large", "Market": "ON_DEMAND", "RunningInstanceCount": 1 } ], "Applications": [ { "Name": "Hadoop" } ], "VisibleToAllUsers": true, "BootstrapActions": [], "MasterPublicDnsName": "ec2-54-147-144-78.compute-1.amazonaws.com", "AutoTerminate": false, "Id": "j-XXXXXXXX", "Configurations": [ { "Properties": { "fs.s3.consistent.retryPeriodSeconds": "20", "fs.s3.enableServerSideEncryption": "true", "fs.s3.consistent": "false", "fs.s3.consistent.retryCount": "2" }, "Classification": "emrfs-site" } ] } } For release-label based instance fleet cluster: { "Cluster": { "Status": { "Timeline": { "ReadyDateTime": 1487897289.705, "CreationDateTime": 1487896933.942 }, "State": "WAITING", "StateChangeReason": { "Message": "Waiting for steps to run" } }, "Ec2InstanceAttributes": { "EmrManagedMasterSecurityGroup": "sg-xxxxx", "RequestedEc2AvailabilityZones": [], "RequestedEc2SubnetIds": [], "IamInstanceProfile": "EMR_EC2_DefaultRole", "Ec2AvailabilityZone": "us-east-1a", "EmrManagedSlaveSecurityGroup": "sg-xxxxx" }, "Name": "My Cluster", "ServiceRole": "EMR_DefaultRole", "Tags": [], "TerminationProtected": false, "ReleaseLabel": "emr-5.2.0", "NormalizedInstanceHours": 472, "InstanceCollectionType": "INSTANCE_FLEET", "InstanceFleets": [ { "Status": { "Timeline": { "ReadyDateTime": 1487897212.74, "CreationDateTime": 1487896933.948 }, "State": "RUNNING", "StateChangeReason": { "Message": "" } }, "ProvisionedSpotCapacity": 1, "Name": "MASTER", "InstanceFleetType": "MASTER", "LaunchSpecifications": { "SpotSpecification": { "TimeoutDurationMinutes": 60, "TimeoutAction": "TERMINATE_CLUSTER" } }, "TargetSpotCapacity": 1, "ProvisionedOnDemandCapacity": 0, "InstanceTypeSpecifications": [ { "BidPrice": "0.5", "InstanceType": "m3.xlarge", "WeightedCapacity": 1 } ], "Id": "if-xxxxxxx", "TargetOnDemandCapacity": 0 } ], "Applications": [ { "Version": "2.7.3", "Name": "Hadoop" } ], "ScaleDownBehavior": "TERMINATE_AT_INSTANCE_HOUR", "VisibleToAllUsers": true, "BootstrapActions": [], "MasterPublicDnsName": "ec2-xxx-xx-xxx-xx.compute-1.amazonaws.com", "AutoTerminate": false, "Id": "j-xxxxx", "Configurations": [] } } For ami based uniform instance group cluster: { "Cluster": { "Status": { "Timeline": { "ReadyDateTime": 1399400564.432, "CreationDateTime": 1399400268.62 }, "State": "WAITING", "StateChangeReason": { "Message": "Waiting for steps to run" } }, "Ec2InstanceAttributes": { "IamInstanceProfile": "EMR_EC2_DefaultRole", "Ec2AvailabilityZone": "us-east-1c" }, "Name": "My Cluster", "Tags": [], "TerminationProtected": true, "RunningAmiVersion": "2.5.4", "InstanceGroups": [ { "RequestedInstanceCount": 1, "Status": { "Timeline": { "ReadyDateTime": 1399400558.848, "CreationDateTime": 1399400268.621 }, "State": "RUNNING", "StateChangeReason": { "Message": "" } }, "Name": "Master instance group", "InstanceGroupType": "MASTER", "InstanceType": "m1.small", "Id": "ig-ABCD", "Market": "ON_DEMAND", "RunningInstanceCount": 1 }, { "RequestedInstanceCount": 2, "Status": { "Timeline": { "ReadyDateTime": 1399400564.439, "CreationDateTime": 1399400268.621 }, "State": "RUNNING", "StateChangeReason": { "Message": "" } }, "Name": "Core instance group", "InstanceGroupType": "CORE", "InstanceType": "m1.small", "Id": "ig-DEF", "Market": "ON_DEMAND", "RunningInstanceCount": 2 } ], "Applications": [ { "Version": "1.0.3", "Name": "hadoop" } ], "BootstrapActions": [], "VisibleToAllUsers": false, "RequestedAmiVersion": "2.4.2", "LogUri": "s3://myLogUri/", "AutoTerminate": false, "Id": "j-XXXXXXXX" } } awscli-1.14.44/awscli/examples/emr/wait.rst0000666454262600001440000000024513243367510021607 0ustar pysdk-ciamazon00000000000000The following command waits until a cluster with the cluster ID ``j-3SD91U2E1L2QX`` is up and running:: aws emr wait cluster-running --cluster-id j-3SD91U2E1L2QX awscli-1.14.44/awscli/examples/emr/create-cluster-synopsis.rst0000666454262600001440000000170013243367510025447 0ustar pysdk-ciamazon00000000000000 create-cluster --release-label | --ami-version --instance-fleets | --instance-groups | --instance-type --instance-count [--auto-terminate | --no-auto-terminate] [--use-default-roles] [--service-role ] [--configurations ] [--name ] [--log-uri ] [--additional-info ] [--ec2-attributes ] [--termination-protected | --no-termination-protected] [--visible-to-all-users | --no-visible-to-all-users] [--enable-debugging | --no-enable-debugging] [--tags ] [--applications ] [--emrfs ] [--bootstrap-actions ] [--steps ] [--restore-from-hbase-backup ] [--security-configuration ] [--custom-ami-id ] [--ebs-root-volume-size ] [--repo-upgrade-on-boot ] [--kerberos--attributes ] awscli-1.14.44/awscli/examples/emr/create-default-roles.rst0000666454262600001440000001307013243367510024652 0ustar pysdk-ciamazon00000000000000**1. To create the default IAM role for EC2** - Command:: aws emr create-default-roles - Output:: If the role already exists then the command returns nothing. If the role does not exist then the output will be: [ { "RolePolicy": { "Version": "2012-10-17", "Statement": [ { "Action": [ "cloudwatch:*", "dynamodb:*", "ec2:Describe*", "elasticmapreduce:Describe*", "elasticmapreduce:ListBootstrapActions", "elasticmapreduce:ListClusters", "elasticmapreduce:ListInstanceGroups", "elasticmapreduce:ListInstances", "elasticmapreduce:ListSteps", "kinesis:CreateStream", "kinesis:DeleteStream", "kinesis:DescribeStream", "kinesis:GetRecords", "kinesis:GetShardIterator", "kinesis:MergeShards", "kinesis:PutRecord", "kinesis:SplitShard", "rds:Describe*", "s3:*", "sdb:*", "sns:*", "sqs:*" ], "Resource": "*", "Effect": "Allow" } ] }, "Role": { "AssumeRolePolicyDocument": { "Version": "2008-10-17", "Statement": [ { "Action": "sts:AssumeRole", "Sid": "", "Effect": "Allow", "Principal": { "Service": "ec2.amazonaws.com" } } ] }, "RoleId": "AROAIQ5SIQUGL5KMYBJX6", "CreateDate": "2015-06-09T17:09:04.602Z", "RoleName": "EMR_EC2_DefaultRole", "Path": "/", "Arn": "arn:aws:iam::176430881729:role/EMR_EC2_DefaultRole" } }, { "RolePolicy": { "Version": "2012-10-17", "Statement": [ { "Action": [ "ec2:AuthorizeSecurityGroupIngress", "ec2:CancelSpotInstanceRequests", "ec2:CreateSecurityGroup", "ec2:CreateTags", "ec2:DeleteTags", "ec2:DescribeAvailabilityZones", "ec2:DescribeAccountAttributes", "ec2:DescribeInstances", "ec2:DescribeInstanceStatus", "ec2:DescribeKeyPairs", "ec2:DescribePrefixLists", "ec2:DescribeRouteTables", "ec2:DescribeSecurityGroups", "ec2:DescribeSpotInstanceRequests", "ec2:DescribeSpotPriceHistory", "ec2:DescribeSubnets", "ec2:DescribeVpcAttribute", "ec2:DescribeVpcEndpoints", "ec2:DescribeVpcEndpointServices", "ec2:DescribeVpcs", "ec2:ModifyImageAttribute", "ec2:ModifyInstanceAttribute", "ec2:RequestSpotInstances", "ec2:RunInstances", "ec2:TerminateInstances", "iam:GetRole", "iam:GetRolePolicy", "iam:ListInstanceProfiles", "iam:ListRolePolicies", "iam:PassRole", "s3:CreateBucket", "s3:Get*", "s3:List*", "sdb:BatchPutAttributes", "sdb:Select", "sqs:CreateQueue", "sqs:Delete*", "sqs:GetQueue*", "sqs:ReceiveMessage" ], "Resource": "*", "Effect": "Allow" } ] }, "Role": { "AssumeRolePolicyDocument": { "Version": "2008-10-17", "Statement": [ { "Action": "sts:AssumeRole", "Sid": "", "Effect": "Allow", "Principal": { "Service": "elasticmapreduce.amazonaws.com" } } ] }, "RoleId": "AROAI3SRVPPVSRDLARBPY", "CreateDate": "2015-06-09T17:09:10.401Z", "RoleName": "EMR_DefaultRole", "Path": "/", "Arn": "arn:aws:iam::176430881729:role/EMR_DefaultRole" } } ] awscli-1.14.44/awscli/examples/emr/remove-tags.rst0000666454262600001440000000027013243367510023072 0ustar pysdk-ciamazon00000000000000The following command removes a tag with the key ``prod`` from a cluster with the cluster ID ``j-3SD91U2E1L2QX``:: aws emr remove-tags --resource-id j-3SD91U2E1L2QX --tag-keys prod awscli-1.14.44/awscli/examples/emr/add-instance-fleet.rst0000666454262600001440000000101113243367510024262 0ustar pysdk-ciamazon00000000000000**To add a task instance fleet to a cluster** This example adds a new task instance fleet to the cluster specified. Command:: aws emr add-instance-fleet --cluster-id 'j-12ABCDEFGHI34JK' --instance-fleet InstanceFleetType=TASK,TargetSpotCapacity=1,LaunchSpecifications={SpotSpecification='{TimeoutDurationMinutes=20,TimeoutAction=TERMINATE_CLUSTER}'},InstanceTypeConfigs=['{InstanceType=m3.xlarge,BidPrice=0.5}'] Output:: { "ClusterId": "j-12ABCDEFGHI34JK", "InstanceFleetId": "if-23ABCDEFGHI45JJ" } awscli-1.14.44/awscli/examples/sts/0000777454262600001440000000000013243367512020140 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/sts/assume-role.rst0000666454262600001440000000262613243367510023132 0ustar pysdk-ciamazon00000000000000To assume a role:: aws sts assume-role --role-arn arn:aws:iam::123456789012:role/xaccounts3access --role-session-name s3-access-example The output of the command contains an access key, secret key, and session token that you can use to authenticate to AWS:: { "AssumedRoleUser": { "AssumedRoleId": "AROA3XFRBF535PLBIFPI4:s3-access-example", "Arn": "arn:aws:sts::123456789012:assumed-role/xaccounts3access/s3-access-example" }, "Credentials": { "SecretAccessKey": "9drTJvcXLB89EXAMPLELB8923FB892xMFI", "SessionToken": "AQoXdzELDDY//////////wEaoAK1wvxJY12r2IrDFT2IvAzTCn3zHoZ7YNtpiQLF0MqZye/qwjzP2iEXAMPLEbw/m3hsj8VBTkPORGvr9jM5sgP+w9IZWZnU+LWhmg+a5fDi2oTGUYcdg9uexQ4mtCHIHfi4citgqZTgco40Yqr4lIlo4V2b2Dyauk0eYFNebHtYlFVgAUj+7Indz3LU0aTWk1WKIjHmmMCIoTkyYp/k7kUG7moeEYKSitwQIi6Gjn+nyzM+PtoA3685ixzv0R7i5rjQi0YE0lf1oeie3bDiNHncmzosRM6SFiPzSvp6h/32xQuZsjcypmwsPSDtTPYcs0+YN/8BRi2/IcrxSpnWEXAMPLEXSDFTAQAM6Dl9zR0tXoybnlrZIwMLlMi1Kcgo5OytwU=", "Expiration": "2016-03-15T00:05:07Z", "AccessKeyId": "ASIAJEXAMPLEXEG2JICEA" } } For AWS CLI use, you can set up a named profile associated with a role. When you use the profile, the AWS CLI will call assume-role and manage credentials for you. See `Assuming a Role`_ in the *AWS CLI User Guide* for instructions. .. _`Assuming a Role`: http://docs.aws.amazon.com/cli/latest/userguide/cli-roles.htmlawscli-1.14.44/awscli/examples/deploy/0000777454262600001440000000000013243367512020623 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/deploy/add-tags-to-on-premises-instances.rst0000666454262600001440000000064313243367510027706 0ustar pysdk-ciamazon00000000000000**To add tags to on-premises instances** This example associates in AWS CodeDeploy the same on-premises instance tag to two on-premises instances. It does not register the on-premises instances with AWS CodeDeploy. Command:: aws deploy add-tags-to-on-premises-instances --instance-names AssetTag12010298EX AssetTag23121309EX --tags Key=Name,Value=CodeDeployDemo-OnPrem Output:: This command produces no output.awscli-1.14.44/awscli/examples/deploy/list-on-premises-instances.rst0000666454262600001440000000077713243367510026565 0ustar pysdk-ciamazon00000000000000**To get information about one or more on-premises instances** This example gets a list of available on-premises instance names for instances that are registered in AWS CodeDeploy and also have the specified on-premises instance tag associated in AWS CodeDeploy with the instance. Command:: aws deploy list-on-premises-instances --registration-status Registered --tag-filters Key=Name,Value=CodeDeployDemo-OnPrem,Type=KEY_AND_VALUE Output:: { "instanceNames": [ "AssetTag12010298EX" ] }awscli-1.14.44/awscli/examples/deploy/list-deployment-groups.rst0000666454262600001440000000060513243367510026022 0ustar pysdk-ciamazon00000000000000**To get information about deployment groups** This example displays information about all deployment groups that are associated with the specified application. Command:: aws deploy list-deployment-groups --application-name WordPress_App Output:: { "applicationName": "WordPress_App", "deploymentGroups": [ "WordPress_DG", "WordPress_Beta_DG" ] }awscli-1.14.44/awscli/examples/deploy/list-applications.rst0000666454262600001440000000044513243367510025015 0ustar pysdk-ciamazon00000000000000**To get information about applications** This example displays information about all applications that are associated with the user's AWS account. Command:: aws deploy list-applications Output:: { "applications": [ "WordPress_App", "MyOther_App" ] }awscli-1.14.44/awscli/examples/deploy/delete-deployment-config.rst0000666454262600001440000000040313243367510026233 0ustar pysdk-ciamazon00000000000000**To delete a deployment configuration** This example deletes a custom deployment configuration that is associated with the user's AWS account. Command:: aws deploy delete-deployment-config --deployment-config-name ThreeQuartersHealthy Output:: None.awscli-1.14.44/awscli/examples/deploy/get-deployment-group.rst0000666454262600001440000000161713243367510025447 0ustar pysdk-ciamazon00000000000000**To view information about a deployment group** This example displays information about a deployment group that is associated with the specified application. Command:: aws deploy get-deployment-group --application-name WordPress_App --deployment-group-name WordPress_DG Output:: { "deploymentGroupInfo": { "applicationName": "WordPress_App", "autoScalingGroups": [ "CodeDeployDemo-ASG" ], "deploymentConfigName": "CodeDeployDefault.OneAtATime", "ec2TagFilters": [ { "Type": "KEY_AND_VALUE", "Value": "CodeDeployDemo", "Key": "Name" } ], "deploymentGroupId": "cdac3220-0e64-4d63-bb50-e68faEXAMPLE", "serviceRoleArn": "arn:aws:iam::80398EXAMPLE:role/CodeDeployDemoRole", "deploymentGroupName": "WordPress_DG" } }awscli-1.14.44/awscli/examples/deploy/push.rst0000666454262600001440000000164013243367510022333 0ustar pysdk-ciamazon00000000000000**To bundle and deploy an AWS CodeDeploy compatible application revision to Amazon S3** This example bundles and deploys an application revision to Amazon S3 and then associates the application revision with the specified application. Use the output of the push command to create a deployment that uses the uploaded application revision. Command:: aws deploy push --application-name WordPress_App --description "This is my deployment" --ignore-hidden-files --s3-location s3://CodeDeployDemoBucket/WordPressApp.zip --source /tmp/MyLocalDeploymentFolder/ Output:: To deploy with this revision, run: aws deploy create-deployment --application-name WordPress_App --deployment-config-name --deployment-group-name --s3-location bucket=CodeDeployDemoBucket,key=WordPressApp.zip,bundleType=zip,eTag="cecc9b8a08eac650a6e71fdb88EXAMPLE",version=LFsJAUd_2J4VWXfvKtvi79L8EXAMPLEawscli-1.14.44/awscli/examples/deploy/delete-application.rst0000666454262600001440000000032113243367510025112 0ustar pysdk-ciamazon00000000000000**To delete an application** This example deletes an application that is associated with the user's AWS account. Command:: aws deploy delete-application --application-name WordPress_App Output:: None.awscli-1.14.44/awscli/examples/deploy/list-application-revisions.rst0000666454262600001440000000172713243367510026655 0ustar pysdk-ciamazon00000000000000**To get information about application revisions** This example displays information about all application revisions that are associated with the specified application. Command:: aws deploy list-application-revisions --application-name WordPress_App --s-3-bucket CodeDeployDemoBucket --deployed exclude --s-3-key-prefix WordPress_ --sort-by lastUsedTime --sort-order descending Output:: { "revisions": [ { "revisionType": "S3", "s3Location": { "version": "uTecLusvCB_JqHFXtfUcyfV8bEXAMPLE", "bucket": "CodeDeployDemoBucket", "key": "WordPress_App.zip", "bundleType": "zip" } }, { "revisionType": "S3", "s3Location": { "version": "tMk.UxgDpMEVb7V187ZM6wVAWEXAMPLE", "bucket": "CodeDeployDemoBucket", "key": "WordPress_App_2-0.zip", "bundleType": "zip" } } ] } awscli-1.14.44/awscli/examples/deploy/get-application-revision.rst0000666454262600001440000000171713243367510026275 0ustar pysdk-ciamazon00000000000000**To get information about an application revision** This example displays information about an application revision that is associated with the specified application. Command:: aws deploy get-application-revision --application-name WordPress_App --s3-location bucket=CodeDeployDemoBucket,bundleType=zip,eTag=dd56cfd59d434b8e768f9d77fEXAMPLE,key=WordPressApp.zip Output:: { "applicationName": "WordPress_App", "revisionInfo": { "description": "Application revision registered by Deployment ID: d-N65I7GEX", "registerTime": 1411076520.009, "deploymentGroups": "WordPress_DG", "lastUsedTime": 1411076520.009, "firstUsedTime": 1411076520.009 }, "revision": { "revisionType": "S3", "s3Location": { "bundleType": "zip", "eTag": "dd56cfd59d434b8e768f9d77fEXAMPLE", "bucket": "CodeDeployDemoBucket", "key": "WordPressApp.zip" } } }awscli-1.14.44/awscli/examples/deploy/batch-get-on-premises-instances.rst0000666454262600001440000000215513243367510027440 0ustar pysdk-ciamazon00000000000000**To get information about one or more on-premises instances** This example gets information about two on-premises instances. Command:: aws deploy batch-get-on-premises-instances --instance-names AssetTag12010298EX AssetTag23121309EX Output:: { "instanceInfos": [ { "iamUserArn": "arn:aws:iam::80398EXAMPLE:user/AWS/CodeDeploy/AssetTag12010298EX", "tags": [ { "Value": "CodeDeployDemo-OnPrem", "Key": "Name" } ], "instanceName": "AssetTag12010298EX", "registerTime": 1425579465.228, "instanceArn": "arn:aws:codedeploy:us-west-2:80398EXAMPLE:instance/AssetTag12010298EX_4IwLNI2Alh" }, { "iamUserArn": "arn:aws:iam::80398EXAMPLE:user/AWS/CodeDeploy/AssetTag23121309EX", "tags": [ { "Value": "CodeDeployDemo-OnPrem", "Key": "Name" } ], "instanceName": "AssetTag23121309EX", "registerTime": 1425595585.988, "instanceArn": "arn:aws:codedeploy:us-west-2:80398EXAMPLE:instance/AssetTag23121309EX_PomUy64Was" } ] }awscli-1.14.44/awscli/examples/deploy/delete-deployment-group.rst0000666454262600001440000000044413243367510026127 0ustar pysdk-ciamazon00000000000000**To delete a deployment group** This example deletes a deployment group that is associated with the specified application. Command:: aws deploy delete-deployment-group --application-name WordPress_App --deployment-group-name WordPress_DG Output:: { "hooksNotCleanedUp": [] }awscli-1.14.44/awscli/examples/deploy/update-deployment-group.rst0000666454262600001440000000111413243367510026142 0ustar pysdk-ciamazon00000000000000**To change information about a deployment group** This example changes the settings of a deployment group that is associated with the specified application. Command:: aws deploy update-deployment-group --application-name WordPress_App --auto-scaling-groups My_CodeDeployDemo_ASG --current-deployment-group-name WordPress_DG --deployment-config-name CodeDeployDefault.AllAtOnce --ec2-tag-filters Key=Name,Type=KEY_AND_VALUE,Value=My_CodeDeployDemo --new-deployment-group-name My_WordPress_DepGroup --service-role-arn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemo-2 Output:: None.awscli-1.14.44/awscli/examples/deploy/register-application-revision.rst0000666454262600001440000000072413243367510027337 0ustar pysdk-ciamazon00000000000000**To register information about an already-uploaded application revision** This example registers information about an already-uploaded application revision in Amazon S3 with AWS CodeDeploy. Command:: aws deploy register-application-revision --application-name WordPress_App --description "Revised WordPress application" --s3-location bucket=CodeDeployDemoBucket,key=RevisedWordPressApp.zip,bundleType=zip,eTag=cecc9b8a08eac650a6e71fdb88EXAMPLE Output:: None.awscli-1.14.44/awscli/examples/deploy/register-on-premises-instance.rst0000666454262600001440000000071413243367510027242 0ustar pysdk-ciamazon00000000000000**To register an on-premises instance** This example registers an on-premises instance with AWS CodeDeploy. It does not create the specified IAM user, nor does it associate in AWS CodeDeploy any on-premises instances tags with the registered instance. Command:: aws deploy register-on-premises-instance --instance-name AssetTag12010298EX --iam-user-arn arn:aws:iam::80398EXAMPLE:user/CodeDeployDemoUser-OnPrem Output:: This command produces no output.awscli-1.14.44/awscli/examples/deploy/uninstall.rst0000666454262600001440000000073113243367510023365 0ustar pysdk-ciamazon00000000000000**To uninstall an on-premises instance** This example uninstalls the AWS CodeDeploy Agent from the on-premises instance, and it removes the on-premises configuration file from the instance. It does not deregister the instance in AWS CodeDeploy, nor disassociate any on-premises instance tags in AWS CodeDeploy from the instance, nor delete the IAM user that is associated with the instance. Command:: aws deploy uninstall Output:: This command produces no output.awscli-1.14.44/awscli/examples/deploy/list-deployments.rst0000666454262600001440000000077313243367510024676 0ustar pysdk-ciamazon00000000000000**To get information about deployments** This example displays information about all deployments that are associated with the specified application and deployment group. Command:: aws deploy list-deployments --application-name WordPress_App --create-time-range start=2014-08-19T00:00:00,end=2014-08-20T00:00:00 --deployment-group-name WordPress_DG --include-only-statuses Failed Output:: { "deployments": [ "d-QA4G4F9EX", "d-1MVNYOEEX", "d-WEWRE8BEX" ] }awscli-1.14.44/awscli/examples/deploy/batch-get-applications.rst0000666454262600001440000000135113243367510025675 0ustar pysdk-ciamazon00000000000000**To get information about multiple applications** This example displays information about multiple applications that are associated with the user's AWS account. Command:: aws deploy batch-get-applications --application-names WordPress_App MyOther_App Output:: { "applicationsInfo": [ { "applicationName": "WordPress_App", "applicationId": "d9dd6993-f171-44fa-a811-211e4EXAMPLE", "createTime": 1407878168.078, "linkedToGitHub": false }, { "applicationName": "MyOther_App", "applicationId": "8ca57519-31da-42b2-9194-8bb16EXAMPLE", "createTime": 1407453571.63, "linkedToGitHub": false } ] }awscli-1.14.44/awscli/examples/deploy/list-deployment-configs.rst0000666454262600001440000000067213243367510026137 0ustar pysdk-ciamazon00000000000000**To get information about deployment configurations** This example displays information about all deployment configurations that are associated with the user's AWS account. Command:: aws deploy list-deployment-configs Output:: { "deploymentConfigsList": [ "ThreeQuartersHealthy", "CodeDeployDefault.AllAtOnce", "CodeDeployDefault.HalfAtATime", "CodeDeployDefault.OneAtATime" ] }awscli-1.14.44/awscli/examples/deploy/deregister.rst0000666454262600001440000000161013243367510023506 0ustar pysdk-ciamazon00000000000000**To deregister an on-premises instance** This example deregisters an on-premises instance with AWS CodeDeploy. It does not delete the IAM user that is associated with the instance. It disassociates in AWS CodeDeploy the on-premises tags from the instance. It does not uninstall the AWS CodeDeploy Agent from the instance nor remove the on-premises configuration file from the instance. Command:: aws deploy deregister --instance-name AssetTag12010298EX --no-delete-iam-user --region us-west-2 Output:: Retrieving on-premises instance information... DONE IamUserArn: arn:aws:iam::80398EXAMPLE:user/AWS/CodeDeploy/AssetTag12010298EX Tags: Key=Name,Value=CodeDeployDemo-OnPrem Removing tags from the on-premises instance... DONE Deregistering the on-premises instance... DONE Run the following command on the on-premises instance to uninstall the codedeploy-agent: aws deploy uninstallawscli-1.14.44/awscli/examples/deploy/get-application.rst0000666454262600001440000000070413243367510024434 0ustar pysdk-ciamazon00000000000000**To get information about an application** This example displays information about an application that is associated with the user's AWS account. Command:: aws deploy get-application --application-name WordPress_App Output:: { "application": { "applicationName": "WordPress_App", "applicationId": "d9dd6993-f171-44fa-a811-211e4EXAMPLE", "createTime": 1407878168.078, "linkedToGitHub": false } }awscli-1.14.44/awscli/examples/deploy/stop-deployment.rst0000666454262600001440000000055013243367510024516 0ustar pysdk-ciamazon00000000000000**To attempt to stop a deployment** This example attempts to stop an in-progress deployment that is associated with the user's AWS account. Command:: aws deploy stop-deployment --deployment-id d-8365D4OEX Output:: { "status": "Succeeded", "statusMessage": "No more commands will be scheduled for execution in the deployment instances" }awscli-1.14.44/awscli/examples/deploy/remove-tags-from-on-premises-instances.rst0000666454262600001440000000120113243367510030763 0ustar pysdk-ciamazon00000000000000**To remove tags from one or more on-premises instances** This example disassociates the same on-premises tag in AWS CodeDeploy from the two specified on-premises instances. It does not deregister the on-premises instances in AWS CodeDeploy, nor uninstall the AWS CodeDeploy Agent from the instance, nor remove the on-premises configuration file from the instances, nor delete the IAM users that are associated with the instances. Command:: aws deploy remove-tags-from-on-premises-instances --instance-names AssetTag12010298EX AssetTag23121309EX --tags Key=Name,Value=CodeDeployDemo-OnPrem Output:: This command produces no output.awscli-1.14.44/awscli/examples/deploy/get-deployment.rst0000666454262600001440000000222713243367510024313 0ustar pysdk-ciamazon00000000000000**To get information about a deployment** This example displays information about a deployment that is associated with the user's AWS account. Command:: aws deploy get-deployment --deployment-id d-USUAELQEX Output:: { "deploymentInfo": { "applicationName": "WordPress_App", "status": "Succeeded", "deploymentOverview": { "Failed": 0, "InProgress": 0, "Skipped": 0, "Succeeded": 1, "Pending": 0 }, "deploymentConfigName": "CodeDeployDefault.OneAtATime", "creator": "user", "description": "My WordPress app deployment", "revision": { "revisionType": "S3", "s3Location": { "bundleType": "zip", "eTag": "\"dd56cfd59d434b8e768f9d77fEXAMPLE\"", "bucket": "CodeDeployDemoBucket", "key": "WordPressApp.zip" } }, "deploymentId": "d-USUAELQEX", "deploymentGroupName": "WordPress_DG", "createTime": 1409764576.589, "completeTime": 1409764596.101, "ignoreApplicationStopFailures": false } }awscli-1.14.44/awscli/examples/deploy/get-deployment-config.rst0000666454262600001440000000113513243367510025553 0ustar pysdk-ciamazon00000000000000**To get information about a deployment configuration** This example displays information about a deployment configuration that is associated with the user's AWS account. Command:: aws deploy get-deployment-config --deployment-config-name ThreeQuartersHealthy Output:: { "deploymentConfigInfo": { "deploymentConfigId": "bf6b390b-61d3-4f24-8911-a1664EXAMPLE", "minimumHealthyHosts": { "type": "FLEET_PERCENT", "value": 75 }, "createTime": 1411081164.379, "deploymentConfigName": "ThreeQuartersHealthy" } }awscli-1.14.44/awscli/examples/deploy/create-application.rst0000666454262600001440000000041613243367510025120 0ustar pysdk-ciamazon00000000000000**To create an application** This example creates an application and associates it with the user's AWS account. Command:: aws deploy create-application --application-name MyOther_App Output:: { "applicationId": "cfd3e1f1-5744-4aee-9251-eaa25EXAMPLE" }awscli-1.14.44/awscli/examples/deploy/deregister-on-premises-instance.rst0000666454262600001440000000103713243367510027552 0ustar pysdk-ciamazon00000000000000**To deregister an on-premises instance** This example deregisters an on-premises instance with AWS CodeDeploy, but it does not delete the IAM user associated with the instance, nor does it disassociate in AWS CodeDeploy the on-premises instance tags from the instance. It also does not uninstall the AWS CodeDeploy Agent from the instance nor remove the on-premises configuration file from the instance. Command:: aws deploy deregister-on-premises-instance --instance-name AssetTag12010298EX Output:: This command produces no output.awscli-1.14.44/awscli/examples/deploy/get-on-premises-instance.rst0000666454262600001440000000121313243367510026170 0ustar pysdk-ciamazon00000000000000**To get information about an on-premises instance** This example gets information about an on-premises instance. Command:: aws deploy get-on-premises-instance --instance-name AssetTag12010298EX Output:: { "instanceInfo": { "iamUserArn": "arn:aws:iam::80398EXAMPLE:user/AWS/CodeDeploy/AssetTag12010298EX", "tags": [ { "Value": "CodeDeployDemo-OnPrem", "Key": "Name" } ], "instanceName": "AssetTag12010298EX", "registerTime": 1425579465.228, "instanceArn": "arn:aws:codedeploy:us-east-1:80398EXAMPLE:instance/AssetTag12010298EX_4IwLNI2Alh" } }awscli-1.14.44/awscli/examples/deploy/batch-get-deployments.rst0000666454262600001440000000447113243367510025560 0ustar pysdk-ciamazon00000000000000**To get information about multiple deployments** This example displays information about multiple deployments that are associated with the user's AWS account. Command:: aws deploy batch-get-deployments --deployment-ids d-USUAELQEX d-QA4G4F9EX Output:: { "deploymentsInfo": [ { "applicationName": "WordPress_App", "status": "Failed", "deploymentOverview": { "Failed": 0, "InProgress": 0, "Skipped": 0, "Succeeded": 1, "Pending": 0 }, "deploymentConfigName": "CodeDeployDefault.OneAtATime", "creator": "user", "deploymentGroupName": "WordPress_DG", "revision": { "revisionType": "S3", "s3Location": { "bundleType": "zip", "version": "uTecLusvCB_JqHFXtfUcyfV8bEXAMPLE", "bucket": "CodeDeployDemoBucket", "key": "WordPressApp.zip" } }, "deploymentId": "d-QA4G4F9EX", "createTime": 1408480721.9, "completeTime": 1408480741.822 }, { "applicationName": "MyOther_App", "status": "Failed", "deploymentOverview": { "Failed": 1, "InProgress": 0, "Skipped": 0, "Succeeded": 0, "Pending": 0 }, "deploymentConfigName": "CodeDeployDefault.OneAtATime", "creator": "user", "errorInformation": { "message": "Deployment failed: Constraint default violated: No hosts succeeded.", "code": "HEALTH_CONSTRAINTS" }, "deploymentGroupName": "MyOther_DG", "revision": { "revisionType": "S3", "s3Location": { "bundleType": "zip", "eTag": "\"dd56cfd59d434b8e768f9d77fEXAMPLE\"", "bucket": "CodeDeployDemoBucket", "key": "MyOtherApp.zip" } }, "deploymentId": "d-USUAELQEX", "createTime": 1409764576.589, "completeTime": 1409764596.101 } ] } awscli-1.14.44/awscli/examples/deploy/update-application.rst0000666454262600001440000000042713243367510025141 0ustar pysdk-ciamazon00000000000000**To change information about an application** This example changes the name of an application that is associated with the user's AWS account. Command:: aws deploy update-application --application-name WordPress_App --new-application-name My_WordPress_App Output:: None.awscli-1.14.44/awscli/examples/deploy/create-deployment-group.rst0000666454262600001440000000111113243367510026120 0ustar pysdk-ciamazon00000000000000**To create a deployment group** This example creates a deployment group and associates it with the specified application and the user's AWS account. Command:: aws deploy create-deployment-group --application-name WordPress_App --auto-scaling-groups CodeDeployDemo-ASG --deployment-config-name CodeDeployDefault.OneAtATime --deployment-group-name WordPress_DG --ec2-tag-filters Key=Name,Value=CodeDeployDemo,Type=KEY_AND_VALUE --service-role-arn arn:aws:iam::80398EXAMPLE:role/CodeDeployDemoRole Output:: { "deploymentGroupId": "cdac3220-0e64-4d63-bb50-e68faEXAMPLE" }awscli-1.14.44/awscli/examples/deploy/register.rst0000666454262600001440000000170413243367510023201 0ustar pysdk-ciamazon00000000000000**To register an on-premises instance** This example registers an on-premises instance with AWS CodeDeploy, associates in AWS CodeDeploy the specified on-premises instance tag with the registered instance, and creates an on-premises configuration file that can be copied to the instance. It does not create the IAM user, nor does it install the AWS CodeDeploy Agent on the instance. Command:: aws deploy register --instance-name AssetTag12010298EX --iam-user-arn arn:aws:iam::80398EXAMPLE:user/CodeDeployUser-OnPrem --tags Key=Name,Value=CodeDeployDemo-OnPrem --region us-west-2 Output:: Registering the on-premises instance... DONE Adding tags to the on-premises instance... DONE Copy the on-premises configuration file named codedeploy.onpremises.yml to the on-premises instance, and run the following command on the on-premises instance to install and configure the AWS CodeDeploy Agent: aws deploy install --config-file codedeploy.onpremises.ymlawscli-1.14.44/awscli/examples/deploy/get-deployment-instance.rst0000666454262600001440000000373113243367510026116 0ustar pysdk-ciamazon00000000000000**To get information about a deployment instance** This example displays information about a deployment instance that is associated with the specified deployment. Command:: aws deploy get-deployment-instance --deployment-id d-QA4G4F9EX --instance-id i-902e9fEX Output:: { "instanceSummary": { "instanceId": "arn:aws:ec2:us-east-1:80398EXAMPLE:instance/i-902e9fEX", "lifecycleEvents": [ { "status": "Succeeded", "endTime": 1408480726.569, "startTime": 1408480726.437, "lifecycleEventName": "ApplicationStop" }, { "status": "Succeeded", "endTime": 1408480728.016, "startTime": 1408480727.665, "lifecycleEventName": "DownloadBundle" }, { "status": "Succeeded", "endTime": 1408480729.744, "startTime": 1408480729.125, "lifecycleEventName": "BeforeInstall" }, { "status": "Succeeded", "endTime": 1408480730.979, "startTime": 1408480730.844, "lifecycleEventName": "Install" }, { "status": "Failed", "endTime": 1408480732.603, "startTime": 1408480732.1, "lifecycleEventName": "AfterInstall" }, { "status": "Skipped", "endTime": 1408480732.606, "lifecycleEventName": "ApplicationStart" }, { "status": "Skipped", "endTime": 1408480732.606, "lifecycleEventName": "ValidateService" } ], "deploymentId": "d-QA4G4F9EX", "lastUpdatedAt": 1408480733.152, "status": "Failed" } }awscli-1.14.44/awscli/examples/deploy/install.rst0000666454262600001440000000137613243367510023030 0ustar pysdk-ciamazon00000000000000**To install an on-premises instance** This example copies the on-premises configuration file from the specified location on the instance to the location on the instance that the AWS CodeDeploy Agent expects to find it. It also installs the AWS CodeDeploy Agent on the instance. It does not create any IAM user, nor register the on-premises instance with AWS CodeDeploy, nor associate any on-premises instance tags in AWS CodeDeploy for the instance. Command:: aws deploy install --override-config --config-file C:\temp\codedeploy.onpremises.yml --region us-west-2 --agent-installer s3://aws-codedeploy-us-west-2/latest/codedeploy-agent.msi Output:: Creating the on-premises instance configuration file... DONE Installing the AWS CodeDeploy Agent... DONEawscli-1.14.44/awscli/examples/deploy/create-deployment-config.rst0000666454262600001440000000060013243367510026233 0ustar pysdk-ciamazon00000000000000**To create a custom deployment configuration** This example creates a custom deployment configuration and associates it with the user's AWS account. Command:: aws deploy create-deployment-config --deployment-config-name ThreeQuartersHealthy --minimum-healthy-hosts type=FLEET_PERCENT,value=75 Output:: { "deploymentConfigId": "bf6b390b-61d3-4f24-8911-a1664EXAMPLE" }awscli-1.14.44/awscli/examples/deploy/create-deployment.rst0000666454262600001440000000074113243367510024776 0ustar pysdk-ciamazon00000000000000**To create a deployment** This example creates a deployment and associates it with the user's AWS account. Command:: aws deploy create-deployment --application-name WordPress_App --deployment-config-name CodeDeployDefault.OneAtATime --deployment-group-name WordPress_DG --description "My demo deployment" --s3-location bucket=CodeDeployDemoBucket,bundleType=zip,eTag=dd56cfd59d434b8e768f9d77fEXAMPLE,key=WordPressApp.zip Output:: { "deploymentId": "d-N65YI7Gex" }awscli-1.14.44/awscli/examples/deploy/list-deployment-instances.rst0000666454262600001440000000056413243367510026476 0ustar pysdk-ciamazon00000000000000**To get information about deployment instances** This example displays information about all deployment instances that are associated with the specified deployment. Command:: aws deploy list-deployment-instances --deployment-id d-9DI6I4EX --instance-status-filter Succeeded Output:: { "instancesList": [ "i-8c4490EX", "i-7d5389EX" ] }awscli-1.14.44/awscli/examples/workspaces/0000777454262600001440000000000013243367512021510 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/workspaces/describe-workspace-bundles.rst0000666454262600001440000000674413243367510027461 0ustar pysdk-ciamazon00000000000000**To describe your WorkSpace bundles** This example describes all of the WorkSpace bundles that are provided by AWS. Command:: aws workspaces describe-workspace-bundles --owner AMAZON Output:: { "Bundles": [ { "ComputeType": { "Name": "PERFORMANCE" }, "Description": "Performance Bundle", "BundleId": "wsb-b0s22j3d7", "Owner": "Amazon", "UserStorage": { "Capacity": "100" }, "Name": "Performance" }, { "ComputeType": { "Name": "VALUE" }, "Description": "Value Base Bundle", "BundleId": "wsb-92tn3b7gx", "Owner": "Amazon", "UserStorage": { "Capacity": "10" }, "Name": "Value" }, { "ComputeType": { "Name": "STANDARD" }, "Description": "Standard Bundle", "BundleId": "wsb-3t36q0xfc", "Owner": "Amazon", "UserStorage": { "Capacity": "50" }, "Name": "Standard" }, { "ComputeType": { "Name": "PERFORMANCE" }, "Description": "Performance Plus Bundle", "BundleId": "wsb-1b5w6vnz6", "Owner": "Amazon", "UserStorage": { "Capacity": "100" }, "Name": "Performance Plus" }, { "ComputeType": { "Name": "VALUE" }, "Description": "Value Plus Office 2013", "BundleId": "wsb-fgy4lgypc", "Owner": "Amazon", "UserStorage": { "Capacity": "10" }, "Name": "Value Plus Office 2013" }, { "ComputeType": { "Name": "PERFORMANCE" }, "Description": "Performance Plus Office 2013", "BundleId": "wsb-vbsjd64y6", "Owner": "Amazon", "UserStorage": { "Capacity": "100" }, "Name": "Performance Plus Office 2013" }, { "ComputeType": { "Name": "VALUE" }, "Description": "Value Plus Bundle", "BundleId": "wsb-kgjp98lt8", "Owner": "Amazon", "UserStorage": { "Capacity": "10" }, "Name": "Value Plus" }, { "ComputeType": { "Name": "STANDARD" }, "Description": "Standard Plus Office 2013", "BundleId": "wsb-5h1pf1zxc", "Owner": "Amazon", "UserStorage": { "Capacity": "50" }, "Name": "Standard Plus Office 2013" }, { "ComputeType": { "Name": "STANDARD" }, "Description": "Standard Plus Bundle", "BundleId": "wsb-vlsvncjjf", "Owner": "Amazon", "UserStorage": { "Capacity": "50" }, "Name": "Standard Plus" } ] } awscli-1.14.44/awscli/examples/workspaces/create-workspaces.rst0000666454262600001440000000133713243367510025666 0ustar pysdk-ciamazon00000000000000**To create a WorkSpace** This example creates a WorkSpace for user ``jimsmith`` in the specified directory, from the specified bundle. Command:: aws workspaces create-workspaces --cli-input-json file://create-workspaces.json Input:: This is the contents of the create-workspaces.json file: { "Workspaces" : [ { "DirectoryId" : "d-906732325d", "UserName" : "jimsmith", "BundleId" : "wsb-b0s22j3d7" } ] } Output:: { "PendingRequests" : [ { "UserName" : "jimsmith", "DirectoryId" : "d-906732325d", "State" : "PENDING", "WorkspaceId" : "ws-0d4y2sbl5", "BundleId" : "wsb-b0s22j3d7" } ], "FailedRequests" : [] } awscli-1.14.44/awscli/examples/workspaces/terminate-workspaces.rst0000666454262600001440000000033113243367510026404 0ustar pysdk-ciamazon00000000000000**To terminate a WorkSpace** This example terminates the specified WorkSpace. Command:: aws workspaces terminate-workspaces --terminate-workspace-requests wsb-3t36q0xfc Output:: { "FailedRequests": [] }awscli-1.14.44/awscli/examples/workspaces/describe-workspace-directories.rst0000666454262600001440000000333313243367510030330 0ustar pysdk-ciamazon00000000000000**To describe your WorkSpace directories** This example describes all of your WorkSpace directories. Command:: aws workspaces describe-workspace-directories Output:: { "Directories" : [ { "CustomerUserName" : "Administrator", "DirectoryId" : "d-906735683d", "DirectoryName" : "example.awsapps.com", "SubnetIds" : [ "subnet-af0e2a87", "subnet-657e7a23" ], "WorkspaceCreationProperties" : { "EnableInternetAccess" : false, "EnableWorkDocs" : false, "UserEnabledAsLocalAdministrator" : true }, "Alias" : "example", "State" : "REGISTERED", "DirectoryType" : "SIMPLE_AD", "RegistrationCode" : "SLiad+S393HD", "IamRoleId" : "arn:aws:iam::972506530580:role/workspaces_DefaultRole", "DnsIpAddresses" : [ "10.0.2.190", "10.0.1.202" ], "WorkspaceSecurityGroupId" : "sg-6e40640b" }, { "CustomerUserName" : "Administrator", "DirectoryId" : "d-906732325d", "DirectoryName" : "exampledomain.com", "SubnetIds" : [ "subnet-775a6531", "subnet-435c036b" ], "WorkspaceCreationProperties" : { "EnableInternetAccess" : false, "EnableWorkDocs" : true, "UserEnabledAsLocalAdministrator" : true }, "Alias" : "example-domain", "State" : "REGISTERED", "DirectoryType" : "AD_CONNECTOR", "RegistrationCode" : "SLiad+UBZGNH", "IamRoleId" : "arn:aws:iam::972506530580:role/workspaces_DefaultRole", "DnsIpAddresses" : [ "50.0.2.223", "50.0.2.184" ] } ] } awscli-1.14.44/awscli/examples/workspaces/describe-workspaces.rst0000666454262600001440000000163013243367510026177 0ustar pysdk-ciamazon00000000000000**To describe your WorkSpaces** This example describes all of your WorkSpaces in the region. Command:: aws workspaces describe-workspaces Output:: { "Workspaces" : [ { "UserName" : "johndoe", "DirectoryId" : "d-906732325d", "State" : "AVAILABLE", "WorkspaceId" : "ws-3lvdznndy", "SubnetId" : "subnet-435c036b", "IpAddress" : "50.0.1.10", "BundleId" : "wsb-86y2d88pq" }, { "UserName": "jimsmith", "DirectoryId": "d-906732325d", "State": "PENDING", "WorkspaceId": "ws-0d4y2sbl5", "BundleId": "wsb-b0s22j3d7" }, { "UserName" : "marym", "DirectoryId" : "d-906732325d", "State" : "AVAILABLE", "WorkspaceId" : "ws-b3vg4shrh", "SubnetId" : "subnet-775a6531", "IpAddress" : "50.0.0.5", "BundleId" : "wsb-3t36q0xfc" } ] } awscli-1.14.44/awscli/examples/cloudfront/0000777454262600001440000000000013243367512021506 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/cloudfront/create-invalidation.rst0000666454262600001440000000276513243367510026172 0ustar pysdk-ciamazon00000000000000The following command creates an invalidation for a CloudFront distribution with the ID ``S11A16G5KZMEQD``:: aws cloudfront create-invalidation --distribution-id S11A16G5KZMEQD \ --paths /index.html /error.html 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" }awscli-1.14.44/awscli/examples/cloudfront/get-invalidation.rst0000666454262600001440000000162113243367510025474 0ustar pysdk-ciamazon00000000000000The following command retrieves an invalidation with the ID ``YNY2LI2BVJ4NJU`` for a CloudFront web distribution with the ID ``S11A16G5KZMEQD``:: aws cloudfront get-invalidation --id YNY2LI2BVJ4NJU --distribution-id S11A16G5KZMEQD The distribution ID is available in the output of ``create-distribution`` and ``list-distributions``. The invalidation ID is available in the output of ``create-invalidation`` and ``list-invalidations``. Output:: { "Invalidation": { "Status": "Completed", "InvalidationBatch": { "Paths": { "Items": [ "/index.html", "/error.html" ], "Quantity": 2 }, "CallerReference": "my-invalidation-2015-09-01" }, "Id": "YNY2LI2BVJ4NJU", "CreateTime": "2015-08-31T21:15:52.042Z" } } awscli-1.14.44/awscli/examples/cloudfront/delete-distribution.rst0000666454262600001440000000102013243367510026206 0ustar pysdk-ciamazon00000000000000The following command deletes a CloudFront distribution with the ID ``S11A16G5KZMEQD``:: aws cloudfront delete-distribution --id S11A16G5KZMEQD --if-match 8UBQECEJX24ST 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``.awscli-1.14.44/awscli/examples/cloudfront/create-distribution.rst0000666454262600001440000001144513243367510026223 0ustar pysdk-ciamazon00000000000000You 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" } }, "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" } awscli-1.14.44/awscli/examples/cloudfront/update-distribution.rst0000666454262600001440000001430713243367510026242 0ustar pysdk-ciamazon00000000000000The following command updates the Default Root Object to "index.html" for a CloudFront distribution with the ID ``S11A16G5KZMEQD``:: aws cloudfront update-distribution --id S11A16G5KZMEQD \ --default-root-object index.html The following command disables a CloudFront distribution with the ID ``S11A16G5KZMEQD``:: aws cloudfront update-distribution --id S11A16G5KZMEQD --distribution-config file://distconfig-disabled.json --if-match E37HOT42DHPVYH The distribution ID is available in the output of ``create-distribution`` and ``list-distributions``. The ETag value ``E37HOT42DHPVYH`` for the ``if-match`` parameter is available in the output of ``create-distribution``, ``get-distribution`` or ``get-distribution-config``. The file ``distconfig-disabled.json`` is a JSON document in the current folder that modifies the existing distribution config for ``S11A16G5KZMEQD`` to disable the distribution. This file was created by taking the existing config from the ``DistributionConfig`` key in the output of ``get-distribution-config`` and changing the ``Enabled`` key's value to ``false``:: { "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": false, "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 } } After disabling a CloudFront distribution you can delete it with ``delete-distribution``. The output includes the updated distribution config. Note that the ``ETag`` value has also changed:: { "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": false, "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-09-01T17:54:11.453Z", "Id": "S11A16G5KZMEQD" }, "ETag": "8UBQECEJX24ST" } awscli-1.14.44/awscli/examples/cloudfront/get-distribution.rst0000666454262600001440000000646313243367510025543 0ustar pysdk-ciamazon00000000000000The following command gets a distribution with the ID ``S11A16G5KZMEQD``:: aws cloudfront get-distribution --id S11A16G5KZMEQD The distribution ID is available in the output of ``create-distribution`` and ``list-distributions``. Output:: { "Distribution": { "Status": "Deployed", "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" } awscli-1.14.44/awscli/examples/cloudfront/list-distributions.rst0000666454262600001440000000634113243367510026115 0ustar pysdk-ciamazon00000000000000The following command retrieves a list of distributions:: aws cloudfront list-distributions Output:: { "DistributionList": { "Marker": "", "Items": [ { "Status": "Deployed", "ARN": "arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5", "CacheBehaviors": { "Quantity": 0 }, "Origins": { "Items": [ { "OriginPath": "", "S3OriginConfig": { "OriginAccessIdentity": "" }, "Id": "my-origin", "DomainName": "my-bucket.s3.amazonaws.com" } ], "Quantity": 1 }, "DomainName": "d2wkuj2w9l34gt.cloudfront.net", "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 }, "Comment": "", "ViewerCertificate": { "CloudFrontDefaultCertificate": true, "MinimumProtocolVersion": "SSLv3" }, "CustomErrorResponses": { "Quantity": 0 }, "LastModifiedTime": "2015-08-31T21:11:29.093Z", "Id": "S11A16G5KZMEQD", "Restrictions": { "GeoRestriction": { "RestrictionType": "none", "Quantity": 0 } }, "Aliases": { "Quantity": 0 } } ], "IsTruncated": false, "MaxItems": 100, "Quantity": 1 } }awscli-1.14.44/awscli/examples/cloudfront/list-invalidations.rst0000666454262600001440000000123213243367510026051 0ustar pysdk-ciamazon00000000000000The following command retrieves a list of invalidations for a CloudFront web distribution with the ID ``S11A16G5KZMEQD``:: aws cloudfront list-invalidations --distribution-id S11A16G5KZMEQD The distribution ID is available in the output of ``create-distribution`` and ``list-distributions``. Output:: { "InvalidationList": { "Marker": "", "Items": [ { "Status": "Completed", "Id": "YNY2LI2BVJ4NJU", "CreateTime": "2015-08-31T21:15:52.042Z" } ], "IsTruncated": false, "MaxItems": 100, "Quantity": 1 } } awscli-1.14.44/awscli/examples/cloudfront/get-distribution-config.rst0000666454262600001440000000525513243367510027004 0ustar pysdk-ciamazon00000000000000The following command gets a distribution config for a CloudFront distribution with the ID ``S11A16G5KZMEQD``:: aws cloudfront get-distribution-config --id S11A16G5KZMEQD The distribution ID is available in the output of ``create-distribution`` and ``list-distributions``. Output:: { "ETag": "E37HOT42DHPVYH", "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 } } }awscli-1.14.44/awscli/examples/iam/0000777454262600001440000000000013243367512020075 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/iam/get-account-authorization-details.rst0000666454262600001440000002130013243367510027353 0ustar pysdk-ciamazon00000000000000The following ``get-account-authorization-details`` command returns information about all IAM users, groups, roles, and policies in the AWS account:: aws iam get-account-authorization-details Output:: { "RoleDetailList": [ { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "ec2.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }, "RoleId": "AROAFP4BKI7Y7TEXAMPLE", "CreateDate": "2014-07-30T17:09:20Z", "InstanceProfileList": [ { "InstanceProfileId": "AIPAFFYRBHWXW2EXAMPLE", "Roles": [ { "AssumeRolePolicyDocument": { "Version":"2012-10-17", "Statement": [ { "Sid":"", "Effect":"Allow", "Principal": { "Service":"ec2.amazonaws.com" }, "Action":"sts:AssumeRole" } ] }, "RoleId": "AROAFP4BKI7Y7TEXAMPLE", "CreateDate": "2014-07-30T17:09:20Z", "RoleName": "EC2role", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/EC2role" } ], "CreateDate": "2014-07-30T17:09:20Z", "InstanceProfileName": "EC2role", "Path": "/", "Arn": "arn:aws:iam::123456789012:instance-profile/EC2role" } ], "RoleName": "EC2role", "Path": "/", "AttachedManagedPolicies": [ { "PolicyName": "AmazonS3FullAccess", "PolicyArn": "arn:aws:iam::aws:policy/AmazonS3FullAccess" }, { "PolicyName": "AmazonDynamoDBFullAccess", "PolicyArn": "arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess" } ], "RolePolicyList": [], "Arn": "arn:aws:iam::123456789012:role/EC2role" }], "GroupDetailList": [ { "GroupId": "AIDACKCEVSQ6C7EXAMPLE", "AttachedManagedPolicies": { "PolicyName": "AdministratorAccess", "PolicyArn": "arn:aws:iam::aws:policy/AdministratorAccess" }, "GroupName": "Admins", "Path": "/", "Arn": "arn:aws:iam::123456789012:group/Admins", "CreateDate": "2013-10-14T18:32:24Z", "GroupPolicyList": [] }, { "GroupId": "AIDACKCEVSQ6C8EXAMPLE", "AttachedManagedPolicies": { "PolicyName": "PowerUserAccess", "PolicyArn": "arn:aws:iam::aws:policy/PowerUserAccess" }, "GroupName": "Dev", "Path": "/", "Arn": "arn:aws:iam::123456789012:group/Dev", "CreateDate": "2013-10-14T18:33:55Z", "GroupPolicyList": [] }, { "GroupId": "AIDACKCEVSQ6C9EXAMPLE", "AttachedManagedPolicies": [], "GroupName": "Finance", "Path": "/", "Arn": "arn:aws:iam::123456789012:group/Finance", "CreateDate": "2013-10-14T18:57:48Z", "GroupPolicyList": [ { "PolicyName": "policygen-201310141157", "PolicyDocument": { "Version":"2012-10-17", "Statement": [ { "Action": "aws-portal:*", "Sid":"Stmt1381777017000", "Resource": "*", "Effect":"Allow" } ] } } ] }], "UserDetailList": [ { "UserName": "Alice", "GroupList": [ "Admins" ], "CreateDate": "2013-10-14T18:32:24Z", "UserId": "AIDACKCEVSQ6C2EXAMPLE", "UserPolicyList": [], "Path": "/", "AttachedManagedPolicies": [], "Arn": "arn:aws:iam::123456789012:user/Alice" }, { "UserName": "Bob", "GroupList": [ "Admins" ], "CreateDate": "2013-10-14T18:32:25Z", "UserId": "AIDACKCEVSQ6C3EXAMPLE", "UserPolicyList": [ { "PolicyName": "DenyBillingAndIAMPolicy", "PolicyDocument": { "Version":"2012-10-17", "Statement": { "Effect":"Deny", "Action": [ "aws-portal:*", "iam:*" ], "Resource":"*" } } } ], "Path": "/", "AttachedManagedPolicies": [], "Arn": "arn:aws:iam::123456789012:user/Bob" }, { "UserName": "Charlie", "GroupList": [ "Dev" ], "CreateDate": "2013-10-14T18:33:56Z", "UserId": "AIDACKCEVSQ6C4EXAMPLE", "UserPolicyList": [], "Path": "/", "AttachedManagedPolicies": [], "Arn": "arn:aws:iam::123456789012:user/Charlie" }], "Policies": [ { "PolicyName": "create-update-delete-set-managed-policies", "CreateDate": "2015-02-06T19:58:34Z", "AttachmentCount": 1, "IsAttachable": true, "PolicyId": "ANPAJ2UCCR6DPCEXAMPLE", "DefaultVersionId": "v1", "PolicyVersionList": [ { "CreateDate": "2015-02-06T19:58:34Z", "VersionId": "v1", "Document": { "Version":"2012-10-17", "Statement": { "Effect":"Allow", "Action": [ "iam:CreatePolicy", "iam:CreatePolicyVersion", "iam:DeletePolicy", "iam:DeletePolicyVersion", "iam:GetPolicy", "iam:GetPolicyVersion", "iam:ListPolicies", "iam:ListPolicyVersions", "iam:SetDefaultPolicyVersion" ], "Resource": "*" } }, "IsDefaultVersion": true } ], "Path": "/", "Arn": "arn:aws:iam::123456789012:policy/create-update-delete-set-managed-policies", "UpdateDate": "2015-02-06T19:58:34Z" }, { "PolicyName": "S3-read-only-specific-bucket", "CreateDate": "2015-01-21T21:39:41Z", "AttachmentCount": 1, "IsAttachable": true, "PolicyId": "ANPAJ4AE5446DAEXAMPLE", "DefaultVersionId": "v1", "PolicyVersionList": [ { "CreateDate": "2015-01-21T21:39:41Z", "VersionId": "v1", "Document": { "Version":"2012-10-17", "Statement": [ { "Effect":"Allow", "Action": [ "s3:Get*", "s3:List*" ], "Resource": [ "arn:aws:s3:::example-bucket", "arn:aws:s3:::example-bucket/*" ] } ] }, "IsDefaultVersion": true } ], "Path": "/", "Arn": "arn:aws:iam::123456789012:policy/S3-read-only-specific-bucket", "UpdateDate": "2015-01-21T23:39:41Z" }, { "PolicyName": "AmazonEC2FullAccess", "CreateDate": "2015-02-06T18:40:15Z", "AttachmentCount": 1, "IsAttachable": true, "PolicyId": "ANPAE3QWE5YT46TQ34WLG", "DefaultVersionId": "v1", "PolicyVersionList": [ { "CreateDate": "2014-10-30T20:59:46Z", "VersionId": "v1", "Document": { "Version":"2012-10-17", "Statement": [ { "Action":"ec2:*", "Effect":"Allow", "Resource":"*" }, { "Effect":"Allow", "Action":"elasticloadbalancing:*", "Resource":"*" }, { "Effect":"Allow", "Action":"cloudwatch:*", "Resource":"*" }, { "Effect":"Allow", "Action":"autoscaling:*", "Resource":"*" } ] }, "IsDefaultVersion": true } ], "Path": "/", "Arn": "arn:aws:iam::aws:policy/AmazonEC2FullAccess", "UpdateDate": "2015-02-06T18:40:15Z" }], "Marker": "EXAMPLEkakv9BCuUNFDtxWSyfzetYwEx2ADc8dnzfvERF5S6YMvXKx41t6gCl/eeaCX3Jo94/bKqezEAg8TEVS99EKFLxm3jtbpl25FDWEXAMPLE", "IsTruncated": true }awscli-1.14.44/awscli/examples/iam/upload-signing-certificate.rst0000666454262600001440000000160213243367510026024 0ustar pysdk-ciamazon00000000000000**To upload a signing certificate for an IAM user** The following ``upload-signing-certificate`` command uploads a signing certificate for the IAM user named ``Bob``:: aws iam upload-signing-certificate --user-name Bob --certificate-body file://certificate.pem Output:: { "Certificate": { "UserName": "Bob", "Status": "Active", "CertificateBody": "-----BEGIN CERTIFICATE----------END CERTIFICATE-----", "CertificateId": "TA7SMP42TDN5Z26OBPJE7EXAMPLE", "UploadDate": "2013-06-06T21:40:08.121Z" } } The certificate is in a file named *certificate.pem* in PEM format. For more information, see `Creating and Uploading a User Signing Certificate`_ in the *Using IAM* guide. .. _`Creating and Uploading a User Signing Certificate`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_UploadCertificate.html awscli-1.14.44/awscli/examples/iam/put-user-policy.rst0000666454262600001440000000112013243367510023700 0ustar pysdk-ciamazon00000000000000**To attach a policy to an IAM user** The following ``put-user-policy`` command attaches a policy to the IAM user named ``Bob``:: aws iam put-user-policy --user-name Bob --policy-name ExamplePolicy --policy-document file://AdminPolicy.json The policy is defined as a JSON document in the *AdminPolicy.json* file. (The file name and extension do not have significance.) For more information, see `Adding a New User to Your AWS Account`_ in the *Using IAM* guide. .. _`Adding a New User to Your AWS Account`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_SettingUpUser.html awscli-1.14.44/awscli/examples/iam/list-mfa-devices.rst0000666454262600001440000000117113243367510023761 0ustar pysdk-ciamazon00000000000000**To list all MFA devices for a specified user** This example returns details about the MFA device assigned to the IAM user ``Bob``:: aws iam list-mfa-devices --user-name Bob Output:: { "MFADevices": [ { "UserName": "Bob", "SerialNumber": "arn:aws:iam::123456789012:mfa/BobsMFADevice", "EnableDate": "2015-06-16T22:36:37Z" } ] } For more information, see `Using Multi-Factor Authentication (MFA) Devices with AWS`_ in the *Using IAM* guide. .. _`Using Multi-Factor Authentication (MFA) Devices with AWS`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingMFA.html awscli-1.14.44/awscli/examples/iam/put-role-policy.rst0000666454262600001440000000121213243367510023665 0ustar pysdk-ciamazon00000000000000**To attach a permissions policy to an IAM role** The following ``put-role-policy`` command adds a permissions policy to the role named ``Test-Role``:: aws iam put-role-policy --role-name Test-Role --policy-name ExamplePolicy --policy-document file://AdminPolicy.json The policy is defined as a JSON document in the *AdminPolicy.json* file. (The file name and extension do not have significance.) To attach a trust policy to a role, use the ``update-assume-role-policy`` command. For more information, see `Creating a Role`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html awscli-1.14.44/awscli/examples/iam/list-attached-group-policies.rst0000666454262600001440000000141213243367510026310 0ustar pysdk-ciamazon00000000000000**To list all managed policies that are attached to the specified group** This example returns the names and ARNs of the managed policies that are attached to the IAM group named ``Admins`` in the AWS account:: aws iam list-attached-group-policies --group-name Admins Output:: { "AttachedPolicies": [ { "PolicyName": "AdministratorAccess", "PolicyArn": "arn:aws:iam::aws:policy/AdministratorAccess" }, { "PolicyName": "SecurityAudit", "PolicyArn": "arn:aws:iam::aws:policy/SecurityAudit" } ], "IsTruncated": false } For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/list-attached-user-policies.rst0000666454262600001440000000135713243367510026142 0ustar pysdk-ciamazon00000000000000**To list all managed policies that are attached to the specified user** This command returns the names and ARNs of the managed policies for the IAM user named ``Bob`` in the AWS account:: aws iam list-attached-user-policies --user-name Bob Output:: { "AttachedPolicies": [ { "PolicyName": "AdministratorAccess", "PolicyArn": "arn:aws:iam::aws:policy/AdministratorAccess" }, { "PolicyName": "SecurityAudit", "PolicyArn": "arn:aws:iam::aws:policy/SecurityAudit" } ], "IsTruncated": false } For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/get-group.rst0000666454262600001440000000111213243367510022531 0ustar pysdk-ciamazon00000000000000**To get an IAM group** This example returns details about the IAM group ``Admins``:: aws iam get-group --group-name Admins Output:: { "Group": { "Path": "/", "CreateDate": "2015-06-16T19:41:48Z", "GroupId": "AIDGPMS9RO4H3FEXAMPLE", "Arn": "arn:aws:iam::123456789012:group/Admins", "GroupName": "Admins" }, "Users": [] } For more information, see `IAM Users and Groups`_ in the *Using IAM* guide. .. _`IAM Users and Groups`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_WorkingWithGroupsAndUsers.htmlawscli-1.14.44/awscli/examples/iam/deactivate-mfa-device.rst0000666454262600001440000000103713243367510024735 0ustar pysdk-ciamazon00000000000000**To deactivate an MFA device** This command deactivates the virtual MFA device with the ARN ``arn:aws:iam::210987654321:mfa/BobsMFADevice`` that is associated with the user ``Bob``:: aws iam deactivate-mfa-device --user-name Bob --serial-number arn:aws:iam::210987654321:mfa/BobsMFADevice For more information, see `Using Multi-Factor Authentication (MFA) Devices with AWS`_ in the *Using IAM* guide. .. _`Using Multi-Factor Authentication (MFA) Devices with AWS`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingMFA.htmlawscli-1.14.44/awscli/examples/iam/list-access-keys.rst0000666454262600001440000000175313243367510024016 0ustar pysdk-ciamazon00000000000000**To list the access key IDs for an IAM user** The following ``list-access-keys`` command lists the access keys IDs for the IAM user named ``Bob``:: aws iam list-access-keys --user-name Bob Output:: "AccessKeyMetadata": [ { "UserName": "Bob", "Status": "Active", "CreateDate": "2013-06-04T18:17:34Z", "AccessKeyId": "AKIAIOSFODNN7EXAMPLE" }, { "UserName": "Bob", "Status": "Inactive", "CreateDate": "2013-06-06T20:42:26Z", "AccessKeyId": "AKIAI44QH8DHBEXAMPLE" } ] You cannot list the secret access keys for IAM users. If the secret access keys are lost, you must create new access keys using the ``create-access-keys`` command. For more information, see `Creating, Modifying, and Viewing User Security Credentials`_ in the *Using IAM* guide. .. _`Creating, Modifying, and Viewing User Security Credentials`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_CreateAccessKey.html awscli-1.14.44/awscli/examples/iam/get-login-profile.rst0000666454262600001440000000157313243367510024156 0ustar pysdk-ciamazon00000000000000**To get password information for an IAM user** The following ``get-login-profile`` command gets information about the password for the IAM user named ``Bob``:: aws iam get-login-profile --user-name Bob Output:: { "LoginProfile": { "UserName": "Bob", "CreateDate": "2012-09-21T23:03:39Z" } } The ``get-login-profile`` command can be used to verify that an IAM user has a password. The command returns a ``NoSuchEntity`` error if no password is defined for the user. You cannot recover a password using this command. If the password is lost, you must delete the login profile (``delete-login-profile``) for the user and then create a new one (``create-login-profile``). For more information, see `Managing Passwords`_ in the *Using IAM* guide. .. _`Managing Passwords`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html awscli-1.14.44/awscli/examples/iam/delete-account-password-policy.rst0000666454262600001440000000064313243367510026661 0ustar pysdk-ciamazon00000000000000**To delete the current account password policy** The following ``delete-account-password-policy`` command removes the password policy for the current account:: aws iam delete-account-password-policy For more information, see `Managing an IAM Password Policy`_ in the *Using IAM* guide. .. _`Managing an IAM Password Policy`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html awscli-1.14.44/awscli/examples/iam/list-user-policies.rst0000666454262600001440000000075413243367510024367 0ustar pysdk-ciamazon00000000000000**To list policies for an IAM user** The following ``list-user-policies`` command lists the policies that are attached to the IAM user named ``Bob``:: aws iam list-user-policies --user-name Bob Output:: "PolicyNames": [ "ExamplePolicy", "TestPolicy" ] For more information, see `Adding a New User to Your AWS Account`_ in the *Using IAM* guide. .. _`Adding a New User to Your AWS Account`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_SettingUpUser.html awscli-1.14.44/awscli/examples/iam/list-virtual-mfa-devices.rst0000666454262600001440000000116413243367510025447 0ustar pysdk-ciamazon00000000000000**To list virtual MFA devices** The following ``list-virtual-mfa-devices`` command lists the virtual MFA devices that have been configured for the current account:: aws iam list-virtual-mfa-devices Output:: { "VirtualMFADevices": [ { "SerialNumber": "arn:aws:iam::123456789012:mfa/ExampleMFADevice" }, { "SerialNumber": "arn:aws:iam::123456789012:mfa/Fred" } ] } For more information, see `Using a Virtual MFA Device with AWS`_ in the *Using IAM* guide. .. _`Using a Virtual MFA Device with AWS`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html awscli-1.14.44/awscli/examples/iam/delete-account-alias.rst0000666454262600001440000000062313243367510024611 0ustar pysdk-ciamazon00000000000000**To delete an account alias** The following ``delete-account-alias`` command removes the alias ``mycompany`` for the current account:: aws iam delete-account-alias --account-alias mycompany For more information, see `Using an Alias for Your AWS Account ID`_ in the *Using IAM* guide. .. _`Using an Alias for Your AWS Account ID`: http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html awscli-1.14.44/awscli/examples/iam/resync-mfa-device.rst0000666454262600001440000000130113243367510024121 0ustar pysdk-ciamazon00000000000000**To synchronize the specified MFA device with AWS servers** This example synchronizes the MFA device that is associated with the IAM user ``Bob`` and whose ARN is ``arn:aws:iam::123456789012:mfa/BobsMFADevice`` with an authenticator program that provided the two authentication codes:: aws iam resync-mfa-device --user-name Bob --serial-number arn:aws:iam::210987654321:mfa/BobsMFADevice --authentication-code-1 123456 --authentication-code-2 987654 For more information, see `Using Multi-Factor Authentication (MFA) Devices with AWS`_ in the *IAM User* guide. .. _`Using Multi-Factor Authentication (MFA) Devices with AWS`: http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa.htmlawscli-1.14.44/awscli/examples/iam/remove-role-from-instance-profile.rst0000666454262600001440000000075313243367510027267 0ustar pysdk-ciamazon00000000000000**To remove a role from an instance profile** The following ``remove-role-from-instance-profile`` command removes the role named ``Test-Role`` from the instance profile named ``ExampleInstanceProfile``:: aws iam remove-role-from-instance-profile --instance-profile-name ExampleInstanceProfile --role-name Test-Role For more information, see `Instance Profiles`_ in the *Using IAM* guide. .. _`Instance Profiles`: http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html awscli-1.14.44/awscli/examples/iam/create-saml-provider.rst0000666454262600001440000000110313243367510024645 0ustar pysdk-ciamazon00000000000000**To create a SAML provider** This example creates a new SAML provider in IAM named ``MySAMLProvider``. It is described by the SAML metadata document found in the file ``SAMLMetaData.xml``:: aws iam create-saml-provider --saml-metadata-document file://SAMLMetaData.xml --name MySAMLProvider Output:: { "SAMLProviderArn": "arn:aws:iam::123456789012:saml-provider/MySAMLProvider" } For more information, see `Using SAML Providers`_ in the *Using IAM* guide. .. _`Using SAML Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-saml.htmlawscli-1.14.44/awscli/examples/iam/update-user.rst0000666454262600001440000000061113243367510023061 0ustar pysdk-ciamazon00000000000000**To change an IAM user's name** The following ``update-user`` command changes the name of the IAM user ``Bob`` to ``Robert``:: aws iam update-user --user-name Bob --new-user-name Robert For more information, see `Changing a Group's Name or Path`_ in the *Using IAM* guide. .. _`Changing a Group's Name or Path`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_RenamingGroup.html awscli-1.14.44/awscli/examples/iam/delete-user.rst0000666454262600001440000000060613243367510023045 0ustar pysdk-ciamazon00000000000000**To delete an IAM user** The following ``delete-user`` command removes the IAM user named ``Bob`` from the current account:: aws iam delete-user --user-name Bob For more information, see `Deleting a User from Your AWS Account`_ in the *Using IAM* guide. .. _`Deleting a User from Your AWS Account`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_DeletingUserFromAccount.html awscli-1.14.44/awscli/examples/iam/attach-group-policy.rst0000666454262600001440000000077513243367510024531 0ustar pysdk-ciamazon00000000000000**To attach a managed policy to an IAM group** The following ``attach-group-policy`` command attaches the AWS managed policy named ``ReadOnlyAccess`` to the IAM group named ``Finance``:: aws iam attach-group-policy --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess --group-name Finance For more information, see `Managed Policies and Inline Policies`_ in the *Using IAM* guide. .. _`Managed Policies and Inline Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.htmlawscli-1.14.44/awscli/examples/iam/create-virtual-mfa-device.rst0000666454262600001440000000142013243367510025547 0ustar pysdk-ciamazon00000000000000**To create a virtual MFA device** This example creates a new virtual MFA device called ``BobsMFADevice``. It creates a file that contains bootstrap information called ``QRCode.png`` and places it in the ``C:/`` directory. The bootstrap method used in this example is ``QRCodePNG``:: aws iam create-virtual-mfa-device --virtual-mfa-device-name BobsMFADevice --outfile C:/QRCode.png --bootstrap-method QRCodePNG Output:: { "VirtualMFADevice": { "SerialNumber": "arn:aws:iam::210987654321:mfa/BobsMFADevice" } For more information, see `Using Multi-Factor Authentication (MFA) Devices with AWS`_ in the *Using IAM* guide. .. _`Using Multi-Factor Authentication (MFA) Devices with AWS`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingMFA.htmlawscli-1.14.44/awscli/examples/iam/create-login-profile.rst0000666454262600001440000000413313243367510024635 0ustar pysdk-ciamazon00000000000000**To create a password for an IAM user** To create a password for an IAM user, we recommend using the ``--cli-input-json`` parameter to pass a JSON file that contains the password. Using this method, you can create a strong password with non-alphanumeric characters. It can be difficult to create a password with non-alphanumeric characters when you pass it as a command line parameter. To use the ``--cli-input-json`` parameter, start by using the ``create-login-profile`` command with the ``--generate-cli-skeleton`` parameter, as in the following example:: aws iam create-login-profile --generate-cli-skeleton > create-login-profile.json The previous command creates a JSON file called create-login-profile.json that you can use to fill in the information for a subsequent ``create-login-profile`` command. For example:: { "UserName": "Bob", "Password": "&1-3a6u:RA0djs", "PasswordResetRequired": true } Next, to create a password for an IAM user, use the ``create-login-profile`` command again, this time passing the ``--cli-input-json`` parameter to specify your JSON file. The following ``create-login-profile`` command uses the ``--cli-input-json`` parameter with a JSON file called create-login-profile.json:: aws iam create-login-profile --cli-input-json file://create-login-profile.json Output:: { "LoginProfile": { "UserName": "Bob", "CreateDate": "2015-03-10T20:55:40.274Z", "PasswordResetRequired": true } } If the new password violates the account password policy, the command returns a ``PasswordPolicyViolation`` error. To change the password for a user that already has one, use ``update-login-profile``. To set a password policy for the account, use the ``update-account-password-policy`` command. If the account password policy allows them to, IAM users can change their own passwords using the ``change-password`` command. For more information, see `Managing Passwords for IAM Users`_ in the *Using IAM* guide. .. _`Managing Passwords for IAM Users`: http://docs.aws.amazon.com/IAM/latest/UserGuide/credentials-add-pwd-for-user.htmlawscli-1.14.44/awscli/examples/iam/delete-access-key.rst0000666454262600001440000000115413243367510024115 0ustar pysdk-ciamazon00000000000000**To delete an access key for an IAM user** The following ``delete-access-key`` command deletes the specified access key (access key ID and secret access key) for the IAM user named ``Bob``:: aws iam delete-access-key --access-key AKIDPMS9RO4H3FEXAMPLE --user-name Bob To list the access keys defined for an IAM user, use the ``list-access-keys`` command. For more information, see `Creating, Modifying, and Viewing User Security Credentials`_ in the *Using IAM* guide. .. _`Creating, Modifying, and Viewing User Security Credentials`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_CreateAccessKey.html awscli-1.14.44/awscli/examples/iam/list-attached-role-policies.rst0000666454262600001440000000122313243367510026115 0ustar pysdk-ciamazon00000000000000**To list all managed policies that are attached to the specified role** This command returns the names and ARNs of the managed policies attached to the IAM role named ``SecurityAuditRole`` in the AWS account:: aws iam list-attached-role-policies --role-name SecurityAuditRole Output:: { "AttachedPolicies": [ { "PolicyName": "SecurityAudit", "PolicyArn": "arn:aws:iam::aws:policy/SecurityAudit" } ], "IsTruncated": false } For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/get-user.rst0000666454262600001440000000107613243367510022364 0ustar pysdk-ciamazon00000000000000**To get information about an IAM user** The following ``get-user`` command gets information about the IAM user named ``Bob``:: aws iam get-user --user-name Bob Output:: { "User": { "UserName": "Bob", "Path": "/", "CreateDate": "2012-09-21T23:03:13Z", "UserId": "AKIAIOSFODNN7EXAMPLE", "Arn": "arn:aws:iam::123456789012:user/Bob" } } For more information, see `Listing Users`_ in the *Using IAM* guide. .. _`Listing Users`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_GetListOfUsers.html awscli-1.14.44/awscli/examples/iam/remove-client-id-from-open-id-connect-provider.rst0000666454262600001440000000132713243367510031544 0ustar pysdk-ciamazon00000000000000**To remove the specified client ID from the list of client IDs registered for the specified IAM OpenID Connect provider** This example removes the client ID ``My-TestApp-3`` from the list of client IDs associated with the IAM OIDC provider whose ARN is ``arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com``:: aws iam remove-client-id-from-open-id-connect-provider --client-id My-TestApp-3 --open-id-connect-provider-arn arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com For more information, see `Using OpenID Connect Identity Providers`_ in the *Using IAM* guide. .. _`Using OpenID Connect Identity Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc.htmlawscli-1.14.44/awscli/examples/iam/create-role.rst0000666454262600001440000000172513243367510023034 0ustar pysdk-ciamazon00000000000000**To create an IAM role** The following ``create-role`` command creates a role named ``Test-Role`` and attaches a trust policy to it:: aws iam create-role --role-name Test-Role --assume-role-policy-document file://Test-Role-Trust-Policy.json Output:: { "Role": { "AssumeRolePolicyDocument": "", "RoleId": "AKIAIOSFODNN7EXAMPLE", "CreateDate": "2013-06-07T20:43:32.821Z", "RoleName": "Test-Role", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/Test-Role" } } The trust policy is defined as a JSON document in the *Test-Role-Trust-Policy.json* file. (The file name and extension do not have significance.) The trust policy must specify a principal. To attach a permissions policy to a role, use the ``put-role-policy`` command. For more information, see `Creating a Role`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html awscli-1.14.44/awscli/examples/iam/update-group.rst0000666454262600001440000000061213243367510023240 0ustar pysdk-ciamazon00000000000000**To rename an IAM group** The following ``update-group`` command changes the name of the IAM group ``Test`` to ``Test-1``:: aws iam update-group --group-name Test --new-group-name Test-1 For more information, see `Changing a Group's Name or Path`_ in the *Using IAM* guide. .. _`Changing a Group's Name or Path`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_RenamingGroup.html awscli-1.14.44/awscli/examples/iam/list-groups.rst0000666454262600001440000000147013243367510023117 0ustar pysdk-ciamazon00000000000000**To list the IAM groups for the current account** The following ``list-groups`` command lists the IAM groups in the current account:: aws iam list-groups Output:: "Groups": [ { "Path": "/", "CreateDate": "2013-06-04T20:27:27.972Z", "GroupId": "AIDACKCEVSQ6C2EXAMPLE", "Arn": "arn:aws:iam::123456789012:group/Admins", "GroupName": "Admins" }, { "Path": "/", "CreateDate": "2013-04-16T20:30:42Z", "GroupId": "AIDGPMS9RO4H3FEXAMPLE", "Arn": "arn:aws:iam::123456789012:group/S3-Admins", "GroupName": "S3-Admins" } ] For more information, see `Creating and Listing Groups`_ in the *Using IAM* guide. .. _`Creating and Listing Groups`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_CreatingAndListingGroups.html awscli-1.14.44/awscli/examples/iam/delete-saml-provider.rst0000666454262600001440000000067613243367510024662 0ustar pysdk-ciamazon00000000000000**To delete a SAML provider** This example deletes the IAM SAML 2.0 provider whose ARN is ``arn:aws:iam::123456789012:saml-provider/SAMLADFSProvider``:: aws iam delete-saml-provider --saml-provider-arn arn:aws:iam::123456789012:saml-provider/SAMLADFSProvider For more information, see `Using SAML Providers`_ in the *Using IAM* guide. .. _`Using SAML Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-saml.htmlawscli-1.14.44/awscli/examples/iam/create-account-alias.rst0000666454262600001440000000061213243367510024610 0ustar pysdk-ciamazon00000000000000**To create an account alias** The following ``create-account-alias`` command creates the alias ``examplecorp`` for your AWS account:: aws iam create-account-alias --account-alias examplecorp For more information, see `Your AWS Account ID and Its Alias`_ in the *Using IAM* guide. .. _`Your AWS Account ID and Its Alias`: http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html awscli-1.14.44/awscli/examples/iam/add-client-id-to-open-id-connect-provider.rst0000666454262600001440000000130513243367510030452 0ustar pysdk-ciamazon00000000000000**To add a client ID (audience) to an Open-ID Connect (OIDC) provider** The following ``add-client-id-to-open-id-connect-provider`` command adds the client ID ``my-application-ID`` to the OIDC provider named ``server.example.com``:: aws iam add-client-id-to-open-id-connect-provider --client-id my-application-ID --open-id-connect-provider-arn arn:aws:iam::123456789012:oidc-provider/server.example.com To create an OIDC provider, use the ``create-open-id-connect-provider`` command. For more information, see `Using OpenID Connect Identity Providers`_ in the *Using IAM* guide. .. _`Using OpenID Connect Identity Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc.htmlawscli-1.14.44/awscli/examples/iam/delete-policy-version.rst0000666454262600001440000000072713243367510025055 0ustar pysdk-ciamazon00000000000000**To delete a version of a managed policy** This example deletes the version identified as ``v2`` from the policy whose ARN is ``arn:aws:iam::123456789012:policy/MySamplePolicy``:: aws iam delete-policy-version --policy-arn arn:aws:iam::123456789012:policy/MyPolicy --version-id v2 For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/list-open-id-connect-providers.rst0000666454262600001440000000115213243367510026572 0ustar pysdk-ciamazon00000000000000**To list information about the OpenID Connect providers in the AWS account** This example returns a list of ARNS of all the OpenID Connect providers that are defined in the current AWS account:: aws iam list-open-id-connect-providers Output:: { "OpenIDConnectProviderList": [ { "Arn": "arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com" } ] } For more information, see `Using OpenID Connect Identity Providers`_ in the *Using IAM* guide. .. _`Using OpenID Connect Identity Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc.htmlawscli-1.14.44/awscli/examples/iam/delete-user-policy.rst0000666454262600001440000000101513243367510024335 0ustar pysdk-ciamazon00000000000000**To remove a policy from an IAM user** The following ``delete-user-policy`` command removes the specified policy from the IAM user named ``Bob``:: aws iam delete-user-policy --user-name Bob --policy-name ExamplePolicy To get a list of policies for an IAM user, use the ``list-user-policies`` command. For more information, see `Adding a New User to Your AWS Account`_ in the *Using IAM* guide. .. _`Adding a New User to Your AWS Account`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_SettingUpUser.html awscli-1.14.44/awscli/examples/iam/get-user-policy.rst0000666454262600001440000000155113243367510023657 0ustar pysdk-ciamazon00000000000000**To list policy details for an IAM user** The following ``get-user-policy`` command lists the details of the specified policy that is attached to the IAM user named ``Bob``:: aws iam get-user-policy --user-name Bob --policy-name ExamplePolicy Output:: { "UserName": "Bob", "PolicyName": "ExamplePolicy", "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": "*", "Resource": "*", "Effect": "Allow" } ] } } To get a list of policies for an IAM user, use the ``list-user-policies`` command. For more information, see `Adding a New User to Your AWS Account`_ in the *Using IAM* guide. .. _`Adding a New User to Your AWS Account`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_SettingUpUser.html awscli-1.14.44/awscli/examples/iam/delete-instance-profile.rst0000666454262600001440000000062313243367510025330 0ustar pysdk-ciamazon00000000000000**To delete an instance profile** The following ``delete-instance-profile`` command deletes the instance profile named ``ExampleInstanceProfile``:: aws iam delete-instance-profile --instance-profile-name ExampleInstanceProfile For more information, see `Instance Profiles`_ in the *Using IAM* guide. .. _`Instance Profiles`: http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html awscli-1.14.44/awscli/examples/iam/delete-role.rst0000666454262600001440000000127013243367510023026 0ustar pysdk-ciamazon00000000000000**To delete an IAM role** The following ``delete-role`` command removes the role named ``Test-Role``:: aws iam delete-role --role-name Test-Role Before you can delete a role, you must remove the role from any instance profile (``remove-role-from-instance-profile``), detach any managed policies (``detach-role-policy``) and delete any inline policies that are attached to the role (``delete-role-policy``). For more information, see `Creating a Role`_ and `Instance Profiles`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html .. _Instance Profiles: http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html awscli-1.14.44/awscli/examples/iam/update-access-key.rst0000666454262600001440000000131313243367510024132 0ustar pysdk-ciamazon00000000000000**To activate or deactivate an access key for an IAM user** The following ``update-access-key`` command deactivates the specified access key (access key ID and secret access key) for the IAM user named ``Bob``:: aws iam update-access-key --access-key-id AKIAIOSFODNN7EXAMPLE --status Inactive --user-name Bob Deactivating the key means that it cannot be used for programmatic access to AWS. However, the key is still available and can be reactivated. For more information, see `Creating, Modifying, and Viewing User Security Credentials`_ in the *Using IAM* guide. .. _`Creating, Modifying, and Viewing User Security Credentials`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_CreateAccessKey.html awscli-1.14.44/awscli/examples/iam/delete-login-profile.rst0000666454262600001440000000056113243367510024635 0ustar pysdk-ciamazon00000000000000**To delete a password for an IAM user** The following ``delete-login-profile`` command deletes the password for the IAM user named ``Bob``:: aws iam delete-login-profile --user-name Bob For more information, see `Managing Passwords`_ in the *Using IAM* guide. .. _`Managing Passwords`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html awscli-1.14.44/awscli/examples/iam/delete-signing-certificate.rst0000666454262600001440000000114413243367510026003 0ustar pysdk-ciamazon00000000000000**To delete a signing certificate for an IAM user** The following ``delete-signing-certificate`` command deletes the specified signing certificate for the IAM user named ``Bob``:: aws iam delete-signing-certificate --user-name Bob --certificate-id TA7SMP42TDN5Z26OBPJE7EXAMPLE To get the ID for a signing certificate, use the ``list-signing-certificates`` command. For more information, see `Creating and Uploading a User Signing Certificate`_ in the *Using IAM* guide. .. _`Creating and Uploading a User Signing Certificate`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_UploadCertificate.html awscli-1.14.44/awscli/examples/iam/upload-server-certificate.rst0000666454262600001440000000221613243367510025676 0ustar pysdk-ciamazon00000000000000**To upload a server certificate to your AWS account** The following **upload-server-certificate** command uploads a server certificate to your AWS account:: aws iam upload-server-certificate --server-certificate-name myServerCertificate --certificate-body file://public_key_cert_file.pem --private-key file://my_private_key.pem --certificate-chain file://my_certificate_chain_file.pem The certificate is in the file ``public_key_cert_file.pem``, and your private key is in the file ``my_private_key.pem``. When the file has finished uploading, it is available under the name *myServerCertificate*. The certificate chain provided by the certificate authority (CA) is included as the ``my_certificate_chain_file.pem`` file. Note that the parameters that contain file names are preceded with ``file://``. This tells the command that the parameter value is a file name. You can include a complete path following ``file://``. For more information, see `Creating, Uploading, and Deleting Server Certificates`_ in the *Using IAM* guide. .. _`Creating, Uploading, and Deleting Server Certificates`: http://docs.aws.amazon.com/IAM/latest/UserGuide/InstallCert.html awscli-1.14.44/awscli/examples/iam/enable-mfa-device.rst0000666454262600001440000000144313243367510024053 0ustar pysdk-ciamazon00000000000000**To enable an MFA device** After you ran the ``create-virtual-mfa-device`` command to create a new virtual MFA device, you can then assign this MFA device to a user. The following example assigns the MFA device with the serial number ``arn:aws:iam::210987654321:mfa/BobsMFADevice`` to the user ``Bob``. The command also synchronizes the device with AWS by including the first two codes in sequence from the virtual MFA device:: aws iam enable-mfa-device --user-name Bob --serial-number arn:aws:iam::210987654321:mfa/BobsMFADevice --authentication-code-1 123456 --authentication-code-2 789012 For more information, see `Using a Virtual MFA Device with AWS`_ in the *Using IAM* guide. .. _`Using a Virtual MFA Device with AWS`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.htmlawscli-1.14.44/awscli/examples/iam/get-account-summary.rst0000666454262600001440000000240513243367510024532 0ustar pysdk-ciamazon00000000000000**To get information about IAM entity usage and IAM quotas in the current account** The following ``get-account-summary`` command returns information about the current IAM entity usage and current IAM entity quotas in the account:: aws iam get-account-summary Output:: { "SummaryMap": { "UsersQuota": 5000, "GroupsQuota": 100, "InstanceProfiles": 6, "SigningCertificatesPerUserQuota": 2, "AccountAccessKeysPresent": 0, "RolesQuota": 250, "RolePolicySizeQuota": 10240, "AccountSigningCertificatesPresent": 0, "Users": 27, "ServerCertificatesQuota": 20, "ServerCertificates": 0, "AssumeRolePolicySizeQuota": 2048, "Groups": 7, "MFADevicesInUse": 1, "Roles": 3, "AccountMFAEnabled": 1, "MFADevices": 3, "GroupsPerUserQuota": 10, "GroupPolicySizeQuota": 5120, "InstanceProfilesQuota": 100, "AccessKeysPerUserQuota": 2, "Providers": 0, "UserPolicySizeQuota": 2048 } } For more information about entity limitations, see `Limitations on IAM Entities`_ in the *Using IAM* guide. .. _`Limitations on IAM Entities`: http://docs.aws.amazon.com/IAM/latest/UserGuide/LimitationsOnEntities.html awscli-1.14.44/awscli/examples/iam/list-users.rst0000666454262600001440000000136313243367510022742 0ustar pysdk-ciamazon00000000000000**To list IAM users** The following ``list-users`` command lists the IAM users in the current account:: aws iam list-users Output:: "Users": [ { "UserName": "Adele", "Path": "/", "CreateDate": "2013-03-07T05:14:48Z", "UserId": "AKIAI44QH8DHBEXAMPLE", "Arn": "arn:aws:iam::123456789012:user/Adele" }, { "UserName": "Bob", "Path": "/", "CreateDate": "2012-09-21T23:03:13Z", "UserId": "AKIAIOSFODNN7EXAMPLE", "Arn": "arn:aws:iam::123456789012:user/Bob" } ] For more information, see `Listing Users`_ in the *Using IAM* guide. .. _`Listing Users`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_GetListOfUsers.html awscli-1.14.44/awscli/examples/iam/delete-virtual-mfa-device.rst0000666454262600001440000000067613243367510025562 0ustar pysdk-ciamazon00000000000000**To remove a virtual MFA device** The following ``delete-virtual-mfa-device`` command removes the specified MFA device from the current account:: aws iam delete-virtual-mfa-device --serial-number arn:aws:iam::123456789012:mfa/MFATest For more information, see `Using a Virtual MFA Device with AWS`_ in the *Using IAM* guide. .. _`Using a Virtual MFA Device with AWS`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_VirtualMFA.html awscli-1.14.44/awscli/examples/iam/create-open-id-connect-provider.rst0000666454262600001440000000454513243367510026710 0ustar pysdk-ciamazon00000000000000**To create an OpenID Connect (OIDC) provider** To create an OpenID Connect (OIDC) provider, we recommend using the ``--cli-input-json`` parameter to pass a JSON file that contains the required parameters. When you create an OIDC provider, you must pass the URL of the provider, and the URL must begin with ``https://``. It can be difficult to pass the URL as a command line parameter, because the colon (:) and forward slash (/) characters have special meaning in some command line environments. Using the ``--cli-input-json`` parameter gets around this limitation. To use the ``--cli-input-json`` parameter, start by using the ``create-open-id-connect-provider`` command with the ``--generate-cli-skeleton`` parameter, as in the following example:: aws iam create-open-id-connect-provider --generate-cli-skeleton > create-open-id-connect-provider.json The previous command creates a JSON file called create-open-id-connect-provider.json that you can use to fill in the information for a subsequent ``create-open-id-connect-provider`` command. For example:: { "Url": "https://server.example.com", "ClientIDList": [ "example-application-ID" ], "ThumbprintList": [ "c3768084dfb3d2b68b7897bf5f565da8eEXAMPLE" ] } Next, to create the OpenID Connect (OIDC) provider, use the ``create-open-id-connect-provider`` command again, this time passing the ``--cli-input-json`` parameter to specify your JSON file. The following ``create-open-id-connect-provider`` command uses the ``--cli-input-json`` parameter with a JSON file called create-open-id-connect-provider.json:: aws iam create-open-id-connect-provider --cli-input-json file://create-open-id-connect-provider.json Output:: { "OpenIDConnectProviderArn": "arn:aws:iam::123456789012:oidc-provider/server.example.com" } For more information about OIDC providers, see `Using OpenID Connect Identity Providers`_ in the *Using IAM* guide. For more information about obtaining thumbprints for an OIDC provider, see `Obtaining the Thumbprint for an OpenID Connect Provider`_ in the *Using IAM* guide. .. _`Using OpenID Connect Identity Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc.html .. _`Obtaining the Thumbprint for an OpenID Connect Provider`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc-obtain-thumbprint.htmlawscli-1.14.44/awscli/examples/iam/attach-user-policy.rst0000666454262600001440000000077613243367510024354 0ustar pysdk-ciamazon00000000000000**To attach a managed policy to an IAM user** The following ``attach-user-policy`` command attaches the AWS managed policy named ``AdministratorAccess`` to the IAM user named ``Alice``:: aws iam attach-user-policy --policy-arn arn:aws:iam::aws:policy/AdministratorAccess --user-name Alice For more information, see `Managed Policies and Inline Policies`_ in the *Using IAM* guide. .. _`Managed Policies and Inline Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.htmlawscli-1.14.44/awscli/examples/iam/generate-credential-report.rst0000666454262600001440000000100113243367510026030 0ustar pysdk-ciamazon00000000000000**To generate a credential report** The following example attempts to generate a credential report for the AWS account:: aws iam generate-credential-report Output:: { "State": "STARTED", "Description": "No report exists. Starting a new report generation task" } For more information, see `Getting Credential Reports for Your AWS Account`_ in the *Using IAM* guide. .. _`Getting Credential Reports for Your AWS Account`: http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.htmlawscli-1.14.44/awscli/examples/iam/change-password.rst0000666454262600001440000000315113243367510023712 0ustar pysdk-ciamazon00000000000000**To change the password for your IAM user** To change the password for your IAM user, we recommend using the ``--cli-input-json`` parameter to pass a JSON file that contains your old and new passwords. Using this method, you can use strong passwords with non-alphanumeric characters. It can be difficult to use passwords with non-alphanumeric characters when you pass them as command line parameters. To use the ``--cli-input-json`` parameter, start by using the ``change-password`` command with the ``--generate-cli-skeleton`` parameter, as in the following example:: aws iam change-password --generate-cli-skeleton > change-password.json The previous command creates a JSON file called change-password.json that you can use to fill in your old and new passwords. For example, the file might look like this:: { "OldPassword": "3s0K_;xh4~8XXI", "NewPassword": "]35d/{pB9Fo9wJ" } Next, to change your password, use the ``change-password`` command again, this time passing the ``--cli-input-json`` parameter to specify your JSON file. The following ``change-password`` command uses the ``--cli-input-json`` parameter with a JSON file called change-password.json:: aws iam change-password --cli-input-json file://change-password.json This command can be called by IAM users only. If this command is called using AWS account (root) credentials, the command returns an ``InvalidUserType`` error. For more information, see `How IAM Users Change Their Own Password`_ in the *Using IAM* guide. .. _`How IAM Users Change Their Own Password`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingUserPwdSelf.htmlawscli-1.14.44/awscli/examples/iam/update-account-password-policy.rst0000666454262600001440000000135513243367510026702 0ustar pysdk-ciamazon00000000000000**To set or change the current account password policy** The following ``update-account-password-policy`` command sets the password policy to require a minimum length of eight characters and to require one or more numbers in the password:: aws iam update-account-password-policy --minimum-password-length 8 --require-numbers Changes to an account's password policy affect any new passwords that are created for IAM users in the account. Password policy changes do not affect existing passwords. For more information, see `Setting an Account Password Policy for IAM Users`_ in the *Using IAM* guide. .. _`Setting an Account Password Policy for IAM Users`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html awscli-1.14.44/awscli/examples/iam/update-assume-role-policy.rst0000666454262600001440000000130613243367510025636 0ustar pysdk-ciamazon00000000000000**To update the trust policy for an IAM role** The following ``update-assume-role-policy`` command updates the trust policy for the role named ``Test-Role``:: aws iam update-assume-role-policy --role-name Test-Role --policy-document file://Test-Role-Trust-Policy.json The trust policy is defined as a JSON document in the *Test-Role-Trust-Policy.json* file. (The file name and extension do not have significance.) The trust policy must specify a principal. To update the permissions policy for a role, use the ``put-role-policy`` command. For more information, see `Creating a Role`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html awscli-1.14.44/awscli/examples/iam/add-user-to-group.rst0000666454262600001440000000067513243367510024113 0ustar pysdk-ciamazon00000000000000**To add a user to an IAM group** The following ``add-user-to-group`` command adds an IAM user named ``Bob`` to the IAM group named ``Admins``:: aws iam add-user-to-group --user-name Bob --group-name Admins For more information, see `Adding and Removing Users in an IAM Group`_ in the *Using IAM* guide. .. _`Adding and Removing Users in an IAM Group`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_AddOrRemoveUsersFromGroup.html awscli-1.14.44/awscli/examples/iam/get-credential-report.rst0000666454262600001440000000075313243367510025032 0ustar pysdk-ciamazon00000000000000**To get a credential report** This example opens the returned report and outputs it to the pipeline as an array of text lines:: aws iam get-credential-report Output:: { "GeneratedTime": "2015-06-17T19:11:50Z", "ReportFormat": "text/csv" } For more information, see `Getting Credential Reports for Your AWS Account`_ in the *Using IAM* guide. .. _`Getting Credential Reports for Your AWS Account`: http://docs.aws.amazon.com/IAM/latest/UserGuide/credential-reports.htmlawscli-1.14.44/awscli/examples/iam/update-login-profile.rst0000666454262600001440000000157713243367510024665 0ustar pysdk-ciamazon00000000000000**To update the password for an IAM user** The following ``update-login-profile`` command creates a new password for the IAM user named ``Bob``:: aws iam update-login-profile --user-name Bob --password To set a password policy for the account, use the ``update-account-password-policy`` command. If the new password violates the account password policy, the command returns a ``PasswordPolicyViolation`` error. If the account password policy allows them to, IAM users can change their own passwords using the ``change-password`` command. Store the password in a secure place. If the password is lost, it cannot be recovered, and you must create a new one using the ``create-login-profile`` command. For more information, see `Managing Passwords`_ in the *Using IAM* guide. .. _`Managing Passwords`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html awscli-1.14.44/awscli/examples/iam/delete-group.rst0000666454262600001440000000052413243367510023222 0ustar pysdk-ciamazon00000000000000**To delete an IAM group** The following ``delete-group`` command deletes an IAM group named ``MyTestGroup``:: aws iam delete-group --group-name MyTestGroup For more information, see `Deleting an IAM Group`_ in the *Using IAM* guide. .. _`Deleting an IAM Group`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_DeleteGroup.htmlawscli-1.14.44/awscli/examples/iam/list-entities-for-policy.rst0000666454262600001440000000140413243367510025502 0ustar pysdk-ciamazon00000000000000**To list all users, groups, and roles that the specified managed policy is attached to** This example returns a list of IAM groups, roles, and users who have the policy ``arn:aws:iam::123456789012:policy/TestPolicy`` attached:: aws iam list-entities-for-policy --policy-arn arn:aws:iam::123456789012:policy/TestPolicy Output:: { "PolicyGroups": [ { "GroupName": "Admins" } ], "PolicyUsers": [ { "UserName": "Bob" } ], "PolicyRoles": [ { "RoleName": "testRole" } ], "IsTruncated": false } For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/get-saml-provider.rst0000666454262600001440000000117013243367510024165 0ustar pysdk-ciamazon00000000000000**To retrieve the SAML provider metadocument** This example retrieves the details about the SAML 2.0 provider whose ARM is ``arn:aws:iam::123456789012:saml-provider/SAMLADFS``. The response includes the metadata document that you got from the identity provider to create the AWS SAML provider entity as well as the creation and expiration dates:: aws iam get-saml-provider --saml-provider-arn arn:aws:iam::123456789012:saml-provider/SAMLADFS For more information, see `Using SAML Providers`_ in the *Using IAM* guide. .. _`Using SAML Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-saml.htmlawscli-1.14.44/awscli/examples/iam/create-access-key.rst0000666454262600001440000000151213243367510024114 0ustar pysdk-ciamazon00000000000000**To create an access key for an IAM user** The following ``create-access-key`` command creates an access key (access key ID and secret access key) for the IAM user named ``Bob``:: aws iam create-access-key --user-name Bob Output:: { "AccessKey": { "UserName": "Bob", "Status": "Active", "CreateDate": "2015-03-09T18:39:23.411Z", "SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY", "AccessKeyId": "AKIAIOSFODNN7EXAMPLE" } } Store the secret access key in a secure location. If it is lost, it cannot be recovered, and you must create a new access key. For more information, see `Managing Access Keys for IAM Users`_ in the *Using IAM* guide. .. _`Managing Access Keys for IAM Users`: http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingCredentials.htmlawscli-1.14.44/awscli/examples/iam/update-saml-provider.rst0000666454262600001440000000124413243367510024672 0ustar pysdk-ciamazon00000000000000**To update the metadata document for an existing SAML provider** This example updates the SAML provider in IAM whose ARN is ``arn:aws:iam::123456789012:saml-provider/SAMLADFS`` with a new SAML metadata document from the file ``SAMLMetaData.xml``:: aws iam update-saml-provider --saml-metadata-document file://SAMLMetaData.xml --saml-provider-arn arn:aws:iam::123456789012:saml-provider/SAMLADFS Output:: { "SAMLProviderArn": "arn:aws:iam::123456789012:saml-provider/SAMLADFS" } For more information, see `Using SAML Providers`_ in the *Using IAM* guide. .. _`Using SAML Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-saml.htmlawscli-1.14.44/awscli/examples/iam/create-group.rst0000666454262600001440000000112213243367510023216 0ustar pysdk-ciamazon00000000000000**To create an IAM group** The following ``create-group`` command creates an IAM group named ``Admins``:: aws iam create-group --group-name Admins Output:: { "Group": { "Path": "/", "CreateDate": "2015-03-09T20:30:24.940Z", "GroupId": "AIDGPMS9RO4H3FEXAMPLE", "Arn": "arn:aws:iam::123456789012:group/Admins", "GroupName": "Admins" } } For more information, see `Creating IAM Groups`_ in the *Using IAM* guide. .. _`Creating IAM Groups`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_CreatingAndListingGroups.htmlawscli-1.14.44/awscli/examples/iam/update-open-id-connect-provider-thumbprint.rst0000666454262600001440000000127213243367510031113 0ustar pysdk-ciamazon00000000000000**To replace the existing list of server certificate thumbprints with a new list** This example updates the certificate thumbprint list for the OIDC provider whose ARN is ``arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com`` to use a new thumbprint:: aws iam update-open-id-connect-provider-thumbprint --open-id-connect-provider-arn arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com --thumbprint-list 7359755EXAMPLEabc3060bce3EXAMPLEec4542a3 For more information, see `Using OpenID Connect Identity Providers`_ in the *Using IAM* guide. .. _`Using OpenID Connect Identity Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc.htmlawscli-1.14.44/awscli/examples/iam/list-signing-certificates.rst0000666454262600001440000000142413243367510025700 0ustar pysdk-ciamazon00000000000000**To list the signing certificates for an IAM user** The following ``list-signing-certificates`` command lists the signing certificates for the IAM user named ``Bob``:: aws iam list-signing-certificates --user-name Bob Output:: { "Certificates: "[ { "UserName": "Bob", "Status": "Inactive", "CertificateBody": "-----BEGIN CERTIFICATE----------END CERTIFICATE-----", "CertificateId": "TA7SMP42TDN5Z26OBPJE7EXAMPLE", "UploadDate": "2013-06-06T21:40:08Z" } ] } For more information, see `Creating and Uploading a User Signing Certificate`_ in the *Using IAM* guide. .. _`Creating and Uploading a User Signing Certificate`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_UploadCertificate.html awscli-1.14.44/awscli/examples/iam/list-account-aliases.rst0000666454262600001440000000063613243367510024656 0ustar pysdk-ciamazon00000000000000**To list account aliases** The following ``list-account-aliases`` command lists the aliases for the current account:: aws iam list-account-aliases Output:: "AccountAliases": [ "mycompany" ] For more information, see `Using an Alias for Your AWS Account ID`_ in the *Using IAM* guide. .. _`Using an Alias for Your AWS Account ID`: http://docs.aws.amazon.com/IAM/latest/UserGuide/AccountAlias.html awscli-1.14.44/awscli/examples/iam/delete-policy.rst0000666454262600001440000000061713243367510023370 0ustar pysdk-ciamazon00000000000000**To delete an IAM policy** This example deletes the policy whose ARN is ``arn:aws:iam::123456789012:policy/MySamplePolicy``:: aws iam delete-policy --policy-arn arn:aws:iam::123456789012:policy/MySamplePolicy For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/get-access-key-last-used.rst0000666454262600001440000000117413243367510025333 0ustar pysdk-ciamazon00000000000000**To retrieve information about when the specified access key was last used** The following example retrieves information about when the access key ``ABCDEXAMPLE`` was last used:: aws iam get-access-key-last-used --access-key-id ABCDEXAMPLE Output:: { "UserName": "Bob", "AccessKeyLastUsed": { "Region": "us-east-1", "ServiceName": "iam", "LastUsedDate": "2015-06-16T22:45:00Z" } } For more information, see `Managing Access Keys for IAM Users`_ in the *Using IAM* guide. .. _`Managing Access Keys for IAM Users`: http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingCredentials.htmlawscli-1.14.44/awscli/examples/iam/create-policy.rst0000666454262600001440000000242513243367510023370 0ustar pysdk-ciamazon00000000000000The following command creates a customer managed policy named ``my-policy``:: aws iam create-policy --policy-name my-policy --policy-document file://policy Output:: { "Policy": { "PolicyName": "my-policy", "CreateDate": "2015-06-01T19:31:18.620Z", "AttachmentCount": 0, "IsAttachable": true, "PolicyId": "ZXR6A36LTYANPAI7NJ5UV", "DefaultVersionId": "v1", "Path": "/", "Arn": "arn:aws:iam::0123456789012:policy/my-policy", "UpdateDate": "2015-06-01T19:31:18.620Z" } } The file ``policy`` is a JSON document in the current folder that grants read only access to the ``shared`` folder in an Amazon S3 bucket named ``my-bucket``:: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:Get*", "s3:List*" ], "Resource": [ "arn:aws:s3:::my-bucket/shared/*" ] }, ] } For more information on using files as input for string parameters, see `Specifying Parameter Values`_ in the *AWS CLI User Guide*. .. _`Specifying Parameter Values`: http://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html awscli-1.14.44/awscli/examples/iam/delete-role-policy.rst0000666454262600001440000000063113243367510024323 0ustar pysdk-ciamazon00000000000000**To remove a policy from an IAM role** The following ``delete-role-policy`` command removes the policy named ``ExamplePolicy`` from the role named ``Test-Role``:: aws iam delete-role-policy --role-name Test-Role --policy-name ExamplePolicy For more information, see `Creating a Role`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html awscli-1.14.44/awscli/examples/iam/list-policy-versions.rst0000666454262600001440000000144213243367510024744 0ustar pysdk-ciamazon00000000000000**To list information about the versions of the specified managed policy** This example returns the list of available versions of the policy whose ARN is ``arn:aws:iam::123456789012:policy/MySamplePolicy``:: aws iam list-policy-versions --policy-arn arn:aws:iam::123456789012:policy/MySamplePolicy Output:: { "IsTruncated": false, "Versions": [ { "CreateDate": "2015-06-02T23:19:44Z", "VersionId": "v2", "IsDefaultVersion": true }, { "CreateDate": "2015-06-02T22:30:47Z", "VersionId": "v1", "IsDefaultVersion": false } ] } For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/list-role-policies.rst0000666454262600001440000000112513243367510024343 0ustar pysdk-ciamazon00000000000000**To list the policies attached to an IAM role** The following ``list-role-policies`` command lists the names of the permissions policies for the specified IAM role:: aws iam list-role-policies --role-name Test-Role Output:: "PolicyNames": [ "ExamplePolicy" ] To see the trust policy attached to a role, use the ``get-role`` command. To see the details of a permissions policy, use the ``get-role-policy`` command. For more information, see `Creating a Role`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html awscli-1.14.44/awscli/examples/iam/create-user.rst0000666454262600001440000000115613243367510023047 0ustar pysdk-ciamazon00000000000000**To create an IAM user** The following ``create-user`` command creates an IAM user named ``Bob`` in the current account:: aws iam create-user --user-name Bob Output:: { "User": { "UserName": "Bob", "Path": "/", "CreateDate": "2013-06-08T03:20:41.270Z", "UserId": "AKIAIOSFODNN7EXAMPLE", "Arn": "arn:aws:iam::123456789012:user/Bob" } } For more information, see `Adding a New User to Your AWS Account`_ in the *Using IAM* guide. .. _`Adding a New User to Your AWS Account`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_SettingUpUser.html awscli-1.14.44/awscli/examples/iam/get-policy-version.rst0000666454262600001440000000151613243367510024367 0ustar pysdk-ciamazon00000000000000**To retrieve information about the specified version of the specified managed policy** This example returns the policy document for the v2 version of the policy whose ARN is ``arn:aws:iam::123456789012:policy/MyManagedPolicy``:: aws iam get-policy-version --policy-arn arn:aws:iam::123456789012:policy/MyPolicy --version-id v2 Output:: { "PolicyVersion": { "CreateDate": "2015-06-17T19:23;32Z", "VersionId": "v2", "Document": { "Version": "2012-10-17", "Statement": [ { "Action": "iam:*", "Resource": "*", "Effect": "Allow" } ] } "IsDefaultVersion": "false" } } For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/remove-user-from-group.rst0000666454262600001440000000073213243367510025173 0ustar pysdk-ciamazon00000000000000**To remove a user from an IAM group** The following ``remove-user-from-group`` command removes the user named ``Bob`` from the IAM group named ``Admins``:: aws iam remove-user-from-group --user-name Bob --group-name Admins For more information, see `Adding Users to and Removing Users from a Group`_ in the *Using IAM* guide. .. _`Adding Users to and Removing Users from a Group`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_AddOrRemoveUsersFromGroup.html awscli-1.14.44/awscli/examples/iam/put-group-policy.rst0000666454262600001440000000104413243367510024063 0ustar pysdk-ciamazon00000000000000**To add a policy to a group** The following ``put-group-policy`` command adds a policy to the IAM group named ``Admins``:: aws iam put-group-policy --group-name Admins --policy-document file://AdminPolicy.json --policy-name AdminRoot The policy is defined as a JSON document in the *AdminPolicy.json* file. (The file name and extension do not have significance.) For more information, see `Managing IAM Policies`_ in the *Using IAM* guide. .. _`Managing IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingPolicies.html awscli-1.14.44/awscli/examples/iam/get-instance-profile.rst0000666454262600001440000000216013243367510024643 0ustar pysdk-ciamazon00000000000000**To get information about an instance profile** The following ``get-instance-profile`` command gets information about the instance profile named ``ExampleInstanceProfile``:: aws iam get-instance-profile --instance-profile-name ExampleInstanceProfile Output:: { "InstanceProfile": { "InstanceProfileId": "AID2MAB8DPLSRHEXAMPLE", "Roles": [ { "AssumeRolePolicyDocument": "", "RoleId": "AIDGPMS9RO4H3FEXAMPLE", "CreateDate": "2013-01-09T06:33:26Z", "RoleName": "Test-Role", "Path": "/", "Arn": "arn:aws:iam::336924118301:role/Test-Role" } ], "CreateDate": "2013-06-12T23:52:02Z", "InstanceProfileName": "ExampleInstanceProfile", "Path": "/", "Arn": "arn:aws:iam::336924118301:instance-profile/ExampleInstanceProfile" } } For more information, see `Instance Profiles`_ in the *Using IAM* guide. .. _`Instance Profiles`: http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html awscli-1.14.44/awscli/examples/iam/list-saml-providers.rst0000666454262600001440000000110413243367510024541 0ustar pysdk-ciamazon00000000000000**To list the SAML providers in the AWS account** This example retrieves the list of SAML 2.0 providers created in the current AWS account:: aws iam list-saml-providers Output:: { "SAMLProviderList": [ { "CreateDate": "2015-06-05T22:45:14Z", "ValidUntil": "2015-06-05T22:45:14Z", "Arn": "arn:aws:iam::123456789012:saml-provider/SAMLADFS" } ] } For more information, see `Using SAML Providers`_ in the *Using IAM* guide. .. _`Using SAML Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-saml.htmlawscli-1.14.44/awscli/examples/iam/get-policy.rst0000666454262600001440000000152413243367510022703 0ustar pysdk-ciamazon00000000000000**To retrieve information about the specified managed policy** This example returns details about the managed policy whose ARN is ``arn:aws:iam::123456789012:policy/MySamplePolicy``:: aws iam get-policy --policy-arn arn:aws:iam::123456789012:policy/MySamplePolicy Output:: { "Policy": { "PolicyName": "MySamplePolicy", "CreateDate": "2015-06-17T19:23;32Z", "AttachmentCount": "0", "IsAttachable": "true", "PolicyId": "Z27SI6FQMGNQ2EXAMPLE1", "DefaultVersionId": "v1", "Path": "/", "Arn": "arn:aws:iam::123456789012:policy/MySamplePolicy", "UpdateDate": "2015-06-17T19:23:32Z" } } For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/list-instance-profiles-for-role.rst0000666454262600001440000000215713243367510026753 0ustar pysdk-ciamazon00000000000000**To list the instance profiles for an IAM role** The following ``list-instance-profiles-for-role`` command lists the instance profiles that are associated with the role ``Test-Role``:: aws iam list-instance-profiles-for-role --role-name Test-Role Output:: "InstanceProfiles": [ { "InstanceProfileId": "AIDGPMS9RO4H3FEXAMPLE", "Roles": [ { "AssumeRolePolicyDocument": "", "RoleId": "AIDACKCEVSQ6C2EXAMPLE", "CreateDate": "2013-06-07T20:42:15Z", "RoleName": "Test-Role", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/Test-Role" } ], "CreateDate": "2013-06-07T21:05:24Z", "InstanceProfileName": "ExampleInstanceProfile", "Path": "/", "Arn": "arn:aws:iam::123456789012:instance-profile/ExampleInstanceProfile" } ] For more information, see `Instance Profiles`_ in the *Using IAM* guide. .. _`Instance Profiles`: http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html awscli-1.14.44/awscli/examples/iam/detach-role-policy.rst0000666454262600001440000000077713243367510024324 0ustar pysdk-ciamazon00000000000000**To detach a policy from a role** This example removes the managed policy with the ARN ``arn:aws:iam::123456789012:policy/FederatedTesterAccessPolicy`` from the role called ``FedTesterRole``:: aws iam detach-role-policy --role-name FedTesterRole --policy-arn arn:aws:iam::123456789012:policy/FederatedTesterAccessPolicy For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/add-role-to-instance-profile.rst0000666454262600001440000000121213243367510026170 0ustar pysdk-ciamazon00000000000000**To add a role to an instance profile** The following ``add-role-to-instance-profile`` command adds the role named ``S3Access`` to the instance profile named ``Webserver``:: aws iam add-role-to-instance-profile --role-name S3Access --instance-profile-name Webserver To create an instance profile, use the ``create-instance-profile`` command. For more information, see `Using IAM Roles to Delegate Permissions to Applications that Run on Amazon EC2`_ in the *Using IAM* guide. .. _`Using IAM Roles to Delegate Permissions to Applications that Run on Amazon EC2`: http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-usingrole-ec2instance.htmlawscli-1.14.44/awscli/examples/iam/attach-role-policy.rst0000666454262600001440000000100213243367510024316 0ustar pysdk-ciamazon00000000000000**To attach a managed policy to an IAM role** The following ``attach-role-policy`` command attaches the AWS managed policy named ``ReadOnlyAccess`` to the IAM role named ``ReadOnlyRole``:: aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess --role-name ReadOnlyRole For more information, see `Managed Policies and Inline Policies`_ in the *Using IAM* guide. .. _`Managed Policies and Inline Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.htmlawscli-1.14.44/awscli/examples/iam/set-default-policy-version.rst0000666454262600001440000000101713243367510026021 0ustar pysdk-ciamazon00000000000000**To set the specified version of the specified policy as the policy's default version.** This example sets the ``v2`` version of the policy whose ARN is ``arn:aws:iam::123456789012:policy/MyPolicy`` as the default active version:: aws iam set-default-policy-version --policy-arn arn:aws:iam::123456789012:policy/MyPolicy --version-id v2 For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/update-signing-certificate.rst0000666454262600001440000000121213243367510026017 0ustar pysdk-ciamazon00000000000000**To activate or deactivate a signing certificate for an IAM user** The following ``update-signing-certificate`` command deactivates the specified signing certificate for the IAM user named ``Bob``:: aws iam update-signing-certificate --certificate-id TA7SMP42TDN5Z26OBPJE7EXAMPLE --status Inactive --user-name Bob To get the ID for a signing certificate, use the ``list-signing-certificates`` command. For more information, see `Creating and Uploading a User Signing Certificate`_ in the *Using IAM* guide. .. _`Creating and Uploading a User Signing Certificate`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_UploadCertificate.html awscli-1.14.44/awscli/examples/iam/get-account-password-policy.rst0000666454262600001440000000146413243367510026200 0ustar pysdk-ciamazon00000000000000**To see the current account password policy** The following ``get-account-password-policy`` command displays details about the password policy for the current account:: aws iam get-account-password-policy Output:: { "PasswordPolicy": { "AllowUsersToChangePassword": false, "RequireLowercaseCharacters": false, "RequireUppercaseCharacters": false, "MinimumPasswordLength": 8, "RequireNumbers": true, "RequireSymbols": true } } If no password policy is defined for the account, the command returns a ``NoSuchEntity`` error. For more information, see `Managing an IAM Password Policy`_ in the *Using IAM* guide. .. _`Managing an IAM Password Policy`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html awscli-1.14.44/awscli/examples/iam/detach-group-policy.rst0000666454262600001440000000074413243367510024511 0ustar pysdk-ciamazon00000000000000**To detach a policy from a group** This example removes the managed policy with the ARN ``arn:aws:iam::123456789012:policy/TesterAccessPolicy`` from the group called ``Testers``:: aws iam detach-group-policy --group-name Testers --policy-arn arn:aws:iam::123456789012:policy/TesterAccessPolicy For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/list-group-policies.rst0000666454262600001440000000106113243367510024535 0ustar pysdk-ciamazon00000000000000**To list all inline policies that are attached to the specified group** The following ``list-group-policies`` command lists the names of inline policies that are attached to the IAM group named ``Admins`` in the current account:: aws iam list-group-policies --group-name Admins Output:: { "PolicyNames": [ "AdminRoot", "ExamplePolicy" ] } For more information, see `Managing IAM Policies`_ in the *Using IAM* guide. .. _`Managing IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingPolicies.html awscli-1.14.44/awscli/examples/iam/get-group-policy.rst0000666454262600001440000000155513243367510024041 0ustar pysdk-ciamazon00000000000000**To get information about a policy attached to an IAM group** The following ``get-group-policy`` command gets information about the specified policy attached to the group named ``Test-Group``:: aws iam get-group-policy --group-name Test-Group --policy-name S3-ReadOnly-Policy Output:: { "GroupName": "Test-Group", "PolicyDocument": { "Statement": [ { "Action": [ "s3:Get*", "s3:List*" ], "Resource": "*", "Effect": "Allow" } ] }, "PolicyName": "S3-ReadOnly-Policy" } For more information, see `Managing IAM Policies`_ in the *Using IAM* guide. .. _`Managing IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingPolicies.html awscli-1.14.44/awscli/examples/iam/list-roles.rst0000666454262600001440000000272313243367510022726 0ustar pysdk-ciamazon00000000000000**To list IAM roles for the current account** The following ``list-roles`` command lists IAM roles for the current account:: aws iam list-roles Output:: { "Roles": [ { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": "sts:AssumeRole", "Principal": { "Service": "ec2.amazonaws.com" }, "Effect": "Allow", "Sid": "" } ] }, "RoleId": "AROAJ52OTH4H7LEXAMPLE", "CreateDate": "2013-05-11T00:02:27Z", "RoleName": "ExampleRole1", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/ExampleRole1" }, { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": "sts:AssumeRole", "Principal": { "Service": "elastictranscoder.amazonaws.com" }, "Effect": "Allow", "Sid": "" } ] }, "RoleId": "AROAI4QRP7UFT7EXAMPLE", "CreateDate": "2013-04-18T05:01:58Z", "RoleName": "emr-access", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/emr-access" } ] } For more information, see `Creating a Role`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html awscli-1.14.44/awscli/examples/iam/delete-group-policy.rst0000666454262600001440000000077213243367510024524 0ustar pysdk-ciamazon00000000000000**To delete a policy from an IAM group** The following ``delete-group-policy`` command deletes the policy named ``ExamplePolicy`` from the group named ``Admins``:: aws iam delete-group-policy --group-name Admins --policy-name ExamplePolicy To see the policies attached to a group, use the ``list-group-policies`` command. For more information, see `Managing IAM Policies`_ in the *Using IAM* guide. .. _`Managing IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/ManagingPolicies.html awscli-1.14.44/awscli/examples/iam/delete-open-id-connect-provider.rst0000666454262600001440000000101613243367510026675 0ustar pysdk-ciamazon00000000000000**To delete an IAM OpenID Connect identity provider** This example deletes the IAM OIDC provider that connects to the provider ``example.oidcprovider.com``:: aws aim delete-open-id-connect-provider --open-id-connect-provider-arn arn:aws:iam::123456789012:oidc-provider/example.oidcprovider.com For more information, see `Using OpenID Connect Identity Providers`_ in the *Using IAM* guide. .. _`Using OpenID Connect Identity Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_CreatingAndListingGroups.htmlawscli-1.14.44/awscli/examples/iam/get-role-policy.rst0000666454262600001440000000164013243367510023641 0ustar pysdk-ciamazon00000000000000**To get information about a policy attached to an IAM role** The following ``get-role-policy`` command gets information about the specified policy attached to the role named ``Test-Role``:: aws iam get-role-policy --role-name Test-Role --policy-name ExamplePolicy Output:: { "RoleName": "Test-Role", "PolicyDocument": { "Statement": [ { "Action": [ "s3:ListBucket", "s3:Put*", "s3:Get*", "s3:*MultipartUpload*" ], "Resource": "*", "Effect": "Allow", "Sid": "1" } ] } "PolicyName": "ExamplePolicy" } For more information, see `Creating a Role`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html awscli-1.14.44/awscli/examples/iam/get-open-id-connect-provider.rst0000666454262600001440000000145013243367510026214 0ustar pysdk-ciamazon00000000000000**To return information about the specified OpenID Connect provider** This example returns details about the OpenID Connect provider whose ARN is ``arn:aws:iam::123456789012:oidc-provider/server.example.com``:: aws iam get-open-id-connect-provider --open-id-connect-provider-arn arn:aws:iam::123456789012:oidc-provider/server.example.com Output:: { "Url": "server.example.com" "CreateDate": "2015-06-16T19:41:48Z", "ThumbprintList": [ "12345abcdefghijk67890lmnopqrst987example" ], "ClientIDList": [ "example-application-ID" ] } For more information, see `Using OpenID Connect Identity Providers`_ in the *Using IAM* guide. .. _`Using OpenID Connect Identity Providers`: http://docs.aws.amazon.com/IAM/latest/UserGuide/identity-providers-oidc.htmlawscli-1.14.44/awscli/examples/iam/create-instance-profile.rst0000666454262600001440000000163113243367510025331 0ustar pysdk-ciamazon00000000000000**To create an instance profile** The following ``create-instance-profile`` command creates an instance profile named ``Webserver``:: aws iam create-instance-profile --instance-profile-name Webserver Output:: { "InstanceProfile": { "InstanceProfileId": "AIPAJMBYC7DLSPEXAMPLE", "Roles": [], "CreateDate": "2015-03-09T20:33:19.626Z", "InstanceProfileName": "Webserver", "Path": "/", "Arn": "arn:aws:iam::123456789012:instance-profile/Webserver" } } To add a role to an instance profile, use the ``add-role-to-instance-profile`` command. For more information, see `Using IAM Roles to Delegate Permissions to Applications that Run on Amazon EC2`_ in the *Using IAM* guide. .. _`Using IAM Roles to Delegate Permissions to Applications that Run on Amazon EC2`: http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-usingrole-ec2instance.htmlawscli-1.14.44/awscli/examples/iam/list-policies.rst0000666454262600001440000000240313243367510023404 0ustar pysdk-ciamazon00000000000000**To list managed policies that are available to your AWS account** This example returns a collection of the first two managed policies available in the current AWS account:: aws iam list-policies --max-items 2 Output:: { "Marker": "AAIWFnoA2MQ9zN9nnTorukxr1uesDIDa4u+q1mEfaurCDZ1AuCYagYfayKYGvu75BEGk8PooPsw5uvumkuizFACZ8f4rKtN1RuBWiVDBWet2OA==", "IsTruncated": true, "Policies": [ { "PolicyName": "AdministratorAccess", "CreateDate": "2015-02-06T18:39:46Z", "AttachmentCount": 5, "IsAttachable": true, "PolicyId": "ANPAIWMBCKSKIEE64ZLYK", "DefaultVersionId": "v1", "Path": "/", "Arn": "arn:aws:iam::aws:policy/AdministratorAccess", "UpdateDate": "2015-02-06T18:39:46Z" }, { "PolicyName": "ASamplePolicy", "CreateDate": "2015-06-17T19:23;32Z", "AttachmentCount": "0", "IsAttachable": "true", "PolicyId": "Z27SI6FQMGNQ2EXAMPLE1", "DefaultVersionId": "v1", "Path": "/", "Arn": "arn:aws:iam::123456789012:policy/ASamplePolicy", "UpdateDate": "2015-06-17T19:23:32Z" } ] } For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/iam/create-policy-version.rst0000666454262600001440000000133513243367510025052 0ustar pysdk-ciamazon00000000000000**To create a new version of a managed policy** This example creates a new ``v2`` version of the IAM policy whose ARN is ``arn:aws:iam::123456789012:policy/MyPolicy`` and makes it the default version:: aws iam create-policy-version --policy-arn arn:aws:iam::123456789012:policy/MyPolicy --policy-document file://NewPolicyVersion.json --set-as-default Output:: { "PolicyVersion": { "CreateDate": "2015-06-16T18:56:03.721Z", "VersionId": "v2", "IsDefaultVersion": true } } For more information, see `Versioning for Managed Policies`_ in the *Using IAM* guide. .. _`Versioning for Managed Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_managed-versioning.htmlawscli-1.14.44/awscli/examples/iam/get-role.rst0000666454262600001440000000142513243367510022345 0ustar pysdk-ciamazon00000000000000**To get information about an IAM role** The following ``get-role`` command gets information about the role named ``Test-Role``:: aws iam get-role --role-name Test-Role Output:: { "Role": { "AssumeRolePolicyDocument": "", "RoleId": "AIDIODR4TAW7CSEXAMPLE", "CreateDate": "2013-04-18T05:01:58Z", "RoleName": "Test-Role", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/Test-Role" } } The command displays the trust policy attached to the role. To list the permissions policies attached to a role, use the ``list-role-policies`` command. For more information, see `Creating a Role`_ in the *Using IAM* guide. .. _`Creating a Role`: http://docs.aws.amazon.com/IAM/latest/UserGuide/creating-role.html awscli-1.14.44/awscli/examples/iam/list-instance-profiles.rst0000666454262600001440000000444213243367510025227 0ustar pysdk-ciamazon00000000000000**To lists the instance profiles for the account** The following ``list-instance-profiles`` command lists the instance profiles that are associated with the current account:: aws iam list-instance-profiles Output:: { "InstanceProfiles": [ { "InstanceProfileId": "AIPAIXEU4NUHUPEXAMPLE", "Roles": [ { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": "sts:AssumeRole", "Principal": { "Service": "ec2.amazonaws.com" }, "Effect": "Allow", "Sid": "" } ] }, "RoleId": "AROAJ52OTH4H7LEXAMPLE", "CreateDate": "2013-05-11T00:02:27Z", "RoleName": "example-role", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/example-role" } ], "CreateDate": "2013-05-11T00:02:27Z", "InstanceProfileName": "ExampleInstanceProfile", "Path": "/", "Arn": "arn:aws:iam::123456789012:instance-profile/ExampleInstanceProfile" }, { "InstanceProfileId": "AIPAJVJVNRIQFREXAMPLE", "Roles": [ { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": "sts:AssumeRole", "Principal": { "Service": "ec2.amazonaws.com" }, "Effect": "Allow", "Sid": "" } ] }, "RoleId": "AROAINUBC5O7XLEXAMPLE", "CreateDate": "2013-01-09T06:33:26Z", "RoleName": "s3-test-role", "Path": "/", "Arn": "arn:aws:iam::123456789012:role/s3-test-role" } ], "CreateDate": "2013-06-12T23:52:02Z", "InstanceProfileName": "ExampleInstanceProfile2", "Path": "/", "Arn": "arn:aws:iam::123456789012:instance-profile/ExampleInstanceProfile2" }, ] } For more information, see `Instance Profiles`_ in the *Using IAM* guide. .. _`Instance Profiles`: http://docs.aws.amazon.com/IAM/latest/UserGuide/instance-profiles.html awscli-1.14.44/awscli/examples/iam/list-groups-for-user.rst0000666454262600001440000000160013243367510024652 0ustar pysdk-ciamazon00000000000000**To list the groups that an IAM user belongs to** The following ``list-groups-for-user`` command displays the groups that the IAM user named ``Bob`` belongs to:: aws iam list-groups-for-user --user-name Bob Output:: "Groups": [ { "Path": "/", "CreateDate": "2013-05-06T01:18:08Z", "GroupId": "AKIAIOSFODNN7EXAMPLE", "Arn": "arn:aws:iam::123456789012:group/Admin", "GroupName": "Admin" }, { "Path": "/", "CreateDate": "2013-05-06T01:37:28Z", "GroupId": "AKIAI44QH8DHBEXAMPLE", "Arn": "arn:aws:iam::123456789012:group/s3-Users", "GroupName": "s3-Users" } ] For more information, see `Creating and Listing Groups`_ in the *Using IAM* guide. .. _`Creating and Listing Groups`: http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_CreatingAndListingGroups.html awscli-1.14.44/awscli/examples/iam/detach-user-policy.rst0000666454262600001440000000070613243367510024331 0ustar pysdk-ciamazon00000000000000**To detach a policy from a user** This example removes the managed policy with the ARN ``arn:aws:iam::123456789012:policy/TesterPolicy`` from the user ``Bob``:: aws iam detach-user-policy --user-name Bob --policy-arn arn:aws:iam::123456789012:policy/TesterPolicy For more information, see `Overview of IAM Policies`_ in the *Using IAM* guide. .. _`Overview of IAM Policies`: http://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.htmlawscli-1.14.44/awscli/examples/codecommit/0000777454262600001440000000000013243367512021452 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/codecommit/delete-branch.rst0000666454262600001440000000047013243367510024700 0ustar pysdk-ciamazon00000000000000**To delete a branch** This example shows how to delete a branch in an AWS CodeCommit repository. Command:: aws codecommit delete-branch --repository-name MyDemoRepo --branch-name MyNewBranch Output:: { "branch": { "commitId": "317f8570EXAMPLE", "branchName": "MyNewBranch" } }awscli-1.14.44/awscli/examples/codecommit/list-repositories.rst0000666454262600001440000000074313243367510025706 0ustar pysdk-ciamazon00000000000000**To view a list of repositories** This example lists all AWS CodeCommit repositories associated with the user's AWS account. Command:: aws codecommit list-repositories Output:: { "repositories": [ { "repositoryName": "MyDemoRepo" "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", }, { "repositoryName": "MyOtherDemoRepo" "repositoryId": "cfc29ac4-b0cb-44dc-9990-f6f51EXAMPLE" } ] }awscli-1.14.44/awscli/examples/codecommit/create-branch.rst0000666454262600001440000000043713243367510024704 0ustar pysdk-ciamazon00000000000000**To create a branch** This example creates a branch in an AWS CodeCommit repository. This command produces output only if there are errors. Command:: aws codecommit create-branch --repository-name MyDemoRepo --branch-name MyNewBranch --commit-id 317f8570EXAMPLE Output:: None. awscli-1.14.44/awscli/examples/codecommit/create-repository.rst0000666454262600001440000000143713243367510025667 0ustar pysdk-ciamazon00000000000000**To create a repository** This example creates a repository and associates it with the user's AWS account. Command:: aws codecommit create-repository --repository-name MyDemoRepo --repository-description "My demonstration repository" Output:: { "repositoryMetadata": { "repositoryName": "MyDemoRepo", "cloneUrlSsh": "ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo", "lastModifiedDate": 1444766838.027, "repositoryDescription": "My demonstration repository", "cloneUrlHttp": "https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo", "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", "Arn": "arn:aws:codecommit:us-east-1:111111111111EXAMPLE:MyDemoRepo", "accountId": "111111111111" } }awscli-1.14.44/awscli/examples/codecommit/delete-repository.rst0000666454262600001440000000036413243367510025664 0ustar pysdk-ciamazon00000000000000**To delete a repository** This example shows how to delete an AWS CodeCommit repository. Command:: aws codecommit delete-repository --repository-name MyDemoRepo Output:: { "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE" }awscli-1.14.44/awscli/examples/codecommit/update-default-branch.rst0000666454262600001440000000047013243367510026342 0ustar pysdk-ciamazon00000000000000**To change the default branch for a repository** This example changes the default branch for an AWS CodeCommit repository. This command produces output only if there are errors. Command:: aws codecommit update-default-branch --repository-name MyDemoRepo --default-branch-name MyNewBranch Output:: None.awscli-1.14.44/awscli/examples/codecommit/update-repository-name.rst0000666454262600001440000000122413243367510026616 0ustar pysdk-ciamazon00000000000000**To change the name of a repository** This example changes the name of an AWS CodeCommit repository. This command produces output only if there are errors. Changing the name of the AWS CodeCommit repository will change the SSH and HTTPS URLs that users need to connect to the repository. Users will not be able to connect to this repository until they update their connection settings. Also, because the repository's ARN will change, changing the repository name will invalidate any IAM user policies that rely on this repository's ARN. Command:: aws codecommit update-repository-name --old-name MyDemoRepo --new-name MyRenamedDemoRepo Output:: None.awscli-1.14.44/awscli/examples/codecommit/update-repository-description.rst0000666454262600001440000000052013243367510030217 0ustar pysdk-ciamazon00000000000000**To change the description for a repository** This example changes the description for an AWS CodeCommit repository. This command produces output only if there are errors. Command:: aws codecommit update-repository-description --repository-name MyDemoRepo --repository-description "This description was changed" Output:: None.awscli-1.14.44/awscli/examples/codecommit/get-branch.rst0000666454262600001440000000051213243367510024212 0ustar pysdk-ciamazon00000000000000**To get information about a branch** This example gets information about a branch in an AWS CodeCommit repository. Command:: aws codecommit get-branch --repository-name MyDemoRepo --branch-name MyNewBranch Output:: { "BranchInfo": { "commitID": "317f8570EXAMPLE", "branchName": "MyNewBranch" } } awscli-1.14.44/awscli/examples/codecommit/list-branches.rst0000666454262600001440000000040413243367510024736 0ustar pysdk-ciamazon00000000000000**To view a list of branch names** This example lists all branch names in an AWS CodeCommit repository. Command:: aws codecommit list-branches --repository-name MyDemoRepo Output:: { "branches": [ "MyNewBranch", "master" ] } awscli-1.14.44/awscli/examples/codecommit/get-repository.rst0000666454262600001440000000153613243367510025203 0ustar pysdk-ciamazon00000000000000**To get information about a repository** This example shows details about an AWS CodeCommit repository. Command:: aws codecommit get-repository --repository-name MyDemoRepo Output:: { "repositoryMetadata": { "creationDate": 1429203623.625, "defaultBranch": "master", "repositoryName": "MyDemoRepo", "cloneUrlSsh": "ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/v1/repos/MyDemoRepo", "lastModifiedDate": 1430783812.0869999, "repositoryDescription": "My demonstration repository", "cloneUrlHttp": "https://codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo", "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", "Arn": "arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo "accountId": "111111111111" } } awscli-1.14.44/awscli/examples/codecommit/batch-get-repositories.rst0000666454262600001440000000333413243367510026570 0ustar pysdk-ciamazon00000000000000**To view details about multiple repositories** This example shows details about multiple AWS CodeCommit repositories. Command:: aws codecommit batch-get-repositories --repository-names MyDemoRepo MyOtherDemoRepo Output:: { "repositories": [ { "creationDate": 1429203623.625, "defaultBranch": "master", "repositoryName": "MyDemoRepo", "cloneUrlSsh": "ssh://ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos//v1/repos/MyDemoRepo", "lastModifiedDate": 1430783812.0869999, "repositoryDescription": "My demonstration repository", "cloneUrlHttp": "https://codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo", "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", "Arn": "arn:aws:codecommit:us-east-1:111111111111EXAMPLE:MyDemoRepo", "accountId": "111111111111" }, { "creationDate": 1429203623.627, "defaultBranch": "master", "repositoryName": "MyOtherDemoRepo", "cloneUrlSsh": "ssh://ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos//v1/repos/MyOtherDemoRepo", "lastModifiedDate": 1430783812.0889999, "repositoryDescription": "My other demonstration repository", "cloneUrlHttp": "https://codecommit.us-east-1.amazonaws.com/v1/repos/MyOtherDemoRepo", "repositoryId": "cfc29ac4-b0cb-44dc-9990-f6f51EXAMPLE", "Arn": "arn:aws:codecommit:us-east-1:111111111111EXAMPLE:MyOtherDemoRepo", "accountId": "111111111111" } ], "repositoriesNotFound": [] }awscli-1.14.44/awscli/examples/sqs/0000777454262600001440000000000013243367512020135 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/sqs/list-queues.rst0000666454262600001440000000142513243367510023147 0ustar pysdk-ciamazon00000000000000**To list queues** This example lists all queues. Command:: aws sqs list-queues Output:: { "QueueUrls": [ "https://queue.amazonaws.com/80398EXAMPLE/MyDeadLetterQueue", "https://queue.amazonaws.com/80398EXAMPLE/MyQueue", "https://queue.amazonaws.com/80398EXAMPLE/MyOtherQueue", "https://queue.amazonaws.com/80398EXAMPLE/TestQueue1", "https://queue.amazonaws.com/80398EXAMPLE/TestQueue2" ] } This example lists only queues that start with "My". Command:: aws sqs list-queues --queue-name-prefix My Output:: { "QueueUrls": [ "https://queue.amazonaws.com/80398EXAMPLE/MyDeadLetterQueue", "https://queue.amazonaws.com/80398EXAMPLE/MyQueue", "https://queue.amazonaws.com/80398EXAMPLE/MyOtherQueue" ] }awscli-1.14.44/awscli/examples/sqs/change-message-visibility-batch.rst0000666454262600001440000000143113243367510026777 0ustar pysdk-ciamazon00000000000000**To change multiple messages' timeout visibilities as a batch** This example changes the 2 specified messages' timeout visibilities to 10 hours (10 hours * 60 minutes * 60 seconds). Command:: aws sqs change-message-visibility-batch --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --entries file://change-message-visibility-batch.json Input file (change-message-visibility-batch.json):: [ { "Id": "FirstMessage", "ReceiptHandle": "AQEBhz2q...Jf3kaw==", "VisibilityTimeout": 36000 }, { "Id": "SecondMessage", "ReceiptHandle": "AQEBkTUH...HifSnw==", "VisibilityTimeout": 36000 } ] Output:: { "Successful": [ { "Id": "SecondMessage" }, { "Id": "FirstMessage" } ] } awscli-1.14.44/awscli/examples/sqs/send-message.rst0000666454262600001440000000153313243367510023242 0ustar pysdk-ciamazon00000000000000**To send a message** This example sends a message with the specified message body, delay period, and message attributes, to the specified queue. Command:: aws sqs send-message --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --message-body "Information about the largest city in Any Region." --delay-seconds 10 --message-attributes file://send-message.json Input file (send-message.json):: { "City": { "DataType": "String", "StringValue": "Any City" }, "Greeting": { "DataType": "Binary", "BinaryValue": "Hello, World!" }, "Population": { "DataType": "Number", "StringValue": "1250800" } } Output:: { "MD5OfMessageBody": "51b0a325...39163aa0", "MD5OfMessageAttributes": "00484c68...59e48f06", "MessageId": "da68f62c-0c07-4bee-bf5f-7e856EXAMPLE" } awscli-1.14.44/awscli/examples/sqs/change-message-visibility.rst0000666454262600001440000000054713243367510025727 0ustar pysdk-ciamazon00000000000000**To change a message's timeout visibility** This example changes the specified message's timeout visibility to 10 hours (10 hours * 60 minutes * 60 seconds). Command:: aws sqs change-message-visibility --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --receipt-handle AQEBTpyI...t6HyQg== --visibility-timeout 36000 Output:: None.awscli-1.14.44/awscli/examples/sqs/remove-permission.rst0000666454262600001440000000042213243367510024346 0ustar pysdk-ciamazon00000000000000**To remove a permission** This example removes the permission with the specified label from the specified queue. Command:: aws sqs remove-permission --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --label SendMessagesFromMyQueue Output:: None.awscli-1.14.44/awscli/examples/sqs/delete-message.rst0000666454262600001440000000034613243367510023554 0ustar pysdk-ciamazon00000000000000**To delete a message** This example deletes the specified message. Command:: aws sqs delete-message --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --receipt-handle AQEBRXTo...q2doVA== Output:: None.awscli-1.14.44/awscli/examples/sqs/get-queue-url.rst0000666454262600001440000000032313243367510023364 0ustar pysdk-ciamazon00000000000000**To get a queue URL** This example gets the specified queue's URL. Command:: aws sqs get-queue-url --queue-name MyQueue Output:: { "QueueUrl": "https://queue.amazonaws.com/80398EXAMPLE/MyQueue" }awscli-1.14.44/awscli/examples/sqs/send-message-batch.rst0000666454262600001440000000421113243367510024315 0ustar pysdk-ciamazon00000000000000**To send multiple messages as a batch** This example sends 2 messages with the specified message bodies, delay periods, and message attributes, to the specified queue. Command:: aws sqs send-message-batch --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --entries file://send-message-batch.json Input file (send-message-batch.json):: [ { "Id": "FuelReport-0001-2015-09-16T140731Z", "MessageBody": "Fuel report for account 0001 on 2015-09-16 at 02:07:31 PM.", "DelaySeconds": 10, "MessageAttributes": { "SellerName": { "DataType": "String", "StringValue": "Example Store" }, "City": { "DataType": "String", "StringValue": "Any City" }, "Region": { "DataType": "String", "StringValue": "WA" }, "PostalCode": { "DataType": "String", "StringValue": "99065" }, "PricePerGallon": { "DataType": "Number", "StringValue": "1.99" } } }, { "Id": "FuelReport-0002-2015-09-16T140930Z", "MessageBody": "Fuel report for account 0002 on 2015-09-16 at 02:09:30 PM.", "DelaySeconds": 10, "MessageAttributes": { "SellerName": { "DataType": "String", "StringValue": "Example Fuels" }, "City": { "DataType": "String", "StringValue": "North Town" }, "Region": { "DataType": "String", "StringValue": "WA" }, "PostalCode": { "DataType": "String", "StringValue": "99123" }, "PricePerGallon": { "DataType": "Number", "StringValue": "1.87" } } } ] Output:: { "Successful": [ { "MD5OfMessageBody": "203c4a38...7943237e", "MD5OfMessageAttributes": "10809b55...baf283ef", "Id": "FuelReport-0001-2015-09-16T140731Z", "MessageId": "d175070c-d6b8-4101-861d-adeb3EXAMPLE" }, { "MD5OfMessageBody": "2cf0159a...c1980595", "MD5OfMessageAttributes": "55623928...ae354a25", "Id": "FuelReport-0002-2015-09-16T140930Z", "MessageId": "f9b7d55d-0570-413e-b9c5-a9264EXAMPLE" } ] } awscli-1.14.44/awscli/examples/sqs/receive-message.rst0000666454262600001440000000373313243367510023737 0ustar pysdk-ciamazon00000000000000**To receive a message** This example receives up to 10 available messages, returning all available attributes. Command:: aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --attribute-names All --message-attribute-names All --max-number-of-messages 10 Output:: { "Messages": [ { "Body": "My first message.", "ReceiptHandle": "AQEBzbVv...fqNzFw==", "MD5OfBody": "1000f835...a35411fa", "MD5OfMessageAttributes": "9424c491...26bc3ae7", "MessageId": "d6790f8d-d575-4f01-bc51-40122EXAMPLE", "Attributes": { "ApproximateFirstReceiveTimestamp": "1442428276921", "SenderId": "AIDAIAZKMSNQ7TEXAMPLE", "ApproximateReceiveCount": "5", "SentTimestamp": "1442428276921" }, "MessageAttributes": { "PostalCode": { "DataType": "String", "StringValue": "ABC123" }, "City": { "DataType": "String", "StringValue": "Any City" } } } ] } This example receives the next available message, returning only the SenderId and SentTimestamp attributes as well as the PostalCode message attribute. Command:: aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --attribute-names SenderId SentTimestamp --message-attribute-names PostalCode Output:: { "Messages": [ { "Body": "My first message.", "ReceiptHandle": "AQEB6nR4...HzlvZQ==", "MD5OfBody": "1000f835...a35411fa", "MD5OfMessageAttributes": "b8e89563...e088e74f", "MessageId": "d6790f8d-d575-4f01-bc51-40122EXAMPLE", "Attributes": { "SenderId": "AIDAIAZKMSNQ7TEXAMPLE", "SentTimestamp": "1442428276921" }, "MessageAttributes": { "PostalCode": { "DataType": "String", "StringValue": "ABC123" } } } ] }awscli-1.14.44/awscli/examples/sqs/list-dead-letter-source-queues.rst0000666454262600001440000000065513243367510026641 0ustar pysdk-ciamazon00000000000000**To list dead letter source queues** This example lists the queues that are associated with the specified dead letter source queue. Command:: aws sqs list-dead-letter-source-queues --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyDeadLetterQueue Output:: { "queueUrls": [ "https://queue.amazonaws.com/80398EXAMPLE/MyQueue", "https://queue.amazonaws.com/80398EXAMPLE/MyOtherQueue" ] }awscli-1.14.44/awscli/examples/sqs/delete-queue.rst0000666454262600001440000000030013243367510023242 0ustar pysdk-ciamazon00000000000000**To delete a queue** This example deletes the specified queue. Command:: aws sqs delete-queue --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewerQueue Output:: None.awscli-1.14.44/awscli/examples/sqs/get-queue-attributes.rst0000666454262600001440000000236613243367510024761 0ustar pysdk-ciamazon00000000000000**To get a queue's attributes** This example gets all of the specified queue's attributes. Command:: aws sqs get-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --attribute-names All Output:: { "Attributes": { "ApproximateNumberOfMessagesNotVisible": "0", "RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:us-east-1:80398EXAMPLE:MyDeadLetterQueue\",\"maxReceiveCount\":1000}", "MessageRetentionPeriod": "345600", "ApproximateNumberOfMessagesDelayed": "0", "MaximumMessageSize": "262144", "CreatedTimestamp": "1442426968", "ApproximateNumberOfMessages": "0", "ReceiveMessageWaitTimeSeconds": "0", "DelaySeconds": "0", "VisibilityTimeout": "30", "LastModifiedTimestamp": "1442426968", "QueueArn": "arn:aws:sqs:us-east-1:80398EXAMPLE:MyNewQueue" } } This example gets only the specified queue's maximum message size and visibility timeout attributes. Command:: aws sqs get-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewQueue --attribute-names MaximumMessageSize VisibilityTimeout Output:: { "Attributes": { "VisibilityTimeout": "30", "MaximumMessageSize": "262144" } } awscli-1.14.44/awscli/examples/sqs/add-permission.rst0000666454262600001440000000051513243367510023604 0ustar pysdk-ciamazon00000000000000**To add a permission to a queue** This example enables the specified AWS account to send messages to the specified queue. Command:: aws sqs add-permission --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --label SendMessagesFromMyQueue --aws-account-ids 12345EXAMPLE --actions SendMessage Output:: None.awscli-1.14.44/awscli/examples/sqs/delete-message-batch.rst0000666454262600001440000000112213243367510024624 0ustar pysdk-ciamazon00000000000000**To delete multiple messages as a batch** This example deletes the specified messages. Command:: aws sqs delete-message-batch --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --entries file://delete-message-batch.json Input file (delete-message-batch.json):: [ { "Id": "FirstMessage", "ReceiptHandle": "AQEB1mgl...Z4GuLw==" }, { "Id": "SecondMessage", "ReceiptHandle": "AQEBLsYM...VQubAA==" } ] Output:: { "Successful": [ { "Id": "FirstMessage" }, { "Id": "SecondMessage" } ] }awscli-1.14.44/awscli/examples/sqs/purge-queue.rst0000666454262600001440000000031413243367510023127 0ustar pysdk-ciamazon00000000000000**To purge a queue** This example deletes all messages in the specified queue. Command:: aws sqs purge-queue --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewQueue Output:: None.awscli-1.14.44/awscli/examples/sqs/set-queue-attributes.rst0000666454262600001440000000173513243367510024774 0ustar pysdk-ciamazon00000000000000**To set queue attributes** This example sets the specified queue to a delivery delay of 10 seconds, a maximum message size of 128 KB (128 KB * 1,024 bytes), a message retention period of 3 days (3 days * 24 hours * 60 minutes * 60 seconds), a receive message wait time of 20 seconds, and a default visibility timeout of 60 seconds. This example also associates the specified dead letter queue with a maximum receive count of 1,000 messages. Command:: aws sqs set-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewQueue --attributes file://set-queue-attributes.json Input file (set-queue-attributes.json):: { "DelaySeconds": "10", "MaximumMessageSize": "131072", "MessageRetentionPeriod": "259200", "ReceiveMessageWaitTimeSeconds": "20", "RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:us-east-1:80398EXAMPLE:MyDeadLetterQueue\",\"maxReceiveCount\":\"1000\"}", "VisibilityTimeout": "60" } Output:: None. awscli-1.14.44/awscli/examples/sqs/create-queue.rst0000666454262600001440000000124713243367510023256 0ustar pysdk-ciamazon00000000000000**To create a queue** This example creates a queue with the specified name, sets the message retention period to 3 days (3 days * 24 hours * 60 minutes * 60 seconds), and sets the queue's dead letter queue to the specified queue with a maximum receive count of 1,000 messages. Command:: aws sqs create-queue --queue-name MyQueue --attributes file://create-queue.json Input file (create-queue.json):: { "RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:us-east-1:80398EXAMPLE:MyDeadLetterQueue\",\"maxReceiveCount\":\"1000\"}", "MessageRetentionPeriod": "259200" } Output:: { "QueueUrl": "https://queue.amazonaws.com/80398EXAMPLE/MyQueue" } awscli-1.14.44/awscli/examples/discovery/0000777454262600001440000000000013243367512021336 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/discovery/describe-agents.rst0000666454262600001440000000276113243367510025133 0ustar pysdk-ciamazon00000000000000**Describe agents with specified collectionStatus states** This example command describes collection agents with collection status of "STARTED" or "STOPPED". Command:: aws discovery describe-agents --filters name="collectionStatus",values="STARTED","STOPPED",condition="EQUALS" --max-results 3 Output:: { "Snapshots": [ { "version": "1.0.40.0", "agentType": "EC2", "hostName": "ip-172-31-40-234", "collectionStatus": "STOPPED", "agentNetworkInfoList": [ { "macAddress": "06:b5:97:14:fc:0d", "ipAddress": "172.31.40.234" } ], "health": "UNKNOWN", "agentId": "i-003305c02a776e883", "registeredTime": "2016-12-09T19:05:06Z", "lastHealthPingTime": "2016-12-09T19:05:10Z" }, { "version": "1.0.40.0", "agentType": "EC2", "hostName": "ip-172-31-39-64", "collectionStatus": "STARTED", "agentNetworkInfoList": [ { "macAddress": "06:a1:0e:c7:b2:73", "ipAddress": "172.31.39.64" } ], "health": "SHUTDOWN", "agentId": "i-003a5e5e2b36cf8bd", "registeredTime": "2016-11-16T16:36:25Z", "lastHealthPingTime": "2016-11-16T16:47:37Z" } ] } awscli-1.14.44/awscli/examples/discovery/list-configurations.rst0000666454262600001440000000245213243367510026074 0ustar pysdk-ciamazon00000000000000**To list all of the discovered servers meeting a set of filter conditions** This example command lists discovered servers matching either of two hostname patterns and not running Ubuntu. Command:: aws discovery list-configurations --configuration-type SERVER --filters name="server.hostName",values="172-31-35","172-31-42",condition="CONTAINS" name="server.osName",values="Ubuntu",condition="NOT_CONTAINS" Output:: { "configurations": [ { "server.osVersion": "3.14.48-33.39.amzn1.x86_64", "server.type": "EC2", "server.hostName": "ip-172-31-42-208", "server.timeOfCreation": "2016-10-28 23:44:30.0", "server.configurationId": "d-server-099385097ef9fbcfb", "server.osName": "Linux - Amazon Linux AMI release 2015.03", "server.agentId": "i-c142b99e" }, { "server.osVersion": "3.14.48-33.39.amzn1.x86_64", "server.type": "EC2", "server.hostName": "ip-172-31-35-152", "server.timeOfCreation": "2016-10-28 23:44:00.0", "server.configurationId": "d-server-0c4f2dd1fee22c6c1", "server.osName": "Linux - Amazon Linux AMI release 2015.03", "server.agentId": "i-4447bc1b" } ] } awscli-1.14.44/awscli/examples/discovery/describe-configurations.rst0000666454262600001440000001520113243367510026675 0ustar pysdk-ciamazon00000000000000**Describe selected asset configurations** This example command describes the configurations of two specified servers. The action detects the type of asset from the configuration ID. Only one type of asset is allowed per command. Command:: aws discovery describe-configurations --configuration-ids "d-server-099385097ef9fbcfb" "d-server-0c4f2dd1fee22c6c1" Output:: { "configurations": [ { "server.performance.maxCpuUsagePct": "0.0", "server.performance.maxDiskReadIOPS": "0.0", "server.performance.avgCpuUsagePct": "0.0", "server.type": "EC2", "server.performance.maxNetworkReadsPerSecondInKB": "0.19140625", "server.hostName": "ip-172-31-35-152", "server.configurationId": "d-server-0c4f2dd1fee22c6c1", "server.tags.hasMoreValues": "false", "server.performance.minFreeRAMInKB": "1543496.0", "server.osVersion": "3.14.48-33.39.amzn1.x86_64", "server.performance.maxDiskReadsPerSecondInKB": "0.0", "server.applications": "[]", "server.performance.numDisks": "1", "server.performance.numCpus": "1", "server.performance.numCores": "1", "server.performance.maxDiskWriteIOPS": "0.0", "server.performance.maxNetworkWritesPerSecondInKB": "0.82421875", "server.performance.avgDiskWritesPerSecondInKB": "0.0", "server.networkInterfaceInfo": "[{\"name\":\"eth0\",\"macAddress\":\"06:A7:7D:3F:54:57\",\"ipAddress\":\"172.31.35.152\",\"netMask\":\"255.255.240.0\"},{\"name\":\"lo\",\"macAddress\":\"00:00:00:00:00:00\",\"ipAddress\":\"127.0.0.1\",\"netMask\":\"255.0.0.0\"},{\"name\":\"eth0\",\"macAddress\":\"06:A7:7D:3F:54:57\",\"ipAddress\":\"fe80::4a7:7dff:fe3f:5457\"},{\"name\":\"lo\",\"macAddress\":\"00:00:00:00:00:00\",\"ipAddress\":\"::1\"}]", "server.performance.avgNetworkReadsPerSecondInKB": "0.04915364583333333", "server.tags": "[]", "server.applications.hasMoreValues": "false", "server.timeOfCreation": "2016-10-28 23:44:00.0", "server.agentId": "i-4447bc1b", "server.performance.maxDiskWritesPerSecondInKB": "0.0", "server.performance.avgDiskReadIOPS": "0.0", "server.performance.avgFreeRAMInKB": "1547210.1333333333", "server.performance.avgDiskReadsPerSecondInKB": "0.0", "server.performance.avgDiskWriteIOPS": "0.0", "server.performance.numNetworkCards": "2", "server.hypervisor": "xen", "server.networkInterfaceInfo.hasMoreValues": "false", "server.performance.avgNetworkWritesPerSecondInKB": "0.1380859375", "server.osName": "Linux - Amazon Linux AMI release 2015.03", "server.performance.totalRAMInKB": "1694732.0", "server.cpuType": "x64" }, { "server.performance.maxCpuUsagePct": "100.0", "server.performance.maxDiskReadIOPS": "0.0", "server.performance.avgCpuUsagePct": "14.733333333333338", "server.type": "EC2", "server.performance.maxNetworkReadsPerSecondInKB": "13.400390625", "server.hostName": "ip-172-31-42-208", "server.configurationId": "d-server-099385097ef9fbcfb", "server.tags.hasMoreValues": "false", "server.performance.minFreeRAMInKB": "1531104.0", "server.osVersion": "3.14.48-33.39.amzn1.x86_64", "server.performance.maxDiskReadsPerSecondInKB": "0.0", "server.applications": "[]", "server.performance.numDisks": "1", "server.performance.numCpus": "1", "server.performance.numCores": "1", "server.performance.maxDiskWriteIOPS": "1.0", "server.performance.maxNetworkWritesPerSecondInKB": "12.271484375", "server.performance.avgDiskWritesPerSecondInKB": "0.5333333333333334", "server.networkInterfaceInfo": "[{\"name\":\"eth0\",\"macAddress\":\"06:4A:79:60:75:61\",\"ipAddress\":\"172.31.42.208\",\"netMask\":\"255.255.240.0\"},{\"name\":\"eth0\",\"macAddress\":\"06:4A:79:60:75:61\",\"ipAddress\":\"fe80::44a:79ff:fe60:7561\"},{\"name\":\"lo\",\"macAddress\":\"00:00:00:00:00:00\",\"ipAddress\":\"::1\"},{\"name\":\"lo\",\"macAddress\":\"00:00:00:00:00:00\",\"ipAddress\":\"127.0.0.1\",\"netMask\":\"255.0.0.0\"}]", "server.performance.avgNetworkReadsPerSecondInKB": "2.8720052083333334", "server.tags": "[]", "server.applications.hasMoreValues": "false", "server.timeOfCreation": "2016-10-28 23:44:30.0", "server.agentId": "i-c142b99e", "server.performance.maxDiskWritesPerSecondInKB": "4.0", "server.performance.avgDiskReadIOPS": "0.0", "server.performance.avgFreeRAMInKB": "1534946.4", "server.performance.avgDiskReadsPerSecondInKB": "0.0", "server.performance.avgDiskWriteIOPS": "0.13333333333333336", "server.performance.numNetworkCards": "2", "server.hypervisor": "xen", "server.networkInterfaceInfo.hasMoreValues": "false", "server.performance.avgNetworkWritesPerSecondInKB": "1.7977864583333332", "server.osName": "Linux - Amazon Linux AMI release 2015.03", "server.performance.totalRAMInKB": "1694732.0", "server.cpuType": "x64" } ] } **Describe selected asset configurations** This example command describes the configurations of two specified applications. The action detects the type of asset from the configuration ID. Only one type of asset is allowed per command. Command:: aws discovery describe-configurations --configuration-ids "d-application-0ac39bc0e4fad0e42" "d-application-02444a45288013764q" Output:: { "configurations": [ { "application.serverCount": "0", "application.name": "Application-12345", "application.lastModifiedTime": "2016-12-13 23:53:27.0", "application.description": "", "application.timeOfCreation": "2016-12-13 23:53:27.0", "application.configurationId": "d-application-0ac39bc0e4fad0e42" }, { "application.serverCount": "0", "application.name": "Application-67890", "application.lastModifiedTime": "2016-12-13 23:53:33.0", "application.description": "", "application.timeOfCreation": "2016-12-13 23:53:33.0", "application.configurationId": "d-application-02444a45288013764" } ] } awscli-1.14.44/awscli/examples/logs/0000777454262600001440000000000013243367512020273 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/examples/logs/describe-log-streams.rst0000666454262600001440000000133313243367510025036 0ustar pysdk-ciamazon00000000000000The following command shows all log streams starting with the prefix ``2015`` in the log group ``my-logs``:: aws logs describe-log-streams --log-group-name my-logs --log-stream-name-prefix 2015 Output:: { "logStreams": [ { "creationTime": 1433189871774, "arn": "arn:aws:logs:us-west-2:0123456789012:log-group:my-logs:log-stream:20150531", "logStreamName": "20150531", "storedBytes": 0 }, { "creationTime": 1433189873898, "arn": "arn:aws:logs:us-west-2:0123456789012:log-group:my-logs:log-stream:20150601", "logStreamName": "20150601", "storedBytes": 0 } ] } awscli-1.14.44/awscli/examples/logs/put-log-events.rst0000666454262600001440000000210713243367510023714 0ustar pysdk-ciamazon00000000000000The following command puts log events to a log stream named ``20150601`` in the log group ``my-logs``:: aws logs put-log-events --log-group-name my-logs --log-stream-name 20150601 --log-events file://events Output:: { "nextSequenceToken": "49542672486831074009579604567656788214806863282469607346" } The above example reads a JSON array of events from a file named ``events`` in the current directory:: [ { "timestamp": 1433190184356, "message": "Example Event 1" }, { "timestamp": 1433190184358, "message": "Example Event 2" }, { "timestamp": 1433190184360, "message": "Example Event 3" } ] Each subsequent call requires the next sequence token provided by the previous call to be specified with the sequence token option:: aws logs put-log-events --log-group-name my-logs --log-stream-name 20150601 --log-events file://events2 --sequence-token "49542672486831074009579604567656788214806863282469607346" Output:: { "nextSequenceToken": "49542672486831074009579604567900991230369019956308219826" } awscli-1.14.44/awscli/examples/logs/delete-retention-policy.rst0000666454262600001440000000026413243367510025571 0ustar pysdk-ciamazon00000000000000The following command removes the retention policy that has previously been applied to a log group named ``my-logs``:: aws logs delete-retention-policy --log-group-name my-logs awscli-1.14.44/awscli/examples/logs/delete-log-stream.rst0000666454262600001440000000026513243367510024340 0ustar pysdk-ciamazon00000000000000The following command deletes a log stream named ``20150531`` from a log group named ``my-logs``:: aws logs delete-log-stream --log-group-name my-logs --log-stream-name 20150531 awscli-1.14.44/awscli/examples/logs/create-log-stream.rst0000666454262600001440000000025713243367510024342 0ustar pysdk-ciamazon00000000000000The following command creates a log stream named ``20150601`` in the log group ``my-logs``:: aws logs create-log-stream --log-group-name my-logs --log-stream-name 20150601 awscli-1.14.44/awscli/examples/logs/describe-log-groups.rst0000666454262600001440000000073013243367510024677 0ustar pysdk-ciamazon00000000000000The following command describes a log group named ``my-logs``:: aws logs describe-log-groups --log-group-name-prefix my-logs Output:: { "logGroups": [ { "storedBytes": 0, "metricFilterCount": 0, "creationTime": 1433189500783, "logGroupName": "my-logs", "retentionInDays": 5, "arn": "arn:aws:logs:us-west-2:0123456789012:log-group:my-logs:*" } ] } awscli-1.14.44/awscli/examples/logs/delete-log-group.rst0000666454262600001440000000016413243367510024177 0ustar pysdk-ciamazon00000000000000The following command deletes a log group named ``my-logs``:: aws logs delete-log-group --log-group-name my-logs awscli-1.14.44/awscli/examples/logs/create-log-group.rst0000666454262600001440000000016413243367510024200 0ustar pysdk-ciamazon00000000000000The following command creates a log group named ``my-logs``:: aws logs create-log-group --log-group-name my-logs awscli-1.14.44/awscli/examples/logs/get-log-events.rst0000666454262600001440000000155713243367510023673 0ustar pysdk-ciamazon00000000000000The following command retrieves log events from a log stream named ``20150601`` in the log group ``my-logs``:: aws logs get-log-events --log-group-name my-logs --log-stream-name 20150601 Output:: { "nextForwardToken": "f/31961209122447488583055879464742346735121166569214640130", "events": [ { "ingestionTime": 1433190494190, "timestamp": 1433190184356, "message": "Example Event 1" }, { "ingestionTime": 1433190516679, "timestamp": 1433190184356, "message": "Example Event 1" }, { "ingestionTime": 1433190494190, "timestamp": 1433190184358, "message": "Example Event 2" } ], "nextBackwardToken": "b/31961209122358285602261756944988674324553373268216709120" } awscli-1.14.44/awscli/examples/logs/put-retention-policy.rst0000666454262600001440000000024713243367510025140 0ustar pysdk-ciamazon00000000000000The following command adds a 5 day retention policy to a log group named ``my-logs``:: aws logs put-retention-policy --log-group-name my-logs --retention-in-days 5 awscli-1.14.44/awscli/plugin.py0000666454262600001440000000433113243367510017360 0ustar pysdk-ciamazon00000000000000# Copyright 2012-2013 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 from botocore.hooks import HierarchicalEmitter log = logging.getLogger('awscli.plugin') BUILTIN_PLUGINS = {'__builtin__': 'awscli.handlers'} def load_plugins(plugin_mapping, event_hooks=None, include_builtins=True): """ :type plugin_mapping: dict :param plugin_mapping: A dict of plugin name to import path, e.g. ``{"plugingName": "package.modulefoo"}``. :type event_hooks: ``EventHooks`` :param event_hooks: Event hook emitter. If one if not provided, an emitter will be created and returned. Otherwise, the passed in ``event_hooks`` will be used to initialize plugins. :type include_builtins: bool :param include_builtins: If True, the builtin awscli plugins (specified in ``BUILTIN_PLUGINS``) will be included in the list of plugins to load. :rtype: HierarchicalEmitter :return: An event emitter object. """ if include_builtins: plugin_mapping.update(BUILTIN_PLUGINS) modules = _import_plugins(plugin_mapping) if event_hooks is None: event_hooks = HierarchicalEmitter() for name, plugin in zip(plugin_mapping.keys(), modules): log.debug("Initializing plugin %s: %s", name, plugin) plugin.awscli_initialize(event_hooks) return event_hooks def _import_plugins(plugin_names): plugins = [] for name, path in plugin_names.items(): log.debug("Importing plugin %s: %s", name, path) if '.' not in path: plugins.append(__import__(path)) else: package, module = path.rsplit('.', 1) module = __import__(path, fromlist=[module]) plugins.append(module) return plugins awscli-1.14.44/awscli/completer.py0000777454262600001440000001336313243367510020064 0ustar pysdk-ciamazon00000000000000# Copyright 2012-2013 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 awscli.clidriver import sys import logging import copy LOG = logging.getLogger(__name__) class Completer(object): def __init__(self, driver=None): if driver is not None: self.driver = driver else: self.driver = awscli.clidriver.create_clidriver() self.main_help = self.driver.create_help_command() self.main_options = self._get_documented_completions( self.main_help.arg_table) def complete(self, cmdline, point=None): if point is None: point = len(cmdline) args = cmdline[0:point].split() current_arg = args[-1] cmd_args = [w for w in args if not w.startswith('-')] opts = [w for w in args if w.startswith('-')] cmd_name, cmd = self._get_command(self.main_help, cmd_args) subcmd_name, subcmd = self._get_command(cmd, cmd_args) if cmd_name is None: # If we didn't find any command names in the cmdline # lets try to complete provider options return self._complete_provider(current_arg, opts) elif subcmd_name is None: return self._complete_command(cmd_name, cmd, current_arg, opts) return self._complete_subcommand(subcmd_name, subcmd, current_arg, opts) def _complete_command(self, command_name, command_help, current_arg, opts): if current_arg == command_name: if command_help: return self._get_documented_completions( command_help.command_table) elif current_arg.startswith('-'): return self._find_possible_options(current_arg, opts) elif command_help is not None: # See if they have entered a partial command name return self._get_documented_completions( command_help.command_table, current_arg) return [] def _complete_subcommand(self, subcmd_name, subcmd_help, current_arg, opts): if current_arg != subcmd_name and current_arg.startswith('-'): return self._find_possible_options(current_arg, opts, subcmd_help) return [] def _complete_option(self, option_name): if option_name == '--endpoint-url': return [] if option_name == '--output': cli_data = self.driver.session.get_data('cli') return cli_data['options']['output']['choices'] if option_name == '--profile': return self.driver.session.available_profiles return [] def _complete_provider(self, current_arg, opts): if current_arg.startswith('-'): return self._find_possible_options(current_arg, opts) elif current_arg == 'aws': return self._get_documented_completions( self.main_help.command_table) else: # Otherwise, see if they have entered a partial command name return self._get_documented_completions( self.main_help.command_table, current_arg) def _get_command(self, command_help, command_args): if command_help is not None and command_help.command_table is not None: for command_name in command_args: if command_name in command_help.command_table: cmd_obj = command_help.command_table[command_name] return command_name, cmd_obj.create_help_command() return None, None def _get_documented_completions(self, table, startswith=None): names = [] for key, command in table.items(): if getattr(command, '_UNDOCUMENTED', False): # Don't tab complete undocumented commands/params continue if startswith is not None and not key.startswith(startswith): continue if getattr(command, 'positional_arg', False): continue names.append(key) return names def _find_possible_options(self, current_arg, opts, subcmd_help=None): all_options = copy.copy(self.main_options) if subcmd_help is not None: all_options += self._get_documented_completions( subcmd_help.arg_table) for option in opts: # Look through list of options on cmdline. If there are # options that have already been specified and they are # not the current word, remove them from list of possibles. if option != current_arg: stripped_opt = option.lstrip('-') if stripped_opt in all_options: all_options.remove(stripped_opt) cw = current_arg.lstrip('-') possibilities = ['--' + n for n in all_options if n.startswith(cw)] if len(possibilities) == 1 and possibilities[0] == current_arg: return self._complete_option(possibilities[0]) return possibilities def complete(cmdline, point): choices = Completer().complete(cmdline, point) print(' \n'.join(choices)) if __name__ == '__main__': if len(sys.argv) == 3: cmdline = sys.argv[1] point = int(sys.argv[2]) elif len(sys.argv) == 2: cmdline = sys.argv[1] else: print('usage: %s ' % sys.argv[0]) sys.exit(1) print(complete(cmdline, point)) awscli-1.14.44/awscli/paramfile.py0000666454262600001440000001431013243367511020021 0ustar pysdk-ciamazon00000000000000# Copyright 2012-2013 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 from botocore.vendored import requests from awscli.compat import six from awscli.compat import compat_open logger = logging.getLogger(__name__) # These are special cased arguments that do _not_ get the # special param file processing. This is typically because it # refers to an actual URI of some sort and we don't want to actually # download the content (i.e TemplateURL in cloudformation). PARAMFILE_DISABLED = set([ 'apigateway.put-integration.uri', 'appstream2.create-stack.redirect-url', 'appstream2.update-stack.redirect-url', 'cloudformation.create-stack.template-url', 'cloudformation.update-stack.template-url', 'cloudformation.create-stack-set.template-url', 'cloudformation.update-stack-set.template-url', 'cloudformation.create-change-set.template-url', 'cloudformation.validate-template.template-url', 'cloudformation.estimate-template-cost.template-url', 'cloudformation.get-template-summary.template-url', 'cloudformation.create-stack.stack-policy-url', 'cloudformation.update-stack.stack-policy-url', 'cloudformation.set-stack-policy.stack-policy-url', # aws cloudformation package --template-file 'custom.package.template-file', # aws cloudformation deploy --template-file 'custom.deploy.template-file', 'cloudformation.update-stack.stack-policy-during-update-url', # We will want to change the event name to ``s3`` as opposed to # custom in the near future along with ``s3`` to ``s3api``. 'custom.cp.website-redirect', 'custom.mv.website-redirect', 'custom.sync.website-redirect', 'guardduty.create-ip-set.location', 'guardduty.update-ip-set.location', 'guardduty.create-threat-intel-set.location', 'guardduty.update-threat-intel-set.location', 'comprehend.detect-dominant-language.text', 'comprehend.batch-detect-dominant-language.text-list', 'comprehend.detect-entities.text', 'comprehend.batch-detect-entities.text-list', 'comprehend.detect-key-phrases.text', 'comprehend.batch-detect-key-phrases.text-list', 'comprehend.detect-sentiment.text', 'comprehend.batch-detect-sentiment.text-list', 'iam.create-open-id-connect-provider.url', 'machinelearning.predict.predict-endpoint', 'rds.copy-db-cluster-snapshot.pre-signed-url', 'rds.create-db-cluster.pre-signed-url', 'rds.copy-db-snapshot.pre-signed-url', 'rds.create-db-instance-read-replica.pre-signed-url', 'sqs.add-permission.queue-url', 'sqs.change-message-visibility.queue-url', 'sqs.change-message-visibility-batch.queue-url', 'sqs.delete-message.queue-url', 'sqs.delete-message-batch.queue-url', 'sqs.delete-queue.queue-url', 'sqs.get-queue-attributes.queue-url', 'sqs.list-dead-letter-source-queues.queue-url', 'sqs.receive-message.queue-url', 'sqs.remove-permission.queue-url', 'sqs.send-message.queue-url', 'sqs.send-message-batch.queue-url', 'sqs.set-queue-attributes.queue-url', 'sqs.purge-queue.queue-url', 'sqs.list-queue-tags.queue-url', 'sqs.tag-queue.queue-url', 'sqs.untag-queue.queue-url', 's3.copy-object.website-redirect-location', 's3.create-multipart-upload.website-redirect-location', 's3.put-object.website-redirect-location', # Double check that this has been renamed! 'sns.subscribe.notification-endpoint', 'iot.create-job.document-source', 'translate.translate-text.text', 'workdocs.create-notification-subscription.notification-endpoint', ]) class ResourceLoadingError(Exception): pass def get_paramfile(path): """Load parameter based on a resource URI. It is possible to pass parameters to operations by referring to files or URI's. If such a reference is detected, this function attempts to retrieve the data from the file or URI and returns it. If there are any errors or if the ``path`` does not appear to refer to a file or URI, a ``None`` is returned. :type path: str :param path: The resource URI, e.g. file://foo.txt. This value may also be a non resource URI, in which case ``None`` is returned. :return: The loaded value associated with the resource URI. If the provided ``path`` is not a resource URI, then a value of ``None`` is returned. """ data = None if isinstance(path, six.string_types): for prefix, function_spec in PREFIX_MAP.items(): if path.startswith(prefix): function, kwargs = function_spec data = function(prefix, path, **kwargs) return data def get_file(prefix, path, mode): file_path = os.path.expandvars(os.path.expanduser(path[len(prefix):])) try: with compat_open(file_path, mode) as f: return f.read() except UnicodeDecodeError: raise ResourceLoadingError( 'Unable to load paramfile (%s), text contents could ' 'not be decoded. If this is a binary file, please use the ' 'fileb:// prefix instead of the file:// prefix.' % file_path) except (OSError, IOError) as e: raise ResourceLoadingError('Unable to load paramfile %s: %s' % ( path, e)) def get_uri(prefix, uri): try: r = requests.get(uri) if r.status_code == 200: return r.text else: raise ResourceLoadingError( "received non 200 status code of %s" % ( r.status_code)) except Exception as e: raise ResourceLoadingError('Unable to retrieve %s: %s' % (uri, e)) PREFIX_MAP = { 'file://': (get_file, {'mode': 'r'}), 'fileb://': (get_file, {'mode': 'rb'}), 'http://': (get_uri, {}), 'https://': (get_uri, {}), } awscli-1.14.44/awscli/schema.py0000666454262600001440000001437413243367510017332 0ustar pysdk-ciamazon00000000000000# 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 collections import defaultdict class ParameterRequiredError(ValueError): pass class SchemaTransformer(object): """ Transforms a custom argument parameter schema into an internal model representation so that it can be treated like a normal service model. This includes shorthand JSON parsing and automatic documentation generation. The format of the schema follows JSON Schema, which can be found here: http://json-schema.org/ Only a relevant subset of features is supported here: * Types: `object`, `array`, `string`, `integer`, `boolean` * Properties: `type`, `description`, `required`, `enum` For example:: { "type": "array", "items": { "type": "object", "properties": { "arg1": { "type": "string", "required": True, "enum": [ "Value1", "Value2", "Value3" ] }, "arg2": { "type": "integer", "description": "The number of calls" } } } } Assuming the schema is applied to a service named `foo`, with an operation named `bar` and that the parameter is called `baz`, you could call it with the shorthand JSON like so:: $ aws foo bar --baz arg1=Value1,arg2=5 arg1=Value2 """ JSON_SCHEMA_TO_AWS_TYPES = { 'object': 'structure', 'array': 'list', } def __init__(self): self._shape_namer = ShapeNameGenerator() def transform(self, schema): """Convert JSON schema to the format used internally by the AWS CLI. :type schema: dict :param schema: The JSON schema describing the argument model. :rtype: dict :return: The transformed model in a form that can be consumed internally by the AWS CLI. The dictionary returned will have a list of shapes, where the shape representing the transformed schema is always named ``InputShape`` in the returned dictionary. """ shapes = {} self._transform(schema, shapes, 'InputShape') return shapes def _transform(self, schema, shapes, shape_name): if 'type' not in schema: raise ParameterRequiredError("Missing required key: 'type'") if schema['type'] == 'object': shapes[shape_name] = self._transform_structure(schema, shapes) elif schema['type'] == 'array': shapes[shape_name] = self._transform_list(schema, shapes) elif schema['type'] == 'map': shapes[shape_name] = self._transform_map(schema, shapes) else: shapes[shape_name] = self._transform_scalar(schema) return shapes def _transform_scalar(self, schema): return self._populate_initial_shape(schema) def _transform_structure(self, schema, shapes): # Transforming a structure involves: # 1. Generating the shape definition for the structure # 2. Generating the shape definitions for its members structure_shape = self._populate_initial_shape(schema) members = {} required_members = [] for key, value in schema['properties'].items(): current_type_name = self._json_schema_to_aws_type(value) current_shape_name = self._shape_namer.new_shape_name( current_type_name) members[key] = {'shape': current_shape_name} if value.get('required', False): required_members.append(key) self._transform(value, shapes, current_shape_name) structure_shape['members'] = members if required_members: structure_shape['required'] = required_members return structure_shape def _transform_map(self, schema, shapes): structure_shape = self._populate_initial_shape(schema) for attribute in ['key', 'value']: type_name = self._json_schema_to_aws_type(schema[attribute]) shape_name = self._shape_namer.new_shape_name(type_name) structure_shape[attribute] = {'shape': shape_name} self._transform(schema[attribute], shapes, shape_name) return structure_shape def _transform_list(self, schema, shapes): # Transforming a structure involves: # 1. Generating the shape definition for the structure # 2. Generating the shape definitions for its 'items' member list_shape = self._populate_initial_shape(schema) member_type = self._json_schema_to_aws_type(schema['items']) member_shape_name = self._shape_namer.new_shape_name(member_type) list_shape['member'] = {'shape': member_shape_name} self._transform(schema['items'], shapes, member_shape_name) return list_shape def _populate_initial_shape(self, schema): shape = {'type': self._json_schema_to_aws_type(schema)} if 'description' in schema: shape['documentation'] = schema['description'] if 'enum' in schema: shape['enum'] = schema['enum'] return shape def _json_schema_to_aws_type(self, schema): if 'type' not in schema: raise ParameterRequiredError("Missing required key: 'type'") type_name = schema['type'] return self.JSON_SCHEMA_TO_AWS_TYPES.get(type_name, type_name) class ShapeNameGenerator(object): def __init__(self): self._name_cache = defaultdict(int) def new_shape_name(self, type_name): self._name_cache[type_name] += 1 current_index = self._name_cache[type_name] return '%sType%s' % (type_name.capitalize(), current_index) awscli-1.14.44/awscli/customizations/0000777454262600001440000000000013243367512020604 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/customizations/ec2/0000777454262600001440000000000013243367512021255 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/customizations/ec2/bundleinstance.py0000666454262600001440000001513213243367510024625 0ustar pysdk-ciamazon00000000000000# Copyright 2013 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 from hashlib import sha1 import hmac import base64 import datetime from awscli.compat import six from awscli.arguments import CustomArgument logger = logging.getLogger('ec2bundleinstance') # This customization adds the following scalar parameters to the # bundle-instance operation: # --bucket: BUCKET_DOCS = ('The bucket in which to store the AMI. ' 'You can specify a bucket that you already own or ' 'a new bucket that Amazon EC2 creates on your behalf. ' 'If you specify a bucket that belongs to someone else, ' 'Amazon EC2 returns an error.') # --prefix: PREFIX_DOCS = ('The prefix for the image component names being stored ' 'in Amazon S3.') # --owner-akid OWNER_AKID_DOCS = 'The access key ID of the owner of the Amazon S3 bucket.' # --policy POLICY_DOCS = ( "An Amazon S3 upload policy that gives " "Amazon EC2 permission to upload items into Amazon S3 " "on the user's behalf. If you provide this parameter, " "you must also provide " "your secret access key, so we can create a policy " "signature for you (the secret access key is not passed " "to Amazon EC2). If you do not provide this parameter, " "we generate an upload policy for you automatically. " "For more information about upload policies see the " "sections about policy construction and signatures in the " '' 'Amazon Simple Storage Service Developer Guide.') # --owner-sak OWNER_SAK_DOCS = ('The AWS secret access key for the owner of the ' 'Amazon S3 bucket specified in the --bucket ' 'parameter. This parameter is required so that a ' 'signature can be computed for the policy.') def _add_params(argument_table, **kwargs): # Add the scalar parameters and also change the complex storage # param to not be required so the user doesn't get an error from # argparse if they only supply scalar params. storage_arg = argument_table['storage'] storage_arg.required = False arg = BundleArgument(storage_param='Bucket', name='bucket', help_text=BUCKET_DOCS) argument_table['bucket'] = arg arg = BundleArgument(storage_param='Prefix', name='prefix', help_text=PREFIX_DOCS) argument_table['prefix'] = arg arg = BundleArgument(storage_param='AWSAccessKeyId', name='owner-akid', help_text=OWNER_AKID_DOCS) argument_table['owner-akid'] = arg arg = BundleArgument(storage_param='_SAK', name='owner-sak', help_text=OWNER_SAK_DOCS) argument_table['owner-sak'] = arg arg = BundleArgument(storage_param='UploadPolicy', name='policy', help_text=POLICY_DOCS) argument_table['policy'] = arg def _check_args(parsed_args, **kwargs): # This function checks the parsed args. If the user specified # the --ip-permissions option with any of the scalar options we # raise an error. logger.debug(parsed_args) arg_dict = vars(parsed_args) if arg_dict['storage']: 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 ' 'not recommended.') raise ValueError(msg) POLICY = ('{{"expiration": "{expires}",' '"conditions": [' '{{"bucket": "{bucket}"}},' '{{"acl": "ec2-bundle-read"}},' '["starts-with", "$key", "{prefix}"]' ']}}' ) def _generate_policy(params): # Called if there is no policy supplied by the user. # Creates a policy that provides access for 24 hours. delta = datetime.timedelta(hours=24) expires = datetime.datetime.utcnow() + delta expires_iso = expires.strftime("%Y-%m-%dT%H:%M:%S.%fZ") policy = POLICY.format(expires=expires_iso, bucket=params['Bucket'], prefix=params['Prefix']) params['UploadPolicy'] = policy def _generate_signature(params): # If we have a policy and a sak, create the signature. policy = params.get('UploadPolicy') sak = params.get('_SAK') if policy and sak: policy = base64.b64encode(six.b(policy)).decode('utf-8') new_hmac = hmac.new(sak.encode('utf-8'), digestmod=sha1) new_hmac.update(six.b(policy)) ps = base64.encodestring(new_hmac.digest()).strip().decode('utf-8') params['UploadPolicySignature'] = ps del params['_SAK'] def _check_params(params, **kwargs): # Called just before call but prior to building the params. # Adds information not supplied by the user. storage = params['Storage']['S3'] if 'UploadPolicy' not in storage: _generate_policy(storage) if 'UploadPolicySignature' not in storage: _generate_signature(storage) EVENTS = [ ('building-argument-table.ec2.bundle-instance', _add_params), ('operation-args-parsed.ec2.bundle-instance', _check_args), ('before-parameter-build.ec2.BundleInstance', _check_params), ] def register_bundleinstance(event_handler): # Register all of the events for customizing BundleInstance for event, handler in EVENTS: event_handler.register(event, handler) class BundleArgument(CustomArgument): def __init__(self, storage_param, *args, **kwargs): super(BundleArgument, self).__init__(*args, **kwargs) self._storage_param = storage_param def _build_storage(self, params, value): # Build up the Storage data structure if 'Storage' not in params: params['Storage'] = {'S3': {}} params['Storage']['S3'][self._storage_param] = value def add_to_params(self, parameters, value): if value: self._build_storage(parameters, value) awscli-1.14.44/awscli/customizations/ec2/secgroupsimplify.py0000666454262600001440000002052413243367510025234 0ustar pysdk-ciamazon00000000000000# Copyright 2013 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. """ This customization adds the following scalar parameters to the authorize operations: * --protocol: tcp | udp | icmp or any protocol number * --port: A single integer or a range (min-max). You can specify ``all`` to mean all ports (for example, port range 0-65535) * --source-group: Either the source security group ID or name. * --cidr - The CIDR range. Cannot be used when specifying a source or destination security group. """ from awscli.arguments import CustomArgument def _add_params(argument_table, **kwargs): arg = ProtocolArgument('protocol', help_text=PROTOCOL_DOCS) argument_table['protocol'] = arg argument_table['ip-protocol']._UNDOCUMENTED = True arg = PortArgument('port', help_text=PORT_DOCS) argument_table['port'] = arg # Port handles both the from-port and to-port, # we need to not document both args. argument_table['from-port']._UNDOCUMENTED = True argument_table['to-port']._UNDOCUMENTED = True arg = CidrArgument('cidr', help_text=CIDR_DOCS) argument_table['cidr'] = arg argument_table['cidr-ip']._UNDOCUMENTED = True arg = SourceGroupArgument('source-group', help_text=SOURCEGROUP_DOCS) argument_table['source-group'] = arg argument_table['source-security-group-name']._UNDOCUMENTED = True arg = GroupOwnerArgument('group-owner', help_text=GROUPOWNER_DOCS) argument_table['group-owner'] = arg argument_table['source-security-group-owner-id']._UNDOCUMENTED = True def _check_args(parsed_args, **kwargs): # This function checks the parsed args. If the user specified # the --ip-permissions option with any of the scalar options we # raise an error. arg_dict = vars(parsed_args) if arg_dict['ip_permissions']: for key in ('protocol', 'port', 'cidr', 'source_group', 'group_owner'): if arg_dict[key]: msg = ('The --%s option is not compatible ' 'with the --ip-permissions option ') % key raise ValueError(msg) def _add_docs(help_command, **kwargs): doc = help_command.doc doc.style.new_paragraph() doc.style.start_note() msg = ('To specify multiple rules in a single command ' 'use the --ip-permissions option') doc.include_doc_string(msg) doc.style.end_note() EVENTS = [ ('building-argument-table.ec2.authorize-security-group-ingress', _add_params), ('building-argument-table.ec2.authorize-security-group-egress', _add_params), ('building-argument-table.ec2.revoke-security-group-ingress', _add_params), ('building-argument-table.ec2.revoke-security-group-egress', _add_params), ('operation-args-parsed.ec2.authorize-security-group-ingress', _check_args), ('operation-args-parsed.ec2.authorize-security-group-egress', _check_args), ('operation-args-parsed.ec2.revoke-security-group-ingress', _check_args), ('operation-args-parsed.ec2.revoke-security-group-egress', _check_args), ('doc-description.ec2.authorize-security-group-ingress', _add_docs), ('doc-description.ec2.authorize-security-group-egress', _add_docs), ('doc-description.ec2.revoke-security-group-ingress', _add_docs), ('doc-description.ec2.revoke-security-groupdoc-ingress', _add_docs), ] PROTOCOL_DOCS = ('

The IP protocol: tcp | ' 'udp | icmp

' '

(VPC only) Use all to specify all protocols.

' '

If this argument is provided without also providing the ' 'port argument, then it will be applied to all ' 'ports for the specified protocol.

') PORT_DOCS = ('

For TCP or UDP: The range of ports to allow.' ' A single integer or a range (min-max).

' '

For ICMP: A single integer or a range (type-code)' ' representing the ICMP type' ' number and the ICMP code number respectively.' ' A value of -1 indicates all ICMP codes for' ' 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.') GROUPOWNER_DOCS = ('

The AWS account ID that owns the source security ' 'group. Cannot be used when specifying a CIDR IP ' 'address.

') def register_secgroup(event_handler): for event, handler in EVENTS: event_handler.register(event, handler) def _build_ip_permissions(params, key, value): if 'IpPermissions' not in params: params['IpPermissions'] = [{}] if key == 'CidrIp': if 'IpRanges' not in params['ip_permissions'][0]: params['IpPermissions'][0]['IpRanges'] = [] params['IpPermissions'][0]['IpRanges'].append(value) elif key in ('GroupId', 'GroupName', 'UserId'): if 'UserIdGroupPairs' not in params['IpPermissions'][0]: params['IpPermissions'][0]['UserIdGroupPairs'] = [{}] params['IpPermissions'][0]['UserIdGroupPairs'][0][key] = value else: params['IpPermissions'][0][key] = value class ProtocolArgument(CustomArgument): def add_to_params(self, parameters, value): if value: try: int_value = int(value) if (int_value < 0 or int_value > 255) and int_value != -1: msg = ('protocol numbers must be in the range 0-255 ' 'or -1 to specify all protocols') raise ValueError(msg) except ValueError: if value not in ('tcp', 'udp', 'icmp', 'all'): msg = ('protocol parameter should be one of: ' 'tcp|udp|icmp|all or any valid protocol number.') raise ValueError(msg) if value == 'all': value = '-1' _build_ip_permissions(parameters, 'IpProtocol', value) class PortArgument(CustomArgument): def add_to_params(self, parameters, value): if value: try: if value == '-1' or value == 'all': fromstr = '-1' tostr = '-1' elif '-' in value: # We can get away with simple logic here because # argparse will not allow values such as # "-1-8", and these aren't actually valid # values any from from/to ports. fromstr, tostr = value.split('-', 1) else: fromstr, tostr = (value, value) _build_ip_permissions(parameters, 'FromPort', int(fromstr)) _build_ip_permissions(parameters, 'ToPort', int(tostr)) except ValueError: msg = ('port parameter should be of the ' 'form (e.g. 22 or 22-25)') raise ValueError(msg) class CidrArgument(CustomArgument): def add_to_params(self, parameters, value): if value: value = [{'CidrIp': value}] _build_ip_permissions(parameters, 'IpRanges', value) class SourceGroupArgument(CustomArgument): def add_to_params(self, parameters, value): if value: if value.startswith('sg-'): _build_ip_permissions(parameters, 'GroupId', value) else: _build_ip_permissions(parameters, 'GroupName', value) class GroupOwnerArgument(CustomArgument): def add_to_params(self, parameters, value): if value: _build_ip_permissions(parameters, 'UserId', value) awscli-1.14.44/awscli/customizations/ec2/decryptpassword.py0000666454262600001440000001076513243367510025073 0ustar pysdk-ciamazon00000000000000# Copyright 2013 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 base64 import rsa from awscli.compat import six from botocore import model from awscli.arguments import BaseCLIArgument logger = logging.getLogger(__name__) HELP = """

The file that contains the private key used to launch the instance (e.g. windows-keypair.pem). If this is supplied, the password data sent from EC2 will be decrypted before display.

""" def ec2_add_priv_launch_key(argument_table, operation_model, session, **kwargs): """ This handler gets called after the argument table for the operation has been created. It's job is to add the ``priv-launch-key`` parameter. """ argument_table['priv-launch-key'] = LaunchKeyArgument( session, operation_model, 'priv-launch-key') class LaunchKeyArgument(BaseCLIArgument): def __init__(self, session, operation_model, name): self._session = session self.argument_model = model.Shape('LaunchKeyArgument', {'type': 'string'}) self._operation_model = operation_model self._name = name self._key_path = None self._required = False @property def cli_type_name(self): return 'string' @property def required(self): return self._required @required.setter def required(self, value): self._required = value @property def documentation(self): return HELP def add_to_parser(self, parser): parser.add_argument(self.cli_name, dest=self.py_name, help='SSH Private Key file') def add_to_params(self, parameters, value): """ This gets called with the value of our ``--priv-launch-key`` if it is specified. It needs to determine if the path provided is valid and, if it is, it stores it in the instance variable ``_key_path`` for use by the decrypt routine. """ if value: path = os.path.expandvars(value) path = os.path.expanduser(path) if os.path.isfile(path): self._key_path = path endpoint_prefix = \ self._operation_model.service_model.endpoint_prefix event = 'after-call.%s.%s' % (endpoint_prefix, self._operation_model.name) self._session.register(event, self._decrypt_password_data) else: msg = ('priv-launch-key should be a path to the ' 'local SSH private key file used to launch ' 'the instance.') raise ValueError(msg) def _decrypt_password_data(self, parsed, **kwargs): """ This handler gets called after the GetPasswordData command has been executed. It is called with the and the ``parsed`` data. It checks to see if a private launch key was specified on the command. If it was, it tries to use that private key to decrypt the password data and replace it in the returned data dictionary. """ if self._key_path is not None: logger.debug("Decrypting password data using: %s", self._key_path) value = parsed.get('PasswordData') if not value: return try: with open(self._key_path) as pk_file: pk_contents = pk_file.read() private_key = rsa.PrivateKey.load_pkcs1(six.b(pk_contents)) value = base64.b64decode(value) value = rsa.decrypt(value, private_key) logger.debug(parsed) parsed['PasswordData'] = value.decode('utf-8') logger.debug(parsed) except Exception: logger.debug('Unable to decrypt PasswordData', exc_info=True) msg = ('Unable to decrypt password data using ' 'provided private key file.') raise ValueError(msg) awscli-1.14.44/awscli/customizations/ec2/protocolarg.py0000666454262600001440000000257013243367510024164 0ustar pysdk-ciamazon00000000000000# Copyright 2013 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. """ This customization allows the user to specify the values "tcp", "udp", or "icmp" as values for the --protocol parameter. The actual Protocol parameter of the operation accepts only integer protocol numbers. """ def _fix_args(params, **kwargs): key_name = 'Protocol' if key_name in params: if params[key_name] == 'tcp': params[key_name] = '6' elif params[key_name] == 'udp': params[key_name] = '17' elif params[key_name] == 'icmp': params[key_name] = '1' elif params[key_name] == 'all': params[key_name] = '-1' def register_protocol_args(cli): cli.register('before-parameter-build.ec2.CreateNetworkAclEntry', _fix_args) cli.register('before-parameter-build.ec2.ReplaceNetworkAclEntry', _fix_args) awscli-1.14.44/awscli/customizations/ec2/runinstances.py0000666454262600001440000001711713243367510024350 0ustar pysdk-ciamazon00000000000000# Copyright 2013 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. """ This customization adds two new parameters to the ``ec2 run-instance`` command. The first, ``--secondary-private-ip-addresses`` allows a list of IP addresses within the specified subnet to be associated with the new instance. The second, ``--secondary-ip-address-count`` allows you to specify how many additional IP addresses you want but the actual address will be assigned for you. This functionality (and much more) is also available using the ``--network-interfaces`` complex argument. This just makes two of the most commonly used features available more easily. """ from awscli.arguments import CustomArgument # --secondary-private-ip-address SECONDARY_PRIVATE_IP_ADDRESSES_DOCS = ( '[EC2-VPC] A secondary private IP address for the network interface ' 'or instance. You can specify this multiple times to assign multiple ' 'secondary IP addresses. If you want additional private IP addresses ' 'but do not need a specific address, use the ' '--secondary-private-ip-address-count option.') # --secondary-private-ip-address-count SECONDARY_PRIVATE_IP_ADDRESS_COUNT_DOCS = ( '[EC2-VPC] The number of secondary IP addresses to assign to ' 'the network interface or instance.') # --associate-public-ip-address ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS = ( '[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', help_text=SECONDARY_PRIVATE_IP_ADDRESSES_DOCS) argument_table['secondary-private-ip-addresses'] = arg arg = SecondaryPrivateIpAddressCountArgument( name='secondary-private-ip-address-count', help_text=SECONDARY_PRIVATE_IP_ADDRESS_COUNT_DOCS) argument_table['secondary-private-ip-address-count'] = arg arg = AssociatePublicIpAddressArgument( name='associate-public-ip-address', help_text=ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS, action='store_true', group_name='associate_public_ip') argument_table['associate-public-ip-address'] = arg arg = NoAssociatePublicIpAddressArgument( name='no-associate-public-ip-address', help_text=ASSOCIATE_PUBLIC_IP_ADDRESS_DOCS, action='store_false', group_name='associate_public_ip') argument_table['no-associate-public-ip-address'] = arg def _check_args(parsed_args, **kwargs): # This function checks the parsed args. If the user specified # the --network-interfaces option with any of the scalar options we # raise an error. arg_dict = vars(parsed_args) if arg_dict['network_interfaces']: for key in ('secondary_private_ip_addresses', 'secondary_private_ip_address_count', 'associate_public_ip_address'): if arg_dict[key]: msg = ('Mixing the --network-interfaces option ' 'with the simple, scalar options is ' 'not supported.') raise ValueError(msg) def _fix_args(params, **kwargs): # The RunInstances request provides some parameters # such as --subnet-id and --security-group-id that can be specified # as separate options only if the request DOES NOT include a # NetworkInterfaces structure. In those cases, the values for # these parameters must be specified inside the NetworkInterfaces # structure. This function checks for those parameters # and fixes them if necessary. # NOTE: If the user is a default VPC customer, RunInstances # allows them to specify the security group by name or by id. # However, in this scenario we can only support id because # we can't place a group name in the NetworkInterfaces structure. network_interface_params = [ 'PrivateIpAddresses', 'SecondaryPrivateIpAddressCount', 'AssociatePublicIpAddress' ] if 'NetworkInterfaces' in params: 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): # Register all of the events for customizing BundleInstance for event, handler in EVENTS: event_handler.register(event, handler) def _build_network_interfaces(params, key, value): # Build up the NetworkInterfaces data structure if 'NetworkInterfaces' not in params: params['NetworkInterfaces'] = [{'DeviceIndex': 0}] if key == 'PrivateIpAddresses': if 'PrivateIpAddresses' not in params['NetworkInterfaces'][0]: params['NetworkInterfaces'][0]['PrivateIpAddresses'] = value else: params['NetworkInterfaces'][0][key] = value class SecondaryPrivateIpAddressesArgument(CustomArgument): def add_to_parser(self, parser, cli_name=None): parser.add_argument(self.cli_name, dest=self.py_name, default=self._default, nargs='*') def add_to_params(self, parameters, value): if value: value = [{'PrivateIpAddress': v, 'Primary': False} for v in value] _build_network_interfaces( parameters, 'PrivateIpAddresses', value) class SecondaryPrivateIpAddressCountArgument(CustomArgument): def add_to_parser(self, parser, cli_name=None): parser.add_argument(self.cli_name, dest=self.py_name, default=self._default, type=int) def add_to_params(self, parameters, value): if 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) class NoAssociatePublicIpAddressArgument(CustomArgument): def add_to_params(self, parameters, value): if value is False: _build_network_interfaces( parameters, 'AssociatePublicIpAddress', value) awscli-1.14.44/awscli/customizations/ec2/addcount.py0000666454262600001440000000566013243367510023435 0ustar pysdk-ciamazon00000000000000# Copyright 2013 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 from botocore import model from awscli.arguments import BaseCLIArgument logger = logging.getLogger(__name__) DEFAULT = 1 HELP = """

Number of instances to launch. If a single number is provided, it is assumed to be the minimum to launch (defaults to %d). If a range is provided in the form min:max then the first number is interpreted as the minimum number of instances to launch and the second is interpreted as the maximum number of instances to launch.

""" % DEFAULT def register_count_events(event_handler): event_handler.register( 'building-argument-table.ec2.run-instances', ec2_add_count) event_handler.register( 'before-parameter-build.ec2.RunInstances', set_default_count) def ec2_add_count(argument_table, **kwargs): argument_table['count'] = CountArgument('count') del argument_table['min-count'] del argument_table['max-count'] def set_default_count(params, **kwargs): params.setdefault('MaxCount', DEFAULT) params.setdefault('MinCount', DEFAULT) class CountArgument(BaseCLIArgument): def __init__(self, name): self.argument_model = model.Shape('CountArgument', {'type': 'string'}) self._name = name self._required = False @property def cli_name(self): return '--' + self._name @property def cli_type_name(self): return 'string' @property def required(self): return self._required @required.setter def required(self, value): self._required = value @property def documentation(self): return HELP def add_to_parser(self, parser): # We do NOT set default value here. It will be set later by event hook. parser.add_argument(self.cli_name, metavar=self.py_name, help='Number of instances to launch') def add_to_params(self, parameters, value): if value is None: # NO-OP if value is not explicitly set by user return try: if ':' in value: minstr, maxstr = value.split(':') else: minstr, maxstr = (value, value) parameters['MinCount'] = int(minstr) parameters['MaxCount'] = int(maxstr) except: msg = ('count parameter should be of ' 'form min[:max] (e.g. 1 or 1:10)') raise ValueError(msg) awscli-1.14.44/awscli/customizations/ec2/paginate.py0000666454262600001440000000440013243367510023413 0ustar pysdk-ciamazon00000000000000# 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. def register_ec2_page_size_injector(event_emitter): EC2PageSizeInjector().register(event_emitter) class EC2PageSizeInjector(object): # Operations to auto-paginate and their specific whitelists. # Format: # Key: Operation # Value: List of parameters to add to whitelist for that operation. TARGET_OPERATIONS = { "describe-volumes": [], "describe-snapshots": ['OwnerIds', 'RestorableByUserIds'] } # Parameters which should be whitelisted for every operation. UNIVERSAL_WHITELIST = ['NextToken', 'DryRun', 'PaginationConfig'] DEFAULT_PAGE_SIZE = 1000 def register(self, event_emitter): """Register `inject` for each target operation.""" event_template = "calling-command.ec2.%s" for operation in self.TARGET_OPERATIONS: event = event_template % operation event_emitter.register_last(event, self.inject) def inject(self, event_name, parsed_globals, call_parameters, **kwargs): """Conditionally inject PageSize.""" if not parsed_globals.paginate: return pagination_config = call_parameters.get('PaginationConfig', {}) if 'PageSize' in pagination_config: return operation_name = event_name.split('.')[-1] whitelisted_params = self.TARGET_OPERATIONS.get(operation_name) if whitelisted_params is None: return whitelisted_params = whitelisted_params + self.UNIVERSAL_WHITELIST for param in call_parameters: if param not in whitelisted_params: return pagination_config['PageSize'] = self.DEFAULT_PAGE_SIZE call_parameters['PaginationConfig'] = pagination_config awscli-1.14.44/awscli/customizations/ec2/__init__.py0000666454262600001440000000106513243367510023366 0ustar pysdk-ciamazon00000000000000# 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. awscli-1.14.44/awscli/customizations/route53.py0000666454262600001440000000224313243367510022463 0ustar pysdk-ciamazon00000000000000# 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. def register_create_hosted_zone_doc_fix(cli): # We can remove this customization once we begin documenting # members of complex parameters because the member's docstring # has the necessary documentation. cli.register( 'doc-option.route53.create-hosted-zone.hosted-zone-config', add_private_zone_note) def add_private_zone_note(help_command, **kwargs): note = ( '

Note do not include PrivateZone in this ' 'input structure. Its value is returned in the output to the command.' '

' ) help_command.doc.include_doc_string(note) awscli-1.14.44/awscli/customizations/datapipeline/0000777454262600001440000000000013243367512023243 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/customizations/datapipeline/listrunsformatter.py0000666454262600001440000000412313243367510027422 0ustar pysdk-ciamazon00000000000000# 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. from awscli.formatter import FullyBufferedFormatter class ListRunsFormatter(FullyBufferedFormatter): TITLE_ROW_FORMAT_STRING = " %-50.50s %-19.19s %-23.23s" FIRST_ROW_FORMAT_STRING = "%4d. %-50.50s %-19.19s %-23.23s" SECOND_ROW_FORMAT_STRING = " %-50.50s %-19.19s %-19.19s" def _format_response(self, command_name, response, stream): self._print_headers(stream) for i, obj in enumerate(response): self._print_row(i, obj, stream) def _print_headers(self, stream): stream.write(self.TITLE_ROW_FORMAT_STRING % ( "Name", "Scheduled Start", "Status")) stream.write('\n') second_row = (self.SECOND_ROW_FORMAT_STRING % ( "ID", "Started", "Ended")) stream.write(second_row) stream.write('\n') stream.write('-' * len(second_row)) stream.write('\n') def _print_row(self, index, obj, stream): logical_name = obj['@componentParent'] object_id = obj['@id'] scheduled_start_date = obj.get('@scheduledStartTime', '') status = obj.get('@status', '') start_date = obj.get('@actualStartTime', '') end_date = obj.get('@actualEndTime', '') first_row = self.FIRST_ROW_FORMAT_STRING % ( index + 1, logical_name, scheduled_start_date, status) second_row = self.SECOND_ROW_FORMAT_STRING % ( object_id, start_date, end_date) stream.write(first_row) stream.write('\n') stream.write(second_row) stream.write('\n\n') awscli-1.14.44/awscli/customizations/datapipeline/constants.py0000666454262600001440000000354713243367510025640 0ustar pysdk-ciamazon00000000000000# 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. # Declare all the constants used by DataPipeline in this file # DataPipeline role names DATAPIPELINE_DEFAULT_SERVICE_ROLE_NAME = "DataPipelineDefaultRole" DATAPIPELINE_DEFAULT_RESOURCE_ROLE_NAME = "DataPipelineDefaultResourceRole" # DataPipeline role arn names DATAPIPELINE_DEFAULT_SERVICE_ROLE_ARN = ("arn:aws:iam::aws:policy/" "service-role/AWSDataPipelineRole") DATAPIPELINE_DEFAULT_RESOURCE_ROLE_ARN = ("arn:aws:iam::aws:policy/" "service-role/" "AmazonEC2RoleforDataPipelineRole") # Assume Role Policy definitions for roles DATAPIPELINE_DEFAULT_RESOURCE_ROLE_ASSUME_POLICY = { "Version": "2008-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": {"Service": "ec2.amazonaws.com"}, "Action": "sts:AssumeRole" } ] } DATAPIPELINE_DEFAULT_SERVICE_ROLE_ASSUME_POLICY = { "Version": "2008-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": {"Service": ["datapipeline.amazonaws.com", "elasticmapreduce.amazonaws.com"] }, "Action": "sts:AssumeRole" } ] } awscli-1.14.44/awscli/customizations/datapipeline/createdefaultroles.py0000666454262600001440000002251013243367510027470 0ustar pysdk-ciamazon00000000000000# 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. # Class to create default roles for datapipeline import logging from awscli.customizations.datapipeline.constants \ import DATAPIPELINE_DEFAULT_SERVICE_ROLE_NAME, \ DATAPIPELINE_DEFAULT_RESOURCE_ROLE_NAME, \ DATAPIPELINE_DEFAULT_SERVICE_ROLE_ARN, \ DATAPIPELINE_DEFAULT_RESOURCE_ROLE_ARN, \ DATAPIPELINE_DEFAULT_SERVICE_ROLE_ASSUME_POLICY, \ DATAPIPELINE_DEFAULT_RESOURCE_ROLE_ASSUME_POLICY from awscli.customizations.commands import BasicCommand from awscli.customizations.datapipeline.translator \ import display_response, dict_to_string, get_region from botocore.exceptions import ClientError LOG = logging.getLogger(__name__) class CreateDefaultRoles(BasicCommand): NAME = "create-default-roles" DESCRIPTION = ('Creates the default IAM role ' + DATAPIPELINE_DEFAULT_SERVICE_ROLE_NAME + ' and ' + DATAPIPELINE_DEFAULT_RESOURCE_ROLE_NAME + ' which are used while creating an EMR cluster.\n' 'If the roles do not exist, create-default-roles ' 'will automatically create them and set their policies.' ' If these roles are already ' 'created create-default-roles' ' will not update their policies.' '\n') def __init__(self, session, formatter=None): super(CreateDefaultRoles, self).__init__(session) def _run_main(self, parsed_args, parsed_globals, **kwargs): """Call to run the commands""" self._region = get_region(self._session, parsed_globals) self._endpoint_url = parsed_globals.endpoint_url self._iam_client = self._session.create_client( 'iam', region_name=self._region, endpoint_url=self._endpoint_url, verify=parsed_globals.verify_ssl ) return self._create_default_roles(parsed_args, parsed_globals) def _create_role(self, role_name, role_arn, role_policy): """Method to create a role for a given role name and arn if it does not exist """ role_result = None role_policy_result = None # Check if the role with the name exists if self._check_if_role_exists(role_name): LOG.debug('Role ' + role_name + ' exists.') else: LOG.debug('Role ' + role_name + ' does not exist.' ' Creating default role for EC2: ' + role_name) # Create a create using the IAM Client with a particular triplet # (role_name, role_arn, assume_role_policy) role_result = self._create_role_with_role_policy(role_name, role_policy, role_arn) role_policy_result = self._get_role_policy(role_arn) return role_result, role_policy_result def _construct_result(self, dpl_default_result, dpl_default_policy, dpl_default_res_result, dpl_default_res_policy): """Method to create a resultant list of responses for create roles for service and resource role """ result = [] self._construct_role_and_role_policy_structure(result, dpl_default_result, dpl_default_policy) self._construct_role_and_role_policy_structure(result, dpl_default_res_result, dpl_default_res_policy) return result def _create_default_roles(self, parsed_args, parsed_globals): # Setting the role name and arn value (datapipline_default_result, datapipline_default_policy) = self._create_role( DATAPIPELINE_DEFAULT_SERVICE_ROLE_NAME, DATAPIPELINE_DEFAULT_SERVICE_ROLE_ARN, DATAPIPELINE_DEFAULT_SERVICE_ROLE_ASSUME_POLICY) (datapipline_default_resource_result, datapipline_default_resource_policy) = self._create_role( DATAPIPELINE_DEFAULT_RESOURCE_ROLE_NAME, DATAPIPELINE_DEFAULT_RESOURCE_ROLE_ARN, DATAPIPELINE_DEFAULT_RESOURCE_ROLE_ASSUME_POLICY) # Check if the default EC2 Instance Profile for DataPipeline exists. instance_profile_name = DATAPIPELINE_DEFAULT_RESOURCE_ROLE_NAME if self._check_if_instance_profile_exists(instance_profile_name): LOG.debug('Instance Profile ' + instance_profile_name + ' exists.') else: LOG.debug('Instance Profile ' + instance_profile_name + 'does not exist. Creating default Instance Profile ' + instance_profile_name) self._create_instance_profile_with_role(instance_profile_name, instance_profile_name) result = self._construct_result(datapipline_default_result, datapipline_default_policy, datapipline_default_resource_result, datapipline_default_resource_policy) display_response(self._session, 'create_role', result, parsed_globals) return 0 def _get_role_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["Policy"]["DefaultVersionId"]) return policy_version_details["PolicyVersion"]["Document"] def _create_role_with_role_policy( self, role_name, assume_role_policy, role_arn): """Method to create role with a given rolename, assume_role_policy and role_arn """ # Create a role using IAM client CreateRole API create_role_response = self._iam_client.create_role( RoleName=role_name, AssumeRolePolicyDocument=dict_to_string( assume_role_policy)) # Create a role using IAM client AttachRolePolicy API self._iam_client.attach_role_policy(PolicyArn=role_arn, RoleName=role_name) return create_role_response def _construct_role_and_role_policy_structure( self, list_val, response, policy): """Method to construct the message to be displayed to the user""" # If the response is not none they we get the role name # from the response and # append the policy information to the response if response is not None and response['Role'] is not None: list_val.append({'Role': response['Role'], 'RolePolicy': policy}) return list_val def _check_if_instance_profile_exists(self, instance_profile_name): """Method to verify if a particular role exists""" try: # Client call to get the instance profile with that name self._iam_client.get_instance_profile( InstanceProfileName=instance_profile_name) except ClientError as e: # If the instance profile does not exist then the error message # would contain the required message if e.response['Error']['Code'] == 'NoSuchEntity': # No instance profile error. return False else: # Some other error. raise. raise e return True def _check_if_role_exists(self, role_name): """Method to verify if a particular role exists""" try: # Client call to get the role self._iam_client.get_role(RoleName=role_name) except ClientError as e: # If the role does not exist then the error message # would contain the required message. if e.response['Error']['Code'] == 'NoSuchEntity': # No role error. return False else: # Some other error. raise. raise e return True def _create_instance_profile_with_role(self, instance_profile_name, role_name): """Method to create the instance profile with the role""" # Setting the value for instance profile name # Client call to create an instance profile self._iam_client.create_instance_profile( InstanceProfileName=instance_profile_name) # Adding the role to the Instance Profile self._iam_client.add_role_to_instance_profile( InstanceProfileName=instance_profile_name, RoleName=role_name) awscli-1.14.44/awscli/customizations/datapipeline/__init__.py0000666454262600001440000004063213243367510025357 0ustar pysdk-ciamazon00000000000000# 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 json from datetime import datetime, timedelta from awscli.formatter import get_formatter from awscli.arguments import CustomArgument from awscli.customizations.commands import BasicCommand from awscli.customizations.datapipeline import translator from awscli.customizations.datapipeline.createdefaultroles \ import CreateDefaultRoles from awscli.customizations.datapipeline.listrunsformatter \ import ListRunsFormatter DEFINITION_HELP_TEXT = """\ The JSON pipeline definition. If the pipeline definition is in a file you can use the file:// syntax to specify a filename. """ PARAMETER_OBJECTS_HELP_TEXT = """\ The JSON parameter objects. If the parameter objects are in a file you can use the file:// syntax to specify a filename. You can optionally provide these in pipeline definition as well. Parameter objects provided on command line would replace the one in definition. """ PARAMETER_VALUES_HELP_TEXT = """\ The JSON parameter values. If the parameter values are in a file you can use the file:// syntax to specify a filename. You can optionally provide these in pipeline definition as well. Parameter values provided on command line would replace the one in definition. """ INLINE_PARAMETER_VALUES_HELP_TEXT = """\ The JSON parameter values. You can specify these as key-value pairs in the key=value format. Multiple parameters are separated by a space. For list type parameter values 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): pass class ParameterDefinitionError(Exception): def __init__(self, msg): full_msg = ("Error in parameter: %s\n" % msg) super(ParameterDefinitionError, self).__init__(full_msg) self.msg = msg def register_customizations(cli): cli.register( 'building-argument-table.datapipeline.put-pipeline-definition', add_pipeline_definition) cli.register( 'building-argument-table.datapipeline.activate-pipeline', activate_pipeline_definition) cli.register( 'after-call.datapipeline.GetPipelineDefinition', translate_definition) cli.register( 'building-command-table.datapipeline', register_commands) cli.register_last( 'doc-output.datapipeline.get-pipeline-definition', document_translation) def register_commands(command_table, session, **kwargs): command_table['list-runs'] = ListRunsCommand(session) command_table['create-default-roles'] = CreateDefaultRoles(session) def document_translation(help_command, **kwargs): # Remove all the writes until we get to the output. # I don't think this is the ideal way to do this, we should # improve our plugin/doc system to make this easier. 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======') doc.write( '\nThe output of this command is the pipeline definition, which' ' is documented in the ' '`Pipeline Definition File Syntax ' '`__') def add_pipeline_definition(argument_table, **kwargs): argument_table['pipeline-definition'] = PipelineDefinitionArgument( 'pipeline-definition', required=True, help_text=DEFINITION_HELP_TEXT) argument_table['parameter-objects'] = ParameterObjectsArgument( 'parameter-objects', required=False, help_text=PARAMETER_OBJECTS_HELP_TEXT) argument_table['parameter-values-uri'] = ParameterValuesArgument( 'parameter-values-uri', required=False, help_text=PARAMETER_VALUES_HELP_TEXT) # Need to use an argument model for inline parameters to accept a list argument_table['parameter-values'] = ParameterValuesInlineArgument( 'parameter-values', required=False, nargs='+', help_text=INLINE_PARAMETER_VALUES_HELP_TEXT) # The pipeline-objects is no longer needed required because # a user can provide a pipeline-definition instead. # get-pipeline-definition also displays the output in the # translated format. del argument_table['pipeline-objects'] def activate_pipeline_definition(argument_table, **kwargs): argument_table['parameter-values-uri'] = ParameterValuesArgument( 'parameter-values-uri', required=False, help_text=PARAMETER_VALUES_HELP_TEXT) # Need to use an argument model for inline parameters to accept a list argument_table['parameter-values'] = ParameterValuesInlineArgument( 'parameter-values', required=False, nargs='+', help_text=INLINE_PARAMETER_VALUES_HELP_TEXT, ) def translate_definition(parsed, **kwargs): translator.api_to_definition(parsed) def convert_described_objects(api_describe_objects, sort_key_func=None): # We need to take a field list that looks like this: # {u'key': u'@sphere', u'stringValue': u'INSTANCE'}, # into {"@sphere": "INSTANCE}. # We convert the fields list into a field dict. converted = [] for obj in api_describe_objects: new_fields = { '@id': obj['id'], 'name': obj['name'], } for field in obj['fields']: new_fields[field['key']] = field.get('stringValue', field.get('refValue')) converted.append(new_fields) if sort_key_func is not None: converted.sort(key=sort_key_func) return converted class QueryArgBuilder(object): """ Convert CLI arguments to Query arguments used by QueryObject. """ def __init__(self, current_time=None): if current_time is None: current_time = datetime.utcnow() self.current_time = current_time def build_query(self, parsed_args): selectors = [] if parsed_args.start_interval is None and \ parsed_args.schedule_interval is None: # If no intervals are specified, default # to a start time of 4 days ago and an end time # of right now. end_datetime = self.current_time start_datetime = end_datetime - timedelta(days=4) start_time_str = start_datetime.strftime('%Y-%m-%dT%H:%M:%S') end_time_str = end_datetime.strftime('%Y-%m-%dT%H:%M:%S') selectors.append({ 'fieldName': '@actualStartTime', 'operator': { 'type': 'BETWEEN', 'values': [start_time_str, end_time_str] } }) else: self._build_schedule_times(selectors, parsed_args) if parsed_args.status is not None: self._build_status(selectors, parsed_args) query = {'selectors': selectors} return query def _build_schedule_times(self, selectors, parsed_args): if parsed_args.start_interval is not None: start_time_str = parsed_args.start_interval[0] end_time_str = parsed_args.start_interval[1] selectors.append({ 'fieldName': '@actualStartTime', 'operator': { 'type': 'BETWEEN', 'values': [start_time_str, end_time_str] } }) if parsed_args.schedule_interval is not None: start_time_str = parsed_args.schedule_interval[0] end_time_str = parsed_args.schedule_interval[1] selectors.append({ 'fieldName': '@scheduledStartTime', 'operator': { 'type': 'BETWEEN', 'values': [start_time_str, end_time_str] } }) def _build_status(self, selectors, parsed_args): selectors.append({ 'fieldName': '@status', 'operator': { 'type': 'EQ', 'values': [status.upper() for status in parsed_args.status] } }) class PipelineDefinitionArgument(CustomArgument): def add_to_params(self, parameters, value): if value is None: return parsed = json.loads(value) api_objects = translator.definition_to_api_objects(parsed) parameter_objects = translator.definition_to_api_parameters(parsed) parameter_values = translator.definition_to_parameter_values(parsed) parameters['pipelineObjects'] = api_objects # Use Parameter objects and values from def if not already provided if 'parameterObjects' not in parameters \ and parameter_objects is not None: parameters['parameterObjects'] = parameter_objects if 'parameterValues' not in parameters \ and parameter_values is not None: parameters['parameterValues'] = parameter_values class ParameterObjectsArgument(CustomArgument): def add_to_params(self, parameters, value): if value is None: return parsed = json.loads(value) parameter_objects = translator.definition_to_api_parameters(parsed) parameters['parameterObjects'] = parameter_objects class ParameterValuesArgument(CustomArgument): def add_to_params(self, parameters, value): if value is None: return if parameters.get('parameterValues', None) is not None: raise Exception( "Only parameter-values or parameter-values-uri is allowed" ) parsed = json.loads(value) parameter_values = translator.definition_to_parameter_values(parsed) parameters['parameterValues'] = parameter_values class ParameterValuesInlineArgument(CustomArgument): def add_to_params(self, parameters, value): if value is None: return if parameters.get('parameterValues', None) is not None: raise Exception( "Only parameter-values or parameter-values-uri is allowed" ) parameter_object = {} # break string into = point for argument in value: try: argument_components = argument.split('=', 1) key = argument_components[0] value = argument_components[1] if key in parameter_object: parameter_object[key] = [parameter_object[key], value] else: parameter_object[key] = value except IndexError: raise ParameterDefinitionError( "Invalid inline parameter format: %s" % argument ) parsed = {'values': parameter_object} parameter_values = translator.definition_to_parameter_values(parsed) parameters['parameterValues'] = parameter_values class ListRunsCommand(BasicCommand): NAME = 'list-runs' DESCRIPTION = ( 'Lists the times the specified pipeline has run. ' 'You can optionally filter the complete list of ' 'results to include only the runs you are interested in.') ARG_TABLE = [ {'name': 'pipeline-id', 'help_text': 'The identifier of the pipeline.', 'action': 'store', 'required': True, 'cli_type_name': 'string', }, {'name': 'status', 'help_text': ( 'Filters the list to include only runs in the ' 'specified statuses. ' 'The valid statuses are as follows: waiting, pending, cancelled, ' 'running, finished, failed, waiting_for_runner, ' 'and waiting_on_dependencies.'), 'action': 'store'}, {'name': 'start-interval', 'help_text': ( 'Filters the list to include only runs that started ' 'within the specified interval.'), 'action': 'store', 'required': False, 'cli_type_name': 'string', }, {'name': 'schedule-interval', 'help_text': ( 'Filters the list to include only runs that are scheduled to ' 'start within the specified interval.'), 'action': 'store', 'required': False, 'cli_type_name': 'string', }, ] VALID_STATUS = ['waiting', 'pending', 'cancelled', 'running', 'finished', 'failed', 'waiting_for_runner', 'waiting_on_dependencies', 'shutting_down'] def _run_main(self, parsed_args, parsed_globals, **kwargs): self._set_client(parsed_globals) self._parse_type_args(parsed_args) self._list_runs(parsed_args, parsed_globals) def _set_client(self, parsed_globals): # This is called from _run_main and is used to ensure that we have # a service/endpoint object to work with. self.client = self._session.create_client( 'datapipeline', region_name=parsed_globals.region, endpoint_url=parsed_globals.endpoint_url, verify=parsed_globals.verify_ssl) def _parse_type_args(self, parsed_args): # TODO: give good error messages! # Parse the start/schedule times. # Parse the status csv. if parsed_args.start_interval is not None: parsed_args.start_interval = [ arg.strip() for arg in parsed_args.start_interval.split(',')] if parsed_args.schedule_interval is not None: parsed_args.schedule_interval = [ arg.strip() for arg in parsed_args.schedule_interval.split(',')] if parsed_args.status is not None: parsed_args.status = [ arg.strip() for arg in parsed_args.status.split(',')] self._validate_status_choices(parsed_args.status) def _validate_status_choices(self, statuses): for status in statuses: if status not in self.VALID_STATUS: raise ValueError("Invalid status: %s, must be one of: %s" % (status, ', '.join(self.VALID_STATUS))) 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) converted = convert_described_objects( objects, sort_key_func=lambda x: (x.get('@scheduledStartTime'), x.get('name'))) formatter = self._get_formatter(parsed_globals) formatter(self.NAME, converted) def _describe_objects(self, pipeline_id, object_ids): # 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( pipelineId=pipeline_id, sphere='INSTANCE', query=query) parsed = paginator.build_full_result() return parsed['ids'] def _get_formatter(self, parsed_globals): output = parsed_globals.output if output is None: return ListRunsFormatter(parsed_globals) else: return get_formatter(output, parsed_globals) awscli-1.14.44/awscli/customizations/datapipeline/translator.py0000666454262600001440000001605413243367510026012 0ustar pysdk-ciamazon00000000000000# 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. import json from awscli.clidriver import CLIOperationCaller class PipelineDefinitionError(Exception): def __init__(self, msg, definition): full_msg = ( "Error in pipeline definition: %s\n" % msg) super(PipelineDefinitionError, self).__init__(full_msg) self.msg = msg self.definition = definition # Method to convert the dictionary input to a string # This is required for escaping def dict_to_string(dictionary, indent=2): return json.dumps(dictionary, indent=indent) # 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 # Method to display the response for a particular CLI operation def display_response(session, operation_name, result, parsed_globals): 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) def api_to_definition(definition): # When we're translating from api_response -> definition # we have to be careful *not* to mutate the existing # response as other code might need to the original # api_response. if 'pipelineObjects' in definition: definition['objects'] = _api_to_objects_definition( definition.pop('pipelineObjects')) if 'parameterObjects' in definition: definition['parameters'] = _api_to_parameters_definition( definition.pop('parameterObjects')) if 'parameterValues' in definition: definition['values'] = _api_to_values_definition( definition.pop('parameterValues')) return definition def definition_to_api_objects(definition): if 'objects' not in definition: raise PipelineDefinitionError('Missing "objects" key', definition) api_elements = [] # To convert to the structure expected by the service, # we convert the existing structure to a list of dictionaries. # Each dictionary has a 'fields', 'id', and 'name' key. for element in definition['objects']: try: element_id = element.pop('id') except KeyError: raise PipelineDefinitionError('Missing "id" key of element: %s' % json.dumps(element), definition) api_object = {'id': element_id} # If a name is provided, then we use that for the name, # otherwise the id is used for the name. name = element.pop('name', element_id) api_object['name'] = name # Now we need the field list. Each element in the field list is a dict # with a 'key', 'stringValue'|'refValue' fields = [] for key, value in sorted(element.items()): fields.extend(_parse_each_field(key, value)) api_object['fields'] = fields api_elements.append(api_object) return api_elements def definition_to_api_parameters(definition): if 'parameters' not in definition: return None parameter_objects = [] for element in definition['parameters']: try: parameter_id = element.pop('id') except KeyError: raise PipelineDefinitionError('Missing "id" key of parameter: %s' % json.dumps(element), definition) parameter_object = {'id': parameter_id} # Now we need the attribute list. Each element in the attribute list # is a dict with a 'key', 'stringValue' attributes = [] for key, value in sorted(element.items()): attributes.extend(_parse_each_field(key, value)) parameter_object['attributes'] = attributes parameter_objects.append(parameter_object) return parameter_objects def definition_to_parameter_values(definition): if 'values' not in definition: return None parameter_values = [] for key in definition['values']: parameter_values.extend( _convert_single_parameter_value(key, definition['values'][key])) return parameter_values def _parse_each_field(key, value): values = [] if isinstance(value, list): for item in value: values.append(_convert_single_field(key, item)) else: values.append(_convert_single_field(key, value)) return values def _convert_single_field(key, value): field = {'key': key} if isinstance(value, dict) and list(value.keys()) == ['ref']: field['refValue'] = value['ref'] else: field['stringValue'] = value return field def _convert_single_parameter_value(key, values): parameter_values = [] if isinstance(values, list): for each_value in values: parameter_value = {'id': key, 'stringValue': each_value} parameter_values.append(parameter_value) else: parameter_value = {'id': key, 'stringValue': values} parameter_values.append(parameter_value) return parameter_values def _api_to_objects_definition(api_response): pipeline_objects = [] for element in api_response: current = { 'id': element['id'], 'name': element['name'] } for field in element['fields']: key = field['key'] if 'stringValue' in field: value = field['stringValue'] else: value = {'ref': field['refValue']} _add_value(key, value, current) pipeline_objects.append(current) return pipeline_objects def _api_to_parameters_definition(api_response): parameter_objects = [] for element in api_response: current = { 'id': element['id'] } for attribute in element['attributes']: _add_value(attribute['key'], attribute['stringValue'], current) parameter_objects.append(current) return parameter_objects def _api_to_values_definition(api_response): pipeline_values = {} for element in api_response: _add_value(element['id'], element['stringValue'], pipeline_values) return pipeline_values def _add_value(key, value, current_map): if key not in current_map: current_map[key] = value elif isinstance(current_map[key], list): # Dupe keys result in values aggregating # into a list. current_map[key].append(value) else: converted_list = [current_map[key], value] current_map[key] = converted_list awscli-1.14.44/awscli/customizations/configservice/0000777454262600001440000000000013243367512023432 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/customizations/configservice/rename_cmd.py0000666454262600001440000000163413243367510026100 0ustar pysdk-ciamazon00000000000000# 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 import utils def register_rename_config(cli): cli.register('building-command-table.main', change_name) def change_name(command_table, session, **kwargs): """ Change all existing ``aws config`` commands to ``aws configservice`` commands. """ utils.rename_command(command_table, 'config', 'configservice') awscli-1.14.44/awscli/customizations/configservice/subscribe.py0000666454262600001440000001552413243367510025772 0ustar pysdk-ciamazon00000000000000# 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. import json import sys from awscli.customizations.commands import BasicCommand from awscli.customizations.utils import s3_bucket_exists from awscli.customizations.s3.utils import find_bucket_key S3_BUCKET = {'name': 's3-bucket', 'required': True, 'help_text': ('The S3 bucket that the AWS Config delivery channel' ' will use. If the bucket does not exist, it will ' 'be automatically created. The value for this ' 'argument should follow the form ' 'bucket/prefix. Note that the prefix is optional.')} SNS_TOPIC = {'name': 'sns-topic', 'required': True, 'help_text': ('The SNS topic that the AWS Config delivery channel' ' will use. If the SNS topic does not exist, it ' 'will be automatically created. Value for this ' 'should be a valid SNS topic name or the ARN of an ' 'existing SNS topic.')} IAM_ROLE = {'name': 'iam-role', 'required': True, 'help_text': ('The IAM role that the AWS Config configuration ' 'recorder will use to record current resource ' 'configurations. Value for this should be the ' 'ARN of the desired IAM role.')} def register_subscribe(cli): cli.register('building-command-table.configservice', add_subscribe) def add_subscribe(command_table, session, **kwargs): command_table['subscribe'] = SubscribeCommand(session) class SubscribeCommand(BasicCommand): NAME = 'subscribe' DESCRIPTION = ('Subcribes user to AWS Config by creating an AWS Config ' 'delivery channel and configuration recorder to track ' 'AWS resource configurations. The names of the default ' 'channel and configuration recorder will be default.') ARG_TABLE = [S3_BUCKET, SNS_TOPIC, IAM_ROLE] def __init__(self, session): self._s3_client = None self._sns_client = None self._config_client = None super(SubscribeCommand, self).__init__(session) def _run_main(self, parsed_args, parsed_globals): # Setup the necessary all of the necessary clients. self._setup_clients(parsed_globals) # Prepare a s3 bucket for use. s3_bucket_helper = S3BucketHelper(self._s3_client) bucket, prefix = s3_bucket_helper.prepare_bucket(parsed_args.s3_bucket) # Prepare a sns topic for use. sns_topic_helper = SNSTopicHelper(self._sns_client) sns_topic_arn = sns_topic_helper.prepare_topic(parsed_args.sns_topic) name = 'default' # Create a configuration recorder. self._config_client.put_configuration_recorder( ConfigurationRecorder={ 'name': name, 'roleARN': parsed_args.iam_role } ) # Create a delivery channel. delivery_channel = { 'name': name, 's3BucketName': bucket, 'snsTopicARN': sns_topic_arn } if prefix: delivery_channel['s3KeyPrefix'] = prefix self._config_client.put_delivery_channel( DeliveryChannel=delivery_channel) # Start the configuration recorder. self._config_client.start_configuration_recorder( ConfigurationRecorderName=name ) # Describe the configuration recorders sys.stdout.write('Subscribe succeeded:\n\n') sys.stdout.write('Configuration Recorders: ') response = self._config_client.describe_configuration_recorders() sys.stdout.write( json.dumps(response['ConfigurationRecorders'], indent=4)) sys.stdout.write('\n\n') # Describe the delivery channels sys.stdout.write('Delivery Channels: ') response = self._config_client.describe_delivery_channels() sys.stdout.write(json.dumps(response['DeliveryChannels'], indent=4)) sys.stdout.write('\n') return 0 def _setup_clients(self, parsed_globals): client_args = { 'verify': parsed_globals.verify_ssl, 'region_name': parsed_globals.region } self._s3_client = self._session.create_client('s3', **client_args) self._sns_client = self._session.create_client('sns', **client_args) # Use the specified endpoint only for config related commands. client_args['endpoint_url'] = parsed_globals.endpoint_url self._config_client = self._session.create_client('config', **client_args) class S3BucketHelper(object): def __init__(self, s3_client): self._s3_client = s3_client def prepare_bucket(self, s3_path): bucket, key = find_bucket_key(s3_path) bucket_exists = self._check_bucket_exists(bucket) if not bucket_exists: self._create_bucket(bucket) sys.stdout.write('Using new S3 bucket: %s\n' % bucket) else: sys.stdout.write('Using existing S3 bucket: %s\n' % bucket) return bucket, key def _check_bucket_exists(self, bucket): return s3_bucket_exists(self._s3_client, bucket) def _create_bucket(self, bucket): region_name = self._s3_client.meta.region_name params = { 'Bucket': bucket } bucket_config = {'LocationConstraint': region_name} if region_name != 'us-east-1': params['CreateBucketConfiguration'] = bucket_config self._s3_client.create_bucket(**params) class SNSTopicHelper(object): def __init__(self, sns_client): self._sns_client = sns_client def prepare_topic(self, sns_topic): sns_topic_arn = sns_topic # Create the topic if a name is given. if not self._check_is_arn(sns_topic): response = self._sns_client.create_topic(Name=sns_topic) sns_topic_arn = response['TopicArn'] sys.stdout.write('Using new SNS topic: %s\n' % sns_topic_arn) else: sys.stdout.write('Using existing SNS topic: %s\n' % sns_topic_arn) return sns_topic_arn def _check_is_arn(self, sns_topic): # The name of topic cannot contain a colon only arns have colons. return ':' in sns_topic awscli-1.14.44/awscli/customizations/configservice/putconfigurationrecorder.py0000666454262600001440000000612213243367510031131 0ustar pysdk-ciamazon00000000000000# 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 copy from awscli.arguments import CLIArgument def register_modify_put_configuration_recorder(cli): cli.register( 'building-argument-table.configservice.put-configuration-recorder', extract_recording_group) def extract_recording_group(session, argument_table, **kwargs): # The purpose of this customization is to extract the recordingGroup # member from ConfigurationRecorder into its own argument. # This customization is needed because the recordingGroup member # breaks the shorthand syntax as it is a structure and not a scalar value. configuration_recorder_argument = argument_table['configuration-recorder'] configuration_recorder_model = copy.deepcopy( configuration_recorder_argument.argument_model) recording_group_model = copy.deepcopy( configuration_recorder_argument.argument_model. members['recordingGroup']) del configuration_recorder_model.members['recordingGroup'] argument_table['configuration-recorder'] = ConfigurationRecorderArgument( name='configuration-recorder', argument_model=configuration_recorder_model, operation_model=configuration_recorder_argument._operation_model, is_required=True, event_emitter=session.get_component('event_emitter'), serialized_name='ConfigurationRecorder' ) argument_table['recording-group'] = RecordingGroupArgument( name='recording-group', argument_model=recording_group_model, operation_model=configuration_recorder_argument._operation_model, is_required=False, event_emitter=session.get_component('event_emitter'), serialized_name='recordingGroup' ) class ConfigurationRecorderArgument(CLIArgument): def add_to_params(self, parameters, value): if value is None: return unpacked = self._unpack_argument(value) if 'ConfigurationRecorder' in parameters: current_value = parameters['ConfigurationRecorder'] current_value.update(unpacked) else: parameters['ConfigurationRecorder'] = unpacked class RecordingGroupArgument(CLIArgument): def add_to_params(self, parameters, value): if value is None: return unpacked = self._unpack_argument(value) if 'ConfigurationRecorder' in parameters: parameters['ConfigurationRecorder']['recordingGroup'] = unpacked else: parameters['ConfigurationRecorder'] = {} parameters['ConfigurationRecorder']['recordingGroup'] = unpacked awscli-1.14.44/awscli/customizations/configservice/getstatus.py0000666454262600001440000001024213243367510026024 0ustar pysdk-ciamazon00000000000000# 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. import sys from awscli.customizations.commands import BasicCommand def register_get_status(cli): cli.register('building-command-table.configservice', add_get_status) def add_get_status(command_table, session, **kwargs): command_table['get-status'] = GetStatusCommand(session) class GetStatusCommand(BasicCommand): NAME = 'get-status' DESCRIPTION = ('Reports the status of all of configuration ' 'recorders and delivery channels.') def __init__(self, session): self._config_client = None super(GetStatusCommand, self).__init__(session) def _run_main(self, parsed_args, parsed_globals): self._setup_client(parsed_globals) self._check_configuration_recorders() self._check_delivery_channels() return 0 def _setup_client(self, parsed_globals): client_args = { 'verify': parsed_globals.verify_ssl, 'region_name': parsed_globals.region, 'endpoint_url': parsed_globals.endpoint_url } self._config_client = self._session.create_client('config', **client_args) def _check_configuration_recorders(self): status = self._config_client.describe_configuration_recorder_status() sys.stdout.write('Configuration Recorders:\n\n') for configuration_recorder in status['ConfigurationRecordersStatus']: self._check_configure_recorder_status(configuration_recorder) sys.stdout.write('\n') def _check_configure_recorder_status(self, configuration_recorder): # Get the name of the recorder and print it out. name = configuration_recorder['name'] sys.stdout.write('name: %s\n' % name) # Get the recording status and print it out. recording = configuration_recorder['recording'] recording_map = {False: 'OFF', True: 'ON'} sys.stdout.write('recorder: %s\n' % recording_map[recording]) # If the recorder is on, get the last status and print it out. if recording: self._check_last_status(configuration_recorder) def _check_delivery_channels(self): status = self._config_client.describe_delivery_channel_status() sys.stdout.write('Delivery Channels:\n\n') for delivery_channel in status['DeliveryChannelsStatus']: self._check_delivery_channel_status(delivery_channel) sys.stdout.write('\n') def _check_delivery_channel_status(self, delivery_channel): # Get the name of the delivery channel and print it out. name = delivery_channel['name'] sys.stdout.write('name: %s\n' % name) # Obtain the various delivery statuses. stream_delivery = delivery_channel['configStreamDeliveryInfo'] history_delivery = delivery_channel['configHistoryDeliveryInfo'] snapshot_delivery = delivery_channel['configSnapshotDeliveryInfo'] # Print the statuses out if they exist. if stream_delivery: self._check_last_status(stream_delivery, 'stream delivery ') if history_delivery: self._check_last_status(history_delivery, 'history delivery ') if snapshot_delivery: self._check_last_status(snapshot_delivery, 'snapshot delivery ') def _check_last_status(self, status, status_name=''): last_status = status['lastStatus'] sys.stdout.write('last %sstatus: %s\n' % (status_name, last_status)) if last_status == "FAILURE": sys.stdout.write('error code: %s\n' % status['lastErrorCode']) sys.stdout.write('message: %s\n' % status['lastErrorMessage']) awscli-1.14.44/awscli/customizations/configservice/__init__.py0000666454262600001440000000106513243367510025543 0ustar pysdk-ciamazon00000000000000# 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. awscli-1.14.44/awscli/customizations/cloudformation/0000777454262600001440000000000013243367512023631 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/customizations/cloudformation/deployer.py0000666454262600001440000002260713243367510026033 0ustar pysdk-ciamazon00000000000000# 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: 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 awscli-1.14.44/awscli/customizations/cloudformation/yamlhelper.py0000666454262600001440000000466013243367510026351 0ustar pysdk-ciamazon00000000000000# 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 json 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 yaml_dump(dict_to_dump): """ Dumps the dictionary as a YAML document :param dict_to_dump: :return: """ return yaml.safe_dump(dict_to_dump, default_flow_style=False) 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) except ValueError: yaml.SafeLoader.add_multi_constructor( "!", intrinsics_multi_constructor) return yaml.safe_load(yamlstr) awscli-1.14.44/awscli/customizations/cloudformation/deploy.py0000666454262600001440000003406213243367510025502 0ustar pysdk-ciamazon00000000000000# 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_globals.region, 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 awscli-1.14.44/awscli/customizations/cloudformation/package.py0000666454262600001440000001275413243367510025605 0ustar pysdk-ciamazon00000000000000# 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.' ) } ] 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_globals.region, parsed_args.s3_prefix, parsed_args.kms_key_id, parsed_args.force_upload) 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) awscli-1.14.44/awscli/customizations/cloudformation/exceptions.py0000666454262600001440000000364113243367510026366 0ustar pysdk-ciamazon00000000000000 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.") awscli-1.14.44/awscli/customizations/cloudformation/artifact_exporter.py0000666454262600001440000003557113243367510027741 0ustar pysdk-ciamazon00000000000000# 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 awscli.compat import urlparse from contextlib import contextmanager from awscli.customizations.cloudformation import exceptions from awscli.customizations.cloudformation.yamlhelper import yaml_dump, \ yaml_parse 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 = resource_dict.get(property_name, None) 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): 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 """ 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 = resource_dict.get(self.PROPERTY_NAME, None) 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) 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 """ resource_dict[self.PROPERTY_NAME] = \ upload_local_artifacts(resource_id, resource_dict, self.PROPERTY_NAME, parent_dir, self.uploader) 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) resource_dict[self.PROPERTY_NAME] = 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) class ServerlessFunctionResource(Resource): PROPERTY_NAME = "CodeUri" FORCE_ZIP = True class ServerlessApiResource(Resource): PROPERTY_NAME = "DefinitionUri" # Don't package the directory if DefinitionUri is omitted. # Necessary to support DefinitionBody PACKAGE_NULL_PROPERTY = False class LambdaFunctionResource(ResourceWithS3UrlDict): PROPERTY_NAME = "Code" BUCKET_NAME_PROPERTY = "S3Bucket" OBJECT_KEY_PROPERTY = "S3Key" VERSION_PROPERTY = "S3ObjectVersion" FORCE_ZIP = True class ApiGatewayRestApiResource(ResourceWithS3UrlDict): PROPERTY_NAME = "BodyS3Location" PACKAGE_NULL_PROPERTY = False BUCKET_NAME_PROPERTY = "Bucket" OBJECT_KEY_PROPERTY = "Key" VERSION_PROPERTY = "Version" class ElasticBeanstalkApplicationVersion(ResourceWithS3UrlDict): PROPERTY_NAME = "SourceBundle" BUCKET_NAME_PROPERTY = "S3Bucket" OBJECT_KEY_PROPERTY = "S3Key" VERSION_PROPERTY = None class CloudFormationStackResource(Resource): """ Represents CloudFormation::Stack resource that can refer to a nested stack template via TemplateURL property. """ 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("https://s3.amazonaws.com/"): # 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") resource_dict[self.PROPERTY_NAME] = self.uploader.to_path_style_s3_url( parts["Key"], parts.get("Version", None)) EXPORT_DICT = { "AWS::Serverless::Function": ServerlessFunctionResource, "AWS::Serverless::Api": ServerlessApiResource, "AWS::ApiGateway::RestApi": ApiGatewayRestApiResource, "AWS::Lambda::Function": LambdaFunctionResource, "AWS::ElasticBeanstalk::ApplicationVersion": ElasticBeanstalkApplicationVersion, "AWS::CloudFormation::Stack": CloudFormationStackResource } class Template(object): """ Class to export a CloudFormation template """ def __init__(self, template_path, parent_dir, uploader, resources_to_export=EXPORT_DICT): """ 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.uploader = uploader 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. """ if "Resources" not in self.template_dict: return 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) if resource_type in self.resources_to_export: # Export code resources exporter = self.resources_to_export[resource_type]( self.uploader) exporter.export(resource_id, resource_dict, self.template_dir) return self.template_dict awscli-1.14.44/awscli/customizations/cloudformation/__init__.py0000666454262600001440000000240113243367510025735 0ustar pysdk-ciamazon00000000000000# 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) awscli-1.14.44/awscli/customizations/configure/0000777454262600001440000000000013243367512022565 5ustar pysdk-ciamazon00000000000000awscli-1.14.44/awscli/customizations/configure/configure.py0000666454262600001440000001350713243367510025124 0ustar pysdk-ciamazon00000000000000# 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 os import logging from botocore.exceptions import ProfileNotFound from awscli.compat import compat_input from awscli.customizations.commands import BasicCommand from awscli.customizations.configure.addmodel import AddModelCommand from awscli.customizations.configure.set import ConfigureSetCommand from awscli.customizations.configure.get import ConfigureGetCommand from awscli.customizations.configure.list import ConfigureListCommand from awscli.customizations.configure.writer import ConfigFileWriter from . import mask_value, profile_to_section logger = logging.getLogger(__name__) def register_configure_cmd(cli): cli.register('building-command-table.main', ConfigureCommand.add_command) class InteractivePrompter(object): def get_value(self, current_value, config_name, prompt_text=''): if config_name in ('aws_access_key_id', 'aws_secret_access_key'): current_value = mask_value(current_value) response = compat_input("%s [%s]: " % (prompt_text, current_value)) if not response: # If the user hits enter, we return a value of None # instead of an empty string. That way we can determine # whether or not a value has changed. response = None return response class ConfigureCommand(BasicCommand): NAME = 'configure' DESCRIPTION = BasicCommand.FROM_FILE() SYNOPSIS = ('aws configure [--profile profile-name]') EXAMPLES = ( 'To create a new configuration::\n' '\n' ' $ aws configure\n' ' AWS Access Key ID [None]: accesskey\n' ' AWS Secret Access Key [None]: secretkey\n' ' Default region name [None]: us-west-2\n' ' Default output format [None]:\n' '\n' 'To update just the region name::\n' '\n' ' $ aws configure\n' ' AWS Access Key ID [****]:\n' ' AWS Secret Access Key [****]:\n' ' Default region name [us-west-1]: us-west-2\n' ' Default output format [None]:\n' ) SUBCOMMANDS = [ {'name': 'list', 'command_class': ConfigureListCommand}, {'name': 'get', 'command_class': ConfigureGetCommand}, {'name': 'set', 'command_class': ConfigureSetCommand}, {'name': 'add-model', 'command_class': AddModelCommand} ] # If you want to add new values to prompt, update this list here. VALUES_TO_PROMPT = [ # (logical_name, config_name, prompt_text) ('aws_access_key_id', "AWS Access Key ID"), ('aws_secret_access_key', "AWS Secret Access Key"), ('region', "Default region name"), ('output', "Default output format"), ] def __init__(self, session, prompter=None, config_writer=None): super(ConfigureCommand, self).__init__(session) if prompter is None: prompter = InteractivePrompter() self._prompter = prompter if config_writer is None: config_writer = ConfigFileWriter() self._config_writer = config_writer def _run_main(self, parsed_args, parsed_globals): # Called when invoked with no args "aws configure" new_values = {} # This is the config from the config file scoped to a specific # profile. try: config = self._session.get_scoped_config() except ProfileNotFound: config = {} for config_name, prompt_text in self.VALUES_TO_PROMPT: current_value = config.get(config_name) new_value = self._prompter.get_value(current_value, config_name, prompt_text) if new_value is not None and new_value != current_value: new_values[config_name] = new_value config_filename = os.path.expanduser( self._session.get_config_variable('config_file')) if new_values: 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): # The access_key/secret_key are now *always* written to the shared # credentials file (~/.aws/credentials), see aws/aws-cli#847. # post-conditions: ~/.aws/credentials will have the updated credential # file values and new_values will have the cred vars removed. credential_file_values = {} if 'aws_access_key_id' in new_values: credential_file_values['aws_access_key_id'] = new_values.pop( 'aws_access_key_id') if 'aws_secret_access_key' in new_values: credential_file_values['aws_secret_access_key'] = new_values.pop( 'aws_secret_access_key') if credential_file_values: if profile_name is not None: credential_file_values['__section__'] = profile_name shared_credentials_filename = os.path.expanduser( self._session.get_config_variable('credentials_file')) self._config_writer.update_config( credential_file_values, shared_credentials_filename) awscli-1.14.44/awscli/customizations/configure/get.py0000666454262600001440000001023713243367510023717 0ustar pysdk-ciamazon00000000000000# 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 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]' EXAMPLES = BasicCommand.FROM_FILE('configure', 'get', '_examples.rst') ARG_TABLE = [ {'name': 'varname', 'help_text': 'The name of the config value to retrieve.', 'action': 'store', 'cli_type_name': 'string', 'positional_arg': True}, ] 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 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. config = self._session.get_scoped_config() value = config.get(varname) else: value = self._get_dotted_config_value(varname) 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. if num_dots == 1 and parts[0] in PREDEFINED_SECTION_NAMES: full_config = self._session.full_config section, config_name = varname.split('.') value = full_config.get(section, {}).get(config_name) if value is None: # Try to retrieve it from the profile config. 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']): 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:] value = self._session.full_config['profiles'].get( profile_name, {}).get(config_name) if len(remaining) == 1: try: value = value.get(remaining[-1]) except AttributeError: value = None return value awscli-1.14.44/awscli/customizations/configure/set.py0000666454262600001440000001104513243367510023731 0ustar pysdk-ciamazon00000000000000# 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 os from awscli.customizations.commands import BasicCommand from awscli.customizations.configure.writer import ConfigFileWriter from . import PREDEFINED_SECTION_NAMES, profile_to_section class ConfigureSetCommand(BasicCommand): NAME = 'set' DESCRIPTION = BasicCommand.FROM_FILE('configure', 'set', '_description.rst') SYNOPSIS = 'aws configure set varname value [--profile profile-name]' EXAMPLES = BasicCommand.FROM_FILE('configure', 'set', '_examples.rst') ARG_TABLE = [ {'name': 'varname', 'help_text': 'The name of the config value to set.', 'action': 'store', 'cli_type_name': 'string', 'positional_arg': True}, {'name': 'value', 'help_text': 'The value to set.', 'action': 'store', 'no_paramfile': True, # To disable the default paramfile behavior 'cli_type_name': 'string', 'positional_arg': True}, ] # Any variables specified in this list will be written to # the ~/.aws/credentials file instead of ~/.aws/config. _WRITE_TO_CREDS_FILE = ['aws_access_key_id', 'aws_secret_access_key', 'aws_session_token'] def __init__(self, session, config_writer=None): super(ConfigureSetCommand, self).__init__(session) if config_writer is None: config_writer = ConfigFileWriter() self._config_writer = config_writer def _run_main(self, args, parsed_globals): varname = args.varname value = args.value section = 'default' # Before handing things off to the config writer, # we need to find out three things: # 1. What section we're writing to (section). # 2. The name of the config key (varname) # 3. The actual value (value). if '.' not in varname: # unqualified name, scope it to the current # profile (or leave it as the 'default' section if # no profile is set). if self._session.profile is not None: section = profile_to_section(self._session.profile) else: # First figure out if it's been scoped to a profile. parts = varname.split('.') if parts[0] in ('default', 'profile'): # Then we know we're scoped to a profile. if parts[0] == 'default': section = 'default' remaining = parts[1:] else: # [profile, profile_name, ...] 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_to_section(self._session.profile) else: profile_name = self._session.get_config_variable('profile') if profile_name is not None: section = profile_name varname = parts[0] if len(parts) == 2: value = {parts[1]: value} elif len(parts) == 2: # Otherwise it's something like "set preview.service true" # of something in the [plugin] section. section, varname = parts config_filename = os.path.expanduser( self._session.get_config_variable('config_file')) updated_config = {'__section__': section, varname: value} if varname in self._WRITE_TO_CREDS_FILE: config_filename = os.path.expanduser( self._session.get_config_variable('credentials_file')) section_name = updated_config['__section__'] if section_name.startswith('profile '): updated_config['__section__'] = section_name[8:] self._config_writer.update_config(updated_config, config_filename) awscli-1.14.44/awscli/customizations/configure/addmodel.py0000666454262600001440000001140013243367510024702 0ustar pysdk-ciamazon00000000000000# 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 json import os from botocore.model import ServiceModel from awscli.customizations.commands import BasicCommand def _get_endpoint_prefix_to_name_mappings(session): # Get the mappings of endpoint prefixes to service names from the # available service models. prefixes_to_services = {} for service_name in session.get_available_services(): service_model = session.get_service_model(service_name) prefixes_to_services[service_model.endpoint_prefix] = service_name return prefixes_to_services def _get_service_name(session, endpoint_prefix): if endpoint_prefix in session.get_available_services(): # Check if the endpoint prefix is a pre-existing service. # If it is, use that endpoint prefix as the service name. return endpoint_prefix else: # The service may have a different endpoint prefix than its name # So we need to determine what the correct mapping may be. # Figure out the mappings of endpoint prefix to service names. name_mappings = _get_endpoint_prefix_to_name_mappings(session) # Determine the service name from the mapping. # If it does not exist in the mapping, return the original endpoint # prefix. return name_mappings.get(endpoint_prefix, endpoint_prefix) def get_model_location(session, service_definition, service_name=None): """Gets the path of where a service-2.json file should go in ~/.aws/models :type session: botocore.session.Session :param session: A session object :type service_definition: dict :param service_definition: The json loaded service definition :type service_name: str :param service_name: The service name to use. If this not provided, this will be determined from a combination of available services and the service definition. :returns: The path to where are model should be placed based on the service defintion and the current services in botocore. """ # Add the ServiceModel abstraction over the service json definition to # make it easier to work with. service_model = ServiceModel(service_definition) # Determine the service_name if not provided if service_name is None: endpoint_prefix = service_model.endpoint_prefix service_name = _get_service_name(session, endpoint_prefix) api_version = service_model.api_version # For the model location we only want the custom data path (~/.aws/models # not the one set by AWS_DATA_PATH) data_path = session.get_component('data_loader').CUSTOMER_DATA_PATH # Use the version of the model to determine the file's naming convention. service_model_name = ( 'service-%d.json' % int( float(service_definition.get('version', '2.0')))) return os.path.join(data_path, service_name, api_version, service_model_name) class AddModelCommand(BasicCommand): NAME = 'add-model' DESCRIPTION = ( 'Adds a service JSON model to the appropriate location in ' '~/.aws/models. Once the model gets added, CLI commands and Boto3 ' 'clients will be immediately available for the service JSON model ' 'provided.' ) ARG_TABLE = [ {'name': 'service-model', 'required': True, 'help_text': ( 'The contents of the service JSON model.')}, {'name': 'service-name', 'help_text': ( 'Overrides the default name used by the service JSON ' 'model to generate CLI service commands and Boto3 clients.')} ] def _run_main(self, parsed_args, parsed_globals): service_definition = json.loads(parsed_args.service_model) # Get the path to where the model should be written model_location = get_model_location( self._session, service_definition, parsed_args.service_name ) # If the service_name/api_version directories do not exist, # then create them. model_directory = os.path.dirname(model_location) if not os.path.exists(model_directory): os.makedirs(model_directory) # Write the model to the specified location with open(model_location, 'wb') as f: f.write(parsed_args.service_model.encode('utf-8')) return 0 awscli-1.14.44/awscli/customizations/configure/writer.py0000666454262600001440000002123213243367510024451 0ustar pysdk-ciamazon00000000000000# 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 os import re from . import SectionNotFoundError class ConfigFileWriter(object): SECTION_REGEX = re.compile(r'\[(?P
[^]]+)\]') OPTION_REGEX = re.compile( r'(?P