New upstream version 1.20.23
Noah Meyerhans
2 years ago
0 | 0 | Metadata-Version: 1.2 |
1 | 1 | Name: awscli |
2 | Version: 1.19.35 | |
2 | Version: 1.20.23 | |
3 | 3 | Summary: Universal Command Line Environment for AWS. |
4 | 4 | Home-page: http://aws.amazon.com/cli/ |
5 | 5 | Author: Amazon Web Services |
37 | 37 | |
38 | 38 | The aws-cli package works on Python versions: |
39 | 39 | |
40 | - 2.7.x and greater | |
41 | 40 | - 3.6.x and greater |
42 | 41 | - 3.7.x and greater |
43 | 42 | - 3.8.x and greater |
43 | ||
44 | On 01/15/2021 deprecation for Python 2.7 was announced and support was dropped | |
45 | on 07/15/2021. To avoid disruption, customers using the AWS CLI on Python 2.7 may | |
46 | need to upgrade their version of Python or pin the version of the AWS CLI. For | |
47 | more information, see this `blog post <https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/>`__. | |
44 | 48 | |
45 | 49 | On 10/29/2020 support for Python 3.4 and Python 3.5 was deprecated and |
46 | 50 | support was dropped on 02/01/2021. Customers using the AWS CLI on |
65 | 69 | |
66 | 70 | Installation |
67 | 71 | ~~~~~~~~~~~~ |
72 | ||
73 | Installation of the AWS CLI and its dependencies use a range of packaging | |
74 | features provided by ``pip`` and ``setuptools``. To ensure smooth installation, | |
75 | it's recommended to use: | |
76 | ||
77 | - ``pip``: 9.0.2 or greater | |
78 | - ``setuptools``: 36.2.0 or greater | |
68 | 79 | |
69 | 80 | The safest way to install the AWS CLI is to use |
70 | 81 | `pip <https://pip.pypa.io/en/stable/>`__ in a ``virtualenv``: |
322 | 333 | Classifier: Natural Language :: English |
323 | 334 | Classifier: License :: OSI Approved :: Apache Software License |
324 | 335 | Classifier: Programming Language :: Python |
325 | Classifier: Programming Language :: Python :: 2 | |
326 | Classifier: Programming Language :: Python :: 2.7 | |
327 | 336 | Classifier: Programming Language :: Python :: 3 |
328 | 337 | Classifier: Programming Language :: Python :: 3.6 |
329 | 338 | Classifier: Programming Language :: Python :: 3.7 |
330 | 339 | Classifier: Programming Language :: Python :: 3.8 |
331 | Requires-Python: >= 2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.* | |
340 | Requires-Python: >= 3.6 |
30 | 30 | |
31 | 31 | The aws-cli package works on Python versions: |
32 | 32 | |
33 | - 2.7.x and greater | |
34 | 33 | - 3.6.x and greater |
35 | 34 | - 3.7.x and greater |
36 | 35 | - 3.8.x and greater |
36 | ||
37 | On 01/15/2021 deprecation for Python 2.7 was announced and support was dropped | |
38 | on 07/15/2021. To avoid disruption, customers using the AWS CLI on Python 2.7 may | |
39 | need to upgrade their version of Python or pin the version of the AWS CLI. For | |
40 | more information, see this `blog post <https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/>`__. | |
37 | 41 | |
38 | 42 | On 10/29/2020 support for Python 3.4 and Python 3.5 was deprecated and |
39 | 43 | support was dropped on 02/01/2021. Customers using the AWS CLI on |
58 | 62 | |
59 | 63 | Installation |
60 | 64 | ~~~~~~~~~~~~ |
65 | ||
66 | Installation of the AWS CLI and its dependencies use a range of packaging | |
67 | features provided by ``pip`` and ``setuptools``. To ensure smooth installation, | |
68 | it's recommended to use: | |
69 | ||
70 | - ``pip``: 9.0.2 or greater | |
71 | - ``setuptools``: 36.2.0 or greater | |
61 | 72 | |
62 | 73 | The safest way to install the AWS CLI is to use |
63 | 74 | `pip <https://pip.pypa.io/en/stable/>`__ in a ``virtualenv``: |
0 | 0 | # CLI Python 3 Migration Guide |
1 | 1 | |
2 | 2 | Python 2.7 was deprecated by the [Python Software Foundation](https://www.python.org/psf-landing/) |
3 | back on January 1, 2020 following a multi-year process of phasing it out. Because of this, AWS is | |
4 | deprecating support for Python 2.7, meaning versions the AWS CLI v1 released after the deprecation | |
5 | date will no longer work with Python 2.7. | |
3 | back on January 1, 2020 following a multi-year process of phasing it out. Because of this, AWS has | |
4 | deprecated support for Python 2.7, meaning versions the AWS CLI v1 released after the deprecation | |
5 | date no longer work with Python 2.7. | |
6 | 6 | |
7 | 7 | ----- |
8 | 8 |
16 | 16 | """ |
17 | 17 | import os |
18 | 18 | |
19 | __version__ = '1.19.35' | |
19 | __version__ = '1.20.23' | |
20 | 20 | |
21 | 21 | # |
22 | 22 | # Get our data path to be added to botocore's search path |
18 | 18 | |
19 | 19 | from awscli import SCALAR_TYPES, COMPLEX_TYPES |
20 | 20 | from awscli import shorthand |
21 | from awscli.utils import find_service_and_method_in_event_name | |
21 | from awscli.utils import ( | |
22 | find_service_and_method_in_event_name, is_document_type, | |
23 | is_document_type_container | |
24 | ) | |
22 | 25 | from botocore.utils import is_json_value_header |
23 | 26 | |
24 | 27 | LOG = logging.getLogger('awscli.argprocess') |
152 | 155 | |
153 | 156 | |
154 | 157 | def _unpack_cli_arg(argument_model, value, cli_name): |
155 | if is_json_value_header(argument_model): | |
158 | if is_json_value_header(argument_model) or \ | |
159 | is_document_type(argument_model): | |
156 | 160 | return _unpack_json_cli_arg(argument_model, value, cli_name) |
157 | 161 | elif argument_model.type_name in SCALAR_TYPES: |
158 | 162 | return unpack_scalar_cli_arg( |
177 | 181 | type_name = argument_model.type_name |
178 | 182 | if type_name == 'structure' or type_name == 'map': |
179 | 183 | if value.lstrip()[0] == '{': |
180 | try: | |
181 | return json.loads(value, object_pairs_hook=OrderedDict) | |
182 | except ValueError as e: | |
183 | raise ParamError( | |
184 | cli_name, "Invalid JSON: %s\nJSON received: %s" | |
185 | % (e, value)) | |
184 | return _unpack_json_cli_arg(argument_model, value, cli_name) | |
186 | 185 | raise ParamError(cli_name, "Invalid JSON:\n%s" % value) |
187 | 186 | elif type_name == 'list': |
188 | 187 | if isinstance(value, six.string_types): |
189 | 188 | if value.lstrip()[0] == '[': |
190 | return json.loads(value, object_pairs_hook=OrderedDict) | |
189 | return _unpack_json_cli_arg(argument_model, value, cli_name) | |
191 | 190 | elif isinstance(value, list) and len(value) == 1: |
192 | 191 | single_value = value[0].strip() |
193 | 192 | if single_value and single_value[0] == '[': |
194 | return json.loads(value[0], object_pairs_hook=OrderedDict) | |
193 | return _unpack_json_cli_arg(argument_model, value[0], cli_name) | |
195 | 194 | try: |
196 | 195 | # There's a couple of cases remaining here. |
197 | 196 | # 1. It's possible that this is just a list of strings, i.e |
231 | 230 | return bool(value) |
232 | 231 | else: |
233 | 232 | return value |
233 | ||
234 | ||
235 | def _supports_shorthand_syntax(model): | |
236 | # Shorthand syntax is only supported if: | |
237 | # | |
238 | # 1. The argument is not a document type nor is a wrapper around a document | |
239 | # type (e.g. is a list of document types or a map of document types). These | |
240 | # should all be expressed as JSON input. | |
241 | # | |
242 | # 2. The argument is sufficiently complex, that is, it's base type is | |
243 | # a complex type *and* if it's a list, then it can't be a list of | |
244 | # scalar types. | |
245 | if is_document_type_container(model): | |
246 | return False | |
247 | return _is_complex_shape(model) | |
234 | 248 | |
235 | 249 | |
236 | 250 | def _is_complex_shape(model): |
392 | 406 | "param shorthand.", cli_argument.py_name) |
393 | 407 | return False |
394 | 408 | model = cli_argument.argument_model |
395 | # The second case is to make sure the argument is sufficiently | |
396 | # complex, that is, it's base type is a complex type *and* | |
397 | # if it's a list, then it can't be a list of scalar types. | |
398 | return _is_complex_shape(model) | |
409 | return _supports_shorthand_syntax(model) | |
399 | 410 | |
400 | 411 | |
401 | 412 | class ParamShorthandDocGen(ParamShorthand): |
407 | 418 | def supports_shorthand(self, argument_model): |
408 | 419 | """Checks if a CLI argument supports shorthand syntax.""" |
409 | 420 | if argument_model is not None: |
410 | return _is_complex_shape(argument_model) | |
421 | return _supports_shorthand_syntax(argument_model) | |
411 | 422 | return False |
412 | 423 | |
413 | 424 | def generate_shorthand_example(self, cli_argument, service_id, |
504 | 515 | def _structure_docs(self, argument_model, stack): |
505 | 516 | parts = [] |
506 | 517 | for name, member_shape in argument_model.members.items(): |
518 | if is_document_type_container(member_shape): | |
519 | continue | |
507 | 520 | parts.append(self._member_docs(name, member_shape, stack)) |
508 | 521 | inner_part = ','.join(parts) |
509 | 522 | if not stack: |
19 | 19 | from awscli.argprocess import ParamShorthandDocGen |
20 | 20 | from awscli.bcdoc.docevents import DOC_EVENTS |
21 | 21 | from awscli.topictags import TopicTagDB |
22 | from awscli.utils import find_service_and_method_in_event_name | |
22 | from awscli.utils import ( | |
23 | find_service_and_method_in_event_name, is_document_type, | |
24 | operation_uses_document_types | |
25 | ) | |
23 | 26 | |
24 | 27 | LOG = logging.getLogger(__name__) |
25 | 28 | |
42 | 45 | def _get_argument_type_name(self, shape, default): |
43 | 46 | if is_json_value_header(shape): |
44 | 47 | return 'JSON' |
48 | if is_document_type(shape): | |
49 | return 'document' | |
45 | 50 | return default |
46 | 51 | |
47 | 52 | def _map_handlers(self, session, event_class, mapfn): |
232 | 237 | |
233 | 238 | def _do_doc_member(self, doc, member_name, member_shape, stack): |
234 | 239 | docs = member_shape.documentation |
240 | type_name = self._get_argument_type_name( | |
241 | member_shape, member_shape.type_name) | |
235 | 242 | if member_name: |
236 | doc.write('%s -> (%s)' % (member_name, self._get_argument_type_name( | |
237 | member_shape, member_shape.type_name))) | |
243 | doc.write('%s -> (%s)' % (member_name, type_name)) | |
238 | 244 | else: |
239 | doc.write('(%s)' % member_shape.type_name) | |
245 | doc.write('(%s)' % type_name) | |
240 | 246 | doc.style.indent() |
241 | 247 | doc.style.new_paragraph() |
242 | 248 | doc.include_doc_string(docs) |
365 | 371 | doc.include_doc_string(operation_model.documentation) |
366 | 372 | self._add_webapi_crosslink(help_command) |
367 | 373 | self._add_top_level_args_reference(help_command) |
374 | self._add_note_for_document_types_if_used(help_command) | |
368 | 375 | |
369 | 376 | def _add_top_level_args_reference(self, help_command): |
370 | 377 | help_command.doc.writeln('') |
391 | 398 | operation_model.name) |
392 | 399 | doc.style.external_link(title="AWS API Documentation", link=link) |
393 | 400 | doc.writeln('') |
401 | ||
402 | def _add_note_for_document_types_if_used(self, help_command): | |
403 | if operation_uses_document_types(help_command.obj): | |
404 | help_command.doc.style.new_paragraph() | |
405 | help_command.doc.writeln( | |
406 | '``%s`` uses document type values. Document types follow the ' | |
407 | 'JSON data model where valid values are: strings, numbers, ' | |
408 | 'booleans, null, arrays, and objects. For command input, ' | |
409 | 'options and nested parameters that are labeled with the type ' | |
410 | '``document`` must be provided as JSON. Shorthand syntax does ' | |
411 | 'not support document types.' % help_command.name | |
412 | ) | |
394 | 413 | |
395 | 414 | def _json_example_value_name(self, argument_model, include_enum_values=True): |
396 | 415 | # If include_enum_values is True, then the valid enum values |
450 | 469 | doc.style.dedent() |
451 | 470 | doc.write('}') |
452 | 471 | elif argument_model.type_name == 'structure': |
453 | self._doc_input_structure_members(doc, argument_model, stack) | |
472 | if argument_model.is_document_type: | |
473 | self._doc_document_member(doc) | |
474 | else: | |
475 | self._doc_input_structure_members(doc, argument_model, stack) | |
476 | ||
477 | def _doc_document_member(self, doc): | |
478 | doc.write('{...}') | |
454 | 479 | |
455 | 480 | def _doc_input_structure_members(self, doc, argument_model, stack): |
456 | 481 | doc.write('{') |
20 | 20 | from botocore.compat import copy_kwargs, OrderedDict |
21 | 21 | from botocore.exceptions import NoCredentialsError |
22 | 22 | from botocore.exceptions import NoRegionError |
23 | from botocore.exceptions import ProfileNotFound | |
23 | 24 | from botocore.history import get_global_history_recorder |
24 | 25 | |
25 | 26 | from awscli import EnvironmentVariables, __version__ |
341 | 342 | |
342 | 343 | def _get_service_model(self): |
343 | 344 | if self._service_model is None: |
344 | api_version = self.session.get_config_variable('api_versions').get( | |
345 | self._service_name, None) | |
345 | try: | |
346 | api_version = self.session.get_config_variable( | |
347 | 'api_versions').get(self._service_name, None) | |
348 | except ProfileNotFound: | |
349 | api_version = None | |
346 | 350 | self._service_model = self.session.get_service_model( |
347 | 351 | self._service_name, api_version=api_version) |
348 | 352 | return self._service_model |
131 | 131 | 'lambda.publish-version.code-sha256': 'code-sha-256', |
132 | 132 | 'lightsail.import-key-pair.public-key-base64': 'public-key-base-64', |
133 | 133 | 'opsworks.register-volume.ec2-volume-id': 'ec-2-volume-id', |
134 | 'mgn.*.replication-servers-security-groups-ids': | |
135 | 'replication-servers-security-groups-i-ds', | |
136 | 'mgn.*.source-server-ids': 'source-server-i-ds', | |
137 | 'mgn.*.replication-configuration-template-ids': | |
138 | 'replication-configuration-template-i-ds', | |
139 | 'elasticache.create-replication-group.preferred-cache-cluster-azs': | |
140 | 'preferred-cache-cluster-a-zs' | |
134 | 141 | } |
135 | 142 | |
136 | 143 |
79 | 79 | return OrderedDict(loader.construct_pairs(node)) |
80 | 80 | |
81 | 81 | |
82 | class SafeLoaderWrapper(yaml.SafeLoader): | |
83 | """Isolated safe loader to allow for customizations without global changes. | |
84 | """ | |
85 | ||
86 | pass | |
87 | ||
82 | 88 | def yaml_parse(yamlstr): |
83 | 89 | """Parse a yaml string""" |
84 | 90 | try: |
87 | 93 | # json parser. |
88 | 94 | return json.loads(yamlstr, object_pairs_hook=OrderedDict) |
89 | 95 | except ValueError: |
90 | yaml.SafeLoader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, _dict_constructor) | |
91 | yaml.SafeLoader.add_multi_constructor( | |
92 | "!", intrinsics_multi_constructor) | |
93 | return yaml.safe_load(yamlstr) | |
96 | loader = SafeLoaderWrapper | |
97 | loader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, | |
98 | _dict_constructor) | |
99 | loader.add_multi_constructor("!", intrinsics_multi_constructor) | |
100 | return yaml.load(yamlstr, loader) | |
94 | 101 | |
95 | 102 | |
96 | 103 | class FlattenAliasDumper(yaml.SafeDumper): |
125 | 125 | LOG.debug('Loaded trail info: %s', trail_info) |
126 | 126 | bucket = trail_info['S3BucketName'] |
127 | 127 | prefix = trail_info.get('S3KeyPrefix', None) |
128 | is_org_trail = trail_info['IsOrganizationTrail'] | |
128 | is_org_trail = trail_info.get('IsOrganizationTrail') | |
129 | 129 | if is_org_trail: |
130 | 130 | if not account_id: |
131 | 131 | raise ParameterRequiredError( |
53 | 53 | self._display_config_value(ConfigValue('-----', '----', '--------'), |
54 | 54 | '----') |
55 | 55 | |
56 | if self._session.profile is not None: | |
57 | profile = ConfigValue(self._session.profile, 'manual', | |
58 | '--profile') | |
56 | if parsed_globals and parsed_globals.profile is not None: | |
57 | profile = ConfigValue(self._session.profile, 'manual', '--profile') | |
59 | 58 | else: |
60 | 59 | profile = self._lookup_config('profile') |
61 | 60 | self._display_config_value(profile, 'profile') |
45 | 45 | config_writer = ConfigFileWriter() |
46 | 46 | self._config_writer = config_writer |
47 | 47 | |
48 | def _get_config_file(self, path): | |
49 | config_path = self._session.get_config_variable(path) | |
50 | return os.path.expanduser(config_path) | |
51 | ||
48 | 52 | def _run_main(self, args, parsed_globals): |
49 | 53 | varname = args.varname |
50 | 54 | value = args.value |
51 | section = 'default' | |
55 | profile = 'default' | |
52 | 56 | # Before handing things off to the config writer, |
53 | 57 | # we need to find out three things: |
54 | # 1. What section we're writing to (section). | |
58 | # 1. What section we're writing to (profile). | |
55 | 59 | # 2. The name of the config key (varname) |
56 | 60 | # 3. The actual value (value). |
57 | 61 | if '.' not in varname: |
59 | 63 | # profile (or leave it as the 'default' section if |
60 | 64 | # no profile is set). |
61 | 65 | if self._session.profile is not None: |
62 | section = profile_to_section(self._session.profile) | |
66 | profile = self._session.profile | |
63 | 67 | else: |
64 | 68 | # First figure out if it's been scoped to a profile. |
65 | 69 | parts = varname.split('.') |
66 | 70 | if parts[0] in ('default', 'profile'): |
67 | 71 | # Then we know we're scoped to a profile. |
68 | 72 | if parts[0] == 'default': |
69 | section = 'default' | |
73 | profile = 'default' | |
70 | 74 | remaining = parts[1:] |
71 | 75 | else: |
72 | 76 | # [profile, profile_name, ...] |
73 | section = profile_to_section(parts[1]) | |
77 | profile = parts[1] | |
74 | 78 | remaining = parts[2:] |
75 | 79 | varname = remaining[0] |
76 | 80 | if len(remaining) == 2: |
77 | 81 | value = {remaining[1]: value} |
78 | 82 | elif parts[0] not in PREDEFINED_SECTION_NAMES: |
79 | 83 | if self._session.profile is not None: |
80 | section = profile_to_section(self._session.profile) | |
84 | profile = self._session.profile | |
81 | 85 | else: |
82 | 86 | profile_name = self._session.get_config_variable('profile') |
83 | 87 | if profile_name is not None: |
84 | section = profile_name | |
88 | profile = profile_name | |
85 | 89 | varname = parts[0] |
86 | 90 | if len(parts) == 2: |
87 | 91 | value = {parts[1]: value} |
88 | 92 | elif len(parts) == 2: |
89 | 93 | # Otherwise it's something like "set preview.service true" |
90 | 94 | # of something in the [plugin] section. |
91 | section, varname = parts | |
92 | config_filename = os.path.expanduser( | |
93 | self._session.get_config_variable('config_file')) | |
95 | profile, varname = parts | |
96 | config_filename = self._get_config_file('config_file') | |
97 | if varname in self._WRITE_TO_CREDS_FILE: | |
98 | # When writing to the creds file, the section is just the profile | |
99 | section = profile | |
100 | config_filename = self._get_config_file('credentials_file') | |
101 | elif profile in PREDEFINED_SECTION_NAMES or profile == 'default': | |
102 | section = profile | |
103 | else: | |
104 | section = profile_to_section(profile) | |
94 | 105 | updated_config = {'__section__': section, varname: value} |
95 | if varname in self._WRITE_TO_CREDS_FILE: | |
96 | config_filename = os.path.expanduser( | |
97 | self._session.get_config_variable('credentials_file')) | |
98 | section_name = updated_config['__section__'] | |
99 | if section_name.startswith('profile '): | |
100 | updated_config['__section__'] = section_name[8:] | |
101 | 106 | self._config_writer.update_config(updated_config, config_filename) |
92 | 92 | "description": "Target number of Amazon EC2 instances " |
93 | 93 | "for the instance group", |
94 | 94 | "required": True |
95 | }, | |
96 | "CustomAmiId": { | |
97 | "type": "string", | |
98 | "description": "The AMI ID of a custom AMI to use when Amazon EMR provisions EC2 instances." | |
95 | 99 | }, |
96 | 100 | "EbsConfiguration": { |
97 | 101 | "type": "object", |
329 | 333 | "BidPriceAsPercentageOfOnDemandPrice": { |
330 | 334 | "type": "double", |
331 | 335 | "description": "Bid price as percentage of on-demand price." |
336 | }, | |
337 | "CustomAmiId": { | |
338 | "type": "string", | |
339 | "description": "The AMI ID of a custom AMI to use when Amazon EMR provisions EC2 instances." | |
332 | 340 | }, |
333 | 341 | "EbsConfiguration": { |
334 | 342 | "type": "object", |
182 | 182 | ' type with the Spot purchasing option launches.</li>' |
183 | 183 | '<li><code>[LaunchSpecifications]</code> - When <code>TargetSpotCapacity</code> is specified,' |
184 | 184 | ' specifies the block duration and timeout action for Spot Instances.' |
185 | '<li><code>InstanceTypeConfigs</code> - Specifies up to five EC2 instance types to' | |
186 | ' use in the instance fleet, including details such as Spot price and Amazon EBS configuration.</li>') | |
185 | '<li><code>InstanceTypeConfigs</code> - Specify up to five EC2 instance types to' | |
186 | ' use in the instance fleet, including details such as Spot price and Amazon EBS configuration.' | |
187 | ' When you use an On-Demand or Spot Instance allocation strategy,' | |
188 | ' you can specify up to 30 instance types per instance fleet.</li>') | |
187 | 189 | |
188 | 190 | INSTANCE_TYPE = ( |
189 | 191 | '<p>Shortcut parameter as an alternative to <code>--instance-groups</code>.' |
209 | 211 | ' the following arguments:</p>' |
210 | 212 | '<li><code>KeyName</code> - Specifies the name of the AWS EC2 key pair that will be used for' |
211 | 213 | ' SSH connections to the master node and other instances on the cluster.</li>' |
212 | '<li><code>AvailabilityZone</code> - Specifies the availability zone in which to launch' | |
213 | ' the cluster. For example, <code>us-west-1b</code>.</li>' | |
214 | '<li><code>SubnetId</code> - Specifies the VPC subnet in which to create the cluster.</li>' | |
214 | '<li><code>AvailabilityZone</code> - Applies to clusters that use the uniform instance group configuration.' | |
215 | ' Specifies the availability zone in which to launch the cluster.' | |
216 | ' For example, <code>us-west-1b</code>. <code>AvailabilityZone</code> is used for uniform instance groups,' | |
217 | ' while <code>AvailabilityZones</code> (plural) is used for instance fleets.</li>' | |
218 | '<li><code>AvailabilityZones</code> - Applies to clusters that use the instance fleet configuration.' | |
219 | ' When multiple Availability Zones are specified, Amazon EMR evaluates them and launches instances' | |
220 | ' in the optimal Availability Zone. <code>AvailabilityZone</code> is used for uniform instance groups,' | |
221 | ' while <code>AvailabilityZones</code> (plural) is used for instance fleets.</li>' | |
222 | '<li><code>SubnetId</code> - Applies to clusters that use the uniform instance group configuration.' | |
223 | ' Specify the VPC subnet in which to create the cluster. <code>SubnetId</code> is used for uniform instance groups,' | |
224 | ' while <code>SubnetIds</code> (plural) is used for instance fleets.</li>' | |
225 | '<li><code>SubnetIds</code> - Applies to clusters that use the instance fleet configuration.' | |
226 | ' When multiple EC2 subnet IDs are specified, Amazon EMR evaluates them and launches instances in the optimal subnet.' | |
227 | ' <code>SubnetId</code> is used for uniform instance groups,' | |
228 | ' while <code>SubnetIds</code> (plural) is used for instance fleets.</li>' | |
215 | 229 | '<li><code>InstanceProfile</code> - An IAM role that allows EC2 instances to' |
216 | 230 | ' access other AWS services, such as Amazon S3, that' |
217 | 231 | ' are required for operations.</li>' |
418 | 432 | ' <code>--created-after 2017-07-04T00:01:30.</p>') |
419 | 433 | |
420 | 434 | LIST_CLUSTERS_CREATED_BEFORE = ( |
421 | '<p>List only those clusters created after the date and time' | |
435 | '<p>List only those clusters created before the date and time' | |
422 | 436 | ' specified in the format yyyy-mm-ddThh:mm:ss. For example,' |
423 | ' <code>--created-after 2017-07-04T00:01:30.</p>') | |
437 | ' <code>--created-before 2017-07-04T00:01:30.</p>') | |
424 | 438 | |
425 | 439 | EMR_MANAGED_MASTER_SECURITY_GROUP = ( |
426 | 440 | '<p>The identifier of the Amazon EC2 security group ' |
48 | 48 | if 'Configurations' in keys: |
49 | 49 | ig_config['Configurations'] = instance_group['Configurations'] |
50 | 50 | |
51 | if 'CustomAmiId' in keys: | |
52 | ig_config['CustomAmiId'] = instance_group['CustomAmiId'] | |
53 | ||
51 | 54 | instance_groups.append(ig_config) |
52 | 55 | return instance_groups |
53 | 56 |
75 | 75 | if not arg_value: |
76 | 76 | verify = False |
77 | 77 | else: |
78 | verify = getattr(parsed_args, 'ca_bundle', None) or \ | |
79 | session.get_config_variable('ca_bundle') | |
78 | # in case if `ca_bundle` not in args it'll be retrieved | |
79 | # from config on session.client creation step | |
80 | verify = getattr(parsed_args, 'ca_bundle', None) | |
80 | 81 | setattr(parsed_args, arg_name, verify) |
81 | 82 | |
82 | 83 |
29 | 29 | from awscli.customizations.s3.s3handler import S3TransferHandlerFactory |
30 | 30 | from awscli.customizations.s3.utils import find_bucket_key, AppendFilter, \ |
31 | 31 | find_dest_path_comp_key, human_readable_size, \ |
32 | RequestParamsMapper, split_s3_bucket_key, block_s3_object_lambda | |
32 | RequestParamsMapper, split_s3_bucket_key, block_unsupported_resources | |
33 | 33 | from awscli.customizations.utils import uni_print |
34 | 34 | from awscli.customizations.s3.syncstrategy.base import MissingFileSync, \ |
35 | 35 | SizeAndLastModifiedSync, NeverSync |
640 | 640 | path = path[5:] |
641 | 641 | if path.endswith('/'): |
642 | 642 | path = path[:-1] |
643 | block_s3_object_lambda(path) | |
643 | block_unsupported_resources(path) | |
644 | 644 | return path |
645 | 645 | |
646 | 646 |
50 | 50 | r'^(?P<bucket>arn:(aws).*:s3-outposts:[a-z\-0-9]+:[0-9]{12}:outpost[/:]' |
51 | 51 | r'[a-zA-Z0-9\-]{1,63}[/:]accesspoint[/:][a-zA-Z0-9\-]{1,63})[/:]?(?P<key>.*)$' |
52 | 52 | ) |
53 | ||
54 | _S3_OUTPOST_BUCKET_ARN_TO_BUCKET_KEY_REGEX = re.compile( | |
55 | r'^(?P<bucket>arn:(aws).*:s3-outposts:[a-z\-0-9]+:[0-9]{12}:outpost[/:]' | |
56 | r'[a-zA-Z0-9\-]{1,63}[/:]bucket[/:]' | |
57 | r'[a-zA-Z0-9\-]{1,63})[/:]?(?P<key>.*)$' | |
58 | ) | |
59 | ||
53 | 60 | _S3_OBJECT_LAMBDA_TO_BUCKET_KEY_REGEX = re.compile( |
54 | 61 | r'^(?P<bucket>arn:(aws).*:s3-object-lambda:[a-z\-0-9]+:[0-9]{12}:' |
55 | 62 | r'accesspoint[/:][a-zA-Z0-9\-]{1,63})[/:]?(?P<key>.*)$' |
186 | 193 | return bucket.popleft() |
187 | 194 | |
188 | 195 | |
189 | def block_s3_object_lambda(s3_path): | |
190 | # AWS CLI s3 commands don't support banner resources only direct API calls | |
196 | def block_unsupported_resources(s3_path): | |
197 | # AWS CLI s3 commands don't support object lambdas only direct API calls | |
191 | 198 | # are available for such resources |
192 | match = _S3_OBJECT_LAMBDA_TO_BUCKET_KEY_REGEX.match(s3_path) | |
193 | if match: | |
199 | if _S3_OBJECT_LAMBDA_TO_BUCKET_KEY_REGEX.match(s3_path): | |
194 | 200 | # In AWS CLI v2 we should use |
195 | 201 | # awscli.customizations.exceptions.ParamValidationError |
196 | 202 | # instead of ValueError |
198 | 204 | 's3 commands do not support S3 Object Lambda resources. ' |
199 | 205 | 'Use s3api commands instead.' |
200 | 206 | ) |
207 | # AWS S3 API and AWS CLI s3 commands don't support Outpost bucket ARNs | |
208 | # only s3control API supports them so far | |
209 | if _S3_OUTPOST_BUCKET_ARN_TO_BUCKET_KEY_REGEX.match(s3_path): | |
210 | raise ValueError( | |
211 | 's3 commands do not support Outpost Bucket ARNs. ' | |
212 | 'Use s3control commands instead.' | |
213 | ) | |
201 | 214 | |
202 | 215 | |
203 | 216 | def find_bucket_key(s3_path): |
206 | 219 | the form: bucket/key |
207 | 220 | It will return the bucket and the key represented by the s3 path |
208 | 221 | """ |
209 | block_s3_object_lambda(s3_path) | |
222 | block_unsupported_resources(s3_path) | |
210 | 223 | match = _S3_ACCESSPOINT_TO_BUCKET_KEY_REGEX.match(s3_path) |
211 | 224 | if match: |
212 | 225 | return match.group('bucket'), match.group('key') |
57 | 57 | "cli-read-timeout": { |
58 | 58 | "dest": "read_timeout", |
59 | 59 | "type": "int", |
60 | "help": "<p>The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout.</p>" | |
60 | "help": "<p>The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.</p>" | |
61 | 61 | }, |
62 | 62 | "cli-connect-timeout": { |
63 | 63 | "dest": "connect_timeout", |
64 | 64 | "type": "int", |
65 | "help": "<p>The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout.</p>" | |
65 | "help": "<p>The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.</p>" | |
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
29 | 29 | |
30 | 30 | The following command opts out of certificate transparency logging when you request a new certificate:: |
31 | 31 | |
32 | aws acm request-certificate --domain-name www.example.com --validation-method DNS --certificate-options CertificateTransparencyLoggingPreference=DISABLED --idempotency-token 184627 | |
32 | aws acm request-certificate --domain-name www.example.com --validation-method DNS --options CertificateTransparencyLoggingPreference=DISABLED --idempotency-token 184627 |
1 | 1 | |
2 | 2 | Command:: |
3 | 3 | |
4 | aws apigateway update-api-key --api-key sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu --patch-operations op='replace',path='/description',value='newName' | |
4 | aws apigateway update-api-key --api-key sNvjQDMReA1eEQPNAW8r37XsU2rDD7fc7m2SiMnu --patch-operations op='replace',path='/name',value='newName' | |
5 | 5 | |
6 | 6 | Output:: |
7 | 7 |
5 | 5 | --name dynamo_db_catalog \ |
6 | 6 | --type LAMBDA \ |
7 | 7 | --description "DynamoDB Catalog" \ |
8 | --function=arn:aws:lambda:us-west-2:111122223333:function:dynamo_db_lambda | |
8 | --parameters function=arn:aws:lambda:us-west-2:111122223333:function:dynamo_db_lambda | |
9 | 9 | |
10 | 10 | This command produces no output. To see the result, use ``aws athena get-data-catalog --name dynamo_db_catalog``. |
11 | 11 |
0 | **To attach an instance to an Auto Scaling group** | |
1 | ||
2 | This example attaches the specified instance to the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling attach-instances --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group | |
0 | **To attach an instance to an Auto Scaling group** | |
1 | ||
2 | This example attaches the specified instance to the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling attach-instances \ | |
5 | --instance-ids i-061c63c5eb45f0416 \ | |
6 | --auto-scaling-group-name my-asg | |
7 | ||
8 | This command produces no output. |
0 | **To attach a target group to an Auto Scaling group** | |
1 | ||
2 | This example attaches the specified target group to the specified Auto Scaling group:: | |
3 | ||
4 | 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 | |
0 | **To attach a target group to an Auto Scaling group** | |
1 | ||
2 | This example attaches the specified target group to the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling attach-load-balancer-target-groups \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --target-group-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Elastic Load Balancing and Amazon EC2 Auto Scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To attach a load balancer to an Auto Scaling group** | |
1 | ||
2 | This example attaches the specified load balancer to the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling attach-load-balancers --load-balancer-names my-load-balancer --auto-scaling-group-name my-auto-scaling-group | |
0 | **To attach a Classic Load Balancer to an Auto Scaling group** | |
1 | ||
2 | This example attaches the specified Classic Load Balancer to the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling attach-load-balancers \ | |
5 | --load-balancer-names my-load-balancer \ | |
6 | --auto-scaling-group-name my-asg | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Elastic Load Balancing and Amazon EC2 Auto Scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
10 | 10 | "InstanceRefreshId": "08b91cf7-8fa6-48af-b6a6-d227f40f1b9b" |
11 | 11 | } |
12 | 12 | |
13 | For more information, see `Replacing Auto Scaling Instances Based on an Instance Refresh <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ | |
13 | For more information, see `Replacing Auto Scaling instances based on an instance refresh <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To complete the lifecycle action** | |
1 | ||
2 | This example notifies Auto Scaling that the specified lifecycle action is complete so that it can finish launching or terminating the instance:: | |
3 | ||
4 | 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 | |
0 | **To complete the lifecycle action** | |
1 | ||
2 | This example notifies Amazon EC2 Auto Scaling that the specified lifecycle action is complete so that it can finish launching or terminating the instance. :: | |
3 | ||
4 | aws autoscaling complete-lifecycle-action \ | |
5 | --lifecycle-hook-name my-launch-hook \ | |
6 | --auto-scaling-group-name my-asg \ | |
7 | --lifecycle-action-result CONTINUE \ | |
8 | --lifecycle-action-token bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635 | |
9 | ||
10 | This command produces no output. | |
11 | ||
12 | For more information, see `Amazon EC2 Auto Scaling lifecycle hooks <https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To create an Auto Scaling group using a launch configuration** | |
1 | ||
2 | This example creates an Auto Scaling group in a VPC using a launch configuration to specify the type of EC2 instance that Amazon EC2 Auto Scaling creates:: | |
3 | ||
4 | aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-configuration-name my-launch-config --min-size 1 --max-size 3 --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" | |
5 | ||
6 | This example creates an Auto Scaling group and configures it to use an Elastic Load Balancing load balancer:: | |
7 | ||
8 | aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-configuration-name my-launch-config --load-balancer-names my-load-balancer --health-check-type ELB --health-check-grace-period 120 --min-size 1 --max-size 3 --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" | |
9 | ||
10 | This example specifies a desired capacity as well as a minimum and maximum capacity. It also launches instances into a placement group and sets the termination policy to terminate the oldest instances first:: | |
11 | ||
12 | aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-configuration-name my-launch-config --min-size 1 --max-size 3 --desired-capacity 1 --placement-group my-placement-group --termination-policies "OldestInstance" --availability-zones us-west-2c | |
13 | ||
14 | **To create an Auto Scaling group using an EC2 instance** | |
15 | ||
16 | This example creates an Auto Scaling group from the specified EC2 instance and assigns a tag to instances in the group:: | |
17 | ||
18 | aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --instance-id i-22c99e2a --min-size 1 --max-size 3 --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" --tags "ResourceId=my-asg,ResourceType=auto-scaling-group,Key=Role,Value=WebServer,PropagateAtLaunch=true" | |
19 | ||
20 | **To create an Auto Scaling group using a launch template** | |
21 | ||
22 | This example creates an Auto Scaling group in a VPC using a launch template to specify the type of EC2 instance that Amazon EC2 Auto Scaling creates:: | |
23 | ||
24 | aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-template "LaunchTemplateName=my-template-for-auto-scaling,Version=1" --min-size 1 --max-size 3 --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" | |
25 | ||
26 | This example uses the default version of the specified launch template. It specifies Availability Zones and subnets and enables the instance protection setting:: | |
27 | ||
28 | aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg --launch-template LaunchTemplateId=lt-0a4872e2c396d941c --min-size 1 --max-size 3 --desired-capacity 2 --availability-zones us-west-2a us-west-2b us-west-2c --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" --new-instances-protected-from-scale-in | |
29 | ||
30 | This example creates an Auto Scaling group that launches a single instance using a launch template to optionally specify the ID of an existing network interface (ENI ID) to use. It specifies an Availability Zone that matches the specified network interface:: | |
31 | ||
32 | aws autoscaling create-auto-scaling-group --auto-scaling-group-name my-asg-single-instance --launch-template "LaunchTemplateName=my-single-instance-asg-template,Version=2" --min-size 1 --max-size 1 --availability-zones us-west-2a | |
33 | ||
34 | This example creates an Auto Scaling group with a lifecycle hook that supports a custom action at instance termination:: | |
35 | ||
36 | aws autoscaling create-auto-scaling-group --cli-input-json file://~/config.json | |
37 | ||
38 | Contents of config.json file:: | |
39 | ||
40 | { | |
41 | "AutoScalingGroupName": "my-asg", | |
42 | "LaunchTemplate": { | |
43 | "LaunchTemplateId": "lt-0a4872e2c396d941c" | |
44 | }, | |
45 | "LifecycleHookSpecificationList": [{ | |
46 | "LifecycleHookName": "my-hook", | |
47 | "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", | |
48 | "NotificationTargetARN": "arn:aws:sqs:us-west-2:123456789012:my-sqs-queue", | |
49 | "RoleARN": "arn:aws:iam::123456789012:role/my-notification-role", | |
50 | "HeartbeatTimeout": 300, | |
51 | "DefaultResult": "CONTINUE" | |
52 | }], | |
53 | "MinSize": 1, | |
54 | "MaxSize": 5, | |
55 | "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782", | |
56 | "Tags": [{ | |
57 | "ResourceType": "auto-scaling-group", | |
58 | "ResourceId": "my-asg", | |
59 | "PropagateAtLaunch": true, | |
60 | "Value": "test", | |
61 | "Key": "environment" | |
62 | }] | |
63 | } | |
64 | ||
65 | For more information, see the `Amazon EC2 Auto Scaling User Guide`_. | |
66 | ||
67 | .. _`Amazon EC2 Auto Scaling User Guide`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/what-is-amazon-ec2-auto-scaling.html | |
0 | **Example 1: To create an Auto Scaling group** | |
1 | ||
2 | The following ``create-auto-scaling-group`` example creates an Auto Scaling group in subnets in multiple Availability Zones within a Region. The instances launch with the default version of the specified launch template. Note that defaults are used for most other settings, such as the termination policies and health check configuration. :: | |
3 | ||
4 | aws autoscaling create-auto-scaling-group \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --launch-template LaunchTemplateId=lt-1234567890abcde12 \ | |
7 | --min-size 1 \ | |
8 | --max-size 5 \ | |
9 | --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" | |
10 | ||
11 | This command produces no output. | |
12 | ||
13 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
14 | ||
15 | **Example 2: To attach an Application Load Balancer, Network Load Balancer, or Gateway Load Balancer** | |
16 | ||
17 | This example specifies the ARN of a target group for a load balancer that supports the expected traffic. The health check type specifies ``ELB`` so that when Elastic Load Balancing reports an instance as unhealthy, the Auto Scaling group replaces it. The command also defines a health check grace period of ``600`` seconds. The grace period helps prevent premature termination of newly launched instances. :: | |
18 | ||
19 | aws autoscaling create-auto-scaling-group \ | |
20 | --auto-scaling-group-name my-asg \ | |
21 | --launch-template LaunchTemplateId=lt-1234567890abcde12 \ | |
22 | --target-group-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/943f017f100becff \ | |
23 | --health-check-type ELB \ | |
24 | --health-check-grace-period 600 \ | |
25 | --min-size 1 \ | |
26 | --max-size 5 \ | |
27 | --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" | |
28 | ||
29 | This command produces no output. | |
30 | ||
31 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
32 | ||
33 | **Example 3: To specify a placement group and use the latest version of the launch template** | |
34 | ||
35 | This example launches instances into a placement group within a single Availability Zone. This can be useful for low-latency groups with HPC workloads. This example also specifies a desired capacity as well as a minimum and maximum capacity. :: | |
36 | ||
37 | aws autoscaling create-auto-scaling-group \ | |
38 | --auto-scaling-group-name my-asg \ | |
39 | --launch-template LaunchTemplateId=lt-1234567890abcde12,Version='$Latest' \ | |
40 | --min-size 1 \ | |
41 | --max-size 5 \ | |
42 | --desired-capacity 3 \ | |
43 | --placement-group my-placement-group \ | |
44 | --vpc-zone-identifier "subnet-6194ea3b" | |
45 | ||
46 | This command produces no output. | |
47 | ||
48 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
49 | ||
50 | **Example 4: To specify a single instance Auto Scaling group and use a specific version of the launch template** | |
51 | ||
52 | This example creates an Auto Scaling group with minimum and maximum capacity set to ``1`` to enforce that one instance will be running. The command also specifies v1 of a launch template in which the ID of an existing ENI is specified. When you use a launch template that specifies an existing ENI for eth0, you must specify an Availability Zone for the Auto Scaling group that matches the network interface, without also specifying a subnet ID in the request. :: | |
53 | ||
54 | aws autoscaling create-auto-scaling-group \ | |
55 | --auto-scaling-group-name my-asg-single-instance \ | |
56 | --launch-template LaunchTemplateName=my-template-for-auto-scaling,Version='1' \ | |
57 | --min-size 1 \ | |
58 | --max-size 1 \ | |
59 | --availability-zones us-west-2a | |
60 | ||
61 | This command produces no output. | |
62 | ||
63 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
64 | ||
65 | **Example 5: To use a launch configuration** | |
66 | ||
67 | This example creates an Auto Scaling group using a launch configuration and sets the termination policy to terminate the oldest instances first. The command also applies a tag to the group and its instances, with a key of ``Role`` and a value of ``WebServer``. :: | |
68 | ||
69 | aws autoscaling create-auto-scaling-group \ | |
70 | --auto-scaling-group-name my-asg \ | |
71 | --launch-configuration-name my-launch-config \ | |
72 | --min-size 1 \ | |
73 | --max-size 5 \ | |
74 | --termination-policies "OldestInstance" \ | |
75 | --tags "ResourceId=my-asg,ResourceType=auto-scaling-group,Key=Role,Value=WebServer,PropagateAtLaunch=true" \ | |
76 | --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" | |
77 | ||
78 | This command produces no output. | |
79 | ||
80 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
81 | ||
82 | **Example 6: To specify a launch lifecycle hook** | |
83 | ||
84 | This example creates an Auto Scaling group with a lifecycle hook that supports a custom action at instance launch. :: | |
85 | ||
86 | aws autoscaling create-auto-scaling-group \ | |
87 | --cli-input-json file://~/config.json | |
88 | ||
89 | Contents of ``config.json`` file:: | |
90 | ||
91 | { | |
92 | "AutoScalingGroupName": "my-asg", | |
93 | "LaunchTemplate": { | |
94 | "LaunchTemplateId": "lt-1234567890abcde12" | |
95 | }, | |
96 | "LifecycleHookSpecificationList": [{ | |
97 | "LifecycleHookName": "my-launch-hook", | |
98 | "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING", | |
99 | "NotificationTargetARN": "arn:aws:sqs:us-west-2:123456789012:my-sqs-queue", | |
100 | "RoleARN": "arn:aws:iam::123456789012:role/my-notification-role", | |
101 | "NotificationMetadata": "SQS message metadata", | |
102 | "HeartbeatTimeout": 4800, | |
103 | "DefaultResult": "ABANDON" | |
104 | }], | |
105 | "MinSize": 1, | |
106 | "MaxSize": 5, | |
107 | "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782", | |
108 | "Tags": [{ | |
109 | "ResourceType": "auto-scaling-group", | |
110 | "ResourceId": "my-asg", | |
111 | "PropagateAtLaunch": true, | |
112 | "Value": "test", | |
113 | "Key": "environment" | |
114 | }] | |
115 | } | |
116 | ||
117 | This command produces no output. | |
118 | ||
119 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
120 | ||
121 | **Example 7: To specify a termination lifecycle hook** | |
122 | ||
123 | This example creates an Auto Scaling group with a lifecycle hook that supports a custom action at instance termination. :: | |
124 | ||
125 | aws autoscaling create-auto-scaling-group \ | |
126 | --cli-input-json file://~/config.json | |
127 | ||
128 | Contents of ``config.json``:: | |
129 | ||
130 | { | |
131 | "AutoScalingGroupName": "my-asg", | |
132 | "LaunchTemplate": { | |
133 | "LaunchTemplateId": "lt-1234567890abcde12" | |
134 | }, | |
135 | "LifecycleHookSpecificationList": [{ | |
136 | "LifecycleHookName": "my-termination-hook", | |
137 | "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", | |
138 | "HeartbeatTimeout": 120, | |
139 | "DefaultResult": "CONTINUE" | |
140 | }], | |
141 | "MinSize": 1, | |
142 | "MaxSize": 5, | |
143 | "TargetGroupARNs": [ | |
144 | "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067" | |
145 | ], | |
146 | "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" | |
147 | } | |
148 | ||
149 | This command produces no output. | |
150 | ||
151 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To create a launch configuration** | |
1 | ||
2 | This example creates a launch configuration:: | |
3 | ||
4 | aws autoscaling create-launch-configuration --launch-configuration-name my-launch-config --image-id ami-c6169af6 --instance-type m1.medium | |
5 | ||
6 | This example creates a launch configuration with a key pair and a bootstrapping script:: | |
7 | ||
8 | 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 | |
9 | ||
10 | 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:: | |
11 | ||
12 | 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 | |
13 | ||
14 | Add the following parameter to add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100. | |
15 | ||
16 | Parameter:: | |
17 | ||
18 | --block-device-mappings "[{\"DeviceName\": \"/dev/sdh\",\"Ebs\":{\"VolumeSize\":100}}]" | |
19 | ||
20 | Add the following parameter to add ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``. | |
21 | ||
22 | Parameter:: | |
23 | ||
24 | --block-device-mappings "[{\"DeviceName\": \"/dev/sdc\",\"VirtualName\":\"ephemeral1\"}]" | |
25 | ||
26 | Add the following parameter to omit a device included on the instance (for example, ``/dev/sdf``). | |
27 | ||
28 | Parameter:: | |
29 | ||
30 | --block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"NoDevice\":\"\"}]" | |
31 | ||
32 | For more information about quoting JSON-formatted parameters, see `Quoting Strings`_ in the *AWS Command Line Interface User Guide*. | |
33 | ||
34 | This example creates a launch configuration that uses Spot Instances:: | |
35 | ||
36 | aws autoscaling create-launch-configuration --launch-configuration-name my-launch-config --image-id ami-01e24be29428c15b2 --instance-type c5.large --spot-price "0.50" | |
37 | ||
38 | For more information, see `Launching Spot Instances in Your Auto Scaling Group`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
39 | ||
40 | .. _`Quoting Strings`: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters.html#quoting-strings | |
41 | ||
42 | .. _`Launching Spot Instances in Your Auto Scaling Group`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html | |
0 | **Example 1: To create a launch configuration** | |
1 | ||
2 | This example creates a launch configuration. :: | |
3 | ||
4 | aws autoscaling create-launch-configuration \ | |
5 | --launch-configuration-name my-launch-config \ | |
6 | --image-id ami-c6169af6 \ | |
7 | --instance-type m1.medium | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Requesting Spot Instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
12 | ||
13 | **Example 2: To create a key pair and bootrapping script launch configuration** | |
14 | ||
15 | This example creates a launch configuration with a key pair and a bootstrapping script. :: | |
16 | ||
17 | aws autoscaling create-launch-configuration \ | |
18 | --launch-configuration-name my-launch-config \ | |
19 | --key-name my-key-pair \ | |
20 | --image-id ami-c6169af6 \ | |
21 | --instance-type m1.small \ | |
22 | --user-data file://myuserdata.txt | |
23 | ||
24 | This command produces no output. | |
25 | ||
26 | For more information, see `Requesting Spot Instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
27 | ||
28 | **Example 3: To create a launch configuration** | |
29 | ||
30 | 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. :: | |
31 | ||
32 | aws autoscaling create-launch-configuration \ | |
33 | --launch-configuration-name my-launch-config \ | |
34 | --key-name my-key-pair \ | |
35 | --instance-id i-7e13c876 \ | |
36 | --security-groups sg-eb2af88e \ | |
37 | --instance-type m1.small \ | |
38 | --user-data file://myuserdata.txt \ | |
39 | --instance-monitoring Enabled=true \ | |
40 | --no-ebs-optimized \ | |
41 | --no-associate-public-ip-address \ | |
42 | --placement-tenancy dedicated \ | |
43 | --iam-instance-profile my-autoscaling-role | |
44 | ||
45 | This command produces no output. | |
46 | ||
47 | For more information, see `Requesting Spot Instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
48 | ||
49 | **Example 4: To create a launch configuration with the specified volume and size** | |
50 | ||
51 | This example creates a launch configuration with an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100. :: | |
52 | ||
53 | aws autoscaling create-launch-configuration \ | |
54 | --launch-configuration-name my-launch-config \ | |
55 | --key-name my-key-pair \ | |
56 | --image-id ami-c6169af6 \ | |
57 | --instance-type m1.small \ | |
58 | --user-data file://myuserdata.txt \ | |
59 | --block-device-mappings "[{\"DeviceName\": \"/dev/sdh\",\"Ebs\":{\"VolumeSize\":100}}]" | |
60 | ||
61 | This command produces no output. | |
62 | ||
63 | For more information about quoting JSON-formatted parameters, see `Using quotation marks with strings in the AWS CLI <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-quoting-strings.html>`__ in the *AWS Command Line Interface User Guide*. | |
64 | ||
65 | **Example 5: To create a launch configuration with an ephemerall volume** | |
66 | ||
67 | This example creates a launch configuration with ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``. :: | |
68 | ||
69 | aws autoscaling create-launch-configuration \ | |
70 | --launch-configuration-name my-launch-config \ | |
71 | --key-name my-key-pair \ | |
72 | --image-id ami-c6169af6 \ | |
73 | --instance-type m1.small \ | |
74 | --user-data file://myuserdata.txt \ | |
75 | --block-device-mappings "[{\"DeviceName\": \"/dev/sdc\",\"VirtualName\":\"ephemeral1\"}]" | |
76 | ||
77 | This command produces no output. | |
78 | ||
79 | For more information about quoting JSON-formatted parameters, see `Using quotation marks with strings in the AWS CLI <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-quoting-strings.html>`__ in the *AWS Command Line Interface User Guide*. | |
80 | ||
81 | **Example 6: To create a launch configuration and omit a device** | |
82 | ||
83 | Add the following parameter to omit a device included on the instance (for example, ``/dev/sdf``). :: | |
84 | ||
85 | aws autoscaling create-launch-configuration \ | |
86 | --launch-configuration-name my-launch-config \ | |
87 | --key-name my-key-pair \ | |
88 | --image-id ami-c6169af6 \ | |
89 | --instance-type m1.small \ | |
90 | --user-data file://myuserdata.txt \ | |
91 | --block-device-mappings "[{\"DeviceName\": \"/dev/sdf\",\"NoDevice\":\"\"}]" | |
92 | ||
93 | This command produces no output. | |
94 | ||
95 | For more information about quoting JSON-formatted parameters, see `Using quotation marks with strings in the AWS CLI <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-quoting-strings.html>`__ in the *AWS Command Line Interface User Guide*. | |
96 | ||
97 | **Example 7: To create a launch configuration with a spot instance** | |
98 | ||
99 | This example creates a launch configuration that uses Spot Instances. :: | |
100 | ||
101 | aws autoscaling create-launch-configuration \ | |
102 | --launch-configuration-name my-launch-config \ | |
103 | --image-id ami-01e24be29428c15b2 \ | |
104 | --instance-type c5.large \ | |
105 | --spot-price "0.50" | |
106 | ||
107 | This command produces no output. | |
108 | ||
109 | For more information, see `Requesting Spot Instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To create or update tags for an Auto Scaling group** | |
1 | ||
2 | This example adds two tags to the specified Auto Scaling group:: | |
3 | ||
4 | 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 | |
0 | **To create or update tags for an Auto Scaling group** | |
1 | ||
2 | This example adds two tags to the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling create-or-update-tags \ | |
5 | --tags ResourceId=my-asg,ResourceType=auto-scaling-group,Key=Role,Value=WebServer,PropagateAtLaunch=true ResourceId=my-asg,ResourceType=auto-scaling-group,Key=Dept,Value=Research,PropagateAtLaunch=true | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Tagging Auto Scaling groups and instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To delete an Auto Scaling group** | |
1 | ||
2 | This example deletes the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | To delete the Auto Scaling group without waiting for the instances in the group to terminate, use the ``--force-delete`` parameter:: | |
7 | ||
8 | aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --force-delete | |
9 | ||
10 | For more information, see `Deleting Your Auto Scaling Infrastructure`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
11 | ||
12 | .. _`Deleting Your Auto Scaling Infrastructure`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-process-shutdown.html | |
0 | **Example 1: To delete the specified Auto Scaling group** | |
1 | ||
2 | This example deletes the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling delete-auto-scaling-group --auto-scaling-group-name my-asg | |
5 | ||
6 | This command produces no output. | |
7 | ||
8 | For more information, see `Deleting your Auto Scaling infrastructure <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-process-shutdown.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
9 | ||
10 | **To force delete the specified Auto Scaling group** | |
11 | ||
12 | To delete the Auto Scaling group without waiting for the instances in the group to terminate, use the ``--force-delete`` option. :: | |
13 | ||
14 | aws autoscaling delete-auto-scaling-group \ | |
15 | --auto-scaling-group-name my-asg \ | |
16 | --force-delete | |
17 | ||
18 | This command produces no output. | |
19 | ||
20 | For more information, see `Deleting your Auto Scaling infrastructure <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-process-shutdown.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To delete a launch configuration** | |
1 | ||
2 | This example deletes the specified launch configuration:: | |
3 | ||
4 | aws autoscaling delete-launch-configuration --launch-configuration-name my-launch-config | |
5 | ||
6 | For more information, see `Deleting Your Auto Scaling Infrastructure`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Deleting Your Auto Scaling Infrastructure`: http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-process-shutdown.html | |
0 | **To delete a launch configuration** | |
1 | ||
2 | This example deletes the specified launch configuration. :: | |
3 | ||
4 | aws autoscaling delete-launch-configuration \ | |
5 | --launch-configuration-name my-launch-config | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Deleting your Auto Scaling infrastructure <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-process-shutdown.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To delete a lifecycle hook** | |
1 | ||
2 | This example deletes the specified lifecycle hook:: | |
3 | ||
4 | aws autoscaling delete-lifecycle-hook --lifecycle-hook-name my-lifecycle-hook --auto-scaling-group-name my-auto-scaling-group | |
0 | **To delete a lifecycle hook** | |
1 | ||
2 | This example deletes the specified lifecycle hook. :: | |
3 | ||
4 | aws autoscaling delete-lifecycle-hook \ | |
5 | --lifecycle-hook-name my-lifecycle-hook \ | |
6 | --auto-scaling-group-name my-asg | |
7 | ||
8 | This command produces no output.⏎ |
0 | **To delete an Auto Scaling notification** | |
1 | ||
2 | This example deletes the specified notification from the specified Auto Scaling group:: | |
3 | ||
4 | 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 | |
5 | ||
6 | For more information, see `Delete the Notification Configuration`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Delete the Notification Configuration`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html#delete-settingupnotifications | |
0 | **To delete an Auto Scaling notification** | |
1 | ||
2 | This example deletes the specified notification from the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling delete-notification-configuration \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --topic-arn arn:aws:sns:us-west-2:123456789012:my-sns-topic | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Delete the notification configuration <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html#delete-settingupnotifications>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To delete an Auto Scaling policy** | |
1 | ||
2 | This example deletes the specified Auto Scaling policy:: | |
3 | ||
4 | aws autoscaling delete-policy --auto-scaling-group-name my-auto-scaling-group --policy-name ScaleIn | |
0 | **To delete a scaling policy** | |
1 | ||
2 | This example deletes the specified scaling policy. :: | |
3 | ||
4 | aws autoscaling delete-policy \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --policy-name alb1000-target-tracking-scaling-policy | |
7 | ||
8 | This command produces no output. |
0 | **To delete a scheduled action from an Auto Scaling group** | |
1 | ||
2 | This example deletes the specified scheduled action from the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling delete-scheduled-action --auto-scaling-group-name my-auto-scaling-group --scheduled-action-name my-scheduled-action | |
0 | **To delete a scheduled action from an Auto Scaling group** | |
1 | ||
2 | This example deletes the specified scheduled action from the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling delete-scheduled-action \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --scheduled-action-name my-scheduled-action | |
7 | ||
8 | This command produces no output.⏎ |
0 | **To delete a tag from an Auto Scaling group** | |
1 | ||
2 | This example deletes the specified tag from the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling delete-tags --tags ResourceId=my-auto-scaling-group,ResourceType=auto-scaling-group,Key=Dept,Value=Research | |
5 | ||
6 | For more information, see `Tagging Auto Scaling Groups and Instances`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Tagging Auto Scaling Groups and Instances`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html | |
0 | **To delete a tag from an Auto Scaling group** | |
1 | ||
2 | This example deletes the specified tag from the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling delete-tags \ | |
5 | --tags ResourceId=my-asg,ResourceType=auto-scaling-group,Key=Dept,Value=Research | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Tagging Auto Scaling groups and instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To describe your Auto Scaling account limits** | |
1 | ||
2 | This example describes the Auto Scaling limits for your AWS account:: | |
3 | ||
4 | aws autoscaling describe-account-limits | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "NumberOfLaunchConfigurations": 5, | |
10 | "MaxNumberOfLaunchConfigurations": 100, | |
11 | "NumberOfAutoScalingGroups": 3, | |
12 | "MaxNumberOfAutoScalingGroups": 20 | |
13 | } | |
14 | ||
15 | For more information, see `Amazon EC2 Auto Scaling Limits`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
16 | ||
17 | .. _`Amazon EC2 Auto Scaling Limits`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html | |
0 | **To describe your Amazon EC2 Auto Scaling account limits** | |
1 | ||
2 | This example describes the Amazon EC2 Auto Scaling limits for your AWS account. :: | |
3 | ||
4 | aws autoscaling describe-account-limits | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "NumberOfLaunchConfigurations": 5, | |
10 | "MaxNumberOfLaunchConfigurations": 100, | |
11 | "NumberOfAutoScalingGroups": 3, | |
12 | "MaxNumberOfAutoScalingGroups": 20 | |
13 | } | |
14 | ||
15 | For more information, see `Amazon EC2 Auto Scaling service quotas <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To describe the Auto Scaling adjustment types** | |
1 | ||
2 | This example describes the available adjustment types:: | |
3 | ||
4 | aws autoscaling describe-adjustment-types | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "AdjustmentTypes": [ | |
10 | { | |
11 | "AdjustmentType": "ChangeInCapacity" | |
12 | }, | |
13 | { | |
14 | "AdjustmentType": "ExactCapcity" | |
15 | }, | |
16 | { | |
17 | "AdjustmentType": "PercentChangeInCapacity" | |
18 | } | |
19 | ] | |
20 | } | |
21 | ||
22 | For more information, see `Scaling Adjustment Types`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
23 | ||
24 | .. _`Scaling Adjustment Types`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment | |
0 | **To describe the available scaling adjustment types** | |
1 | ||
2 | This example describes the available adjustment types. :: | |
3 | ||
4 | aws autoscaling describe-adjustment-types | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "AdjustmentTypes": [ | |
10 | { | |
11 | "AdjustmentType": "ChangeInCapacity" | |
12 | }, | |
13 | { | |
14 | "AdjustmentType": "ExactCapacity" | |
15 | }, | |
16 | { | |
17 | "AdjustmentType": "PercentChangeInCapacity" | |
18 | } | |
19 | ] | |
20 | } | |
21 | ||
22 | For more information, see `Scaling adjustment types <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html#as-scaling-adjustment>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To get a description of an Auto Scaling group** | |
1 | ||
2 | This example describes the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | This example describes the specified Auto Scaling groups. It allows you to specify up to 100 group names:: | |
7 | ||
8 | aws autoscaling describe-auto-scaling-groups --max-items 100 --auto-scaling-group-name "group1" "group2" "group3" "group4" | |
9 | ||
10 | This example describes the Auto Scaling groups in the specified region, up to a maximum of 75 groups:: | |
11 | ||
12 | aws autoscaling describe-auto-scaling-groups --max-items 75 --region us-east-1 | |
13 | ||
14 | The following is example output:: | |
15 | ||
16 | { | |
17 | "AutoScalingGroups": [ | |
18 | { | |
19 | "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-auto-scaling-group", | |
20 | "HealthCheckGracePeriod": 300, | |
21 | "SuspendedProcesses": [], | |
22 | "DesiredCapacity": 1, | |
23 | "Tags": [], | |
24 | "EnabledMetrics": [], | |
25 | "LoadBalancerNames": [], | |
26 | "AutoScalingGroupName": "my-auto-scaling-group", | |
27 | "DefaultCooldown": 300, | |
28 | "MinSize": 0, | |
29 | "Instances": [ | |
30 | { | |
31 | "InstanceId": "i-4ba0837f", | |
32 | "AvailabilityZone": "us-west-2c", | |
33 | "HealthStatus": "Healthy", | |
34 | "LifecycleState": "InService", | |
35 | "LaunchConfigurationName": "my-launch-config" | |
36 | } | |
37 | ], | |
38 | "MaxSize": 1, | |
39 | "VPCZoneIdentifier": null, | |
40 | "TerminationPolicies": [ | |
41 | "Default" | |
42 | ], | |
43 | "LaunchConfigurationName": "my-launch-config", | |
44 | "CreatedTime": "2013-08-19T20:53:25.584Z", | |
45 | "AvailabilityZones": [ | |
46 | "us-west-2c" | |
47 | ], | |
48 | "HealthCheckType": "EC2", | |
49 | "NewInstancesProtectedFromScaleIn": false | |
50 | } | |
51 | ] | |
52 | } | |
53 | ||
54 | To return a specific number of Auto Scaling groups, use the ``max-items`` parameter:: | |
55 | ||
56 | aws autoscaling describe-auto-scaling-groups --max-items 1 | |
57 | ||
58 | 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:: | |
59 | ||
60 | aws autoscaling describe-auto-scaling-groups --starting-token Z3M3LMPEXAMPLE | |
0 | **Example 1: To describe the specified Auto Scaling group** | |
1 | ||
2 | This example describes the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling describe-auto-scaling-groups \ | |
5 | --auto-scaling-group-name my-asg | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "AutoScalingGroups": [ | |
11 | { | |
12 | "AutoScalingGroupName": "my-asg", | |
13 | "AutoScalingGroupARN": "arn:aws:autoscaling:us-west-2:123456789012:autoScalingGroup:930d940e-891e-4781-a11a-7b0acd480f03:autoScalingGroupName/my-asg", | |
14 | "LaunchTemplate": { | |
15 | "LaunchTemplateName": "my-launch-template", | |
16 | "Version": "1", | |
17 | "LaunchTemplateId": "lt-1234567890abcde12" | |
18 | }, | |
19 | "MinSize": 0, | |
20 | "MaxSize": 1, | |
21 | "DesiredCapacity": 1, | |
22 | "DefaultCooldown": 300, | |
23 | "AvailabilityZones": [ | |
24 | "us-west-2a", | |
25 | "us-west-2b", | |
26 | "us-west-2c" | |
27 | ], | |
28 | "LoadBalancerNames": [], | |
29 | "TargetGroupARNs": [], | |
30 | "HealthCheckType": "EC2", | |
31 | "HealthCheckGracePeriod": 0, | |
32 | "Instances": [ | |
33 | { | |
34 | "InstanceId": "i-06905f55584de02da", | |
35 | "InstanceType": "t2.micro", | |
36 | "AvailabilityZone": "us-west-2a", | |
37 | "HealthStatus": "Healthy", | |
38 | "LifecycleState": "InService", | |
39 | "ProtectedFromScaleIn": false, | |
40 | "LaunchTemplate": { | |
41 | "LaunchTemplateName": "my-launch-template", | |
42 | "Version": "1", | |
43 | "LaunchTemplateId": "lt-1234567890abcde12" | |
44 | } | |
45 | } | |
46 | ], | |
47 | "CreatedTime": "2020-10-28T02:39:22.152Z", | |
48 | "VPCZoneIdentifier": "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782", | |
49 | "SuspendedProcesses": [], | |
50 | "EnabledMetrics": [], | |
51 | "Tags": [], | |
52 | "TerminationPolicies": [ | |
53 | "Default" | |
54 | ], | |
55 | "NewInstancesProtectedFromScaleIn": false, | |
56 | "ServiceLinkedRoleARN":"arn" | |
57 | } | |
58 | ] | |
59 | } | |
60 | ||
61 | **Example 2: To describe the first 100 specified Auto Scaling group** | |
62 | ||
63 | This example describes the specified Auto Scaling groups. It allows you to specify up to 100 group names. :: | |
64 | ||
65 | aws autoscaling describe-auto-scaling-groups \ | |
66 | --max-items 100 \ | |
67 | --auto-scaling-group-name "group1" "group2" "group3" "group4" | |
68 | ||
69 | See example 1 for sample output. | |
70 | ||
71 | **Example 3: To describe an Auto Scaling group in the specified region** | |
72 | ||
73 | This example describes the Auto Scaling groups in the specified region, up to a maximum of 75 groups. :: | |
74 | ||
75 | aws autoscaling describe-auto-scaling-groups \ | |
76 | --max-items 75 \ | |
77 | --region us-east-1 | |
78 | ||
79 | See example 1 for sample output. | |
80 | ||
81 | **Example 4: To describe the specified number of Auto Scaling group** | |
82 | ||
83 | To return a specific number of Auto Scaling groups, use the ``--max-items`` option. :: | |
84 | ||
85 | aws autoscaling describe-auto-scaling-groups \ | |
86 | --max-items 1 | |
87 | ||
88 | See example 1 for sample output. | |
89 | ||
90 | 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`` option in a subsequent call as follows. :: | |
91 | ||
92 | aws autoscaling describe-auto-scaling-groups --starting-token Z3M3LMPEXAMPLE | |
93 | ||
94 | See example 1 for sample output. |
0 | **To describe one or more instances** | |
1 | ||
2 | This example describes the specified instance:: | |
3 | ||
4 | aws autoscaling describe-auto-scaling-instances --instance-ids i-4ba0837f | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "AutoScalingInstances": [ | |
10 | { | |
11 | "ProtectedFromScaleIn": false, | |
12 | "AvailabilityZone": "us-west-2c", | |
13 | "InstanceId": "i-4ba0837f", | |
14 | "AutoScalingGroupName": "my-auto-scaling-group", | |
15 | "HealthStatus": "HEALTHY", | |
16 | "LifecycleState": "InService", | |
17 | "LaunchConfigurationName": "my-launch-config" | |
18 | } | |
19 | ] | |
20 | } | |
21 | ||
22 | This example uses the ``max-items`` parameter to specify how many instances to return with this call:: | |
23 | ||
24 | aws autoscaling describe-auto-scaling-instances --max-items 1 | |
25 | ||
26 | The following is example output:: | |
27 | ||
28 | { | |
29 | "NextToken": "Z3M3LMPEXAMPLE", | |
30 | "AutoScalingInstances": [ | |
31 | { | |
32 | "ProtectedFromScaleIn": false, | |
33 | "AvailabilityZone": "us-west-2c", | |
34 | "InstanceId": "i-4ba0837f", | |
35 | "AutoScalingGroupName": "my-auto-scaling-group", | |
36 | "HealthStatus": "HEALTHY", | |
37 | "LifecycleState": "InService", | |
38 | "LaunchConfigurationName": "my-launch-config" | |
39 | } | |
40 | ] | |
41 | } | |
42 | ||
43 | 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:: | |
44 | ||
45 | aws autoscaling describe-auto-scaling-instances --starting-token Z3M3LMPEXAMPLE | |
0 | **Example 1: To describe one or more instances** | |
1 | ||
2 | This example describes the specified instance. :: | |
3 | ||
4 | aws autoscaling describe-auto-scaling-instances \ | |
5 | --instance-ids i-06905f55584de02da | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "AutoScalingInstances": [ | |
11 | { | |
12 | "InstanceId": "i-06905f55584de02da", | |
13 | "InstanceType": "t2.micro", | |
14 | "AutoScalingGroupName": "my-asg", | |
15 | "AvailabilityZone": "us-west-2b", | |
16 | "LifecycleState": "InService", | |
17 | "HealthStatus": "HEALTHY", | |
18 | "ProtectedFromScaleIn": false, | |
19 | "LaunchTemplate": { | |
20 | "LaunchTemplateId": "lt-1234567890abcde12", | |
21 | "LaunchTemplateName": "my-launch-template", | |
22 | "Version": "1" | |
23 | } | |
24 | } | |
25 | ] | |
26 | } | |
27 | ||
28 | **Example 2: To describe one or more instances** | |
29 | ||
30 | This example uses the ``--max-items`` option to specify how many instances to return with this call. :: | |
31 | ||
32 | aws autoscaling describe-auto-scaling-instances --max-items 1 | |
33 | ||
34 | 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`` option in a subsequent call as follows. :: | |
35 | ||
36 | aws autoscaling describe-auto-scaling-instances --starting-token Z3M3LMPEXAMPLE | |
37 | ||
38 | Output:: | |
39 | ||
40 | { | |
41 | "AutoScalingInstances": [ | |
42 | { | |
43 | "InstanceId": "i-06905f55584de02da", | |
44 | "InstanceType": "t2.micro", | |
45 | "AutoScalingGroupName": "my-asg", | |
46 | "AvailabilityZone": "us-west-2b", | |
47 | "LifecycleState": "InService", | |
48 | "HealthStatus": "HEALTHY", | |
49 | "ProtectedFromScaleIn": false, | |
50 | "LaunchTemplate": { | |
51 | "LaunchTemplateId": "lt-1234567890abcde12", | |
52 | "LaunchTemplateName": "my-launch-template", | |
53 | "Version": "1" | |
54 | } | |
55 | } | |
56 | ] | |
57 | }⏎ |
0 | **To describe the Auto Scaling notification types** | |
1 | ||
2 | This example describes the available notification types:: | |
3 | ||
4 | aws autoscaling describe-auto-scaling-notification-types | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "AutoScalingNotificationTypes": [ | |
10 | "autoscaling:EC2_INSTANCE_LAUNCH", | |
11 | "autoscaling:EC2_INSTANCE_LAUNCH_ERROR", | |
12 | "autoscaling:EC2_INSTANCE_TERMINATE", | |
13 | "autoscaling:EC2_INSTANCE_TERMINATE_ERROR", | |
14 | "autoscaling:TEST_NOTIFICATION" | |
15 | ] | |
16 | } | |
17 | ||
18 | For more information, see `Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
19 | ||
20 | .. _`Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html | |
0 | **To describe the available notification types** | |
1 | ||
2 | This example describes the available notification types. :: | |
3 | ||
4 | aws autoscaling describe-auto-scaling-notification-types | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "AutoScalingNotificationTypes": [ | |
10 | "autoscaling:EC2_INSTANCE_LAUNCH", | |
11 | "autoscaling:EC2_INSTANCE_LAUNCH_ERROR", | |
12 | "autoscaling:EC2_INSTANCE_TERMINATE", | |
13 | "autoscaling:EC2_INSTANCE_TERMINATE_ERROR", | |
14 | "autoscaling:TEST_NOTIFICATION" | |
15 | ] | |
16 | } | |
17 | ||
18 | For more information, see `Getting Amazon SNS notifications when your Auto Scaling group scales <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
28 | 28 | ] |
29 | 29 | } |
30 | 30 | |
31 | For more information, see `Replacing Auto Scaling Instances Based on an Instance Refresh <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ | |
31 | For more information, see `Replacing Auto Scaling instances based on an instance refresh <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To describe Auto Scaling launch configurations** | |
1 | ||
2 | This example describes the specified launch configuration:: | |
3 | ||
4 | aws autoscaling describe-launch-configurations --launch-configuration-names my-launch-config | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "LaunchConfigurations": [ | |
10 | { | |
11 | "UserData": null, | |
12 | "EbsOptimized": false, | |
13 | "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config", | |
14 | "InstanceMonitoring": { | |
15 | "Enabled": true | |
16 | }, | |
17 | "ImageId": "ami-043a5034", | |
18 | "CreatedTime": "2014-05-07T17:39:28.599Z", | |
19 | "BlockDeviceMappings": [], | |
20 | "KeyName": null, | |
21 | "SecurityGroups": [ | |
22 | "sg-67ef0308" | |
23 | ], | |
24 | "LaunchConfigurationName": "my-launch-config", | |
25 | "KernelId": null, | |
26 | "RamdiskId": null, | |
27 | "InstanceType": "t1.micro", | |
28 | "AssociatePublicIpAddress": true | |
29 | } | |
30 | ] | |
31 | } | |
32 | ||
33 | To return a specific number of launch configurations, use the ``max-items`` parameter:: | |
34 | ||
35 | aws autoscaling describe-launch-configurations --max-items 1 | |
36 | ||
37 | The following is example output:: | |
38 | ||
39 | { | |
40 | "NextToken": "Z3M3LMPEXAMPLE", | |
41 | "LaunchConfigurations": [ | |
42 | { | |
43 | "UserData": null, | |
44 | "EbsOptimized": false, | |
45 | "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config", | |
46 | "InstanceMonitoring": { | |
47 | "Enabled": true | |
48 | }, | |
49 | "ImageId": "ami-043a5034", | |
50 | "CreatedTime": "2014-05-07T17:39:28.599Z", | |
51 | "BlockDeviceMappings": [], | |
52 | "KeyName": null, | |
53 | "SecurityGroups": [ | |
54 | "sg-67ef0308" | |
55 | ], | |
56 | "LaunchConfigurationName": "my-launch-config", | |
57 | "KernelId": null, | |
58 | "RamdiskId": null, | |
59 | "InstanceType": "t1.micro", | |
60 | "AssociatePublicIpAddress": true | |
61 | } | |
62 | ] | |
63 | } | |
64 | ||
65 | 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:: | |
66 | ||
67 | aws autoscaling describe-launch-configurations --starting-token Z3M3LMPEXAMPLE | |
0 | **Example 1: To describe the specified launch configuration** | |
1 | ||
2 | This example describes the specified launch configuration. :: | |
3 | ||
4 | aws autoscaling describe-launch-configurations \ | |
5 | --launch-configuration-names my-launch-config | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "LaunchConfigurations": [ | |
11 | { | |
12 | "LaunchConfigurationName": "my-launch-config", | |
13 | "LaunchConfigurationARN": "arn:aws:autoscaling:us-west-2:123456789012:launchConfiguration:98d3b196-4cf9-4e88-8ca1-8547c24ced8b:launchConfigurationName/my-launch-config", | |
14 | "ImageId": "ami-0528a5175983e7f28", | |
15 | "KeyName": "my-key-pair-uswest2", | |
16 | "SecurityGroups": [ | |
17 | "sg-05eaec502fcdadc2e" | |
18 | ], | |
19 | "ClassicLinkVPCSecurityGroups": [], | |
20 | "UserData": "", | |
21 | "InstanceType": "t2.micro", | |
22 | "KernelId": "", | |
23 | "RamdiskId": "", | |
24 | "BlockDeviceMappings": [ | |
25 | { | |
26 | "DeviceName": "/dev/xvda", | |
27 | "Ebs": { | |
28 | "SnapshotId": "snap-06c1606ba5ca274b1", | |
29 | "VolumeSize": 8, | |
30 | "VolumeType": "gp2", | |
31 | "DeleteOnTermination": true, | |
32 | "Encrypted": false | |
33 | } | |
34 | } | |
35 | ], | |
36 | "InstanceMonitoring": { | |
37 | "Enabled": true | |
38 | }, | |
39 | "CreatedTime": "2020-10-28T02:39:22.321Z", | |
40 | "EbsOptimized": false, | |
41 | "AssociatePublicIpAddress": true, | |
42 | "MetadataOptions": { | |
43 | "HttpTokens": "required", | |
44 | "HttpPutResponseHopLimit": 1, | |
45 | "HttpEndpoint": "disabled" | |
46 | } | |
47 | } | |
48 | ] | |
49 | } | |
50 | ||
51 | **Example 2: To describe a specified number of launch configurations** | |
52 | ||
53 | To return a specific number of launch configurations, use the ``--max-items`` option. :: | |
54 | ||
55 | aws autoscaling describe-launch-configurations \ | |
56 | --max-items 1 | |
57 | ||
58 | 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`` option in a subsequent call as follows. :: | |
59 | ||
60 | aws autoscaling describe-launch-configurations \ | |
61 | --starting-token Z3M3LMPEXAMPLE |
0 | **To describe the available types of lifecycle hooks** | |
1 | ||
2 | This example describes the available lifecycle hook types:: | |
3 | ||
4 | aws autoscaling describe-lifecycle-hook-types | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "LifecycleHookTypes": [ | |
10 | "autoscaling:EC2_INSTANCE_LAUNCHING", | |
11 | "autoscaling:EC2_INSTANCE_TERMINATING" | |
12 | ] | |
13 | } | |
0 | **To describe the available lifecycle hook types** | |
1 | ||
2 | This example describes the available lifecycle hook types. :: | |
3 | ||
4 | aws autoscaling describe-lifecycle-hook-types | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "LifecycleHookTypes": [ | |
10 | "autoscaling:EC2_INSTANCE_LAUNCHING", | |
11 | "autoscaling:EC2_INSTANCE_TERMINATING" | |
12 | ] | |
13 | } |
0 | **To describe your lifecycle hooks** | |
1 | ||
2 | This example describes the lifecycle hooks for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling describe-lifecycle-hooks --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "LifecycleHooks": [ | |
10 | { | |
11 | "GlobalTimeout": 172800, | |
12 | "HeartbeatTimeout": 3600, | |
13 | "RoleARN": "arn:aws:iam::123456789012:role/my-auto-scaling-role", | |
14 | "AutoScalingGroupName": "my-auto-scaling-group", | |
15 | "LifecycleHookName": "my-lifecycle-hook", | |
16 | "DefaultResult": "ABANDON", | |
17 | "NotificationTargetARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic", | |
18 | "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING" | |
19 | } | |
20 | ] | |
21 | } | |
0 | **To describe your lifecycle hooks** | |
1 | ||
2 | This example describes the lifecycle hooks for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling describe-lifecycle-hooks \ | |
5 | --auto-scaling-group-name my-asg | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "LifecycleHooks": [ | |
11 | { | |
12 | "GlobalTimeout": 3000, | |
13 | "HeartbeatTimeout": 30, | |
14 | "AutoScalingGroupName": "my-asg", | |
15 | "LifecycleHookName": "my-launch-hook", | |
16 | "DefaultResult": "ABANDON", | |
17 | "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING" | |
18 | }, | |
19 | { | |
20 | "GlobalTimeout": 6000, | |
21 | "HeartbeatTimeout": 60, | |
22 | "AutoScalingGroupName": "my-asg", | |
23 | "LifecycleHookName": "my-termination-hook", | |
24 | "DefaultResult": "CONTINUE", | |
25 | "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING" | |
26 | } | |
27 | ] | |
28 | }⏎ |
0 | **To describe the target groups for an Auto Scaling group** | |
1 | ||
2 | This example describes the target groups attached to the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling describe-load-balancer-target-groups --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "LoadBalancerTargetGroups": [ | |
10 | { | |
11 | "LoadBalancerTargetGroupARN": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", | |
12 | "State": "Added" | |
13 | } | |
14 | ] | |
15 | } | |
0 | **To describe the load balancer target groups for an Auto Scaling group** | |
1 | ||
2 | This example describes the load balancer target groups attached to the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling describe-load-balancer-target-groups \ | |
5 | --auto-scaling-group-name my-asg | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "LoadBalancerTargetGroups": [ | |
11 | { | |
12 | "LoadBalancerTargetGroupARN": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067", | |
13 | "State": "Added" | |
14 | } | |
15 | ] | |
16 | } |
0 | **To describe the load balancers for an Auto Scaling group** | |
1 | ||
2 | This example describes the load balancers for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling describe-load-balancers --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "LoadBalancers": [ | |
10 | { | |
11 | "State": "Added", | |
12 | "LoadBalancerName": "my-load-balancer" | |
13 | } | |
14 | ] | |
15 | } | |
0 | **To describe the Classic Load Balancers for an Auto Scaling group** | |
1 | ||
2 | This example describes the Classic Load Balancers for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling describe-load-balancers \ | |
5 | --auto-scaling-group-name my-asg | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "LoadBalancers": [ | |
11 | { | |
12 | "State": "Added", | |
13 | "LoadBalancerName": "my-load-balancer" | |
14 | } | |
15 | ] | |
16 | } |
0 | **To describe the Auto Scaling metric collection types** | |
1 | ||
2 | This example describes the available metric collection types:: | |
3 | ||
4 | aws autoscaling describe-metric-collection-types | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "Metrics": [ | |
10 | { | |
11 | "Metric": "GroupMinSize" | |
12 | }, | |
13 | { | |
14 | "Metric": "GroupMaxSize" | |
15 | }, | |
16 | { | |
17 | "Metric": "GroupDesiredCapacity" | |
18 | }, | |
19 | { | |
20 | "Metric": "GroupInServiceInstances" | |
21 | }, | |
22 | { | |
23 | "Metric": "GroupPendingInstances" | |
24 | }, | |
25 | { | |
26 | "Metric": "GroupTerminatingInstances" | |
27 | }, | |
28 | { | |
29 | "Metric": "GroupStandbyInstances" | |
30 | }, | |
31 | { | |
32 | "Metric": "GroupTotalInstances" | |
33 | } | |
34 | ], | |
35 | "Granularities": [ | |
36 | { | |
37 | "Granularity": "1Minute" | |
38 | } | |
39 | ] | |
40 | } | |
41 | ||
42 | For more information, see `Auto Scaling Group Metrics`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
43 | ||
44 | .. _`Auto Scaling Group Metrics`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html#as-group-metrics | |
0 | **To describe the available metric collection types** | |
1 | ||
2 | This example describes the available metric collection types. :: | |
3 | ||
4 | aws autoscaling describe-metric-collection-types | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Metrics": [ | |
10 | { | |
11 | "Metric": "GroupMinSize" | |
12 | }, | |
13 | { | |
14 | "Metric": "GroupMaxSize" | |
15 | }, | |
16 | { | |
17 | "Metric": "GroupDesiredCapacity" | |
18 | }, | |
19 | { | |
20 | "Metric": "GroupInServiceInstances" | |
21 | }, | |
22 | { | |
23 | "Metric": "GroupPendingInstances" | |
24 | }, | |
25 | { | |
26 | "Metric": "GroupTerminatingInstances" | |
27 | }, | |
28 | { | |
29 | "Metric": "GroupStandbyInstances" | |
30 | }, | |
31 | { | |
32 | "Metric": "GroupTotalInstances" | |
33 | } | |
34 | ], | |
35 | "Granularities": [ | |
36 | { | |
37 | "Granularity": "1Minute" | |
38 | } | |
39 | ] | |
40 | } | |
41 | ||
42 | For more information, see `Auto Scaling group metrics <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html#as-group-metrics>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To describe the Auto Scaling notification configurations** | |
1 | ||
2 | This example describes the notification configurations for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling describe-notification-configurations --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "NotificationConfigurations": [ | |
10 | { | |
11 | "AutoScalingGroupName": "my-auto-scaling-group", | |
12 | "NotificationType": "autoscaling:TEST_NOTIFICATION", | |
13 | "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" | |
14 | }, | |
15 | { | |
16 | "AutoScalingGroupName": "my-auto-scaling-group", | |
17 | "NotificationType": "autoscaling:TEST_NOTIFICATION", | |
18 | "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic" | |
19 | } | |
20 | ] | |
21 | } | |
22 | ||
23 | To return a specific number of notification configurations, use the ``max-items`` parameter:: | |
24 | ||
25 | aws autoscaling describe-notification-configurations --auto-scaling-group-name my-auto-scaling-group --max-items 1 | |
26 | ||
27 | The following is example output:: | |
28 | ||
29 | { | |
30 | "NextToken": "Z3M3LMPEXAMPLE", | |
31 | "NotificationConfigurations": [ | |
32 | { | |
33 | "AutoScalingGroupName": "my-auto-scaling-group", | |
34 | "NotificationType": "autoscaling:TEST_NOTIFICATION", | |
35 | "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" | |
36 | } | |
37 | ] | |
38 | } | |
39 | ||
40 | Use the ``NextToken`` field with the ``starting-token`` parameter in a subsequent call to get additional notification configurations:: | |
41 | ||
42 | aws autoscaling describe-notification-configurations --auto-scaling-group-name my-auto-scaling-group --starting-token Z3M3LMPEXAMPLE | |
43 | ||
44 | For more information, see `Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
45 | ||
46 | .. _`Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html | |
0 | **Example 1: To describe the notification configurations of a specified group** | |
1 | ||
2 | This example describes the notification configurations for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling describe-notification-configurations \ | |
5 | --auto-scaling-group-name my-asg | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "NotificationConfigurations": [ | |
11 | { | |
12 | "AutoScalingGroupName": "my-asg", | |
13 | "NotificationType": "autoscaling:TEST_NOTIFICATION", | |
14 | "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" | |
15 | }, | |
16 | { | |
17 | "AutoScalingGroupName": "my-asg", | |
18 | "NotificationType": "autoscaling:TEST_NOTIFICATION", | |
19 | "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ||
24 | For more information, see `Getting Amazon SNS notifications when your Auto Scaling group scales <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
25 | ||
26 | **Example 1: To describe a specified number of notification configurations** | |
27 | ||
28 | To return a specific number of notification configurations, use the ``max-items`` parameter. :: | |
29 | ||
30 | aws autoscaling describe-notification-configurations \ | |
31 | --auto-scaling-group-name my-auto-scaling-group \ | |
32 | --max-items 1 | |
33 | ||
34 | Output:: | |
35 | ||
36 | { | |
37 | "NotificationConfigurations": [ | |
38 | { | |
39 | "AutoScalingGroupName": "my-asg", | |
40 | "NotificationType": "autoscaling:TEST_NOTIFICATION", | |
41 | "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic-2" | |
42 | }, | |
43 | { | |
44 | "AutoScalingGroupName": "my-asg", | |
45 | "NotificationType": "autoscaling:TEST_NOTIFICATION", | |
46 | "TopicARN": "arn:aws:sns:us-west-2:123456789012:my-sns-topic" | |
47 | } | |
48 | ] | |
49 | } | |
50 | ||
51 | If the output includes a ``NextToken`` field, there are more notification configurations. To get the additional notification configurations, use the value of this field with the ``starting-token`` parameter in a subsequent call as follows. :: | |
52 | ||
53 | aws autoscaling describe-notification-configurations \ | |
54 | --auto-scaling-group-name my-asg \ | |
55 | --starting-token Z3M3LMPEXAMPLE | |
56 | ||
57 | For more information, see `Getting Amazon SNS notifications when your Auto Scaling group scales <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To describe Auto Scaling policies** | |
1 | ||
2 | This example describes the policies for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling describe-policies --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "ScalingPolicies": [ | |
10 | { | |
11 | "PolicyName": "ScaleIn", | |
12 | "AutoScalingGroupName": "my-auto-scaling-group", | |
13 | "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn", | |
14 | "AdjustmentType": "ChangeInCapacity", | |
15 | "Alarms": [], | |
16 | "ScalingAdjustment": -1 | |
17 | }, | |
18 | { | |
19 | "PolicyName": "ScalePercentChange", | |
20 | "MinAdjustmentStep": 2, | |
21 | "AutoScalingGroupName": "my-auto-scaling-group", | |
22 | "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2b435159-cf77-4e89-8c0e-d63b497baad7:autoScalingGroupName/my-auto-scaling-group:policyName/ScalePercentChange", | |
23 | "Cooldown": 60, | |
24 | "AdjustmentType": "PercentChangeInCapacity", | |
25 | "Alarms": [], | |
26 | "ScalingAdjustment": 25 | |
27 | } | |
28 | ] | |
29 | } | |
30 | ||
31 | To return specific scaling policies, use the ``policy-names`` parameter:: | |
32 | ||
33 | aws autoscaling describe-policies --auto-scaling-group-name my-auto-scaling-group --policy-names ScaleIn | |
34 | ||
35 | To return a specific number of policies, use the ``max-items`` parameter:: | |
36 | ||
37 | aws autoscaling describe-policies --auto-scaling-group-name my-auto-scaling-group --max-items 1 | |
38 | ||
39 | The following is example output:: | |
40 | ||
41 | { | |
42 | "ScalingPolicies": [ | |
43 | { | |
44 | "PolicyName": "ScaleIn", | |
45 | "AutoScalingGroupName": "my-auto-scaling-group", | |
46 | "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:2233f3d7-6290-403b-b632-93c553560106:autoScalingGroupName/my-auto-scaling-group:policyName/ScaleIn", | |
47 | "AdjustmentType": "ChangeInCapacity", | |
48 | "Alarms": [], | |
49 | "ScalingAdjustment": -1 | |
50 | } | |
51 | ], | |
52 | "NextToken": "Z3M3LMPEXAMPLE" | |
53 | } | |
54 | ||
55 | 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:: | |
56 | ||
57 | aws autoscaling describe-policies --auto-scaling-group-name my-auto-scaling-group --starting-token Z3M3LMPEXAMPLE | |
58 | ||
59 | For more information, see `Dynamic Scaling`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
60 | ||
61 | .. _`Dynamic Scaling`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html | |
0 | **Example 1: To describe the scaling policies of a specified group** | |
1 | ||
2 | This example describes the scaling policies for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling describe-policies \ | |
5 | --auto-scaling-group-name my-asg | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ScalingPolicies": [ | |
11 | { | |
12 | "AutoScalingGroupName": "my-asg", | |
13 | "PolicyName": "alb1000-target-tracking-scaling-policy", | |
14 | "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:3065d9c8-9969-4bec-bb6a-3fbe5550fde6:autoScalingGroupName/my-asg:policyName/alb1000-target-tracking-scaling-policy", | |
15 | "PolicyType": "TargetTrackingScaling", | |
16 | "StepAdjustments": [], | |
17 | "Alarms": [ | |
18 | { | |
19 | "AlarmName": "TargetTracking-my-asg-AlarmHigh-924887a9-12d7-4e01-8686-6f844d13a196", | |
20 | "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-my-asg-AlarmHigh-924887a9-12d7-4e01-8686-6f844d13a196" | |
21 | }, | |
22 | { | |
23 | "AlarmName": "TargetTracking-my-asg-AlarmLow-f96f899d-b8e7-4d09-a010-c1aaa35da296", | |
24 | "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-my-asg-AlarmLow-f96f899d-b8e7-4d09-a010-c1aaa35da296" | |
25 | } | |
26 | ], | |
27 | "TargetTrackingConfiguration": { | |
28 | "PredefinedMetricSpecification": { | |
29 | "PredefinedMetricType": "ALBRequestCountPerTarget", | |
30 | "ResourceLabel": "app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff" | |
31 | }, | |
32 | "TargetValue": 1000.0, | |
33 | "DisableScaleIn": false | |
34 | }, | |
35 | "Enabled": true | |
36 | }, | |
37 | { | |
38 | "AutoScalingGroupName": "my-asg", | |
39 | "PolicyName": "cpu40-target-tracking-scaling-policy", | |
40 | "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:5fd26f71-39d4-4690-82a9-b8515c45cdde:autoScalingGroupName/my-asg:policyName/cpu40-target-tracking-scaling-policy", | |
41 | "PolicyType": "TargetTrackingScaling", | |
42 | "StepAdjustments": [], | |
43 | "Alarms": [ | |
44 | { | |
45 | "AlarmName": "TargetTracking-my-asg-AlarmHigh-139f9789-37b9-42ad-bea5-b5b147d7f473", | |
46 | "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-my-asg-AlarmHigh-139f9789-37b9-42ad-bea5-b5b147d7f473" | |
47 | }, | |
48 | { | |
49 | "AlarmName": "TargetTracking-my-asg-AlarmLow-bd681c67-fc18-4c56-8468-fb8e413009c9", | |
50 | "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-my-asg-AlarmLow-bd681c67-fc18-4c56-8468-fb8e413009c9" | |
51 | } | |
52 | ], | |
53 | "TargetTrackingConfiguration": { | |
54 | "PredefinedMetricSpecification": { | |
55 | "PredefinedMetricType": "ASGAverageCPUUtilization" | |
56 | }, | |
57 | "TargetValue": 40.0, | |
58 | "DisableScaleIn": false | |
59 | }, | |
60 | "Enabled": true | |
61 | } | |
62 | ] | |
63 | } | |
64 | ||
65 | For more information, see `Dynamic scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
66 | ||
67 | **Example 2: To describe the scaling policies of a specified name** | |
68 | ||
69 | To return specific scaling policies, use the ``--policy-names`` option. :: | |
70 | ||
71 | aws autoscaling describe-policies \ | |
72 | --auto-scaling-group-name my-asg \ | |
73 | --policy-names cpu40-target-tracking-scaling-policy | |
74 | ||
75 | See example 1 for sample output. | |
76 | ||
77 | For more information, see `Dynamic scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
78 | ||
79 | **Example 3: To describe a number of scaling policies** | |
80 | ||
81 | To return a specific number of policies, use the ``--max-items`` option. :: | |
82 | ||
83 | aws autoscaling describe-policies \ | |
84 | --auto-scaling-group-name my-asg \ | |
85 | --max-items 1 | |
86 | ||
87 | See example 1 for sample output. | |
88 | ||
89 | If the output includes a ``NextToken`` field, use the value of this field with the ``--starting-token`` option in a subsequent call to get the additional policies. :: | |
90 | ||
91 | aws autoscaling describe-policies --auto-scaling-group-name my-asg --starting-token Z3M3LMPEXAMPLE | |
92 | ||
93 | For more information, see `Dynamic scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To get a description of the scaling activities for an Auto Scaling group** | |
1 | ||
2 | This example describes the scaling activities for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling describe-scaling-activities --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "Activities": [ | |
10 | { | |
11 | "Description": "Launching a new EC2 instance: i-4ba0837f", | |
12 | "AutoScalingGroupName": "my-auto-scaling-group", | |
13 | "ActivityId": "f9f2d65b-f1f2-43e7-b46d-d86756459699", | |
14 | "Details": "{"Availability Zone":"us-west-2c"}", | |
15 | "StartTime": "2013-08-19T20:53:29.930Z", | |
16 | "Progress": 100, | |
17 | "EndTime": "2013-08-19T20:54:02Z", | |
18 | "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.", | |
19 | "StatusCode": "Successful" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ||
24 | To describe a specific scaling activity, use the ``activity-ids`` parameter:: | |
25 | ||
26 | aws autoscaling describe-scaling-activities --activity-ids b55c7b67-c8aa-4d10-b240-730ff91d8895 | |
27 | ||
28 | To return a specific number of activities, use the ``max-items`` parameter:: | |
29 | ||
30 | aws autoscaling describe-scaling-activities --max-items 1 | |
31 | ||
32 | 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:: | |
33 | ||
34 | aws autoscaling describe-scaling-activities --starting-token Z3M3LMPEXAMPLE | |
0 | **Example 1: To describe scaling activities for the specified group** | |
1 | ||
2 | This example describes the scaling activities for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling describe-scaling-activities \ | |
5 | --auto-scaling-group-name my-asg | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Activities": [ | |
11 | { | |
12 | "ActivityId": "f9f2d65b-f1f2-43e7-b46d-d86756459699", | |
13 | "Description": "Launching a new EC2 instance: i-0d44425630326060f", | |
14 | "AutoScalingGroupName": "my-asg", | |
15 | "Cause": "At 2020-10-30T19:35:51Z a user request update of AutoScalingGroup constraints to min: 0, max: 16, desired: 16 changing the desired capacity from 0 to 16. At 2020-10-30T19:36:07Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 16.", | |
16 | "StartTime": "2020-10-30T19:36:09.766Z", | |
17 | "EndTime": "2020-10-30T19:36:41Z", | |
18 | "StatusCode": "Successful", | |
19 | "Progress": 100, | |
20 | "Details": "{\"Subnet ID\":\"subnet-5ea0c127\",\"Availability Zone\":\"us-west-2b\"}" | |
21 | } | |
22 | ] | |
23 | } | |
24 | ||
25 | **Example 2: To describe the scaling activities of the specified activity ID** | |
26 | ||
27 | To describe a specific scaling activity, use the ``--activity-ids`` option. :: | |
28 | ||
29 | aws autoscaling describe-scaling-activities \ | |
30 | --activity-ids b55c7b67-c8aa-4d10-b240-730ff91d8895 | |
31 | ||
32 | Output:: | |
33 | ||
34 | { | |
35 | "Activities": [ | |
36 | { | |
37 | "ActivityId": "f9f2d65b-f1f2-43e7-b46d-d86756459699", | |
38 | "Description": "Launching a new EC2 instance: i-0d44425630326060f", | |
39 | "AutoScalingGroupName": "my-asg", | |
40 | "Cause": "At 2020-10-30T19:35:51Z a user request update of AutoScalingGroup constraints to min: 0, max: 16, desired: 16 changing the desired capacity from 0 to 16. At 2020-10-30T19:36:07Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 16.", | |
41 | "StartTime": "2020-10-30T19:36:09.766Z", | |
42 | "EndTime": "2020-10-30T19:36:41Z", | |
43 | "StatusCode": "Successful", | |
44 | "Progress": 100, | |
45 | "Details": "{\"Subnet ID\":\"subnet-5ea0c127\",\"Availability Zone\":\"us-west-2b\"}" | |
46 | } | |
47 | ] | |
48 | } | |
49 | ||
50 | **Example 3: To describe a specified number of scaling activities** | |
51 | ||
52 | To return a specific number of activities, use the ``--max-items`` option. :: | |
53 | ||
54 | aws autoscaling describe-scaling-activities --max-items 1 | |
55 | ||
56 | Output:: | |
57 | ||
58 | { | |
59 | "Activities": [ | |
60 | { | |
61 | "ActivityId": "f9f2d65b-f1f2-43e7-b46d-d86756459699", | |
62 | "Description": "Launching a new EC2 instance: i-0d44425630326060f", | |
63 | "AutoScalingGroupName": "my-asg", | |
64 | "Cause": "At 2020-10-30T19:35:51Z a user request update of AutoScalingGroup constraints to min: 0, max: 16, desired: 16 changing the desired capacity from 0 to 16. At 2020-10-30T19:36:07Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 16.", | |
65 | "StartTime": "2020-10-30T19:36:09.766Z", | |
66 | "EndTime": "2020-10-30T19:36:41Z", | |
67 | "StatusCode": "Successful", | |
68 | "Progress": 100, | |
69 | "Details": "{\"Subnet ID\":\"subnet-5ea0c127\",\"Availability Zone\":\"us-west-2b\"}" | |
70 | } | |
71 | ] | |
72 | } | |
73 | ||
74 | 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`` option in a subsequent call as follows. :: | |
75 | ||
76 | aws autoscaling describe-scaling-activities --starting-token Z3M3LMPEXAMPLE |
0 | **To describe the Auto Scaling process types** | |
1 | ||
2 | This example describes the Auto Scaling process types:: | |
3 | ||
4 | aws autoscaling describe-scaling-process-types | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "Processes": [ | |
10 | { | |
11 | "ProcessName": "AZRebalance" | |
12 | }, | |
13 | { | |
14 | "ProcessName": "AddToLoadBalancer" | |
15 | }, | |
16 | { | |
17 | "ProcessName": "AlarmNotification" | |
18 | }, | |
19 | { | |
20 | "ProcessName": "HealthCheck" | |
21 | }, | |
22 | { | |
23 | "ProcessName": "Launch" | |
24 | }, | |
25 | { | |
26 | "ProcessName": "ReplaceUnhealthy" | |
27 | }, | |
28 | { | |
29 | "ProcessName": "ScheduledActions" | |
30 | }, | |
31 | { | |
32 | "ProcessName": "Terminate" | |
33 | } | |
34 | ] | |
35 | } | |
36 | ||
37 | For more information, see `Suspending and Resuming Scaling Processes`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
38 | ||
39 | .. _`Suspending and Resuming Scaling Processes`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html | |
0 | **To describe the available process types** | |
1 | ||
2 | This example describes the available process types. :: | |
3 | ||
4 | aws autoscaling describe-scaling-process-types | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Processes": [ | |
10 | { | |
11 | "ProcessName": "AZRebalance" | |
12 | }, | |
13 | { | |
14 | "ProcessName": "AddToLoadBalancer" | |
15 | }, | |
16 | { | |
17 | "ProcessName": "AlarmNotification" | |
18 | }, | |
19 | { | |
20 | "ProcessName": "HealthCheck" | |
21 | }, | |
22 | { | |
23 | "ProcessName": "Launch" | |
24 | }, | |
25 | { | |
26 | "ProcessName": "ReplaceUnhealthy" | |
27 | }, | |
28 | { | |
29 | "ProcessName": "ScheduledActions" | |
30 | }, | |
31 | { | |
32 | "ProcessName": "Terminate" | |
33 | } | |
34 | ] | |
35 | } | |
36 | ||
37 | For more information, see `Suspending and resuming scaling processes <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To describe scheduled actions** | |
1 | ||
2 | This example describes all your scheduled actions:: | |
3 | ||
4 | aws autoscaling describe-scheduled-actions | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "ScheduledUpdateGroupActions": [ | |
10 | { | |
11 | "MinSize": 2, | |
12 | "DesiredCapacity": 4, | |
13 | "AutoScalingGroupName": "my-auto-scaling-group", | |
14 | "MaxSize": 6, | |
15 | "Recurrence": "30 0 1 12 *", | |
16 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-auto-scaling-group:scheduledActionName/my-scheduled-action", | |
17 | "ScheduledActionName": "my-scheduled-action", | |
18 | "StartTime": "2019-12-01T00:30:00Z", | |
19 | "Time": "2019-12-01T00:30:00Z" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ||
24 | To describe the scheduled actions for a specific Auto Scaling group, use the ``auto-scaling-group-name`` parameter:: | |
25 | ||
26 | aws autoscaling describe-scheduled-actions --auto-scaling-group-name my-auto-scaling-group | |
27 | ||
28 | To describe a specific scheduled action, use the ``scheduled-action-names`` parameter:: | |
29 | ||
30 | aws autoscaling describe-scheduled-actions --scheduled-action-names my-scheduled-action | |
31 | ||
32 | To describe the scheduled actions that start at a specific time, use the ``start-time`` parameter:: | |
33 | ||
34 | aws autoscaling describe-scheduled-actions --start-time "2019-12-01T00:30:00Z" | |
35 | ||
36 | To describe the scheduled actions that end at a specific time, use the ``end-time`` parameter:: | |
37 | ||
38 | aws autoscaling describe-scheduled-actions --end-time "2022-12-01T00:30:00Z" | |
39 | ||
40 | To return a specific number of scheduled actions, use the ``max-items`` parameter:: | |
41 | ||
42 | aws autoscaling describe-scheduled-actions --auto-scaling-group-name my-auto-scaling-group --max-items 1 | |
43 | ||
44 | The following is example output:: | |
45 | ||
46 | { | |
47 | "NextToken": "Z3M3LMPEXAMPLE", | |
48 | "ScheduledUpdateGroupActions": [ | |
49 | { | |
50 | "MinSize": 2, | |
51 | "DesiredCapacity": 4, | |
52 | "AutoScalingGroupName": "my-auto-scaling-group", | |
53 | "MaxSize": 6, | |
54 | "Recurrence": "30 0 1 12 *", | |
55 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-auto-scaling-group:scheduledActionName/my-scheduled-action", | |
56 | "ScheduledActionName": "my-scheduled-action", | |
57 | "StartTime": "2019-12-01T00:30:00Z", | |
58 | "Time": "2019-12-01T00:30:00Z" | |
59 | } | |
60 | ] | |
61 | } | |
62 | ||
63 | Use the ``NextToken`` field with the ``starting-token`` parameter in a subsequent call to get the additional scheduled actions:: | |
64 | ||
65 | aws autoscaling describe-scheduled-actions --auto-scaling-group-name my-auto-scaling-group --starting-token Z3M3LMPEXAMPLE | |
66 | ||
67 | For more information, see `Scheduled Scaling`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
68 | ||
69 | .. _`Scheduled Scaling`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html | |
0 | **Example 1: To describe all scheduled actions** | |
1 | ||
2 | This example describes all your scheduled actions. :: | |
3 | ||
4 | aws autoscaling describe-scheduled-actions | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "ScheduledUpdateGroupActions": [ | |
10 | { | |
11 | "AutoScalingGroupName": "my-asg", | |
12 | "ScheduledActionName": "my-recurring-action", | |
13 | "Recurrence": "30 0 1 1,6,12 *", | |
14 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-asg:scheduledActionName/my-recurring-action", | |
15 | "StartTime": "2020-12-01T00:30:00Z", | |
16 | "Time": "2020-12-01T00:30:00Z", | |
17 | "MinSize": 1, | |
18 | "MaxSize": 6, | |
19 | "DesiredCapacity": 4 | |
20 | } | |
21 | ] | |
22 | } | |
23 | ||
24 | For more information, see `Scheduled scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
25 | ||
26 | **Example 2: To describe scheduled actions for the specified group** | |
27 | ||
28 | To describe the scheduled actions for a specific Auto Scaling group, use the ``--auto-scaling-group-name`` option. :: | |
29 | ||
30 | aws autoscaling describe-scheduled-actions \ | |
31 | --auto-scaling-group-name my-asg | |
32 | ||
33 | Output:: | |
34 | ||
35 | { | |
36 | "ScheduledUpdateGroupActions": [ | |
37 | { | |
38 | "AutoScalingGroupName": "my-asg", | |
39 | "ScheduledActionName": "my-recurring-action", | |
40 | "Recurrence": "30 0 1 1,6,12 *", | |
41 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-asg:scheduledActionName/my-recurring-action", | |
42 | "StartTime": "2020-12-01T00:30:00Z", | |
43 | "Time": "2020-12-01T00:30:00Z", | |
44 | "MinSize": 1, | |
45 | "MaxSize": 6, | |
46 | "DesiredCapacity": 4 | |
47 | } | |
48 | ] | |
49 | } | |
50 | ||
51 | For more information, see `Scheduled scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
52 | ||
53 | **Example 3: To describe the specified scheduled action** | |
54 | ||
55 | To describe a specific scheduled action, use the ``--scheduled-action-names`` option. :: | |
56 | ||
57 | aws autoscaling describe-scheduled-actions \ | |
58 | --scheduled-action-names my-recurring-action | |
59 | ||
60 | Output:: | |
61 | ||
62 | { | |
63 | "ScheduledUpdateGroupActions": [ | |
64 | { | |
65 | "AutoScalingGroupName": "my-asg", | |
66 | "ScheduledActionName": "my-recurring-action", | |
67 | "Recurrence": "30 0 1 1,6,12 *", | |
68 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-asg:scheduledActionName/my-recurring-action", | |
69 | "StartTime": "2020-12-01T00:30:00Z", | |
70 | "Time": "2020-12-01T00:30:00Z", | |
71 | "MinSize": 1, | |
72 | "MaxSize": 6, | |
73 | "DesiredCapacity": 4 | |
74 | } | |
75 | ] | |
76 | } | |
77 | ||
78 | ||
79 | For more information, see `Scheduled scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
80 | ||
81 | **Example 4: To describe scheduled actions with a sepecified start time** | |
82 | ||
83 | To describe the scheduled actions that start at a specific time, use the ``--start-time`` option. :: | |
84 | ||
85 | aws autoscaling describe-scheduled-actions \ | |
86 | --start-time "2020-12-01T00:30:00Z" | |
87 | ||
88 | Output:: | |
89 | ||
90 | { | |
91 | "ScheduledUpdateGroupActions": [ | |
92 | { | |
93 | "AutoScalingGroupName": "my-asg", | |
94 | "ScheduledActionName": "my-recurring-action", | |
95 | "Recurrence": "30 0 1 1,6,12 *", | |
96 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-asg:scheduledActionName/my-recurring-action", | |
97 | "StartTime": "2020-12-01T00:30:00Z", | |
98 | "Time": "2020-12-01T00:30:00Z", | |
99 | "MinSize": 1, | |
100 | "MaxSize": 6, | |
101 | "DesiredCapacity": 4 | |
102 | } | |
103 | ] | |
104 | } | |
105 | ||
106 | ||
107 | For more information, see `Scheduled scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
108 | ||
109 | **Example 5: To describe scheduled actions that end at a specified time** | |
110 | ||
111 | To describe the scheduled actions that end at a specific time, use the ``--end-time`` option. :: | |
112 | ||
113 | aws autoscaling describe-scheduled-actions \ | |
114 | --end-time "2022-12-01T00:30:00Z" | |
115 | ||
116 | Output:: | |
117 | ||
118 | { | |
119 | "ScheduledUpdateGroupActions": [ | |
120 | { | |
121 | "AutoScalingGroupName": "my-asg", | |
122 | "ScheduledActionName": "my-recurring-action", | |
123 | "Recurrence": "30 0 1 1,6,12 *", | |
124 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-asg:scheduledActionName/my-recurring-action", | |
125 | "StartTime": "2020-12-01T00:30:00Z", | |
126 | "Time": "2020-12-01T00:30:00Z", | |
127 | "MinSize": 1, | |
128 | "MaxSize": 6, | |
129 | "DesiredCapacity": 4 | |
130 | } | |
131 | ] | |
132 | } | |
133 | ||
134 | For more information, see `Scheduled scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
135 | ||
136 | **Example 6: To describe a specified number of scheduled actions** | |
137 | ||
138 | To return a specific number of scheduled actions, use the ``--max-items`` option. :: | |
139 | ||
140 | aws autoscaling describe-scheduled-actions \ | |
141 | --auto-scaling-group-name my-asg --max-items 1 | |
142 | ||
143 | Output:: | |
144 | ||
145 | { | |
146 | "ScheduledUpdateGroupActions": [ | |
147 | { | |
148 | "AutoScalingGroupName": "my-asg", | |
149 | "ScheduledActionName": "my-recurring-action", | |
150 | "Recurrence": "30 0 1 1,6,12 *", | |
151 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledUpdateGroupAction:8e86b655-b2e6-4410-8f29-b4f094d6871c:autoScalingGroupName/my-asg:scheduledActionName/my-recurring-action", | |
152 | "StartTime": "2020-12-01T00:30:00Z", | |
153 | "Time": "2020-12-01T00:30:00Z", | |
154 | "MinSize": 1, | |
155 | "MaxSize": 6, | |
156 | "DesiredCapacity": 4 | |
157 | } | |
158 | ] | |
159 | } | |
160 | ||
161 | If the output includes a ``NextToken`` field, there are more scheduled actions. To get the additional scheduled actions, use the value of this field with the ``--starting-token`` option in a subsequent call as follows. :: | |
162 | ||
163 | aws autoscaling describe-scheduled-actions \ | |
164 | --auto-scaling-group-name my-asg \ | |
165 | --starting-token Z3M3LMPEXAMPLE | |
166 | ||
167 | For more information, see `Scheduled scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To describe tags** | |
1 | ||
2 | This example describes all your tags:: | |
3 | ||
4 | aws autoscaling describe-tags | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "Tags": [ | |
10 | { | |
11 | "ResourceType": "auto-scaling-group", | |
12 | "ResourceId": "my-auto-scaling-group", | |
13 | "PropagateAtLaunch": true, | |
14 | "Value": "Research", | |
15 | "Key": "Dept" | |
16 | }, | |
17 | { | |
18 | "ResourceType": "auto-scaling-group", | |
19 | "ResourceId": "my-auto-scaling-group", | |
20 | "PropagateAtLaunch": true, | |
21 | "Value": "WebServer", | |
22 | "Key": "Role" | |
23 | } | |
24 | ] | |
25 | } | |
26 | ||
27 | To describe tags for a specific Auto Scaling group, use the ``filters`` parameter:: | |
28 | ||
29 | aws autoscaling describe-tags --filters Name=auto-scaling-group,Values=my-auto-scaling-group | |
30 | ||
31 | To return a specific number of tags, use the ``max-items`` parameter:: | |
32 | ||
33 | aws autoscaling describe-tags --max-items 1 | |
34 | ||
35 | The following is example output:: | |
36 | ||
37 | { | |
38 | "NextToken": "Z3M3LMPEXAMPLE", | |
39 | "Tags": [ | |
40 | { | |
41 | "ResourceType": "auto-scaling-group", | |
42 | "ResourceId": "my-auto-scaling-group", | |
43 | "PropagateAtLaunch": true, | |
44 | "Value": "Research", | |
45 | "Key": "Dept" | |
46 | } | |
47 | ] | |
48 | } | |
49 | ||
50 | Use the ``NextToken`` field with the ``starting-token`` parameter in a subsequent call to get the additional tags:: | |
51 | ||
52 | aws autoscaling describe-tags --filters Name=auto-scaling-group,Values=my-auto-scaling-group --starting-token Z3M3LMPEXAMPLE | |
53 | ||
54 | For more information, see `Tagging Auto Scaling Groups and Instances`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
55 | ||
56 | .. _`Tagging Auto Scaling Groups and Instances`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html | |
0 | **To describe all tags** | |
1 | ||
2 | This example describes all your tags. :: | |
3 | ||
4 | aws autoscaling describe-tags | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Tags": [ | |
10 | { | |
11 | "ResourceType": "auto-scaling-group", | |
12 | "ResourceId": "my-asg", | |
13 | "PropagateAtLaunch": true, | |
14 | "Value": "Research", | |
15 | "Key": "Dept" | |
16 | }, | |
17 | { | |
18 | "ResourceType": "auto-scaling-group", | |
19 | "ResourceId": "my-asg", | |
20 | "PropagateAtLaunch": true, | |
21 | "Value": "WebServer", | |
22 | "Key": "Role" | |
23 | } | |
24 | ] | |
25 | } | |
26 | ||
27 | For more information, see `Tagging Auto Scaling groups and instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
28 | ||
29 | **Example 2: To describe tags for a specified group** | |
30 | ||
31 | To describe tags for a specific Auto Scaling group, use the ``--filters`` option. :: | |
32 | ||
33 | aws autoscaling describe-tags --filters Name=auto-scaling-group,Values=my-asg | |
34 | ||
35 | For more information, see `Tagging Auto Scaling groups and instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
36 | ||
37 | **Example 3: To describe the specified number of tags** | |
38 | ||
39 | To return a specific number of tags, use the ``--max-items`` option. :: | |
40 | ||
41 | aws autoscaling describe-tags \ | |
42 | --max-items 1 | |
43 | ||
44 | If the output includes a ``NextToken`` field, there are more tags. To get the additional tags, use the value of this field with the ``--starting-token`` option in a subsequent call as follows. :: | |
45 | ||
46 | aws autoscaling describe-tags \ | |
47 | --filters Name=auto-scaling-group,Values=my-asg \ | |
48 | --starting-token Z3M3LMPEXAMPLE | |
49 | ||
50 | For more information, see `Tagging Auto Scaling groups and instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To describe termination policy types** | |
1 | ||
2 | This example describes the available termination policy types:: | |
3 | ||
4 | aws autoscaling describe-termination-policy-types | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "TerminationPolicyTypes": [ | |
10 | "AllocationStrategy", | |
11 | "ClosestToNextInstanceHour", | |
12 | "Default", | |
13 | "NewestInstance", | |
14 | "OldestInstance", | |
15 | "OldestLaunchConfiguration", | |
16 | "OldestLaunchTemplate" | |
17 | ] | |
18 | } | |
19 | ||
20 | For more information, see `Controlling Which Instances Auto Scaling Terminates During Scale In`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
21 | ||
22 | .. _`Controlling Which Instances Auto Scaling Terminates During Scale In`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html | |
0 | **To describe available termination policy types** | |
1 | ||
2 | This example describes the available termination policy types. :: | |
3 | ||
4 | aws autoscaling describe-termination-policy-types | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "TerminationPolicyTypes": [ | |
10 | "AllocationStrategy", | |
11 | "ClosestToNextInstanceHour", | |
12 | "Default", | |
13 | "NewestInstance", | |
14 | "OldestInstance", | |
15 | "OldestLaunchConfiguration", | |
16 | "OldestLaunchTemplate" | |
17 | ] | |
18 | } | |
19 | ||
20 | For more information, see `Controlling which Auto Scaling instances terminate during scale in <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
21 |
0 | **To detach an instance from an Auto Scaling group** | |
1 | ||
2 | This example detaches the specified instance from the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling detach-instances --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group --should-decrement-desired-capacity | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "Activities": [ | |
10 | { | |
11 | "Description": "Detaching EC2 instance: i-93633f9b", | |
12 | "AutoScalingGroupName": "my-auto-scaling-group", | |
13 | "ActivityId": "5091cb52-547a-47ce-a236-c9ccbc2cb2c9", | |
14 | "Details": {"Availability Zone": "us-west-2a"}, | |
15 | "StartTime": "2015-04-12T15:02:16.179Z", | |
16 | "Progress": 50, | |
17 | "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.", | |
18 | "StatusCode": "InProgress" | |
19 | } | |
20 | ] | |
21 | } | |
0 | **To detach an instance from an Auto Scaling group** | |
1 | ||
2 | This example detaches the specified instance from the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling detach-instances \ | |
5 | --instance-ids i-030017cfa84b20135 \ | |
6 | --auto-scaling-group-name my-asg \ | |
7 | --should-decrement-desired-capacity | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Activities": [ | |
13 | { | |
14 | "ActivityId": "5091cb52-547a-47ce-a236-c9ccbc2cb2c9", | |
15 | "AutoScalingGroupName": "my-asg", | |
16 | "Description": "Detaching EC2 instance: i-030017cfa84b20135", | |
17 | "Cause": "At 2020-10-31T17:35:04Z instance i-030017cfa84b20135 was detached in response to a user request, shrinking the capacity from 2 to 1.", | |
18 | "StartTime": "2020-04-12T15:02:16.179Z", | |
19 | "StatusCode": "InProgress", | |
20 | "Progress": 50, | |
21 | "Details": "{\"Subnet ID\":\"subnet-6194ea3b\",\"Availability Zone\":\"us-west-2c\"}" | |
22 | } | |
23 | ] | |
24 | }⏎ |
0 | **To detach a target group from an Auto Scaling group** | |
1 | ||
2 | This example detaches the specified target group from the specified Auto Scaling group:: | |
3 | ||
4 | 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 | |
0 | **To detach a load balancer target group from an Auto Scaling group** | |
1 | ||
2 | This example detaches the specified load balancer target group from the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling detach-load-balancer-target-groups \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --target-group-arns arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 | |
7 | ||
8 | This command produces no output | |
9 | ||
10 | For more information, see `Attaching a load balancer to your Auto Scaling group <https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To detach a load balancer from an Auto Scaling group** | |
1 | ||
2 | This example detaches the specified load balancer from the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling detach-load-balancers --load-balancer-names my-load-balancer --auto-scaling-group-name my-auto-scaling-group | |
0 | **To detach a Classic Load Balancer from an Auto Scaling group** | |
1 | ||
2 | This example detaches the specified Classic Load Balancer from the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling detach-load-balancers \ | |
5 | --load-balancer-names my-load-balancer \ | |
6 | --auto-scaling-group-name my-asg | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Attaching a load balancer to your Auto Scaling group <https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To disable metrics collection for an Auto Scaling group** | |
1 | ||
2 | This example disables collecting data for the ``GroupDesiredCapacity`` metric for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling disable-metrics-collection --auto-scaling-group-name my-auto-scaling-group --metrics GroupDesiredCapacity | |
5 | ||
6 | For more information, see `Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html | |
0 | **To disable metrics collection for an Auto Scaling group** | |
1 | ||
2 | This example disables collection of the ``GroupDesiredCapacity`` metric for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling disable-metrics-collection \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --metrics GroupDesiredCapacity | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Monitoring CloudWatch metrics for your Auto Scaling groups and instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html>`_ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To enable metrics collection for an Auto Scaling group** | |
1 | ||
2 | This example enables data collection for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling enable-metrics-collection --auto-scaling-group-name my-auto-scaling-group --granularity "1Minute" | |
5 | ||
6 | To collect data for a specific metric, use the ``metrics`` parameter:: | |
7 | ||
8 | aws autoscaling enable-metrics-collection --auto-scaling-group-name my-auto-scaling-group --metrics GroupDesiredCapacity --granularity "1Minute" | |
9 | ||
10 | For more information, see `Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
11 | ||
12 | .. _`Monitoring Your Auto Scaling Groups and Instances Using Amazon CloudWatch`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html | |
0 | **Example 1: To enable metrics collection for an Auto Scaling group** | |
1 | ||
2 | This example enables data collection for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling enable-metrics-collection \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --granularity "1Minute" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Monitoring CloudWatch metrics for your Auto Scaling groups and instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
11 | ||
12 | **Example 2: To collect data for the scpecified metric for an Auto Scaling group** | |
13 | ||
14 | To collect data for a specific metric, use the ``--metrics`` option. :: | |
15 | ||
16 | aws autoscaling enable-metrics-collection \ | |
17 | --auto-scaling-group-name my-asg \ | |
18 | --metrics GroupDesiredCapacity --granularity "1Minute" | |
19 | ||
20 | This command produces no output. | |
21 | ||
22 | For more information, see `Monitoring CloudWatch metrics for your Auto Scaling groups and instances <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-monitoring.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To move instances into standby mode** | |
1 | ||
2 | This example puts the specified instance into standby mode:: | |
3 | ||
4 | aws autoscaling enter-standby --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group --should-decrement-desired-capacity | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "Activities": [ | |
10 | { | |
11 | "Description": "Moving EC2 instance to Standby: i-93633f9b", | |
12 | "AutoScalingGroupName": "my-auto-scaling-group", | |
13 | "ActivityId": "ffa056b4-6ed3-41ba-ae7c-249dfae6eba1", | |
14 | "Details": {"Availability Zone": "us-west-2a"}, | |
15 | "StartTime": "2015-04-12T15:10:23.640Z", | |
16 | "Progress": 50, | |
17 | "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.", | |
18 | "StatusCode": "InProgress" | |
19 | } | |
20 | ] | |
21 | } | |
0 | **To move instances into standby mode** | |
1 | ||
2 | This example puts the specified instance into standby mode. This is useful for updating or troubleshooting an instance that is currently in service. :: | |
3 | ||
4 | aws autoscaling enter-standby \ | |
5 | --instance-ids i-061c63c5eb45f0416 \ | |
6 | --auto-scaling-group-name my-asg \ | |
7 | --should-decrement-desired-capacity | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Activities": [ | |
13 | { | |
14 | "ActivityId": "ffa056b4-6ed3-41ba-ae7c-249dfae6eba1", | |
15 | "AutoScalingGroupName": "my-asg", | |
16 | "Description": "Moving EC2 instance to Standby: i-061c63c5eb45f0416", | |
17 | "Cause": "At 2020-10-31T20:31:00Z instance i-061c63c5eb45f0416 was moved to standby in response to a user request, shrinking the capacity from 1 to 0.", | |
18 | "StartTime": "2020-10-31T20:31:00.949Z", | |
19 | "StatusCode": "InProgress", | |
20 | "Progress": 50, | |
21 | "Details": "{\"Subnet ID\":\"subnet-6194ea3b\",\"Availability Zone\":\"us-west-2c\"}" | |
22 | } | |
23 | ] | |
24 | } | |
25 | ||
26 | For more information, see `Amazon EC2 Auto Scaling instance lifecycle <https://docs.aws.amazon.com/autoscaling/ec2/userguide/detach-instance-asg.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To execute an Auto Scaling policy** | |
1 | ||
2 | This example executes the specified Auto Scaling policy for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling execute-policy --auto-scaling-group-name my-auto-scaling-group --policy-name ScaleIn --honor-cooldown | |
5 | ||
6 | For more information, see `Dynamic Scaling`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Dynamic Scaling`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html | |
0 | **To execute a scaling policy** | |
1 | ||
2 | This example executes the scaling policy named ``my-step-scale-out-policy`` for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling execute-policy \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --policy-name my-step-scale-out-policy \ | |
7 | --metric-value 95 \ | |
8 | --breach-threshold 80 | |
9 | ||
10 | This command produces no output. | |
11 | ||
12 | For more information, see `Step and simple scaling policies <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scaling-simple-step.html>`_ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To move instances out of standby mode** | |
1 | ||
2 | This example moves the specified instance out of standby mode:: | |
3 | ||
4 | aws autoscaling exit-standby --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group | |
5 | ||
6 | The following is example output:: | |
7 | ||
8 | { | |
9 | "Activities": [ | |
10 | { | |
11 | "Description": "Moving EC2 instance out of Standby: i-93633f9b", | |
12 | "AutoScalingGroupName": "my-auto-scaling-group", | |
13 | "ActivityId": "142928e1-a2dc-453a-9b24-b85ad6735928", | |
14 | "Details": {"Availability Zone": "us-west-2a"}, | |
15 | "StartTime": "2015-04-12T15:14:29.886Z", | |
16 | "Progress": 30, | |
17 | "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.", | |
18 | "StatusCode": "PreInService" | |
19 | } | |
20 | ] | |
21 | } | |
0 | **To move instances out of standby mode** | |
1 | ||
2 | This example moves the specified instance out of standby mode. :: | |
3 | ||
4 | aws autoscaling exit-standby \ | |
5 | --instance-ids i-061c63c5eb45f0416 \ | |
6 | --auto-scaling-group-name my-asg | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Activities": [ | |
12 | { | |
13 | "ActivityId": "142928e1-a2dc-453a-9b24-b85ad6735928", | |
14 | "AutoScalingGroupName": "my-asg", | |
15 | "Description": "Moving EC2 instance out of Standby: i-061c63c5eb45f0416", | |
16 | "Cause": "At 2020-10-31T20:32:50Z instance i-061c63c5eb45f0416 was moved out of standby in response to a user request, increasing the capacity from 0 to 1.", | |
17 | "StartTime": "2020-10-31T20:32:50.222Z", | |
18 | "StatusCode": "PreInService", | |
19 | "Progress": 30, | |
20 | "Details": "{\"Subnet ID\":\"subnet-6194ea3b\",\"Availability Zone\":\"us-west-2c\"}" | |
21 | } | |
22 | ] | |
23 | } | |
24 | ||
25 | For more information, see `Temporarily removing instances from your Auto Scaling group <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To create a lifecycle hook** | |
1 | ||
2 | This example creates a lifecycle hook:: | |
3 | ||
4 | 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 | |
5 | ||
6 | For more information, see `Add Lifecycle Hooks`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Add Lifecycle Hooks`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html#adding-lifecycle-hooks | |
0 | **Example 1: To create a lifecycle hook** | |
1 | ||
2 | This example creates a lifecycle hook that will invoke on any newly launched instances, with a timeout of 4800 seconds. This is useful for keeping the instances in a wait state until the user data scripts have finished, or for invoking an AWS Lambda function using EventBridge. :: | |
3 | ||
4 | aws autoscaling put-lifecycle-hook \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --lifecycle-hook-name my-launch-hook \ | |
7 | --lifecycle-transition autoscaling:EC2_INSTANCE_LAUNCHING \ | |
8 | --heartbeat-timeout 4800 | |
9 | ||
10 | This command produces no output. If a lifecycle hook with the same name already exists, it will be overwritten by the new lifecycle hook. | |
11 | ||
12 | For more information, see `Amazon EC2 Auto Scaling lifecycle hooks <https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
13 | ||
14 | **Example 2: To send an Amazon SNS email message to notify you of instance state transitions** | |
15 | ||
16 | This example creates a lifecycle hook with the Amazon SNS topic and IAM role to use to receive notification at instance launch. :: | |
17 | ||
18 | aws autoscaling put-lifecycle-hook \ | |
19 | --auto-scaling-group-name my-asg \ | |
20 | --lifecycle-hook-name my-launch-hook \ | |
21 | --lifecycle-transition autoscaling:EC2_INSTANCE_LAUNCHING \ | |
22 | --notification-target-arn arn:aws:sns:us-west-2:123456789012:my-sns-topic \ | |
23 | --role-arn arn:aws:iam::123456789012:role/my-auto-scaling-role | |
24 | ||
25 | This command produces no output. | |
26 | ||
27 | For more information, see `Amazon EC2 Auto Scaling lifecycle hooks <https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
28 | ||
29 | **Example 3: To publish a message to an Amazon SQS queue** | |
30 | ||
31 | This example creates a lifecycle hook that publishes a message with metadata to the specified Amazon SQS queue. :: | |
32 | ||
33 | aws autoscaling put-lifecycle-hook \ | |
34 | --auto-scaling-group-name my-asg \ | |
35 | --lifecycle-hook-name my-launch-hook \ | |
36 | --lifecycle-transition autoscaling:EC2_INSTANCE_LAUNCHING \ | |
37 | --notification-target-arn arn:aws:sqs:us-west-2:123456789012:my-sqs-queue \ | |
38 | --role-arn arn:aws:iam::123456789012:role/my-notification-role \ | |
39 | --notification-metadata "SQS message metadata" | |
40 | ||
41 | This command produces no output. | |
42 | ||
43 | For more information, see `Amazon EC2 Auto Scaling lifecycle hooks <https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To add an Auto Scaling notification** | |
1 | ||
2 | This example adds the specified notification to the specified Auto Scaling group:: | |
3 | ||
4 | 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 | |
5 | ||
6 | For more information, see `Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Getting Amazon SNS Notifications When Your Auto Scaling Group Scales`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html#as-configure-asg-for-sns | |
0 | **To add a notification** | |
1 | ||
2 | This example adds the specified notification to the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling put-notification-configuration \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --topic-arn arn:aws:sns:us-west-2:123456789012:my-sns-topic \ | |
7 | --notification-type autoscaling:TEST_NOTIFICATION | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Getting Amazon SNS notifications when your Auto Scaling group scales <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ASGettingNotifications.html#as-configure-asg-for-sns>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To add a scaling policy to an Auto Scaling group** | |
1 | ||
2 | The following put-scaling-policy example applies a target tracking scaling policy to the specified Auto Scaling group. The output contains the ARNs and names of the two CloudWatch alarms created on your behalf. :: | |
3 | ||
4 | aws autoscaling put-scaling-policy --policy-name alb1000-target-tracking-scaling-policy \ | |
5 | --auto-scaling-group-name my-asg --policy-type TargetTrackingScaling \ | |
6 | --target-tracking-configuration file://config.json | |
7 | ||
8 | This example assumes that you have a `config.json` file in the current directory with the following contents:: | |
9 | ||
10 | { | |
11 | "TargetValue": 1000.0, | |
12 | "PredefinedMetricSpecification": { | |
13 | "PredefinedMetricType": "ALBRequestCountPerTarget", | |
14 | "ResourceLabel": "app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d" | |
15 | } | |
16 | } | |
17 | ||
18 | Output:: | |
19 | ||
20 | { | |
21 | "PolicyARN": "arn:aws:autoscaling:region:account-id:scalingPolicy:228f02c2-c665-4bfd-aaac-8b04080bea3c:autoScalingGroupName/my-asg:policyName/alb1000-target-tracking-scaling-policy", | |
22 | "Alarms": [ | |
23 | { | |
24 | "AlarmARN": "arn:aws:cloudwatch:region:account-id:alarm:TargetTracking-my-asg-AlarmHigh-fc0e4183-23ac-497e-9992-691c9980c38e", | |
25 | "AlarmName": "TargetTracking-my-asg-AlarmHigh-fc0e4183-23ac-497e-9992-691c9980c38e" | |
26 | }, | |
27 | { | |
28 | "AlarmARN": "arn:aws:cloudwatch:region:account-id:alarm:TargetTracking-my-asg-AlarmLow-61a39305-ed0c-47af-bd9e-471a352ee1a2", | |
29 | "AlarmName": "TargetTracking-my-asg-AlarmLow-61a39305-ed0c-47af-bd9e-471a352ee1a2" | |
30 | } | |
31 | ] | |
32 | } | |
33 | ||
34 | For more information, see `Example Scaling Policies for the AWS Command Line Interface (AWS CLI)`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
35 | ||
36 | .. _`Example Scaling Policies for the AWS Command Line Interface (AWS CLI)`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/examples-scaling-policies.html | |
0 | **To add a target tracking scaling policy to an Auto Scaling group** | |
1 | ||
2 | The following ``put-scaling-policy`` example applies a target tracking scaling policy to the specified Auto Scaling group. The output contains the ARNs and names of the two CloudWatch alarms created on your behalf. If a scaling policy with the same name already exists, it will be overwritten by the new scaling policy. :: | |
3 | ||
4 | aws autoscaling put-scaling-policy --auto-scaling-group-name my-asg \ | |
5 | --policy-name alb1000-target-tracking-scaling-policy \ | |
6 | --policy-type TargetTrackingScaling \ | |
7 | --target-tracking-configuration file://config.json | |
8 | ||
9 | Contents of ``config.json``:: | |
10 | ||
11 | { | |
12 | "TargetValue": 1000.0, | |
13 | "PredefinedMetricSpecification": { | |
14 | "PredefinedMetricType": "ALBRequestCountPerTarget", | |
15 | "ResourceLabel": "app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff" | |
16 | } | |
17 | } | |
18 | ||
19 | Output:: | |
20 | ||
21 | { | |
22 | "PolicyARN": "arn:aws:autoscaling:region:account-id:scalingPolicy:228f02c2-c665-4bfd-aaac-8b04080bea3c:autoScalingGroupName/my-asg:policyName/alb1000-target-tracking-scaling-policy", | |
23 | "Alarms": [ | |
24 | { | |
25 | "AlarmARN": "arn:aws:cloudwatch:region:account-id:alarm:TargetTracking-my-asg-AlarmHigh-fc0e4183-23ac-497e-9992-691c9980c38e", | |
26 | "AlarmName": "TargetTracking-my-asg-AlarmHigh-fc0e4183-23ac-497e-9992-691c9980c38e" | |
27 | }, | |
28 | { | |
29 | "AlarmARN": "arn:aws:cloudwatch:region:account-id:alarm:TargetTracking-my-asg-AlarmLow-61a39305-ed0c-47af-bd9e-471a352ee1a2", | |
30 | "AlarmName": "TargetTracking-my-asg-AlarmLow-61a39305-ed0c-47af-bd9e-471a352ee1a2" | |
31 | } | |
32 | ] | |
33 | } | |
34 | ||
35 | For more examples, see `Example scaling policies for the AWS Command Line Interface (AWS CLI) <https://docs.aws.amazon.com/autoscaling/ec2/userguide/examples-scaling-policies.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To add a scheduled action to an Auto Scaling group** | |
1 | ||
2 | This example adds the specified scheduled action to the specified Auto Scaling group:: | |
3 | ||
4 | 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 | |
5 | ||
6 | 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:: | |
7 | ||
8 | aws autoscaling put-scheduled-update-group-action --auto-scaling-group-name my-auto-scaling-group --scheduled-action-name my-scheduled-action --recurrence "30 0 1 1,6,12 *" --min-size 2 --max-size 6 --desired-capacity 4 | |
9 | ||
10 | For more information, see `Scheduled Scaling`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
11 | ||
12 | .. __: https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html⏎ | |
0 | **Example 1: To add a scheduled action to an Auto Scaling group** | |
1 | ||
2 | This example adds the specified scheduled action to the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling put-scheduled-update-group-action \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --scheduled-action-name my-scheduled-action \ | |
7 | --start-time "2021-05-12T08:00:00Z" \ | |
8 | --min-size 2 \ | |
9 | --max-size 6 \ | |
10 | --desired-capacity 4 | |
11 | ||
12 | This command produces no output. If a scheduled action with the same name already exists, it will be overwritten by the new scheduled action. | |
13 | ||
14 | For more examples, see `Scheduled scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
15 | ||
16 | **Example 2: To specify a recurring schedule** | |
17 | ||
18 | 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. :: | |
19 | ||
20 | aws autoscaling put-scheduled-update-group-action \ | |
21 | --auto-scaling-group-name my-asg \ | |
22 | --scheduled-action-name my-recurring-action \ | |
23 | --recurrence "30 0 1 1,6,12 *" \ | |
24 | --min-size 2 \ | |
25 | --max-size 6 \ | |
26 | --desired-capacity 4 | |
27 | ||
28 | This command produces no output. If a scheduled action with the same name already exists, it will be overwritten by the new scheduled action. | |
29 | ||
30 | For more examples, see `Scheduled scaling <https://docs.aws.amazon.com/autoscaling/ec2/userguide/schedule_time.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To record a lifecycle action heartbeat** | |
1 | ||
2 | This example records a lifecycle action heartbeat to keep the instance in a pending state:: | |
3 | ||
4 | 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 | |
0 | **To record a lifecycle action heartbeat** | |
1 | ||
2 | This example records a lifecycle action heartbeat to keep the instance in a pending state. :: | |
3 | ||
4 | aws autoscaling record-lifecycle-action-heartbeat \ | |
5 | --lifecycle-hook-name my-launch-hook \ | |
6 | --auto-scaling-group-name my-asg \ | |
7 | --lifecycle-action-token bcd2f1b8-9a78-44d3-8a7a-4dd07d7cf635 | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Amazon EC2 Auto Scaling lifecycle hooks <https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
12 |
0 | **To resume Auto Scaling processes** | |
1 | ||
2 | This example resumes the specified suspended scaling process for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling resume-processes --auto-scaling-group-name my-auto-scaling-group --scaling-processes AlarmNotification | |
5 | ||
6 | For more information, see `Suspending and Resuming Scaling Processes`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Suspending and Resuming Scaling Processes`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html | |
0 | **To resume suspended processes** | |
1 | ||
2 | This example resumes the specified suspended scaling process for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling resume-processes \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --scaling-processes AlarmNotification | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Suspending and resuming scaling processes <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To set the desired capacity for an Auto Scaling group** | |
1 | ||
2 | This example sets the desired capacity for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling set-desired-capacity --auto-scaling-group-name my-auto-scaling-group --desired-capacity 2 --honor-cooldown | |
0 | **To set the desired capacity for an Auto Scaling group** | |
1 | ||
2 | This example sets the desired capacity for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling set-desired-capacity \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --desired-capacity 2 \ | |
7 | --honor-cooldown | |
8 | ||
9 | This command returns to the prompt if successful.⏎ |
0 | **To set the health status of an instance** | |
1 | ||
2 | This example sets the health status of the specified instance to ``Unhealthy``:: | |
3 | ||
4 | aws autoscaling set-instance-health --instance-id i-93633f9b --health-status Unhealthy | |
0 | **To set the health status of an instance** | |
1 | ||
2 | This example sets the health status of the specified instance to ``Unhealthy``. :: | |
3 | ||
4 | aws autoscaling set-instance-health \ | |
5 | --instance-id i-061c63c5eb45f0416 \ | |
6 | --health-status Unhealthy | |
7 | ||
8 | This command produces no output.⏎ |
0 | **To change the instance protection setting for an instance** | |
1 | ||
2 | This example enables instance protection for the specified instance:: | |
3 | ||
4 | aws autoscaling set-instance-protection --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group --protected-from-scale-in | |
5 | ||
6 | This example disables instance protection for the specified instance:: | |
7 | ||
8 | aws autoscaling set-instance-protection --instance-ids i-93633f9b --auto-scaling-group-name my-auto-scaling-group --no-protected-from-scale-in | |
0 | **Example 1: To enable the instance protection setting for an instance** | |
1 | ||
2 | This example enables instance protection for the specified instance. :: | |
3 | ||
4 | aws autoscaling set-instance-protection \ | |
5 | --instance-ids i-061c63c5eb45f0416 \ | |
6 | --auto-scaling-group-name my-asg --protected-from-scale-in | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | **Example 2: To disable the instance protection setting for an instance** | |
11 | ||
12 | This example disables instance protection for the specified instance. :: | |
13 | ||
14 | aws autoscaling set-instance-protection \ | |
15 | --instance-ids i-061c63c5eb45f0416 \ | |
16 | --auto-scaling-group-name my-asg \ | |
17 | --no-protected-from-scale-in | |
18 | ||
19 | This command produces no output. |
11 | 11 | "InstanceRefreshId": "08b91cf7-8fa6-48af-b6a6-d227f40f1b9b" |
12 | 12 | } |
13 | 13 | |
14 | For more information, see `Replacing Auto Scaling Instances Based on an Instance Refresh <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
14 | For more information, see `Replacing Auto Scaling instances based on an instance refresh <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
15 | 15 | |
16 | 16 | **Example 2: To start an instance refresh using a JSON file** |
17 | 17 | |
36 | 36 | "InstanceRefreshId": "08b91cf7-8fa6-48af-b6a6-d227f40f1b9b" |
37 | 37 | } |
38 | 38 | |
39 | For more information, see `Replacing Auto Scaling Instances Based on an Instance Refresh <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
39 | For more information, see `Replacing Auto Scaling instances based on an instance refresh <https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-refresh.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
0 | **To suspend Auto Scaling processes** | |
1 | ||
2 | This example suspends the specified scaling process for the specified Auto Scaling group:: | |
3 | ||
4 | aws autoscaling suspend-processes --auto-scaling-group-name my-auto-scaling-group --scaling-processes AlarmNotification | |
5 | ||
6 | For more information, see `Suspending and Resuming Scaling Processes`_ in the *Amazon EC2 Auto Scaling User Guide*. | |
7 | ||
8 | .. _`Suspending and Resuming Scaling Processes`: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html | |
0 | **To suspend Auto Scaling processes** | |
1 | ||
2 | This example suspends the specified scaling process for the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling suspend-processes \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --scaling-processes AlarmNotification | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Suspending and resuming scaling processes <https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-suspend-resume-processes.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. |
0 | **To terminate an instance in an Auto Scaling group** | |
1 | ||
2 | This example terminates the specified instance from the specified Auto Scaling group without updating the size of the group:: | |
3 | ||
4 | aws autoscaling terminate-instance-in-auto-scaling-group --instance-id i-93633f9b --no-should-decrement-desired-capacity | |
5 | ||
6 | Auto Scaling launches a replacement instance after the specified instance terminates. | |
0 | **To terminate an instance in an Auto Scaling group** | |
1 | ||
2 | This example terminates the specified instance from the specified Auto Scaling group without updating the size of the group. Amazon EC2 Auto Scaling launches a replacement instance after the specified instance terminates. :: | |
3 | ||
4 | aws autoscaling terminate-instance-in-auto-scaling-group \ | |
5 | --instance-id i-061c63c5eb45f0416 \ | |
6 | --no-should-decrement-desired-capacity | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Activities": [ | |
12 | { | |
13 | "ActivityId": "8c35d601-793c-400c-fcd0-f64a27530df7", | |
14 | "AutoScalingGroupName": "my-asg", | |
15 | "Description": "Terminating EC2 instance: i-061c63c5eb45f0416", | |
16 | "Cause": "", | |
17 | "StartTime": "2020-10-31T20:34:25.680Z", | |
18 | "StatusCode": "InProgress", | |
19 | "Progress": 0, | |
20 | "Details": "{\"Subnet ID\":\"subnet-6194ea3b\",\"Availability Zone\":\"us-west-2c\"}" | |
21 | } | |
22 | ] | |
23 | }⏎ |
0 | **To update an Auto Scaling group** | |
1 | ||
2 | This example updates the specified Auto Scaling group to use Elastic Load Balancing health checks:: | |
3 | ||
4 | aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --health-check-type ELB --health-check-grace-period 60 | |
5 | ||
6 | This example updates the launch configuration, minimum and maximum size of the group, and which subnet to use:: | |
7 | ||
8 | 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 | |
9 | ||
10 | This example updates the desired capacity, default cooldown, placement group, termination policy, and which Availability Zone to use:: | |
11 | ||
12 | 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 | |
13 | ||
14 | This example enables the instance protection setting for the specified Auto Scaling group:: | |
15 | ||
16 | aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --new-instances-protected-from-scale-in | |
17 | ||
18 | This example disables the instance protection setting for the specified Auto Scaling group:: | |
19 | ||
20 | aws autoscaling update-auto-scaling-group --auto-scaling-group-name my-auto-scaling-group --no-new-instances-protected-from-scale-in | |
0 | **Example 1: To update the size of an Auto Scaling group** | |
1 | ||
2 | This example updates the desired capacity, maximum size, and minimum size of the specified Auto Scaling group. :: | |
3 | ||
4 | aws autoscaling update-auto-scaling-group \ | |
5 | --auto-scaling-group-name my-asg \ | |
6 | --desired-capacity 6 \ | |
7 | --max-size 10 \ | |
8 | --min-size 2 | |
9 | ||
10 | This command produces no output. | |
11 | ||
12 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
13 | ||
14 | **Example 2: To add Elastic Load Balancing health checks and specify which Availability Zones and subnets to use** | |
15 | ||
16 | This example updates the specified Auto Scaling group to add Elastic Load Balancing health checks. This command also updates the value of ``--vpc-zone-identifier``. This helps you change the Availability Zones where the instances are located as well as the subnets. :: | |
17 | ||
18 | aws autoscaling update-auto-scaling-group \ | |
19 | --auto-scaling-group-name my-asg \ | |
20 | --health-check-type ELB \ | |
21 | --health-check-grace-period 600 \ | |
22 | --vpc-zone-identifier "subnet-5ea0c127,subnet-6194ea3b,subnet-c934b782" | |
23 | ||
24 | This command produces no output. | |
25 | ||
26 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
27 | ||
28 | **Example 3: To update the placement group and termination policy** | |
29 | ||
30 | This example updates the placement group and termination policy to use. :: | |
31 | ||
32 | aws autoscaling update-auto-scaling-group \ | |
33 | --auto-scaling-group-name my-asg \ | |
34 | --placement-group my-placement-group \ | |
35 | --termination-policies "OldestInstance" | |
36 | ||
37 | This command produces no output. | |
38 | ||
39 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
40 | ||
41 | **Example 4: To use the latest version of the launch template** | |
42 | ||
43 | This example updates the specified Auto Scaling group to use the latest version of the specified launch template. :: | |
44 | ||
45 | aws autoscaling update-auto-scaling-group \ | |
46 | --auto-scaling-group-name my-asg \ | |
47 | --launch-template LaunchTemplateId=lt-1234567890abcde12,Version='$Latest' | |
48 | ||
49 | This command produces no output. | |
50 | ||
51 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
52 | ||
53 | **Example 5: To use a specific version of the launch template** | |
54 | ||
55 | This example updates the specified Auto Scaling group to use a specific version of the specified launch template. :: | |
56 | ||
57 | aws autoscaling update-auto-scaling-group \ | |
58 | --auto-scaling-group-name my-asg \ | |
59 | --launch-template LaunchTemplateName=my-template-for-auto-scaling,Version='2' | |
60 | ||
61 | This command produces no output. | |
62 | ||
63 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*. | |
64 | ||
65 | **Example 6: To define a mixed instances policy and enable capacity rebalancing** | |
66 | ||
67 | This example updates the specified Auto Scaling group to use a mixed instances policy and enables capacity rebalancing. This structure lets you specify groups with Spot and On-Demand capacities and use different launch templates for different architectures. :: | |
68 | ||
69 | aws autoscaling update-auto-scaling-group \ | |
70 | --cli-input-json file://~/config.json | |
71 | ||
72 | Contents of ``config.json``:: | |
73 | ||
74 | { | |
75 | "AutoScalingGroupName": "my-asg", | |
76 | "CapacityRebalance": true, | |
77 | "MixedInstancesPolicy": { | |
78 | "LaunchTemplate": { | |
79 | "LaunchTemplateSpecification": { | |
80 | "LaunchTemplateName": "my-launch-template-for-x86", | |
81 | "Version": "$Latest" | |
82 | }, | |
83 | "Overrides": [ | |
84 | { | |
85 | "InstanceType": "c6g.large", | |
86 | "LaunchTemplateSpecification": { | |
87 | "LaunchTemplateName": "my-launch-template-for-arm", | |
88 | "Version": "$Latest" | |
89 | } | |
90 | }, | |
91 | { | |
92 | "InstanceType": "c5.large" | |
93 | }, | |
94 | { | |
95 | "InstanceType": "c5a.large" | |
96 | } | |
97 | ] | |
98 | }, | |
99 | "InstancesDistribution": { | |
100 | "OnDemandPercentageAboveBaseCapacity": 50, | |
101 | "SpotAllocationStrategy": "capacity-optimized" | |
102 | } | |
103 | } | |
104 | } | |
105 | ||
106 | This command produces no output. | |
107 | ||
108 | For more information, see `Auto Scaling groups <https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html>`__ in the *Amazon EC2 Auto Scaling User Guide*.⏎ |
43 | 43 | Before the command uploads artifacts, it checks if the artifacts are already |
44 | 44 | present in the S3 bucket to prevent unnecessary uploads. The command uses MD5 |
45 | 45 | checksums to compare files. If the values match, the command doesn't upload the |
46 | artifacts. Use the ``--force flag`` to skip this check and always upload the | |
46 | artifacts. Use the ``--force-upload flag`` to skip this check and always upload the | |
47 | 47 | artifacts. |
48 | 48 |
3 | 3 | |
4 | 4 | aws codecommit associate-approval-rule-template-with-repository \ |
5 | 5 | --repository-name MyDemoRepo \ |
6 | --approval-rule-template-name 2-approver-rule-for-master | |
6 | --approval-rule-template-name 2-approver-rule-for-main | |
7 | 7 | |
8 | 8 | This command produces no output. |
9 | 9 |
+1
-1
5 | 5 | |
6 | 6 | aws codecommit batch-associate-approval-rule-template-with-repositories \ |
7 | 7 | --repository-names MyDemoRepo, MyOtherDemoRepo \ |
8 | --approval-rule-template-name 2-approver-rule-for-master | |
8 | --approval-rule-template-name 2-approver-rule-for-main | |
9 | 9 | |
10 | 10 | Output:: |
11 | 11 |
0 | 0 | **To get information about merge conflicts in all files or a subset of files in a merge between two commit specifiers** |
1 | 1 | |
2 | The following ``batch-describe-merge-conflicts`` example determines the merge conflicts for merging a source branch named ``feature-randomizationfeature`` with a destination branch named ``master`` using the ``THREE_WAY_MERGE`` strategy in a repository named ``MyDemoRepo``. :: | |
2 | The following ``batch-describe-merge-conflicts`` example determines the merge conflicts for merging a source branch named ``feature-randomizationfeature`` with a destination branch named ``main`` using the ``THREE_WAY_MERGE`` strategy in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | 4 | aws codecommit batch-describe-merge-conflicts \ |
5 | 5 | --source-commit-specifier feature-randomizationfeature \ |
6 | --destination-commit-specifier master \ | |
6 | --destination-commit-specifier main \ | |
7 | 7 | --merge-option THREE_WAY_MERGE \ |
8 | 8 | --repository-name MyDemoRepo |
9 | 9 | |
66 | 66 | "baseCommitId": "767b6958EXAMPLE" |
67 | 67 | } |
68 | 68 | |
69 | ||
70 | For more information, see `Resolve Conflicts in a Pull Request <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-resolve-conflict-pull-request.html#batch-describe-merge-conflicts>`__ in the *AWS CodeCommit User Guide*. | |
69 | For more information, see `Resolve Conflicts in a Pull Request <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-resolve-conflict-pull-request.html#batch-describe-merge-conflicts>`__ in the *AWS CodeCommit User Guide*.⏎ |
0 | 0 | **To view details about multiple repositories** |
1 | 1 | |
2 | This example shows details about multiple AWS CodeCommit repositories. | |
2 | This example shows details about multiple AWS CodeCommit repositories. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws codecommit batch-get-repositories --repository-names MyDemoRepo MyOtherDemoRepo | |
4 | aws codecommit batch-get-repositories \ | |
5 | --repository-names MyDemoRepo MyOtherDemoRepo | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
10 | { | |
9 | { | |
10 | "repositoriesNotFound": [], | |
11 | 11 | "repositories": [ |
12 | 12 | { |
13 | 13 | "creationDate": 1429203623.625, |
14 | "defaultBranch": "master", | |
14 | "defaultBranch": "main", | |
15 | 15 | "repositoryName": "MyDemoRepo", |
16 | "cloneUrlSsh": "ssh://ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos//v1/repos/MyDemoRepo", | |
16 | "cloneUrlSsh": "ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo", | |
17 | 17 | "lastModifiedDate": 1430783812.0869999, |
18 | 18 | "repositoryDescription": "My demonstration repository", |
19 | "cloneUrlHttp": "https://codecommit.us-east-1.amazonaws.com/v1/repos/MyDemoRepo", | |
19 | "cloneUrlHttp": "https://codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo", | |
20 | 20 | "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", |
21 | "Arn": "arn:aws:codecommit:us-east-1:111111111111EXAMPLE:MyDemoRepo", | |
21 | "Arn": "arn:aws:codecommit:us-east-2:111111111111:MyDemoRepo" | |
22 | 22 | "accountId": "111111111111" |
23 | 23 | }, |
24 | 24 | { |
25 | 25 | "creationDate": 1429203623.627, |
26 | "defaultBranch": "master", | |
26 | "defaultBranch": "main", | |
27 | 27 | "repositoryName": "MyOtherDemoRepo", |
28 | "cloneUrlSsh": "ssh://ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos//v1/repos/MyOtherDemoRepo", | |
28 | "cloneUrlSsh": "ssh://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyOtherDemoRepo", | |
29 | 29 | "lastModifiedDate": 1430783812.0889999, |
30 | 30 | "repositoryDescription": "My other demonstration repository", |
31 | "cloneUrlHttp": "https://codecommit.us-east-1.amazonaws.com/v1/repos/MyOtherDemoRepo", | |
31 | "cloneUrlHttp": "https://codecommit.us-east-2.amazonaws.com/v1/repos/MyOtherDemoRepo", | |
32 | 32 | "repositoryId": "cfc29ac4-b0cb-44dc-9990-f6f51EXAMPLE", |
33 | "Arn": "arn:aws:codecommit:us-east-1:111111111111EXAMPLE:MyOtherDemoRepo", | |
33 | "Arn": "arn:aws:codecommit:us-east-2:111111111111:MyOtherDemoRepo" | |
34 | 34 | "accountId": "111111111111" |
35 | 35 | } |
36 | 36 | ], |
37 | 37 | "repositoriesNotFound": [] |
38 | }⏎ | |
38 | }⏎ |
0 | 0 | **To create an approval rule template** |
1 | 1 | |
2 | The following ``create-approval-rule-template`` example creates an approval rule template named ``2-approver-rule-for-master ``. The template requires two users who assume the role of ``CodeCommitReview`` to approve any pull request before it can be merged to the ``master`` branch. :: | |
2 | The following ``create-approval-rule-template`` example creates an approval rule template named ``2-approver-rule-for-main ``. The template requires two users who assume the role of ``CodeCommitReview`` to approve any pull request before it can be merged to the ``main`` branch. :: | |
3 | 3 | |
4 | 4 | aws codecommit create-approval-rule-template \ |
5 | --approval-rule-template-name 2-approver-rule-for-master \ | |
6 | --approval-rule-template-description "Requires two developers from the team to approve the pull request if the destination branch is master" \ | |
7 | --approval-rule-template-content "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/master\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}" | |
5 | --approval-rule-template-name 2-approver-rule-for-main \ | |
6 | --approval-rule-template-description "Requires two developers from the team to approve the pull request if the destination branch is main" \ | |
7 | --approval-rule-template-content "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}" | |
8 | 8 | |
9 | 9 | Output:: |
10 | 10 | |
11 | 11 | { |
12 | 12 | "approvalRuleTemplate": { |
13 | "approvalRuleTemplateName": "2-approver-rule-for-master", | |
13 | "approvalRuleTemplateName": "2-approver-rule-for-main", | |
14 | 14 | "creationDate": 1571356106.936, |
15 | 15 | "approvalRuleTemplateId": "dd8b17fe-EXAMPLE", |
16 | "approvalRuleTemplateContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/master\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
16 | "approvalRuleTemplateContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
17 | 17 | "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major", |
18 | "approvalRuleTemplateDescription": "Requires two developers from the team to approve the pull request if the destination branch is master", | |
18 | "approvalRuleTemplateDescription": "Requires two developers from the team to approve the pull request if the destination branch is main", | |
19 | 19 | "lastModifiedDate": 1571356106.936, |
20 | 20 | "ruleContentSha256": "4711b576EXAMPLE" |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | For more information, see `Create an Approval Rule Template <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-template.html#create-template-cli>`__ in the *AWS CodeCommit User Guide*. | |
24 | For more information, see `Create an Approval Rule Template <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-template.html#create-template-cli>`__ in the *AWS CodeCommit User Guide*.⏎ |
0 | 0 | **To create a commit** |
1 | 1 | |
2 | The following ``create-commit`` example demonstrates how to create an initial commit for a repository that adds a ``readme.md`` file to a repository named ``MyDemoRepo`` in the ``master`` branch. :: | |
2 | The following ``create-commit`` example demonstrates how to create an initial commit for a repository that adds a ``readme.md`` file to a repository named ``MyDemoRepo`` in the ``main`` branch. :: | |
3 | 3 | |
4 | aws codecommit create-commit --repository-name MyDemoRepo --branch-name master --put-files "filePath=readme.md,fileContent='Welcome to our team repository.'" | |
4 | aws codecommit create-commit \ | |
5 | --repository-name MyDemoRepo \ | |
6 | --branch-name main \ | |
7 | --put-files "filePath=readme.md,fileContent='Welcome to our team repository.'" | |
5 | 8 | |
6 | 9 | Output:: |
7 | 10 | |
19 | 22 | "filesUpdated": [] |
20 | 23 | } |
21 | 24 | |
22 | For more information, see `Create a Commit in AWS CodeCommit`_ in the *AWS CodeCommit User Guide*. | |
23 | ||
24 | .. _`Create a Commit in AWS CodeCommit`: https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-commit.html#how-to-create-commit-cli⏎ | |
25 | For more information, see `Create a Commit in AWS CodeCommit <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-commit.html#how-to-create-commit-cli>`__ in the *AWS CodeCommit User Guide*.⏎ |
0 | 0 | **To create a pull request** |
1 | 1 | |
2 | The following ``create-pull-request`` example creates a pull request named 'My Pull Request' with a description of 'Please review these changes by Tuesday' that targets the 'MyNewBranch' source branch and is to be merged to the default branch 'master' in an AWS CodeCommit repository named 'MyDemoRepo'. :: | |
2 | The following ``create-pull-request`` example creates a pull request named 'Pronunciation difficulty analyzer' with a description of 'Please review these changes by Tuesday' that targets the 'jane-branch' source branch and is to be merged to the default branch 'main' in an AWS CodeCommit repository named 'MyDemoRepo'. :: | |
3 | 3 | |
4 | 4 | aws codecommit create-pull-request \ |
5 | 5 | --title "My Pull Request" \ |
10 | 10 | Output:: |
11 | 11 | |
12 | 12 | { |
13 | "pullRequest": { | |
13 | "pullRequest": { | |
14 | "approvalRules": [ | |
15 | { | |
16 | "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
17 | "approvalRuleId": "dd8b17fe-EXAMPLE", | |
18 | "approvalRuleName": "2-approver-rule-for-main", | |
19 | "creationDate": 1571356106.936, | |
20 | "lastModifiedDate": 571356106.936, | |
21 | "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major", | |
22 | "originApprovalRuleTemplate": { | |
23 | "approvalRuleTemplateId": "dd3d22fe-EXAMPLE", | |
24 | "approvalRuleTemplateName": "2-approver-rule-for-main" | |
25 | }, | |
26 | "ruleContentSha256": "4711b576EXAMPLE" | |
27 | } | |
28 | ], | |
14 | 29 | "authorArn": "arn:aws:iam::111111111111:user/Jane_Doe", |
15 | "clientRequestToken": "123Example", | |
16 | "creationDate": 1508962823.285, | |
17 | 30 | "description": "Please review these changes by Tuesday", |
31 | "title": "Pronunciation difficulty analyzer", | |
32 | "pullRequestTargets": [ | |
33 | { | |
34 | "destinationCommit": "5d036259EXAMPLE", | |
35 | "destinationReference": "refs/heads/main", | |
36 | "repositoryName": "MyDemoRepo", | |
37 | "sourceCommit": "317f8570EXAMPLE", | |
38 | "sourceReference": "refs/heads/jane-branch", | |
39 | "mergeMetadata": { | |
40 | "isMerged": false | |
41 | } | |
42 | } | |
43 | ], | |
18 | 44 | "lastActivityDate": 1508962823.285, |
19 | 45 | "pullRequestId": "42", |
46 | "clientRequestToken": "123Example", | |
20 | 47 | "pullRequestStatus": "OPEN", |
21 | "pullRequestTargets": [ | |
22 | { | |
23 | "destinationCommit": "5d036259EXAMPLE", | |
24 | "destinationReference": "refs/heads/master", | |
25 | "mergeMetadata": { | |
26 | "isMerged": false, | |
27 | }, | |
28 | "repositoryName": "MyDemoRepo", | |
29 | "sourceCommit": "317f8570EXAMPLE", | |
30 | "sourceReference": "refs/heads/MyNewBranch" | |
31 | } | |
32 | ], | |
33 | "title": "My Pull Request" | |
48 | "creationDate": 1508962823.285 | |
34 | 49 | } |
35 | 50 | } |
0 | 0 | **To create an unreferenced commit that represents the result of merging two commit specifiers** |
1 | 1 | |
2 | The following ``create-unreferenced-merge-commit`` example creates a commit that represents the results of a merge between a source branch named ``bugfix-1234`` with a destination branch named ``master`` using the THREE_WAY_MERGE strategy in a repository named ``MyDemoRepo``. :: | |
2 | The following ``create-unreferenced-merge-commit`` example creates a commit that represents the results of a merge between a source branch named ``bugfix-1234`` with a destination branch named ``main`` using the THREE_WAY_MERGE strategy in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | 4 | aws codecommit create-unreferenced-merge-commit \ |
5 | 5 | --source-commit-specifier bugfix-1234 \ |
6 | --destination-commit-specifier master \ | |
6 | --destination-commit-specifier main \ | |
7 | 7 | --merge-option THREE_WAY_MERGE \ |
8 | 8 | --repository-name MyDemoRepo \ |
9 | 9 | --name "Maria Garcia" \ |
0 | 0 | **To delete the content of a comment** |
1 | 1 | |
2 | You can only delete the content of a comment if you created the comment. This example demonstrates how to delete the content of a comment with the system-generated ID of 'ff30b348EXAMPLEb9aa670f':: | |
2 | You can only delete the content of a comment if you created the comment. This example demonstrates how to delete the content of a comment with the system-generated ID of ``ff30b348EXAMPLEb9aa670f``. :: | |
3 | 3 | |
4 | aws codecommit delete-comment-content --comment-id ff30b348EXAMPLEb9aa670f | |
4 | aws codecommit delete-comment-content \ | |
5 | --comment-id ff30b348EXAMPLEb9aa670f | |
5 | 6 | |
6 | 7 | Output:: |
7 | 8 | |
8 | { | |
9 | "comment": { | |
10 | "creationDate": 1508369768.142, | |
11 | "deleted": true, | |
12 | "lastModifiedDate": 1508369842.278, | |
13 | "clientRequestToken": "123Example", | |
14 | "commentId": "ff30b348EXAMPLEb9aa670f", | |
15 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan" | |
16 | } | |
17 | }⏎ | |
9 | { | |
10 | "comment": { | |
11 | "creationDate": 1508369768.142, | |
12 | "deleted": true, | |
13 | "lastModifiedDate": 1508369842.278, | |
14 | "clientRequestToken": "123Example", | |
15 | "commentId": "ff30b348EXAMPLEb9aa670f", | |
16 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
17 | "callerReactions": [], | |
18 | "reactionCounts": | |
19 | { | |
20 | "CLAP" : 1 | |
21 | } | |
22 | } | |
23 | }⏎ |
0 | 0 | **To delete a file** |
1 | 1 | |
2 | The following ``delete-file`` example demonstrates how to delete a file named ``README.md`` from a branch named ``master`` with a most recent commit ID of ``c5709475EXAMPLE`` in a repository named ``MyDemoRepo``. :: | |
2 | The following ``delete-file`` example demonstrates how to delete a file named ``README.md`` from a branch named ``main`` with a most recent commit ID of ``c5709475EXAMPLE`` in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | aws codecommit delete-file --repository-name MyDemoRepo --branch-name master --file-path README.md --parent-commit-id c5709475EXAMPLE | |
4 | aws codecommit delete-file \ | |
5 | --repository-name MyDemoRepo \ | |
6 | --branch-name main \ | |
7 | --file-path README.md \ | |
8 | --parent-commit-id c5709475EXAMPLE | |
5 | 9 | |
6 | 10 | Output:: |
7 | 11 | |
12 | 16 | "treeId":"6bc824cEXAMPLE" |
13 | 17 | } |
14 | 18 | |
15 | For more information, see `Edit or Delete a File in AWS CodeCommit`_ in the *AWS CodeCommit API Reference* guide. | |
16 | ||
17 | .. _`Edit or Delete a File in AWS CodeCommit`: https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-edit-file.html?shortFooter=true#how-to-edit-file-cli⏎ | |
19 | For more information, see `Edit or Delete a File in AWS CodeCommit <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-edit-file.html?shortFooter=true#how-to-edit-file-cli>`__ in the *AWS CodeCommit API Reference* guide.⏎ |
3 | 3 | |
4 | 4 | aws codecommit describe-merge-conflicts \ |
5 | 5 | --source-commit-specifier feature-randomizationfeature \ |
6 | --destination-commit-specifier master \ | |
6 | --destination-commit-specifier main \ | |
7 | 7 | --merge-option THREE_WAY_MERGE \ |
8 | 8 | --file-path readme.md \ |
9 | 9 | --repository-name MyDemoRepo |
0 | 0 | **To view details of a comment** |
1 | 1 | |
2 | This example demonstrates how to view details of a comment with the system-generated comment ID of 'ff30b348EXAMPLEb9aa670f':: | |
2 | This example demonstrates how to view details of a comment with the system-generated comment ID of ``ff30b348EXAMPLEb9aa670f``. :: | |
3 | 3 | |
4 | aws codecommit get-comment --comment-id ff30b348EXAMPLEb9aa670f | |
4 | aws codecommit get-comment \ | |
5 | --comment-id ff30b348EXAMPLEb9aa670f | |
5 | 6 | |
6 | 7 | Output:: |
7 | 8 | |
8 | { | |
9 | "comment": { | |
10 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
11 | "clientRequestToken": "123Example", | |
12 | "commentId": "ff30b348EXAMPLEb9aa670f", | |
13 | "content": "Whoops - I meant to add this comment to the line, but I don't see how to delete it.", | |
14 | "creationDate": 1508369768.142, | |
15 | "deleted": false, | |
16 | "commentId": "", | |
17 | "lastModifiedDate": 1508369842.278 | |
18 | } | |
19 | }⏎ | |
9 | { | |
10 | "comment": { | |
11 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
12 | "clientRequestToken": "123Example", | |
13 | "commentId": "ff30b348EXAMPLEb9aa670f", | |
14 | "content": "Whoops - I meant to add this comment to the line, but I don't see how to delete it.", | |
15 | "creationDate": 1508369768.142, | |
16 | "deleted": false, | |
17 | "commentId": "", | |
18 | "lastModifiedDate": 1508369842.278, | |
19 | "callerReactions": [], | |
20 | "reactionCounts": | |
21 | { | |
22 | "SMILE" : 6, | |
23 | "THUMBSUP" : 1 | |
24 | } | |
25 | } | |
26 | }⏎ |
0 | 0 | **To view comments on a commit** |
1 | 1 | |
2 | This example demonstrates how to view view comments made on the comparison between two commits in a repository named 'MyDemoRepo':: | |
2 | This example demonstrates how to view view comments made on the comparison between two commits in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | aws codecommit get-comments-for-compared-commit --repository-name MyDemoRepo --before-commit-ID 6e147360EXAMPLE --after-commit-id 317f8570EXAMPLE | |
4 | aws codecommit get-comments-for-compared-commit \ | |
5 | --repository-name MyDemoRepo \ | |
6 | --before-commit-ID 6e147360EXAMPLE \ | |
7 | --after-commit-id 317f8570EXAMPLE | |
5 | 8 | |
6 | 9 | Output:: |
7 | 10 | |
8 | { | |
9 | "commentsForComparedCommitData": [ | |
10 | { | |
11 | "afterBlobId": "1f330709EXAMPLE", | |
12 | "afterCommitId": "317f8570EXAMPLE", | |
13 | "beforeBlobId": "80906a4cEXAMPLE", | |
14 | "beforeCommitId": "6e147360EXAMPLE", | |
15 | "comments": [ | |
11 | { | |
12 | "commentsForComparedCommitData": [ | |
16 | 13 | { |
17 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
18 | "clientRequestToken": "123Example", | |
19 | "commentId": "ff30b348EXAMPLEb9aa670f", | |
20 | "content": "Whoops - I meant to add this comment to the line, not the file, but I don't see how to delete it.", | |
21 | "creationDate": 1508369768.142, | |
22 | "deleted": false, | |
23 | "CommentId": "123abc-EXAMPLE", | |
24 | "lastModifiedDate": 1508369842.278 | |
25 | }, | |
26 | { | |
27 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
28 | "clientRequestToken": "123Example", | |
29 | "commentId": "553b509bEXAMPLE56198325", | |
30 | "content": "Can you add a test case for this?", | |
31 | "creationDate": 1508369612.240, | |
32 | "deleted": false, | |
33 | "commentId": "456def-EXAMPLE", | |
34 | "lastModifiedDate": 1508369612.240 | |
35 | } | |
36 | ], | |
37 | "location": { | |
38 | "filePath": "cl_sample.js", | |
39 | "filePosition": 1232, | |
40 | "relativeFileVersion": "after" | |
41 | }, | |
42 | "repositoryName": "MyDemoRepo" | |
43 | } | |
44 | ], | |
45 | "nextToken": "exampleToken" | |
46 | }⏎ | |
14 | "afterBlobId": "1f330709EXAMPLE", | |
15 | "afterCommitId": "317f8570EXAMPLE", | |
16 | "beforeBlobId": "80906a4cEXAMPLE", | |
17 | "beforeCommitId": "6e147360EXAMPLE", | |
18 | "comments": [ | |
19 | { | |
20 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
21 | "clientRequestToken": "123Example", | |
22 | "commentId": "ff30b348EXAMPLEb9aa670f", | |
23 | "content": "Whoops - I meant to add this comment to the line, not the file, but I don't see how to delete it.", | |
24 | "creationDate": 1508369768.142, | |
25 | "deleted": false, | |
26 | "CommentId": "123abc-EXAMPLE", | |
27 | "lastModifiedDate": 1508369842.278, | |
28 | "callerReactions": [], | |
29 | "reactionCounts": | |
30 | { | |
31 | "SMILE" : 6, | |
32 | "THUMBSUP" : 1 | |
33 | } | |
34 | }, | |
35 | { | |
36 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
37 | "clientRequestToken": "123Example", | |
38 | "commentId": "553b509bEXAMPLE56198325", | |
39 | "content": "Can you add a test case for this?", | |
40 | "creationDate": 1508369612.240, | |
41 | "deleted": false, | |
42 | "commentId": "456def-EXAMPLE", | |
43 | "lastModifiedDate": 1508369612.240, | |
44 | "callerReactions": [], | |
45 | "reactionCounts": | |
46 | { | |
47 | "THUMBSUP" : 2 | |
48 | } | |
49 | } | |
50 | ], | |
51 | "location": { | |
52 | "filePath": "cl_sample.js", | |
53 | "filePosition": 1232, | |
54 | "relativeFileVersion": "after" | |
55 | }, | |
56 | "repositoryName": "MyDemoRepo" | |
57 | } | |
58 | ], | |
59 | "nextToken": "exampleToken" | |
60 | }⏎ |
0 | 0 | **To view comments for a pull request** |
1 | 1 | |
2 | This example demonstrates how to view comments for a pull request in a repository named 'MyDemoRepo'. :: | |
2 | This example demonstrates how to view comments for a pull request in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | 4 | aws codecommit get-comments-for-pull-request \ |
5 | 5 | --repository-name MyDemoRepo \ |
23 | 23 | "content": "These don't appear to be used anywhere. Can we remove them?", |
24 | 24 | "creationDate": 1508369622.123, |
25 | 25 | "deleted": false, |
26 | "lastModifiedDate": 1508369622.123 | |
26 | "lastModifiedDate": 1508369622.123, | |
27 | "callerReactions": [], | |
28 | "reactionCounts": | |
29 | { | |
30 | "THUMBSUP" : 6, | |
31 | "CONFUSED" : 1 | |
32 | } | |
27 | 33 | }, |
28 | 34 | { |
29 | 35 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", |
32 | 38 | "content": "Good catch. I'll remove them.", |
33 | 39 | "creationDate": 1508369829.104, |
34 | 40 | "deleted": false, |
35 | "commentId": "abcd1234EXAMPLEb5678efgh", | |
36 | "lastModifiedDate": 150836912.273 | |
41 | "lastModifiedDate": 150836912.273, | |
42 | "callerReactions": ["THUMBSUP"] | |
43 | "reactionCounts": | |
44 | { | |
45 | "THUMBSUP" : 14 | |
46 | } | |
37 | 47 | } |
38 | 48 | ], |
39 | 49 | "location": { |
0 | 0 | **To get the base-64 encoded contents of a file in an AWS CodeCommit repository** |
1 | 1 | |
2 | The following ``get-file`` example demonstrates how to get the base-64 encoded contents of a file named ``README.md`` from a branch named ``master`` in a repository named ``MyDemoRepo``. :: | |
2 | The following ``get-file`` example demonstrates how to get the base-64 encoded contents of a file named ``README.md`` from a branch named ``main`` in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | aws codecommit get-file --repository-name MyDemoRepo --commit-specifier master --file-path README.md | |
4 | aws codecommit get-file \ | |
5 | --repository-name MyDemoRepo \ | |
6 | --commit-specifier main \ | |
7 | --file-path README.md | |
5 | 8 | |
6 | 9 | Output:: |
7 | 10 | |
14 | 17 | "fileSize":1563 |
15 | 18 | } |
16 | 19 | |
17 | For more information, see `GetFile`_ in the *AWS CodeCommit API Reference* guide. | |
18 | ||
19 | .. _`GetFile`: https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetFile.html | |
20 | For more information, see `GetFile <https://docs.aws.amazon.com/codecommit/latest/APIReference/API_GetFile.html>`__ in the *AWS CodeCommit API Reference* guide. |
0 | 0 | **To get detailed information about a merge commit** |
1 | 1 | |
2 | The following ``get-merge-commit`` example displays details about a merge commit for the source branch named ``bugfix-bug1234`` with a destination branch named ``master`` using the THREE_WAY_MERGE strategy in a repository named ``MyDemoRepo``. :: | |
2 | The following ``get-merge-commit`` example displays details about a merge commit for the source branch named ``bugfix-bug1234`` with a destination branch named ``main`` using the THREE_WAY_MERGE strategy in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | 4 | aws codecommit get-merge-commit \ |
5 | 5 | --source-commit-specifier bugfix-bug1234 \ |
6 | --destination-commit-specifier master \ | |
6 | --destination-commit-specifier main \ | |
7 | 7 | --merge-option THREE_WAY_MERGE \ |
8 | 8 | --repository-name MyDemoRepo |
9 | 9 |
0 | 0 | **To view whether there are any merge conflicts for a pull request** |
1 | 1 | |
2 | The following ``get-merge-conflicts`` example displays whether there are any merge conflicts between the tip of a source branch named 'my-feature-branch' and a destination branch named 'master' in a repository named 'MyDemoRepo'. :: | |
2 | The following ``get-merge-conflicts`` example displays whether there are any merge conflicts between the tip of a source branch named ``feature-randomizationfeature`` and a destination branch named 'main' in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | 4 | aws codecommit get-merge-conflicts \ |
5 | 5 | --repository-name MyDemoRepo \ |
6 | --source-commit-specifier my-feature-branch \ | |
7 | --destination-commit-specifier master \ | |
8 | --merge-option FAST_FORWARD_MERGE | |
6 | --source-commit-specifier feature-randomizationfeature \ | |
7 | --destination-commit-specifier main \ | |
8 | --merge-option THREE_WAY_MERGE | |
9 | 9 | |
10 | 10 | Output:: |
11 | 11 | |
12 | 12 | { |
13 | "destinationCommitId": "fac04518EXAMPLE", | |
14 | 13 | "mergeable": false, |
15 | "sourceCommitId": "16d097f03EXAMPLE" | |
14 | "destinationCommitId": "86958e0aEXAMPLE", | |
15 | "sourceCommitId": "6ccd57fdEXAMPLE", | |
16 | "baseCommitId": "767b6958EXAMPLE", | |
17 | "conflictMetadataList": [ | |
18 | { | |
19 | "filePath": "readme.md", | |
20 | "fileSizes": { | |
21 | "source": 139, | |
22 | "destination": 230, | |
23 | "base": 85 | |
24 | }, | |
25 | "fileModes": { | |
26 | "source": "NORMAL", | |
27 | "destination": "NORMAL", | |
28 | "base": "NORMAL" | |
29 | }, | |
30 | "objectTypes": { | |
31 | "source": "FILE", | |
32 | "destination": "FILE", | |
33 | "base": "FILE" | |
34 | }, | |
35 | "numberOfConflicts": 1, | |
36 | "isBinaryFile": { | |
37 | "source": false, | |
38 | "destination": false, | |
39 | "base": false | |
40 | }, | |
41 | "contentConflict": true, | |
42 | "fileModeConflict": false, | |
43 | "objectTypeConflict": false, | |
44 | "mergeOperations": { | |
45 | "source": "M", | |
46 | "destination": "M" | |
47 | } | |
48 | } | |
49 | ] | |
16 | 50 | } |
0 | 0 | **To get information about the merge options available for merging two specified branches** |
1 | 1 | |
2 | The following ``get-merge-options`` example determines the merge options available for merging a source branch named ``bugfix-bug1234`` with a destination branch named ``master`` in a repository named ``MyDemoRepo``. :: | |
2 | The following ``get-merge-options`` example determines the merge options available for merging a source branch named ``bugfix-bug1234`` with a destination branch named ``main`` in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | 4 | aws codecommit get-merge-options \ |
5 | 5 | --source-commit-specifier bugfix-bug1234 \ |
6 | --destination-commit-specifier master \ | |
6 | --destination-commit-specifier main \ | |
7 | 7 | --repository-name MyDemoRepo |
8 | 8 | |
9 | 9 | Output:: |
19 | 19 | "baseCommitId": "ffd3311dEXAMPLE" |
20 | 20 | } |
21 | 21 | |
22 | ||
23 | 22 | For more information, see `Resolve Conflicts in a Pull Request <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-resolve-conflict-pull-request.html#get-merge-options>`__ in the *AWS CodeCommit User Guide*. |
0 | 0 | **To view details of a pull request** |
1 | 1 | |
2 | This example demonstrates how to view information about a pull request with the ID of '42':: | |
2 | This example demonstrates how to view information about a pull request with the ID of ``27``. :: | |
3 | 3 | |
4 | aws codecommit get-pull-request --pull-request-id 42 | |
4 | aws codecommit get-pull-request \ | |
5 | --pull-request-id 27 | |
5 | 6 | |
6 | 7 | Output:: |
7 | 8 | |
8 | { | |
9 | "pullRequest": { | |
10 | "authorArn": "arn:aws:iam::111111111111:user/Jane_Doe", | |
11 | "title": "Pronunciation difficulty analyzer" | |
12 | "pullRequestTargets": [ | |
13 | { | |
14 | "destinationReference": "refs/heads/master", | |
15 | "destinationCommit": "5d036259EXAMPLE", | |
16 | "sourceReference": "refs/heads/jane-branch" | |
17 | "sourceCommit": "317f8570EXAMPLE", | |
18 | "repositoryName": "MyDemoRepo", | |
19 | "mergeMetadata": { | |
20 | "isMerged": false, | |
21 | }, | |
22 | } | |
23 | ], | |
24 | "lastActivityDate": 1508442444, | |
25 | "pullRequestId": "42", | |
26 | "clientRequestToken": "123Example", | |
27 | "pullRequestStatus": "OPEN", | |
28 | "creationDate": 1508962823, | |
29 | "description": "A code review of the new feature I just added to the service.", | |
30 | } | |
31 | }⏎ | |
9 | { | |
10 | "pullRequest": { | |
11 | "approvalRules": [ | |
12 | { | |
13 | "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
14 | "approvalRuleId": "dd8b17fe-EXAMPLE", | |
15 | "approvalRuleName": "2-approver-rule-for-main", | |
16 | "creationDate": 1571356106.936, | |
17 | "lastModifiedDate": 571356106.936, | |
18 | "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major", | |
19 | "ruleContentSha256": "4711b576EXAMPLE" | |
20 | } | |
21 | ], | |
22 | "lastActivityDate": 1562619583.565, | |
23 | "pullRequestTargets": [ | |
24 | { | |
25 | "sourceCommit": "ca45e279EXAMPLE", | |
26 | "sourceReference": "refs/heads/bugfix-1234", | |
27 | "mergeBase": "a99f5ddbEXAMPLE", | |
28 | "destinationReference": "refs/heads/main", | |
29 | "mergeMetadata": { | |
30 | "isMerged": false | |
31 | }, | |
32 | "destinationCommit": "2abfc6beEXAMPLE", | |
33 | "repositoryName": "MyDemoRepo" | |
34 | } | |
35 | ], | |
36 | "revisionId": "e47def21EXAMPLE", | |
37 | "title": "Quick fix for bug 1234", | |
38 | "authorArn": "arn:aws:iam::123456789012:user/Nikhil_Jayashankar", | |
39 | "clientRequestToken": "d8d7612e-EXAMPLE", | |
40 | "creationDate": 1562619583.565, | |
41 | "pullRequestId": "27", | |
42 | "pullRequestStatus": "OPEN" | |
43 | } | |
44 | }⏎ |
0 | 0 | **To get information about triggers in a repository** |
1 | 1 | |
2 | This example shows details about triggers configured for an AWS CodeCommit repository named 'MyDemoRepo'. | |
2 | This example shows details about triggers configured for an AWS CodeCommit repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws codecommit get-repository-triggers --repository-name MyDemoRepo | |
4 | aws codecommit get-repository-triggers \ | |
5 | --repository-name MyDemoRepo | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
10 | { | |
11 | "configurationId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", | |
12 | "triggers": [ | |
13 | { | |
14 | "destinationArn": "arn:aws:sns:us-east-1:111111111111:MyCodeCommitTopic", | |
15 | "branches": [ | |
16 | "mainline", | |
17 | "preprod" | |
18 | ], | |
19 | "name": "MyFirstTrigger", | |
20 | "customData": "", | |
21 | "events": [ | |
22 | "all" | |
23 | ] | |
24 | }, | |
25 | { | |
26 | "destinationArn": "arn:aws:lambda:us-east-1:111111111111:function:MyCodeCommitPythonFunction", | |
27 | "branches": [], | |
28 | "name": "MySecondTrigger", | |
29 | "customData": "EXAMPLE", | |
30 | "events": [ | |
31 | "all" | |
32 | ] | |
33 | } | |
34 | ] | |
35 | }⏎ | |
9 | { | |
10 | "configurationId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", | |
11 | "triggers": [ | |
12 | { | |
13 | "destinationArn": "arn:aws:sns:us-east-1:111111111111:MyCodeCommitTopic", | |
14 | "branches": [ | |
15 | "main", | |
16 | "preprod" | |
17 | ], | |
18 | "name": "MyFirstTrigger", | |
19 | "customData": "", | |
20 | "events": [ | |
21 | "all" | |
22 | ] | |
23 | }, | |
24 | { | |
25 | "destinationArn": "arn:aws:lambda:us-east-1:111111111111:function:MyCodeCommitPythonFunction", | |
26 | "branches": [], | |
27 | "name": "MySecondTrigger", | |
28 | "customData": "EXAMPLE", | |
29 | "events": [ | |
30 | "all" | |
31 | ] | |
32 | } | |
33 | ] | |
34 | }⏎ |
0 | 0 | **To get information about a repository** |
1 | 1 | |
2 | This example shows details about an AWS CodeCommit repository. | |
2 | This example shows details about an AWS CodeCommit repository. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws codecommit get-repository --repository-name MyDemoRepo | |
4 | aws codecommit get-repository \ | |
5 | --repository-name MyDemoRepo | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
10 | { | |
11 | "repositoryMetadata": { | |
9 | { | |
10 | "repositoryMetadata": { | |
12 | 11 | "creationDate": 1429203623.625, |
13 | "defaultBranch": "master", | |
12 | "defaultBranch": "main", | |
14 | 13 | "repositoryName": "MyDemoRepo", |
15 | 14 | "cloneUrlSsh": "ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/v1/repos/MyDemoRepo", |
16 | 15 | "lastModifiedDate": 1430783812.0869999, |
20 | 19 | "Arn": "arn:aws:codecommit:us-east-1:80398EXAMPLE:MyDemoRepo |
21 | 20 | "accountId": "111111111111" |
22 | 21 | } |
23 | } | |
22 | } |
8 | 8 | |
9 | 9 | { |
10 | 10 | "approvalRuleTemplateNames": [ |
11 | "2-approver-rule-for-master", | |
11 | "2-approver-rule-for-main", | |
12 | 12 | "1-approver-rule-for-all-pull-requests" |
13 | 13 | ] |
14 | 14 | } |
15 | 15 | |
16 | For more information, see `Manage Approval Rule Templates <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#list-templates>`__ in the *AWS CodeCommit User Guide*. | |
16 | For more information, see `Manage Approval Rule Templates <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-manage-templates.html#list-templates>`__ in the *AWS CodeCommit User Guide*.⏎ |
+1
-1
8 | 8 | |
9 | 9 | { |
10 | 10 | "approvalRuleTemplateNames": [ |
11 | "2-approver-rule-for-master", | |
11 | "2-approver-rule-for-main", | |
12 | 12 | "1-approver-rule-for-all-pull-requests" |
13 | 13 | ] |
14 | 14 | } |
0 | 0 | **To view a list of branch names** |
1 | 1 | |
2 | This example lists all branch names in an AWS CodeCommit repository. | |
2 | This example lists all branch names in an AWS CodeCommit repository. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws codecommit list-branches --repository-name MyDemoRepo | |
4 | aws codecommit list-branches \ | |
5 | --repository-name MyDemoRepo | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
10 | { | |
11 | "branches": [ | |
12 | "MyNewBranch", | |
13 | "master" | |
14 | ] | |
15 | } | |
9 | { | |
10 | "branches": [ | |
11 | "MyNewBranch", | |
12 | "main" | |
13 | ] | |
14 | } |
2 | 2 | The following ``list-repositories-for-approval-rule-template`` example lists all repositories associated with the specified approval rule template. :: |
3 | 3 | |
4 | 4 | aws codecommit list-repositories-for-approval-rule-template \ |
5 | --approval-rule-template-name 2-approver-rule-for-master | |
5 | --approval-rule-template-name 2-approver-rule-for-main | |
6 | 6 | |
7 | 7 | Output:: |
8 | 8 |
2 | 2 | The following ``merge-branches-by-three-way`` example merges the specified source branch with the specified destination branch in a repository named ``MyDemoRepo``. :: |
3 | 3 | |
4 | 4 | aws codecommit merge-branches-by-three-way \ |
5 | --source-commit-specifier master \ | |
5 | --source-commit-specifier main \ | |
6 | 6 | --destination-commit-specifier bugfix-bug1234 \ |
7 | 7 | --author-name "Jorge Souza" --email "jorge_souza@example.com" \ |
8 | --commit-message "Merging changes from master to bugfix branch before additional testing." \ | |
8 | --commit-message "Merging changes from main to bugfix branch before additional testing." \ | |
9 | 9 | --repository-name MyDemoRepo |
10 | 10 | |
11 | 11 | Output:: |
0 | 0 | **To merge and close a pull request** |
1 | 1 | |
2 | This example demonstrates how to merge and close a pull request with the ID of '47' and a source commit ID of '99132ab0EXAMPLE' in a repository named 'MyDemoRepo':: | |
2 | This example demonstrates how to merge and close a pull request with the ID of '47' and a source commit ID of '99132ab0EXAMPLE' in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | aws codecommit merge-pull-request-by-fast-forward --pull-request-id 47 --source-commit-id 99132ab0EXAMPLE --repository-name MyDemoRepo | |
4 | aws codecommit merge-pull-request-by-fast-forward \ | |
5 | --pull-request-id 47 \ | |
6 | --source-commit-id 99132ab0EXAMPLE \ | |
7 | --repository-name MyDemoRepo | |
5 | 8 | |
6 | 9 | Output:: |
7 | 10 | |
8 | { | |
9 | "pullRequest": { | |
10 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
11 | "clientRequestToken": "", | |
12 | "creationDate": 1508530823.142, | |
13 | "description": "Review the latest changes and updates to the global variables", | |
14 | "lastActivityDate": 1508887223.155, | |
15 | "pullRequestId": "47", | |
16 | "pullRequestStatus": "CLOSED", | |
17 | "pullRequestTargets": [ | |
18 | { | |
19 | "destinationCommit": "9f31c968EXAMPLE", | |
20 | "destinationReference": "refs/heads/master", | |
21 | "mergeMetadata": { | |
22 | "isMerged": true, | |
23 | "mergedBy": "arn:aws:iam::111111111111:user/Mary_Major" | |
24 | }, | |
25 | "repositoryName": "MyDemoRepo", | |
26 | "sourceCommit": "99132ab0EXAMPLE", | |
27 | "sourceReference": "refs/heads/variables-branch" | |
28 | } | |
29 | ], | |
30 | "title": "Consolidation of global variables" | |
11 | { | |
12 | "pullRequest": { | |
13 | "approvalRules": [ | |
14 | { | |
15 | "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 1,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
16 | "approvalRuleId": "dd8b17fe-EXAMPLE", | |
17 | "approvalRuleName": "I want one approver for this pull request", | |
18 | "creationDate": 1571356106.936, | |
19 | "lastModifiedDate": 571356106.936, | |
20 | "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major", | |
21 | "ruleContentSha256": "4711b576EXAMPLE" | |
22 | } | |
23 | ], | |
24 | "authorArn": "arn:aws:iam::123456789012:user/Li_Juan", | |
25 | "clientRequestToken": "", | |
26 | "creationDate": 1508530823.142, | |
27 | "description": "Review the latest changes and updates to the global variables", | |
28 | "lastActivityDate": 1508887223.155, | |
29 | "pullRequestId": "47", | |
30 | "pullRequestStatus": "CLOSED", | |
31 | "pullRequestTargets": [ | |
32 | { | |
33 | "destinationCommit": "9f31c968EXAMPLE", | |
34 | "destinationReference": "refs/heads/main", | |
35 | "mergeMetadata": { | |
36 | "isMerged": true, | |
37 | "mergedBy": "arn:aws:iam::123456789012:user/Mary_Major" | |
38 | }, | |
39 | "repositoryName": "MyDemoRepo", | |
40 | "sourceCommit": "99132ab0EXAMPLE", | |
41 | "sourceReference": "refs/heads/variables-branch" | |
42 | } | |
43 | ], | |
44 | "title": "Consolidation of global variables" | |
45 | } | |
31 | 46 | } |
32 | }⏎ | |
47 | ||
48 | For more information, see `Merge a Pull Request <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-merge-pull-request.html#merge-pull-request-by-fast-forward>`__ in the *AWS CodeCommit User Guide*.⏎ |
13 | 13 | Output:: |
14 | 14 | |
15 | 15 | { |
16 | "pullRequest": { | |
17 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
16 | "pullRequest": { | |
17 | "approvalRules": [ | |
18 | { | |
19 | "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
20 | "approvalRuleId": "dd8b17fe-EXAMPLE", | |
21 | "approvalRuleName": "2-approver-rule-for-main", | |
22 | "creationDate": 1571356106.936, | |
23 | "lastModifiedDate": 571356106.936, | |
24 | "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major", | |
25 | "originApprovalRuleTemplate": { | |
26 | "approvalRuleTemplateId": "dd8b17fe-EXAMPLE", | |
27 | "approvalRuleTemplateName": "2-approver-rule-for-main" | |
28 | }, | |
29 | "ruleContentSha256": "4711b576EXAMPLE" | |
30 | } | |
31 | ], | |
32 | "authorArn": "arn:aws:iam::123456789012:user/Li_Juan", | |
18 | 33 | "clientRequestToken": "", |
19 | 34 | "creationDate": 1508530823.142, |
20 | 35 | "description": "Review the latest changes and updates to the global variables", |
21 | 36 | "lastActivityDate": 1508887223.155, |
22 | 37 | "pullRequestId": "47", |
23 | 38 | "pullRequestStatus": "CLOSED", |
24 | "pullRequestTargets": [ | |
25 | { | |
39 | "pullRequestTargets": [ | |
40 | { | |
26 | 41 | "destinationCommit": "9f31c968EXAMPLE", |
27 | "destinationReference": "refs/heads/master", | |
28 | "mergeMetadata": { | |
42 | "destinationReference": "refs/heads/main", | |
43 | "mergeMetadata": { | |
29 | 44 | "isMerged": true, |
30 | "mergedBy": "arn:aws:iam::111111111111:user/Jorge_Souza" | |
45 | "mergedBy": "arn:aws:iam::123456789012:user/Mary_Major" | |
31 | 46 | }, |
32 | 47 | "repositoryName": "MyDemoRepo", |
33 | 48 | "sourceCommit": "99132ab0EXAMPLE", |
12 | 12 | Output:: |
13 | 13 | |
14 | 14 | { |
15 | "pullRequest": { | |
16 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
15 | "pullRequest": { | |
16 | "approvalRules": [ | |
17 | { | |
18 | "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
19 | "approvalRuleId": "dd8b17fe-EXAMPLE", | |
20 | "approvalRuleName": "2-approver-rule-for-main", | |
21 | "creationDate": 1571356106.936, | |
22 | "lastModifiedDate": 571356106.936, | |
23 | "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major", | |
24 | "originApprovalRuleTemplate": { | |
25 | "approvalRuleTemplateId": "dd8b17fe-EXAMPLE", | |
26 | "approvalRuleTemplateName": "2-approver-rule-for-main" | |
27 | }, | |
28 | "ruleContentSha256": "4711b576EXAMPLE" | |
29 | } | |
30 | ], | |
31 | "authorArn": "arn:aws:iam::123456789012:user/Li_Juan", | |
17 | 32 | "clientRequestToken": "", |
18 | 33 | "creationDate": 1508530823.142, |
19 | 34 | "description": "Review the latest changes and updates to the global variables", |
20 | 35 | "lastActivityDate": 1508887223.155, |
21 | 36 | "pullRequestId": "47", |
22 | 37 | "pullRequestStatus": "CLOSED", |
23 | "pullRequestTargets": [ | |
24 | { | |
38 | "pullRequestTargets": [ | |
39 | { | |
25 | 40 | "destinationCommit": "9f31c968EXAMPLE", |
26 | "destinationReference": "refs/heads/master", | |
27 | "mergeMetadata": { | |
41 | "destinationReference": "refs/heads/main", | |
42 | "mergeMetadata": { | |
28 | 43 | "isMerged": true, |
29 | "mergedBy": "arn:aws:iam::111111111111:user/Maria_Garcia" | |
44 | "mergedBy": "arn:aws:iam::123456789012:user/Mary_Major" | |
30 | 45 | }, |
31 | 46 | "repositoryName": "MyDemoRepo", |
32 | 47 | "sourceCommit": "99132ab0EXAMPLE", |
0 | 0 | **To create a comment on a commit** |
1 | 1 | |
2 | This example demonstrates how to add the comment '"Can you add a test case for this?"' on the change to the 'cl_sample.js' file in the comparison between two commits in a repository named 'MyDemoRepo':: | |
2 | This example demonstrates how to add the comment ``"Can you add a test case for this?"`` on the change to the ``cl_sample.js`` file in the comparison between two commits in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | aws codecommit post-comment-for-compared-commit --repository-name MyDemoRepo --before-commit-id 317f8570EXAMPLE --after-commit-id 5d036259EXAMPLE --client-request-token 123Example --content "Can you add a test case for this?" --location filePath=cl_sample.js,filePosition=1232,relativeFileVersion=AFTER | |
4 | aws codecommit post-comment-for-compared-commit \ | |
5 | --repository-name MyDemoRepo \ | |
6 | --before-commit-id 317f8570EXAMPLE \ | |
7 | --after-commit-id 5d036259EXAMPLE \ | |
8 | --client-request-token 123Example \ | |
9 | --content "Can you add a test case for this?" \ | |
10 | --location filePath=cl_sample.js,filePosition=1232,relativeFileVersion=AFTER | |
5 | 11 | |
6 | 12 | Output:: |
7 | 13 | |
8 | { | |
9 | "afterBlobId": "1f330709EXAMPLE", | |
10 | "afterCommitId": "317f8570EXAMPLE", | |
11 | "beforeBlobId": "80906a4cEXAMPLE", | |
12 | "beforeCommitId": "6e147360EXAMPLE", | |
13 | "comment": { | |
14 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
15 | "clientRequestToken": "", | |
16 | "commentId": "553b509bEXAMPLE56198325", | |
17 | "content": "Can you add a test case for this?", | |
18 | "creationDate": 1508369612.203, | |
19 | "deleted": false, | |
20 | "commentId": "abc123-EXAMPLE", | |
21 | "lastModifiedDate": 1508369612.203 | |
22 | }, | |
23 | "location": { | |
24 | "filePath": "cl_sample.js", | |
25 | "filePosition": 1232, | |
26 | "relativeFileVersion": "AFTER" | |
27 | }, | |
28 | "repositoryName": "MyDemoRepo" | |
29 | }⏎ | |
14 | { | |
15 | "afterBlobId": "1f330709EXAMPLE", | |
16 | "afterCommitId": "317f8570EXAMPLE", | |
17 | "beforeBlobId": "80906a4cEXAMPLE", | |
18 | "beforeCommitId": "6e147360EXAMPLE", | |
19 | "comment": { | |
20 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
21 | "clientRequestToken": "", | |
22 | "commentId": "553b509bEXAMPLE56198325", | |
23 | "content": "Can you add a test case for this?", | |
24 | "creationDate": 1508369612.203, | |
25 | "deleted": false, | |
26 | "commentId": "abc123-EXAMPLE", | |
27 | "lastModifiedDate": 1508369612.203, | |
28 | "callerReactions": [], | |
29 | "reactionCounts": [] | |
30 | }, | |
31 | "location": { | |
32 | "filePath": "cl_sample.js", | |
33 | "filePosition": 1232, | |
34 | "relativeFileVersion": "AFTER" | |
35 | , | |
36 | "repositoryName": "MyDemoRepo" | |
37 | } | |
38 | }⏎ |
0 | 0 | **To add a comment to a pull request** |
1 | 1 | |
2 | The following ``post-comment-for-pull-request`` example adds the comment "These don't appear to be used anywhere. Can we remove them?" on the change to the ``ahs_count.py`` file in a pull request with the ID of '47' in a repository named 'MyDemoRepo'. :: | |
2 | The following ``post-comment-for-pull-request`` example adds the comment "These don't appear to be used anywhere. Can we remove them?" on the change to the ``ahs_count.py`` file in a pull request with the ID of ``47`` in a repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | 4 | aws codecommit post-comment-for-pull-request \ |
5 | 5 | --pull-request-id "47" \ |
25 | 25 | "creationDate": 1508369622.123, |
26 | 26 | "deleted": false, |
27 | 27 | "CommentId": "", |
28 | "lastModifiedDate": 1508369622.123 | |
28 | "lastModifiedDate": 1508369622.123, | |
29 | "callerReactions": [], | |
30 | "reactionCounts": [] | |
29 | 31 | }, |
30 | 32 | "location": { |
31 | 33 | "filePath": "ahs_count.py", |
0 | 0 | **To reply to a comment on a commit or in a pull request** |
1 | 1 | |
2 | This example demonstrates how to add the reply '"Good catch. I'll remove them."' to the comment with the system-generated ID of 'abcd1234EXAMPLEb5678efgh':: | |
2 | This example demonstrates how to add the reply ``"Good catch. I'll remove them."`` to the comment with the system-generated ID of ``abcd1234EXAMPLEb5678efgh``. :: | |
3 | 3 | |
4 | aws codecommit post-comment-reply --in-reply-to abcd1234EXAMPLEb5678efgh --content "Good catch. I'll remove them." --client-request-token 123Example | |
4 | aws codecommit post-comment-reply \ | |
5 | --in-reply-to abcd1234EXAMPLEb5678efgh \ | |
6 | --content "Good catch. I'll remove them." \ | |
7 | --client-request-token 123Example | |
5 | 8 | |
6 | 9 | Output:: |
7 | 10 | |
8 | { | |
9 | "comment": { | |
10 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
11 | "clientRequestToken": "123Example", | |
12 | "commentId": "442b498bEXAMPLE5756813", | |
13 | "content": "Good catch. I'll remove them.", | |
14 | "creationDate": 1508369829.136, | |
15 | "deleted": false, | |
16 | "CommentId": "abcd1234EXAMPLEb5678efgh", | |
17 | "lastModifiedDate": 150836912.221 | |
18 | } | |
19 | }⏎ | |
11 | { | |
12 | "comment": { | |
13 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
14 | "clientRequestToken": "123Example", | |
15 | "commentId": "442b498bEXAMPLE5756813", | |
16 | "content": "Good catch. I'll remove them.", | |
17 | "creationDate": 1508369829.136, | |
18 | "deleted": false, | |
19 | "CommentId": "abcd1234EXAMPLEb5678efgh", | |
20 | "lastModifiedDate": 150836912.221, | |
21 | "callerReactions": [], | |
22 | "reactionCounts": [] | |
23 | } | |
24 | }⏎ |
0 | 0 | **To add or update a trigger in a repository** |
1 | 1 | |
2 | This example demonstrates how to update triggers named 'MyFirstTrigger' and 'MySecondTrigger' using an already-created JSON file (here named MyTriggers.json) that contains the structure of all the triggers for a repository named MyDemoRepo. To learn how to get the JSON for existing triggers, see the get-repository-triggers command. | |
2 | This example demonstrates how to update triggers named 'MyFirstTrigger' and 'MySecondTrigger' using an already-created JSON file (here named MyTriggers.json) that contains the structure of all the triggers for a repository named MyDemoRepo. To learn how to get the JSON for existing triggers, see the get-repository-triggers command. :: | |
3 | 3 | |
4 | aws codecommit put-repository-triggers \ | |
5 | --repository-name MyDemoRepo file://MyTriggers.json | |
4 | 6 | |
5 | Command:: | |
7 | Contents of ``MyTriggers.json``:: | |
6 | 8 | |
7 | aws codecommit put-repository-triggers --repository-name MyDemoRepo file://MyTriggers.json | |
8 | ||
9 | JSON file sample contents: | |
10 | { | |
11 | "repositoryName": "MyDemoRepo", | |
12 | "triggers": [ | |
13 | { | |
14 | "destinationArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MyCodeCommitTopic", | |
15 | "branches": [ | |
16 | "master", | |
17 | "preprod" | |
18 | ], | |
19 | "name": "MyFirstTrigger", | |
20 | "customData": "", | |
21 | "events": [ | |
22 | "all" | |
23 | ] | |
24 | }, | |
25 | { | |
26 | "destinationArn": "arn:aws:lambda:us-east-1:111111111111:function:MyCodeCommitPythonFunction", | |
27 | "branches": [], | |
28 | "name": "MySecondTrigger", | |
29 | "customData": "EXAMPLE", | |
30 | "events": [ | |
31 | "all" | |
32 | ] | |
33 | } | |
34 | ] | |
35 | } | |
9 | { | |
10 | "repositoryName": "MyDemoRepo", | |
11 | "triggers": [ | |
12 | { | |
13 | "destinationArn": "arn:aws:sns:us-east-1:80398EXAMPLE:MyCodeCommitTopic", | |
14 | "branches": [ | |
15 | "main", | |
16 | "preprod" | |
17 | ], | |
18 | "name": "MyFirstTrigger", | |
19 | "customData": "", | |
20 | "events": [ | |
21 | "all" | |
22 | ] | |
23 | }, | |
24 | { | |
25 | "destinationArn": "arn:aws:lambda:us-east-1:111111111111:function:MyCodeCommitPythonFunction", | |
26 | "branches": [], | |
27 | "name": "MySecondTrigger", | |
28 | "customData": "EXAMPLE", | |
29 | "events": [ | |
30 | "all" | |
31 | ] | |
32 | } | |
33 | ] | |
34 | } | |
36 | 35 | |
37 | 36 | Output:: |
38 | 37 | |
39 | { | |
40 | "configurationId": "6fa51cd8-35c1-EXAMPLE" | |
41 | } | |
38 | { | |
39 | "configurationId": "6fa51cd8-35c1-EXAMPLE" | |
40 | } |
3 | 3 | |
4 | 4 | aws codecommit update-approval-rule-template-content \ |
5 | 5 | --approval-rule-template-name 1-approver-rule \ |
6 | --new-rule-content "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/master\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}" | |
6 | --new-rule-content "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}" | |
7 | 7 | |
8 | 8 | Output:: |
9 | 9 |
0 | 0 | **To update a comment on a commit** |
1 | 1 | |
2 | This example demonstrates how to add the content '"Fixed as requested. I'll update the pull request."' to a comment with an ID of '442b498bEXAMPLE5756813':: | |
2 | This example demonstrates how to add the content ``"Fixed as requested. I'll update the pull request."`` to a comment with an ID of ``442b498bEXAMPLE5756813``. :: | |
3 | 3 | |
4 | aws codecommit update-comment --comment-id 442b498bEXAMPLE5756813 --content "Fixed as requested. I'll update the pull request." | |
4 | aws codecommit update-comment \ | |
5 | --comment-id 442b498bEXAMPLE5756813 \ | |
6 | --content "Fixed as requested. I'll update the pull request." | |
5 | 7 | |
6 | 8 | Output:: |
7 | 9 | |
8 | { | |
9 | "comment": { | |
10 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
11 | "clientRequestToken": "", | |
12 | "commentId": "442b498bEXAMPLE5756813", | |
13 | "content": "Fixed as requested. I'll update the pull request.", | |
14 | "creationDate": 1508369929.783, | |
15 | "deleted": false, | |
16 | "lastModifiedDate": 1508369929.287 | |
17 | } | |
18 | }⏎ | |
10 | { | |
11 | "comment": { | |
12 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
13 | "clientRequestToken": "", | |
14 | "commentId": "442b498bEXAMPLE5756813", | |
15 | "content": "Fixed as requested. I'll update the pull request.", | |
16 | "creationDate": 1508369929.783, | |
17 | "deleted": false, | |
18 | "lastModifiedDate": 1508369929.287, | |
19 | "callerReactions": [], | |
20 | "reactionCounts": | |
21 | { | |
22 | "THUMBSUP" : 2 | |
23 | } | |
24 | } | |
25 | }⏎ |
0 | 0 | **To change the description of a pull request** |
1 | 1 | |
2 | This example demonstrates how to change the description of a pull request with the ID of '47':: | |
2 | This example demonstrates how to change the description of a pull request with the ID of ``47``. :: | |
3 | 3 | |
4 | aws codecommit update-pull-request-description --pull-request-id 47 --description "Updated the pull request to remove unused global variable." | |
4 | aws codecommit update-pull-request-description \ | |
5 | --pull-request-id 47 \ | |
6 | --description "Updated the pull request to remove unused global variable." | |
5 | 7 | |
6 | 8 | Output:: |
7 | 9 | |
8 | { | |
9 | "pullRequest": { | |
10 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
11 | "clientRequestToken": "", | |
12 | "creationDate": 1508530823.155, | |
13 | "description": "Updated the pull request to remove unused global variable.", | |
14 | "lastActivityDate": 1508372423.204, | |
15 | "pullRequestId": "47", | |
16 | "pullRequestStatus": "OPEN", | |
17 | "pullRequestTargets": [ | |
18 | { | |
19 | "destinationCommit": "9f31c968EXAMPLE", | |
20 | "destinationReference": "refs/heads/master", | |
21 | "mergeMetadata": { | |
22 | "isMerged": false, | |
23 | }, | |
24 | "repositoryName": "MyDemoRepo", | |
25 | "sourceCommit": "99132ab0EXAMPLE", | |
26 | "sourceReference": "refs/heads/variables-branch" | |
27 | } | |
28 | ], | |
29 | "title": "Consolidation of global variables" | |
10 | { | |
11 | "pullRequest": { | |
12 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
13 | "clientRequestToken": "", | |
14 | "creationDate": 1508530823.155, | |
15 | "description": "Updated the pull request to remove unused global variable.", | |
16 | "lastActivityDate": 1508372423.204, | |
17 | "pullRequestId": "47", | |
18 | "pullRequestStatus": "OPEN", | |
19 | "pullRequestTargets": [ | |
20 | { | |
21 | "destinationCommit": "9f31c968EXAMPLE", | |
22 | "destinationReference": "refs/heads/main", | |
23 | "mergeMetadata": { | |
24 | "isMerged": false, | |
25 | }, | |
26 | "repositoryName": "MyDemoRepo", | |
27 | "sourceCommit": "99132ab0EXAMPLE", | |
28 | "sourceReference": "refs/heads/variables-branch" | |
29 | } | |
30 | ], | |
31 | "title": "Consolidation of global variables" | |
32 | } | |
30 | 33 | } |
31 | } |
0 | 0 | **To change the status of a pull request** |
1 | 1 | |
2 | This example demonstrates how to to change the status of a pull request with the ID of '42' to a status of 'CLOSED' in an AWS CodeCommit repository named 'MyDemoRepo':: | |
2 | This example demonstrates how to to change the status of a pull request with the ID of ``42`` to a status of ``CLOSED`` in an AWS CodeCommit repository named ``MyDemoRepo``. :: | |
3 | 3 | |
4 | aws codecommit update-pull-request-status --pull-request-id 42 --pull-request-status CLOSED | |
4 | aws codecommit update-pull-request-status \ | |
5 | --pull-request-id 42 \ | |
6 | --pull-request-status CLOSED | |
5 | 7 | |
6 | 8 | Output:: |
7 | 9 | |
8 | { | |
9 | "pullRequest": { | |
10 | "authorArn": "arn:aws:iam::111111111111:user/Jane_Doe", | |
11 | "clientRequestToken": "123Example", | |
12 | "creationDate": 1508962823.165, | |
13 | "description": "A code review of the new feature I just added to the service.", | |
14 | "lastActivityDate": 1508442444.12, | |
15 | "pullRequestId": "42", | |
16 | "pullRequestStatus": "CLOSED", | |
17 | "pullRequestTargets": [ | |
18 | { | |
19 | "destinationCommit": "5d036259EXAMPLE", | |
20 | "destinationReference": "refs/heads/master", | |
21 | "mergeMetadata": { | |
22 | "isMerged": false, | |
23 | }, | |
24 | "repositoryName": "MyDemoRepo", | |
25 | "sourceCommit": "317f8570EXAMPLE", | |
26 | "sourceReference": "refs/heads/jane-branch" | |
27 | } | |
28 | ], | |
29 | "title": "Pronunciation difficulty analyzer" | |
10 | { | |
11 | "pullRequest": { | |
12 | "approvalRules": [ | |
13 | { | |
14 | "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
15 | "approvalRuleId": "dd8b17fe-EXAMPLE", | |
16 | "approvalRuleName": "2-approvers-needed-for-this-change", | |
17 | "creationDate": 1571356106.936, | |
18 | "lastModifiedDate": 571356106.936, | |
19 | "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major", | |
20 | "ruleContentSha256": "4711b576EXAMPLE" | |
21 | } | |
22 | ], | |
23 | "authorArn": "arn:aws:iam::123456789012:user/Li_Juan", | |
24 | "clientRequestToken": "", | |
25 | "creationDate": 1508530823.165, | |
26 | "description": "Updated the pull request to remove unused global variable.", | |
27 | "lastActivityDate": 1508372423.12, | |
28 | "pullRequestId": "47", | |
29 | "pullRequestStatus": "CLOSED", | |
30 | "pullRequestTargets": [ | |
31 | { | |
32 | "destinationCommit": "9f31c968EXAMPLE", | |
33 | "destinationReference": "refs/heads/main", | |
34 | "mergeMetadata": { | |
35 | "isMerged": false, | |
36 | }, | |
37 | "repositoryName": "MyDemoRepo", | |
38 | "sourceCommit": "99132ab0EXAMPLE", | |
39 | "sourceReference": "refs/heads/variables-branch" | |
40 | } | |
41 | ], | |
42 | "title": "Consolidation of global variables" | |
43 | } | |
30 | 44 | } |
31 | } |
0 | 0 | **To change the title of a pull request** |
1 | 1 | |
2 | This example demonstrates how to change the title of a pull request with the ID of '47':: | |
2 | This example demonstrates how to change the title of a pull request with the ID of ``47``. :: | |
3 | 3 | |
4 | aws codecommit update-pull-request-title --pull-request-id 47 --title "Consolidation of global variables - updated review" | |
4 | aws codecommit update-pull-request-title \ | |
5 | --pull-request-id 47 \ | |
6 | --title "Consolidation of global variables - updated review" | |
5 | 7 | |
6 | 8 | Output:: |
7 | 9 | |
8 | { | |
9 | "pullRequest": { | |
10 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
11 | "clientRequestToken": "", | |
12 | "creationDate": 1508530823.12, | |
13 | "description": "Review the latest changes and updates to the global variables. I have updated this request with some changes, including removing some unused variables.", | |
14 | "lastActivityDate": 1508372657.188, | |
15 | "pullRequestId": "47", | |
16 | "pullRequestStatus": "OPEN", | |
17 | "pullRequestTargets": [ | |
18 | { | |
19 | "destinationCommit": "9f31c968EXAMPLE", | |
20 | "destinationReference": "refs/heads/master", | |
21 | "mergeMetadata": { | |
22 | "isMerged": false, | |
23 | }, | |
24 | "repositoryName": "MyDemoRepo", | |
25 | "sourceCommit": "99132ab0EXAMPLE", | |
26 | "sourceReference": "refs/heads/variables-branch" | |
27 | } | |
28 | ], | |
29 | "title": "Consolidation of global variables - updated review" | |
10 | { | |
11 | "pullRequest": { | |
12 | "approvalRules": [ | |
13 | { | |
14 | "approvalRuleContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}", | |
15 | "approvalRuleId": "dd8b17fe-EXAMPLE", | |
16 | "approvalRuleName": "2-approver-rule-for-main", | |
17 | "creationDate": 1571356106.936, | |
18 | "lastModifiedDate": 571356106.936, | |
19 | "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major", | |
20 | "originApprovalRuleTemplate": { | |
21 | "approvalRuleTemplateId": "dd8b26gr-EXAMPLE", | |
22 | "approvalRuleTemplateName": "2-approver-rule-for-main" | |
23 | }, | |
24 | "ruleContentSha256": "4711b576EXAMPLE" | |
25 | } | |
26 | ], | |
27 | "authorArn": "arn:aws:iam::123456789012:user/Li_Juan", | |
28 | "clientRequestToken": "", | |
29 | "creationDate": 1508530823.12, | |
30 | "description": "Review the latest changes and updates to the global variables. I have updated this request with some changes, including removing some unused variables.", | |
31 | "lastActivityDate": 1508372657.188, | |
32 | "pullRequestId": "47", | |
33 | "pullRequestStatus": "OPEN", | |
34 | "pullRequestTargets": [ | |
35 | { | |
36 | "destinationCommit": "9f31c968EXAMPLE", | |
37 | "destinationReference": "refs/heads/main", | |
38 | "mergeMetadata": { | |
39 | "isMerged": false, | |
40 | }, | |
41 | "repositoryName": "MyDemoRepo", | |
42 | "sourceCommit": "99132ab0EXAMPLE", | |
43 | "sourceReference": "refs/heads/variables-branch" | |
44 | } | |
45 | ], | |
46 | "title": "Consolidation of global variables - updated review" | |
47 | } | |
30 | 48 | } |
31 | } |
0 | **To create a code review.** | |
1 | ||
2 | The following ``create-code-review`` creates a review of code in the ``mainline`` branch of an AWS CodeCommit repository that is named ``my-repository-name``. :: | |
3 | ||
4 | aws codeguru-reviewer create-code-review \ | |
5 | --name my-code-review \ | |
6 | --repository-association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \ | |
7 | --type '{"RepositoryAnalysis": {"RepositoryHead": {"BranchName": "mainline"}}}' | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "CodeReview": { | |
13 | "Name": "my-code-review", | |
14 | "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222:code-review:RepositoryAnalysis-my-code-review", | |
15 | "RepositoryName": "my-repository-name", | |
16 | "Owner": "123456789012", | |
17 | "ProviderType": "CodeCommit", | |
18 | "State": "Pending", | |
19 | "StateReason": "CodeGuru Reviewer has received the request, and a code review is scheduled.", | |
20 | "CreatedTimeStamp": 1618873489.195, | |
21 | "LastUpdatedTimeStamp": 1618873489.195, | |
22 | "Type": "RepositoryAnalysis", | |
23 | "SourceCodeType": { | |
24 | "RepositoryHead": { | |
25 | "BranchName": "mainline" | |
26 | } | |
27 | }, | |
28 | "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" | |
29 | } | |
30 | } | |
31 | ||
32 | For more information, see `CreateCodeReview<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CreateCodeReview.html>`__ in the *Amazon CodeGuru Reviewer API Reference* |
0 | **List details about a code review.** | |
1 | ||
2 | The following ``describe-code-review`` lists information about a review of code in the "mainline" branch of an AWS CodeCommit repository that is named "my-repo-name". :: | |
3 | ||
4 | aws codeguru-reviewer put-recommendation-feedback \ | |
5 | --code-review-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678 \ | |
6 | --recommendation-id 3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb \ | |
7 | --reactions ThumbsUp | |
8 | ||
9 | Output :: | |
10 | ||
11 | { | |
12 | "CodeReview": { | |
13 | "Name": "My-ecs-beta-repo-master-xs6di4kfd4j269dz", | |
14 | "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE22222:code-review:RepositoryAnalysis-my-repo-name", | |
15 | "RepositoryName": "My-ecs-beta-repo", | |
16 | "Owner": "123456789012", | |
17 | "ProviderType": "CodeCommit", | |
18 | "State": "Pending", | |
19 | "StateReason": "CodeGuru Reviewer is reviewing the source code.", | |
20 | "CreatedTimeStamp": 1618874226.226, | |
21 | "LastUpdatedTimeStamp": 1618874233.689, | |
22 | "Type": "RepositoryAnalysis", | |
23 | "SourceCodeType": { | |
24 | "RepositoryHead": { | |
25 | "BranchName": "mainline" | |
26 | } | |
27 | }, | |
28 | "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111" | |
29 | } | |
30 | } | |
31 | ||
32 | For more information, see `DescribeCodeReview<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeCodeReview.html>`__ in the *Amazon CodeGuru Reviewer API Reference* |
0 | **To view information about feedback on a recommendation** | |
1 | ||
2 | The following ``describe-recommendation-feedback`` displays information about feedback on a recommendation. This recommendation has one ``ThumbsUp`` reaction. :: | |
3 | ||
4 | aws codeguru-reviewer describe-recommendation-feedback \ | |
5 | --code-review-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678 \ | |
6 | --recommendation-id 3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "RecommendationFeedback": { | |
12 | "CodeReviewArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678", | |
13 | "RecommendationId": "3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb", | |
14 | "Reactions": [ | |
15 | "ThumbsUp" | |
16 | ], | |
17 | "UserId": "aws-user-id", | |
18 | "CreatedTimeStamp": 1618877070.313, | |
19 | "LastUpdatedTimeStamp": 1618877948.881 | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `DescribeRecommendationFeedback <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DescribeRecommendationFeedback.html>`__ in the *Amazon CodeGuru Reviewer API Reference*.⏎ |
0 | **To disassociate a repository association** | |
1 | ||
2 | The following ``disassociate-repository`` disassociates a repository association that is using an AWS CodeCommit repository. :: | |
3 | ||
4 | aws codeguru-reviewer disassociate-repository \ | |
5 | --association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "RepositoryAssociation": { | |
11 | "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", | |
12 | "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", | |
13 | "Name": "my-repository", | |
14 | "Owner": "123456789012", | |
15 | "ProviderType": "CodeCommit", | |
16 | "State": "Disassociating", | |
17 | "LastUpdatedTimeStamp": 1618939174.759, | |
18 | "CreatedTimeStamp": 1595636947.096 | |
19 | }, | |
20 | "Tags": { | |
21 | "Status": "Secret", | |
22 | "Team": "Saanvi" | |
23 | } | |
24 | } | |
25 | ||
26 | For more information, see `DisassociateRepository <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_DisassociateRepository.html>`__ in the *Amazon CodeGuru Reviewer API Reference*.⏎ |
0 | **To list customer recommendation feedback for a recommendation on an associated repository.** | |
1 | ||
2 | The following ``list-recommendation-feedback`` Lists customer feedback on all recommendations on a code review. This code review has one piece of feedback, a "ThumbsUp", from a customer. :: | |
3 | ||
4 | aws codeguru-reviewer list-recommendation-feedback \ | |
5 | --code-review-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "RecommendationFeedbackSummaries": [ | |
11 | { | |
12 | "RecommendationId": "3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb", | |
13 | "Reactions": [ | |
14 | "ThumbsUp" | |
15 | ], | |
16 | "UserId": "aws-user-id" | |
17 | } | |
18 | ] | |
19 | } | |
20 | ||
21 | For more information, see `ListRecommendationFeedback <https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRecommendationFeedback.html>`__ in the *Amazon CodeGuru Reviewer API Reference*.⏎ |
0 | **To list the tags on an associated repository** | |
1 | ||
2 | The following ``list-tags-for-resource`` lists the tags on an associated repository. This associated repository has two tags. :: | |
3 | ||
4 | aws codeguru-reviewer list-tags-for-resource \ | |
5 | --resource-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Tags": { | |
11 | "Status": "Secret", | |
12 | "Team": "Saanvi" | |
13 | } | |
14 | } | |
15 | ||
16 | For more information, see `ListTagsForResource<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListTagsForResource.html>`__ in the *Amazon CodeGuru Reviewer API Reference*.⏎ |
0 | **To add a recommendation to a code review** | |
1 | ||
2 | The following ``put-recommendation-feedback`` puts a ``ThumbsUp`` recommendation on a code review. :: | |
3 | ||
4 | aws codeguru-reviewer put-recommendation-feedback \ | |
5 | --code-review-arn \arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111:code-review:RepositoryAnalysis-my-repository-name-branch-abcdefgh12345678 \ | |
6 | --recommendation-id 3be1b2e5d7ef6e298a06499379ee290c9c596cf688fdcadb08285ddb0dd390eb \ | |
7 | --reactions ThumbsUp | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `PutRecommendationFeedback<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_PutRecommendationFeedback.html>`__ in the *Amazon CodeGuru Reviewer API Reference* |
0 | **To add a tag to an associated repository** | |
1 | ||
2 | The following ``tag-resource`` adds two tags to an associated repository :: | |
3 | ||
4 | aws codeguru-reviewer tag-resource \ | |
5 | --resource-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \ | |
6 | --tags Status=Secret,Team=Saanvi | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `TagResource<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_TagResource.html>`__ in the *Amazon CodeGuru Reviewer API Reference*⏎ |
0 | **To untag an associated repository** | |
1 | ||
2 | The following ``untag-resource`` removes two tags with keys "Secret" and "Team" from an associated repository. :: | |
3 | ||
4 | aws codeguru-reviewer untag-resource \ | |
5 | --resource-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 \ | |
6 | --tag-keys Status Team | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `UntagResource<https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_UntagResource.html>`__ in the *Amazon CodeGuru Reviewer API Reference*.⏎ |
0 | 0 | **To enable Amazon Detective and create a new behavior graph** |
1 | 1 | |
2 | The following ``create-graph`` example enables Detective for the AWS account that runs the command in the Region where the command is run. A new behavior graph is created that has that account as its administrator account. :: | |
2 | The following ``create-graph`` example enables Detective for the AWS account that runs the command in the Region where the command is run. A new behavior graph is created that has that account as its administrator account. The command also assigns the value Finance to the Department tag. :: | |
3 | 3 | |
4 | aws detective create-graph | |
4 | aws detective create-graph \ | |
5 | --tags '{"Department": "Finance"}' | |
5 | 6 | |
6 | 7 | Output:: |
7 | 8 |
0 | 0 | **To list the member accounts in a behavior graph** |
1 | 1 | |
2 | The following ``list-members`` example retrieves the invited and enabled member accounts for the behavior graph arn:aws:detective:us-east-1:111122223333:graph:123412341234. The results do not include member accounts that were removed. :: | |
2 | The following ``list-members`` example retrieves the invited and enabled member accounts for the behavior graph ``arn:aws:detective:us-east-1:111122223333:graph:123412341234``. The results do not include member accounts that were removed. :: | |
3 | 3 | |
4 | 4 | aws detective list-members \ |
5 | 5 | --graph-arn arn:aws:detective:us-east-1:111122223333:graph:123412341234 |
7 | 7 | Output:: |
8 | 8 | |
9 | 9 | { |
10 | "MemberDetails": [ | |
11 | { | |
12 | "AccountId": "444455556666", | |
13 | "AdministratorId": "111122223333", | |
14 | "EmailAddress": "mmajor@example.com", | |
15 | "GraphArn": "arn:aws:detective:us-east-1:111122223333:graph:123412341234", | |
16 | "InvitedTime": 1579826107000, | |
17 | "MasterId": "111122223333", | |
18 | "Status": "INVITED", | |
19 | "UpdatedTime": 1579826107000 | |
20 | }, | |
21 | { | |
22 | "AccountId": "123456789012", | |
23 | "AdministratorId": "111122223333", | |
24 | "EmailAddress": "jstiles@example.com", | |
25 | "GraphArn": "arn:aws:detective:us-east-1:111122223333:graph:123412341234", | |
26 | "InvitedTime": 1579826107000, | |
27 | "MasterId": "111122223333", | |
28 | "Status": "ENABLED", | |
29 | "UpdatedTime": 1579973711000 | |
30 | } | |
10 | "MemberDetails": [ | |
11 | { | |
12 | "AccountId": "444455556666", | |
13 | "AdministratorId": "111122223333", | |
14 | "EmailAddress": "mmajor@example.com", | |
15 | "GraphArn": "arn:aws:detective:us-east-1:111122223333:graph:123412341234", | |
16 | "InvitedTime": 1579826107000, | |
17 | "MasterId": "111122223333", | |
18 | "Status": "INVITED", | |
19 | "UpdatedTime": 1579826107000 | |
20 | }, | |
21 | { | |
22 | "AccountId": "123456789012", | |
23 | "AdministratorId": "111122223333", | |
24 | "EmailAddress": "jstiles@example.com", | |
25 | "GraphArn": "arn:aws:detective:us-east-1:111122223333:graph:123412341234", | |
26 | "InvitedTime": 1579826107000, | |
27 | "MasterId": "111122223333", | |
28 | "PercentOfGraphUtilization": 2, | |
29 | "PercentOfGraphUtilizationUpdatedTime": 1586287843, | |
30 | "Status": "ENABLED", | |
31 | "UpdatedTime": 1579973711000, | |
32 | "VolumeUsageInBytes": 200, | |
33 | "VolumeUsageUpdatedTime": 1586287843 | |
34 | } | |
31 | 35 | ] |
32 | 36 | } |
33 | 37 | |
34 | For more information, see `Viewing the list of accounts in a behavior graph<https://docs.aws.amazon.com/detective/latest/adminguide/graph-admin-view-accounts.html>`__ in the *Amazon Detective Administration Guide*.⏎ | |
38 | For more information, see `Viewing the list of accounts in a behavior graph <https://docs.aws.amazon.com/detective/latest/adminguide/graph-admin-view-accounts.html>`__ in the *Amazon Detective Administration Guide*.⏎ |
0 | **To retrieve the tags assigned to a behavior graph** | |
1 | ||
2 | The following ``list-tags-for-resource`` example returns the tags assigned to the specified behavior graph. :: | |
3 | ||
4 | aws detective list-tags-for-resource \ | |
5 | --resource-arn arn:aws:detective:us-east-1:111122223333:graph:123412341234 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Tags": { | |
11 | "Department" : "Finance" | |
12 | } | |
13 | } | |
14 | ||
15 | For more information, see `Managing tags for a behavior graph <https://docs.aws.amazon.com/detective/latest/adminguide/graph-tags.html>`__ in the *Amazon Detective Administration Guide*.⏎ |
0 | **To assign a tag to a resource** | |
1 | ||
2 | The following ``tag-resource`` example assigns a value for the Department tag to the specified behavior graph. :: | |
3 | ||
4 | aws detective tag-resource \ | |
5 | --resource-arn arn:aws:detective:us-east-1:111122223333:graph:123412341234 \ | |
6 | --tags '{"Department":"Finance"}' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Managing tags for a behavior graph <https://docs.aws.amazon.com/detective/latest/adminguide/graph-tags.html>`__ in the *Amazon Detective Administration Guide*.⏎ |
0 | **To remove a tag value from a resource** | |
1 | ||
2 | The following ``untag-resource`` example removes the Department tag from the specified behavior graph. :: | |
3 | ||
4 | aws detective untag-resource \ | |
5 | --resource-arn arn:aws:detective:us-east-1:111122223333:graph:123412341234 \ | |
6 | --tag-keys "Department" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Managing tags for a behavior graph <https://docs.aws.amazon.com/detective/latest/adminguide/graph-tags.html>`__ in the *Amazon Detective Administration Guide*.⏎ |
72 | 72 | "VpcSecurityGroupId": "sg-77186e0d" |
73 | 73 | } |
74 | 74 | ], |
75 | "AutoMinorVersionUpgrade": true, | |
76 | 75 | "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster-instance-2", |
77 | 76 | "DbiResourceId": "db-XEKJLEMGRV5ZKCARUVA4HO3ITE" |
78 | 77 | } |
79 | 78 | } |
80 | 79 | |
81 | ||
82 | For more information, see `Adding an Amazon DocumentDB Instance to a Cluster <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-add.html>`__ in the *Amazon DocumentDB Developer Guide*. | |
80 | For more information, see `Adding an Amazon DocumentDB Instance to a Cluster <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-add.html>`__ in the *Amazon DocumentDB Developer Guide*.⏎ |
162 | 162 | |
163 | 163 | **Example 5: To query an index** |
164 | 164 | |
165 | The following example queries the local secondary index ``AlbumTitleIndex``. The query returns all attributes from the base table that have been projected into the local secondary index. Note that when querying a local secondary index or global secondary index, you must also provide the name of the base table using the ``table-name`` parameter. | |
165 | The following example queries the local secondary index ``AlbumTitleIndex``. The query returns all attributes from the base table that have been projected into the local secondary index. Note that when querying a local secondary index or global secondary index, you must also provide the name of the base table using the ``table-name`` parameter. :: | |
166 | 166 | |
167 | 167 | aws dynamodb query \ |
168 | 168 | --table-name MusicCollection \ |
72 | 72 | |
73 | 73 | **Example 2: To update an item conditionally** |
74 | 74 | |
75 | The following example updates an item in the ``MusicCollection`` table, but only if the existing item does not already have a ``Year`` attribute. | |
75 | The following example updates an item in the ``MusicCollection`` table, but only if the existing item does not already have a ``Year`` attribute. :: | |
76 | 76 | |
77 | 77 | aws dynamodb update-item \ |
78 | 78 | --table-name MusicCollection \ |
103 | 103 | ":t":{"S": "Louder Than Ever"} |
104 | 104 | } |
105 | 105 | |
106 | If the item already has a ``Year`` attribute, DynamoDB returns the following output:: | |
106 | If the item already has a ``Year`` attribute, DynamoDB returns the following output. :: | |
107 | 107 | |
108 | 108 | An error occurred (ConditionalCheckFailedException) when calling the UpdateItem operation: The conditional request failed |
109 | 109 |
21 | 21 | --source-region us-west-2 \ |
22 | 22 | --source-snapshot-id snap-066877671789bd71b \ |
23 | 23 | --encrypted \ |
24 | --kmd-key-id alias/my-cmk | |
24 | --kms-key-id alias/my-cmk |
0 | **To create a transit gateway Connect attachment** | |
1 | ||
2 | The following "create-transit-gateway-connect" example creates a Connect attachment for the specified attachment with the "gre" protocol. :: | |
3 | ||
4 | aws ec2 create-transit-gateway-connect \ | |
5 | --transport-transit-gateway-attachment-id tgw-attach-0a89069f57EXAMPLE \ | |
6 | --options "Protocol=gre" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "TransitGatewayConnect": { | |
12 | "TransitGatewayAttachmentId": "tgw-attach-037012e5dcEXAMPLE", | |
13 | "TransportTransitGatewayAttachmentId": "tgw-attach-0a89069f57EXAMPLE", | |
14 | "TransitGatewayId": "tgw-02f776b1a7EXAMPLE", | |
15 | "State": "pending", | |
16 | "CreationTime": "2021-03-09T19:59:17+00:00", | |
17 | "Options": { | |
18 | "Protocol": "gre" | |
19 | } | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Transit gateway Connect attachments and Connect peers <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-connect.html>`__ in the *User Guide for AWSPrivateLink*.⏎ |
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
25 | For more information, see `Creating a gateway endpoint <https://docs.aws.amazon.com/vpc/latest/userguide/vpce-gateway.html#create-gateway-endpoint>`__ in the *Amazon VPC User Guide*. | |
25 | For more information, see `Creating a gateway endpoint <https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-gateway.html#create-gateway-endpoint>`__ in the *AWSPrivateLink Guide*. | |
26 | 26 | |
27 | 27 | **Example 2: To create an interface endpoint** |
28 | 28 | |
29 | The following ``create-vpc-endpoint`` example creates an interface VPC endpoint between VPC ``vpc-1a2b3c4d`` and Elastic Load Balancing in the ``us-east-1`` region. The command creates the endpoint in subnet ``subnet-7b16de0c`` and associates it with security group ``sg-1a2b3c4d``. :: | |
29 | The following ``create-vpc-endpoint`` example creates an interface VPC endpoint between VPC ``vpc-1a2b3c4d`` and Amazon S3 in the ``us-east-1`` region. The command creates the endpoint in subnet ``subnet-1a2b3c4d``, associates it with security group ``sg-1a2b3c4d``, and adds a tag with a key of "Service" and a Value of "S3". :: | |
30 | 30 | |
31 | 31 | aws ec2 create-vpc-endpoint \ |
32 | 32 | --vpc-id vpc-1a2b3c4d \ |
33 | 33 | --vpc-endpoint-type Interface \ |
34 | --service-name com.amazonaws.us-east-1.elasticloadbalancing \ | |
34 | --service-name com.amazonaws.us-east-1.s3 \ | |
35 | 35 | --subnet-id subnet-7b16de0c \ |
36 | --security-group-id sg-1a2b3c4d | |
36 | --security-group-id sg-1a2b3c4d \ | |
37 | --tag-specifications ResourceType=vpc-endpoint,Tags=[{Key=service,Value=S3}] | |
37 | 38 | |
38 | 39 | Output:: |
39 | 40 | |
40 | 41 | { |
41 | 42 | "VpcEndpoint": { |
42 | "PolicyDocument": "{\n \"Statement\": [\n {\n \"Action\": \"\*\", \n \"Effect\": \"Allow\", \n \"Principal\": \"\*\", \n \"Resource\": \"\*\"\n }\n ]\n}", | |
43 | "VpcEndpointId": "vpce-1a2b3c4d5e6f1a2b3", | |
44 | "VpcEndpointType": "Interface", | |
43 | 45 | "VpcId": "vpc-1a2b3c4d", |
44 | "NetworkInterfaceIds": [ | |
45 | "eni-bf8aa46b" | |
46 | "ServiceName": "com.amazonaws.us-east-1.s3", | |
47 | "State": "pending", | |
48 | "RouteTableIds": [], | |
49 | "SubnetIds": [ | |
50 | "subnet-1a2b3c4d" | |
46 | 51 | ], |
47 | "SubnetIds": [ | |
48 | "subnet-7b16de0c" | |
49 | ], | |
50 | "PrivateDnsEnabled": true, | |
51 | "State": "pending", | |
52 | "ServiceName": "com.amazonaws.us-east-1.elasticloadbalancing", | |
53 | "RouteTableIds": [], | |
54 | 52 | "Groups": [ |
55 | 53 | { |
56 | "GroupName": "default", | |
57 | "GroupId": "sg-1a2b3c4d" | |
54 | "GroupId": "sg-1a2b3c4d", | |
55 | "GroupName": "default" | |
58 | 56 | } |
59 | 57 | ], |
60 | "VpcEndpointId": "vpce-088d25a4bbEXAMPLE", | |
61 | "VpcEndpointType": "Interface", | |
62 | "CreationTimestamp": "2017-09-05T20:14:41.240Z", | |
58 | "PrivateDnsEnabled": false, | |
59 | "RequesterManaged": false, | |
60 | "NetworkInterfaceIds": [ | |
61 | "eni-0b16f0581c8ac6877" | |
62 | ], | |
63 | 63 | "DnsEntries": [ |
64 | 64 | { |
65 | "HostedZoneId": "Z7HUB22UULQXV", | |
66 | "DnsName": "vpce-088d25a4bbf4a7e66-ks83awe7.elasticloadbalancing.us-east-1.vpce.amazonaws.com" | |
65 | "DnsName": "*.vpce-1a2b3c4d5e6f1a2b3-9hnenorg.s3.us-east-1.vpce.amazonaws.com", | |
66 | "HostedZoneId": "Z7HUB22UULQXV" | |
67 | 67 | }, |
68 | 68 | { |
69 | "HostedZoneId": "Z7HUB22UULQXV", | |
70 | "DnsName": "vpce-088d25a4bbf4a7e66-ks83awe7-us-east-1a.elasticloadbalancing.us-east-1.vpce.amazonaws.com" | |
71 | }, | |
69 | "DnsName": "*.vpce-1a2b3c4d5e6f1a2b3-9hnenorg-us-east-1c.s3.us-east-1.vpce.amazonaws.com", | |
70 | "HostedZoneId": "Z7HUB22UULQXV" | |
71 | } | |
72 | ], | |
73 | "CreationTimestamp": "2021-03-05T14:46:16.030000+00:00", | |
74 | "Tags": [ | |
72 | 75 | { |
73 | "HostedZoneId": "Z1K56Z6FNPJRR", | |
74 | "DnsName": "elasticloadbalancing.us-east-1.amazonaws.com" | |
76 | "Key": "service", | |
77 | "Value": "S3" | |
75 | 78 | } |
76 | 79 | ], |
77 | 80 | "OwnerId": "123456789012" |
78 | 81 | } |
79 | 82 | } |
80 | 83 | |
81 | For more information, see `Creating an interface endpoint <https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#create-interface-endpoint>`__ in the *Amazon VPC User Guide*. | |
84 | For more information, see `Creating an interface endpoint <https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#create-interface-endpoint>`__ in the *User Guide for AWSPrivateLink*. | |
82 | 85 | |
83 | 86 | **Example 3: To create a Gateway Load Balancer endpoint** |
84 | 87 | |
111 | 114 | } |
112 | 115 | } |
113 | 116 | |
114 | For more information, see `Gateway Load Balancer endpoints <https://docs.aws.amazon.com/vpc/latest/userguide/vpce-gateway-load-balancer.html>`__ in the *Amazon VPC User Guide*. | |
117 | For more information, see `Gateway Load Balancer endpoints <https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-gateway-load-balancer.html>`__ in the *User Guide for AWSPrivateLink*.⏎ |
0 | **To delete your carrier gateway** | |
1 | ||
2 | The following ``delete-carrier-gateway`` example deletes the specified carrier gateway. :: | |
3 | ||
4 | aws ec2 delete-carrier-gateway \ | |
5 | --carrier-gateway-id cagw-0465cdEXAMPLE1111 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "CarrierGateway": { | |
11 | "CarrierGatewayId": "cagw-0465cdEXAMPLE1111", | |
12 | "VpcId": "vpc-0c529aEXAMPLE1111", | |
13 | "State": "deleting", | |
14 | "OwnerId": "123456789012" | |
15 | } | |
16 | } | |
17 | ||
18 | For more information, see `Carrier gateways <https://docs.aws.amazon.com/vpc/latest/userguide/Carrier_Gateway.html>`__ in the *Amazon Virtual Private Cloud | |
19 | User Guide*.⏎ |
47 | 47 | The following ``describe-capacity-reservations`` example displays details about the specified capacity reservation. :: |
48 | 48 | |
49 | 49 | aws ec2 describe-capacity-reservations \ |
50 | --capacity-reserveration-id cr-1234abcd56EXAMPLE | |
50 | --capacity-reservation-id cr-1234abcd56EXAMPLE | |
51 | 51 | |
52 | 52 | Output:: |
53 | 53 | |
72 | 72 | ] |
73 | 73 | } |
74 | 74 | |
75 | For more information, see `Viewing a Capacity Reservation <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-view>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. | |
75 | For more information, see `Viewing a Capacity Reservation <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-view>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*.⏎ |
0 | **To describe all carrier gateways** | |
1 | ||
2 | The following ``describe-carrier-gateways`` example lists all your carrier gateways. :: | |
3 | ||
4 | aws ec2 describe-carrier-gateways | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "CarrierGateways": [ | |
10 | { | |
11 | "CarrierGatewayId": "cagw-0465cdEXAMPLE1111", | |
12 | "VpcId": "vpc-0c529aEXAMPLE", | |
13 | "State": "available", | |
14 | "OwnerId": "123456789012", | |
15 | "Tags": [ | |
16 | { | |
17 | ||
18 | "Key": "example", | |
19 | "Value": "tag" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ] | |
24 | } | |
25 | ||
26 | For more information, see `Carrier gateways<https://docs.aws.amazon.com/vpc/latest/userguide/Carrier_Gateway.html>`__ in the *Amazon Virtual Private Cloud | |
27 | User Guide*.⏎ |
7 | 7 | Output:: |
8 | 8 | |
9 | 9 | { |
10 | "Instances": [ | |
10 | "Reservations": [ | |
11 | 11 | { |
12 | "AmiLaunchIndex": 0, | |
13 | "ImageId": "ami-0abcdef1234567890, | |
14 | "InstanceId": "i-1234567890abcdef0, | |
15 | "InstanceType": "t2.micro", | |
16 | "KeyName": "MyKeyPair", | |
17 | "LaunchTime": "2018-05-10T08:05:20.000Z", | |
18 | "Monitoring": { | |
19 | "State": "disabled" | |
20 | }, | |
21 | "Placement": { | |
22 | "AvailabilityZone": "us-east-2a", | |
23 | "GroupName": "", | |
24 | "Tenancy": "default" | |
25 | }, | |
26 | "PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal", | |
27 | "PrivateIpAddress": "10.0.0.157", | |
28 | "ProductCodes": [], | |
29 | "PublicDnsName": "", | |
30 | "State": { | |
31 | "Code": 0, | |
32 | "Name": "pending" | |
33 | }, | |
34 | "StateTransitionReason": "", | |
35 | "SubnetId": "subnet-04a636d18e83cfacb", | |
36 | "VpcId": "vpc-1234567890abcdef0", | |
37 | "Architecture": "x86_64", | |
38 | "BlockDeviceMappings": [], | |
39 | "ClientToken": "", | |
40 | "EbsOptimized": false, | |
41 | "Hypervisor": "xen", | |
42 | "NetworkInterfaces": [ | |
12 | "Groups": [], | |
13 | "Instances": [ | |
43 | 14 | { |
44 | "Attachment": { | |
45 | "AttachTime": "2018-05-10T08:05:20.000Z", | |
46 | "AttachmentId": "eni-attach-0e325c07e928a0405", | |
47 | "DeleteOnTermination": true, | |
48 | "DeviceIndex": 0, | |
49 | "Status": "attaching" | |
50 | }, | |
51 | "Description": "", | |
52 | "Groups": [ | |
53 | { | |
54 | "GroupName": "MySecurityGroup", | |
55 | "GroupId": "sg-0598c7d356eba48d7" | |
56 | } | |
57 | ], | |
58 | "Ipv6Addresses": [], | |
59 | "MacAddress": "0a:ab:58:e0:67:e2", | |
60 | "NetworkInterfaceId": "eni-0c0a29997760baee7", | |
61 | "OwnerId": "123456789012", | |
62 | "PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal", | |
63 | "PrivateIpAddress": "10.0.0.157" | |
64 | "PrivateIpAddresses": [ | |
65 | { | |
66 | "Primary": true, | |
67 | "PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal", | |
68 | "PrivateIpAddress": "10.0.0.157" | |
69 | } | |
70 | ], | |
71 | "SourceDestCheck": true, | |
72 | "Status": "in-use", | |
73 | "SubnetId": "subnet-04a636d18e83cfacb", | |
74 | "VpcId": "vpc-1234567890abcdef0", | |
75 | "InterfaceType": "interface" | |
15 | "AmiLaunchIndex": 0, | |
16 | "ImageId": "ami-0abcdef1234567890, | |
17 | "InstanceId": "i-1234567890abcdef0, | |
18 | "InstanceType": "t2.micro", | |
19 | "KeyName": "MyKeyPair", | |
20 | "LaunchTime": "2018-05-10T08:05:20.000Z", | |
21 | "Monitoring": { | |
22 | "State": "disabled" | |
23 | }, | |
24 | "Placement": { | |
25 | "AvailabilityZone": "us-east-2a", | |
26 | "GroupName": "", | |
27 | "Tenancy": "default" | |
28 | }, | |
29 | "PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal", | |
30 | "PrivateIpAddress": "10.0.0.157", | |
31 | "ProductCodes": [], | |
32 | "PublicDnsName": "", | |
33 | "State": { | |
34 | "Code": 0, | |
35 | "Name": "pending" | |
36 | }, | |
37 | "StateTransitionReason": "", | |
38 | "SubnetId": "subnet-04a636d18e83cfacb", | |
39 | "VpcId": "vpc-1234567890abcdef0", | |
40 | "Architecture": "x86_64", | |
41 | "BlockDeviceMappings": [], | |
42 | "ClientToken": "", | |
43 | "EbsOptimized": false, | |
44 | "Hypervisor": "xen", | |
45 | "NetworkInterfaces": [ | |
46 | { | |
47 | "Attachment": { | |
48 | "AttachTime": "2018-05-10T08:05:20.000Z", | |
49 | "AttachmentId": "eni-attach-0e325c07e928a0405", | |
50 | "DeleteOnTermination": true, | |
51 | "DeviceIndex": 0, | |
52 | "Status": "attaching" | |
53 | }, | |
54 | "Description": "", | |
55 | "Groups": [ | |
56 | { | |
57 | "GroupName": "MySecurityGroup", | |
58 | "GroupId": "sg-0598c7d356eba48d7" | |
59 | } | |
60 | ], | |
61 | "Ipv6Addresses": [], | |
62 | "MacAddress": "0a:ab:58:e0:67:e2", | |
63 | "NetworkInterfaceId": "eni-0c0a29997760baee7", | |
64 | "OwnerId": "123456789012", | |
65 | "PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal", | |
66 | "PrivateIpAddress": "10.0.0.157" | |
67 | "PrivateIpAddresses": [ | |
68 | { | |
69 | "Primary": true, | |
70 | "PrivateDnsName": "ip-10-0-0-157.us-east-2.compute.internal", | |
71 | "PrivateIpAddress": "10.0.0.157" | |
72 | } | |
73 | ], | |
74 | "SourceDestCheck": true, | |
75 | "Status": "in-use", | |
76 | "SubnetId": "subnet-04a636d18e83cfacb", | |
77 | "VpcId": "vpc-1234567890abcdef0", | |
78 | "InterfaceType": "interface" | |
79 | } | |
80 | ], | |
81 | "RootDeviceName": "/dev/xvda", | |
82 | "RootDeviceType": "ebs", | |
83 | "SecurityGroups": [ | |
84 | { | |
85 | "GroupName": "MySecurityGroup", | |
86 | "GroupId": "sg-0598c7d356eba48d7" | |
87 | } | |
88 | ], | |
89 | "SourceDestCheck": true, | |
90 | "StateReason": { | |
91 | "Code": "pending", | |
92 | "Message": "pending" | |
93 | }, | |
94 | "Tags": [], | |
95 | "VirtualizationType": "hvm", | |
96 | "CpuOptions": { | |
97 | "CoreCount": 1, | |
98 | "ThreadsPerCore": 1 | |
99 | }, | |
100 | "CapacityReservationSpecification": { | |
101 | "CapacityReservationPreference": "open" | |
102 | }, | |
103 | "MetadataOptions": { | |
104 | "State": "pending", | |
105 | "HttpTokens": "optional", | |
106 | "HttpPutResponseHopLimit": 1, | |
107 | "HttpEndpoint": "enabled" | |
76 | 108 | } |
77 | ], | |
78 | "RootDeviceName": "/dev/xvda", | |
79 | "RootDeviceType": "ebs", | |
80 | "SecurityGroups": [ | |
81 | { | |
82 | "GroupName": "MySecurityGroup", | |
83 | "GroupId": "sg-0598c7d356eba48d7" | |
84 | } | |
85 | ], | |
86 | "SourceDestCheck": true, | |
87 | "StateReason": { | |
88 | "Code": "pending", | |
89 | "Message": "pending" | |
90 | }, | |
91 | "Tags": [], | |
92 | "VirtualizationType": "hvm", | |
93 | "CpuOptions": { | |
94 | "CoreCount": 1, | |
95 | "ThreadsPerCore": 1 | |
96 | }, | |
97 | "CapacityReservationSpecification": { | |
98 | "CapacityReservationPreference": "open" | |
99 | }, | |
100 | "MetadataOptions": { | |
101 | "State": "pending", | |
102 | "HttpTokens": "optional", | |
103 | "HttpPutResponseHopLimit": 1, | |
104 | "HttpEndpoint": "enabled" | |
105 | 109 | } |
106 | } | |
107 | ], | |
108 | "OwnerId": "123456789012" | |
109 | "ReservationId": "r-02a3f596d91211712", | |
110 | ], | |
111 | "OwnerId": "123456789012" | |
112 | "ReservationId": "r-02a3f596d91211712", | |
113 | } | |
110 | 114 | } |
111 | 115 | |
112 | **Example 2: To describe instances based on filters** | |
116 | **Example 2: To filter for instances with the specified type** | |
113 | 117 | |
114 | 118 | The following ``describe-instances`` example uses filters to scope the results to instances of the specified type. :: |
115 | 119 | |
116 | 120 | aws ec2 describe-instances \ |
117 | 121 | --filters Name=instance-type,Values=m5.large |
118 | 122 | |
123 | For sample of output, see Example 1. | |
124 | ||
125 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
126 | ||
127 | **Example 3: To filter for instances with the specified type and Availability Zone** | |
128 | ||
119 | 129 | The following ``describe-instances`` example uses multiple filters to scope the results to instances with the specified type that are also in the specified Availability Zone. :: |
120 | 130 | |
121 | 131 | aws ec2 describe-instances \ |
122 | 132 | --filters Name=instance-type,Values=t2.micro,t3.micro Name=availability-zone,Values=us-east-2c |
133 | ||
134 | For sample of output, see Example 1. | |
135 | ||
136 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
137 | ||
138 | **Example 4: To filter for instances with the specified type and Availability Zone using a JSON file** | |
123 | 139 | |
124 | 140 | The following ``describe-instances`` example uses a JSON input file to perform the same filtering as the previous example. When filters get more complicated, they can be easier to specify in a JSON file. :: |
125 | 141 | |
139 | 155 | } |
140 | 156 | ] |
141 | 157 | |
142 | For an example of the output for ``describe-instances``, see Example 1. | |
143 | ||
144 | **Example 3: To describe instances based on tags** | |
158 | For sample of output, see Example 1. | |
159 | ||
160 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
161 | ||
162 | **Example 5: To filter for instances with the specified Owner tag** | |
145 | 163 | |
146 | 164 | The following ``describe-instances`` example uses tag filters to scope the results to instances that have a tag with the specified tag key (Owner), regardless of the tag value. :: |
147 | 165 | |
148 | 166 | aws ec2 describe-instances \ |
149 | 167 | --filters "Name=tag-key,Values=Owner" |
150 | 168 | |
169 | For sample of output, see Example 1. | |
170 | ||
171 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
172 | ||
173 | **Example 6: To filter for instances with the specified my-team tag value** | |
174 | ||
151 | 175 | The following ``describe-instances`` example uses tag filters to scope the results to instances that have a tag with the specified tag value (my-team), regardless of the tag key. :: |
152 | 176 | |
153 | 177 | aws ec2 describe-instances \ |
154 | 178 | --filters "Name=tag-value,Values=my-team" |
155 | 179 | |
180 | For sample of output, see Example 1. | |
181 | ||
182 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
183 | ||
184 | **Example 7: To filter for instances with the specified Owner tag and my-team value** | |
185 | ||
156 | 186 | The following ``describe-instances`` example uses tag filters to scope the results to instances that have the specified tag (Owner=my-team). :: |
157 | 187 | |
158 | 188 | aws ec2 describe-instances \ |
159 | 189 | --filters "Name=tag:Owner,Values=my-team" |
160 | 190 | |
161 | For an example of the output for ``describe-instances``, see Example 1. | |
162 | ||
163 | **Example 4: To display only specific output** | |
191 | For sample of output, see Example 1. | |
192 | ||
193 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
194 | ||
195 | **Example 8: To display only instance and subnet IDs for all instances** | |
164 | 196 | |
165 | 197 | The following ``describe-instances`` example uses the ``--query`` parameter to display only the instance and subnet IDs for all instances, in JSON format. |
166 | 198 | |
167 | Linux command:: | |
199 | Linux and macOS:: | |
168 | 200 | |
169 | 201 | aws ec2 describe-instances \ |
170 | 202 | --query 'Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}' \ |
171 | 203 | --output json |
172 | 204 | |
173 | Windows command:: | |
205 | Windows:: | |
174 | 206 | |
175 | 207 | aws ec2 describe-instances ^ |
176 | 208 | --query "Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}" ^ |
193 | 225 | } |
194 | 226 | ... |
195 | 227 | ] |
228 | ||
229 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
230 | ||
231 | **Example 9: To filter instances of the specified type and only display their instance IDs** | |
196 | 232 | |
197 | 233 | The following ``describe-instances`` example uses filters to scope the results to instances of the specified type and the ``--query`` parameter to display only the instance IDs. :: |
198 | 234 | |
210 | 246 | i-00b8ae04f9f99908e |
211 | 247 | i-0fc71c25d2374130c |
212 | 248 | |
249 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
250 | ||
251 | **Example 10: To filter instances of the specified type and only display their instance IDs, Availability Zone and the specified tag value in table format** | |
252 | ||
213 | 253 | The following ``describe-instances`` example displays the instance ID, Availability Zone, and the value of the ``Name`` tag for instances that have a tag with the name ``tag-key``, in table format. |
214 | 254 | |
215 | Linux command:: | |
255 | Linux and macOS:: | |
216 | 256 | |
217 | 257 | aws ec2 describe-instances \ |
218 | 258 | --filters Name=tag-key,Values=Name \ |
219 | 259 | --query 'Reservations[*].Instances[*].{Instance:InstanceId,AZ:Placement.AvailabilityZone,Name:Tags[?Key==`Name`]|[0].Value}' \ |
220 | 260 | --output table |
221 | 261 | |
222 | Windows command:: | |
262 | Windows:: | |
223 | 263 | |
224 | 264 | aws ec2 describe-instances ^ |
225 | 265 | --filters Name=tag-key,Values=Name ^ |
238 | 278 | | us-east-2a | i-027552a73f021f3bd | test-server-2 | |
239 | 279 | +--------------+-----------------------+--------------------+ |
240 | 280 | |
241 | **Example 5: To describe instances in a partition placement group** | |
281 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
282 | ||
283 | **Example 11: To describe instances in a partition placement group** | |
242 | 284 | |
243 | 285 | The following ``describe-instances`` example describes the specified instance. The output includes the placement information for the instance, which contains the placement group name and the partition number for the instance. :: |
244 | 286 | |
245 | 287 | aws ec2 describe-instances \ |
246 | 288 | --instance-id i-0123a456700123456 |
247 | 289 | |
248 | The following shows only the placement information from the output. :: | |
249 | ||
250 | "Placement": { | |
251 | "AvailabilityZone": "us-east-1c", | |
252 | "GroupName": "HDFS-Group-A", | |
253 | "PartitionNumber": 3, | |
254 | "Tenancy": "default" | |
255 | } | |
290 | Output:: | |
291 | ||
292 | [ | |
293 | .... | |
294 | ||
295 | "Placement": { | |
296 | "AvailabilityZone": "us-east-1c", | |
297 | "GroupName": "HDFS-Group-A", | |
298 | "PartitionNumber": 3, | |
299 | "Tenancy": "default" | |
300 | } | |
301 | ||
302 | .... | |
303 | ] | |
304 | ||
305 | For more information, see `Describing instances in a placement group <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#describe-instance-placement>`__ in the *Amazon EC2 Users Guide*. | |
306 | ||
307 | **Example 12: To filter to instances with the specified placement group and partition number** | |
256 | 308 | |
257 | 309 | The following ``describe-instances`` example filters the results to only those instances with the specified placement group and partition number. :: |
258 | 310 |
0 | **To describe all carrier gateways** | |
1 | ||
2 | The following "describe-carrier-gateways" example lists all your carrier gateways. :: | |
3 | ||
4 | aws ec2 describe-carrier-gateways | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "CarrierGateways": [ | |
10 | { | |
11 | "CarrierGatewayId": "cagw-0465cdEXAMPLE1111", | |
12 | "VpcId": "vpc-0c529aEXAMPLE", | |
13 | "State": "available", | |
14 | "OwnerId": "123456789012", | |
15 | "Tags": [ | |
16 | { | |
17 | ||
18 | "Key": "example", | |
19 | "Value": "tag" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ] | |
24 | } | |
25 | ||
26 | For more information, see `Carrier gateways <https://docs.aws.amazon.com/vpc/latest/userguide/Carrier_Gateway.html>`__ in the *Amazon Virtual Private Cloud | |
27 | User Guide*.⏎ |
0 | **To describe your transit gateway multicast domains** | |
1 | ||
2 | The following ``describe-transit-gateway-multicast-domains`` example displays details for all of your transit gateway multicast domains. :: | |
3 | ||
4 | aws ec2 describe-transit-gateway-multicast-domains | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | ||
10 | "TransitGatewayMulticastDomains": [ | |
11 | { | |
12 | "TransitGatewayMulticastDomainId": "tgw-mcast-domain-000fb24d04EXAMPLE", | |
13 | "TransitGatewayId": "tgw-0bf0bffefaEXAMPLE", | |
14 | "TransitGatewayMulticastDomainArn": "arn:aws:ec2:us-east-1:123456789012:transit-gateway-multicast-domain/tgw-mcast-domain-000fb24d04EXAMPLE", | |
15 | "OwnerId": "123456789012", | |
16 | "Options": { | |
17 | "Igmpv2Support": "disable", | |
18 | "StaticSourcesSupport": "enable", | |
19 | "AutoAcceptSharedAssociations": "disable" | |
20 | }, | |
21 | "State": "available", | |
22 | "CreationTime": "2019-12-10T18:32:50+00:00", | |
23 | "Tags": [ | |
24 | { | |
25 | "Key": "Name", | |
26 | "Value": "mc1" | |
27 | } | |
28 | ] | |
29 | } | |
30 | ] | |
31 | } | |
32 | ||
33 | For more information, see `Managing multicast domains <https://docs.aws.amazon.com/vpc/latest/tgw/manage-domain.html>`__ in the *Transit Gateways Guide*.⏎ |
0 | **To describe VPC endpoint services** | |
0 | **Example 1: To describe all VPC endpoint services** | |
1 | 1 | |
2 | This example describes all available endpoint services for the region. | |
2 | The following "describe-vpc-endpoint-services" example lists all VPC endpoint services for an AWS Region. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 describe-vpc-endpoint-services | |
4 | aws ec2 describe-vpc-endpoint-services | |
7 | 5 | |
8 | 6 | Output:: |
9 | 7 | |
10 | { | |
11 | "ServiceDetails": [ | |
12 | { | |
13 | "ServiceType": [ | |
14 | { | |
15 | "ServiceType": "Gateway" | |
16 | } | |
17 | ], | |
18 | "AcceptanceRequired": false, | |
19 | "ServiceName": "com.amazonaws.us-east-1.dynamodb", | |
20 | "VpcEndpointPolicySupported": true, | |
21 | "Owner": "amazon", | |
22 | "AvailabilityZones": [ | |
23 | "us-east-1a", | |
24 | "us-east-1b", | |
25 | "us-east-1c", | |
26 | "us-east-1d", | |
27 | "us-east-1e", | |
8 | { | |
9 | "ServiceDetails": [ | |
10 | { | |
11 | "ServiceType": [ | |
12 | { | |
13 | "ServiceType": "Gateway" | |
14 | } | |
15 | ], | |
16 | "AcceptanceRequired": false, | |
17 | "ServiceName": "com.amazonaws.us-east-1.dynamodb", | |
18 | "VpcEndpointPolicySupported": true, | |
19 | "Owner": "amazon", | |
20 | "AvailabilityZones": [ | |
21 | "us-east-1a", | |
22 | "us-east-1b", | |
23 | "us-east-1c", | |
24 | "us-east-1d", | |
25 | "us-east-1e", | |
26 | "us-east-1f" | |
27 | ], | |
28 | "BaseEndpointDnsNames": [ | |
29 | "dynamodb.us-east-1.amazonaws.com" | |
30 | ] | |
31 | }, | |
32 | { | |
33 | "ServiceType": [ | |
34 | { | |
35 | "ServiceType": "Interface" | |
36 | } | |
37 | ], | |
38 | "PrivateDnsName": "ec2.us-east-1.amazonaws.com", | |
39 | "ServiceName": "com.amazonaws.us-east-1.ec2", | |
40 | "VpcEndpointPolicySupported": false, | |
41 | "Owner": "amazon", | |
42 | "AvailabilityZones": [ | |
43 | "us-east-1a", | |
44 | "us-east-1b", | |
45 | "us-east-1c", | |
46 | "us-east-1d", | |
47 | "us-east-1e", | |
48 | "us-east-1f" | |
49 | ], | |
50 | "AcceptanceRequired": false, | |
51 | "BaseEndpointDnsNames": [ | |
52 | "ec2.us-east-1.vpce.amazonaws.com" | |
53 | ] | |
54 | }, | |
55 | { | |
56 | "ServiceType": [ | |
57 | { | |
58 | "ServiceType": "Interface" | |
59 | } | |
60 | ], | |
61 | "PrivateDnsName": "ssm.us-east-1.amazonaws.com", | |
62 | "ServiceName": "com.amazonaws.us-east-1.ssm", | |
63 | "VpcEndpointPolicySupported": true, | |
64 | "Owner": "amazon", | |
65 | "AvailabilityZones": [ | |
66 | "us-east-1a", | |
67 | "us-east-1b", | |
68 | "us-east-1c", | |
69 | "us-east-1d", | |
70 | "us-east-1e" | |
71 | ], | |
72 | "AcceptanceRequired": false, | |
73 | "BaseEndpointDnsNames": [ | |
74 | "ssm.us-east-1.vpce.amazonaws.com" | |
75 | ] | |
76 | } | |
77 | ], | |
78 | "ServiceNames": [ | |
79 | "com.amazonaws.us-east-1.dynamodb", | |
80 | "com.amazonaws.us-east-1.ec2", | |
81 | "com.amazonaws.us-east-1.ec2messages", | |
82 | "com.amazonaws.us-east-1.elasticloadbalancing", | |
83 | "com.amazonaws.us-east-1.kinesis-streams", | |
84 | "com.amazonaws.us-east-1.s3", | |
85 | "com.amazonaws.us-east-1.ssm" | |
86 | ] | |
87 | } | |
88 | ||
89 | For more information, see `View available AWS service names <https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#vpce-view-services>`__ in the *User Guide for AWSPrivateLink*. | |
90 | ||
91 | **Example 2: To describe the details about an endpoint service** | |
92 | ||
93 | The following "describe-vpc-endpoint-services" example lists the details of the Amazon S3 interface endpoint srvice :: | |
94 | ||
95 | aws ec2 describe-vpc-endpoint-services \ | |
96 | --filter "Name=service-type,Values=Interface" Name=service-name,Values=com.amazonaws.us-east-1.s3 | |
97 | ||
98 | Output:: | |
99 | ||
100 | { | |
101 | "ServiceDetails": [ | |
102 | { | |
103 | "ServiceName": "com.amazonaws.us-east-1.s3", | |
104 | "ServiceId": "vpce-svc-081d84efcdEXAMPLE", | |
105 | "ServiceType": [ | |
106 | { | |
107 | "ServiceType": "Interface" | |
108 | } | |
109 | ], | |
110 | "AvailabilityZones": [ | |
111 | "us-east-1a", | |
112 | "us-east-1b", | |
113 | "us-east-1c", | |
114 | "us-east-1d", | |
115 | "us-east-1e", | |
28 | 116 | "us-east-1f" |
29 | ], | |
30 | "BaseEndpointDnsNames": [ | |
31 | "dynamodb.us-east-1.amazonaws.com" | |
32 | ] | |
33 | }, | |
34 | { | |
35 | "ServiceType": [ | |
36 | { | |
37 | "ServiceType": "Interface" | |
38 | } | |
39 | ], | |
40 | "PrivateDnsName": "ec2.us-east-1.amazonaws.com", | |
41 | "ServiceName": "com.amazonaws.us-east-1.ec2", | |
42 | "VpcEndpointPolicySupported": false, | |
43 | "Owner": "amazon", | |
44 | "AvailabilityZones": [ | |
45 | "us-east-1a", | |
46 | "us-east-1b", | |
47 | "us-east-1c", | |
48 | "us-east-1d", | |
49 | "us-east-1e", | |
50 | "us-east-1f" | |
51 | ], | |
52 | "AcceptanceRequired": false, | |
53 | "BaseEndpointDnsNames": [ | |
54 | "ec2.us-east-1.vpce.amazonaws.com" | |
55 | ] | |
56 | }, | |
57 | { | |
58 | "ServiceType": [ | |
59 | { | |
60 | "ServiceType": "Interface" | |
61 | } | |
62 | ], | |
63 | "PrivateDnsName": "ec2messages.us-east-1.amazonaws.com", | |
64 | "ServiceName": "com.amazonaws.us-east-1.ec2messages", | |
65 | "VpcEndpointPolicySupported": false, | |
66 | "Owner": "amazon", | |
67 | "AvailabilityZones": [ | |
68 | "us-east-1a", | |
69 | "us-east-1b", | |
70 | "us-east-1c", | |
71 | "us-east-1d", | |
72 | "us-east-1e", | |
73 | "us-east-1f" | |
74 | ], | |
75 | "AcceptanceRequired": false, | |
76 | "BaseEndpointDnsNames": [ | |
77 | "ec2messages.us-east-1.vpce.amazonaws.com" | |
78 | ] | |
79 | }, | |
80 | { | |
81 | "ServiceType": [ | |
82 | { | |
83 | "ServiceType": "Interface" | |
84 | } | |
85 | ], | |
86 | "PrivateDnsName": "elasticloadbalancing.us-east-1.amazonaws.com", | |
87 | "ServiceName": "com.amazonaws.us-east-1.elasticloadbalancing", | |
88 | "VpcEndpointPolicySupported": false, | |
89 | "Owner": "amazon", | |
90 | "AvailabilityZones": [ | |
91 | "us-east-1a", | |
92 | "us-east-1b", | |
93 | "us-east-1c", | |
94 | "us-east-1d", | |
95 | "us-east-1e", | |
96 | "us-east-1f" | |
97 | ], | |
98 | "AcceptanceRequired": false, | |
99 | "BaseEndpointDnsNames": [ | |
100 | "elasticloadbalancing.us-east-1.vpce.amazonaws.com" | |
101 | ] | |
102 | }, | |
103 | { | |
104 | "ServiceType": [ | |
105 | { | |
106 | "ServiceType": "Interface" | |
107 | } | |
108 | ], | |
109 | "PrivateDnsName": "kinesis.us-east-1.amazonaws.com", | |
110 | "ServiceName": "com.amazonaws.us-east-1.kinesis-streams", | |
111 | "VpcEndpointPolicySupported": false, | |
112 | "Owner": "amazon", | |
113 | "AvailabilityZones": [ | |
114 | "us-east-1a", | |
115 | "us-east-1b", | |
116 | "us-east-1c", | |
117 | "us-east-1d", | |
118 | "us-east-1e", | |
119 | "us-east-1f" | |
120 | ], | |
121 | "AcceptanceRequired": false, | |
122 | "BaseEndpointDnsNames": [ | |
123 | "kinesis.us-east-1.vpce.amazonaws.com" | |
124 | ] | |
125 | }, | |
126 | { | |
127 | "ServiceType": [ | |
128 | { | |
129 | "ServiceType": "Gateway" | |
130 | } | |
131 | ], | |
132 | "AcceptanceRequired": false, | |
133 | "ServiceName": "com.amazonaws.us-east-1.s3", | |
134 | "VpcEndpointPolicySupported": true, | |
135 | "Owner": "amazon", | |
136 | "AvailabilityZones": [ | |
137 | "us-east-1a", | |
138 | "us-east-1b", | |
139 | "us-east-1c", | |
140 | "us-east-1d", | |
141 | "us-east-1e", | |
142 | "us-east-1f" | |
143 | ], | |
144 | "BaseEndpointDnsNames": [ | |
145 | "s3.us-east-1.amazonaws.com" | |
146 | ] | |
147 | }, | |
148 | { | |
149 | "ServiceType": [ | |
150 | { | |
151 | "ServiceType": "Interface" | |
152 | } | |
153 | ], | |
154 | "PrivateDnsName": "ssm.us-east-1.amazonaws.com", | |
155 | "ServiceName": "com.amazonaws.us-east-1.ssm", | |
156 | "VpcEndpointPolicySupported": true, | |
157 | "Owner": "amazon", | |
158 | "AvailabilityZones": [ | |
159 | "us-east-1a", | |
160 | "us-east-1b", | |
161 | "us-east-1c", | |
162 | "us-east-1d", | |
163 | "us-east-1e" | |
164 | ], | |
165 | "AcceptanceRequired": false, | |
166 | "BaseEndpointDnsNames": [ | |
167 | "ssm.us-east-1.vpce.amazonaws.com" | |
168 | ] | |
169 | } | |
170 | ], | |
171 | "ServiceNames": [ | |
172 | "com.amazonaws.us-east-1.dynamodb", | |
173 | "com.amazonaws.us-east-1.ec2", | |
174 | "com.amazonaws.us-east-1.ec2messages", | |
175 | "com.amazonaws.us-east-1.elasticloadbalancing", | |
176 | "com.amazonaws.us-east-1.kinesis-streams", | |
177 | "com.amazonaws.us-east-1.s3", | |
178 | "com.amazonaws.us-east-1.ssm" | |
179 | ] | |
180 | }⏎ | |
117 | ], | |
118 | "Owner": "amazon", | |
119 | "BaseEndpointDnsNames": [ | |
120 | "s3.us-east-1.vpce.amazonaws.com" | |
121 | ], | |
122 | "VpcEndpointPolicySupported": true, | |
123 | "AcceptanceRequired": false, | |
124 | "ManagesVpcEndpoints": false, | |
125 | "Tags": [] | |
126 | } | |
127 | ], | |
128 | "ServiceNames": [ | |
129 | "com.amazonaws.us-east-1.s3" | |
130 | ] | |
131 | } | |
132 | ||
133 | For more information, see `View available AWS service names <https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html#vpce-view-services>`__ in the *User Guide for AWSPrivateLink*.⏎ |
30 | 30 | |
31 | 31 | **Example 3: To move an instance to a placement group** |
32 | 32 | |
33 | To move an instance to a placement group, stop the instance, modify the instance placement, and then restart the instance. :: | |
33 | The following ``modify-instance-placement`` example moves an instance to a placement group, stop the instance, modify the instance placement, and then restart the instance. :: | |
34 | 34 | |
35 | 35 | aws ec2 stop-instances \ |
36 | 36 | --instance-ids i-0123a456700123456 |
46 | 46 | |
47 | 47 | **Example 4: To remove an instance from a placement group** |
48 | 48 | |
49 | To remove an instance from a placement group, stop the instance, modify the instance placement, and then restart the instance. The following example specifies an empty string (" ") for the placement group name to indicate that the instance is not to be located in a placement group. | |
49 | The following ``modify-instance-placement`` example removes an instance from a placement group by stopping the instance, modifying the instance placement, and then restarting the instance. The following example specifies an empty string ("") for the placement group name to indicate that the instance is not to be located in a placement group. | |
50 | ||
51 | Stop the instance:: | |
50 | 52 | |
51 | 53 | aws ec2 stop-instances \ |
52 | 54 | --instance-ids i-0123a456700123456 |
53 | 55 | |
56 | Modify the placement (Windows Command Prompt, Linux, and macOS):: | |
57 | ||
54 | 58 | aws ec2 modify-instance-placement \ |
55 | 59 | --instance-id i-0123a456700123456 \ |
56 | --group-name " " | |
60 | --group-name "" | |
61 | ||
62 | Modify the placement (Windows PowerShell):: | |
63 | ||
64 | aws ec2 modify-instance-placement ` | |
65 | --instance-id i-0123a456700123456 ` | |
66 | --group-name """" | |
67 | ||
68 | Restart the instance:: | |
57 | 69 | |
58 | 70 | aws ec2 start-instances \ |
59 | 71 | --instance-ids i-0123a456700123456 |
60 | 72 | |
61 | For more information, see `Modifying Instance Tenancy and Affinity <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#moving-instances-dedicated-hosts>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. | |
73 | Output:: | |
74 | ||
75 | { | |
76 | "Return": true | |
77 | } | |
78 | ||
79 | For more information, see `Modifying Instance Tenancy and Affinity <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#moving-instances-dedicated-hosts>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*.⏎ |
0 | 0 | **To add tags to a resource** |
1 | 1 | |
2 | The following ``add-tags-to-resource`` example adds up to 10 tags, key-value pairs, to a cluster or snapshot resource. :: | |
2 | The following ``add-tags-to-resource`` example adds up to 10 tags, key-value pairs, to a cluster or snapshot resource. :: | |
3 | 3 | |
4 | 4 | aws elasticache add-tags-to-resource \ |
5 | -- resource name "arn:aws:elasticache:us-east-1:1234567890:cluster:my-mem-cluster" \ | |
6 | -- tags -- '{"20150202":15, "ElastiCache":"Service"}' | |
5 | --resource-name "arn:aws:elasticache:us-east-1:1234567890:cluster:my-mem-cluster" \ | |
6 | --tags '{"20150202":15, "ElastiCache":"Service"}' | |
7 | ||
7 | 8 | |
8 | 9 | Output:: |
9 | 10 | |
20 | 21 | ] |
21 | 22 | } |
22 | 23 | |
23 | For more information, see `Monitoring Costs with Cost Allocation Tags <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Tagging.html>`__ in the *Elasticache User Guide*. | |
24 | For more information, see `Monitoring Costs with Cost Allocation Tags <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Tagging.html>`__ in the *Elasticache User Guide*.⏎ |
0 | **To authorize cache security group ingress** | |
0 | **To authorize cache security group for ingress** | |
1 | 1 | |
2 | The following ''authorize-cache-security-group-ingress'' example allows network ingress to a cache security group. :: | |
2 | The following ``authorize-cache-security-group-ingress`` example allows network ingress to a cache security group. :: | |
3 | 3 | |
4 | 4 | aws elasticache authorize-cache-security-group-ingress \ |
5 | 5 | --cache-security-group-name "my-sec-grp" \ |
6 | 6 | --ec2-security-group-name "my-ec2-sec-grp" \ |
7 | 7 | --ec2-security-group-owner-id "1234567890" |
8 | 8 | |
9 | This command produces no output. | |
9 | The command produces no output. | |
10 | 10 | |
11 | For more information, see 'Self-Service Updates in Amazon ElastiCache <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Self-Service-Updates.html>'__ in the *Elasticache User Guide*. | |
11 | For more information, see `Self-Service Updates in Amazon ElastiCache <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Self-Service-Updates.html>`__ in the *Elasticache User Guide*.⏎ |
0 | 0 | **To create a cache cluster** |
1 | 1 | |
2 | The following ''create-cache-cluster'' example creates a cache cluster using the Redis engine. :: | |
2 | The following ``create-cache-cluster`` example creates a cache cluster using the Redis engine. :: | |
3 | 3 | |
4 | 4 | aws elasticache create-cache-cluster \ |
5 | -- cache-cluster-id "cluster-test" \ | |
5 | --cache-cluster-id "cluster-test" \ | |
6 | 6 | --engine redis \ |
7 | 7 | --cache-node-type cache.m5.large \ |
8 | 8 | --num-cache-nodes 1 |
9 | ||
9 | 10 | |
10 | 11 | Output:: |
11 | 12 |
0 | 0 | **To delete a replication group** |
1 | 1 | |
2 | The following ``delete-replication-group`` example deletes the specified replication group. By default, this operation deletes the entire replication group, including the primary or primaries and all of the read replicas. If the replication group has only one primary, you can optionally delete only the read replicas, while keeping the primary by setting ``--retain-primary-cluster``. | |
2 | The following ``delete-replication-group`` example deletes an existing replication group. By default, this operation deletes the entire replication group, including the primary/primaries and all of the read replicas. If the replication group has only one primary, you can optionally delete only the read replicas, while retaining the primary by setting RetainPrimaryCluster=true . | |
3 | 3 | |
4 | When you get a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you can't cancel or revert this operation. This operation is valid for Redis only. | |
4 | When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation. Valid for Redis only. :: | |
5 | 5 | |
6 | 6 | aws elasticache delete-replication-group \ |
7 | 7 | --replication-group-id "mygroup" |
20 | 20 | "TransitEncryptionEnabled": false, |
21 | 21 | "AtRestEncryptionEnabled": false |
22 | 22 | } |
23 | } | |
24 | ||
25 | For more information, see `Deleting a Replication Group <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Replication.DeletingRepGroup.html>`__ in the *Elasticache User Guide*. | |
23 | }⏎ |
2 | 2 | The following ``delete-user-group`` example deletes a user group. :: |
3 | 3 | |
4 | 4 | aws elasticache delete-user-group \ |
5 | --user-id user2 | |
5 | --user-group-id myusergroup | |
6 | 6 | |
7 | 7 | Output:: |
8 | 8 |
0 | 0 | **To describe a cache cluster** |
1 | 1 | |
2 | The following ``describe-cache-clusters`` example returns information about the specific cache cluster. :: | |
2 | The following ``describe-cache-clusters`` example describes a cache cluster. :: | |
3 | 3 | |
4 | aws elasticache describe-cache-clusters \ | |
5 | --cache-cluster-id "my-cluster-003" | |
4 | aws elasticache describe-cache-clusters | |
6 | 5 | |
7 | 6 | Output:: |
8 | 7 | |
9 | 8 | { |
10 | 9 | "CacheClusters": [ |
11 | { | |
10 | { | |
12 | 11 | "CacheClusterId": "my-cluster-003", |
13 | 12 | "ClientDownloadLandingPage": "https://console.aws.amazon.com/elasticache/home#client-download:", |
14 | 13 | "CacheNodeType": "cache.r5.large", |
43 | 42 | "SnapshotWindow": "06:30-07:30", |
44 | 43 | "AuthTokenEnabled": false, |
45 | 44 | "TransitEncryptionEnabled": false, |
46 | "AtRestEncryptionEnabled": false | |
45 | "AtRestEncryptionEnabled": false, | |
46 | "ARN": "arn:aws:elasticache:us-west-2:xxxxxxxxxxx152:cluster:my-cache-cluster", | |
47 | "ReplicationGroupLogDeliveryEnabled": false, | |
48 | "LogDeliveryConfigurations": [ | |
49 | { | |
50 | "LogType": "slow-log", | |
51 | "DestinationType": "cloudwatch-logs", | |
52 | "DestinationDetails": { | |
53 | "CloudWatchLogsDetails": { | |
54 | "LogGroup": "test-log" | |
55 | } | |
56 | }, | |
57 | "LogFormat": "text", | |
58 | "Status": "active" | |
59 | } | |
60 | ] | |
47 | 61 | } |
48 | 62 | ] |
49 | 63 | } |
50 | 64 | |
51 | For more information, see `Viewing a Cluster's Details <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.ViewDetails.html>`__ in the *Elasticache User Guide*. | |
52 | ||
53 | ||
65 | For more information, see `Managing Clusters <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.html>`__ in the *Elasticache User Guide*.⏎ |
2 | 2 | The following ``describe-events`` example returns a list of events for a replication group. :: |
3 | 3 | |
4 | 4 | aws elasticache describe-events \ |
5 | -- source-identifier test-cluster \ | |
5 | --source-identifier test-cluster \ | |
6 | 6 | --source-type replication-group |
7 | ||
7 | 8 | |
8 | 9 | Output:: |
9 | 10 |
0 | **To describe replication groups** | |
0 | **To return a list of replication group details** | |
1 | 1 | |
2 | The following ``describe-replication-groups`` example returns information about the specified replication group. :: | |
2 | The following ``describe-replication-groups`` example returns the replication groups. :: | |
3 | 3 | |
4 | aws elasticache describe-replication-groups | |
5 | --replication-group-id "my-cluster" | |
4 | aws elasticache describe-replication-groups | |
6 | 5 | |
7 | 6 | Output:: |
8 | 7 | |
82 | 81 | "CacheNodeType": "cache.r5.xlarge", |
83 | 82 | "AuthTokenEnabled": false, |
84 | 83 | "TransitEncryptionEnabled": false, |
85 | "AtRestEncryptionEnabled": false | |
84 | "AtRestEncryptionEnabled": false, | |
85 | "ARN": "arn:aws:elasticache:us-west-2:xxxxxxxxxxx152:replicationgroup:my-cluster", | |
86 | "LogDeliveryConfigurations": [ | |
87 | { | |
88 | "LogType": "slow-log", | |
89 | "DestinationType": "cloudwatch-logs", | |
90 | "DestinationDetails": { | |
91 | "CloudWatchLogsDetails": { | |
92 | "LogGroup": "test-log" | |
93 | } | |
94 | }, | |
95 | "LogFormat": "json", | |
96 | "Status": "active" | |
97 | } | |
98 | ] | |
86 | 99 | } |
87 | 100 | ] |
88 | 101 | } |
89 | 102 | |
90 | For more information, see `Viewing a Replication Group's Details <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Replication.ViewDetails.html>`__ in the *Elasticache User Guide*. | |
103 | For more information, see `Managing Clusters <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.html>`__ in the *Elasticache User Guide*.⏎ |
0 | **To list events** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists the tags for a cache cluster. :: | |
3 | ||
4 | aws elasticache list-tags-for-resource \ | |
5 | --resource-name "arn:aws:elasticache:us-east-1:123456789012:cluster:my-cluster" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TagList": [ | |
11 | { | |
12 | "Key": "Project", | |
13 | "Value": "querySpeedUp" | |
14 | }, | |
15 | { | |
16 | "Key": "Environment", | |
17 | "Value": "PROD" | |
18 | } | |
19 | ] | |
20 | } | |
21 | ||
22 | For more information, see `Listing Tags Using the AWS CLI < https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Tagging.Managing.CLI.html#Tagging.Managing.CLI.List>`__ in the *Amazon ElastiCache for Redis User Guide*. | |
0 | **To list tags for a resource** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists tags for a resource. :: | |
3 | ||
4 | aws elasticache list-tags-for-resource \ | |
5 | --resource-name "arn:aws:elasticache:us-east-1:123456789012:cluster:my-cluster" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TagList": [ | |
11 | { | |
12 | "Key": "Project", | |
13 | "Value": "querySpeedUp" | |
14 | }, | |
15 | { | |
16 | "Key": "Environment", | |
17 | "Value": "PROD" | |
18 | } | |
19 | ] | |
20 | } | |
21 | ||
22 | For more information, see `Listing Tags Using the AWS CLI <https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Tagging.Managing.CLI.html>`__ in the *Elasticache User Guide*.⏎ |
8 | 8 | --instance-type m4.large \ |
9 | 9 | --instance-count 2 |
10 | 10 | |
11 | This command produces no output. | |
12 | ||
11 | 13 | **Example 2: To create an Amazon EMR cluster with default ServiceRole and InstanceProfile roles** |
12 | 14 | |
13 | 15 | The following ``create-cluster`` example creates an Amazon EMR cluster that uses the ``--instance-groups`` configuration. :: |
74 | 76 | |
75 | 77 | **Example 8: To customize application configurations** |
76 | 78 | |
77 | The following examples use the ``--configurations`` parameter to specify a JSON configuration file that contains application customizations for Hadoop. For more information, see `Configuring Applications <http://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html>`_ in the *Amazon EMR Release Guide*. | |
79 | The following examples use the ``--configurations`` parameter to specify a JSON configuration file that contains application customizations for Hadoop. For more information, see `Configuring Applications <http://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html>`__ in the *Amazon EMR Release Guide*. | |
78 | 80 | |
79 | 81 | Contents of ``configurations.json``:: |
80 | 82 | |
81 | 83 | [ |
82 | { | |
83 | "Classification": "mapred-site", | |
84 | "Properties": { | |
85 | "mapred.tasktracker.map.tasks.maximum": 2 | |
86 | } | |
87 | }, | |
88 | { | |
89 | "Classification": "hadoop-env", | |
90 | "Properties": {}, | |
91 | "Configurations": [ | |
92 | { | |
93 | "Classification": "export", | |
94 | "Properties": { | |
95 | "HADOOP_DATANODE_HEAPSIZE": 2048, | |
96 | "HADOOP_NAMENODE_OPTS": "-XX:GCTimeRatio=19" | |
97 | } | |
84 | { | |
85 | "Classification": "mapred-site", | |
86 | "Properties": { | |
87 | "mapred.tasktracker.map.tasks.maximum": 2 | |
98 | 88 | } |
99 | ] | |
100 | } | |
89 | }, | |
90 | { | |
91 | "Classification": "hadoop-env", | |
92 | "Properties": {}, | |
93 | "Configurations": [ | |
94 | { | |
95 | "Classification": "export", | |
96 | "Properties": { | |
97 | "HADOOP_DATANODE_HEAPSIZE": 2048, | |
98 | "HADOOP_NAMENODE_OPTS": "-XX:GCTimeRatio=19" | |
99 | } | |
100 | } | |
101 | ] | |
102 | } | |
101 | 103 | ] |
102 | 104 | |
103 | 105 | The following example references ``configurations.json`` as a local file. :: |
135 | 137 | |
136 | 138 | **Example 11: To specify cluster configuration details such as the Amazon EC2 key pair, network configuration, and security groups** |
137 | 139 | |
138 | The following ``create-cluster`` example creates a cluster with the Amazon EC2 key pair named ``myKey`` and a customized instance profile named ``myProfile``. Key pairs are used to authorize SSH connections to cluster nodes, most often the master node. For more information, see `Use an Amazon EC2 Key Pair for SSH Credentials <http://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-access-ssh.html>`_ in the *Amazon EMR Management Guide*. :: | |
140 | The following ``create-cluster`` example creates a cluster with the Amazon EC2 key pair named ``myKey`` and a customized instance profile named ``myProfile``. Key pairs are used to authorize SSH connections to cluster nodes, most often the master node. For more information, see `Use an Amazon EC2 Key Pair for SSH Credentials <http://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-access-ssh.html>`__ in the *Amazon EMR Management Guide*. :: | |
139 | 141 | |
140 | 142 | aws emr create-cluster \ |
141 | 143 | --ec2-attributes KeyName=myKey,InstanceProfile=myProfile \ |
184 | 186 | |
185 | 187 | The following example creates a cluster in a VPC private subnet and use a specific Amazon EC2 security group to enable Amazon EMR service access, which is required for clusters in private subnets. :: |
186 | 188 | |
187 | aws emr create-cluster \ | |
189 | aws emr create-cluster \ | |
188 | 190 | --release-label emr-5.9.0 \ |
189 | 191 | --service-role myServiceRole \ |
190 | 192 | --ec2-attributes InstanceProfile=myRole,ServiceAccessSecurityGroup=sg-service-access,EmrManagedMasterSecurityGroup=sg-master,EmrManagedSlaveSecurityGroup=sg-slave \ |
191 | 193 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large |
192 | 194 | |
193 | The following example specifies security group configuration parameters using a JSON file named ``ec2_attributes.json`` that is stored locally. | |
195 | The following example specifies security group configuration parameters using a JSON file named ``ec2_attributes.json`` that is stored locally. | |
196 | NOTE: JSON arguments must include options and values as their own items in the list. :: | |
197 | ||
198 | aws emr create-cluster \ | |
199 | --release-label emr-5.9.0 \ | |
200 | --service-role myServiceRole \ | |
201 | --ec2-attributes file://ec2_attributes.json \ | |
202 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large | |
194 | 203 | |
195 | 204 | Contents of ``ec2_attributes.json``:: |
196 | 205 | |
207 | 216 | } |
208 | 217 | ] |
209 | 218 | |
210 | NOTE: JSON arguments must include options and values as their own items in the list. | |
211 | ||
212 | Command:: | |
213 | ||
214 | aws emr create-cluster \ | |
215 | --release-label emr-5.9.0 \ | |
216 | --service-role myServiceRole \ | |
217 | --ec2-attributes file://ec2_attributes.json \ | |
218 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large | |
219 | ||
220 | 219 | **Example 12: To enable debugging and specify a log URI** |
221 | 220 | |
222 | 221 | The following ``create-cluster`` example uses the ``--enable-debugging`` parameter, which allows you to view log files more easily using the debugging tool in the Amazon EMR console. The ``--log-uri`` parameter is required with ``--enable-debugging``. :: |
230 | 229 | |
231 | 230 | **Example 13: To add tags when creating a cluster** |
232 | 231 | |
233 | Tags are key-value pairs that help you identify and manage clusters. The following ``create-cluster`` example uses the ``--tags`` parameter to create two tags for a cluster, one with the key name ``name`` and the value ``Shirley Rodriguez`` and the other with the key name ``address`` and the value ``123 Maple Street, Anytown, USA``. :: | |
232 | Tags are key-value pairs that help you identify and manage clusters. The following ``create-cluster`` example uses the ``--tags`` parameter to create three tags for a cluster, one with the key name ``name`` and the value ``Shirley Rodriguez``, a second with the key name ``age`` and the value ``29``, and a third tag with the key name ``department`` and the value ``Analytics``. :: | |
234 | 233 | |
235 | 234 | aws emr create-cluster \ |
236 | 235 | --tags name="Shirley Rodriguez" age=29 department="Analytics" \ |
237 | --release-label emr-5.9.0 \ | |
238 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large \ | |
239 | --auto-terminate | |
236 | --release-label emr-5.32.0 \ | |
237 | --instance-type m5.xlarge \ | |
238 | --instance-count 3 \ | |
239 | --use-default-roles | |
240 | 240 | |
241 | 241 | The following example lists the tags applied to a cluster. :: |
242 | 242 | |
286 | 286 | --use-default-roles --auto-scaling-role EMR_AutoScaling_DefaultRole \ |
287 | 287 | --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}]}}}]}' |
288 | 288 | |
289 | The following example uses a JSON file, ``instancegroupconfig.json``, to specify the configuration of all instance groups in a cluster. The JSON file specifies the automatic scaling policy configuration for the core instance group. | |
289 | The following example uses a JSON file, ``instancegroupconfig.json``, to specify the configuration of all instance groups in a cluster. The JSON file specifies the automatic scaling policy configuration for the core instance group. :: | |
290 | ||
291 | aws emr create-cluster \ | |
292 | --release-label emr-5.9.0 \ | |
293 | --service-role EMR_DefaultRole \ | |
294 | --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole \ | |
295 | --instance-groups s3://mybucket/instancegroupconfig.json \ | |
296 | --auto-scaling-role EMR_AutoScaling_DefaultRole | |
290 | 297 | |
291 | 298 | Contents of ``instancegroupconfig.json``:: |
292 | 299 | |
342 | 349 | } |
343 | 350 | ] |
344 | 351 | |
345 | Command:: | |
346 | ||
347 | aws emr create-cluster \ | |
348 | --release-label emr-5.9.0 \ | |
349 | --service-role EMR_DefaultRole \ | |
350 | --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole \ | |
351 | --instance-groups s3://mybucket/instancegroupconfig.json \ | |
352 | --auto-scaling-role EMR_AutoScaling_DefaultRole | |
353 | ||
354 | 352 | **Example 17: Add custom JAR steps when creating a cluster** |
355 | 353 | |
356 | 354 | The following ``create-cluster`` example adds steps by specifying a JAR file stored in Amazon S3. Steps submit work to a cluster. The main function defined in the JAR file executes after EC2 instances are provisioned, any bootstrap actions have executed, and applications are installed. The steps are specified using ``Type=CUSTOM_JAR``. |
357 | 355 | |
358 | Custom JAR steps required the ``Jar=`` parameter, which specifies the path and file name of the JAR. Optional parameters are the following:: | |
359 | ||
360 | Type, Name, ActionOnFailure, Args, MainClass | |
361 | ||
362 | If main class is not specified, the JAR file should specify Main-Class in its manifest file. | |
363 | ||
364 | Command:: | |
356 | Custom JAR steps require the ``Jar=`` parameter, which specifies the path and file name of the JAR. Optional parameters are ``Type``, ``Name``, ``ActionOnFailure``, ``Args``, and ``MainClass``. If main class is not specified, the JAR file should specify ``Main-Class`` in its manifest file. :: | |
365 | 357 | |
366 | 358 | aws emr create-cluster \ |
367 | 359 | --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 \ |
371 | 363 | |
372 | 364 | **Example 18: To add streaming steps when creating a cluster** |
373 | 365 | |
374 | The following ``create-cluster`` examples add a streaming step to a cluster that terminates after all steps run. | |
375 | ||
376 | Streaming steps required parameters:: | |
377 | ||
378 | Type, Args | |
379 | ||
380 | Streaming steps optional parameters:: | |
381 | ||
382 | Name, ActionOnFailure | |
366 | The following ``create-cluster`` examples add a streaming step to a cluster that terminates after all steps run. Streaming steps require parameters ``Type`` and ``Args``. Streaming steps optional parameters are ``Name`` and ``ActionOnFailure``. | |
383 | 367 | |
384 | 368 | The following example specifies the step inline. :: |
385 | 369 | |
389 | 373 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large \ |
390 | 374 | --auto-terminate |
391 | 375 | |
392 | The following example uses a locally stored JSON configuration file named ``multiplefiles.json``. The JSON configuration specifies multiple files. To specify multiple files within a step, you must use a JSON configuration file to specify the step. | |
376 | The following example uses a locally stored JSON configuration file named ``multiplefiles.json``. The JSON configuration specifies multiple files. To specify multiple files within a step, you must use a JSON configuration file to specify the step. JSON arguments must include options and values as their own items in the list. :: | |
377 | ||
378 | aws emr create-cluster \ | |
379 | --steps file://./multiplefiles.json \ | |
380 | --release-label emr-5.9.0 \ | |
381 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large \ | |
382 | --auto-terminate | |
393 | 383 | |
394 | 384 | Contents of ``multiplefiles.json``:: |
395 | 385 | |
413 | 403 | } |
414 | 404 | ] |
415 | 405 | |
416 | NOTE: JSON arguments must include options and values as their own items in the list. | |
417 | ||
418 | Command:: | |
419 | ||
420 | aws emr create-cluster \ | |
421 | --steps file://./multiplefiles.json \ | |
422 | --release-label emr-5.9.0 \ | |
423 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large \ | |
424 | --auto-terminate | |
425 | ||
426 | 406 | **Example 19: To add Hive steps when creating a cluster** |
427 | 407 | |
428 | Command:: | |
408 | The following example add Hive steps when creating a cluster. Hive steps require parameters ``Type`` and ``Args``. Hive steps optional parameters are ``Name`` and ``ActionOnFailure``. :: | |
429 | 409 | |
430 | 410 | aws emr create-cluster \ |
431 | 411 | --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] \ |
433 | 413 | --release-label emr-5.3.1 \ |
434 | 414 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large |
435 | 415 | |
436 | Hive steps required parameters:: | |
437 | ||
438 | Type, Args | |
439 | ||
440 | Hive steps optional parameters:: | |
441 | ||
442 | Name, ActionOnFailure | |
443 | ||
444 | 416 | **Example 20: To add Pig steps when creating a cluster** |
445 | 417 | |
446 | Command:: | |
418 | The following example adds Pig steps when creating a cluster. Pig steps required parameters are ``Type`` and ``Args``. Pig steps optional parameters are ``Name`` and ``ActionOnFailure``. :: | |
447 | 419 | |
448 | 420 | aws emr create-cluster \ |
449 | 421 | --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] \ |
451 | 423 | --release-label emr-5.3.1 \ |
452 | 424 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large |
453 | 425 | |
454 | Pig steps required parameters:: | |
455 | ||
456 | Type, Args | |
457 | ||
458 | Pig steps optional parameters:: | |
459 | ||
460 | Name, ActionOnFailure | |
461 | ||
462 | 426 | **Example 21: To add bootstrap actions** |
463 | 427 | |
464 | 428 | The following ``create-cluster`` example runs two bootstrap actions defined as scripts that are stored in Amazon S3. :: |
478 | 442 | --release-label emr-5.9.0 \ |
479 | 443 | --emrfs Consistent=true,RetryCount=6,RetryPeriod=30 |
480 | 444 | |
481 | The following example specifies the same EMRFS configuration as the previous example, using a locally stored JSON configuration file named ``emrfsconfig.json``. | |
445 | The following example specifies the same EMRFS configuration as the previous example, using a locally stored JSON configuration file named ``emrfsconfig.json``. :: | |
446 | ||
447 | aws emr create-cluster \ | |
448 | --instance-type m4.large \ | |
449 | --release-label emr-5.9.0 \ | |
450 | --emrfs file://emrfsconfig.json | |
482 | 451 | |
483 | 452 | Contents of ``emrfsconfig.json``:: |
484 | 453 | |
488 | 457 | "RetryPeriod": 30 |
489 | 458 | } |
490 | 459 | |
491 | Command:: | |
492 | ||
493 | aws emr create-cluster \ | |
494 | --instance-type m4.large \ | |
495 | --release-label emr-5.9.0 \ | |
496 | --emrfs file://emrfsconfig.json | |
497 | ||
498 | 460 | **Example 23: To create a cluster with Kerberos configured** |
499 | 461 | |
500 | 462 | The following ``create-cluster`` examples create a cluster using a security configuration with Kerberos enabled, and establishes Kerberos parameters for the cluster using ``--kerberos-attributes``. |
509 | 471 | --security-configuration mySecurityConfiguration \ |
510 | 472 | --kerberos-attributes Realm=EC2.INTERNAL,KdcAdminPassword=123,CrossRealmTrustPrincipalPassword=123 |
511 | 473 | |
512 | The following command specifies the same attributes, but references a locally stored JSON file named ``kerberos_attributes.json``. In this example, the file is saved in the same directory where you run the command. You can also reference a configuration file saved in Amazon S3. | |
474 | The following command specifies the same attributes, but references a locally stored JSON file named ``kerberos_attributes.json``. In this example, the file is saved in the same directory where you run the command. You can also reference a configuration file saved in Amazon S3. :: | |
475 | ||
476 | aws emr create-cluster \ | |
477 | --instance-type m3.xlarge \ | |
478 | --release-label emr-5.10.0 \ | |
479 | --service-role EMR_DefaultRole \ | |
480 | --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole \ | |
481 | --security-configuration mySecurityConfiguration \ | |
482 | --kerberos-attributes file://kerberos_attributes.json | |
513 | 483 | |
514 | 484 | Contents of ``kerberos_attributes.json``:: |
515 | 485 | |
519 | 489 | "CrossRealmTrustPrincipalPassword": "123", |
520 | 490 | } |
521 | 491 | |
522 | Command:: | |
523 | ||
524 | aws emr create-cluster \ | |
525 | --instance-type m3.xlarge \ | |
526 | --release-label emr-5.10.0 \ | |
492 | The following ``create-cluster`` example creates an Amazon EMR cluster that uses the ``--instance-groups`` configuration and has a managed scaling policy. :: | |
493 | ||
494 | aws emr create-cluster \ | |
495 | --release-label emr-5.30.0 \ | |
527 | 496 | --service-role EMR_DefaultRole \ |
528 | 497 | --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole \ |
529 | --security-configuration mySecurityConfiguration \ | |
530 | --kerberos-attributes file://kerberos_attributes.json | |
531 | ||
532 | The following ``create-cluster`` example creates an Amazon EMR cluster that uses the ``--instance-groups`` configuration and has a managed scaling policy. :: | |
533 | ||
534 | aws emr create-cluster \ | |
535 | --release-label emr-5.30.0 \ | |
536 | --service-role EMR_DefaultRole \ | |
537 | --ec2-attributes InstanceProfile=EMR_EC2_DefaultRole \ | |
538 | 498 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large |
539 | 499 | --managed-scaling-policy ComputeLimits='{MinimumCapacityUnits=2,MaximumCapacityUnits=4,UnitType=Instances}' |
540 | 500 | |
541 | The following ``create-cluster`` example creates an Amazon EMR cluster that uses the "--log-encryption-kms-key-id" to define KMS key ID utilized for Log encryption. | |
542 | ||
543 | Command:: | |
501 | The following ``create-cluster`` example creates an Amazon EMR cluster that uses the "--log-encryption-kms-key-id" to define KMS key ID utilized for Log encryption. :: | |
544 | 502 | |
545 | 503 | aws emr create-cluster \ |
546 | 504 | --release-label emr-5.30.0 \ |
548 | 506 | --log-encryption-kms-key-id arn:aws:kms:us-east-1:110302272565:key/dd559181-283e-45d7-99d1-66da348c4d33 \ |
549 | 507 | --instance-groups InstanceGroupType=MASTER,InstanceCount=1,InstanceType=m4.large InstanceGroupType=CORE,InstanceCount=2,InstanceType=m4.large |
550 | 508 | |
551 | The following ``create-cluster`` example creates an Amazon EMR cluster that uses the "--placement-group-configs" configuration to place master nodes in a high-availability (HA) cluster within an EC2 placement group using ``SPREAD`` placement strategy. | |
552 | ||
553 | Command:: | |
509 | The following ``create-cluster`` example creates an Amazon EMR cluster that uses the "--placement-group-configs" configuration to place master nodes in a high-availability (HA) cluster within an EC2 placement group using ``SPREAD`` placement strategy. :: | |
554 | 510 | |
555 | 511 | aws emr create-cluster \ |
556 | 512 | --release-label emr-5.30.0 \ |
0 | **To create an experiment template** | |
1 | ||
2 | The following ``create-experiment-template`` example creates an experiment template in your AWS FIS account. :: | |
3 | ||
4 | aws fis create-experiment-template \ | |
5 | --cli-input-json file://myfile.json | |
6 | ||
7 | Contents of ``myfile.json``:: | |
8 | ||
9 | { | |
10 | "description": "experimentTemplate", | |
11 | "stopConditions": [ | |
12 | { | |
13 | "source": "aws:cloudwatch:alarm", | |
14 | "value": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:alarmName" | |
15 | } | |
16 | ], | |
17 | "targets": { | |
18 | "Instances-Target-1": { | |
19 | "resourceType": "aws:ec2:instance", | |
20 | "resourceArns": [ | |
21 | "arn:aws:ec2:us-west-2:123456789012:instance/i-12a3b4c56d78e9012" | |
22 | ], | |
23 | "selectionMode": "ALL" | |
24 | } | |
25 | }, | |
26 | "actions": { | |
27 | "reboot": { | |
28 | "actionId": "aws:ec2:reboot-instances", | |
29 | "description": "reboot", | |
30 | "parameters": {}, | |
31 | "targets": { | |
32 | "Instances": "Instances-Target-1" | |
33 | } | |
34 | } | |
35 | }, | |
36 | "roleArn": "arn:aws:iam::123456789012:role/myRole" | |
37 | } | |
38 | ||
39 | Output:: | |
40 | ||
41 | { | |
42 | "experimentTemplate": { | |
43 | "id": "ABCDE1fgHIJkLmNop", | |
44 | "description": "experimentTemplate", | |
45 | "targets": { | |
46 | "Instances-Target-1": { | |
47 | "resourceType": "aws:ec2:instance", | |
48 | "resourceArns": [ | |
49 | "arn:aws:ec2:us-west-2:123456789012:instance/i-12a3b4c56d78e9012" | |
50 | ], | |
51 | "selectionMode": "ALL" | |
52 | } | |
53 | }, | |
54 | "actions": { | |
55 | "reboot": { | |
56 | "actionId": "aws:ec2:reboot-instances", | |
57 | "description": "reboot", | |
58 | "parameters": {}, | |
59 | "targets": { | |
60 | "Instances": "Instances-Target-1" | |
61 | } | |
62 | } | |
63 | }, | |
64 | "stopConditions": [ | |
65 | { | |
66 | "source": "aws:cloudwatch:alarm", | |
67 | "value": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:alarmName" | |
68 | } | |
69 | ], | |
70 | "creationTime": 1616434850.659, | |
71 | "lastUpdateTime": 1616434850.659, | |
72 | "roleArn": "arn:aws:iam::123456789012:role/myRole", | |
73 | "tags": {} | |
74 | } | |
75 | } | |
76 | ||
77 | For more information, see `Create an experiment template <https://docs.aws.amazon.com/fis/latest/userguide/working-with-templates.html#create-template>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To delete an experiment template** | |
1 | ||
2 | The following ``delete-experiment-template`` example deletes the specified experiment template. :: | |
3 | ||
4 | aws fis delete-experiment-template \ | |
5 | --id ABCDE1fgHIJkLmNop | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "experimentTemplate": { | |
11 | "id": "ABCDE1fgHIJkLmNop", | |
12 | "description": "myExperimentTemplate", | |
13 | "targets": { | |
14 | "Instances-Target-1": { | |
15 | "resourceType": "aws:ec2:instance", | |
16 | "resourceArns": [ | |
17 | "arn:aws:ec2:us-west-2:123456789012:instance/i-12a3b4c56d78e9012" | |
18 | ], | |
19 | "selectionMode": "ALL" | |
20 | } | |
21 | }, | |
22 | "actions": { | |
23 | "testaction": { | |
24 | "actionId": "aws:ec2:stop-instances", | |
25 | "parameters": {}, | |
26 | "targets": { | |
27 | "Instances": "Instances-Target-1" | |
28 | } | |
29 | } | |
30 | }, | |
31 | "stopConditions": [ | |
32 | { | |
33 | "source": "none" | |
34 | } | |
35 | ], | |
36 | "creationTime": 1616017191.124, | |
37 | "lastUpdateTime": 1616017859.607, | |
38 | "roleArn": "arn:aws:iam::123456789012:role/FISRole" | |
39 | } | |
40 | } | |
41 | ||
42 | For more information, see `Delete an experiment template <https://docs.aws.amazon.com/fis/latest/userguide/working-with-templates.html#delete-template>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To get action details** | |
1 | ||
2 | The following ``get-action`` example gets the details of the specified action. :: | |
3 | ||
4 | aws fis get-action \ | |
5 | --id aws:ec2:stop-instances | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "action": { | |
11 | "id": "aws:ec2:stop-instances", | |
12 | "description": "Stop the specified EC2 instances.", | |
13 | "parameters": { | |
14 | "startInstancesAfterDuration": { | |
15 | "description": "The time to wait before restarting the instances (ISO 8601 duration).", | |
16 | "required": false | |
17 | } | |
18 | }, | |
19 | "targets": { | |
20 | "Instances": { | |
21 | "resourceType": "aws:ec2:instance" | |
22 | } | |
23 | }, | |
24 | "tags": {} | |
25 | } | |
26 | } | |
27 | ||
28 | For more information, see `Actions <https://docs.aws.amazon.com/fis/latest/userguide/actions.html>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To get experiment template details** | |
1 | ||
2 | The following ``get-experiment-template`` example gets the details of the specified experiment template. :: | |
3 | ||
4 | aws fis get-experiment-template \ | |
5 | --id ABCDE1fgHIJkLmNop | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "experimentTemplate": { | |
11 | "id": "ABCDE1fgHIJkLmNop", | |
12 | "description": "myExperimentTemplate", | |
13 | "targets": { | |
14 | "Instances-Target-1": { | |
15 | "resourceType": "aws:ec2:instance", | |
16 | "resourceArns": [ | |
17 | "arn:aws:ec2:us-west-2:123456789012:instance/i-12a3b4c56d78e9012" | |
18 | ], | |
19 | "selectionMode": "ALL" | |
20 | } | |
21 | }, | |
22 | "actions": { | |
23 | "testaction": { | |
24 | "actionId": "aws:ec2:stop-instances", | |
25 | "parameters": {}, | |
26 | "targets": { | |
27 | "Instances": "Instances-Target-1" | |
28 | } | |
29 | } | |
30 | }, | |
31 | "stopConditions": [ | |
32 | { | |
33 | "source": "none" | |
34 | } | |
35 | ], | |
36 | "creationTime": 1616017191.124, | |
37 | "lastUpdateTime": 1616017331.51, | |
38 | "roleArn": "arn:aws:iam::123456789012:role/FISRole", | |
39 | "tags": { | |
40 | "key: "value" | |
41 | } | |
42 | } | |
43 | } | |
44 | ||
45 | For more information, see `Experiment templates <https://docs.aws.amazon.com/fis/latest/userguide/experiment-templates.html>`__ in the *AWS Fault Injection Simulator User Guide*.⏎ |
0 | **To get experiment details** | |
1 | ||
2 | The following ``get-experiment`` example gets the details of the specified experiment. :: | |
3 | ||
4 | aws fis get-experiment \ | |
5 | --id ABC12DeFGhI3jKLMNOP | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "experiment": { | |
11 | "id": "ABC12DeFGhI3jKLMNOP", | |
12 | "experimentTemplateId": "ABCDE1fgHIJkLmNop", | |
13 | "roleArn": "arn:aws:iam::123456789012:role/myRole", | |
14 | "state": { | |
15 | "status": "completed", | |
16 | "reason": "Experiment completed." | |
17 | }, | |
18 | "targets": { | |
19 | "Instances-Target-1": { | |
20 | "resourceType": "aws:ec2:instance", | |
21 | "resourceArns": [ | |
22 | "arn:aws:ec2:us-west-2:123456789012:instance/i-12a3b4c56d78e9012" | |
23 | ], | |
24 | "selectionMode": "ALL" | |
25 | } | |
26 | }, | |
27 | "actions": { | |
28 | "reboot": { | |
29 | "actionId": "aws:ec2:reboot-instances", | |
30 | "parameters": {}, | |
31 | "targets": { | |
32 | "Instances": "Instances-Target-1" | |
33 | }, | |
34 | "state": { | |
35 | "status": "completed", | |
36 | "reason": "Action was completed." | |
37 | } | |
38 | } | |
39 | }, | |
40 | "stopConditions": [ | |
41 | { | |
42 | "source": "none" | |
43 | } | |
44 | ], | |
45 | "creationTime": 1616432509.662, | |
46 | "startTime": 1616432509.962, | |
47 | "endTime": 1616432522.307, | |
48 | "tags": {} | |
49 | } | |
50 | } | |
51 | ||
52 | For more information, see `Experiments for AWS FIS <https://docs.aws.amazon.com/fis/latest/userguide/experiments.html>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To list actions** | |
1 | ||
2 | The following ``list-actions`` example lists the available actions. :: | |
3 | ||
4 | aws fis list-actions | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "actions": [ | |
10 | { | |
11 | "id": "aws:ec2:reboot-instances", | |
12 | "description": "Reboot the specified EC2 instances.", | |
13 | "targets": { | |
14 | "Instances": { | |
15 | "resourceType": "aws:ec2:instance" | |
16 | } | |
17 | }, | |
18 | "tags": {} | |
19 | }, | |
20 | { | |
21 | "id": "aws:ec2:stop-instances", | |
22 | "description": "Stop the specified EC2 instances.", | |
23 | "targets": { | |
24 | "Instances": { | |
25 | "resourceType": "aws:ec2:instance" | |
26 | } | |
27 | }, | |
28 | "tags": {} | |
29 | }, | |
30 | { | |
31 | "id": "aws:ec2:terminate-instances", | |
32 | "description": "Terminate the specified EC2 instances.", | |
33 | "targets": { | |
34 | "Instances": { | |
35 | "resourceType": "aws:ec2:instance" | |
36 | } | |
37 | }, | |
38 | "tags": {} | |
39 | }, | |
40 | { | |
41 | "id": "aws:ecs:drain-container-instances", | |
42 | "description": "Drain percentage of underlying EC2 instances on an ECS cluster.", | |
43 | "targets": { | |
44 | "Clusters": { | |
45 | "resourceType": "aws:ecs:cluster" | |
46 | } | |
47 | }, | |
48 | "tags": {} | |
49 | }, | |
50 | { | |
51 | "id": "aws:eks:terminate-nodegroup-instances", | |
52 | "description": "Terminates a percentage of the underlying EC2 instances in an EKS cluster.", | |
53 | "targets": { | |
54 | "Nodegroups": { | |
55 | "resourceType": "aws:eks:nodegroup" | |
56 | } | |
57 | }, | |
58 | "tags": {} | |
59 | }, | |
60 | { | |
61 | "id": "aws:fis:inject-api-internal-error", | |
62 | "description": "Cause an AWS service to return internal error responses for specific callers and operations.", | |
63 | "targets": { | |
64 | "Roles": { | |
65 | "resourceType": "aws:iam:role" | |
66 | } | |
67 | }, | |
68 | "tags": {} | |
69 | }, | |
70 | { | |
71 | "id": "aws:fis:inject-api-throttle-error", | |
72 | "description": "Cause an AWS service to return throttled responses for specific callers and operations.", | |
73 | "targets": { | |
74 | "Roles": { | |
75 | "resourceType": "aws:iam:role" | |
76 | } | |
77 | }, | |
78 | "tags": {} | |
79 | }, | |
80 | { | |
81 | "id": "aws:fis:inject-api-unavailable-error", | |
82 | "description": "Cause an AWS service to return unavailable error responses for specific callers and operations.", | |
83 | "targets": { | |
84 | "Roles": { | |
85 | "resourceType": "aws:iam:role" | |
86 | } | |
87 | }, | |
88 | "tags": {} | |
89 | }, | |
90 | { | |
91 | "id": "aws:fis:wait", | |
92 | "description": "Wait for the specified duration. Stop condition monitoring will continue during this time.", | |
93 | "tags": {} | |
94 | }, | |
95 | { | |
96 | "id": "aws:rds:failover-db-cluster", | |
97 | "description": "Failover a DB Cluster to one of the replicas.", | |
98 | "targets": { | |
99 | "Clusters": { | |
100 | "resourceType": "aws:rds:cluster" | |
101 | } | |
102 | }, | |
103 | "tags": {} | |
104 | }, | |
105 | { | |
106 | "id": "aws:rds:reboot-db-instances", | |
107 | "description": "Reboot the specified DB instances.", | |
108 | "targets": { | |
109 | "DBInstances": { | |
110 | "resourceType": "aws:rds:db" | |
111 | } | |
112 | }, | |
113 | "tags": {} | |
114 | }, | |
115 | { | |
116 | "id": "aws:ssm:send-command", | |
117 | "description": "Run the specified SSM document.", | |
118 | "targets": { | |
119 | "Instances": { | |
120 | "resourceType": "aws:ec2:instance" | |
121 | } | |
122 | }, | |
123 | "tags": {} | |
124 | } | |
125 | ] | |
126 | } | |
127 | ||
128 | For more information, see `Actions <https://docs.aws.amazon.com/fis/latest/userguide/actions.html>`__ in the *AWS Fault Injection Simulator User Guide*.⏎ |
0 | **To list experiment templates** | |
1 | ||
2 | The following ``list-experiment-templates`` example lists the experiment templates in your AWS account. :: | |
3 | ||
4 | aws fis list-experiment-templates | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "experimentTemplates": [ | |
10 | { | |
11 | "id": "ABCDE1fgHIJkLmNop", | |
12 | "description": "myExperimentTemplate", | |
13 | "creationTime": 1616017191.124, | |
14 | "lastUpdateTime": 1616017191.124, | |
15 | "tags": { | |
16 | "key": "value" | |
17 | } | |
18 | } | |
19 | ] | |
20 | } | |
21 | ||
22 | For more information, see `Experiment templates <https://docs.aws.amazon.com/fis/latest/userguide/experiment-templates.html>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To list experiments** | |
1 | ||
2 | The following ``list-experiments`` example lists the experiments in your AWS account. :: | |
3 | ||
4 | aws fis list-experiments | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "experiments": [ | |
10 | { | |
11 | "id": "ABCdeF1GHiJkLM23NO", | |
12 | "experimentTemplateId": "ABCDE1fgHIJkLmNop", | |
13 | "state": { | |
14 | "status": "running", | |
15 | "reason": "Experiment is running." | |
16 | }, | |
17 | "creationTime": 1616017341.197, | |
18 | "tags": { | |
19 | "key": "value" | |
20 | } | |
21 | } | |
22 | ] | |
23 | } | |
24 | ||
25 | For more information, see `Experiments <https://docs.aws.amazon.com/fis/latest/userguide/experiments.html>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To list tags for a resource** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists the tags for the specified resource. :: | |
3 | ||
4 | aws fis list-tags-for-resource \ | |
5 | --resource-arn arn:aws:fis:us-west-2:123456789012:experiment/ABC12DeFGhI3jKLMNOP | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "tags": { | |
11 | "key1": "value1", | |
12 | "key2": "value2" | |
13 | } | |
14 | } | |
15 | ||
16 | For more information, see `Tag your AWS FIS resources <https://docs.aws.amazon.com/fis/latest/userguide/tagging.html>`__ in the *AWS Fault Injection Simulator User Guide*.⏎ |
0 | **To start an experiment** | |
1 | ||
2 | The following ``start-experiment`` example starts the specified experiment. :: | |
3 | ||
4 | aws fis start-experiment \ | |
5 | --experiment-template-id ABCDE1fgHIJkLmNop | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "experiment": { | |
11 | "id": "ABC12DeFGhI3jKLMNOP", | |
12 | "experimentTemplateId": "ABCDE1fgHIJkLmNop", | |
13 | "roleArn": "arn:aws:iam::123456789012:role/myRole", | |
14 | "state": { | |
15 | "status": "initiating", | |
16 | "reason": "Experiment is initiating." | |
17 | }, | |
18 | "targets": { | |
19 | "Instances-Target-1": { | |
20 | "resourceType": "aws:ec2:instance", | |
21 | "resourceArns": [ | |
22 | "arn:aws:ec2:us-west-2:123456789012:instance/i-12a3b4c56d78e9012" | |
23 | ], | |
24 | "selectionMode": "ALL" | |
25 | } | |
26 | }, | |
27 | "actions": { | |
28 | "reboot": { | |
29 | "actionId": "aws:ec2:reboot-instances", | |
30 | "parameters": {}, | |
31 | "targets": { | |
32 | "Instances": "Instances-Target-1" | |
33 | }, | |
34 | "state": { | |
35 | "status": "pending", | |
36 | "reason": "Initial state" | |
37 | } | |
38 | } | |
39 | }, | |
40 | "stopConditions": [ | |
41 | { | |
42 | "source": "none" | |
43 | } | |
44 | ], | |
45 | "creationTime": 1616432464.025, | |
46 | "startTime": 1616432464.374, | |
47 | "tags": {} | |
48 | } | |
49 | } | |
50 | ||
51 | For more information, see `Experiments for AWS FIS <https://docs.aws.amazon.com/fis/latest/userguide/experiments.html>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To stop an experiment** | |
1 | ||
2 | The following ``stop-experiment`` example stops the specified experiment from running. :: | |
3 | ||
4 | aws fis stop-experiment \ | |
5 | --id ABC12DeFGhI3jKLMNOP | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "experiment": { | |
11 | "id": "ABC12DeFGhI3jKLMNOP", | |
12 | "experimentTemplateId": "ABCDE1fgHIJkLmNop", | |
13 | "roleArn": "arn:aws:iam::123456789012:role/myRole", | |
14 | "state": { | |
15 | "status": "stopping", | |
16 | "reason": "Stopping Experiment." | |
17 | }, | |
18 | "targets": { | |
19 | "Instances-Target-1": { | |
20 | "resourceType": "aws:ec2:instance", | |
21 | "resourceArns": [ | |
22 | "arn:aws:ec2:us-west-2:123456789012:instance/i-12a3b4c56d78e9012" | |
23 | ], | |
24 | "selectionMode": "ALL" | |
25 | } | |
26 | }, | |
27 | "actions": { | |
28 | "reboot": { | |
29 | "actionId": "aws:ec2:reboot-instances", | |
30 | "parameters": {}, | |
31 | "targets": { | |
32 | "Instances": "Instances-Target-1" | |
33 | }, | |
34 | "startAfter": [ | |
35 | "wait" | |
36 | ], | |
37 | "state": { | |
38 | "status": "pending", | |
39 | "reason": "Initial state." | |
40 | } | |
41 | }, | |
42 | "wait": { | |
43 | "actionId": "aws:fis:wait", | |
44 | "parameters": { | |
45 | "duration": "PT5M" | |
46 | }, | |
47 | "state": { | |
48 | "status": "running", | |
49 | "reason": "" | |
50 | } | |
51 | } | |
52 | }, | |
53 | "stopConditions": [ | |
54 | { | |
55 | "source": "none" | |
56 | } | |
57 | ], | |
58 | "creationTime": 1616432680.927, | |
59 | "startTime": 1616432681.177, | |
60 | "tags": {} | |
61 | } | |
62 | } | |
63 | ||
64 | For more information, see `Experiments for AWS FIS <https://docs.aws.amazon.com/fis/latest/userguide/experiments.html>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To tag a resource** | |
1 | ||
2 | The following ``tag-resource`` example tags the specified resource. :: | |
3 | ||
4 | aws fis tag-resource \ | |
5 | --resource-arn arn:aws:fis:us-west-2:123456789012:experiment/ABC12DeFGhI3jKLMNOP \ | |
6 | --tags key1=value1,key2=value2 | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tag your AWS FIS resources <https://docs.aws.amazon.com/fis/latest/userguide/tagging.html>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To untag a resource** | |
1 | ||
2 | The following ``untag-resource`` example removes the tags from the specified resource. :: | |
3 | ||
4 | aws fis untag-resource \ | |
5 | --resource-arn arn:aws:fis:us-west-2:123456789012:experiment/ABC12DeFGhI3jKLMNOP | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Tag your AWS FIS resources <https://docs.aws.amazon.com/fis/latest/userguide/tagging.html>`__ in the *AWS Fault Injection Simulator User Guide*. |
0 | **To update an experiment template** | |
1 | ||
2 | The following ``update-experiment-template`` example updates the description of the specified experiment template. :: | |
3 | ||
4 | aws fis update-experiment-template \ | |
5 | --id ABCDE1fgHIJkLmNop \ | |
6 | ---description myExperimentTemplate | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "experimentTemplate": { | |
12 | "id": "ABCDE1fgHIJkLmNop", | |
13 | "description": "myExperimentTemplate", | |
14 | "targets": { | |
15 | "Instances-Target-1": { | |
16 | "resourceType": "aws:ec2:instance", | |
17 | "resourceArns": [ | |
18 | "arn:aws:ec2:us-west-2:123456789012:instance/i-12a3b4c56d78e9012" | |
19 | ], | |
20 | "selectionMode": "ALL" | |
21 | } | |
22 | }, | |
23 | "actions": { | |
24 | "testaction": { | |
25 | "actionId": "aws:ec2:stop-instances", | |
26 | "parameters": {}, | |
27 | "targets": { | |
28 | "Instances": "Instances-Target-1" | |
29 | } | |
30 | } | |
31 | }, | |
32 | "stopConditions": [ | |
33 | { | |
34 | "source": "none" | |
35 | } | |
36 | ], | |
37 | "creationTime": 1616017191.124, | |
38 | "lastUpdateTime": 1616017859.607, | |
39 | "roleArn": "arn:aws:iam::123456789012:role/FISRole", | |
40 | "tags": { | |
41 | "key": "value" | |
42 | } | |
43 | } | |
44 | } | |
45 | ||
46 | For more information, see `Update an experiment template <https://docs.aws.amazon.com/fis/latest/userguide/working-with-templates.html#update-template>`__ in the *AWS Fault Injection Simulator User Guide*.⏎ |
0 | **To add a VPC subnet endpoint to an endpoint group for a custom routing accelerator** | |
1 | ||
2 | The following ``add-custom-routing-endpoints`` example adds a VPC subnet endpoint to an endpoint group for a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator add-custom-routing-endpoints \ | |
5 | --endpoint-group-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/4321abcd \ | |
6 | --endpoint-configurations "EndpointId=subnet-1234567890abcdef0" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "EndpointDescriptions": [ | |
12 | { | |
13 | "EndpointId": "subnet-1234567890abcdef0" | |
14 | } | |
15 | ], | |
16 | "EndpointGroupArn":"arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/4321abcd" | |
17 | } | |
18 | ||
19 | For more information, see `VPC subnet endpoints for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-endpoints.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
13 | 13 | } |
14 | 14 | } |
15 | 15 | |
16 | For more information, see `Bring Your Own IP Address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
16 | For more information, see `Bring Your Own IP Address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To allow traffic to specific Amazon EC2 instance destinations in a VPC subnet for a custom routing accelerator** | |
1 | ||
2 | The following ``allow-custom-routing-traffic`` example specifies that traffic is allowed to certain Amazon EC2 instance (destination) IP addresses and ports for a VPC subnet endpoint in a custom routing accelerator can receive traffic. :: | |
3 | ||
4 | aws globalaccelerator allow-custom-routing-traffic \ | |
5 | --endpoint-group-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/ab88888example \ | |
6 | --endpoint-id subnet-abcd123example \ | |
7 | --destination-addresses "172.31.200.6" "172.31.200.7" \ | |
8 | --destination-ports 80 81 | |
9 | ||
10 | This command produces no output. | |
11 | ||
12 | For more information, see `VPC subnet endpoints for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-endpoints.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To create an accelerator** |
1 | 1 | |
2 | The following ``create-accelerator`` example creates an accelerator with two tags. You must specify the ``US-West-2 (Oregon)`` Region to create or update an accelerator. :: | |
2 | The following ``create-accelerator`` example creates an accelerator with two tags with two BYOIP static IP addresses. You must specify the ``US-West-2 (Oregon)`` Region to create or update an accelerator. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator create-accelerator \ |
5 | 5 | --name ExampleAccelerator \ |
6 | 6 | --tags Key="Name",Value="Example Name" Key="Project",Value="Example Project" \ |
7 | --region us-west-2 \ | |
8 | 7 | --ip-addresses 192.0.2.250 198.51.100.52 |
9 | 8 | |
10 | 9 | Output:: |
31 | 30 | } |
32 | 31 | } |
33 | 32 | |
34 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
33 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To create a custom routing accelerator** | |
1 | ||
2 | The following ``create-custom-routing-accelerator`` example creates a custom routing accelerator with the tags ``Name`` and ``Project``. :: | |
3 | ||
4 | aws globalaccelerator create-custom-routing-accelerator \ | |
5 | --name ExampleCustomRoutingAccelerator \ | |
6 | --tags Key="Name",Value="Example Name" Key="Project",Value="Example Project" \ | |
7 | --ip-addresses 192.0.2.250 198.51.100.52 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Accelerator": { | |
13 | "AcceleratorArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh", | |
14 | "IpAddressType": "IPV4", | |
15 | "Name": "ExampleCustomRoutingAccelerator", | |
16 | "Enabled": true, | |
17 | "Status": "IN_PROGRESS", | |
18 | "IpSets": [ | |
19 | { | |
20 | "IpAddresses": [ | |
21 | "192.0.2.250", | |
22 | "198.51.100.52" | |
23 | ], | |
24 | "IpFamily": "IPv4" | |
25 | } | |
26 | ], | |
27 | "DnsName":"a1234567890abcdef.awsglobalaccelerator.com", | |
28 | "CreatedTime": 1542394847.0, | |
29 | "LastModifiedTime": 1542394847.0 | |
30 | } | |
31 | } | |
32 | ||
33 | For more information, see `Custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*. |
0 | **To create an endpoint group for a custom routing accelerator** | |
1 | ||
2 | The following ``create-custom-routing-endpoint-group`` example creates an endpoint group for a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator create-custom-routing-endpoint-group \ | |
5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz \ | |
6 | --endpoint-group-region us-east-2 \ | |
7 | --destination-configurations "FromPort=80,ToPort=81,Protocols=TCP,UDP" | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "EndpointGroup": { | |
13 | "EndpointGroupArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/4321abcd", | |
14 | "EndpointGroupRegion": "us-east-2", | |
15 | "DestinationDescriptions": [ | |
16 | { | |
17 | "FromPort": 80, | |
18 | "ToPort": 81, | |
19 | "Protocols": [ | |
20 | "TCP", | |
21 | "UDP" | |
22 | ] | |
23 | } | |
24 | ], | |
25 | "EndpointDescriptions": [] | |
26 | } | |
27 | } | |
28 | ||
29 | For more information, see `Endpoint groups for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To create a listener for a custom routing accelerator** | |
1 | ||
2 | The following ``create-custom-routing-listener`` example creates a listener with a port range from 5000 to 10000 for a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator create-custom-routing-listener \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --port-ranges FromPort=5000,ToPort=10000 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Listener": { | |
12 | "PortRange": [ | |
13 | "FromPort": 5000, | |
14 | "ToPort": 10000 | |
15 | ], | |
16 | "ListenerArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz" | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Listeners for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*. |
4 | 4 | aws globalaccelerator create-endpoint-group \ |
5 | 5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz \ |
6 | 6 | --endpoint-group-region us-east-1 \ |
7 | --endpoint-configurations EndpointId=i-1234567890abcdef0,Weight=128 \ | |
8 | --region us-west-2 | |
7 | --endpoint-configurations EndpointId=i-1234567890abcdef0,Weight=128 | |
9 | 8 | |
10 | 9 | Output:: |
11 | 10 | |
23 | 22 | } |
24 | 23 | } |
25 | 24 | |
26 | For more information, see `Endpoint Groups in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
25 | For more information, see `Endpoint groups in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*. |
4 | 4 | aws globalaccelerator create-listener \ |
5 | 5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ |
6 | 6 | --port-ranges FromPort=80,ToPort=80 FromPort=81,ToPort=81 \ |
7 | --protocol TCP \ | |
8 | --region us-west-2 | |
7 | --protocol TCP | |
9 | 8 | |
10 | 9 | Output:: |
11 | 10 | |
27 | 26 | } |
28 | 27 | } |
29 | 28 | |
30 | For more information, see `Listeners in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
29 | For more information, see `Listeners in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To specify a destination address that cannot receive traffic in a custom routing accelerator** | |
1 | ||
2 | The following ``deny-custom-routing-traffic`` example specifies destination address or addresses in a subnet endpoint that cannot receive traffic for a custom routing accelerator. To specify more than one destination address, separate the addresses with a space. There's no response for a successful deny-custom-routing-traffic call. :: | |
3 | ||
4 | aws globalaccelerator deny-custom-routing-traffic \ | |
5 | --endpoint-group-arn "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/ab88888example" \ | |
6 | --endpoint-id "subnet-abcd123example" \ | |
7 | --destination-addresses "198.51.100.52" | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `VPC subnet endpoints for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-endpoints.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
13 | 13 | } |
14 | 14 | } |
15 | 15 | |
16 | For more information, see `Bring Your Own IP Address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
17 | ||
16 | For more information, see `Bring your own IP address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To describe an accelerator's attributes** |
1 | 1 | |
2 | The following ``describe-accelerator-attributes`` example describes the attributes for an accelerator. :: | |
2 | The following ``describe-accelerator-attributes`` example retrieves the attribute details for an accelerator. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator describe-accelerator-attributes \ |
5 | 5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh |
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
17 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
17 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
2 | 2 | The following ``describe-accelerator`` example retrieves the details about the specified accelerator. :: |
3 | 3 | |
4 | 4 | aws globalaccelerator describe-accelerator \ |
5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --region us-west-2 | |
5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
11 | 10 | "Accelerator": { |
12 | 11 | "AcceleratorArn": "arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh", |
13 | 12 | "IpAddressType": "IPV4", |
14 | "Name": "ExampleAaccelerator", | |
13 | "Name": "ExampleAccelerator", | |
15 | 14 | "Enabled": true, |
16 | 15 | "Status": "IN_PROGRESS", |
17 | 16 | "IpSets": [ |
29 | 28 | } |
30 | 29 | } |
31 | 30 | |
32 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
31 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
+16
-0
0 | **To describe a custom routing accelerator's attributes** | |
1 | ||
2 | The following ``describe-custom-routing-accelerator-attributes`` example describes the attributes for a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator describe-custom-routing-accelerator-attributes \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "AcceleratorAttributes": { | |
11 | "FlowLogsEnabled": false | |
12 | } | |
13 | } | |
14 | ||
15 | For more information, see `Custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To describe a custom routing accelerator** | |
1 | ||
2 | The following ``describe-custom-routing-accelerator`` example retrieves the details about the specified custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator describe-custom-routing-accelerator \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Accelerator": { | |
11 | "AcceleratorArn": "arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh", | |
12 | "IpAddressType": "IPV4", | |
13 | "Name": "ExampleCustomRoutingAccelerator", | |
14 | "Enabled": true, | |
15 | "Status": "IN_PROGRESS", | |
16 | "IpSets": [ | |
17 | { | |
18 | "IpAddresses": [ | |
19 | "192.0.2.250", | |
20 | "198.51.100.52" | |
21 | ], | |
22 | "IpFamily": "IPv4" | |
23 | } | |
24 | ], | |
25 | "DnsName":"a1234567890abcdef.awsglobalaccelerator.com", | |
26 | "CreatedTime": 1542394847, | |
27 | "LastModifiedTime": 1542395013 | |
28 | } | |
29 | } | |
30 | ||
31 | For more information, see `Custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To describe an endpoint group for a custom routing accelerator** | |
1 | ||
2 | The following ``describe-custom-routing-endpoint-group`` example describes an endpoint group for a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator describe-custom-routing-endpoint-group \ | |
5 | --endpoint-group-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/6789vxyz/endpoint-group/ab88888example | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "EndpointGroup": { | |
11 | "EndpointGroupArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/6789vxyz/endpoint-group/ab88888example", | |
12 | "EndpointGroupRegion": "us-east-2", | |
13 | "DestinationDescriptions": [ | |
14 | { | |
15 | "FromPort": 5000, | |
16 | "ToPort": 10000, | |
17 | "Protocols": [ | |
18 | "UDP" | |
19 | ] | |
20 | } | |
21 | ], | |
22 | "EndpointDescriptions": [ | |
23 | { | |
24 | "EndpointId": "subnet-1234567890abcdef0" | |
25 | } | |
26 | ] | |
27 | } | |
28 | } | |
29 | ||
30 | For more information, see `Endpoint groups for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To describe a listener for a custom routing accelerator** | |
1 | ||
2 | The following ``describe-custom-routing-listener`` example describes a listener for a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator describe-custom-routing-listener \ | |
5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Listener": { | |
11 | "PortRanges": [ | |
12 | "FromPort": 5000, | |
13 | "ToPort": 10000 | |
14 | ], | |
15 | "ListenerArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234" | |
16 | } | |
17 | } | |
18 | ||
19 | For more information, see `Listeners for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To describe an endpoint group** |
1 | 1 | |
2 | The following ``describe-endpoint-group`` example describes an endpoint group. :: | |
2 | The following ``describe-endpoint-group`` example retrieves details about an endpoint group with the following endpoints: an Amazon EC2 instance, an ALB, and an NLB. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator describe-endpoint-group \ |
5 | 5 | --endpoint-group-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/6789vxyz-vxyz-6789-vxyz-6789lmnopqrs/endpoint-group/ab88888example |
10 | 10 | "EndpointGroup": { |
11 | 11 | "TrafficDialPercentage": 100.0, |
12 | 12 | "EndpointDescriptions": [ |
13 | { | |
14 | "Weight": 128, | |
15 | "EndpointId": "i-1234567890abcdef0" | |
16 | }, | |
17 | { | |
18 | "Weight": 128, | |
19 | "EndpointId": "arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/app/ALBTesting/alb01234567890xyz" | |
20 | }, | |
21 | { | |
22 | "Weight": 128, | |
23 | "EndpointId": "arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/net/NLBTesting/alb01234567890qrs" | |
24 | } | |
13 | { | |
14 | "Weight": 128, | |
15 | "EndpointId": "i-1234567890abcdef0" | |
16 | }, | |
17 | { | |
18 | "Weight": 128, | |
19 | "EndpointId": "arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/app/ALBTesting/alb01234567890xyz" | |
20 | }, | |
21 | { | |
22 | "Weight": 128, | |
23 | "EndpointId": "arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/net/NLBTesting/alb01234567890qrs" | |
24 | } | |
25 | 25 | ], |
26 | 26 | "EndpointGroupArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/6789vxyz-vxyz-6789-vxyz-6789lmnopqrs/endpoint-group/4321abcd-abcd-4321-abcd-4321abcdefg", |
27 | 27 | "EndpointGroupRegion": "us-east-1" |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
31 | For more information, see `Endpoint groups in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
2 | 2 | The following ``describe-listener`` example describes a listener. :: |
3 | 3 | |
4 | 4 | aws globalaccelerator describe-listener \ |
5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234 \ | |
6 | --region us-west-2 | |
5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234 | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
21 | 20 | } |
22 | 21 | } |
23 | 22 | |
24 | For more information, see `Listeners in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
23 | For more information, see `Listeners in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To list your accelerators** |
1 | 1 | |
2 | The following ``list-accelerators`` example lists the accelerators in your account. :: | |
2 | The following ``list-accelerators`` example lists the accelerators in your AWS account. This account has two accelerators. :: | |
3 | 3 | |
4 | aws globalaccelerator list-accelerators | |
4 | aws globalaccelerator list-accelerators | |
5 | 5 | |
6 | 6 | Output:: |
7 | 7 | |
8 | 8 | { |
9 | "Accelerators": [ | |
9 | "Accelerators": [ | |
10 | 10 | { |
11 | 11 | "AcceleratorArn": "arn:aws:globalaccelerator::012345678901:accelerator/5555abcd-abcd-5555-abcd-5555EXAMPLE1", |
12 | 12 | "Name": "TestAccelerator", |
48 | 48 | ] |
49 | 49 | } |
50 | 50 | |
51 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
51 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To list your address ranges** |
1 | 1 | |
2 | The following ``advertise-byoip-cidr`` example advertises an address range with AWS Global Accelerator that you've provisioned for use with your AWS resources. :: | |
2 | The following ``list-byoip-cidr`` example list the bring your own IP address (BYOIP) address ranges that you've provisioned for use with Global Accelerator. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator list-byoip-cidrs |
5 | 5 | |
18 | 18 | ] |
19 | 19 | } |
20 | 20 | |
21 | For more information, see `Bring Your Own IP Address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
21 | For more information, see `Bring your own IP address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To list your custom routing accelerators** | |
1 | ||
2 | The following ``list-custom-routing-accelerators`` example lists the custom routing accelerators in an AWS account. :: | |
3 | ||
4 | aws globalaccelerator list-custom-routing-accelerators | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Accelerators": [ | |
10 | { | |
11 | "AcceleratorArn": "arn:aws:globalaccelerator::012345678901:accelerator/5555abcd-abcd-5555-abcd-5555EXAMPLE1", | |
12 | "Name": "TestCustomRoutingAccelerator", | |
13 | "IpAddressType": "IPV4", | |
14 | "Enabled": true, | |
15 | "IpSets": [ | |
16 | { | |
17 | "IpFamily": "IPv4", | |
18 | "IpAddresses": [ | |
19 | "192.0.2.250", | |
20 | "198.51.100.52" | |
21 | ] | |
22 | } | |
23 | ], | |
24 | "DnsName": "5a5a5a5a5a5a5a5a.awsglobalaccelerator.com", | |
25 | "Status": "DEPLOYED", | |
26 | "CreatedTime": 1552424416.0, | |
27 | "LastModifiedTime": 1569375641.0 | |
28 | }, | |
29 | { | |
30 | "AcceleratorArn": "arn:aws:globalaccelerator::888888888888:accelerator/8888abcd-abcd-8888-abcd-8888EXAMPLE2", | |
31 | "Name": "ExampleCustomRoutingAccelerator", | |
32 | "IpAddressType": "IPV4", | |
33 | "Enabled": true, | |
34 | "IpSets": [ | |
35 | { | |
36 | "IpFamily": "IPv4", | |
37 | "IpAddresses": [ | |
38 | "192.0.2.100", | |
39 | "198.51.100.10" | |
40 | ] | |
41 | } | |
42 | ], | |
43 | "DnsName": "6a6a6a6a6a6a6a.awsglobalaccelerator.com", | |
44 | "Status": "DEPLOYED", | |
45 | "CreatedTime": 1575585564.0, | |
46 | "LastModifiedTime": 1579809243.0 | |
47 | }, | |
48 | ] | |
49 | } | |
50 | ||
51 | For more information, see `Custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To list endpoint groups for a listener in a custom routing accelerator** | |
1 | ||
2 | The following ``list-custom-routing-endpoint-groups`` example lists the endpoint groups for a listener in a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator list-custom-routing-endpoint-groups \ | |
5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "EndpointGroups": [ | |
11 | { | |
12 | "EndpointGroupArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234/endpoint-group/ab88888example", | |
13 | "EndpointGroupRegion": "eu-central-1", | |
14 | "DestinationDescriptions": [ | |
15 | { | |
16 | "FromPort": 80, | |
17 | "ToPort": 80, | |
18 | "Protocols": [ | |
19 | "TCP", | |
20 | "UDP" | |
21 | ] | |
22 | } | |
23 | ] | |
24 | "EndpointDescriptions": [ | |
25 | { | |
26 | "EndpointId": "subnet-abcd123example" | |
27 | } | |
28 | ] | |
29 | } | |
30 | ] | |
31 | } | |
32 | ||
33 | For more information, see `Endpoint groups for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To list listeners for custom routing accelerators** | |
1 | ||
2 | The following ``list-custom-routing-listeners`` example lists the listeners for a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator list-custom-routing-listeners \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Listeners": [ | |
11 | { | |
12 | "ListenerArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234", | |
13 | "PortRanges": [ | |
14 | { | |
15 | "FromPort": 5000, | |
16 | "ToPort": 10000 | |
17 | } | |
18 | ], | |
19 | "Protocol": "TCP" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ||
24 | For more information, see `Listeners for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
+38
-0
0 | **To list the port mappings for a specific custom routing accelerator destination** | |
1 | ||
2 | The following ``list-custom-routing-port-mappings-by-destination`` example provides the port mappings for a specific destination EC2 server (at the destination address) for a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator list-custom-routing-port-mappings-by-destination \ | |
5 | --endpoint-id subnet-abcd123example \ | |
6 | --destination-address 198.51.100.52 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "DestinationPortMappings": [ | |
12 | { | |
13 | "AcceleratorArn": "arn:aws:globalaccelerator::402092451327:accelerator/24ea29b8-d750-4489-8919-3095f3c4b0a7", | |
14 | "AcceleratorSocketAddresses": [ | |
15 | { | |
16 | "IpAddress": "192.0.2.250", | |
17 | "Port": 65514 | |
18 | }, | |
19 | { | |
20 | "IpAddress": "192.10.100.99", | |
21 | "Port": 65514 | |
22 | } | |
23 | ], | |
24 | "EndpointGroupArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/ab88888example", | |
25 | "EndpointId": "subnet-abcd123example", | |
26 | "EndpointGroupRegion": "us-west-2", | |
27 | "DestinationSocketAddress": { | |
28 | "IpAddress": "198.51.100.52", | |
29 | "Port": 80 | |
30 | }, | |
31 | "IpAddressType": "IPv4", | |
32 | "DestinationTrafficState": "ALLOW" | |
33 | } | |
34 | ] | |
35 | } | |
36 | ||
37 | For more information, see `How custom routing accelerators work in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-how-it-works.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To list the port mappings in a custom routing accelerator** | |
1 | ||
2 | The following ``list-custom-routing-port-mappings`` example provides a partial list of the port mappings in a custom routing accelerator. :: | |
3 | ||
4 | aws globalaccelerator list-custom-routing-port-mappings \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "PortMappings": [ | |
11 | { | |
12 | "AcceleratorPort": 40480, | |
13 | "EndpointGroupArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/098765zyxwvu", | |
14 | "EndpointId": "subnet-1234567890abcdef0", | |
15 | "DestinationSocketAddress": { | |
16 | "IpAddress": "192.0.2.250", | |
17 | "Port": 80 | |
18 | }, | |
19 | "Protocols": [ | |
20 | "TCP", | |
21 | "UDP" | |
22 | ], | |
23 | "DestinationTrafficState": "ALLOW" | |
24 | } | |
25 | { | |
26 | "AcceleratorPort": 40481, | |
27 | "EndpointGroupArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/098765zyxwvu", | |
28 | "EndpointId": "subnet-1234567890abcdef0", | |
29 | "DestinationSocketAddress": { | |
30 | "IpAddress": "192.0.2.251", | |
31 | "Port": 80 | |
32 | }, | |
33 | "Protocols": [ | |
34 | "TCP", | |
35 | "UDP" | |
36 | ], | |
37 | "DestinationTrafficState": "ALLOW" | |
38 | } | |
39 | ] | |
40 | } | |
41 | ||
42 | For more information, see `How custom routing accelerators work in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-how-it-works.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To list endpoint groups** |
1 | 1 | |
2 | The following ``list-endpoint-groups`` example lists the endpoint groups for a listener. :: | |
2 | The following ``list-endpoint-groups`` example lists the endpoint groups for a listener. This listener has two endpoint groups. :: | |
3 | 3 | |
4 | aws globalaccelerator list-endpoint-groups \ | |
5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234 \ | |
6 | --region us-west-2 | |
4 | aws globalaccelerator --region us-west-2 list-endpoint-groups \ | |
5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/abcdef1234 | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
32 | 31 | ] |
33 | 32 | } |
34 | 33 | |
35 | For more information, see `Endpoint Groups in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
34 | For more information, see `Endpoint Groups in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
2 | 2 | The following ``list-listeners`` example lists the listeners for an accelerator. :: |
3 | 3 | |
4 | 4 | aws globalaccelerator list-listeners \ |
5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --region us-west-2 | |
5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
23 | 22 | ] |
24 | 23 | } |
25 | 24 | |
26 | For more information, see `Listeners in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
25 | For more information, see `Listeners in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To list tags for an accelerator** |
1 | 1 | |
2 | The following ``list-tags-for-resource`` example lists the listeners for an accelerator. :: | |
2 | The following ``list-tags-for-resource`` example lists the tags for a specific accelerator. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator list-tags-for-resource \ |
5 | 5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh |
2 | 2 | The following ``provision-byoip-cidr`` example provisions the specified address range to use with your AWS resources. :: |
3 | 3 | |
4 | 4 | aws globalaccelerator provision-byoip-cidr \ |
5 | --cidr 203.0.113.25/24 \ | |
5 | --cidr 192.0.2.250/24 \ | |
6 | 6 | --cidr-authorization-context Message="$text_message",Signature="$signed_message" |
7 | 7 | |
8 | 8 | Output:: |
9 | 9 | |
10 | 10 | { |
11 | 11 | "ByoipCidr": { |
12 | "Cidr": "203.0.113.25/24", | |
12 | "Cidr": "192.0.2.250/24", | |
13 | 13 | "State": "PENDING_PROVISIONING" |
14 | 14 | } |
15 | 15 | } |
16 | 16 | |
17 | For more information, see `Bring Your Own IP Address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
17 | For more information, see `Bring your own IP address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To tag an accelerator** |
1 | 1 | |
2 | The following ``tag-resource`` example adds tags to an accelerator. When successful, this command has no output. :: | |
2 | The following ``tag-resource`` example adds tags Name and Project to an accelerator, along with corresponding values for each. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator tag-resource \ |
5 | --resource-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --tags Key="Name",Value="Example Name" Key="Project",Value="Example Project" | |
5 | --resource-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --tags Key="Name",Value="Example Name" Key="Project",Value="Example Project" | |
7 | 7 | |
8 | For more information, see `Tagging in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To remove a tag from an accelerator** |
1 | 1 | |
2 | The following ``untag-resource`` example removes a tag from an accelerator. When successful, this command has no output. :: | |
2 | The following ``untag-resource`` example removes the tags Name and Project from an accelerator. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator untag-resource \ |
5 | 5 | --resource-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ |
6 | 6 | --tag-keys Key="Name" Key="Project" |
7 | 7 | |
8 | For more information, see `Tagging in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To update an accelerator's attributes** |
1 | 1 | |
2 | The following ``update-accelerator-attributes`` example updates an accelerator to enable flow logs. The us-west-2 AWS Region must be specified. :: | |
2 | The following ``update-accelerator-attributes`` example updates an accelerator to enable flow logs. You must specify the ``US-West-2 (Oregon)`` Region to create or update accelerator attributes. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator update-accelerator-attributes \ |
5 | 5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ |
6 | 6 | --flow-logs-enabled \ |
7 | 7 | --flow-logs-s3-bucket flowlogs-abc \ |
8 | --flow-logs-s3-prefix bucketprefix-abc \ | |
9 | --region us-west-2 | |
8 | --flow-logs-s3-prefix bucketprefix-abc | |
10 | 9 | |
11 | 10 | Output:: |
12 | 11 | |
18 | 17 | } |
19 | 18 | } |
20 | 19 | |
21 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
20 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To update an accelerator** |
1 | 1 | |
2 | The following ``update-accelerator`` example modifies an accelerator to change the accelerator name. You must specify the ``US-West-2 (Oregon)`` Region to create or update accelerators. :: | |
2 | The following ``update-accelerator`` example modifies an accelerator to change the accelerator name to ``ExampleAcceleratorNew``. You must specify the ``US-West-2 (Oregon)`` Region to create or update accelerators. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator update-accelerator \ |
5 | 5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ |
6 | --name ExampleAcceleratorNew \ | |
7 | --region us-west-2 | |
6 | --name ExampleAcceleratorNew | |
8 | 7 | |
9 | 8 | Output:: |
10 | 9 | |
30 | 29 | } |
31 | 30 | } |
32 | 31 | |
33 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
32 | For more information, see `Accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To update a custom routing accelerator's attributes** | |
1 | ||
2 | The following ``update-custom-routing-accelerator-attributes`` example updates a custom routing accelerator to enable flow logs. :: | |
3 | ||
4 | aws globalaccelerator update-custom-routing-accelerator-attributes \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --flow-logs-enabled \ | |
7 | --flow-logs-s3-bucket flowlogs-abc \ | |
8 | --flow-logs-s3-prefix bucketprefix-abc | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "AcceleratorAttributes": { | |
14 | "FlowLogsEnabled": true | |
15 | "FlowLogsS3Bucket": flowlogs-abc | |
16 | "FlowLogsS3Prefix": bucketprefix-abc | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To update a custom routing accelerator** | |
1 | ||
2 | The following ``update-custom-routing-accelerator`` example modifies a custom routing accelerator to change the accelerator name. :: | |
3 | ||
4 | aws globalaccelerator --region us-west-2 update-custom-routing-accelerator \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --name ExampleCustomRoutingAcceleratorNew | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Accelerator": { | |
12 | "AcceleratorArn": "arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh", | |
13 | "IpAddressType": "IPV4", | |
14 | "Name": "ExampleCustomRoutingAcceleratorNew", | |
15 | "Enabled": true, | |
16 | "Status": "IN_PROGRESS", | |
17 | "IpSets": [ | |
18 | { | |
19 | "IpAddresses": [ | |
20 | "192.0.2.250", | |
21 | "198.51.100.52" | |
22 | ], | |
23 | "IpFamily": "IPv4" | |
24 | } | |
25 | ], | |
26 | "DnsName":"a1234567890abcdef.awsglobalaccelerator.com", | |
27 | "CreatedTime": 1232394847, | |
28 | "LastModifiedTime": 1232395654 | |
29 | } | |
30 | } | |
31 | ||
32 | For more information, see `Custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-accelerators.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | **To update a listener for a custom routing accelerator** | |
1 | ||
2 | The following ``update-custom-routing-listener`` example updates a listener to change the port range. :: | |
3 | ||
4 | aws globalaccelerator update-custom-routing-listener \ | |
5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz \ | |
6 | --port-ranges FromPort=10000,ToPort=20000 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Listener": { | |
12 | "ListenerArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz | |
13 | "PortRanges": [ | |
14 | { | |
15 | "FromPort": 10000, | |
16 | "ToPort": 20000 | |
17 | } | |
18 | ], | |
19 | "Protocol": "TCP" | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Listeners for custom routing accelerators in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-custom-routing-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To update an endpoint group** |
1 | 1 | |
2 | The following ``update-endpoint-group`` example adds endpoints to an endpoint group. :: | |
2 | The following ``update-endpoint-group`` example adds three endpoints to an endpoint group: an Elastic IP address, an ALB, and an NLB. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator update-endpoint-group \ |
5 | 5 | --endpoint-group-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/6789vxyz-vxyz-6789-vxyz-6789lmnopqrs/endpoint-group/ab88888example \ |
6 | 6 | --endpoint-configurations \ |
7 | 7 | EndpointId=eipalloc-eip01234567890abc,Weight=128 \ |
8 | 8 | EndpointId=arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/app/ALBTesting/alb01234567890xyz,Weight=128 \ |
9 | EndpointId=arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/net/NLBTesting/alb01234567890qrs,Weight=128 | |
9 | EndpointId=arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/net/NLBTesting/alb01234567890qrs,Weight=128 | |
10 | 10 | |
11 | 11 | Output:: |
12 | 12 | |
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | For more information, see `Endpoint Groups in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
35 | For more information, see `Endpoint groups in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To update a listener** |
1 | 1 | |
2 | The following ``update-listener`` example updates a listener to change the port. :: | |
2 | The following ``update-listener`` example updates a listener to change the port to 100. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator update-listener \ |
5 | 5 | --listener-arn arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz \ |
6 | --port-ranges FromPort=100,ToPort=100 | |
6 | --port-ranges FromPort=100,ToPort=100 | |
7 | 7 | |
8 | 8 | Output:: |
9 | 9 | |
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
24 | For more information, see `Listeners in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
24 | For more information, see `Listeners in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-listeners.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
0 | 0 | **To withdraw an address range** |
1 | 1 | |
2 | The following ``withdraw-byoip-cidr`` example withdraws an address range from AWS Global Accelerator that you've previously advertised for use with your AWS resources. :: | |
2 | The following ``withdraw-byoip-cidr`` example withdraws an address range from AWS Global Accelerator that you previously advertised for use with your AWS resources. :: | |
3 | 3 | |
4 | 4 | aws globalaccelerator withdraw-byoip-cidr \ |
5 | --cidr 203.0.113.25/24 | |
5 | --cidr 192.0.2.250/24 | |
6 | 6 | |
7 | 7 | Output:: |
8 | 8 | |
9 | 9 | { |
10 | 10 | "ByoipCidr": { |
11 | "Cidr": "203.0.113.25/24", | |
11 | "Cidr": "192.0.2.250/24", | |
12 | 12 | "State": "PENDING_WITHDRAWING" |
13 | 13 | } |
14 | 14 | } |
15 | 15 | |
16 | For more information, see `Bring Your Own IP Address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*. | |
16 | For more information, see `Bring your own IP address in AWS Global Accelerator <https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html>`__ in the *AWS Global Accelerator Developer Guide*.⏎ |
9 | 9 | "Policy": { |
10 | 10 | "PolicyName": "MySamplePolicy", |
11 | 11 | "CreateDate": "2015-06-17T19:23;32Z", |
12 | "AttachmentCount": "0", | |
13 | "IsAttachable": "true", | |
12 | "AttachmentCount": 0, | |
13 | "IsAttachable": true, | |
14 | 14 | "PolicyId": "Z27SI6FQMGNQ2EXAMPLE1", |
15 | 15 | "DefaultVersionId": "v1", |
16 | 16 | "Path": "/", |
1 | 1 | |
2 | 2 | The following ``wait policy-exists`` command pauses and continues only after it can confirm that the specified policy exists. There is no output. :: |
3 | 3 | |
4 | aws iam wait policy-exists --policy-name MyPolicy | |
4 | aws iam wait policy-exists --policy-arn arn:aws:iam::123456789012:policy/MyPolicy |
0 | **To list a Device Defender's ML Detect Security Profile training model's status** | |
1 | ||
2 | The following ``get-behavior-model-training-summaries`` example lists model training status for the configured behaviors in the chosen Security Profile. For each behavior, the name, model status, and percentage of datapoints collected are listed. :: | |
3 | ||
4 | aws iot get-behavior-model-training-summaries \ | |
5 | --security-profile-name MySecuirtyProfileName | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "summaries": [ | |
11 | { | |
12 | "securityProfileName": "MySecuirtyProfileName", | |
13 | "behaviorName": "Messages_sent_ML_behavior", | |
14 | "modelStatus": "PENDING_BUILD", | |
15 | "datapointsCollectionPercentage": 0.0 | |
16 | }, | |
17 | { | |
18 | "securityProfileName": "MySecuirtyProfileName", | |
19 | "behaviorName": "Messages_received_ML_behavior", | |
20 | "modelStatus": "PENDING_BUILD", | |
21 | "datapointsCollectionPercentage": 0.0 | |
22 | }, | |
23 | { | |
24 | "securityProfileName": "MySecuirtyProfileName", | |
25 | "behaviorName": "Authorization_failures_ML_behavior", | |
26 | "modelStatus": "PENDING_BUILD", | |
27 | "datapointsCollectionPercentage": 0.0 | |
28 | }, | |
29 | { | |
30 | "securityProfileName": "MySecuirtyProfileName", | |
31 | "behaviorName": "Message_size_ML_behavior", | |
32 | "modelStatus": "PENDING_BUILD", | |
33 | "datapointsCollectionPercentage": 0.0 | |
34 | }, | |
35 | { | |
36 | "securityProfileName": "MySecuirtyProfileName", | |
37 | "behaviorName": "Connection_attempts_ML_behavior", | |
38 | "modelStatus": "PENDING_BUILD", | |
39 | "datapointsCollectionPercentage": 0.0 | |
40 | }, | |
41 | { | |
42 | "securityProfileName": "MySPNoALerts", | |
43 | "behaviorName": "Disconnects_ML_behavior", | |
44 | "modelStatus": "PENDING_BUILD", | |
45 | "datapointsCollectionPercentage": 0.0 | |
46 | } | |
47 | ] | |
48 | } | |
49 | ||
50 | For more information, see `GetBehaviorModelTrainingSummaries (Detect Commands) <https://docs.aws.amazon.com/iot/latest/developerguide/detect-commands.html>`__ in the *AWS IoT Developer Guide*.⏎ |
0 | **To list all defined mitigation actions** | |
1 | ||
2 | The following ``list-mitigation-actions`` example lists all defined mitigation actions for your AWS account and Region. For each action, the name, ARN, and creation date are listed. :: | |
3 | ||
4 | aws iot list-mitigation-actions | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "actionIdentifiers": [ | |
10 | { | |
11 | "actionName": "DeactivateCACertAction", | |
12 | "actionArn": "arn:aws:iot:us-west-2:123456789012:mitigationaction/DeactivateCACertAction", | |
13 | "creationDate": "2019-12-10T11:12:47.574000-08:00" | |
14 | }, | |
15 | { | |
16 | "actionName": "ResetPolicyVersionAction", | |
17 | "actionArn": "arn:aws:iot:us-west-2:123456789012:mitigationaction/ResetPolicyVersionAction", | |
18 | "creationDate": "2019-12-10T11:11:48.920000-08:00" | |
19 | }, | |
20 | { | |
21 | "actionName": "PublishFindingToSNSAction", | |
22 | "actionArn": "arn:aws:iot:us-west-2:123456789012:mitigationaction/PublishFindingToSNSAction", | |
23 | "creationDate": "2019-12-10T11:10:49.546000-08:00" | |
24 | }, | |
25 | { | |
26 | "actionName": "AddThingsToQuarantineGroupAction", | |
27 | "actionArn": "arn:aws:iot:us-west-2:123456789012:mitigationaction/AddThingsToQuarantineGroupAction", | |
28 | "creationDate": "2019-12-10T11:09:35.999000-08:00" | |
29 | }, | |
30 | { | |
31 | "actionName": "UpdateDeviceCertAction", | |
32 | "actionArn": "arn:aws:iot:us-west-2:123456789012:mitigationaction/UpdateDeviceCertAction", | |
33 | "creationDate": "2019-12-10T11:08:44.263000-08:00" | |
34 | }, | |
35 | { | |
36 | "actionName": "SampleMitigationAction", | |
37 | "actionArn": "arn:aws:iot:us-west-2:123456789012:mitigationaction/SampleMitigationAction", | |
38 | "creationDate": "2019-12-10T11:03:41.840000-08:00" | |
39 | } | |
40 | ] | |
41 | } | |
42 | ||
43 | For more information, see `ListMitigationActions (Mitigation Action Commands) <https://docs.aws.amazon.com/iot/latest/developerguide/mitigation-action-commands.html#dd-api-iot-ListMitigationActions>`__ in the *AWS IoT Developer Guide*. |
0 | 0 | **To get channel configuration information about multiple channels** |
1 | 1 | |
2 | The following ``batch-get-channel`` example lists information about the specified channels. :: | |
2 | The following ``batch-get-channel`` example lists information about the specified channels. :: | |
3 | 3 | |
4 | 4 | aws ivs batch-get-channel \ |
5 | 5 | --arns arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh \ |
6 | arn:aws:ivs:us-west-2:123456789012:channel/ijklMNOPqrst | |
6 | arn:aws:ivs:us-west-2:123456789012:channel/efghEFGHijkl | |
7 | 7 | |
8 | 8 | Output:: |
9 | 9 | |
13 | 13 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", |
14 | 14 | "name": "channel-1", |
15 | 15 | "latencyMode": "LOW", |
16 | "type": "STANDARD", | |
17 | "recordingConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh", | |
16 | 18 | "ingestEndpoint": "a1b2c3d4e5f6.global-contribute.live-video.net", |
17 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8", | |
19 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel-1.abcdEFGH.m3u8", | |
18 | 20 | "tags": {} |
19 | 21 | }, |
20 | 22 | { |
21 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", | |
23 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/efghEFGHijkl", | |
22 | 24 | "name": "channel-2", |
23 | 25 | "latencyMode": "LOW", |
26 | "type": "STANDARD", | |
27 | "recordingConfigurationArn": "", | |
24 | 28 | "ingestEndpoint": "a1b2c3d4e5f6.global-contribute.live-video.net", |
25 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8", | |
29 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel-2.abcdEFGH.m3u8", | |
26 | 30 | "tags": {} |
27 | 31 | } |
28 | 32 | ] |
0 | **To create channels** | |
0 | **Example 1: To create a channel with no recording** | |
1 | 1 | |
2 | 2 | The following ``create-channel`` example creates a new channel and an associated stream key to start streaming. :: |
3 | 3 | |
4 | aws ivs create-channel | |
4 | aws ivs create-channel \ | |
5 | -name "test-channel" | |
5 | 6 | |
6 | 7 | Output:: |
7 | 8 | |
10 | 11 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", |
11 | 12 | "name": "test-channel", |
12 | 13 | "latencyMode": "LOW", |
14 | "recordingConfigurationArn": "", | |
13 | 15 | "ingestEndpoint": "a1b2c3d4e5f6.global-contribute.live-video.net", |
14 | 16 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8", |
15 | 17 | "tags": {} |
22 | 24 | } |
23 | 25 | } |
24 | 26 | |
25 | For more information, see `Create a Channel <https://docs.aws.amazon.com/ivs/latest/userguide/GSIVS-create-channel.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ | |
27 | For more information, see `Create a Channel <https://docs.aws.amazon.com/ivs/latest/userguide/GSIVS-create-channel.html>`__ in the *Amazon Interactive Video Service User Guide*. | |
28 | ||
29 | **Example 2: To create a channel with recording enabled, using the RecordingConfiguration resource specified by its ARN** | |
30 | ||
31 | The following ``create-channel`` example creates a new channel and an associated stream key to start streaming, and sets up recording for the channel:: | |
32 | ||
33 | aws ivs create-channel \ | |
34 | --name test-channel-with-recording \ | |
35 | --recording-configuration-arn "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh" | |
36 | ||
37 | Output:: | |
38 | ||
39 | { | |
40 | "channel": { | |
41 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", | |
42 | "name": "test-channel-with-recording", | |
43 | "latencyMode": "LOW", | |
44 | "type": "STANDARD", | |
45 | "recordingConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh", | |
46 | "ingestEndpoint": "a1b2c3d4e5f6.global-contribute.live-video.net", | |
47 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8", | |
48 | "authorized": false, | |
49 | "tags": {} | |
50 | }, | |
51 | "streamKey": { | |
52 | "arn": "arn:aws:ivs:us-west-2:123456789012:stream-key/abcdABCDefgh", | |
53 | "value": "sk_us-west-2_abcdABCDefgh_567890abcdef", | |
54 | "channelArn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", | |
55 | "tags": {} | |
56 | } | |
57 | } | |
58 | ||
59 | For more information, see `Record to Amazon S3 <https://docs.aws.amazon.com/ivs/latest/userguide/record-to-S3.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ |
0 | **To create a RecordingConfiguration resource** | |
1 | ||
2 | The following ``create-recording-configuration`` example creates RecordingConfiguration resource to enable recording to Amazon S3. :: | |
3 | ||
4 | aws ivs create-recording-configuration \ | |
5 | --name test-recording-config \ | |
6 | --destination-configuration S3={bucketName=demo-recording-bucket} | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "recordingConfiguration": { | |
12 | "arn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABcdef34ghIJ", | |
13 | "name": "test-recording-config", | |
14 | "destinationConfiguration": { | |
15 | "s3": { | |
16 | "bucketName": "demo-recording-bucket" | |
17 | } | |
18 | }, | |
19 | "state": "CREATING", | |
20 | "tags": {} | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Record to Amazon S3 <https://docs.aws.amazon.com/ivs/latest/userguide/record-to-S3.html>`__ in the *Amazon Interactive Video Service User Guide*. |
0 | **To delete the RecordingConfiguration resource specified by its ARN** | |
1 | ||
2 | The following ``delete-recording-configuration`` example deletes the RecordingConfiguration resource with the specified ARN. :: | |
3 | ||
4 | aws ivs delete-recording-configuration \ | |
5 | --arn "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABcdef34ghIJ" | |
6 | ||
7 | This command produces no output.⏎ |
3 | 3 | |
4 | 4 | aws ivs get-channel \ |
5 | 5 | --arn arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh |
6 | ||
6 | ||
7 | 7 | Output:: |
8 | 8 | |
9 | 9 | { |
11 | 11 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", |
12 | 12 | "name": "channel-1", |
13 | 13 | "latencyMode": "LOW", |
14 | "type": "STANDARD", | |
15 | "recordingConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh", | |
14 | 16 | "ingestEndpoint": "a1b2c3d4e5f6.global-contribute.live-video.net", |
15 | 17 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8", |
16 | 18 | "tags": {} |
17 | 19 | } |
18 | 20 | } |
19 | ||
21 | ||
20 | 22 | For more information, see `Create a Channel <https://docs.aws.amazon.com/ivs/latest/userguide/GSIVS-create-channel.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ |
0 | **To get information about a RecordingConfiguration resource** | |
1 | ||
2 | The following ``get-recording-configuration`` example gets information about the RecordingConfiguration resource for the specified ARN. :: | |
3 | ||
4 | aws ivs get-recording-configuration \ | |
5 | --arn "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABcdef34ghIJ" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "recordingConfiguration": { | |
11 | "arn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABcdef34ghIJ", | |
12 | "name": "test-recording-config", | |
13 | "destinationConfiguration": { | |
14 | "s3": { | |
15 | "bucketName": "demo-recording-bucket" | |
16 | } | |
17 | }, | |
18 | "state": "ACTIVE", | |
19 | "tags": {} | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Record to Amazon S3 <https://docs.aws.amazon.com/ivs/latest/userguide/record-to-S3.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ |
0 | **To get summary information about channels** | |
0 | **Example 1: To get summary information about all channels** | |
1 | 1 | |
2 | 2 | The following ``list-channels`` example lists all channels for your AWS account. :: |
3 | 3 | |
11 | 11 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", |
12 | 12 | "name": "channel-1", |
13 | 13 | "latencyMode": "LOW", |
14 | "authorized": false, | |
15 | "recordingConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh", | |
14 | 16 | "tags": {} |
15 | 17 | }, |
16 | 18 | { |
17 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", | |
19 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/efghEFGHijkl", | |
18 | 20 | "name": "channel-2", |
19 | 21 | "latencyMode": "LOW", |
22 | "authorized": false, | |
23 | "recordingConfigurationArn": "", | |
20 | 24 | "tags": {} |
21 | 25 | } |
22 | 26 | ] |
23 | 27 | } |
24 | 28 | |
25 | For more information, see `Create a Channel <https://docs.aws.amazon.com/ivs/latest/userguide/GSIVS-create-channel.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ | |
29 | For more information, see `Create a Channel <https://docs.aws.amazon.com/ivs/latest/userguide/GSIVS-create-channel.html>`__ in the *Amazon Interactive Video Service User Guide*. | |
30 | ||
31 | **Example 2: To get summary information about all channels, filtered by the specified RecordingConfiguration ARN** | |
32 | ||
33 | The following ``list-channels`` example lists all channels for your AWS account, that are associated with the specified RecordingConfiguration ARN. :: | |
34 | ||
35 | aws ivs list-channels \ | |
36 | --filter-by-recording-configuration-arn "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh" | |
37 | ||
38 | Output:: | |
39 | ||
40 | { | |
41 | "channels": [ | |
42 | { | |
43 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", | |
44 | "name": "channel-1", | |
45 | "latencyMode": "LOW", | |
46 | "authorized": false, | |
47 | "recordingConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh", | |
48 | "tags": {} | |
49 | } | |
50 | ] | |
51 | } | |
52 | ||
53 | For more information, see `Record to Amazon S3 <https://docs.aws.amazon.com/ivs/latest/userguide/record-to-S3.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ |
0 | **To list all the RecordingConfiguration resources created in this account** | |
1 | ||
2 | The following ``get-recording-configuration`` example gets information about the RecordingConfiguration resource for the specified ARN. :: | |
3 | ||
4 | aws ivs list-recording-configurations | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "recordingConfigurations": [ | |
10 | { | |
11 | "arn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABcdef34ghIJ", | |
12 | "name": "test-recording-config-1", | |
13 | "destinationConfiguration": { | |
14 | "s3": { | |
15 | "bucketName": "demo-recording-bucket-1" | |
16 | } | |
17 | }, | |
18 | "state": "ACTIVE", | |
19 | "tags": {} | |
20 | }, | |
21 | { | |
22 | "arn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/CD12abcdGHIJ", | |
23 | "name": "test-recording-config-2", | |
24 | "destinationConfiguration": { | |
25 | "s3": { | |
26 | "bucketName": "demo-recording-bucket-2" | |
27 | } | |
28 | }, | |
29 | "state": "ACTIVE", | |
30 | "tags": {} | |
31 | } | |
32 | ] | |
33 | } | |
34 | ||
35 | For more information, see `Record to Amazon S3 <https://docs.aws.amazon.com/ivs/latest/userguide/record-to-S3.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ |
0 | **To update a channel's configuration information** | |
0 | **Example 1: To update a channel's configuration information** | |
1 | 1 | |
2 | The following ``update-channel`` example updates the channel configuration for a specified channel ARN (Amazon Resource Name). This does not affect an ongoing stream of this channel; you must stop and restart the stream for the changes to take effect. :: | |
2 | The following ``update-channel`` example updates the channel configuration for a specified channel ARN to change the channel name. This does not affect an ongoing stream of this channel; you must stop and restart the stream for the changes to take effect. :: | |
3 | 3 | |
4 | 4 | aws ivs update-channel \ |
5 | 5 | --arn arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh \ |
12 | 12 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", |
13 | 13 | "name": "channel-1", |
14 | 14 | "latencyMode": "LOW", |
15 | "type": "STANDARD", | |
16 | "recordingConfigurationArn": "", | |
15 | 17 | "ingestEndpoint": "a1b2c3d4e5f6.global-contribute.live-video.net", |
16 | 18 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8", |
17 | 19 | "tags": {} |
18 | 20 | } |
19 | 21 | |
20 | For more information, see `Create a Channel <https://docs.aws.amazon.com/ivs/latest/userguide/GSIVS-create-channel.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ | |
22 | For more information, see `Create a Channel <https://docs.aws.amazon.com/ivs/latest/userguide/GSIVS-create-channel.html>`__ in the *Amazon Interactive Video Service User Guide*. | |
23 | ||
24 | **Example 2: To update a channel's configuration to enable recording** | |
25 | ||
26 | The following ``update-channel`` example updates the channel configuration for a specified channel ARN to enable recording. This does not affect an ongoing stream of this channel; you must stop and restart the stream for the changes to take effect. :: | |
27 | ||
28 | aws ivs update-channel \ | |
29 | --arn "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh" \ | |
30 | --recording-configuration-arn "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh" | |
31 | ||
32 | Output:: | |
33 | ||
34 | { | |
35 | "channel": { | |
36 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", | |
37 | "name": "test-channel-with-recording", | |
38 | "latencyMode": "LOW", | |
39 | "type": "STANDARD", | |
40 | "recordingConfigurationArn": "arn:aws:ivs:us-west-2:123456789012:recording-configuration/ABCD12cdEFgh", | |
41 | "ingestEndpoint": "a1b2c3d4e5f6.global-contribute.live-video.net", | |
42 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8", | |
43 | "authorized": false, | |
44 | "tags": {} | |
45 | } | |
46 | } | |
47 | ||
48 | For more information, see `Record to Amazon S3 <https://docs.aws.amazon.com/ivs/latest/userguide/record-to-S3.html>`__ in the *Amazon Interactive Video Service User Guide*. | |
49 | ||
50 | **Example 3: To update a channel's configuration to disable recording** | |
51 | ||
52 | The following ``update-channel`` example updates the channel configuration for a specified channel ARN to disable recording. This does not affect an ongoing stream of this channel; you must stop and restart the stream for the changes to take effect. :: | |
53 | ||
54 | aws ivs update-channel \ | |
55 | --arn "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh" \ | |
56 | --recording-configuration-arn "" | |
57 | ||
58 | Output:: | |
59 | ||
60 | { | |
61 | "channel": { | |
62 | "arn": "arn:aws:ivs:us-west-2:123456789012:channel/abcdABCDefgh", | |
63 | "name": "test-channel-with-recording", | |
64 | "latencyMode": "LOW", | |
65 | "type": "STANDARD", | |
66 | "recordingConfigurationArn": "", | |
67 | "ingestEndpoint": "a1b2c3d4e5f6.global-contribute.live-video.net", | |
68 | "playbackUrl": "https://a1b2c3d4e5f6.us-west-2.playback.live-video.net/api/video/v1/us-west-2.123456789012.channel.abcdEFGH.m3u8", | |
69 | "authorized": false, | |
70 | "tags": {} | |
71 | } | |
72 | } | |
73 | ||
74 | For more information, see `Record to Amazon S3 <https://docs.aws.amazon.com/ivs/latest/userguide/record-to-S3.html>`__ in the *Amazon Interactive Video Service User Guide*.⏎ |
0 | **Example 1: To decrypt an encrypted file** | |
0 | **Example 1: To decrypt an encrypted message with a symmetric CMK (Linux and macOS)** | |
1 | 1 | |
2 | The following ``decrypt`` command demonstrates the recommended way to decrypt data with the AWS CLI. :: | |
2 | The following ``decrypt`` command example demonstrates the recommended way to decrypt data with the AWS CLI. This version shows how to decrypt data under a symmetric customer master key (CMK). | |
3 | ||
4 | * Provide the ciphertext in a file. | |
5 | ||
6 | In the value of the ``--ciphertext-blob`` parameter, use the ``fileb://`` prefix, which tells the CLI to read the data from a binary file. If the file is not in the current directory, type the full path to file. For more information about reading AWS CLI parameter values from a file, see `Loading AWS CLI parameters from a file <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html>` in the *AWS Command Line Interface User Guide* and `Best Practices for Local File Parameters<https://aws.amazon.com/blogs/developer/best-practices-for-local-file-parameters/>` in the *AWS Command Line Tool Blog*. | |
7 | ||
8 | * Specify the CMK to decrypt the ciphertext. | |
9 | ||
10 | The ``--key-id`` parameter is not required when decrypting with symmetric CMKs. AWS KMS can get the CMK that was used to encrypt the data from the metadata in the ciphertext blob. But it's always a best practice to specify the CMK you are using. This practice ensures that you use the CMK that you intend, and prevents you from inadvertently decrypting a ciphertext using a CMK you do not trust. | |
11 | ||
12 | * Request the plaintext output as a text value. | |
13 | ||
14 | The ``--query`` parameter tells the CLI to get only the value of the ``Plaintext`` field from the output. The ``--output`` parameter returns the output as text. | |
15 | ||
16 | * Base64-decode the plaintext and save it in a file. | |
17 | ||
18 | The following example pipes (|) the value of the ``Plaintext`` parameter to the Base64 utility, which decodes it. Then, it redirects (>) the decoded output to the ``ExamplePlaintext`` file. | |
19 | ||
20 | Before running this command, replace the example key ID with a valid key ID from your AWS account. :: | |
3 | 21 | |
4 | 22 | aws kms decrypt \ |
5 | 23 | --ciphertext-blob fileb://ExampleEncryptedFile \ |
24 | --key-id 1234abcd-12ab-34cd-56ef-1234567890ab \ | |
6 | 25 | --output text \ |
7 | --query Plaintext | base64 --decode > ExamplePlaintextFile | |
26 | --query Plaintext | base64 \ | |
27 | --decode > ExamplePlaintextFile | |
8 | 28 | |
9 | The command does several things: | |
29 | This command produces no output. The output from the ``decrypt`` command is base64-decoded and saved in a file. | |
10 | 30 | |
11 | #. Uses the ``fileb://`` prefix to specify the ``--ciphertext-blob`` parameter. | |
31 | For more information, see `Decrypt <https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html>`__ in the *AWS Key Management Service API Reference*. | |
12 | 32 | |
13 | 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``. | |
33 | **Example 2: To decrypt an encrypted message with a symmetric CMK (Windows command prompt)** | |
14 | 34 | |
15 | For more information about reading AWS CLI parameter values from a file, see `Loading Parameters from a File <https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-file>`_ in the *AWS Command Line Interface User Guide* and `Best Practices for Local File Parameters <https://blogs.aws.amazon.com/cli/post/TxLWWN1O25V1HE/Best-Practices-for-Local-File-Parameters>`_ on the AWS Command Line Tool Blog. | |
35 | The following example is the same as the previous one except that it uses the ``certutil`` utility to Base64-decode the plaintext data. This procedure requires two commands, as shown in the following examples. | |
16 | 36 | |
17 | The command assumes the ciphertext in ``ExampleEncryptedFile`` is binary data. The `encrypt examples <encrypt.html#examples>`_ demonstrate how to save a ciphertext this way. | |
37 | Before running this command, replace the example key ID with a valid key ID from your AWS account. :: | |
18 | 38 | |
19 | #. Uses the ``--output`` and ``--query`` parameters to control the command's output. | |
20 | ||
21 | These parameters extract the decrypted data, called the *plaintext*, from the command's output. For more information about controlling output, see `Controlling Command Output <https://docs.aws.amazon.com/cli/latest/userguide/controlling-output.html>`_ in the *AWS Command Line Interface User Guide*. | |
22 | ||
23 | #. Uses the ``base64`` utility. | |
24 | ||
25 | 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. | |
26 | ||
27 | #. Saves the binary plaintext to a file. | |
28 | ||
29 | The final part of the command (``> ExamplePlaintextFile``) saves the binary plaintext data to a file. | |
30 | ||
31 | **Example 2: Using the AWS CLI to decrypt data from the Windows command prompt** | |
32 | ||
33 | 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. :: | |
34 | ||
35 | aws kms decrypt \ | |
36 | --ciphertext-blob fileb://ExampleEncryptedFile \ | |
37 | --output text \ | |
39 | aws kms decrypt ^ | |
40 | --ciphertext-blob fileb://ExampleEncryptedFile ^ | |
41 | --key-id 1234abcd-12ab-34cd-56ef-1234567890ab ^ | |
42 | --output text ^ | |
38 | 43 | --query Plaintext > ExamplePlaintextFile.base64 |
39 | 44 | |
45 | Run the ``certutil`` command. :: | |
46 | ||
40 | 47 | certutil -decode ExamplePlaintextFile.base64 ExamplePlaintextFile |
48 | ||
49 | Output:: | |
50 | ||
51 | Input Length = 18 | |
52 | Output Length = 12 | |
53 | CertUtil: -decode command completed successfully. | |
54 | ||
55 | For more information, see `Decrypt <https://docs.aws.amazon.com/kms/latest/APIReference/API_Decrypt.html>`__ in the *AWS Key Management Service API Reference*.⏎ |
0 | **Example 1: To re-encrypt encrypted data under a different CMK** | |
0 | **Example 1: To re-encrypt an encrypted message under a different symmetric CMK (Linux and macOS).** | |
1 | 1 | |
2 | The following ``re-encrypt`` example re-encrypts data that was encrypted using the ``encrypt`` operation in the AWS CLI. You can use the ``re-encrypt`` command to re-encrypt the result of any AWS KMS operation that encrypted data or data keys. | |
2 | The following ``re-encrypt`` command example demonstrates the recommended way to re-encrypt data with the AWS CLI. | |
3 | 3 | |
4 | This example writes the output to the command line so you can see the all of the properties in the response. However, unless you're testing or demonstrating this operation, you should base64-decode the encrypted data and save it in a file. | |
4 | * Provide the ciphertext in a file. | |
5 | 5 | |
6 | The command in this example re-encrypts the data under a different CMK, but you can re-encrypt it under the same CMK to change characteristics of the encryption, such as the encryption context. | |
6 | In the value of the ``--ciphertext-blob`` parameter, use the ``fileb://`` prefix, which tells the CLI to read the data from a binary file. If the file is not in the current directory, type the full path to file. For more information about reading AWS CLI parameter values from a file, see `Loading AWS CLI parameters from a file <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-file.html>` in the *AWS Command Line Interface User Guide* and `Best Practices for Local File Parameters<https://aws.amazon.com/blogs/developer/best-practices-for-local-file-parameters/>` in the *AWS Command Line Tool Blog*. | |
7 | 7 | |
8 | To run this command, you must have ``kms:ReEncryptFrom`` permission on the CMK that encrypted the data and ``kms:ReEncryptTo`` permissions on the CMK that you use to re-encrypt the data. | |
8 | * Specify the source CMK, which decrypts the ciphertext. | |
9 | 9 | |
10 | * The ``--ciphertext-blob`` parameter identifies the ciphertext to re-encrypt. The file ``ExampleEncryptedFile`` contains the base64-decoded output of the encrypt command. | |
11 | * The ``fileb://`` prefix of the file name tells the CLI to treat the input file as binary instead of text. | |
12 | * The ``--destination-key-id`` parameter specifies the CMK under which the data is to be re-encrypted. This example uses the key ID to identify the CMK, but you can use a key ID, key ARN, alias name, or alias ARN in this command. | |
13 | * You do not need to specify the CMK that was used to encrypt the data. AWS KMS gets that information from metadata in the ciphertext. :: | |
10 | The ``--source-key-id`` parameter is not required when decrypting with symmetric CMKs. AWS KMS can get the CMK that was used to encrypt the data from the metadata in the ciphertext blob. But it's always a best practice to specify the CMK you are using. This practice ensures that you use the CMK that you intend, and prevents you from inadvertently decrypting a ciphertext using a CMK you do not trust. | |
11 | ||
12 | * Specify the destination CMK, which re-encrypts the data. | |
13 | ||
14 | The ``--destination-key-id`` parameter is always required. This example uses a key ARN, but you can use any valid key identifier. | |
15 | ||
16 | * Request the plaintext output as a text value. | |
17 | ||
18 | The ``--query`` parameter tells the CLI to get only the value of the ``Plaintext`` field from the output. The ``--output`` parameter returns the output as text. | |
19 | ||
20 | * Base64-decode the plaintext and save it in a file. | |
21 | ||
22 | ||
23 | The following example pipes (|) the value of the ``Plaintext`` parameter to the Base64 utility, which decodes it. Then, it redirects (>) the decoded output to the ``ExamplePlaintext`` file. | |
24 | ||
25 | Before running this command, replace the example key IDs with valid key identifiers from your AWS account. :: | |
14 | 26 | |
15 | 27 | aws kms re-encrypt \ |
16 | 28 | --ciphertext-blob fileb://ExampleEncryptedFile \ |
17 | --destination-key-id 0987dcba-09fe-87dc-65ba-ab0987654321 | |
29 | --source-key-id 1234abcd-12ab-34cd-56ef-1234567890ab \ | |
30 | --destination-key-id 0987dcba-09fe-87dc-65ba-ab0987654321 \ | |
31 | --query CiphertextBlob \ | |
32 | --output text | base64 --decode > ExampleReEncryptedFile | |
18 | 33 | |
19 | The output includes the following properties: | |
34 | This command produces no output. The output from the ``decrypt`` command is base64-decoded and saved in a file. | |
20 | 35 | |
21 | * The ``SourceKeyID`` is the key ID of the CMK that originally encrypted the CMK. | |
22 | * The ``KeyId`` is the ID of the CMK that re-encrypted the data. | |
23 | * The ``CiphertextBlob``, which is the re-encrypted data in base64-encoded format. :: | |
36 | For more information, see `Using symmetric and asymmetric keys <https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html`__ in the *AWS KMS Developer Guide*. | |
24 | 37 | |
25 | { | |
26 | "CiphertextBlob": "AQICAHgJtIvJqgOGUX6NLvVXnW5OOQT...", | |
27 | "SourceKeyId": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab", | |
28 | "KeyId": "arn:aws:kms:us-west-2:123456789012:key/0987dcba-09fe-87dc-65ba-ab0987654321" | |
29 | } | |
38 | **Example 2: To re-encrypt an encrypted message under a different symmetric CMK (Windows command prompt).** | |
30 | 39 | |
31 | **Example 2: To re-encrypt encrypted data under a different CMK (Linux or macOs)** | |
40 | The following ``re-encrypt`` command example is the same as the previous one except that it uses the ``certutil`` utility to Base64-decode the plaintext data. This procedure requires two commands, as shown in the following examples. | |
32 | 41 | |
33 | The following ``re-encrypt`` example demonstrates the recommended way to re-encrypt data with the AWS CLI. This example re-encrypts the ciphertext that was encrypted by the encrypt command, but you can use the same procedure to re-encrypt data keys. | |
34 | ||
35 | This example is the same as the previous example except that it does not write the output to the command line. Instead, after re-encrypting the ciphertext under a different CMK, it extracts the re-encrypted ciphertext from the response, base64-decodes it, and saves the binary data in a file. You can store the file safely. Then, you can use the file in decrypt or re-encrypt commands in the AWS CLI. | |
36 | ||
37 | To run this command, you must have ``kms:ReEncryptFrom`` permission on the CMK that encrypted the data and ``kms:ReEncryptTo`` permissions on the CMK that will re-encrypt the data. | |
38 | The ``--ciphertext-blob`` parameter identifies the ciphertext to re-encrypt. | |
39 | ||
40 | * The ``fileb://`` prefix tells the CLI to treat the input file as binary instead of text. | |
41 | * The ``--destination-key-id`` parameter specifies the CMK under which the data is re-encrypted. This example uses the key ID to identify the CMK, but you can use a key ID, key ARN, alias name, or alias ARN in this command. | |
42 | * You do not need to specify the CMK that was used to encrypt the data. AWS KMS gets that information from metadata in the ciphertext. | |
43 | * The ``--output`` parameter with a value of ``text`` directs the AWS CLI to return the output as text, instead of JSON. | |
44 | * The ``--query`` parameter extracts the value of the ``CiphertextBlob`` property from the response. | |
45 | * The pipe operator ( | ) sends the output of the CLI command to the ``base64`` utility, which decodes the extracted output. The ``CiphertextBlob`` that the re-encrypt operation returns is base64-encoded text. However, the ``decrypt`` and ``re-encrypt`` commands require binary data. The example decodes the base64-encoded ciphertext back to binary and then saves it in a file. You can use the file as input to the decrypt or re-encrypt commands. :: | |
46 | ||
47 | aws kms re-encrypt \ | |
48 | --ciphertext-blob fileb://ExampleEncryptedFile \ | |
49 | --destination-key-id 0987dcba-09fe-87dc-65ba-ab0987654321 \ | |
50 | --output text \ | |
51 | --query CiphertextBlob | base64 --decode > ExampleReEncryptedFile | |
52 | ||
53 | This command produces no output on screen because it is redirected to a file. | |
54 | ||
55 | **Example 3: To re-encrypted encrypted data under a different CMK (Windows Command Prompt)** | |
56 | ||
57 | This example is the same as the previous example, except that it uses the ``certutil`` utility in Windows to base64-decode the ciphertext before saving it in a file. | |
58 | ||
59 | * The first command re-encrypts the ciphertext and saves the base64-encoded ciphertext in a temporary file named ``ExampleReEncryptedFile.base64``. | |
60 | * The second command uses the ``certutil -decode`` command to decode the base64-encoded ciphertext in the file to binary. Then, it saves the binary ciphertext in the file ``ExampleReEncryptedFile``. This file is ready to be used in a decrypt or re-encrypt command in the AWS CLI. :: | |
42 | Before running this command, replace the example key ID with a valid key ID from your AWS account. :: | |
61 | 43 | |
62 | 44 | aws kms re-encrypt ^ |
63 | 45 | --ciphertext-blob fileb://ExampleEncryptedFile ^ |
46 | --source-key-id 1234abcd-12ab-34cd-56ef-1234567890ab ^ | |
64 | 47 | --destination-key-id 0987dcba-09fe-87dc-65ba-ab0987654321 ^ |
65 | --output text ^ | |
66 | --query CiphertextBlob > ExampleReEncryptedFile.base64 | |
67 | certutil -decode ExampleReEncryptedFile.base64 ExampleReEncryptedFile | |
48 | --query CiphertextBlob ^ | |
49 | --output text > ExampleReEncryptedFile.base64 | |
50 | ||
51 | Then use the ``certutil`` utility :: | |
52 | ||
53 | certutil -decode ExamplePlaintextFile.base64 ExamplePlaintextFile | |
68 | 54 | |
69 | 55 | Output:: |
70 | 56 | |
72 | 58 | Output Length = 12 |
73 | 59 | CertUtil: -decode command completed successfully. |
74 | 60 | |
75 | For more information, see `ReEncrypt <https://docs.aws.amazon.com/kms/latest/APIReference/API_ReEncrypt.html>`__ in the *AWS Key Management Service API Reference*. | |
61 | For more information, see `Using symmetric and asymmetric keys <https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html`__ in the *AWS KMS Developer Guide*. |
0 | **To detach an Aurora secondary cluster from an Aurora global database cluster** | |
1 | ||
2 | The following ``remove-from-global-cluster`` example detaches an Aurora secondary cluster from an Aurora global database cluster. The cluster changes from being read-only to a standalone cluster with read-write capability. :: | |
3 | ||
4 | aws rds remove-from-global-cluster \ | |
5 | --region us-west-2 \ | |
6 | --global-cluster-identifier myglobalcluster \ | |
7 | --db-cluster-identifier arn:aws:rds:us-west-2:123456789012:cluster:DB-1 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "GlobalCluster": { | |
13 | "GlobalClusterIdentifier": "myglobalcluster", | |
14 | "GlobalClusterResourceId": "cluster-abc123def456gh", | |
15 | "GlobalClusterArn": "arn:aws:rds::123456789012:global-cluster:myglobalcluster", | |
16 | "Status": "available", | |
17 | "Engine": "aurora-postgresql", | |
18 | "EngineVersion": "10.11", | |
19 | "StorageEncrypted": true, | |
20 | "DeletionProtection": false, | |
21 | "GlobalClusterMembers": [ | |
22 | { | |
23 | "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:js-global-cluster", | |
24 | "Readers": [ | |
25 | "arn:aws:rds:us-west-2:123456789012:cluster:DB-1" | |
26 | ], | |
27 | "IsWriter": true | |
28 | }, | |
29 | { | |
30 | "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:DB-1", | |
31 | "Readers": [], | |
32 | "IsWriter": false, | |
33 | "GlobalWriteForwardingStatus": "disabled" | |
34 | } | |
35 | ] | |
36 | } | |
37 | } | |
38 | ||
39 | For more information, see `Removing a cluster from an Amazon Aurora global database<https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-managing.html#aurora-global-database-detaching>`__ in the *Amazon Aurora User Guide*.⏎ |
0 | **To associate a firewall rule group with a VPC** | |
1 | ||
2 | The following ``associate-firewall-rule-group`` example associates a DNS Firewall rule group with an Amazon VPC. :: | |
3 | ||
4 | aws route53resolver associate-firewall-rule-group \ | |
5 | --name test-association \ | |
6 | --firewall-rule-group-id rslvr-frg-47f93271fexample \ | |
7 | --vpc-id vpc-31e92222 \ | |
8 | --priority 101 | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "FirewallRuleGroupAssociation": { | |
14 | "Id": "rslvr-frgassoc-57e8873d7example", | |
15 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group-association/rslvr-frgassoc-57e8873d7example", | |
16 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
17 | "VpcId": "vpc-31e92222", | |
18 | "Name": "test-association", | |
19 | "Priority": 101, | |
20 | "MutationProtection": "DISABLED", | |
21 | "Status": "UPDATING", | |
22 | "StatusMessage": "Creating Firewall Rule Group Association", | |
23 | "CreatorRequestId": "2ca1a304-32b3-4f5f-bc4c-EXAMPLE11111", | |
24 | "CreationTime": "2021-05-25T21:47:48.755768Z", | |
25 | "ModificationTime": "2021-05-25T21:47:48.755768Z" | |
26 | } | |
27 | } | |
28 | ||
29 | For more information, see `Managing associations between your VPC and Route 53 Resolver DNS Firewall rule groups <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-vpc-associating-rule-group.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To create a Route 53 Resolver DNS Firewall domain list** | |
1 | ||
2 | The following ``create-firewall-domain-list`` example creates a Route 53 Resolver DNS Firewall domain list, named test, in your AWS account. :: | |
3 | ||
4 | aws route53resolver create-firewall-domain-list \ | |
5 | --creator-request-id my-request-id \ | |
6 | --name test | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "FirewallDomainList": { | |
12 | "Id": "rslvr-fdl-d61cbb2cbexample", | |
13 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-domain-list/rslvr-fdl-d61cbb2cbexample", | |
14 | "Name": "test", | |
15 | "DomainCount": 0, | |
16 | "Status": "COMPLETE", | |
17 | "StatusMessage": "Created Firewall Domain List", | |
18 | "CreatorRequestId": "my-request-id", | |
19 | "CreationTime": "2021-05-25T15:55:51.115365Z", | |
20 | "ModificationTime": "2021-05-25T15:55:51.115365Z" | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Managing your own domain lists <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-user-managed-domain-lists.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To create a Firewall rule group** | |
1 | ||
2 | The following ``create-firewall-rule-group`` example creates a DNS Firewall rule group. :: | |
3 | ||
4 | aws route53resolver create-firewall-rule-group \ | |
5 | --creator-request-id my-request-id \ | |
6 | --name test | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "FirewallRuleGroup": { | |
12 | "Id": "rslvr-frg-47f93271fexample", | |
13 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group/rslvr-frg-47f93271fexample", | |
14 | "Name": "test", | |
15 | "RuleCount": 0, | |
16 | "Status": "COMPLETE", | |
17 | "StatusMessage": "Created Firewall Rule Group", | |
18 | "OwnerId": "123456789012", | |
19 | "CreatorRequestId": "my-request-id", | |
20 | "ShareStatus": "NOT_SHARED", | |
21 | "CreationTime": "2021-05-25T18:59:26.490017Z", | |
22 | "ModificationTime": "2021-05-25T18:59:26.490017Z" | |
23 | } | |
24 | } | |
25 | ||
26 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To create a firewall rule** | |
1 | ||
2 | The following ``create-firewall-rule`` example creates a firewall rule in a DNS Firewall rule for domains listed in a DNS Firewall domain list. :: | |
3 | ||
4 | aws route53resolver create-firewall-rule \ | |
5 | --name allow-rule \ | |
6 | --firewall-rule-group-id rslvr-frg-47f93271fexample \ | |
7 | --firewall-domain-list-id rslvr-fdl-9e956e9ffexample \ | |
8 | --priority 101 \ | |
9 | --action ALLOW | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "FirewallRule": { | |
15 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
16 | "FirewallDomainListId": "rslvr-fdl-9e956e9ffexample", | |
17 | "Name": "allow-rule", | |
18 | "Priority": 101, | |
19 | "Action": "ALLOW", | |
20 | "CreatorRequestId": "d81e3fb7-020b-415e-939f-EXAMPLE11111", | |
21 | "CreationTime": "2021-05-25T21:44:00.346093Z", | |
22 | "ModificationTime": "2021-05-25T21:44:00.346093Z" | |
23 | } | |
24 | } | |
25 | ||
26 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To delete a Route 53 Resolver DNS Firewall domain list** | |
1 | ||
2 | The following ``delete-firewall-domain-list`` example deletes a Route 53 Resolver DNS Firewall domain list, named test, in your AWS account. :: | |
3 | ||
4 | aws route53resolver delete-firewall-domain-list \ | |
5 | --firewall-domain-list-id rslvr-fdl-9e956e9ffexample | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallDomainList": { | |
11 | "Id": "rslvr-fdl-9e956e9ffexample", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-domain-list/rslvr-fdl-9e956e9ffexample", | |
13 | "Name": "test", | |
14 | "DomainCount": 6, | |
15 | "Status": "DELETING", | |
16 | "StatusMessage": "Deleting the Firewall Domain List", | |
17 | "CreatorRequestId": "my-request-id", | |
18 | "CreationTime": "2021-05-25T15:55:51.115365Z", | |
19 | "ModificationTime": "2021-05-25T18:58:05.588024Z" | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Managing your own domain lists <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-user-managed-domain-lists.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To delete a firewall rule group** | |
1 | ||
2 | The following ``delete-firewall-rule-group`` example deletes a firewall rule group. :: | |
3 | ||
4 | aws route53resolver delete-firewall-rule-group \ | |
5 | --firewall-rule-group-id rslvr-frg-47f93271fexample | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallRuleGroup": { | |
11 | "Id": "rslvr-frg-47f93271fexample", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group/rslvr-frg-47f93271fexample", | |
13 | "Name": "test", | |
14 | "RuleCount": 0, | |
15 | "Status": "UPDATING", | |
16 | "StatusMessage": "Updating Firewall Rule Group", | |
17 | "OwnerId": "123456789012", | |
18 | "CreatorRequestId": "my-request-id", | |
19 | "ShareStatus": "NOT_SHARED", | |
20 | "CreationTime": "2021-05-25T18:59:26.490017Z", | |
21 | "ModificationTime": "2021-05-25T21:51:53.028688Z" | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To delete a firewall rule** | |
1 | ||
2 | The following ``delete-firewall-rule`` example deletes a specified firewall rule. :: | |
3 | ||
4 | aws route53resolver delete-firewall-rule \ | |
5 | --firewall-rule-group-id rslvr-frg-47f93271fexample \ | |
6 | --firewall-domain-list-id rslvr-fdl-9e956e9ffexample | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "FirewallRule": { | |
12 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
13 | "FirewallDomainListId": "rslvr-fdl-9e956e9ffexample", | |
14 | "Name": "allow-rule", | |
15 | "Priority": 102, | |
16 | "Action": "ALLOW", | |
17 | "CreatorRequestId": "d81e3fb7-020b-415e-939f-EXAMPLE11111", | |
18 | "CreationTime": "2021-05-25T21:44:00.346093Z", | |
19 | "ModificationTime": "2021-05-25T21:45:59.611600Z" | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To disassociate a firewall rule group from a VPC** | |
1 | ||
2 | The following ``disassociate-firewall-rule-group`` example disassociates a DNS Firewall rule group from an Amazon VPC. :: | |
3 | ||
4 | aws route53resolver disassociate-firewall-rule-group \ | |
5 | --firewall-rule-group-association-id rslvr-frgassoc-57e8873d7example | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallRuleGroupAssociation": { | |
11 | "Id": "rslvr-frgassoc-57e8873d7example", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group-association/rslvr-frgassoc-57e8873d7example", | |
13 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
14 | "VpcId": "vpc-31e92222", | |
15 | "Name": "test-association", | |
16 | "Priority": 103, | |
17 | "MutationProtection": "DISABLED", | |
18 | "Status": "DELETING", | |
19 | "StatusMessage": "Deleting the Firewall Rule Group Association", | |
20 | "CreatorRequestId": "2ca1a304-32b3-4f5f-bc4c-EXAMPLE11111", | |
21 | "CreationTime": "2021-05-25T21:47:48.755768Z", | |
22 | "ModificationTime": "2021-05-25T21:51:02.377887Z" | |
23 | } | |
24 | } | |
25 | ||
26 | For more information, see `Managing associations between your VPC and Route 53 Resolver DNS Firewall rule groups <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-vpc-associating-rule-group.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To get a firewall config for a VPC** | |
1 | ||
2 | The following ``get-firewall-config`` example retrieves the DNS Firewall behavior for the specified VPC. :: | |
3 | ||
4 | aws route53resolver get-firewall-config \ | |
5 | --resource-id vpc-31e92222 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallConfig": { | |
11 | "Id": "rslvr-fc-86016850cexample", | |
12 | "ResourceId": "vpc-31e9222", | |
13 | "OwnerId": "123456789012", | |
14 | "FirewallFailOpen": "DISABLED" | |
15 | } | |
16 | } | |
17 | ||
18 | For more information, see `DNS Firewall VPC configuration <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-vpc-configuration.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To get a Route 53 Resolver DNS Firewall domain list** | |
1 | ||
2 | The following ``get-firewall-domain-list`` example retrieves the domain list with the ID you specify. :: | |
3 | ||
4 | aws route53resolver get-firewall-domain-list \ | |
5 | --firewall-domain-list-id rslvr-fdl-42b60677cexample | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallDomainList": { | |
11 | "Id": "rslvr-fdl-9e956e9ffexample", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123457689012:firewall-domain-list/rslvr-fdl-42b60677cexample", | |
13 | "Name": "test", | |
14 | "DomainCount": 0, | |
15 | "Status": "COMPLETE", | |
16 | "StatusMessage": "Created Firewall Domain List", | |
17 | "CreatorRequestId": "my-request-id", | |
18 | "CreationTime": "2021-05-25T15:55:51.115365Z", | |
19 | "ModificationTime": "2021-05-25T15:55:51.115365Z" | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Managing your own domain lists <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-user-managed-domain-lists.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To get a firewall rule group association** | |
1 | ||
2 | The following ``get-firewall-rule-group-association`` example retrieves a firewall rule group association. :: | |
3 | ||
4 | aws route53resolver get-firewall-rule-group-association \ | |
5 | --firewall-rule-group-association-id rslvr-frgassoc-57e8873d7example | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallRuleGroupAssociation": { | |
11 | "Id": "rslvr-frgassoc-57e8873d7example", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group-association/rslvr-frgassoc-57e8873d7example", | |
13 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
14 | "VpcId": "vpc-31e92222", | |
15 | "Name": "test-association", | |
16 | "Priority": 101, | |
17 | "MutationProtection": "DISABLED", | |
18 | "Status": "COMPLETE", | |
19 | "StatusMessage": "Finished rule group association update", | |
20 | "CreatorRequestId": "2ca1a304-32b3-4f5f-bc4c-EXAMPLE11111", | |
21 | "CreationTime": "2021-05-25T21:47:48.755768Z", | |
22 | "ModificationTime": "2021-05-25T21:47:48.755768Z" | |
23 | } | |
24 | } | |
25 | ||
26 | For more information, see `Managing associations between your VPC and Route 53 Resolver DNS Firewall rule groups <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-vpc-associating-rule-group.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To get an AWS IAM policy** | |
1 | ||
2 | The following ``get-firewall-rule-group-policy`` example gets the AWS Identity and Access Management (AWS IAM) policy for sharing the specified rule group. :: | |
3 | ||
4 | aws route53resolver get-firewall-rule-group-policy \ | |
5 | --arn arn:aws:route53resolver:us-west-2:AWS_ACCOUNT_ID:firewall-rule-group/rslvr-frg-47f93271fexample | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallRuleGroupPolicy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"test\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::AWS_ACCOUNT_ID:root\"},\"Action\":[\"route53resolver:GetFirewallRuleGroup\",\"route53resolver:ListFirewallRuleGroups\"],\"Resource\":\"arn:aws:route53resolver:us-east-1:AWS_ACCOUNT_ID:firewall-rule-group/rslvr-frg-47f93271fexample\"}]}" | |
11 | } | |
12 | ||
13 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To get a Firewall rule group** | |
1 | ||
2 | The following ``get-firewall-rule-group`` example retrieves information about a DNS Firewall rule group with the ID you provide. :: | |
3 | ||
4 | aws route53resolver get-firewall-rule-group \ | |
5 | --firewall-rule-group-id rslvr-frg-47f93271fexample | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallRuleGroup": { | |
11 | "Id": "rslvr-frg-47f93271fexample", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group/rslvr-frg-47f93271fexample", | |
13 | "Name": "test", | |
14 | "RuleCount": 0, | |
15 | "Status": "COMPLETE", | |
16 | "StatusMessage": "Created Firewall Rule Group", | |
17 | "OwnerId": "123456789012", | |
18 | "CreatorRequestId": "my-request-id", | |
19 | "ShareStatus": "NOT_SHARED", | |
20 | "CreationTime": "2021-05-25T18:59:26.490017Z", | |
21 | "ModificationTime": "2021-05-25T18:59:26.490017Z" | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To import domains into a domain list** | |
1 | ||
2 | The following ``import-firewall-domains`` example imports a set of domains from a file into a DNS Firewall domain list that you specify. :: | |
3 | ||
4 | aws route53resolver import-firewall-domains \ | |
5 | --firewall-domain-list-id rslvr-fdl-d61cbb2cbexample \ | |
6 | --operation REPLACE \ | |
7 | --domain-file-url s3://PATH/TO/YOUR/FILE | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Id": "rslvr-fdl-d61cbb2cbexample", | |
13 | "Name": "test", | |
14 | "Status": "IMPORTING", | |
15 | "StatusMessage": "Importing domains from provided file." | |
16 | } | |
17 | ||
18 | For more information, see `Managing your own domain lists <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-user-managed-domain-lists.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To list firewall configs** | |
1 | ||
2 | The following ``list-firewall-configs`` example lists your DNS Firewall configurations. :: | |
3 | ||
4 | aws route53resolver list-firewall-configs | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "FirewallConfigs": [ | |
10 | { | |
11 | "Id": "rslvr-fc-86016850cexample", | |
12 | "ResourceId": "vpc-31e92222", | |
13 | "OwnerId": "123456789012", | |
14 | "FirewallFailOpen": "DISABLED" | |
15 | } | |
16 | ] | |
17 | } | |
18 | ||
19 | For more information, see `DNS Firewall VPC configuration <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-vpc-configuration.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To list all of Route 53 Resolver DNS Firewall domain lists** | |
1 | ||
2 | The following ``list-firewall-domain-lists`` example lists all the domain lists. :: | |
3 | ||
4 | aws route53resolver list-firewall-domain-lists | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "FirewallDomainLists": [ | |
10 | { | |
11 | "Id": "rslvr-fdl-2c46f2ecfexample", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-domain-list/rslvr-fdl-2c46f2ecfexample", | |
13 | "Name": "AWSManagedDomainsMalwareDomainList", | |
14 | "CreatorRequestId": "AWSManagedDomainsMalwareDomainList", | |
15 | "ManagedOwnerName": "Route 53 Resolver DNS Firewall" | |
16 | }, | |
17 | { | |
18 | "Id": "rslvr-fdl-aa970e9e1example", | |
19 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-domain-list/rslvr-fdl-aa970e9e1example", | |
20 | "Name": "AWSManagedDomainsBotnetCommandandControl", | |
21 | "CreatorRequestId": "AWSManagedDomainsBotnetCommandandControl", | |
22 | "ManagedOwnerName": "Route 53 Resolver DNS Firewall" | |
23 | }, | |
24 | { | |
25 | "Id": "rslvr-fdl-42b60677cexample", | |
26 | "Arn": "arn:aws:route53resolver:us-west-2:123456789111:firewall-domain-list/rslvr-fdl-42b60677cexample", | |
27 | "Name": "test", | |
28 | "CreatorRequestId": "my-request-id" | |
29 | } | |
30 | ] | |
31 | } | |
32 | ||
33 | For more information, see `Route 53 Resolver DNS Firewall domain lists <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-domain-lists.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To list domains in a domain list** | |
1 | ||
2 | The following ``list-firewall-domains`` example lists the domains in a DNS Firewall domain list that you specify. :: | |
3 | ||
4 | aws route53resolver list-firewall-domains \ | |
5 | --firewall-domain-list-id rslvr-fdl-d61cbb2cbexample | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Domains": [ | |
11 | "test1.com.", | |
12 | "test2.com.", | |
13 | "test3.com." | |
14 | ] | |
15 | } | |
16 | ||
17 | For more information, see `Managing your own domain lists <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-user-managed-domain-lists.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To list DNS Firewall rule group associations** | |
1 | ||
2 | The following ``list-firewall-rule-group-associations`` example lists your DNS Firewall rule group associations with Amazon VPCs. :: | |
3 | ||
4 | aws route53resolver list-firewall-rule-group-associations | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "FirewallRuleGroupAssociations": [ | |
10 | { | |
11 | "Id": "rslvr-frgassoc-57e8873d7example", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group-association/rslvr-frgassoc-57e8873d7example", | |
13 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
14 | "VpcId": "vpc-31e92222", | |
15 | "Name": "test-association", | |
16 | "Priority": 101, | |
17 | "MutationProtection": "DISABLED", | |
18 | "Status": "UPDATING", | |
19 | "StatusMessage": "Creating Firewall Rule Group Association", | |
20 | "CreatorRequestId": "2ca1a304-32b3-4f5f-bc4c-EXAMPLE11111", | |
21 | "CreationTime": "2021-05-25T21:47:48.755768Z", | |
22 | "ModificationTime": "2021-05-25T21:47:48.755768Z" | |
23 | } | |
24 | ] | |
25 | } | |
26 | ||
27 | For more information, see `Managing associations between your VPC and Route 53 Resolver DNS Firewall rule group <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-vpc-associating-rule-group.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To get a list of your Firewall rule groups** | |
1 | ||
2 | The following ``list-firewall-rule-groups`` example lists your DNS Firewall rule groups. :: | |
3 | ||
4 | aws route53resolver list-firewall-rule-groups | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "FirewallRuleGroups": [ | |
10 | { | |
11 | "Id": "rslvr-frg-47f93271fexample", | |
12 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group/rslvr-frg-47f93271fexample", | |
13 | "Name": "test", | |
14 | "OwnerId": "123456789012", | |
15 | "CreatorRequestId": "my-request-id", | |
16 | "ShareStatus": "NOT_SHARED" | |
17 | } | |
18 | ] | |
19 | } | |
20 | ||
21 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To list firewall rules** | |
1 | ||
2 | The following ``list-firewall-rules`` example list all of your DNS Firewall rules within a firewall rule group. :: | |
3 | ||
4 | aws route53resolver list-firewall-rules \ | |
5 | --firewall-rule-group-id rslvr-frg-47f93271fexample | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FirewallRules": [ | |
11 | { | |
12 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
13 | "FirewallDomainListId": "rslvr-fdl-9e956e9ffexample", | |
14 | "Name": "allow-rule", | |
15 | "Priority": 101, | |
16 | "Action": "ALLOW", | |
17 | "CreatorRequestId": "d81e3fb7-020b-415e-939f-EXAMPLE11111", | |
18 | "CreationTime": "2021-05-25T21:44:00.346093Z", | |
19 | "ModificationTime": "2021-05-25T21:44:00.346093Z" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ||
24 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To attach an AWS IAM policy to share a Firewall rule group policy** | |
1 | ||
2 | The following ``put-firewall-rule-group-policy`` example attaches an AWS Identity and Access Management (AWS IAM) policy for sharing the rule group. :: | |
3 | ||
4 | aws route53resolver put-firewall-rule-group-policy \ | |
5 | --firewall-rule-group-policy "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"test\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::AWS_ACCOUNT_ID:root\"},\"Action\":[\"route53resolver:GetFirewallRuleGroup\",\"route53resolver:ListFirewallRuleGroups\"],\"Resource\":\"arn:aws:route53resolver:us-east-1:AWS_ACCOUNT_ID:firewall-rule-group/rslvr-frg-47f93271fexample\"}]}" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ReturnValue": true | |
11 | } | |
12 | ||
13 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To update a firewall config** | |
1 | ||
2 | The following ``update-firewall-config`` example updates DNS Firewall configuration. :: | |
3 | ||
4 | aws route53resolver update-firewall-config \ | |
5 | --resource-id vpc-31e92222 \ | |
6 | --firewall-fail-open DISABLED | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "FirewallConfig": { | |
12 | "Id": "rslvr-fc-86016850cexample", | |
13 | "ResourceId": "vpc-31e92222", | |
14 | "OwnerId": "123456789012", | |
15 | "FirewallFailOpen": "DISABLED" | |
16 | } | |
17 | } | |
18 | ||
19 | For more information, see `DNS Firewall VPC configuration <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-vpc-configuration.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To update a domain list** | |
1 | ||
2 | The following ``update-firewall-domains`` example adds the domains to a domain list with the ID you provide. :: | |
3 | ||
4 | aws route53resolver update-firewall-domains \ | |
5 | --firewall-domain-list-id rslvr-fdl-42b60677cexampleb \ | |
6 | --operation ADD \ | |
7 | --domains test1.com test2.com test3.com \ | |
8 | --profile yw | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "Id": "rslvr-fdl-42b60677cexample", | |
14 | "Name": "test", | |
15 | "Status": "UPDATING", | |
16 | "StatusMessage": "Updating the Firewall Domain List" | |
17 | } | |
18 | ||
19 | For more information, see `Managing your own domain lists <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-user-managed-domain-lists.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To update a firewall rule group association** | |
1 | ||
2 | The following ``update-firewall-rule-group-association`` example updates a firewall rule group association. :: | |
3 | ||
4 | aws route53resolver update-firewall-rule-group-association \ | |
5 | --firewall-rule-group-association-id rslvr-frgassoc-57e8873d7example \ | |
6 | --priority 103 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "FirewallRuleGroupAssociation": { | |
12 | "Id": "rslvr-frgassoc-57e8873d7example", | |
13 | "Arn": "arn:aws:route53resolver:us-west-2:123456789012:firewall-rule-group-association/rslvr-frgassoc-57e8873d7example", | |
14 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
15 | "VpcId": "vpc-31e92222", | |
16 | "Name": "test-association", | |
17 | "Priority": 103, | |
18 | "MutationProtection": "DISABLED", | |
19 | "Status": "UPDATING", | |
20 | "StatusMessage": "Updating the Firewall Rule Group Association Attributes", | |
21 | "CreatorRequestId": "2ca1a304-32b3-4f5f-bc4c-EXAMPLE11111", | |
22 | "CreationTime": "2021-05-25T21:47:48.755768Z", | |
23 | "ModificationTime": "2021-05-25T21:50:09.272569Z" | |
24 | } | |
25 | } | |
26 | ||
27 | For more information, see `Managing associations between your VPC and Route 53 Resolver DNS Firewall rule group <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-vpc-associating-rule-group.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
0 | **To update a firewall rule** | |
1 | ||
2 | The following ``update-firewall-rule`` example updates a firewall rule with the parameters you specify. :: | |
3 | ||
4 | aws route53resolver update-firewall-rule \ | |
5 | --firewall-rule-group-id rslvr-frg-47f93271fexample \ | |
6 | --firewall-domain-list-id rslvr-fdl-9e956e9ffexample \ | |
7 | --priority 102 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "FirewallRule": { | |
13 | "FirewallRuleGroupId": "rslvr-frg-47f93271fexample", | |
14 | "FirewallDomainListId": "rslvr-fdl-9e956e9ffexample", | |
15 | "Name": "allow-rule", | |
16 | "Priority": 102, | |
17 | "Action": "ALLOW", | |
18 | "CreatorRequestId": "d81e3fb7-020b-415e-939f-EXAMPLE11111", | |
19 | "CreationTime": "2021-05-25T21:44:00.346093Z", | |
20 | "ModificationTime": "2021-05-25T21:45:59.611600Z" | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Managing rule groups and rules in DNS Firewall <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resolver-dns-firewall-rule-group-managing.html>`__ in the *Amazon Route 53 Developer Guide*.⏎ |
150 | 150 | |
151 | 151 | **Uploading a local file stream to S3** |
152 | 152 | |
153 | WARNING:: PowerShell may alter the encoding of or add a CRLF to piped input. | |
153 | .. WARNING:: PowerShell may alter the encoding of or add a CRLF to piped input. | |
154 | 154 | |
155 | 155 | The following ``cp`` command uploads a local file stream from standard input to a specified bucket and key:: |
156 | 156 | |
157 | 157 | aws s3 cp - s3://mybucket/stream.txt |
158 | 158 | |
159 | **Uploading a local file stream that is larger than 50GB to S3** | |
160 | ||
161 | The following ``cp`` command uploads a 51GB local file stream from standard input to a specified bucket and key. The ``--expected-size`` option must be provided, or the upload may fail when it reaches the default part limit of 10,000:: | |
162 | ||
163 | aws s3 cp - s3://mybucket/stream.txt --expected-size 54760833024 | |
159 | 164 | |
160 | 165 | **Downloading an S3 object as a local file stream** |
161 | 166 | |
162 | WARNING:: PowerShell may alter the encoding of or add a CRLF to piped or redirected output. | |
167 | .. WARNING:: PowerShell may alter the encoding of or add a CRLF to piped or redirected output. | |
163 | 168 | |
164 | 169 | 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:: |
165 | 170 |
0 | **To accept an invitation from an administrator account** | |
1 | ||
2 | The following ``accept-administrator-invitation`` example accepts the specified invitation from the specified administrator account. :: | |
3 | ||
4 | aws securityhub accept-invitation \ | |
5 | --administrator-id 123456789012 \ | |
6 | --invitation-id 7ab938c5d52d7904ad09f9e7c20cc4eb | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | **To accept an invitation from a master account** | |
0 | **To accept an invitation from an administrator account** | |
1 | 1 | |
2 | The following ``accept-invitation`` example accepts the specified invitation from the specified master account. :: | |
2 | The following ``accept-invitation`` example accepts the specified invitation from the specified administrator account. :: | |
3 | 3 | |
4 | 4 | aws securityhub accept-invitation \ |
5 | 5 | --master-id 123456789012 \ |
7 | 7 | |
8 | 8 | This command produces no output. |
9 | 9 | |
10 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
10 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
6 | 6 | [{ |
7 | 7 | "AwsAccountId": "123456789012", |
8 | 8 | "CreatedAt": "2020-05-27T17:05:54.832Z", |
9 | "Description": "Vulnerability in a CloudTrail trail", | |
9 | "Description": "Vulnerability in a CloudTrail trail", | |
10 | "FindingProviderFields": { | |
11 | "Severity": { | |
12 | "Label": "LOW", | |
13 | "Original": "10" | |
14 | }, | |
15 | "Types": [ | |
16 | "Software and Configuration Checks/Vulnerabilities/CVE" | |
17 | ] | |
18 | }, | |
10 | 19 | "GeneratorId": "TestGeneratorId", |
11 | 20 | "Id": "Id1", |
12 | 21 | "ProductArn": "arn:aws:securityhub:us-west-1:123456789012:product/123456789012/default", |
19 | 28 | } |
20 | 29 | ], |
21 | 30 | "SchemaVersion": "2018-10-08", |
22 | "Severity": { | |
23 | "Label": "LOW", | |
24 | "Product": 10 | |
25 | }, | |
26 | 31 | "Title": "CloudTrail trail vulnerability", |
27 | "Types": [ | |
28 | "Software and Configuration Checks/Vulnerabilities/CVE" | |
29 | ], | |
30 | 32 | "UpdatedAt": "2020-06-02T16:05:54.832Z" |
31 | 33 | }]' |
32 | 34 | |
38 | 40 | "FailedFindings": [] |
39 | 41 | } |
40 | 42 | |
41 | For more information, see `Using BatchImportFindings to create and update findings <https://docs.aws.amazon.com/securityhub/latest/userguide/finding-update-batchimportfindings.html>`__ in the *AWS Security Hub User Guide*. | |
43 | For more information, see `Using BatchImportFindings to create and update findings <https://docs.aws.amazon.com/securityhub/latest/userguide/finding-update-batchimportfindings.html>`__ in the *AWS Security Hub User Guide*.⏎ |
0 | 0 | **To add accounts as member accounts** |
1 | 1 | |
2 | The following ``create-members`` example adds two accounts as member accounts to the requesting master account. :: | |
2 | The following ``create-members`` example adds two accounts as member accounts to the requesting administrator account. :: | |
3 | 3 | |
4 | 4 | aws securityhub create-members \ |
5 | 5 | --account-details '[{"AccountId": "123456789111"}, {"AccountId": "123456789222"}]' |
10 | 10 | "UnprocessedAccounts": [] |
11 | 11 | } |
12 | 12 | |
13 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
13 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | 0 | **To decline an invitation to be a member account** |
1 | 1 | |
2 | The following ``decline-invitations`` example declines an invitation to be a member account of the specified master account. The member account is the requesting account. :: | |
2 | The following ``decline-invitations`` example declines an invitation to be a member account of the specified administrator account. The member account is the requesting account. :: | |
3 | 3 | |
4 | 4 | aws securityhub decline-invitations \ |
5 | 5 | --account-ids "123456789012" |
10 | 10 | "UnprocessedAccounts": [] |
11 | 11 | } |
12 | 12 | |
13 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
13 | ||
14 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | 0 | **To delete an invitation to be a member account** |
1 | 1 | |
2 | The following ``delete-invitations`` example deletes an invitation to be a member account for the specified master account. The member account is the requesting account. :: | |
2 | The following ``delete-invitations`` example deletes an invitation to be a member account for the specified administrator account. The member account is the requesting account. :: | |
3 | 3 | |
4 | 4 | aws securityhub delete-invitations \ |
5 | 5 | --account-ids "123456789012" |
10 | 10 | "UnprocessedAccounts": [] |
11 | 11 | } |
12 | 12 | |
13 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
13 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | 0 | **To delete member accounts** |
1 | 1 | |
2 | The following ``delete-members`` example deletes the specified member accounts from the requesting master account. :: | |
2 | The following ``delete-members`` example deletes the specified member accounts from the requesting administrator account. :: | |
3 | 3 | |
4 | 4 | aws securityhub delete-members \ |
5 | 5 | --account-ids "123456789111" "123456789222" |
10 | 10 | "UnprocessedAccounts": [] |
11 | 11 | } |
12 | 12 | |
13 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
13 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | **To disassociate from an administrator account** | |
1 | ||
2 | The following ``disassociate-from-administrator-account`` example disassociates the requesting account from its current administrator account. :: | |
3 | ||
4 | aws securityhub disassociate-from-administrator-account | |
5 | ||
6 | This command produces no output. | |
7 | ||
8 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | **To disassociate from a master account** | |
0 | **To disassociate from an administrator account** | |
1 | 1 | |
2 | The following ``disassociate-from-master-account`` example disassociates the requesting account from its current master account. :: | |
2 | The following ``disassociate-from-master-account`` example disassociates the requesting account from its current administrator account. :: | |
3 | 3 | |
4 | 4 | aws securityhub disassociate-from-master-account |
5 | 5 | |
6 | 6 | This command produces no output. |
7 | 7 | |
8 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
8 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | 0 | **To disassociate member accounts** |
1 | 1 | |
2 | The following ``disassociate-members`` example disassociates the specified member accounts from the requesting master account. :: | |
2 | The following ``disassociate-members`` example disassociates the specified member accounts from the requesting administrator account. :: | |
3 | 3 | |
4 | 4 | aws securityhub disassociate-members \ |
5 | 5 | --account-ids "123456789111" "123456789222" |
6 | 6 | |
7 | 7 | This command produces no output. |
8 | 8 | |
9 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
9 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | **To retrieve information about an administrator account** | |
1 | ||
2 | The following ``get-administrator-account`` example retrieves information about the administrator account for the requesting account. :: | |
3 | ||
4 | aws securityhub get-administrator-account | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Master": { | |
10 | "AccountId": "123456789012", | |
11 | "InvitationId": "7ab938c5d52d7904ad09f9e7c20cc4eb", | |
12 | "InvitedAt": 2020-06-01T20:21:18.042000+00:00, | |
13 | "MemberStatus": "ASSOCIATED" | |
14 | } | |
15 | } | |
16 | ||
17 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | **To return findings generated for a specific standard** | |
0 | **Example 1: To return findings generated for a specific standard** | |
1 | 1 | |
2 | 2 | The following ``get-findings`` example returns findings for the PCI DSS standard. :: |
3 | 3 | |
4 | 4 | aws securityhub get-findings \ |
5 | --filters '{"GeneratorId":[{"Value": "pci-dss","Comparison":"PREFIX"}]}' | |
5 | --filters '{"GeneratorId":[{"Value": "pci-dss","Comparison":"PREFIX"}]}' \ | |
6 | 6 | --max-items 1 |
7 | 7 | |
8 | 8 | Output:: |
17 | 17 | "AwsAccountId": "123456789012", |
18 | 18 | "Types": [ |
19 | 19 | "Software and Configuration Checks/Industry and Regulatory Standards/PCI-DSS" |
20 | ], | |
20 | ], | |
21 | "FindingProviderFields": { | |
22 | "Severity": { | |
23 | "Original": 0, | |
24 | "Label": "INFORMATIONAL" | |
25 | }, | |
26 | "Types": [ | |
27 | "Software and Configuration Checks/Industry and Regulatory Standards/PCI-DSS" | |
28 | ] | |
29 | }, | |
21 | 30 | "FirstObservedAt": "2020-06-02T14:02:49.159Z", |
22 | 31 | "LastObservedAt": "2020-06-02T14:02:52.397Z", |
23 | 32 | "CreatedAt": "2020-06-02T14:02:49.159Z", |
24 | 33 | "UpdatedAt": "2020-06-02T14:02:52.397Z", |
25 | 34 | "Severity": { |
26 | "Product": 0, | |
35 | "Original": 0, | |
27 | 36 | "Label": "INFORMATIONAL", |
28 | 37 | "Normalized": 0 |
29 | 38 | }, |
75 | 84 | "NextToken": "eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxfQ==" |
76 | 85 | } |
77 | 86 | |
78 | ** To return critical-severity findings that have a workflow status of NOTIFIED ** | |
87 | **Example 2: To return critical-severity findings that have a workflow status of NOTIFIED** | |
79 | 88 | |
80 | 89 | The following ``get-findings`` example returns findings that have a severity label value of CRITICAL and a workflow status of NOTIFIED. The results are sorted in descending order by the value of Confidence. :: |
81 | 90 | |
97 | 106 | "Types": [ |
98 | 107 | "Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark" |
99 | 108 | ], |
109 | "FindingProviderFields" { | |
110 | "Severity": { | |
111 | "Original": 90, | |
112 | "Label": "CRITICAL" | |
113 | }, | |
114 | "Types": [ | |
115 | "Software and Configuration Checks/Industry and Regulatory Standards/CIS AWS Foundations Benchmark" | |
116 | ] | |
117 | }, | |
100 | 118 | "FirstObservedAt": "2020-05-21T20:16:34.752Z", |
101 | 119 | "LastObservedAt": "2020-06-09T08:16:37.171Z", |
102 | 120 | "CreatedAt": "2020-05-21T20:16:34.752Z", |
103 | 121 | "UpdatedAt": "2020-06-09T08:16:36.430Z", |
104 | 122 | "Severity": { |
105 | "Product": 90, | |
123 | "Original": 90, | |
106 | 124 | "Label": "CRITICAL", |
107 | 125 | "Normalized": 90 |
108 | 126 | }, |
6 | 6 | Output:: |
7 | 7 | |
8 | 8 | { |
9 | "InvitationsCount": 3 | |
9 | "InvitationsCount": 3 | |
10 | 10 | } |
11 | 11 | |
12 | 12 | |
13 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
13 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | **To retrieve information about a master account** | |
0 | **To retrieve information about an administrator account** | |
1 | 1 | |
2 | The following ``get-master-account`` example retrieves information about the master account for the requesting account. :: | |
2 | The following ``get-master-account`` example retrieves information about the administrator account for the requesting account. :: | |
3 | 3 | |
4 | 4 | aws securityhub get-master-account |
5 | 5 | |
6 | 6 | Output:: |
7 | 7 | |
8 | 8 | { |
9 | "Master": { | |
10 | "AccountId": "123456789012", | |
11 | "InvitationId": "7ab938c5d52d7904ad09f9e7c20cc4eb", | |
12 | "InvitedAt": 2020-06-01T20:21:18.042000+00:00, | |
13 | "MemberStatus": "ASSOCIATED" | |
14 | } | |
9 | "Master": { | |
10 | "AccountId": "123456789012", | |
11 | "InvitationId": "7ab938c5d52d7904ad09f9e7c20cc4eb", | |
12 | "InvitedAt": 2020-06-01T20:21:18.042000+00:00, | |
13 | "MemberStatus": "ASSOCIATED" | |
14 | } | |
15 | 15 | } |
16 | 16 | |
17 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
17 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
10 | 10 | "Members": [ |
11 | 11 | { |
12 | 12 | "AccountId": "123456789111", |
13 | "AdministratorId": "123456789012", | |
13 | 14 | "InvitedAt": 2020-06-01T20:15:15.289000+00:00, |
14 | 15 | "MasterId": "123456789012", |
15 | 16 | "MemberStatus": "ASSOCIATED", |
17 | 18 | }, |
18 | 19 | { |
19 | 20 | "AccountId": "123456789222", |
21 | "AdministratorId": "123456789012", | |
20 | 22 | "InvitedAt": 2020-06-01T20:15:15.289000+00:00, |
21 | 23 | "MasterId": "123456789012", |
22 | 24 | "MemberStatus": "ASSOCIATED", |
26 | 28 | "UnprocessedAccounts": [ ] |
27 | 29 | } |
28 | 30 | |
29 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
31 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
10 | 10 | "UnprocessedAccounts": [] |
11 | 11 | } |
12 | 12 | |
13 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
13 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
16 | 16 | ], |
17 | 17 | } |
18 | 18 | |
19 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
19 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
0 | 0 | **To retrieve a list of member accounts** |
1 | 1 | |
2 | The following ``list-members`` example returns the list of member accounts for the requesting master account. :: | |
2 | The following ``list-members`` example returns the list of member accounts for the requesting administrator account. :: | |
3 | 3 | |
4 | 4 | aws securityhub list-members |
5 | 5 | |
9 | 9 | "Members": [ |
10 | 10 | { |
11 | 11 | "AccountId": "123456789111", |
12 | "AdministratorId": "123456789012", | |
12 | 13 | "InvitedAt": 2020-06-01T20:15:15.289000+00:00, |
13 | 14 | "MasterId": "123456789012", |
14 | 15 | "MemberStatus": "ASSOCIATED", |
16 | 17 | }, |
17 | 18 | { |
18 | 19 | "AccountId": "123456789222", |
20 | "AdministratorId": "123456789012", | |
19 | 21 | "InvitedAt": 2020-06-01T20:15:15.289000+00:00, |
20 | 22 | "MasterId": "123456789012", |
21 | 23 | "MemberStatus": "ASSOCIATED", |
24 | 26 | ], |
25 | 27 | } |
26 | 28 | |
27 | For more information, see `Master and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. | |
29 | For more information, see `Managing administrator and member accounts <https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-accounts.html>`__ in the *AWS Security Hub User Guide*. |
2 | 2 | The following ``opt-in-phone-number`` example opts the specified phone number into receiving SMS messages. :: |
3 | 3 | |
4 | 4 | aws sns opt-in-phone-number \ |
5 | --phone-number 555-555-0100 | |
5 | --phone-number +1-555-555-0100 | |
6 | 6 | |
7 | 7 | This command produces no output. |
0 | **To delete an association** | |
1 | ||
2 | This example deletes the association between an instance and a document. There is no output if the command succeeds. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ssm delete-association --instance-id "i-1234567890abcdef0" --name "AWS-UpdateSSMAgent" | |
7 | ||
8 | **To delete an association using the association ID** | |
9 | ||
10 | This example deletes the association for the specified association ID. There is no output if the command succeeds. | |
11 | ||
12 | Command:: | |
13 | ||
14 | aws ssm delete-association --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
0 | **Example 1: To delete an association using the association ID** | |
1 | ||
2 | The following ``delete-association`` example deletes the association for the specified association ID. There is no output if the command succeeds. :: | |
3 | ||
4 | aws ssm delete-association \ | |
5 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Editing and creating a new version of an association <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-edit.html>`__ in the *AWS Systems Manager User Guide*. | |
10 | ||
11 | **Example 2: To delete an association** | |
12 | ||
13 | The following ``delete-association`` example deletes the association between an instance and a document. There is no output if the command succeeds. :: | |
14 | ||
15 | aws ssm delete-association \ | |
16 | --instance-id "i-1234567890abcdef0" \ | |
17 | --name "AWS-UpdateSSMAgent" | |
18 | ||
19 | This command produces no output. | |
20 | ||
21 | For more information, see `Working with associations in Systems Manager <https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-associations.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To get details of an association execution** | |
1 | ||
2 | This example describes the specified association execution. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ssm describe-association-execution-targets --association-id "8dfe3659-4309-493a-8755-0123456789ab" --execution-id "7abb6378-a4a5-4f10-8312-0123456789ab" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociationExecutionTargets": [ | |
12 | { | |
13 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
14 | "AssociationVersion": "1", | |
15 | "ExecutionId": "7abb6378-a4a5-4f10-8312-0123456789ab", | |
16 | "ResourceId": "i-1234567890abcdef0", | |
17 | "ResourceType": "ManagedInstance", | |
18 | "Status": "Success", | |
19 | "DetailedStatus": "Success", | |
20 | "LastExecutionDate": 1550505538.497, | |
21 | "OutputSource": { | |
22 | "OutputSourceId": "97fff367-fc5a-4299-aed8-0123456789ab", | |
23 | "OutputSourceType": "RunCommand" | |
24 | } | |
25 | } | |
26 | ] | |
27 | } | |
0 | **To get details of an association execution** | |
1 | ||
2 | The following ``describe-association-execution-targets`` example describes the specified association execution. :: | |
3 | ||
4 | aws ssm describe-association-execution-targets \ | |
5 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" \ | |
6 | --execution-id "7abb6378-a4a5-4f10-8312-0123456789ab" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociationExecutionTargets": [ | |
12 | { | |
13 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
14 | "AssociationVersion": "1", | |
15 | "ExecutionId": "7abb6378-a4a5-4f10-8312-0123456789ab", | |
16 | "ResourceId": "i-1234567890abcdef0", | |
17 | "ResourceType": "ManagedInstance", | |
18 | "Status": "Success", | |
19 | "DetailedStatus": "Success", | |
20 | "LastExecutionDate": 1550505538.497, | |
21 | "OutputSource": { | |
22 | "OutputSourceId": "97fff367-fc5a-4299-aed8-0123456789ab", | |
23 | "OutputSourceType": "RunCommand" | |
24 | } | |
25 | } | |
26 | ] | |
27 | } | |
28 | ||
29 | For more information, see `Viewing association histories <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-history.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To get details of all executions for an association** | |
1 | ||
2 | This example describes all executions of the specified association. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ssm describe-association-executions --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociationExecutions": [ | |
12 | { | |
13 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
14 | "AssociationVersion": "1", | |
15 | "ExecutionId": "474925ef-1249-45a2-b93d-0123456789ab", | |
16 | "Status": "Success", | |
17 | "DetailedStatus": "Success", | |
18 | "CreatedTime": 1550505827.119, | |
19 | "ResourceCountByStatus": "{Success=1}" | |
20 | }, | |
21 | { | |
22 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
23 | "AssociationVersion": "1", | |
24 | "ExecutionId": "7abb6378-a4a5-4f10-8312-0123456789ab", | |
25 | "Status": "Success", | |
26 | "DetailedStatus": "Success", | |
27 | "CreatedTime": 1550505536.843, | |
28 | "ResourceCountByStatus": "{Success=1}" | |
29 | }, | |
30 | ... | |
31 | ] | |
32 | } | |
33 | ||
34 | **To get details of all executions for an association after a specific date and time** | |
35 | ||
36 | This example describes all executions of an association after the specified date and time. | |
37 | ||
38 | Command:: | |
39 | ||
40 | aws ssm describe-association-executions --association-id "8dfe3659-4309-493a-8755-0123456789ab" --filters "Key=CreatedTime,Value=2019-02-18T16:00:00Z,Type=GREATER_THAN" | |
41 | ||
42 | Output:: | |
43 | ||
44 | { | |
45 | "AssociationExecutions": [ | |
46 | { | |
47 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
48 | "AssociationVersion": "1", | |
49 | "ExecutionId": "474925ef-1249-45a2-b93d-0123456789ab", | |
50 | "Status": "Success", | |
51 | "DetailedStatus": "Success", | |
52 | "CreatedTime": 1550505827.119, | |
53 | "ResourceCountByStatus": "{Success=1}" | |
54 | } | |
55 | ] | |
56 | } | |
0 | **Example 1: To get details of all executions for an association** | |
1 | ||
2 | The following ``describe-association-executions`` example describes all executions of the specified association. :: | |
3 | ||
4 | aws ssm describe-association-executions \ | |
5 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "AssociationExecutions": [ | |
11 | { | |
12 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
13 | "AssociationVersion": "1", | |
14 | "ExecutionId": "474925ef-1249-45a2-b93d-0123456789ab", | |
15 | "Status": "Success", | |
16 | "DetailedStatus": "Success", | |
17 | "CreatedTime": 1550505827.119, | |
18 | "ResourceCountByStatus": "{Success=1}" | |
19 | }, | |
20 | { | |
21 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
22 | "AssociationVersion": "1", | |
23 | "ExecutionId": "7abb6378-a4a5-4f10-8312-0123456789ab", | |
24 | "Status": "Success", | |
25 | "DetailedStatus": "Success", | |
26 | "CreatedTime": 1550505536.843, | |
27 | "ResourceCountByStatus": "{Success=1}" | |
28 | }, | |
29 | ... | |
30 | ] | |
31 | } | |
32 | ||
33 | For more information, see `Viewing association histories <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-history.html>`__ in the *AWS Systems Manager User Guide*. | |
34 | ||
35 | **Example 2: To get details of all executions for an association after a specific date and time** | |
36 | ||
37 | The following ``describe-association-executions`` example describes all executions of an association after the specified date and time. :: | |
38 | ||
39 | aws ssm describe-association-executions \ | |
40 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" \ | |
41 | --filters "Key=CreatedTime,Value=2019-02-18T16:00:00Z,Type=GREATER_THAN" | |
42 | ||
43 | Output:: | |
44 | ||
45 | { | |
46 | "AssociationExecutions": [ | |
47 | { | |
48 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
49 | "AssociationVersion": "1", | |
50 | "ExecutionId": "474925ef-1249-45a2-b93d-0123456789ab", | |
51 | "Status": "Success", | |
52 | "DetailedStatus": "Success", | |
53 | "CreatedTime": 1550505827.119, | |
54 | "ResourceCountByStatus": "{Success=1}" | |
55 | }, | |
56 | { | |
57 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
58 | "AssociationVersion": "1", | |
59 | "ExecutionId": "7abb6378-a4a5-4f10-8312-0123456789ab", | |
60 | "Status": "Success", | |
61 | "DetailedStatus": "Success", | |
62 | "CreatedTime": 1550505536.843, | |
63 | "ResourceCountByStatus": "{Success=1}" | |
64 | }, | |
65 | ... | |
66 | ] | |
67 | } | |
68 | ||
69 | For more information, see `Viewing association histories <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-history.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To get details of an association** | |
1 | ||
2 | This example describes the association for the specified association ID. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ssm describe-association --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociationDescription": { | |
12 | "Name": "AWS-GatherSoftwareInventory", | |
13 | "AssociationVersion": "1", | |
14 | "Date": 1534864780.995, | |
15 | "LastUpdateAssociationDate": 1543235759.81, | |
16 | "Overview": { | |
17 | "Status": "Success", | |
18 | "AssociationStatusAggregatedCount": { | |
19 | "Success": 2 | |
20 | } | |
21 | }, | |
22 | "DocumentVersion": "$DEFAULT", | |
23 | "Parameters": { | |
24 | "applications": [ | |
25 | "Enabled" | |
26 | ], | |
27 | "awsComponents": [ | |
28 | "Enabled" | |
29 | ], | |
30 | "customInventory": [ | |
31 | "Enabled" | |
32 | ], | |
33 | "files": [ | |
34 | "" | |
35 | ], | |
36 | "instanceDetailedInformation": [ | |
37 | "Enabled" | |
38 | ], | |
39 | "networkConfig": [ | |
40 | "Enabled" | |
41 | ], | |
42 | "services": [ | |
43 | "Enabled" | |
44 | ], | |
45 | "windowsRegistry": [ | |
46 | "" | |
47 | ], | |
48 | "windowsRoles": [ | |
49 | "Enabled" | |
50 | ], | |
51 | "windowsUpdates": [ | |
52 | "Enabled" | |
53 | ] | |
54 | }, | |
55 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
56 | "Targets": [ | |
57 | { | |
58 | "Key": "InstanceIds", | |
59 | "Values": [ | |
60 | "*" | |
61 | ] | |
62 | } | |
63 | ], | |
64 | "ScheduleExpression": "rate(24 hours)", | |
65 | "LastExecutionDate": 1550501886.0, | |
66 | "LastSuccessfulExecutionDate": 1550501886.0, | |
67 | "AssociationName": "Inventory-Association" | |
68 | } | |
69 | } | |
70 | ||
71 | **To get details of an association for a specific instance and document** | |
72 | ||
73 | This example describes the association between an instance and a document. | |
74 | ||
75 | Command:: | |
76 | ||
77 | aws ssm describe-association --instance-id "i-1234567890abcdef0" --name "AWS-UpdateSSMAgent" | |
78 | ||
79 | Output:: | |
80 | ||
81 | { | |
82 | "AssociationDescription": { | |
83 | "Status": { | |
84 | "Date": 1487876122.564, | |
85 | "Message": "Associated with AWS-UpdateSSMAgent", | |
86 | "Name": "Associated" | |
87 | }, | |
88 | "Name": "AWS-UpdateSSMAgent", | |
89 | "InstanceId": "i-1234567890abcdef0", | |
90 | "Overview": { | |
91 | "Status": "Pending", | |
92 | "DetailedStatus": "Associated", | |
93 | "AssociationStatusAggregatedCount": { | |
94 | "Pending": 1 | |
95 | } | |
96 | }, | |
97 | "AssociationId": "d8617c07-2079-4c18-9847-1234567890ab", | |
98 | "DocumentVersion": "$DEFAULT", | |
99 | "LastUpdateAssociationDate": 1487876122.564, | |
100 | "Date": 1487876122.564, | |
101 | "Targets": [ | |
102 | { | |
103 | "Values": [ | |
104 | "i-1234567890abcdef0" | |
105 | ], | |
106 | "Key": "InstanceIds" | |
107 | } | |
108 | ] | |
109 | } | |
110 | } | |
0 | **Example 1: To get details of an association** | |
1 | ||
2 | The following ``describe-association`` example describes the association for the specified association ID. :: | |
3 | ||
4 | aws ssm describe-association \ | |
5 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "AssociationDescription": { | |
11 | "Name": "AWS-GatherSoftwareInventory", | |
12 | "AssociationVersion": "1", | |
13 | "Date": 1534864780.995, | |
14 | "LastUpdateAssociationDate": 1543235759.81, | |
15 | "Overview": { | |
16 | "Status": "Success", | |
17 | "AssociationStatusAggregatedCount": { | |
18 | "Success": 2 | |
19 | } | |
20 | }, | |
21 | "DocumentVersion": "$DEFAULT", | |
22 | "Parameters": { | |
23 | "applications": [ | |
24 | "Enabled" | |
25 | ], | |
26 | "awsComponents": [ | |
27 | "Enabled" | |
28 | ], | |
29 | "customInventory": [ | |
30 | "Enabled" | |
31 | ], | |
32 | "files": [ | |
33 | "" | |
34 | ], | |
35 | "instanceDetailedInformation": [ | |
36 | "Enabled" | |
37 | ], | |
38 | "networkConfig": [ | |
39 | "Enabled" | |
40 | ], | |
41 | "services": [ | |
42 | "Enabled" | |
43 | ], | |
44 | "windowsRegistry": [ | |
45 | "" | |
46 | ], | |
47 | "windowsRoles": [ | |
48 | "Enabled" | |
49 | ], | |
50 | "windowsUpdates": [ | |
51 | "Enabled" | |
52 | ] | |
53 | }, | |
54 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
55 | "Targets": [ | |
56 | { | |
57 | "Key": "InstanceIds", | |
58 | "Values": [ | |
59 | "*" | |
60 | ] | |
61 | } | |
62 | ], | |
63 | "ScheduleExpression": "rate(24 hours)", | |
64 | "LastExecutionDate": 1550501886.0, | |
65 | "LastSuccessfulExecutionDate": 1550501886.0, | |
66 | "AssociationName": "Inventory-Association" | |
67 | } | |
68 | } | |
69 | ||
70 | For more information, see `Editing and creating a new version of an association <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-edit.html>`__ in the *AWS Systems Manager User Guide*. | |
71 | ||
72 | **Example 2: To get details of an association for a specific instance and document** | |
73 | ||
74 | The following ``describe-association`` example describes the association between an instance and a document. :: | |
75 | ||
76 | aws ssm describe-association \ | |
77 | --instance-id "i-1234567890abcdef0" \ | |
78 | --name "AWS-UpdateSSMAgent" | |
79 | ||
80 | Output:: | |
81 | ||
82 | { | |
83 | "AssociationDescription": { | |
84 | "Status": { | |
85 | "Date": 1487876122.564, | |
86 | "Message": "Associated with AWS-UpdateSSMAgent", | |
87 | "Name": "Associated" | |
88 | }, | |
89 | "Name": "AWS-UpdateSSMAgent", | |
90 | "InstanceId": "i-1234567890abcdef0", | |
91 | "Overview": { | |
92 | "Status": "Pending", | |
93 | "DetailedStatus": "Associated", | |
94 | "AssociationStatusAggregatedCount": { | |
95 | "Pending": 1 | |
96 | } | |
97 | }, | |
98 | "AssociationId": "d8617c07-2079-4c18-9847-1234567890ab", | |
99 | "DocumentVersion": "$DEFAULT", | |
100 | "LastUpdateAssociationDate": 1487876122.564, | |
101 | "Date": 1487876122.564, | |
102 | "Targets": [ | |
103 | { | |
104 | "Values": [ | |
105 | "i-1234567890abcdef0" | |
106 | ], | |
107 | "Key": "InstanceIds" | |
108 | } | |
109 | ] | |
110 | } | |
111 | } | |
112 | ||
113 | For more information, see `Editing and creating a new version of an association <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-edit.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To get the instance states for a patch group** | |
0 | **Example 1: To get the instance states for a patch group** | |
1 | 1 | |
2 | 2 | The following ``describe-instance-patch-states-for-patch-group`` example retrieves details about the patch summary states per-instance for the specified patch group. :: |
3 | 3 | |
9 | 9 | { |
10 | 10 | "InstancePatchStates": [ |
11 | 11 | { |
12 | "InstanceId": "i-1234567890abcdef0", | |
12 | "InstanceId": "i-02573cafcfEXAMPLE", | |
13 | "BaselineId": "pb-0c10e65780EXAMPLE", | |
14 | "SnapshotId": "a3f5ff34-9bc4-4d2c-a665-4d1c1EXAMPLE", | |
13 | 15 | "PatchGroup": "Production", |
14 | "BaselineId": "pb-0713accee01234567", | |
15 | "SnapshotId": "521c3536-930c-4aa9-950e-01234567abcd", | |
16 | 16 | "OwnerInformation": "", |
17 | "InstalledCount": 1, | |
18 | "InstalledOtherCount": 13, | |
19 | "InstalledRejectedCount": 0, | |
20 | "MissingCount": 3, | |
21 | 17 | "FailedCount": 0, |
22 | "NotApplicableCount": 11, | |
23 | "OperationStartTime": 1550244665.723, | |
24 | "OperationEndTime": 1550244826.241, | |
25 | "Operation": "Scan" | |
18 | "InstalledCount": 17, | |
19 | "InstalledOtherCount": 378, | |
20 | "InstalledPendingRebootCount": 3, | |
21 | "InstalledRejectedCount": 1 | |
22 | "MissingCount": 14, | |
23 | "UnreportedNotApplicableCount": 0, | |
24 | "NotApplicableCount": 396, | |
25 | "Operation": "Scan", | |
26 | "OperationEndTime": 1520964020, | |
27 | "OperationStartTime": 1520964019, | |
28 | "RebootOption": "RebootIfNeeded" | |
26 | 29 | }, |
27 | 30 | { |
28 | "InstanceId": "i-0987654321abcdef0", | |
31 | "InstanceId": "i-0471e04240EXAMPLE", | |
32 | "BaselineId": "pb-09ca3fb51fEXAMPLE", | |
33 | "SnapshotId": "05d8ffb0-1bbe-4812-ba2d-d9b7bEXAMPLE", | |
29 | 34 | "PatchGroup": "Production", |
30 | "BaselineId": "pb-0713accee01234567", | |
31 | "SnapshotId": "521c3536-930c-4aa9-950e-01234567abcd", | |
32 | 35 | "OwnerInformation": "", |
33 | "InstalledCount": 1, | |
34 | "InstalledOtherCount": 7, | |
35 | "InstalledRejectedCount": 0, | |
36 | "MissingCount": 1, | |
37 | 36 | "FailedCount": 0, |
38 | "NotApplicableCount": 13, | |
39 | "OperationStartTime": 1550245130.069, | |
40 | "OperationEndTime": 1550245143.043, | |
41 | "Operation": "Scan" | |
37 | "InstalledCount": 22, | |
38 | "InstalledOtherCount": 452, | |
39 | "InstalledPendingRebootCount": 4, | |
40 | "InstalledRejectedCount": 1, | |
41 | "MissingCount": 16, | |
42 | "UnreportedNotApplicableCount": 0, | |
43 | "NotApplicableCount": 401, | |
44 | "Operation": "Scan", | |
45 | "OperationEndTime": 1520964020, | |
46 | "OperationStartTime": 1520964019, | |
47 | "RebootOption": "RebootIfNeeded" | |
42 | 48 | } |
43 | 49 | ] |
44 | 50 | } |
45 | 51 | |
46 | 52 | For more information, see `About Patch Compliance States <https://docs.aws.amazon.com/systems-manager/latest/userguide/about-patch-compliance-states.html>`__ in the *AWS Systems Manager User Guide*. |
53 | ||
54 | **Example 2: To get the instance states for a patch group with more than five missing patches** | |
55 | ||
56 | The following ``describe-instance-patch-states-for-patch-group`` example retrieves details about the patch summary states for the specified patch group for instances with more than five missing patches. :: | |
57 | ||
58 | aws ssm describe-instance-patch-states-for-patch-group \ | |
59 | --filters Key=MissingCount,Type=GreaterThan,Values=5 \ | |
60 | --patch-group "Production" | |
61 | ||
62 | Output:: | |
63 | ||
64 | { | |
65 | "InstancePatchStates": [ | |
66 | { | |
67 | "InstanceId": "i-02573cafcfEXAMPLE", | |
68 | "BaselineId": "pb-0c10e65780EXAMPLE", | |
69 | "SnapshotId": "a3f5ff34-9bc4-4d2c-a665-4d1c1EXAMPLE", | |
70 | "PatchGroup": "Production", | |
71 | "OwnerInformation": "", | |
72 | "FailedCount": 0, | |
73 | "InstalledCount": 17, | |
74 | "InstalledOtherCount": 378, | |
75 | "InstalledPendingRebootCount": 3, | |
76 | "InstalledRejectedCount": 1 | |
77 | "MissingCount": 14, | |
78 | "UnreportedNotApplicableCount": 0, | |
79 | "NotApplicableCount": 396, | |
80 | "Operation": "Scan", | |
81 | "OperationEndTime": 1520964020, | |
82 | "OperationStartTime": 1520964019, | |
83 | "RebootOption": "RebootIfNeeded" | |
84 | }, | |
85 | { | |
86 | "InstanceId": "i-0471e04240EXAMPLE", | |
87 | "BaselineId": "pb-09ca3fb51fEXAMPLE", | |
88 | "SnapshotId": "05d8ffb0-1bbe-4812-ba2d-d9b7bEXAMPLE", | |
89 | "PatchGroup": "Production", | |
90 | "OwnerInformation": "", | |
91 | "FailedCount": 0, | |
92 | "InstalledCount": 22, | |
93 | "InstalledOtherCount": 452, | |
94 | "InstalledPendingRebootCount": 4, | |
95 | "InstalledRejectedCount": 1, | |
96 | "MissingCount": 16, | |
97 | "UnreportedNotApplicableCount": 0, | |
98 | "NotApplicableCount": 401, | |
99 | "Operation": "Scan", | |
100 | "OperationEndTime": 1520964020, | |
101 | "OperationStartTime": 1520964019, | |
102 | "RebootOption": "RebootIfNeeded" | |
103 | } | |
104 | ] | |
105 | } | |
106 | ||
107 | For more information, see `About Patch Compliance States <https://docs.aws.amazon.com/systems-manager/latest/userguide/about-patch-compliance-states.html>`__ in the *AWS Systems Manager User Guide*. | |
108 | ||
109 | **Example 3: To get the instance states for a patch group with fewer than ten instances that require a reboot** | |
110 | ||
111 | The following ``describe-instance-patch-states-for-patch-group`` example retrieves details about the patch summary states for the specified patch group for instances with fewer than ten instances requiring a reboot. :: | |
112 | ||
113 | aws ssm describe-instance-patch-states-for-patch-group \ | |
114 | --filters Key=InstalledPendingRebootCount,Type=LessThan,Values=10 \ | |
115 | --patch-group "Production" | |
116 | ||
117 | Output:: | |
118 | ||
119 | { | |
120 | "InstancePatchStates": [ | |
121 | { | |
122 | "InstanceId": "i-02573cafcfEXAMPLE", | |
123 | "BaselineId": "pb-0c10e65780EXAMPLE", | |
124 | "SnapshotId": "a3f5ff34-9bc4-4d2c-a665-4d1c1EXAMPLE", | |
125 | "PatchGroup": "Production", | |
126 | "OwnerInformation": "", | |
127 | "FailedCount": 0, | |
128 | "InstalledCount": 17, | |
129 | "InstalledOtherCount": 378, | |
130 | "InstalledPendingRebootCount": 3, | |
131 | "InstalledRejectedCount": 1 | |
132 | "MissingCount": 14, | |
133 | "UnreportedNotApplicableCount": 0, | |
134 | "NotApplicableCount": 396, | |
135 | "Operation": "Scan", | |
136 | "OperationEndTime": 1520964020, | |
137 | "OperationStartTime": 1520964019, | |
138 | "RebootOption": "RebootIfNeeded" | |
139 | }, | |
140 | { | |
141 | "InstanceId": "i-0471e04240EXAMPLE", | |
142 | "BaselineId": "pb-09ca3fb51fEXAMPLE", | |
143 | "SnapshotId": "05d8ffb0-1bbe-4812-ba2d-d9b7bEXAMPLE", | |
144 | "PatchGroup": "Production", | |
145 | "OwnerInformation": "", | |
146 | "FailedCount": 0, | |
147 | "InstalledCount": 22, | |
148 | "InstalledOtherCount": 452, | |
149 | "InstalledPendingRebootCount": 4, | |
150 | "InstalledRejectedCount": 1, | |
151 | "MissingCount": 16, | |
152 | "UnreportedNotApplicableCount": 0, | |
153 | "NotApplicableCount": 401, | |
154 | "Operation": "Scan", | |
155 | "OperationEndTime": 1520964020, | |
156 | "OperationStartTime": 1520964019, | |
157 | "RebootOption": "RebootIfNeeded" | |
158 | } | |
159 | ] | |
160 | } | |
161 | ||
162 | For more information, see `About Patch Compliance States <https://docs.aws.amazon.com/systems-manager/latest/userguide/about-patch-compliance-states.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | 0 | **To get the patch summary states for instances** |
1 | 1 | |
2 | The following ``describe-instance-patch-states`` example retrieves details about the patch summary states for the specified instance. :: | |
2 | This ``describe-instance-patch-states`` example gets the patch summary states for an instance. :: | |
3 | 3 | |
4 | 4 | aws ssm describe-instance-patch-states \ |
5 | 5 | --instance-ids "i-1234567890abcdef0" |
10 | 10 | "InstancePatchStates": [ |
11 | 11 | { |
12 | 12 | "InstanceId": "i-1234567890abcdef0", |
13 | "PatchGroup": "", | |
14 | "BaselineId": "pb-0713accee01234567", | |
13 | "PatchGroup": "my-patch-group", | |
14 | "BaselineId": "pb-0713accee01234567", | |
15 | 15 | "SnapshotId": "521c3536-930c-4aa9-950e-01234567abcd", |
16 | "OwnerInformation": "", | |
17 | "InstalledCount": 2, | |
18 | "InstalledOtherCount": 12, | |
16 | "CriticalNonCompliantCount": 2, | |
17 | "SecurityNonCompliantCount": 2, | |
18 | "OtherNonCompliantCount": 1, | |
19 | "InstalledCount": 123, | |
20 | "InstalledOtherCount": 334, | |
21 | "InstalledPendingRebootCount": 0, | |
19 | 22 | "InstalledRejectedCount": 0, |
20 | 23 | "MissingCount": 1, |
21 | "FailedCount": 0, | |
22 | "NotApplicableCount": 675, | |
23 | "OperationStartTime": 1548438382.462, | |
24 | "OperationEndTime": 1548438392.176, | |
25 | "Operation": "Scan" | |
24 | "FailedCount": 2, | |
25 | "UnreportedNotApplicableCount": 11, | |
26 | "NotApplicableCount": 2063, | |
27 | "OperationStartTime": "2021-05-03T11:00:56-07:00", | |
28 | "OperationEndTime": "2021-05-03T11:01:09-07:00", | |
29 | "Operation": "Scan", | |
30 | "LastNoRebootInstallOperationTime": "2020-06-14T12:17:41-07:00", | |
31 | "RebootOption": "RebootIfNeeded" | |
26 | 32 | } |
27 | 33 | ] |
28 | 34 | } |
29 | 35 | |
30 | For more information, see `About Patch Compliance <https://docs.aws.amazon.com/systems-manager/latest/userguide/about-patch-compliance.html>`__ in the *AWS Systems Manager User Guide*. | |
36 | For more information, see `About Patch Compliance <https://docs.aws.amazon.com/systems-manager/latest/userguide/about-patch-compliance.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To list all versions of an association for a specific association ID** | |
1 | ||
2 | This example lists all versions of the specified associations. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ssm list-association-versions --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociationVersions": [ | |
12 | { | |
13 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
14 | "AssociationVersion": "1", | |
15 | "CreatedDate": 1550505536.726, | |
16 | "Name": "AWS-UpdateSSMAgent", | |
17 | "Parameters": { | |
18 | "allowDowngrade": [ | |
19 | "false" | |
20 | ], | |
21 | "version": [ | |
22 | "" | |
23 | ] | |
24 | }, | |
25 | "Targets": [ | |
26 | { | |
27 | "Key": "InstanceIds", | |
28 | "Values": [ | |
29 | "i-1234567890abcdef0" | |
30 | ] | |
31 | } | |
32 | ], | |
33 | "ScheduleExpression": "cron(0 00 12 ? * SUN *)", | |
34 | "AssociationName": "UpdateSSMAgent" | |
35 | } | |
36 | ] | |
37 | } | |
0 | **To list all versions of an association for a specific association ID** | |
1 | ||
2 | The following ``list-association-versions`` example lists all versions of the specified associations. :: | |
3 | ||
4 | aws ssm list-association-versions \ | |
5 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "AssociationVersions": [ | |
11 | { | |
12 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
13 | "AssociationVersion": "1", | |
14 | "CreatedDate": 1550505536.726, | |
15 | "Name": "AWS-UpdateSSMAgent", | |
16 | "Parameters": { | |
17 | "allowDowngrade": [ | |
18 | "false" | |
19 | ], | |
20 | "version": [ | |
21 | "" | |
22 | ] | |
23 | }, | |
24 | "Targets": [ | |
25 | { | |
26 | "Key": "InstanceIds", | |
27 | "Values": [ | |
28 | "i-1234567890abcdef0" | |
29 | ] | |
30 | } | |
31 | ], | |
32 | "ScheduleExpression": "cron(0 00 12 ? * SUN *)", | |
33 | "AssociationName": "UpdateSSMAgent" | |
34 | } | |
35 | ] | |
36 | } | |
37 | ||
38 | For more information, see `Working with associations in Systems Manager <https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-associations.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To list documents** | |
0 | **Example 1: To list documents** | |
1 | 1 | |
2 | 2 | The following ``list-documents`` example lists documents owned by the requesting account tagged with the custom tag. :: |
3 | 3 | |
27 | 27 | ] |
28 | 28 | } |
29 | 29 | ] |
30 | } | |
30 | } | |
31 | 31 | |
32 | 32 | For more information, see `AWS Systems Manager Documents <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html>`__ in the *AWS Systems Manager User Guide*. |
33 | ||
34 | **Example 2: To list shared documents** | |
35 | ||
36 | The following ``list-documents`` example lists shared documents, including private shared documents not owned by AWS. :: | |
37 | ||
38 | aws ssm list-documents \ | |
39 | --filters Key=Name,Values=sharedDocNamePrefix Key=Owner,Values=Private | |
40 | ||
41 | Output:: | |
42 | ||
43 | { | |
44 | "DocumentIdentifiers": [ | |
45 | { | |
46 | "Name": "Example", | |
47 | "Owner": "12345EXAMPLE", | |
48 | "PlatformTypes": [ | |
49 | "Windows", | |
50 | "Linux" | |
51 | ], | |
52 | "DocumentVersion": "1", | |
53 | "DocumentType": "Command", | |
54 | "SchemaVersion": "0.3", | |
55 | "DocumentFormat": "YAML", | |
56 | "Tags": [] | |
57 | } | |
58 | ] | |
59 | } | |
60 | ||
61 | For more information, see `AWS Systems Manager Documents <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ssm-docs.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To execute an association immediately and only one time** | |
1 | ||
2 | This example executes the specified association immediately and only once. There is no output if the command succeeds. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ssm start-associations-once --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
7 | ||
0 | **To run an association immediately and only one time** | |
1 | ||
2 | The following ``start-associations-once`` example run the specified association immediately and only once. There is no output if the command succeeds. :: | |
3 | ||
4 | aws ssm start-associations-once \ | |
5 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Viewing association histories <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-history.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To delete parameter labels** | |
1 | ||
2 | The following ``unlabel-parameter-version`` example deletes the specified labels from the given parameter version. :: | |
3 | ||
4 | aws ssm unlabel-parameter-version \ | |
5 | --name "parameterName" \ | |
6 | --parameter-version "version" \ | |
7 | --labels "label_1" "label_2" "label_3" | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "RemovedLabels": [ | |
13 | "label_1" | |
14 | "label_2" | |
15 | "label_3" | |
16 | ], | |
17 | "InvalidLabels": [] | |
18 | } | |
19 | ||
20 | For more information, see `Delete parameter labels (AWS CLI) <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-labels.html#systems-manager-parameter-store-labels-cli-delete>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To update the association status** | |
1 | ||
2 | This example updates the association status of the association between an instance and a document. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ssm update-association-status --name "AWS-UpdateSSMAgent" --instance-id "i-1234567890abcdef0" --association-status "Date=1424421071.939,Name=Pending,Message=temp_status_change,AdditionalInfo=Additional-Config-Needed" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociationDescription": { | |
12 | "Name": "AWS-UpdateSSMAgent", | |
13 | "InstanceId": "i-1234567890abcdef0", | |
14 | "AssociationVersion": "1", | |
15 | "Date": 1550507529.604, | |
16 | "LastUpdateAssociationDate": 1550507806.974, | |
17 | "Status": { | |
18 | "Date": 1424421071.0, | |
19 | "Name": "Pending", | |
20 | "Message": "temp_status_change", | |
21 | "AdditionalInfo": "Additional-Config-Needed" | |
22 | }, | |
23 | "Overview": { | |
24 | "Status": "Success", | |
25 | "AssociationStatusAggregatedCount": { | |
26 | "Success": 1 | |
27 | } | |
28 | }, | |
29 | "DocumentVersion": "$DEFAULT", | |
30 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
31 | "Targets": [ | |
32 | { | |
33 | "Key": "InstanceIds", | |
34 | "Values": [ | |
35 | "i-1234567890abcdef0" | |
36 | ] | |
37 | } | |
38 | ], | |
39 | "LastExecutionDate": 1550507808.0, | |
40 | "LastSuccessfulExecutionDate": 1550507808.0 | |
41 | } | |
42 | } | |
0 | **To update the association status** | |
1 | ||
2 | The following ``update-association-status`` example updates the association status of the association between an instance and a document. :: | |
3 | ||
4 | aws ssm update-association-status \ | |
5 | --name "AWS-UpdateSSMAgent" \ | |
6 | --instance-id "i-1234567890abcdef0" \ | |
7 | --association-status "Date=1424421071.939,Name=Pending,Message=temp_status_change,AdditionalInfo=Additional-Config-Needed" | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "AssociationDescription": { | |
13 | "Name": "AWS-UpdateSSMAgent", | |
14 | "InstanceId": "i-1234567890abcdef0", | |
15 | "AssociationVersion": "1", | |
16 | "Date": 1550507529.604, | |
17 | "LastUpdateAssociationDate": 1550507806.974, | |
18 | "Status": { | |
19 | "Date": 1424421071.0, | |
20 | "Name": "Pending", | |
21 | "Message": "temp_status_change", | |
22 | "AdditionalInfo": "Additional-Config-Needed" | |
23 | }, | |
24 | "Overview": { | |
25 | "Status": "Success", | |
26 | "AssociationStatusAggregatedCount": { | |
27 | "Success": 1 | |
28 | } | |
29 | }, | |
30 | "DocumentVersion": "$DEFAULT", | |
31 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
32 | "Targets": [ | |
33 | { | |
34 | "Key": "InstanceIds", | |
35 | "Values": [ | |
36 | "i-1234567890abcdef0" | |
37 | ] | |
38 | } | |
39 | ], | |
40 | "LastExecutionDate": 1550507808.0, | |
41 | "LastSuccessfulExecutionDate": 1550507808.0 | |
42 | } | |
43 | } | |
44 | ||
45 | For more information, see `Working with associations in Systems Manager <https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-associations.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To update a document association** | |
1 | ||
2 | This example updates an association with a new document version. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ssm update-association --association-id "8dfe3659-4309-493a-8755-0123456789ab" --document-version "\$LATEST" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociationDescription": { | |
12 | "Name": "AWS-UpdateSSMAgent", | |
13 | "AssociationVersion": "2", | |
14 | "Date": 1550508093.293, | |
15 | "LastUpdateAssociationDate": 1550508106.596, | |
16 | "Overview": { | |
17 | "Status": "Pending", | |
18 | "DetailedStatus": "Creating" | |
19 | }, | |
20 | "DocumentVersion": "$LATEST", | |
21 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
22 | "Targets": [ | |
23 | { | |
24 | "Key": "tag:Name", | |
25 | "Values": [ | |
26 | "Linux" | |
27 | ] | |
28 | } | |
29 | ], | |
30 | "LastExecutionDate": 1550508094.879, | |
31 | "LastSuccessfulExecutionDate": 1550508094.879 | |
32 | } | |
33 | } | |
34 | ||
35 | **To update the schedule expression of an association** | |
36 | ||
37 | This example updates the schedule expression for the specified association. | |
38 | ||
39 | Command:: | |
40 | ||
41 | aws ssm update-association --association-id "8dfe3659-4309-493a-8755-0123456789ab" --schedule-expression "cron(0 0 0/4 1/1 * ? *)" | |
42 | ||
0 | **Example 1: To update a document association** | |
1 | ||
2 | The following ``update-association`` example updates an association with a new document version. :: | |
3 | ||
4 | aws ssm update-association \ | |
5 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" \ | |
6 | --document-version "\$LATEST" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociationDescription": { | |
12 | "Name": "AWS-UpdateSSMAgent", | |
13 | "AssociationVersion": "2", | |
14 | "Date": 1550508093.293, | |
15 | "LastUpdateAssociationDate": 1550508106.596, | |
16 | "Overview": { | |
17 | "Status": "Pending", | |
18 | "DetailedStatus": "Creating" | |
19 | }, | |
20 | "DocumentVersion": "$LATEST", | |
21 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
22 | "Targets": [ | |
23 | { | |
24 | "Key": "tag:Name", | |
25 | "Values": [ | |
26 | "Linux" | |
27 | ] | |
28 | } | |
29 | ], | |
30 | "LastExecutionDate": 1550508094.879, | |
31 | "LastSuccessfulExecutionDate": 1550508094.879 | |
32 | } | |
33 | } | |
34 | ||
35 | For more information, see `Editing and creating a new version of an association <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-edit.html>`__ in the *AWS Systems Manager User Guide*. | |
36 | ||
37 | **Example 2: To update the schedule expression of an association** | |
38 | ||
39 | The following ``update-association`` example updates the schedule expression for the specified association. :: | |
40 | ||
41 | aws ssm update-association \ | |
42 | --association-id "8dfe3659-4309-493a-8755-0123456789ab" \ | |
43 | --schedule-expression "cron(0 0 0/4 1/1 * ? *)" | |
44 | ||
45 | Output:: | |
46 | ||
47 | { | |
48 | "AssociationDescription": { | |
49 | "Name": "AWS-HelloWorld", | |
50 | "AssociationVersion": "2", | |
51 | "Date": "2021-02-08T13:54:19.203000-08:00", | |
52 | "LastUpdateAssociationDate": "2021-06-29T11:51:07.933000-07:00", | |
53 | "Overview": { | |
54 | "Status": "Pending", | |
55 | "DetailedStatus": "Creating" | |
56 | }, | |
57 | "DocumentVersion": "$DEFAULT", | |
58 | "AssociationId": "8dfe3659-4309-493a-8755-0123456789ab", | |
59 | "Targets": [ | |
60 | { | |
61 | "Key": "aws:NoOpAutomationTag", | |
62 | "Values": [ | |
63 | "AWS-NoOpAutomationTarget-Value" | |
64 | ] | |
65 | } | |
66 | ], | |
67 | "ScheduleExpression": "cron(0 0 0/4 1/1 * ? *)", | |
68 | "LastExecutionDate": "2021-06-26T19:00:48.110000-07:00", | |
69 | "ApplyOnlyAtCronInterval": false | |
70 | } | |
71 | } | |
72 | ||
73 | For more information, see `Editing and creating a new version of an association <https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-state-assoc-edit.html>`__ in the *AWS Systems Manager User Guide*.⏎ |
0 | **To accept a page during and engagement** | |
1 | ||
2 | The following ``accept-page`` using an accept code sent to the contact channel to accept a page. :: | |
3 | ||
4 | aws ssm-contacts accept-page \ | |
5 | --page-id "arn:aws:ssm-contacts:us-east-2:682428703967:page/akuam/94ea0c7b-56d9-46c3-b84a-a37c8b067ad3" \ | |
6 | --accept-type READ \ | |
7 | --accept-code 425440 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "All of the output": "goes here", | |
13 | "More Output": [ | |
14 | { "arrayitem1": 1 }, | |
15 | { "arrayitem2": 2 } | |
16 | ] | |
17 | "Each indent": "Must be 4 spaces" | |
18 | } | |
19 | ||
20 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **Activate a contact's contact channel** | |
1 | ||
2 | The following ``activate-contact-channel`` example activates a contact channel and makes it usable as part of an incident. :: | |
3 | ||
4 | aws ssm-contacts activate-contact-channel \ | |
5 | --contact-channel-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/fc7405c4-46b2-48b7-87b2-93e2f225b90d" \ | |
6 | --activation-code "466136" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To delete a contact** | |
1 | ||
2 | The following ``command-name`` example deletes a contact. The contact will no longer be reachable from any escalation plan that refers to them. :: | |
3 | ||
4 | aws ssm-contacts delete-contact \ | |
5 | --contact-id "arn:aws:ssm-contacts:us-east-1:682428703967:contact/alejr" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To create a contact channel** | |
1 | ||
2 | Creates a contact channel of type SMS for the contact Akua Mansa. Contact channels can be created of type SMS, EMAIL, or VOICE. :: | |
3 | ||
4 | aws ssm-contacts create-contact-channel \ | |
5 | --contact-id "arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam" \ | |
6 | --name "akuas sms-test" \ | |
7 | --type SMS \ | |
8 | --delivery-address '{"SimpleAddress": "+15005550199"}' | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "ContactChannelArn": "arn:aws:ssm-contacts:us-east-1:111122223333:contact-channel/akuam/02f506b9-ea5d-4764-af89-2daa793ff024" | |
14 | } | |
15 | ||
16 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To create a contact** | |
1 | ||
2 | The following ``create-contact`` example creates a contact in your environment with a blank plan. The plan can be updated after creating contact channels. Use the create-contact-channel command with the output ARN of this command. After you have created contact channels for this contact use update-contact to update the plan. :: | |
3 | ||
4 | aws ssm-contacts create-contact \ | |
5 | --alias "akuam" \ | |
6 | --display-name "Akua Mansa" \ | |
7 | --type PERSONAL \ | |
8 | --plan '{"Stages": []}' | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam" | |
14 | } | |
15 | ||
16 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list details of a contact channel** | |
1 | ||
2 | The following ``command-name`` example lists the available widgets in your AWS account. Deactivating a contact channel means the contact channel will no longer be paged during an incident. You can also reactivate a contact channel at any time using th ``activate-contact-channel`` command. :: | |
3 | ||
4 | aws ssm-contacts deactivate-contact-channel \ | |
5 | --contact-channel-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/fc7405c4-46b2-48b7-87b2-93e2f225b90d" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To delete a contact channel** | |
1 | ||
2 | The following ``delete-contact-channel`` example deletes a contact channel. Deleting a contact channel ensures the contact channel will not be paged during an incident. :: | |
3 | ||
4 | aws ssm-contacts delete-contact-channel \ | |
5 | --contact-channel-id "arn:aws:ssm-contacts:us-east-1:111122223333:contact-channel/akuam/13149bad-52ee-45ea-ae1e-45857f78f9b2" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To delete a contact** | |
1 | ||
2 | The following ``command-name`` example deletes a contact. The contact will no longer be reachable from any escalation plan that refers to them. :: | |
3 | ||
4 | aws ssm-contacts delete-contact \ | |
5 | --contact-id "arn:aws:ssm-contacts:us-east-1:111122223333:contact/alejr" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To describe the details of an engagement** | |
1 | ||
2 | The following ``describe-engagement`` example lists the details of an engagement to a contact or escalation plan. The subject and content are sent to the contact channels. :: | |
3 | ||
4 | aws ssm-contacts describe-engagement \ | |
5 | --engagement-id "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/example_escalation/69e40ce1-8dbb-4d57-8962-5fbe7fc53356" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/example_escalation", | |
11 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/example_escalation/69e40ce1-8dbb-4d57-8962-5fbe7fc53356", | |
12 | "Sender": "cli", | |
13 | "Subject": "cli-test", | |
14 | "Content": "Testing engagements via CLI", | |
15 | "PublicSubject": "cli-test", | |
16 | "PublicContent": "Testing engagements va CLI", | |
17 | "StartTime": "2021-05-18T18:25:41.151000+00:00" | |
18 | } | |
19 | ||
20 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list the details of a page to a contact channel** | |
1 | ||
2 | The following ``describe-page`` example lists details of a page to a contact channel. The page will include the subject and content provided. :: | |
3 | ||
4 | aws ssm-contacts describe-page \ | |
5 | --page-id "arn:aws:ssm-contacts:us-east-2:111122223333:page/akuam/ad0052bd-e606-498a-861b-25726292eb93" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "PageArn": "arn:aws:ssm-contacts:us-east-2:111122223333:page/akuam/ad0052bd-e606-498a-861b-25726292eb93", | |
11 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/akuam/78a29753-3674-4ac5-9f83-0468563567f0", | |
12 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
13 | "Sender": "cli", | |
14 | "Subject": "cli-test", | |
15 | "Content": "Testing engagements via CLI", | |
16 | "PublicSubject": "cli-test", | |
17 | "PublicContent": "Testing engagements va CLI", | |
18 | "SentTime": "2021-05-18T18:43:29.301000+00:00", | |
19 | "ReadTime": "2021-05-18T18:43:55.708000+00:00", | |
20 | "DeliveryTime": "2021-05-18T18:43:55.265000+00:00" | |
21 | } | |
22 | ||
23 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list the details of a contact channel** | |
1 | ||
2 | The following ``get-contact-channel`` example lists the details of a contact channel. :: | |
3 | ||
4 | aws ssm-contacts get-contact-channel \ | |
5 | --contact-channel-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/fc7405c4-46b2-48b7-87b2-93e2f225b90d" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
11 | "ContactChannelArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/fc7405c4-46b2-48b7-87b2-93e2f225b90d", | |
12 | "Name": "akuas sms", | |
13 | "Type": "SMS", | |
14 | "DeliveryAddress": { | |
15 | "SimpleAddress": "+15005550199" | |
16 | }, | |
17 | "ActivationStatus": "ACTIVATED" | |
18 | } | |
19 | ||
20 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list the resource policies of a contact** | |
1 | ||
2 | The following ``get-contact-policy`` example lists the resource policies associated with the specified contact. :: | |
3 | ||
4 | aws ssm-contacts get-contact-policy \ | |
5 | --contact-arn "arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ContactArn": "arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam", | |
11 | "Policy": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"SharePolicyForDocumentationDralia\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"222233334444\"},\"Action\":[\"ssm-contacts:GetContact\",\"ssm-contacts:StartEngagement\",\"ssm-contacts:DescribeEngagement\",\"ssm-contacts:ListPagesByEngagement\",\"ssm-contacts:StopEngagement\"],\"Resource\":[\"arn:aws:ssm-contacts:*:111122223333:contact/akuam\",\"arn:aws:ssm-contacts:*:111122223333:engagement/akuam/*\"]}]}" | |
12 | } | |
13 | ||
14 | For more information, see `Working with shared contacts and response plans <https://docs.aws.amazon.com/incident-manager/latest/userguide/sharing.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **Example 1: To describe a contact plan** | |
1 | ||
2 | The following ``get-contact`` example describes a contact. :: | |
3 | ||
4 | aws ssm-contacts get-contact \ | |
5 | --contact-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
11 | "Alias": "akuam", | |
12 | "DisplayName": "Akua Mansa", | |
13 | "Type": "PERSONAL", | |
14 | "Plan": { | |
15 | "Stages": [ | |
16 | { | |
17 | "DurationInMinutes": 5, | |
18 | "Targets": [ | |
19 | { | |
20 | "ChannelTargetInfo": { | |
21 | "ContactChannelId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/beb25840-5ac8-4644-95cc-7a8de390fa65", | |
22 | "RetryIntervalInMinutes": 1 | |
23 | } | |
24 | } | |
25 | ] | |
26 | }, | |
27 | { | |
28 | "DurationInMinutes": 5, | |
29 | "Targets": [ | |
30 | { | |
31 | "ChannelTargetInfo": { | |
32 | "ContactChannelId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/49f3c24d-5f9f-4638-ae25-3f49e04229ad", | |
33 | "RetryIntervalInMinutes": 1 | |
34 | } | |
35 | } | |
36 | ] | |
37 | }, | |
38 | { | |
39 | "DurationInMinutes": 5, | |
40 | "Targets": [ | |
41 | { | |
42 | "ChannelTargetInfo": { | |
43 | "ContactChannelId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/77d4f447-f619-4954-afff-85551e369c2a", | |
44 | "RetryIntervalInMinutes": 1 | |
45 | } | |
46 | } | |
47 | ] | |
48 | } | |
49 | ] | |
50 | } | |
51 | } | |
52 | ||
53 | **Example 2: To describe an escalation plan** | |
54 | ||
55 | The following ``get-contact`` example describes an escalation plan. :: | |
56 | ||
57 | aws ssm-contacts get-contact \ | |
58 | --contact-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact/example_escalation" | |
59 | ||
60 | Output:: | |
61 | ||
62 | { | |
63 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/example_escalation", | |
64 | "Alias": "example_escalation", | |
65 | "DisplayName": "Example Escalation", | |
66 | "Type": "ESCALATION", | |
67 | "Plan": { | |
68 | "Stages": [ | |
69 | { | |
70 | "DurationInMinutes": 5, | |
71 | "Targets": [ | |
72 | { | |
73 | "ContactTargetInfo": { | |
74 | "ContactId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
75 | "IsEssential": true | |
76 | } | |
77 | } | |
78 | ] | |
79 | }, | |
80 | { | |
81 | "DurationInMinutes": 5, | |
82 | "Targets": [ | |
83 | { | |
84 | "ContactTargetInfo": { | |
85 | "ContactId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/alejr", | |
86 | "IsEssential": false | |
87 | } | |
88 | } | |
89 | ] | |
90 | }, | |
91 | { | |
92 | "DurationInMinutes": 0, | |
93 | "Targets": [ | |
94 | { | |
95 | "ContactTargetInfo": { | |
96 | "ContactId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/anasi", | |
97 | "IsEssential": false | |
98 | } | |
99 | } | |
100 | ] | |
101 | } | |
102 | ] | |
103 | } | |
104 | } | |
105 | ||
106 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list the contact channels of a contact** | |
1 | ||
2 | The following ``list-contact-channels`` example lists the available contact channels of the specified contact. :: | |
3 | ||
4 | aws ssm-contacts list-contact-channels \ | |
5 | --contact-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | [ | |
11 | { | |
12 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
13 | "Name": "akuas email", | |
14 | "Type": "EMAIL", | |
15 | "DeliveryAddress": { | |
16 | "SimpleAddress": "akuam@example.com" | |
17 | }, | |
18 | "ActivationStatus": "NOT_ACTIVATED" | |
19 | }, | |
20 | { | |
21 | "ContactChannelArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/fc7405c4-46b2-48b7-87b2-93e2f225b90d", | |
22 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
23 | "Name": "akuas sms", | |
24 | "Type": "SMS", | |
25 | "DeliveryAddress": { | |
26 | "SimpleAddress": "+15005550100" | |
27 | }, | |
28 | "ActivationStatus": "ACTIVATED" | |
29 | } | |
30 | ] | |
31 | } | |
32 | ||
33 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list all escalation plans and contacts** | |
1 | ||
2 | The following ``list-contacts`` example lists the contacts and escalation plans in your account. :: | |
3 | ||
4 | aws ssm-contacts list-contacts | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Contacts": [ | |
10 | { | |
11 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
12 | "Alias": "akuam", | |
13 | "DisplayName": "Akua Mansa", | |
14 | "Type": "PERSONAL" | |
15 | }, | |
16 | { | |
17 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/alejr", | |
18 | "Alias": "alejr", | |
19 | "DisplayName": "Alejandro Rosalez", | |
20 | "Type": "PERSONAL" | |
21 | }, | |
22 | { | |
23 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/anasi", | |
24 | "Alias": "anasi", | |
25 | "DisplayName": "Ana Carolina Silva", | |
26 | "Type": "PERSONAL" | |
27 | }, | |
28 | { | |
29 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/example_escalation", | |
30 | "Alias": "example_escalation", | |
31 | "DisplayName": "Example Escalation", | |
32 | "Type": "ESCALATION" | |
33 | } | |
34 | ] | |
35 | } | |
36 | ||
37 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list all engagements** | |
1 | ||
2 | The following ``list-engagements`` example lists engagements to escalation plans and contacts. You can also list engagements for a single incident. :: | |
3 | ||
4 | aws ssm-contacts list-engagements | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Engagements": [ | |
10 | { | |
11 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/akuam/91792571-0b53-4821-9f73-d25d13d9e529", | |
12 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
13 | "Sender": "cli", | |
14 | "StartTime": "2021-05-18T20:37:50.300000+00:00" | |
15 | }, | |
16 | { | |
17 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/akuam/78a29753-3674-4ac5-9f83-0468563567f0", | |
18 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
19 | "Sender": "cli", | |
20 | "StartTime": "2021-05-18T18:40:26.666000+00:00" | |
21 | }, | |
22 | { | |
23 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/example_escalation/69e40ce1-8dbb-4d57-8962-5fbe7fc53356", | |
24 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/example_escalation", | |
25 | "Sender": "cli", | |
26 | "StartTime": "2021-05-18T18:25:41.151000+00:00" | |
27 | }, | |
28 | { | |
29 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/akuam/607ced0e-e8fa-4ea7-8958-a237b8803f8f", | |
30 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
31 | "Sender": "cli", | |
32 | "StartTime": "2021-05-18T18:20:58.093000+00:00" | |
33 | } | |
34 | ] | |
35 | } | |
36 | ||
37 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list page receipts** | |
1 | ||
2 | The following ``command-name`` example lists whether a page was received or not by a contact. :: | |
3 | ||
4 | aws ssm-contacts list-page-receipts \ | |
5 | --page-id "arn:aws:ssm-contacts:us-east-2:111122223333:page/akuam/94ea0c7b-56d9-46c3-b84a-a37c8b067ad3" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Receipts": [ | |
11 | { | |
12 | "ContactChannelArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/fc7405c4-46b2-48b7-87b2-93e2f225b90d", | |
13 | "ReceiptType": "DELIVERED", | |
14 | "ReceiptInfo": "425440", | |
15 | "ReceiptTime": "2021-05-18T20:42:57.485000+00:00" | |
16 | }, | |
17 | { | |
18 | "ContactChannelArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/fc7405c4-46b2-48b7-87b2-93e2f225b90d", | |
19 | "ReceiptType": "READ", | |
20 | "ReceiptInfo": "425440", | |
21 | "ReceiptTime": "2021-05-18T20:42:57.907000+00:00" | |
22 | }, | |
23 | { | |
24 | "ContactChannelArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/fc7405c4-46b2-48b7-87b2-93e2f225b90d", | |
25 | "ReceiptType": "SENT", | |
26 | "ReceiptInfo": "SM6656c19132f1465f9c9c1123a5dde7c9", | |
27 | "ReceiptTime": "2021-05-18T20:40:52.962000+00:00" | |
28 | } | |
29 | ] | |
30 | } | |
31 | ||
32 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list pages by contact** | |
1 | ||
2 | The following ``list-pages-by-contact`` example lists all pages to the specified contact. :: | |
3 | ||
4 | aws ssm-contacts list-pages-by-contact \ | |
5 | --contact-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Pages": [ | |
11 | { | |
12 | "PageArn": "arn:aws:ssm-contacts:us-east-2:111122223333:page/akuam/ad0052bd-e606-498a-861b-25726292eb93", | |
13 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/akuam/78a29753-3674-4ac5-9f83-0468563567f0", | |
14 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
15 | "Sender": "cli", | |
16 | "SentTime": "2021-05-18T18:43:29.301000+00:00", | |
17 | "DeliveryTime": "2021-05-18T18:43:55.265000+00:00", | |
18 | "ReadTime": "2021-05-18T18:43:55.708000+00:00" | |
19 | } | |
20 | ] | |
21 | } | |
22 | ||
23 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list pages to contact channels started from an engagement.** | |
1 | ||
2 | The following ``list-pages-by-engagement`` example lists the pages that occurred while engaging the defined engagement plan. :: | |
3 | ||
4 | aws ssm-contacts list-pages-by-engagement \ | |
5 | --engagement-id "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/akuam/78a29753-3674-4ac5-9f83-0468563567f0" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Pages": [ | |
11 | { | |
12 | "PageArn": "arn:aws:ssm-contacts:us-east-2:111122223333:page/akuam/ad0052bd-e606-498a-861b-25726292eb93", | |
13 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/akuam/78a29753-3674-4ac5-9f83-0468563567f0", | |
14 | "ContactArn": "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam", | |
15 | "Sender": "cli", | |
16 | "SentTime": "2021-05-18T18:40:27.245000+00:00" | |
17 | } | |
18 | ] | |
19 | } | |
20 | ||
21 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list tags for a contact** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists the tags of the specified contact. :: | |
3 | ||
4 | aws ssm-contacts list-tags-for-resource \ | |
5 | --resource-arn "arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Tags": [ | |
11 | { | |
12 | "Key": "group1", | |
13 | "Value": "1" | |
14 | } | |
15 | ] | |
16 | } | |
17 | ||
18 | For more information, see `Tagging <https://docs.aws.amazon.com/incident-manager/latest/userguide/tagging.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To share a contact and engagements** | |
1 | ||
2 | The following ``command-name`` example adds a resource policy to the contact Akua that shares the contact and related engagements with the principal. :: | |
3 | ||
4 | aws ssm-contacts put-contact-policy \ | |
5 | --contact-arn "arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam" \ | |
6 | --policy "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"ExampleResourcePolicy\",\"Action\":[\"ssm-contacts:GetContact\",\"ssm-contacts:StartEngagement\",\"ssm-contacts:DescribeEngagement\",\"ssm-contacts:ListPagesByEngagement\",\"ssm-contacts:StopEngagement\"],\"Principal\":{\"AWS\":\"222233334444\"},\"Effect\":\"Allow\",\"Resource\":[\"arn:aws:ssm-contacts:*:111122223333:contact\/akuam\",\"arn:aws:ssm-contacts:*:111122223333:engagement\/akuam\/*\"]}]}" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Working with shared contacts and response plans <https://docs.aws.amazon.com/incident-manager/latest/userguide/sharing.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To send an activation code** | |
1 | ||
2 | The following ``send-activation-code`` example sends an activation code and message to the specified contact channel. :: | |
3 | ||
4 | aws ssm-contacts send-activation-code \ | |
5 | --contact-channel-id "arn:aws:ssm-contacts:us-east-1:111122223333:contact-channel/akuam/8ddae2d1-12c8-4e45-b852-c8587266c400" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **Example 1: To page a contact's contact channels** | |
1 | ||
2 | The following ``start-engagement`` pages contact's contact channels. Sender, subject, public-subject, and public-content are all free from fields. Incident Manager sends the subject and content to the provided VOICE or EMAIL contact channels. Incident Manager sends the public-subject and public-content to the provided SMS contact channels. Sender is used to track who started the engagement. :: | |
3 | ||
4 | aws ssm-contacts start-engagement \ | |
5 | --contact-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam" \ | |
6 | --sender "cli" \ | |
7 | --subject "cli-test" \ | |
8 | --content "Testing engagements via CLI" \ | |
9 | --public-subject "cli-test" \ | |
10 | --public-content "Testing engagements va CLI" | |
11 | ||
12 | Output:: | |
13 | ||
14 | { | |
15 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/akuam/607ced0e-e8fa-4ea7-8958-a237b8803f8f" | |
16 | } | |
17 | ||
18 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*. | |
19 | ||
20 | **Example 2: To page a contact in the provided escalation plan.** | |
21 | ||
22 | The following ``start-engagement`` engages contact's through an escalation plan. Each contact is paged according to their engagement plan. :: | |
23 | ||
24 | aws ssm-contacts start-engagement \ | |
25 | --contact-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact/example_escalation" \ | |
26 | --sender "cli" \ | |
27 | --subject "cli-test" \ | |
28 | --content "Testing engagements via CLI" \ | |
29 | --public-subject "cli-test" \ | |
30 | --public-content "Testing engagements va CLI" | |
31 | ||
32 | Output:: | |
33 | ||
34 | { | |
35 | "EngagementArn": "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/example_escalation/69e40ce1-8dbb-4d57-8962-5fbe7fc53356" | |
36 | } | |
37 | ||
38 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To stop an engagement** | |
1 | ||
2 | The following ``stop-engagement`` example stops an engagement from paging further contacts and contact channels. :: | |
3 | ||
4 | aws ssm-contacts stop-engagement \ | |
5 | --engagement-id "arn:aws:ssm-contacts:us-east-2:111122223333:engagement/example_escalation/69e40ce1-8dbb-4d57-8962-5fbe7fc53356" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To tag a contact** | |
1 | ||
2 | The following ``tag-resource`` example tags a specified contact with the provided tag key value pair. :: | |
3 | ||
4 | aws ssm-contacts tag-resource \ | |
5 | --resource-arn "arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam" \ | |
6 | --tags '[{"Key":"group1","Value":"1"}]' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging <https://docs.aws.amazon.com/incident-manager/latest/userguide/tagging.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To remove tags from a contact** | |
1 | ||
2 | The following ``untag-resource`` example removes the group1 tag from the specified contact. :: | |
3 | ||
4 | aws ssm-contacts untag-resource \ | |
5 | --resource-arn "arn:aws:ssm-contacts:us-east-1:111122223333:contact/akuam" \ | |
6 | --tag-keys "group1" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging <https://docs.aws.amazon.com/incident-manager/latest/userguide/tagging.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To update a contact channel** | |
1 | ||
2 | The following ``update-contact-channel`` example updates the name and delivery address of a contact channel. :: | |
3 | ||
4 | aws ssm-contacts update-contact-channel \ | |
5 | --contact-channel-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/49f3c24d-5f9f-4638-ae25-3f49e04229ad" \ | |
6 | --name "akuas voice channel" \ | |
7 | --delivery-address '{"SimpleAddress": "+15005550198"}' | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To update the engagement plan of contact** | |
1 | ||
2 | The following ``update-contact`` example updates the engagement plan of the contact Akua to include the three types of contacts channels. This is done after creating contact channels for Akua. :: | |
3 | ||
4 | aws ssm-contacts update-contact \ | |
5 | --contact-id "arn:aws:ssm-contacts:us-east-2:111122223333:contact/akuam" \ | |
6 | --plan '{"Stages": [{"DurationInMinutes": 5, "Targets": [{"ChannelTargetInfo": {"ContactChannelId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/beb25840-5ac8-4644-95cc-7a8de390fa65","RetryIntervalInMinutes": 1 }}]}, {"DurationInMinutes": 5, "Targets": [{"ChannelTargetInfo":{"ContactChannelId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/49f3c24d-5f9f-4638-ae25-3f49e04229ad", "RetryIntervalInMinutes": 1}}]}, {"DurationInMinutes": 5, "Targets": [{"ChannelTargetInfo": {"ContactChannelId": "arn:aws:ssm-contacts:us-east-2:111122223333:contact-channel/akuam/77d4f447-f619-4954-afff-85551e369c2a","RetryIntervalInMinutes": 1 }}]}]}' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Contacts <https://docs.aws.amazon.com/incident-manager/latest/userguide/contacts.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To create the replication set** | |
1 | ||
2 | The following ``create-replication-set`` example creates the replication set Incident Manager uses to replicate and encrypt data in your Amazon Web Services account. This example uses the us-east-1 and us-east-2 Regions while creating the replication set. :: | |
3 | ||
4 | aws ssm-incidents create-replication-set \ | |
5 | --regions '{"us-east-1": {"sseKmsKeyId": "arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"}, "us-east-2": {"sseKmsKeyId": "arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"}}' | |
6 | ||
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "replicationSetArns": [ | |
12 | "arn:aws:ssm-incidents::111122223333:replication-set/c4bcb603-4bf9-bb3f-413c-08df53673b57" | |
13 | ] | |
14 | } | |
15 | ||
16 | For more information, see `Using the Incident Manager replication set <https://docs.aws.amazon.com/incident-manager/latest/userguide/replication.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To create a response plan** | |
1 | ||
2 | The following ``create-response-plan`` example creates a response plan with the specified details. :: | |
3 | ||
4 | aws ssm-incidents create-response-plan \ | |
5 | --chat-channel '{"chatbotSns": ["arn:aws:sns:us-east-1:111122223333:Standard_User"]}' \ | |
6 | --display-name "Example response plan" \ | |
7 | --incident-template '{"impact": 5, "title": "example-incident"}' \ | |
8 | --name "example-response" \ | |
9 | --actions '[{"ssmAutomation": {"documentName": "AWSIncidents-CriticalIncidentRunbookTemplate", "documentVersion": "$DEFAULT", "roleArn": "arn:aws:iam::111122223333:role/aws-service-role/ssm-incidents.amazonaws.com/AWSServiceRoleForIncidentManager", "targetAccount": "RESPONSE_PLAN_OWNER_ACCOUNT"}}]' \ | |
10 | --engagements '["arn:aws:ssm-contacts:us-east-1:111122223333:contact/example"]' | |
11 | ||
12 | Output:: | |
13 | ||
14 | { | |
15 | "arn": "arn:aws:ssm-incidents::111122223333:response-plan/example-response" | |
16 | } | |
17 | ||
18 | For more information, see `Incident preparation <https://docs.aws.amazon.com/incident-manager/latest/userguide/incident-response.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To create a timeline event** | |
1 | ||
2 | The following ``create-timeline-event`` example creates a custom timeline event at the specified time on the specified incident. :: | |
3 | ||
4 | aws ssm-incidents create-timeline-event \ | |
5 | --event-data "\"example timeline event"\" \ | |
6 | --event-time 2020-10-01T20:30:00.000 \ | |
7 | --event-type "Custom Event" \ | |
8 | --incident-record-arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "eventId": "c0bcc885-a41d-eb01-b4ab-9d2de193643c", | |
14 | "incidentRecordArn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
15 | } | |
16 | ||
17 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To delete an incident record** | |
1 | ||
2 | The following ``delete-incident-record`` example deletes the specified incident record. :: | |
3 | ||
4 | aws ssm-incidents delete-incident-record \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Incident tracking <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To delete the replication set** | |
1 | ||
2 | The following ``delete-replication-set`` example deletes the replication set from your Amazon Web Services account. Deleting the replication set also deletes all Incident Manager data. This can't be undone. :: | |
3 | ||
4 | aws ssm-incidents delete-replication-set \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:replication-set/c4bcb603-4bf9-bb3f-413c-08df53673b57" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Using the Incident Manager replication set <https://docs.aws.amazon.com/incident-manager/latest/userguide/replication.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To delete a resource policy** | |
1 | ||
2 | The following ``delete-resource-policy`` example deletes a resource policy from a response plan. This will revoke access from the principal or organization that the response plan was shared with. :: | |
3 | ||
4 | aws ssm-incidents delete-resource-policy \ | |
5 | --policy-id "be8b57191f0371f1c6827341aa3f0a03" \ | |
6 | --resource-arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Working with shared contacts and response plans <https://docs.aws.amazon.com/incident-manager/latest/userguide/sharing.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To delete a response plan** | |
1 | ||
2 | The following ``delete-response-plan`` example deletes the specified response plan. :: | |
3 | ||
4 | aws ssm-incidents delete-response-plan \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:response-plan/example-response" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Incident preparation <https://docs.aws.amazon.com/incident-manager/latest/userguide/incident-response.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To delete a timeline event** | |
1 | ||
2 | The following ``command-name`` example deletes a custom timeline event from the specified incident record. :: | |
3 | ||
4 | aws ssm-incidents delete-timeline-event \ | |
5 | --event-id "c0bcc885-a41d-eb01-b4ab-9d2de193643c" \ | |
6 | --incident-record-arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To get an incident record** | |
1 | ||
2 | The following ``command-name`` example gets details about the specified incident record. :: | |
3 | ||
4 | aws ssm-incidents get-incident-record \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "incidentRecord": { | |
11 | "arn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308", | |
12 | "automationExecutions": [], | |
13 | "creationTime": "2021-05-21T18:16:57.579000+00:00", | |
14 | "dedupeString": "c4bcc812-85e7-938d-2b78-17181176ee1a", | |
15 | "impact": 5, | |
16 | "incidentRecordSource": { | |
17 | "createdBy": "arn:aws:iam::111122223333:user/draliatp", | |
18 | "invokedBy": "arn:aws:iam::111122223333:user/draliatp", | |
19 | "source": "aws.ssm-incidents.custom" | |
20 | }, | |
21 | "lastModifiedBy": "arn:aws:iam::111122223333:user/draliatp", | |
22 | "lastModifiedTime": "2021-05-21T18:16:59.149000+00:00", | |
23 | "notificationTargets": [], | |
24 | "status": "OPEN", | |
25 | "title": "Example-Incident" | |
26 | } | |
27 | } | |
28 | ||
29 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To get the replication set** | |
1 | ||
2 | The following ``get-replication-set`` example gets the details of the replication set Incident Manager uses to replicate and encrypt data in your Amazon Web Services account. :: | |
3 | ||
4 | aws ssm-incidents get-replication-set \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:replication-set/c4bcb603-4bf9-bb3f-413c-08df53673b57" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "replicationSet": { | |
11 | "createdBy": "arn:aws:sts::111122223333:assumed-role/Admin/username", | |
12 | "createdTime": "2021-05-14T17:57:22.010000+00:00", | |
13 | "deletionProtected": false, | |
14 | "lastModifiedBy": "arn:aws:sts::111122223333:assumed-role/Admin/username", | |
15 | "lastModifiedTime": "2021-05-14T17:57:22.010000+00:00", | |
16 | "regionMap": { | |
17 | "us-east-1": { | |
18 | "sseKmsKeyId": "DefaultKey", | |
19 | "status": "ACTIVE" | |
20 | }, | |
21 | "us-east-2": { | |
22 | "sseKmsKeyId": "DefaultKey", | |
23 | "status": "ACTIVE", | |
24 | "statusMessage": "Tagging inaccessible" | |
25 | } | |
26 | }, | |
27 | "status": "ACTIVE" | |
28 | } | |
29 | } | |
30 | ||
31 | For more information, see `Using the Incident Manager replication set <https://docs.aws.amazon.com/incident-manager/latest/userguide/replication.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list resource policies for a response plan** | |
1 | ||
2 | The following ``command-name`` example lists the resource policies associated with the specified response plan. :: | |
3 | ||
4 | aws ssm-incidents get-resource-policies \ | |
5 | --resource-arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourcePolicies": [ | |
11 | { | |
12 | "policyDocument": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"d901b37a-dbb0-458a-8842-75575c464219-external-principals\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::222233334444:root\"},\"Action\":[\"ssm-incidents:GetResponsePlan\",\"ssm-incidents:StartIncident\",\"ssm-incidents:UpdateIncidentRecord\",\"ssm-incidents:GetIncidentRecord\",\"ssm-incidents:CreateTimelineEvent\",\"ssm-incidents:UpdateTimelineEvent\",\"ssm-incidents:GetTimelineEvent\",\"ssm-incidents:ListTimelineEvents\",\"ssm-incidents:UpdateRelatedItems\",\"ssm-incidents:ListRelatedItems\"],\"Resource\":[\"arn:aws:ssm-incidents:*:111122223333:response-plan/Example-Response-Plan\",\"arn:aws:ssm-incidents:*:111122223333:incident-record/Example-Response-Plan/*\"]}]}", | |
13 | "policyId": "be8b57191f0371f1c6827341aa3f0a03", | |
14 | "ramResourceShareRegion": "us-east-1" | |
15 | } | |
16 | ] | |
17 | } | |
18 | ||
19 | For more information, see `Working with shared contacts and response plans <https://docs.aws.amazon.com/incident-manager/latest/userguide/sharing.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To get details of a response plan** | |
1 | ||
2 | The following ``command-name`` example gets details about a specified response plan in your AWS account. :: | |
3 | ||
4 | aws ssm-incidents get-response-plan \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "actions": [ | |
11 | { | |
12 | "ssmAutomation": { | |
13 | "documentName": "AWSIncidents-CriticalIncidentRunbookTemplate", | |
14 | "documentVersion": "$DEFAULT", | |
15 | "roleArn": "arn:aws:iam::111122223333:role/aws-service-role/ssm-incidents.amazonaws.com/AWSServiceRoleForIncidentManager", | |
16 | "targetAccount": "RESPONSE_PLAN_OWNER_ACCOUNT" | |
17 | } | |
18 | } | |
19 | ], | |
20 | "arn": "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan", | |
21 | "chatChannel": { | |
22 | "chatbotSns": [ | |
23 | "arn:aws:sns:us-east-1:111122223333:Standard_User" | |
24 | ] | |
25 | }, | |
26 | "displayName": "Example response plan", | |
27 | "engagements": [ | |
28 | "arn:aws:ssm-contacts:us-east-1:111122223333:contact/example" | |
29 | ], | |
30 | "incidentTemplate": { | |
31 | "impact": 5, | |
32 | "title": "Example-Incident" | |
33 | }, | |
34 | "name": "Example-Response-Plan" | |
35 | } | |
36 | ||
37 | For more information, see `Incident preparation <https://docs.aws.amazon.com/incident-manager/latest/userguide/incident-response.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To get details of a timeline event** | |
1 | ||
2 | The following ``get-timeline-event`` example returns details of the specified timeline event. :: | |
3 | ||
4 | aws ssm-incidents get-timeline-event \ | |
5 | --event-id 20bcc812-8a94-4cd7-520c-0ff742111424 \ | |
6 | --incident-record-arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "event": { | |
12 | "eventData": "\"Incident Started\"", | |
13 | "eventId": "20bcc812-8a94-4cd7-520c-0ff742111424", | |
14 | "eventTime": "2021-05-21T18:16:57+00:00", | |
15 | "eventType": "Custom Event", | |
16 | "eventUpdatedTime": "2021-05-21T18:16:59.944000+00:00", | |
17 | "incidentRecordArn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
18 | } | |
19 | } | |
20 | ||
21 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list incident records** | |
1 | ||
2 | The following ``command-name`` example lists the incident records in your Amazon Web Services account. :: | |
3 | ||
4 | aws ssm-incidents list-incident-records | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "incidentRecordSummaries": [ | |
10 | { | |
11 | "arn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308", | |
12 | "creationTime": "2021-05-21T18:16:57.579000+00:00", | |
13 | "impact": 5, | |
14 | "incidentRecordSource": { | |
15 | "createdBy": "arn:aws:iam::111122223333:user/draliatp", | |
16 | "invokedBy": "arn:aws:iam::111122223333:user/draliatp", | |
17 | "source": "aws.ssm-incidents.custom" | |
18 | }, | |
19 | "status": "OPEN", | |
20 | "title": "Example-Incident" | |
21 | } | |
22 | ] | |
23 | } | |
24 | ||
25 | For more information, see `Incident list <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-list.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list related items** | |
1 | ||
2 | The following ``list-related-items`` example lists the related items of the specified incident. :: | |
3 | ||
4 | aws ssm-incidents list-related-items \ | |
5 | --incident-record-arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
6 | ||
7 | Contents of ``myfile.json``:: | |
8 | ||
9 | { | |
10 | "somekey": "some value" | |
11 | } | |
12 | ||
13 | Output:: | |
14 | ||
15 | { | |
16 | "relatedItems": [ | |
17 | { | |
18 | "identifier": { | |
19 | "type": "OTHER", | |
20 | "value": { | |
21 | "url": "https://console.aws.amazon.com/systems-manager/opsitems/oi-8ef82158e190/workbench?region=us-east-1" | |
22 | } | |
23 | }, | |
24 | "title": "Example related item" | |
25 | }, | |
26 | { | |
27 | "identifier": { | |
28 | "type": "PARENT", | |
29 | "value": { | |
30 | "arn": "arn:aws:ssm:us-east-1:111122223333:opsItem/oi-8084126392ac" | |
31 | } | |
32 | }, | |
33 | "title": "parentItem" | |
34 | } | |
35 | ] | |
36 | } | |
37 | ||
38 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list the replication set** | |
1 | ||
2 | The following ``list-replication-set`` example lists the replication set Incident Manager uses to replicate and encrypt data in your AWS account. :: | |
3 | ||
4 | aws ssm-incidents list-replication-sets | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "replicationSetArns": [ | |
10 | "arn:aws:ssm-incidents::111122223333:replication-set/c4bcb603-4bf9-bb3f-413c-08df53673b57" | |
11 | ] | |
12 | } | |
13 | ||
14 | For more information, see `Using the Incident Manager replication set <https://docs.aws.amazon.com/incident-manager/latest/userguide/replication.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list the available response plans** | |
1 | ||
2 | The following ``list-response-plans`` example lists the available response plans in your Amazon Web Services account. :: | |
3 | ||
4 | aws ssm-incidents list-response-plans | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "responsePlanSummaries": [ | |
10 | { | |
11 | "arn": "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan", | |
12 | "displayName": "Example response plan", | |
13 | "name": "Example-Response-Plan" | |
14 | } | |
15 | ] | |
16 | } | |
17 | ||
18 | For more information, see `Incident preparation <https://docs.aws.amazon.com/incident-manager/latest/userguide/incident-response.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list tags for a response plan** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists the tags associated with the specified response plan. :: | |
3 | ||
4 | aws ssm-incidents list-tags-for-resource \ | |
5 | --resource-arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "tags": { | |
11 | "group1": "1" | |
12 | } | |
13 | } | |
14 | ||
15 | For more information, see `Tagging <https://docs.aws.amazon.com/incident-manager/latest/userguide/tagging.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To list timeline events of an incident** | |
1 | ||
2 | The following ``command-name`` example lists the timeline events of the specified incident. :: | |
3 | ||
4 | aws ssm-incidents list-timeline-events \ | |
5 | --incident-record-arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "eventSummaries": [ | |
11 | { | |
12 | "eventId": "8cbcc889-35e1-a42d-2429-d6f100799915", | |
13 | "eventTime": "2021-05-21T22:36:13.766000+00:00", | |
14 | "eventType": "SSM Incident Record Update", | |
15 | "eventUpdatedTime": "2021-05-21T22:36:13.766000+00:00", | |
16 | "incidentRecordArn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
17 | }, | |
18 | { | |
19 | "eventId": "a2bcc825-aab5-1787-c605-f9bb2640d85b", | |
20 | "eventTime": "2021-05-21T18:58:46.443000+00:00", | |
21 | "eventType": "SSM Incident Record Update", | |
22 | "eventUpdatedTime": "2021-05-21T18:58:46.443000+00:00", | |
23 | "incidentRecordArn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
24 | }, | |
25 | { | |
26 | "eventId": "5abcc812-89c0-b0a8-9437-1c74223d4685", | |
27 | "eventTime": "2021-05-21T18:16:59.149000+00:00", | |
28 | "eventType": "SSM Incident Record Update", | |
29 | "eventUpdatedTime": "2021-05-21T18:16:59.149000+00:00", | |
30 | "incidentRecordArn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
31 | }, | |
32 | { | |
33 | "eventId": "06bcc812-8820-405e-4065-8d2b14d29b92", | |
34 | "eventTime": "2021-05-21T18:16:58+00:00", | |
35 | "eventType": "SSM Automation Execution Start Failure for Incident", | |
36 | "eventUpdatedTime": "2021-05-21T18:16:58.689000+00:00", | |
37 | "incidentRecordArn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
38 | }, | |
39 | { | |
40 | "eventId": "20bcc812-8a94-4cd7-520c-0ff742111424", | |
41 | "eventTime": "2021-05-21T18:16:57+00:00", | |
42 | "eventType": "Custom Event", | |
43 | "eventUpdatedTime": "2021-05-21T18:16:59.944000+00:00", | |
44 | "incidentRecordArn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
45 | }, | |
46 | { | |
47 | "eventId": "c0bcc885-a41d-eb01-b4ab-9d2de193643c", | |
48 | "eventTime": "2020-10-01T20:30:00+00:00", | |
49 | "eventType": "Custom Event", | |
50 | "eventUpdatedTime": "2021-05-21T22:28:26.299000+00:00", | |
51 | "incidentRecordArn": "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
52 | } | |
53 | ] | |
54 | } | |
55 | ||
56 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To share a response plan and incidents** | |
1 | ||
2 | The following ``command-name`` example adds a resource policy to the Example-Response-Plan that shares the response plan and associated incidents with the specified principal. :: | |
3 | ||
4 | aws ssm-incidents put-resource-policy \ | |
5 | --resource-arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" \ | |
6 | --policy "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"ExampleResourcePolciy\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::222233334444:root\"},\"Action\":[\"ssm-incidents:GetResponsePlan\",\"ssm-incidents:StartIncident\",\"ssm-incidents:UpdateIncidentRecord\",\"ssm-incidents:GetIncidentRecord\",\"ssm-incidents:CreateTimelineEvent\",\"ssm-incidents:UpdateTimelineEvent\",\"ssm-incidents:GetTimelineEvent\",\"ssm-incidents:ListTimelineEvents\",\"ssm-incidents:UpdateRelatedItems\",\"ssm-incidents:ListRelatedItems\"],\"Resource\":[\"arn:aws:ssm-incidents:*:111122223333:response-plan/Example-Response-Plan\",\"arn:aws:ssm-incidents:*:111122223333:incident-record/Example-Response-Plan/*\"]}]}" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "policyId": "be8b57191f0371f1c6827341aa3f0a03" | |
12 | } | |
13 | ||
14 | For more information, see `Working with shared contacts and response plans <https://docs.aws.amazon.com/incident-manager/latest/userguide/sharing.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To start an incident** | |
1 | ||
2 | The following ``start-incident`` example starts an incident using the specified response plan. :: | |
3 | ||
4 | aws ssm-incidents start-incident \ | |
5 | --response-plan-arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "incidentRecordArn": "arn:aws:ssm-incidents::682428703967:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" | |
11 | } | |
12 | ||
13 | For more information, see `Incident creation <https://docs.aws.amazon.com/incident-manager/latest/userguide/incident-creation.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To tag a response plan** | |
1 | ||
2 | The following ``tag-resource`` example tags a specified response plan with the provided tag key-value pair. :: | |
3 | ||
4 | aws ssm-incidents tag-resource \ | |
5 | --resource-arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" \ | |
6 | --tags '{"group1":"1"}' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging <https://docs.aws.amazon.com/incident-manager/latest/userguide/tagging.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To remove tags from a response plan** | |
1 | ||
2 | The following ``untag-resource`` example removes the specified tags from the response plan. :: | |
3 | ||
4 | aws ssm-incidents untag-resource \ | |
5 | --resource-arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" \ | |
6 | --tag-keys '["group1"]' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging <https://docs.aws.amazon.com/incident-manager/latest/userguide/tagging.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To update replication set deletion protection** | |
1 | ||
2 | The following ``update-deletion-protection`` example updates the deletion protection in your account to protect you from deleting the last Region in your replication set. :: | |
3 | ||
4 | aws ssm-incidents update-deletion-protection \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:replication-set/a2bcc5c9-0f53-8047-7fef-c20749989b40" \ | |
6 | --deletion-protected | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Using the Incident Manager replication set <https://docs.aws.amazon.com/incident-manager/latest/userguide/replication.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To update an incident record** | |
1 | ||
2 | The following ``command-name`` example resolves the specified incident. :: | |
3 | ||
4 | aws ssm-incidents update-incident-record \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" \ | |
6 | --status "RESOLVED" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To update an incidents related item** | |
1 | ||
2 | The following ``update-related-item`` example removes a related item from the specified incident record. :: | |
3 | ||
4 | aws ssm-incidents update-related-items \ | |
5 | --incident-record-arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" \ | |
6 | --related-items-update '{"itemToRemove": {"type": "OTHER", "value": {"url": "https://console.aws.amazon.com/systems-manager/opsitems/oi-8ef82158e190/workbench?region=us-east-1"}}}' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To update a replication set** | |
1 | ||
2 | The following ``command-name`` example deletes the us-east-2 Region from the replication set. :: | |
3 | ||
4 | aws ssm-incidents update-replication-set \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:replication-set/a2bcc5c9-0f53-8047-7fef-c20749989b40" \ | |
6 | --actions '[{"deleteRegionAction": {"regionName": "us-east-2"}}]' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Using the Incident Manager replication set <https://docs.aws.amazon.com/incident-manager/latest/userguide/replication.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To update a response plan** | |
1 | ||
2 | The following ``update-response-plan`` example removes a chat channel from the specified response plan. :: | |
3 | ||
4 | aws ssm-incidents update-response-plan \ | |
5 | --arn "arn:aws:ssm-incidents::111122223333:response-plan/Example-Response-Plan" \ | |
6 | --chat-channel '{"empty":{}}' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Incident preparation <https://docs.aws.amazon.com/incident-manager/latest/userguide/incident-response.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | **To update a timeline event** | |
1 | ||
2 | The following ``update-timeline-event`` example updates the time that the event occurred. :: | |
3 | ||
4 | aws ssm-incidents update-timeline-event \ | |
5 | --event-id 20bcc812-8a94-4cd7-520c-0ff742111424 \ | |
6 | --incident-record-arn "arn:aws:ssm-incidents::111122223333:incident-record/Example-Response-Plan/6ebcc812-85f5-b7eb-8b2f-283e4d844308" \ | |
7 | --event-time "2021-05-21T18:10:57+00:00" | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Incident details <https://docs.aws.amazon.com/incident-manager/latest/userguide/tracking-details.html>`__ in the *Incident Manager User Guide*.⏎ |
0 | 0 | **To update a web ACL** |
1 | 1 | |
2 | The following ``update-web-acl`` changes the high-level configuration for an existing web ACL, and leaves the rule statements unchanged. This call requires an ID, which you can obtain from the call, ``list-web-acls``, and a lock token which you can obtain from the calls, ``list-web-acls`` and ``get-web-acl``. This call also returns a lock token that you can use for a subsequent update. :: | |
2 | The following ``update-web-acl`` changes settings for an existing web ACL. This call requires an ID, which you can obtain from the call, ``list-web-acls``, and a lock token and other settings, which you can obtain from the call ``get-web-acl``. This call also returns a lock token that you can use for a subsequent update. :: | |
3 | 3 | |
4 | 4 | aws wafv2 update-web-acl \ |
5 | 5 | --name TestWebAcl \ |
8 | 8 | --lock-token 2294b3a1-0000-0000-0000-a3ae04329de9 \ |
9 | 9 | --default-action Block={} \ |
10 | 10 | --visibility-config SampledRequestsEnabled=false,CloudWatchMetricsEnabled=false,MetricName=NewMetricTestWebAcl \ |
11 | --rules file://waf-rule.json \ | |
11 | 12 | --region us-west-2 |
12 | 13 | |
13 | 14 | Output:: |
16 | 17 | "NextLockToken": "714a0cfb-0000-0000-0000-2959c8b9a684" |
17 | 18 | } |
18 | 19 | |
19 | For more information, see `Managing and Using a Web Access Control List (Web ACL) <https://docs.aws.amazon.com/waf/latest/developerguide/web-acl.html>`__ in the *AWS WAF, AWS Firewall Manager, and AWS Shield Advanced Developer Guide*. | |
20 | For more information, see `Managing and Using a Web Access Control List (Web ACL) <https://docs.aws.amazon.com/waf/latest/developerguide/web-acl.html>`__ in the *AWS WAF, AWS Firewall Manager, and AWS Shield Advanced Developer Guide*.⏎ |
39 | 39 | """ |
40 | 40 | import re |
41 | 41 | import string |
42 | ||
43 | from awscli.utils import is_document_type | |
42 | 44 | |
43 | 45 | |
44 | 46 | _EOF = object() |
110 | 112 | "space." |
111 | 113 | ) % (self.key, self._error_location()) |
112 | 114 | return msg |
115 | ||
116 | ||
117 | class DocumentTypesNotSupportedError(Exception): | |
118 | pass | |
113 | 119 | |
114 | 120 | |
115 | 121 | class ShorthandParser(object): |
417 | 423 | |
418 | 424 | |
419 | 425 | class BackCompatVisitor(ModelVisitor): |
426 | def _visit_structure(self, parent, shape, name, value): | |
427 | self._raise_if_document_type_found(value, shape) | |
428 | if not isinstance(value, dict): | |
429 | return | |
430 | for member_name, member_shape in shape.members.items(): | |
431 | try: | |
432 | self._visit(value, member_shape, member_name, | |
433 | value.get(member_name)) | |
434 | except DocumentTypesNotSupportedError: | |
435 | # Catch and propagate the document type error to a better | |
436 | # error message as when the original error is thrown there is | |
437 | # no reference to the original member that used the document | |
438 | # type. | |
439 | raise ShorthandParseError( | |
440 | 'Shorthand syntax does not support document types. Use ' | |
441 | 'JSON input for top-level argument to specify nested ' | |
442 | 'parameter: %s' % member_name | |
443 | ) | |
444 | ||
420 | 445 | def _visit_list(self, parent, shape, name, value): |
421 | 446 | if not isinstance(value, list): |
422 | 447 | # Convert a -> [a] because they specified |
442 | 467 | parent[name] = True |
443 | 468 | elif value.lower() == 'false': |
444 | 469 | parent[name] = False |
470 | ||
471 | def _raise_if_document_type_found(self, value, member_shape): | |
472 | # Shorthand syntax does not have support for explicit typing and | |
473 | # instead relies on the model to do type coercion. However, document | |
474 | # types are unmodeled. So using short hand syntax on a document type | |
475 | # would result in all values being typed as strings (e.g. 1 -> "1", | |
476 | # null -> "null") which is probably not desired. So blocking the use | |
477 | # of document types allows us to add proper support for them in the | |
478 | # future in a backwards compatible way. | |
479 | if value is not None and is_document_type(member_shape): | |
480 | raise DocumentTypesNotSupportedError() |
130 | 130 | return service_name, operation_name |
131 | 131 | |
132 | 132 | |
133 | def is_document_type(shape): | |
134 | """Check if shape is a document type""" | |
135 | return getattr(shape, 'is_document_type', False) | |
136 | ||
137 | ||
138 | def is_document_type_container(shape): | |
139 | """Check if the shape is a document type or wraps document types | |
140 | ||
141 | This is helpful to determine if a shape purely deals with document types | |
142 | whether the shape is a document type or it is lists or maps whose base | |
143 | values are document types. | |
144 | """ | |
145 | if not shape: | |
146 | return False | |
147 | recording_visitor = ShapeRecordingVisitor() | |
148 | ShapeWalker().walk(shape, recording_visitor) | |
149 | end_shape = recording_visitor.visited.pop() | |
150 | if not is_document_type(end_shape): | |
151 | return False | |
152 | for shape in recording_visitor.visited: | |
153 | if shape.type_name not in ['list', 'map']: | |
154 | return False | |
155 | return True | |
156 | ||
157 | ||
158 | def operation_uses_document_types(operation_model): | |
159 | """Check if document types are ever used in the operation""" | |
160 | recording_visitor = ShapeRecordingVisitor() | |
161 | walker = ShapeWalker() | |
162 | walker.walk(operation_model.input_shape, recording_visitor) | |
163 | walker.walk(operation_model.output_shape, recording_visitor) | |
164 | for visited_shape in recording_visitor.visited: | |
165 | if is_document_type(visited_shape): | |
166 | return True | |
167 | return False | |
168 | ||
169 | ||
133 | 170 | def json_encoder(obj): |
134 | 171 | """JSON encoder that formats datetimes as ISO8601 format.""" |
135 | 172 | if isinstance(obj, datetime.datetime): |
192 | 229 | outfile.write("\n") |
193 | 230 | outfile.write(six.text_type(ex)) |
194 | 231 | outfile.write("\n") |
232 | ||
233 | ||
234 | class ShapeWalker(object): | |
235 | def walk(self, shape, visitor): | |
236 | """Walk through and visit shapes for introspection | |
237 | ||
238 | :type shape: botocore.model.Shape | |
239 | :param shape: Shape to walk | |
240 | ||
241 | :type visitor: BaseShapeVisitor | |
242 | :param visitor: The visitor to call when walking a shape | |
243 | """ | |
244 | ||
245 | if shape is None: | |
246 | return | |
247 | stack = [] | |
248 | return self._walk(shape, visitor, stack) | |
249 | ||
250 | def _walk(self, shape, visitor, stack): | |
251 | if shape.name in stack: | |
252 | return | |
253 | stack.append(shape.name) | |
254 | getattr(self, '_walk_%s' % shape.type_name, self._default_scalar_walk)( | |
255 | shape, visitor, stack | |
256 | ) | |
257 | stack.pop() | |
258 | ||
259 | def _walk_structure(self, shape, visitor, stack): | |
260 | self._do_shape_visit(shape, visitor) | |
261 | for _, member_shape in shape.members.items(): | |
262 | self._walk(member_shape, visitor, stack) | |
263 | ||
264 | def _walk_list(self, shape, visitor, stack): | |
265 | self._do_shape_visit(shape, visitor) | |
266 | self._walk(shape.member, visitor, stack) | |
267 | ||
268 | def _walk_map(self, shape, visitor, stack): | |
269 | self._do_shape_visit(shape, visitor) | |
270 | self._walk(shape.value, visitor, stack) | |
271 | ||
272 | def _default_scalar_walk(self, shape, visitor, stack): | |
273 | self._do_shape_visit(shape, visitor) | |
274 | ||
275 | def _do_shape_visit(self, shape, visitor): | |
276 | visitor.visit_shape(shape) | |
277 | ||
278 | ||
279 | class BaseShapeVisitor(object): | |
280 | """Visit shape encountered by ShapeWalker""" | |
281 | def visit_shape(self, shape): | |
282 | pass | |
283 | ||
284 | ||
285 | class ShapeRecordingVisitor(BaseShapeVisitor): | |
286 | """Record shapes visited by ShapeWalker""" | |
287 | def __init__(self): | |
288 | self.visited = [] | |
289 | ||
290 | def visit_shape(self, shape): | |
291 | self.visited.append(shape) |
0 | 0 | Metadata-Version: 1.2 |
1 | 1 | Name: awscli |
2 | Version: 1.19.35 | |
2 | Version: 1.20.23 | |
3 | 3 | Summary: Universal Command Line Environment for AWS. |
4 | 4 | Home-page: http://aws.amazon.com/cli/ |
5 | 5 | Author: Amazon Web Services |
37 | 37 | |
38 | 38 | The aws-cli package works on Python versions: |
39 | 39 | |
40 | - 2.7.x and greater | |
41 | 40 | - 3.6.x and greater |
42 | 41 | - 3.7.x and greater |
43 | 42 | - 3.8.x and greater |
43 | ||
44 | On 01/15/2021 deprecation for Python 2.7 was announced and support was dropped | |
45 | on 07/15/2021. To avoid disruption, customers using the AWS CLI on Python 2.7 may | |
46 | need to upgrade their version of Python or pin the version of the AWS CLI. For | |
47 | more information, see this `blog post <https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/>`__. | |
44 | 48 | |
45 | 49 | On 10/29/2020 support for Python 3.4 and Python 3.5 was deprecated and |
46 | 50 | support was dropped on 02/01/2021. Customers using the AWS CLI on |
65 | 69 | |
66 | 70 | Installation |
67 | 71 | ~~~~~~~~~~~~ |
72 | ||
73 | Installation of the AWS CLI and its dependencies use a range of packaging | |
74 | features provided by ``pip`` and ``setuptools``. To ensure smooth installation, | |
75 | it's recommended to use: | |
76 | ||
77 | - ``pip``: 9.0.2 or greater | |
78 | - ``setuptools``: 36.2.0 or greater | |
68 | 79 | |
69 | 80 | The safest way to install the AWS CLI is to use |
70 | 81 | `pip <https://pip.pypa.io/en/stable/>`__ in a ``virtualenv``: |
322 | 333 | Classifier: Natural Language :: English |
323 | 334 | Classifier: License :: OSI Approved :: Apache Software License |
324 | 335 | Classifier: Programming Language :: Python |
325 | Classifier: Programming Language :: Python :: 2 | |
326 | Classifier: Programming Language :: Python :: 2.7 | |
327 | 336 | Classifier: Programming Language :: Python :: 3 |
328 | 337 | Classifier: Programming Language :: Python :: 3.6 |
329 | 338 | Classifier: Programming Language :: Python :: 3.7 |
330 | 339 | Classifier: Programming Language :: Python :: 3.8 |
331 | Requires-Python: >= 2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.* | |
340 | Requires-Python: >= 3.6 |
950 | 950 | awscli/examples/codecommit/update-repository-description.rst |
951 | 951 | awscli/examples/codecommit/update-repository-name.rst |
952 | 952 | awscli/examples/codeguru-reviewer/associate-repository.rst |
953 | awscli/examples/codeguru-reviewer/create-code-review.rst | |
954 | awscli/examples/codeguru-reviewer/describe-code-review.rst | |
955 | awscli/examples/codeguru-reviewer/describe-recommendation-feedback.rst | |
953 | 956 | awscli/examples/codeguru-reviewer/describe-repository-association.rst |
957 | awscli/examples/codeguru-reviewer/disassociate-repository.rst | |
954 | 958 | awscli/examples/codeguru-reviewer/list-code-reviews.rst |
959 | awscli/examples/codeguru-reviewer/list-recommendation-feedback.rst | |
955 | 960 | awscli/examples/codeguru-reviewer/list-recommendations.rst |
956 | 961 | awscli/examples/codeguru-reviewer/list-repository-associations.rst |
962 | awscli/examples/codeguru-reviewer/list-tags-for-resource.rst | |
963 | awscli/examples/codeguru-reviewer/put-recommendation-feedback.rst | |
964 | awscli/examples/codeguru-reviewer/tag-resource.rst | |
965 | awscli/examples/codeguru-reviewer/untag-resource.rst | |
957 | 966 | awscli/examples/codepipeline/acknowledge-job.rst |
958 | 967 | awscli/examples/codepipeline/create-custom-action-type.rst |
959 | 968 | awscli/examples/codepipeline/create-pipeline.rst |
1263 | 1272 | awscli/examples/detective/list-graphs.rst |
1264 | 1273 | awscli/examples/detective/list-invitations.rst |
1265 | 1274 | awscli/examples/detective/list-members.rst |
1275 | awscli/examples/detective/list-tags-for-resource.rst | |
1266 | 1276 | awscli/examples/detective/reject-invitation.rst |
1277 | awscli/examples/detective/tag-resource.rst | |
1278 | awscli/examples/detective/untag-resource.rst | |
1267 | 1279 | awscli/examples/devicefarm/create-device-pool.rst |
1268 | 1280 | awscli/examples/devicefarm/create-project.rst |
1269 | 1281 | awscli/examples/devicefarm/create-upload.rst |
1543 | 1555 | awscli/examples/ec2/create-traffic-mirror-filter.rst |
1544 | 1556 | awscli/examples/ec2/create-traffic-mirror-session.rst |
1545 | 1557 | awscli/examples/ec2/create-traffic-mirror-target.rst |
1558 | awscli/examples/ec2/create-transit-gateway-connect.rst | |
1546 | 1559 | awscli/examples/ec2/create-transit-gateway-peering-attachment.rst |
1547 | 1560 | awscli/examples/ec2/create-transit-gateway-prefix-list-reference.rst |
1548 | 1561 | awscli/examples/ec2/create-transit-gateway-route-table.rst |
1558 | 1571 | awscli/examples/ec2/create-vpn-connection-route.rst |
1559 | 1572 | awscli/examples/ec2/create-vpn-connection.rst |
1560 | 1573 | awscli/examples/ec2/create-vpn-gateway.rst |
1574 | awscli/examples/ec2/delete-carrier-gateway.rst | |
1561 | 1575 | awscli/examples/ec2/delete-client-vpn-endpoint.rst |
1562 | 1576 | awscli/examples/ec2/delete-client-vpn-route.rst |
1563 | 1577 | awscli/examples/ec2/delete-customer-gateway.rst |
1620 | 1634 | awscli/examples/ec2/describe-bundle-tasks.rst |
1621 | 1635 | awscli/examples/ec2/describe-byoip-cidrs.rst |
1622 | 1636 | awscli/examples/ec2/describe-capacity-reservations.rst |
1637 | awscli/examples/ec2/describe-carrier-gateways.rst | |
1623 | 1638 | awscli/examples/ec2/describe-classic-link-instances.rst |
1624 | 1639 | awscli/examples/ec2/describe-client-vpn-authorization-rules.rst |
1625 | 1640 | awscli/examples/ec2/describe-client-vpn-connections.rst |
1707 | 1722 | awscli/examples/ec2/describe-traffic-mirror-sessions.rst |
1708 | 1723 | awscli/examples/ec2/describe-traffic-mirror-targets.rst |
1709 | 1724 | awscli/examples/ec2/describe-transit-gateway-attachments.rst |
1725 | awscli/examples/ec2/describe-transit-gateway-connects.rst | |
1726 | awscli/examples/ec2/describe-transit-gateway-multicast-domains.rst | |
1710 | 1727 | awscli/examples/ec2/describe-transit-gateway-peering-attachments.rst |
1711 | 1728 | awscli/examples/ec2/describe-transit-gateway-route-tables.rst |
1712 | 1729 | awscli/examples/ec2/describe-transit-gateway-vpc-attachments.rst |
2236 | 2253 | awscli/examples/firehose/list-delivery-streams.rst |
2237 | 2254 | awscli/examples/firehose/put-record-batch.rst |
2238 | 2255 | awscli/examples/firehose/put-record.rst |
2256 | awscli/examples/fis/create-experiment-template.rst | |
2257 | awscli/examples/fis/delete-experiment-template.rst | |
2258 | awscli/examples/fis/get-action.rst | |
2259 | awscli/examples/fis/get-experiment-template.rst | |
2260 | awscli/examples/fis/get-experiment.rst | |
2261 | awscli/examples/fis/list-actions.rst | |
2262 | awscli/examples/fis/list-experiment-templates.rst | |
2263 | awscli/examples/fis/list-experiments.rst | |
2264 | awscli/examples/fis/list-tags-for-resource.rst | |
2265 | awscli/examples/fis/start-experiment.rst | |
2266 | awscli/examples/fis/stop-experiment.rst | |
2267 | awscli/examples/fis/tag-resource.rst | |
2268 | awscli/examples/fis/untag-resource.rst | |
2269 | awscli/examples/fis/update-experiment-template.rst | |
2239 | 2270 | awscli/examples/fms/associate-admin-account.rst |
2240 | 2271 | awscli/examples/fms/delete-notification-channel.rst |
2241 | 2272 | awscli/examples/fms/delete-policy.rst |
2307 | 2338 | awscli/examples/glacier/upload-multipart-part.rst |
2308 | 2339 | awscli/examples/glacier/wait/vault-exists.rst |
2309 | 2340 | awscli/examples/glacier/wait/vault-not-exists.rst |
2341 | awscli/examples/globalaccelerator/add-custom-routing-endpoints.rst | |
2310 | 2342 | awscli/examples/globalaccelerator/advertise-byoip-cidr.rst |
2343 | awscli/examples/globalaccelerator/allow-custom-routing-traffic.rst | |
2311 | 2344 | awscli/examples/globalaccelerator/create-accelerator.rst |
2345 | awscli/examples/globalaccelerator/create-custom-routing-accelerator.rst | |
2346 | awscli/examples/globalaccelerator/create-custom-routing-endpoint-group.rst | |
2347 | awscli/examples/globalaccelerator/create-custom-routing-listener.rst | |
2312 | 2348 | awscli/examples/globalaccelerator/create-endpoint-group.rst |
2313 | 2349 | awscli/examples/globalaccelerator/create-listener.rst |
2350 | awscli/examples/globalaccelerator/deny-custom-routing-traffic.rst | |
2314 | 2351 | awscli/examples/globalaccelerator/deprovision-byoip-cidr.rst |
2315 | 2352 | awscli/examples/globalaccelerator/describe-accelerator-attributes.rst |
2316 | 2353 | awscli/examples/globalaccelerator/describe-accelerator.rst |
2354 | awscli/examples/globalaccelerator/describe-custom-routing-accelerator-attributes.rst | |
2355 | awscli/examples/globalaccelerator/describe-custom-routing-accelerator.rst | |
2356 | awscli/examples/globalaccelerator/describe-custom-routing-endpoint-group.rst | |
2357 | awscli/examples/globalaccelerator/describe-custom-routing-listener.rst | |
2317 | 2358 | awscli/examples/globalaccelerator/describe-endpoint-group.rst |
2318 | 2359 | awscli/examples/globalaccelerator/describe-listener.rst |
2319 | 2360 | awscli/examples/globalaccelerator/list-accelerators.rst |
2320 | 2361 | awscli/examples/globalaccelerator/list-byoip-cidr.rst |
2362 | awscli/examples/globalaccelerator/list-custom-routing-accelerators.rst | |
2363 | awscli/examples/globalaccelerator/list-custom-routing-endpoint-groups.rst | |
2364 | awscli/examples/globalaccelerator/list-custom-routing-listeners.rst | |
2365 | awscli/examples/globalaccelerator/list-custom-routing-port-mappings-by-destination.rst | |
2366 | awscli/examples/globalaccelerator/list-custom-routing-port-mappings.rst | |
2321 | 2367 | awscli/examples/globalaccelerator/list-endpoint-groups.rst |
2322 | 2368 | awscli/examples/globalaccelerator/list-listeners.rst |
2323 | 2369 | awscli/examples/globalaccelerator/list-tags-for-resource.rst |
2326 | 2372 | awscli/examples/globalaccelerator/untag-resource.rst |
2327 | 2373 | awscli/examples/globalaccelerator/update-accelerator-attributes.rst |
2328 | 2374 | awscli/examples/globalaccelerator/update-accelerator.rst |
2375 | awscli/examples/globalaccelerator/update-custom-routing-accelerator-attributes.rst | |
2376 | awscli/examples/globalaccelerator/update-custom-routing-accelerator.rst | |
2377 | awscli/examples/globalaccelerator/update-custom-routing-listener.rst | |
2329 | 2378 | awscli/examples/globalaccelerator/update-endpoint-group.rst |
2330 | 2379 | awscli/examples/globalaccelerator/update-listener.rst |
2331 | 2380 | awscli/examples/globalaccelerator/withdraw-byoip-cidr.rst |
2814 | 2863 | awscli/examples/iot/detach-thing-principal.rst |
2815 | 2864 | awscli/examples/iot/disable-topic-rule.rst |
2816 | 2865 | awscli/examples/iot/enable-topic-rule.rst |
2866 | awscli/examples/iot/get-behavior-model-training-summaries.rst | |
2817 | 2867 | awscli/examples/iot/get-cardinality.rst |
2818 | 2868 | awscli/examples/iot/get-effective-policies.rst |
2819 | 2869 | awscli/examples/iot/get-indexing-configuration.rst |
2847 | 2897 | awscli/examples/iot/list-job-executions-for-job.rst |
2848 | 2898 | awscli/examples/iot/list-job-executions-for-thing.rst |
2849 | 2899 | awscli/examples/iot/list-jobs.rst |
2900 | awscli/examples/iot/list-mitigation-actions.rst | |
2850 | 2901 | awscli/examples/iot/list-mitigations-actions.rst |
2851 | 2902 | awscli/examples/iot/list-ota-updates.rst |
2852 | 2903 | awscli/examples/iot/list-outgoing-certificates.rst |
3176 | 3227 | awscli/examples/ivs/batch-get-channel.rst |
3177 | 3228 | awscli/examples/ivs/batch-get-stream-key.rst |
3178 | 3229 | awscli/examples/ivs/create-channel.rst |
3230 | awscli/examples/ivs/create-recording-configuration.rst | |
3179 | 3231 | awscli/examples/ivs/create-stream-key.rst |
3180 | 3232 | awscli/examples/ivs/delete-playback-key-pair.rst |
3233 | awscli/examples/ivs/delete-recording-configuration.rst | |
3181 | 3234 | awscli/examples/ivs/delete-stream-key.rst |
3182 | 3235 | awscli/examples/ivs/get-channel.rst |
3183 | 3236 | awscli/examples/ivs/get-playback-key-pair.rst |
3237 | awscli/examples/ivs/get-recording-configuration.rst | |
3184 | 3238 | awscli/examples/ivs/get-stream-key.rst |
3185 | 3239 | awscli/examples/ivs/get-stream.rst |
3186 | 3240 | awscli/examples/ivs/import-playback-key-pair.rst |
3187 | 3241 | awscli/examples/ivs/list-channels.rst |
3188 | 3242 | awscli/examples/ivs/list-playback-key-pairs.rst |
3243 | awscli/examples/ivs/list-recording-configurations.rst | |
3189 | 3244 | awscli/examples/ivs/list-stream-keys.rst |
3190 | 3245 | awscli/examples/ivs/list-streams.rst |
3191 | 3246 | awscli/examples/ivs/list-tags-for-resource.rst |
3844 | 3899 | awscli/examples/rds/purchase-reserved-db-instance.rst |
3845 | 3900 | awscli/examples/rds/purchase-reserved-db-instances-offerings.rst |
3846 | 3901 | awscli/examples/rds/reboot-db-instance.rst |
3902 | awscli/examples/rds/remove-from-global-cluster.rst | |
3847 | 3903 | awscli/examples/rds/remove-option-from-option-group.rst |
3848 | 3904 | awscli/examples/rds/remove-role-from-db-cluster.rst |
3849 | 3905 | awscli/examples/rds/remove-role-from-db-instance.rst |
4083 | 4139 | awscli/examples/route53domains/update-domain-nameservers.rst |
4084 | 4140 | awscli/examples/route53domains/update-tags-for-domain.rst |
4085 | 4141 | awscli/examples/route53domains/view-billing.rst |
4142 | awscli/examples/route53resolver/associate-firewall-rule-group.rst | |
4086 | 4143 | awscli/examples/route53resolver/associate-resolver-endpoint-ip-address.rst |
4087 | 4144 | awscli/examples/route53resolver/associate-resolver-rule.rst |
4145 | awscli/examples/route53resolver/create-firewall-domain-list.rst | |
4146 | awscli/examples/route53resolver/create-firewall-rule-group.rst | |
4147 | awscli/examples/route53resolver/create-firewall-rule.rst | |
4088 | 4148 | awscli/examples/route53resolver/create-resolver-endpoint.rst |
4089 | 4149 | awscli/examples/route53resolver/create-resolver-rule.rst |
4150 | awscli/examples/route53resolver/delete-firewall-domain-list.rst | |
4151 | awscli/examples/route53resolver/delete-firewall-rule-group.rst | |
4152 | awscli/examples/route53resolver/delete-firewall-rule.rst | |
4090 | 4153 | awscli/examples/route53resolver/delete-resolver-endpoint.rst |
4091 | 4154 | awscli/examples/route53resolver/delete-resolver-rule.rst |
4155 | awscli/examples/route53resolver/disassociate-firewall-rule-group.rst | |
4092 | 4156 | awscli/examples/route53resolver/disassociate-resolver-endpoint-ip-address.rst |
4093 | 4157 | awscli/examples/route53resolver/disassociate-resolver-rule.rst |
4158 | awscli/examples/route53resolver/get-firewall-config.rst | |
4159 | awscli/examples/route53resolver/get-firewall-domain-list.rst | |
4160 | awscli/examples/route53resolver/get-firewall-rule-group-association.rst | |
4161 | awscli/examples/route53resolver/get-firewall-rule-group-policy.rst | |
4162 | awscli/examples/route53resolver/get-firewall-rule-group.rst | |
4094 | 4163 | awscli/examples/route53resolver/get-resolver-endpoint.rst |
4095 | 4164 | awscli/examples/route53resolver/get-resolver-rule-association.rst |
4096 | 4165 | awscli/examples/route53resolver/get-resolver-rule.rst |
4166 | awscli/examples/route53resolver/import-firewall-domains.rst | |
4167 | awscli/examples/route53resolver/list-firewall-configs.rst | |
4168 | awscli/examples/route53resolver/list-firewall-domain-lists.rst | |
4169 | awscli/examples/route53resolver/list-firewall-domains.rst | |
4170 | awscli/examples/route53resolver/list-firewall-rule-group-associations.rst | |
4171 | awscli/examples/route53resolver/list-firewall-rule-groups.rst | |
4172 | awscli/examples/route53resolver/list-firewall-rules.rst | |
4097 | 4173 | awscli/examples/route53resolver/list-resolver-endpoint-ip-addresses.rst |
4098 | 4174 | awscli/examples/route53resolver/list-resolver-endpoints.rst |
4099 | 4175 | awscli/examples/route53resolver/list-resolver-rule-associations.rst |
4100 | 4176 | awscli/examples/route53resolver/list-resolver-rules.rst |
4101 | 4177 | awscli/examples/route53resolver/list-tags-for-resource.rst |
4178 | awscli/examples/route53resolver/put-firewall-rule-group-policy.rst | |
4102 | 4179 | awscli/examples/route53resolver/put-resolver-rule-policy.rst |
4103 | 4180 | awscli/examples/route53resolver/tag-resource.rst |
4104 | 4181 | awscli/examples/route53resolver/untag-resource.rst |
4182 | awscli/examples/route53resolver/update-firewall-config.rst | |
4183 | awscli/examples/route53resolver/update-firewall-domains.rst | |
4184 | awscli/examples/route53resolver/update-firewall-rule-group-association.rst | |
4185 | awscli/examples/route53resolver/update-firewall-rule.rst | |
4105 | 4186 | awscli/examples/route53resolver/update-resolver-endpoint.rst |
4106 | 4187 | awscli/examples/route53resolver/update-resolver-rule.rst |
4107 | 4188 | awscli/examples/s3/_concepts.rst |
4240 | 4321 | awscli/examples/secretsmanager/untag-resource.rst |
4241 | 4322 | awscli/examples/secretsmanager/update-secret-version-stage.rst |
4242 | 4323 | awscli/examples/secretsmanager/update-secret.rst |
4324 | awscli/examples/securityhub/accept-administrator-invitation.rst | |
4243 | 4325 | awscli/examples/securityhub/accept-invitation.rst |
4244 | 4326 | awscli/examples/securityhub/batch-disable-standards.rst |
4245 | 4327 | awscli/examples/securityhub/batch-enable-standards.rst |
4262 | 4344 | awscli/examples/securityhub/disable-import-findings-for-product.rst |
4263 | 4345 | awscli/examples/securityhub/disable-organization-admin-account.rst |
4264 | 4346 | awscli/examples/securityhub/disable-security-hub.rst |
4347 | awscli/examples/securityhub/disassociate-from-administrator-account.rst | |
4265 | 4348 | awscli/examples/securityhub/disassociate-from-master-account.rst |
4266 | 4349 | awscli/examples/securityhub/disassociate-members.rst |
4267 | 4350 | awscli/examples/securityhub/enable-import-findings-for-product.rst |
4268 | 4351 | awscli/examples/securityhub/enable-organization-admin-account.rst |
4269 | 4352 | awscli/examples/securityhub/enable-security-hub.rst |
4353 | awscli/examples/securityhub/get-administrator-account.rst | |
4270 | 4354 | awscli/examples/securityhub/get-enabled-standards.rst |
4271 | 4355 | awscli/examples/securityhub/get-findings.rst |
4272 | 4356 | awscli/examples/securityhub/get-insight-results.rst |
4555 | 4639 | awscli/examples/ssm/start-session.rst |
4556 | 4640 | awscli/examples/ssm/stop-automation-execution.rst |
4557 | 4641 | awscli/examples/ssm/terminate-session.rst |
4642 | awscli/examples/ssm/unlabel-parameter-version.rst | |
4558 | 4643 | awscli/examples/ssm/update-association-status.rst |
4559 | 4644 | awscli/examples/ssm/update-association.rst |
4560 | 4645 | awscli/examples/ssm/update-document-default-version.rst |
4567 | 4652 | awscli/examples/ssm/update-patch-baseline.rst |
4568 | 4653 | awscli/examples/ssm/update-resource-data-sync.rst |
4569 | 4654 | awscli/examples/ssm/update-service-setting.rst |
4655 | awscli/examples/ssm-contacts/accept-page.rst | |
4656 | awscli/examples/ssm-contacts/activate-contact-channel.rst | |
4657 | awscli/examples/ssm-contacts/command-name.rst | |
4658 | awscli/examples/ssm-contacts/create-contact-channel.rst | |
4659 | awscli/examples/ssm-contacts/create-contact.rst | |
4660 | awscli/examples/ssm-contacts/deactivate-contact-channel.rst | |
4661 | awscli/examples/ssm-contacts/delete-contact-channel.rst | |
4662 | awscli/examples/ssm-contacts/delete-contact.rst | |
4663 | awscli/examples/ssm-contacts/describe-engagement.rst | |
4664 | awscli/examples/ssm-contacts/describe-page.rst | |
4665 | awscli/examples/ssm-contacts/get-contact-channel.rst | |
4666 | awscli/examples/ssm-contacts/get-contact-policy.rst | |
4667 | awscli/examples/ssm-contacts/get-contact.rst | |
4668 | awscli/examples/ssm-contacts/list-contact-channels.rst | |
4669 | awscli/examples/ssm-contacts/list-contacts.rst | |
4670 | awscli/examples/ssm-contacts/list-engagements.rst | |
4671 | awscli/examples/ssm-contacts/list-page-receipts.rst | |
4672 | awscli/examples/ssm-contacts/list-pages-by-contact.rst | |
4673 | awscli/examples/ssm-contacts/list-pages-by-engagement.rst | |
4674 | awscli/examples/ssm-contacts/list-tags-for-resource.rst | |
4675 | awscli/examples/ssm-contacts/put-contact-policy.rst | |
4676 | awscli/examples/ssm-contacts/send-activation-code.rst | |
4677 | awscli/examples/ssm-contacts/start-engagement.rst | |
4678 | awscli/examples/ssm-contacts/stop-engagement.rst | |
4679 | awscli/examples/ssm-contacts/tag-resource.rst | |
4680 | awscli/examples/ssm-contacts/untag-resource.rst | |
4681 | awscli/examples/ssm-contacts/update-contact-channel.rst | |
4682 | awscli/examples/ssm-contacts/update-contact.rst | |
4683 | awscli/examples/ssm-incidents/create-replication-set.rst | |
4684 | awscli/examples/ssm-incidents/create-response-plan.rst | |
4685 | awscli/examples/ssm-incidents/create-timeline-event.rst | |
4686 | awscli/examples/ssm-incidents/delete-incident-record.rst | |
4687 | awscli/examples/ssm-incidents/delete-replication-set.rst | |
4688 | awscli/examples/ssm-incidents/delete-resource-policy.rst | |
4689 | awscli/examples/ssm-incidents/delete-response-plan.rst | |
4690 | awscli/examples/ssm-incidents/delete-timeline-event.rst | |
4691 | awscli/examples/ssm-incidents/get-incident-record.rst | |
4692 | awscli/examples/ssm-incidents/get-replication-set.rst | |
4693 | awscli/examples/ssm-incidents/get-resource-policies.rst | |
4694 | awscli/examples/ssm-incidents/get-response-plan.rst | |
4695 | awscli/examples/ssm-incidents/get-timeline-event.rst | |
4696 | awscli/examples/ssm-incidents/list-incident-records.rst | |
4697 | awscli/examples/ssm-incidents/list-related-items.rst | |
4698 | awscli/examples/ssm-incidents/list-replication-sets.rst | |
4699 | awscli/examples/ssm-incidents/list-response-plans.rst | |
4700 | awscli/examples/ssm-incidents/list-tags-for-resource.rst | |
4701 | awscli/examples/ssm-incidents/list-timeline-events.rst | |
4702 | awscli/examples/ssm-incidents/put-resource-policy.rst | |
4703 | awscli/examples/ssm-incidents/start-incident.rst | |
4704 | awscli/examples/ssm-incidents/tag-resource.rst | |
4705 | awscli/examples/ssm-incidents/untag-resource.rst | |
4706 | awscli/examples/ssm-incidents/update-deletion-protection.rst | |
4707 | awscli/examples/ssm-incidents/update-incident-record.rst | |
4708 | awscli/examples/ssm-incidents/update-related-items.rst | |
4709 | awscli/examples/ssm-incidents/update-replication-set.rst | |
4710 | awscli/examples/ssm-incidents/update-response-plan.rst | |
4711 | awscli/examples/ssm-incidents/update-timeline-event.rst | |
4570 | 4712 | awscli/examples/storagegateway/describe-gateway-information.rst |
4571 | 4713 | awscli/examples/storagegateway/list-file-shares.rst |
4572 | 4714 | awscli/examples/storagegateway/list-gateways.rst |
0 | botocore==1.20.35 | |
0 | botocore==1.21.23 | |
1 | 1 | docutils<0.16,>=0.10 |
2 | s3transfer<0.4.0,>=0.3.0 | |
2 | s3transfer<0.6.0,>=0.5.0 | |
3 | 3 | PyYAML<5.5,>=3.10 |
4 | 4 | colorama<0.4.4,>=0.2.5 |
5 | rsa<=4.5.0,>=3.1.2 | |
5 | rsa<4.8,>=3.1.2 |
0 | 0 | [wheel] |
1 | universal = 1 | |
1 | universal = 0 | |
2 | 2 | |
3 | 3 | [metadata] |
4 | 4 | requires_dist = |
5 | botocore==1.20.35 | |
5 | botocore==1.21.23 | |
6 | 6 | docutils>=0.10,<0.16 |
7 | s3transfer>=0.3.0,<0.4.0 | |
7 | s3transfer>=0.5.0,<0.6.0 | |
8 | 8 | PyYAML>=3.10,<5.5 |
9 | 9 | colorama>=0.2.5,<0.4.4 |
10 | rsa>=3.1.2,<=4.5.0; python_version=='2.7' | |
11 | rsa>=3.1.2,<4.8; python_version>='3.6' | |
10 | rsa>=3.1.2,<4.8 | |
12 | 11 | |
13 | 12 | [check-manifest] |
14 | 13 | ignore = |
23 | 23 | |
24 | 24 | |
25 | 25 | install_requires = [ |
26 | 'botocore==1.20.35', | |
26 | 'botocore==1.21.23', | |
27 | 27 | 'docutils>=0.10,<0.16', |
28 | 's3transfer>=0.3.0,<0.4.0', | |
28 | 's3transfer>=0.5.0,<0.6.0', | |
29 | 29 | 'PyYAML>=3.10,<5.5', |
30 | 30 | 'colorama>=0.2.5,<0.4.4', |
31 | 'rsa>=3.1.2,<4.8', | |
31 | 32 | ] |
32 | ||
33 | if sys.version_info[:2] == (2, 7): | |
34 | # Last version of rsa supporting Python 2.7 | |
35 | install_requires.append('rsa>=3.1.2,<=4.5.0') | |
36 | else: | |
37 | install_requires.append('rsa>=3.1.2,<4.8') | |
38 | 33 | |
39 | 34 | |
40 | 35 | setup_options = dict( |
55 | 50 | install_requires=install_requires, |
56 | 51 | extras_require={}, |
57 | 52 | license="Apache License 2.0", |
58 | python_requires=">= 2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*", | |
53 | python_requires=">= 3.6", | |
59 | 54 | classifiers=[ |
60 | 55 | 'Development Status :: 5 - Production/Stable', |
61 | 56 | 'Intended Audience :: Developers', |
63 | 58 | 'Natural Language :: English', |
64 | 59 | 'License :: OSI Approved :: Apache Software License', |
65 | 60 | 'Programming Language :: Python', |
66 | 'Programming Language :: Python :: 2', | |
67 | 'Programming Language :: Python :: 2.7', | |
68 | 61 | 'Programming Language :: Python :: 3', |
69 | 62 | 'Programming Language :: Python :: 3.6', |
70 | 63 | 'Programming Language :: Python :: 3.7', |