New upstream version 1.16.251
TANIGUCHI Takaki
4 years ago
0 | 0 | Metadata-Version: 1.1 |
1 | 1 | Name: awscli |
2 | Version: 1.16.218 | |
2 | Version: 1.16.251 | |
3 | 3 | Summary: Universal Command Line Environment for AWS. |
4 | 4 | Home-page: http://aws.amazon.com/cli/ |
5 | 5 | Author: Amazon Web Services |
16 | 16 | """ |
17 | 17 | import os |
18 | 18 | |
19 | __version__ = '1.16.218' | |
19 | __version__ = '1.16.251' | |
20 | 20 | |
21 | 21 | # |
22 | 22 | # Get our data path to be added to botocore's search path |
57 | 57 | {'name': 'sns-custom-policy', |
58 | 58 | 'help_text': 'Custom SNS policy template or URL'} |
59 | 59 | ] |
60 | ||
61 | 60 | UPDATE = False |
61 | _UNDOCUMENTED = True | |
62 | 62 | |
63 | 63 | def _run_main(self, args, parsed_globals): |
64 | 64 | self.setup_services(args, parsed_globals) |
28 | 28 | get_account_id_from_arn |
29 | 29 | from awscli.customizations.commands import BasicCommand |
30 | 30 | from botocore.exceptions import ClientError |
31 | from awscli.schema import ParameterRequiredError | |
31 | 32 | |
32 | 33 | |
33 | 34 | LOG = logging.getLogger(__name__) |
76 | 77 | raise ValueError('Invalid trail ARN provided: %s' % trail_arn) |
77 | 78 | |
78 | 79 | |
79 | def create_digest_traverser(cloudtrail_client, s3_client_provider, trail_arn, | |
80 | def create_digest_traverser(cloudtrail_client, organization_client, | |
81 | s3_client_provider, trail_arn, | |
80 | 82 | trail_source_region=None, on_invalid=None, |
81 | 83 | on_gap=None, on_missing=None, bucket=None, |
82 | prefix=None): | |
84 | prefix=None, account_id=None): | |
83 | 85 | """Creates a CloudTrail DigestTraverser and its object graph. |
84 | 86 | |
85 | 87 | :type cloudtrail_client: botocore.client.CloudTrail |
86 | 88 | :param cloudtrail_client: Client used to connect to CloudTrail |
89 | :type organization_client: botocore.client.organizations | |
90 | :param organization_client: Client used to connect to Organizations | |
87 | 91 | :type s3_client_provider: S3ClientProvider |
88 | 92 | :param s3_client_provider: Used to create Amazon S3 client per/region. |
89 | 93 | :param trail_arn: CloudTrail trail ARN |
99 | 103 | :param prefix: bucket: Key prefix prepended to each digest and log placed |
100 | 104 | in the Amazon S3 bucket if it is different than the prefix that is |
101 | 105 | currently associated with the trail. |
106 | :param account_id: The account id for which the digest files are | |
107 | validated. For normal trails this is the caller account, for | |
108 | organization trails it is the member accout. | |
102 | 109 | |
103 | 110 | ``on_gap``, ``on_invalid``, and ``on_missing`` callbacks are invoked with |
104 | 111 | the following named arguments: |
111 | 118 | - ``message``: (optional) Message string about the notification. |
112 | 119 | """ |
113 | 120 | assert_cloudtrail_arn_is_valid(trail_arn) |
114 | account_id = get_account_id_from_arn(trail_arn) | |
121 | organization_id = None | |
115 | 122 | if bucket is None: |
116 | 123 | # Determine the bucket and prefix based on the trail arn. |
117 | 124 | trail_info = get_trail_by_arn(cloudtrail_client, trail_arn) |
118 | 125 | LOG.debug('Loaded trail info: %s', trail_info) |
119 | 126 | bucket = trail_info['S3BucketName'] |
120 | 127 | prefix = trail_info.get('S3KeyPrefix', None) |
128 | is_org_trail = trail_info['IsOrganizationTrail'] | |
129 | if is_org_trail: | |
130 | if not account_id: | |
131 | raise ParameterRequiredError( | |
132 | "Missing required parameter for organization " | |
133 | "trail: '--account-id'") | |
134 | organization_id = organization_client.describe_organization()[ | |
135 | 'Organization']['Id'] | |
136 | if not account_id: | |
137 | account_id = get_account_id_from_arn(trail_arn) | |
121 | 138 | # Determine the region from the ARN (e.g., arn:aws:cloudtrail:REGION:...) |
122 | 139 | trail_region = trail_arn.split(':')[3] |
123 | 140 | # Determine the name from the ARN (the last part after "/") |
126 | 143 | account_id=account_id, trail_name=trail_name, |
127 | 144 | s3_client_provider=s3_client_provider, |
128 | 145 | trail_source_region=trail_source_region, |
129 | trail_home_region=trail_region) | |
146 | trail_home_region=trail_region, | |
147 | organization_id=organization_id) | |
130 | 148 | return DigestTraverser( |
131 | 149 | digest_provider=digest_provider, starting_bucket=bucket, |
132 | 150 | starting_prefix=prefix, on_invalid=on_invalid, on_gap=on_gap, |
223 | 241 | one digest to the next. |
224 | 242 | """ |
225 | 243 | def __init__(self, s3_client_provider, account_id, trail_name, |
226 | trail_home_region, trail_source_region=None): | |
244 | trail_home_region, trail_source_region=None, | |
245 | organization_id=None): | |
227 | 246 | self._client_provider = s3_client_provider |
228 | 247 | self.trail_name = trail_name |
229 | 248 | self.account_id = account_id |
230 | 249 | self.trail_home_region = trail_home_region |
231 | 250 | self.trail_source_region = trail_source_region or trail_home_region |
251 | self.organization_id = organization_id | |
232 | 252 | |
233 | 253 | def load_digest_keys_in_range(self, bucket, prefix, start_date, end_date): |
234 | 254 | """Returns a list of digest keys in the date range. |
299 | 319 | """ |
300 | 320 | # Subtract one minute to ensure the dates are inclusive. |
301 | 321 | date = start_date - timedelta(minutes=1) |
302 | template = ('AWSLogs/{account}/CloudTrail-Digest/{source_region}/' | |
303 | '{ymd}/{account}_CloudTrail-Digest_{source_region}_{name}_' | |
304 | '{home_region}_{date}.json.gz') | |
305 | key = template.format(account=self.account_id, date=format_date(date), | |
306 | ymd=date.strftime('%Y/%m/%d'), | |
307 | source_region=self.trail_source_region, | |
308 | home_region=self.trail_home_region, | |
309 | name=self.trail_name) | |
322 | template = 'AWSLogs/' | |
323 | template_params = { | |
324 | 'account_id': self.account_id, | |
325 | 'date': format_date(date), | |
326 | 'ymd': date.strftime('%Y/%m/%d'), | |
327 | 'source_region': self.trail_source_region, | |
328 | 'home_region': self.trail_home_region, | |
329 | 'name': self.trail_name | |
330 | } | |
331 | if self.organization_id: | |
332 | template += '{organization_id}/' | |
333 | template_params['organization_id'] = self.organization_id | |
334 | template += ( | |
335 | '{account_id}/CloudTrail-Digest/{source_region}/' | |
336 | '{ymd}/{account_id}_CloudTrail-Digest_{source_region}_{name}_' | |
337 | '{home_region}_{date}.json.gz' | |
338 | ) | |
339 | key = template.format(**template_params) | |
310 | 340 | if key_prefix: |
311 | 341 | key = key_prefix + '/' + key |
312 | 342 | return key |
313 | 343 | |
314 | 344 | def _create_digest_key_regex(self, key_prefix): |
315 | 345 | """Creates a regular expression used to match against S3 keys""" |
316 | template = ('AWSLogs/{account}/CloudTrail\\-Digest/{source_region}/' | |
317 | '\\d+/\\d+/\\d+/{account}_CloudTrail\\-Digest_' | |
318 | '{source_region}_{name}_{home_region}_.+\\.json\\.gz') | |
319 | key = template.format( | |
320 | account=re.escape(self.account_id), | |
321 | source_region=re.escape(self.trail_source_region), | |
322 | home_region=re.escape(self.trail_home_region), | |
323 | name=re.escape(self.trail_name)) | |
346 | template = 'AWSLogs/' | |
347 | template_params = { | |
348 | 'account_id': re.escape(self.account_id), | |
349 | 'source_region': re.escape(self.trail_source_region), | |
350 | 'home_region': re.escape(self.trail_home_region), | |
351 | 'name': re.escape(self.trail_name) | |
352 | } | |
353 | if self.organization_id: | |
354 | template += '{organization_id}/' | |
355 | template_params['organization_id'] = self.organization_id | |
356 | template += ( | |
357 | '{account_id}/CloudTrail\\-Digest/{source_region}/' | |
358 | '\\d+/\\d+/\\d+/{account_id}_CloudTrail\\-Digest_' | |
359 | '{source_region}_{name}_{home_region}_.+\\.json\\.gz' | |
360 | ) | |
361 | key = template.format(**template_params) | |
324 | 362 | if key_prefix: |
325 | 363 | key = re.escape(key_prefix) + '/' + key |
326 | 364 | return '^' + key + '$' |
584 | 622 | log files. |
585 | 623 | - The digest and log files must not have been moved from the original S3 |
586 | 624 | location where CloudTrail delivered them. |
625 | - For organization trails you must have access to describe-organization to | |
626 | validate digest files | |
587 | 627 | |
588 | 628 | When you disable Log File Validation, the chain of digest files is broken |
589 | 629 | after one hour. CloudTrail will not digest log files that were delivered |
628 | 668 | 'digest files are stored. If not specified, the CLI ' |
629 | 669 | 'will determine the prefix automatically by calling ' |
630 | 670 | 'describe_trails.')}, |
671 | {'name': 'account-id', 'cli_type_name': 'string', | |
672 | 'help_text': ('Optionally specifies the account for validating logs. ' | |
673 | 'This parameter is needed for organization trails ' | |
674 | 'for validating logs for specific account inside an ' | |
675 | 'organization')}, | |
631 | 676 | {'name': 'verbose', 'cli_type_name': 'boolean', |
632 | 677 | 'action': 'store_true', |
633 | 678 | 'help_text': 'Display verbose log validation information'} |
643 | 688 | self.s3_prefix = None |
644 | 689 | self.s3_client_provider = None |
645 | 690 | self.cloudtrail_client = None |
691 | self.account_id = None | |
646 | 692 | self._source_region = None |
647 | 693 | self._valid_digests = 0 |
648 | 694 | self._invalid_digests = 0 |
665 | 711 | self.is_verbose = args.verbose |
666 | 712 | self.s3_bucket = args.s3_bucket |
667 | 713 | self.s3_prefix = args.s3_prefix |
714 | self.account_id = args.account_id | |
668 | 715 | self.start_time = normalize_date(parse_date(args.start_time)) |
669 | 716 | if args.end_time: |
670 | 717 | self.end_time = normalize_date(parse_date(args.end_time)) |
687 | 734 | self._session, self._source_region) |
688 | 735 | client_args = {'region_name': parsed_globals.region, |
689 | 736 | 'verify': parsed_globals.verify_ssl} |
737 | self.organization_client = self._session.create_client( | |
738 | 'organizations', **client_args) | |
739 | ||
690 | 740 | if parsed_globals.endpoint_url is not None: |
691 | 741 | client_args['endpoint_url'] = parsed_globals.endpoint_url |
692 | 742 | self.cloudtrail_client = self._session.create_client( |
695 | 745 | def _call(self): |
696 | 746 | traverser = create_digest_traverser( |
697 | 747 | trail_arn=self.trail_arn, cloudtrail_client=self.cloudtrail_client, |
748 | organization_client=self.organization_client, | |
698 | 749 | trail_source_region=self._source_region, |
699 | 750 | s3_client_provider=self.s3_client_provider, bucket=self.s3_bucket, |
700 | 751 | prefix=self.s3_prefix, on_missing=self._on_missing_digest, |
701 | on_invalid=self._on_invalid_digest, on_gap=self._on_digest_gap) | |
752 | on_invalid=self._on_invalid_digest, on_gap=self._on_digest_gap, | |
753 | account_id=self.account_id) | |
702 | 754 | self._write_startup_text() |
703 | 755 | digests = traverser.traverse(self.start_time, self.end_time) |
704 | 756 | for digest in digests: |
17 | 17 | |
18 | 18 | import colorama |
19 | 19 | |
20 | from awscli.table import COLORAMA_KWARGS | |
20 | 21 | from awscli.compat import six |
21 | 22 | from awscli.customizations.history.commands import HistorySubcommand |
22 | 23 | from awscli.customizations.history.filters import RegexFilter |
178 | 179 | self._colorize = colorize |
179 | 180 | self._value_pformatter = SectionValuePrettyFormatter() |
180 | 181 | if self._colorize: |
181 | colorama.init(autoreset=True, strip=False) | |
182 | colorama.init(**COLORAMA_KWARGS) | |
182 | 183 | |
183 | 184 | def _display(self, event_record): |
184 | 185 | section_definition = self._SECTIONS.get(event_record['event_type']) |
0 | **To delete a scheduled action** | |
1 | ||
2 | The follwing ``delete-scheduled-action`` example deletes the specified scheduled action from the specified Amazon AppStream 2.0 fleet:: | |
3 | ||
4 | aws application-autoscaling delete-scheduled-action \ | |
5 | --service-namespace appstream \ | |
6 | --scalable-dimension appstream:fleet:DesiredCapacity \ | |
7 | --resource-id fleet/sample-fleet \ | |
8 | --scheduled-action-name my-recurring-action | |
9 | ||
10 | This command produces no output. | |
11 | ||
12 | For more information, see `Scheduled Scaling <https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html>`__ in the *Application Auto Scaling User Guide*. |
0 | 0 | **To describe scalable targets** |
1 | 1 | |
2 | This example command describes the scalable targets for the `ecs` service namespace. | |
2 | The following ``describe-scalable-targets`` example command displays details for the the scalable targets for the ``ecs`` service namespace:: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws application-autoscaling describe-scalable-targets --service-namespace ecs | |
4 | aws application-autoscaling describe-scalable-targets \ | |
5 | --service-namespace ecs | |
7 | 6 | |
8 | 7 | Output:: |
9 | 8 | |
10 | { | |
11 | "ScalableTargets": [ | |
12 | { | |
13 | "ScalableDimension": "ecs:service:DesiredCount", | |
14 | "ResourceId": "service/default/web-app", | |
15 | "RoleARN": "arn:aws:iam::012345678910:role/ApplicationAutoscalingECSRole", | |
16 | "CreationTime": 1462558906.199, | |
17 | "MinCapacity": 1, | |
18 | "ServiceNamespace": "ecs", | |
19 | "MaxCapacity": 10 | |
20 | } | |
21 | ] | |
22 | } | |
9 | { | |
10 | "ScalableTargets": [ | |
11 | { | |
12 | "ScalableDimension": "ecs:service:DesiredCount", | |
13 | "ResourceId": "service/default/web-app", | |
14 | "RoleARN": "arn:aws:iam::123456789012:role/ApplicationAutoscalingECSRole", | |
15 | "SuspendedState": { | |
16 | "DynamicScalingOutSuspended": false, | |
17 | "ScheduledScalingSuspended": false, | |
18 | "DynamicScalingInSuspended": false | |
19 | }, | |
20 | "CreationTime": 1462558906.199, | |
21 | "MinCapacity": 1, | |
22 | "ServiceNamespace": "ecs", | |
23 | "MaxCapacity": 10 | |
24 | } | |
25 | ] | |
26 | } | |
27 | ||
28 | For more information, see `What Is Application Auto Scaling? <https://docs.aws.amazon.com/autoscaling/application/userguide/what-is-application-auto-scaling.html>`__ in the *Application Auto Scaling User Guide*. |
0 | **To describe scaling activities for a scalable target** | |
0 | **Example 1: To describe scaling activities for a scalable target** | |
1 | 1 | |
2 | This example describes the scaling activities for an Amazon ECS service called `web-app` that is running in the `default` cluster. | |
2 | The following ``describe-scaling-activities`` example displays details for th the scaling activities for an Amazon ECS service called `web-app` that is running in the `default` cluster. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws application-autoscaling describe-scaling-activities --service-namespace ecs --scalable-dimension ecs:service:DesiredCount --resource-id service/default/web-app | |
4 | aws application-autoscaling describe-scaling-activities \ | |
5 | --service-namespace ecs \ | |
6 | --scalable-dimension ecs:service:DesiredCount \ | |
7 | --resource-id service/default/web-app | |
7 | 8 | |
8 | 9 | Output:: |
9 | 10 | |
10 | { | |
11 | "ScalingActivities": [ | |
12 | { | |
13 | "ScalableDimension": "ecs:service:DesiredCount", | |
14 | "Description": "Setting desired count to 1.", | |
15 | "ResourceId": "service/default/web-app", | |
16 | "ActivityId": "e6c5f7d1-dbbb-4a3f-89b2-51f33e766399", | |
17 | "StartTime": 1462575838.171, | |
18 | "ServiceNamespace": "ecs", | |
19 | "EndTime": 1462575872.111, | |
20 | "Cause": "monitor alarm web-app-cpu-lt-25 in state ALARM triggered policy web-app-cpu-lt-25", | |
21 | "StatusMessage": "Successfully set desired count to 1. Change successfully fulfilled by ecs.", | |
22 | "StatusCode": "Successful" | |
23 | } | |
24 | ] | |
25 | }⏎ | |
11 | { | |
12 | "ScalingActivities": [ | |
13 | { | |
14 | "ScalableDimension": "ecs:service:DesiredCount", | |
15 | "Description": "Setting desired count to 1.", | |
16 | "ResourceId": "service/default/web-app", | |
17 | "ActivityId": "e6c5f7d1-dbbb-4a3f-89b2-51f33e766399", | |
18 | "StartTime": 1462575838.171, | |
19 | "ServiceNamespace": "ecs", | |
20 | "EndTime": 1462575872.111, | |
21 | "Cause": "monitor alarm web-app-cpu-lt-25 in state ALARM triggered policy web-app-cpu-lt-25", | |
22 | "StatusMessage": "Successfully set desired count to 1. Change successfully fulfilled by ecs.", | |
23 | "StatusCode": "Successful" | |
24 | } | |
25 | ] | |
26 | } | |
27 | ||
28 | **Example 2: To describe scaling activities triggered by scheduled actions** | |
29 | ||
30 | The following ``describe-scaling-activities`` example describes the scaling activities for the specified DynamoDB table. The output shows scaling activities triggered by two different scheduled actions:: | |
31 | ||
32 | aws application-autoscaling describe-scaling-activities \ | |
33 | --service-namespace dynamodb \ | |
34 | --scalable-dimension dynamodb:table:WriteCapacityUnits \ | |
35 | --resource-id table/my-table | |
36 | ||
37 | Output:: | |
38 | ||
39 | { | |
40 | "ScalingActivities": [ | |
41 | { | |
42 | "ScalableDimension": "dynamodb:table:WriteCapacityUnits", | |
43 | "Description": "Setting write capacity units to 10.", | |
44 | "ResourceId": "table/my-table", | |
45 | "ActivityId": "4d1308c0-bbcf-4514-a673-b0220ae38547", | |
46 | "StartTime": 1561574415.086, | |
47 | "ServiceNamespace": "dynamodb", | |
48 | "EndTime": 1561574449.51, | |
49 | "Cause": "maximum capacity was set to 10", | |
50 | "StatusMessage": "Successfully set write capacity units to 10. Change successfully fulfilled by dynamodb.", | |
51 | "StatusCode": "Successful" | |
52 | }, | |
53 | { | |
54 | "ScalableDimension": "dynamodb:table:WriteCapacityUnits", | |
55 | "Description": "Setting min capacity to 5 and max capacity to 10", | |
56 | "ResourceId": "table/my-table", | |
57 | "ActivityId": "f2b7847b-721d-4e01-8ef0-0c8d3bacc1c7", | |
58 | "StartTime": 1561574414.644, | |
59 | "ServiceNamespace": "dynamodb", | |
60 | "Cause": "scheduled action name my-second-scheduled-action was triggered", | |
61 | "StatusMessage": "Successfully set min capacity to 5 and max capacity to 10", | |
62 | "StatusCode": "Successful" | |
63 | }, | |
64 | { | |
65 | "ScalableDimension": "dynamodb:table:WriteCapacityUnits", | |
66 | "Description": "Setting write capacity units to 15.", | |
67 | "ResourceId": "table/my-table", | |
68 | "ActivityId": "d8ea4de6-9eaa-499f-b466-2cc5e681ba8b", | |
69 | "StartTime": 1561574108.904, | |
70 | "ServiceNamespace": "dynamodb", | |
71 | "EndTime": 1561574140.255, | |
72 | "Cause": "minimum capacity was set to 15", | |
73 | "StatusMessage": "Successfully set write capacity units to 15. Change successfully fulfilled by dynamodb.", | |
74 | "StatusCode": "Successful" | |
75 | }, | |
76 | { | |
77 | "ScalableDimension": "dynamodb:table:WriteCapacityUnits", | |
78 | "Description": "Setting min capacity to 15 and max capacity to 20", | |
79 | "ResourceId": "table/my-table", | |
80 | "ActivityId": "3250fd06-6940-4e8e-bb1f-d494db7554d2", | |
81 | "StartTime": 1561574108.512, | |
82 | "ServiceNamespace": "dynamodb", | |
83 | "Cause": "scheduled action name my-first-scheduled-action was triggered", | |
84 | "StatusMessage": "Successfully set min capacity to 15 and max capacity to 20", | |
85 | "StatusCode": "Successful" | |
86 | } | |
87 | ] | |
88 | } | |
89 | ||
90 | For more information, see `Scheduled Scaling <https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html>`__ in the *Application Auto Scaling User Guide*. |
0 | **To describe scheduled actions** | |
1 | ||
2 | The following ``describe-scheduled-actions`` example displays details for the scheduled actions for the specified service namespace:: | |
3 | ||
4 | aws application-autoscaling describe-scheduled-actions \ | |
5 | --service-namespace dynamodb | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ScheduledActions": [ | |
11 | { | |
12 | "ScalableDimension": "dynamodb:table:WriteCapacityUnits", | |
13 | "Schedule": "at(2019-05-20T18:35:00)", | |
14 | "ResourceId": "table/my-table", | |
15 | "CreationTime": 1561571888.361, | |
16 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledAction:2d36aa3b-cdf9-4565-b290-81db519b227d:resource/dynamodb/table/my-table:scheduledActionName/my-first-scheduled-action", | |
17 | "ScalableTargetAction": { | |
18 | "MinCapacity": 15, | |
19 | "MaxCapacity": 20 | |
20 | }, | |
21 | "ScheduledActionName": "my-first-scheduled-action", | |
22 | "ServiceNamespace": "dynamodb" | |
23 | }, | |
24 | { | |
25 | "ScalableDimension": "dynamodb:table:WriteCapacityUnits", | |
26 | "Schedule": "at(2019-05-20T18:40:00)", | |
27 | "ResourceId": "table/my-table", | |
28 | "CreationTime": 1561571946.021, | |
29 | "ScheduledActionARN": "arn:aws:autoscaling:us-west-2:123456789012:scheduledAction:2d36aa3b-cdf9-4565-b290-81db519b227d:resource/dynamodb/table/my-table:scheduledActionName/my-second-scheduled-action", | |
30 | "ScalableTargetAction": { | |
31 | "MinCapacity": 5, | |
32 | "MaxCapacity": 10 | |
33 | }, | |
34 | "ScheduledActionName": "my-second-scheduled-action", | |
35 | "ServiceNamespace": "dynamodb" | |
36 | } | |
37 | ] | |
38 | } | |
39 | ||
40 | For more information, see `Scheduled Scaling <https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-scheduled-scaling.html>`__ in the *Application Auto Scaling User Guide*. |
81 | 81 | ] |
82 | 82 | } |
83 | 83 | |
84 | **Example 3: To apply a target tracking scaling policy for scale out only** | |
85 | ||
86 | The following ``put-scaling-policy`` example applies a target tracking scaling policy to an Amazon ECS service called ``web-app`` in the default cluster. The policy is used to scale out the ECS service when the ``RequestCountPerTarget`` metric from the Application Load Balancer exceeds the threshold. The output contains the ARN and name of the CloudWatch alarm created on your behalf. :: | |
87 | ||
88 | aws application-autoscaling put-scaling-policy \ | |
89 | --service-namespace ecs \ | |
90 | --scalable-dimension ecs:service:DesiredCount \ | |
91 | --resource-id service/default/web-app \ | |
92 | --policy-name alb-scale-out-target-tracking-scaling-policy \ | |
93 | --policy-type TargetTrackingScaling \ | |
94 | --target-tracking-scaling-policy-configuration file://config.json | |
95 | ||
96 | Contents of ``config.json``:: | |
97 | ||
98 | { | |
99 | "TargetValue": 1000.0, | |
100 | "PredefinedMetricSpecification": { | |
101 | "PredefinedMetricType": "ALBRequestCountPerTarget", | |
102 | "ResourceLabel": "app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d" | |
103 | }, | |
104 | "ScaleOutCooldown": 60, | |
105 | "ScaleInCooldown": 60, | |
106 | "DisableScaleIn": true | |
107 | } | |
108 | ||
109 | Output:: | |
110 | ||
111 | { | |
112 | "PolicyARN": "arn:aws:autoscaling:us-west-2:123456789012:scalingPolicy:6d8972f3-efc8-437c-92d1-6270f29a66e7:resource/ecs/service/default/web-app:policyName/alb-scale-out-target-tracking-scaling-policy", | |
113 | "Alarms": [ | |
114 | { | |
115 | "AlarmName": "TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca", | |
116 | "AlarmARN": "arn:aws:cloudwatch:us-west-2:123456789012:alarm:TargetTracking-service/default/web-app-AlarmHigh-d4f0770c-b46e-434a-a60f-3b36d653feca" | |
117 | } | |
118 | ] | |
119 | } | |
120 | ||
84 | 121 | For more information, see `Target Tracking Scaling Policies for Application Auto Scaling <https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html>`_ in the *AWS Application Auto Scaling User Guide*. |
0 | 0 | **Example 1: To create a new route with weighting** |
1 | 1 | |
2 | The following ``create-route`` example uses a JSON input file to create a route with weighted targets. :: | |
2 | The following ``create-route`` example uses a `JSON input file <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-skeleton.html>`__ to create a route with weighted targets. :: | |
3 | 3 | |
4 | 4 | aws appmesh create-route \ |
5 | 5 | --cli-input-json file://create-route-weighted.json |
74 | 74 | |
75 | 75 | **Example 2: To create a new route with path-based routing** |
76 | 76 | |
77 | The following ``create-route`` example uses a JSON input file to create a route with path-based routing. :: | |
77 | The following ``create-route`` example uses a `JSON input file <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-skeleton.html>`__ to create a route with path-based routing. :: | |
78 | 78 | |
79 | 79 | aws appmesh create-route \ |
80 | 80 | --cli-input-json file://create-route-path.json |
138 | 138 | } |
139 | 139 | |
140 | 140 | For more information, see `Path-based Routing <https://docs.aws.amazon.com/app-mesh/latest/userguide/route-path.html>`__ in the *AWS App Mesh User Guide*. |
141 | ||
142 | **Example 3: To create a new route based on an HTTP header** | |
143 | ||
144 | The following ``create-route`` example uses a `JSON input file <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-skeleton.html>`__ to create a route that will route all requests to ``serviceB`` that have any path prefix in an HTTPS post where the ``clientRequestId`` header has a prefix of ``123``:: | |
145 | ||
146 | aws appmesh create-route \ | |
147 | --cli-input-json file://create-route-headers.json | |
148 | ||
149 | Contents of ``create-route-headers.json``:: | |
150 | ||
151 | { | |
152 | "meshName" : "app1", | |
153 | "routeName" : "route-headers", | |
154 | "spec" : { | |
155 | "httpRoute" : { | |
156 | "action" : { | |
157 | "weightedTargets" : [ | |
158 | { | |
159 | "virtualNode" : "serviceB", | |
160 | "weight" : 100 | |
161 | } | |
162 | ] | |
163 | }, | |
164 | "match" : { | |
165 | "headers" : [ | |
166 | { | |
167 | "invert" : false, | |
168 | "match" : { | |
169 | "prefix" : "123" | |
170 | }, | |
171 | "name" : "clientRequestId" | |
172 | } | |
173 | ], | |
174 | "method" : "POST", | |
175 | "prefix" : "/", | |
176 | "scheme" : "https" | |
177 | } | |
178 | } | |
179 | }, | |
180 | "virtualRouterName" : "virtual-router1" | |
181 | } | |
182 | ||
183 | Output:: | |
184 | ||
185 | { | |
186 | "route": { | |
187 | "meshName": "app1", | |
188 | "metadata": { | |
189 | "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/app1/virtualRouter/virtual-router1/route/route-headers", | |
190 | "createdAt": 1565963028.608, | |
191 | "lastUpdatedAt": 1565963028.608, | |
192 | "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE", | |
193 | "version": 1 | |
194 | }, | |
195 | "routeName": "route-headers", | |
196 | "spec": { | |
197 | "httpRoute": { | |
198 | "action": { | |
199 | "weightedTargets": [ | |
200 | { | |
201 | "virtualNode": "serviceB", | |
202 | "weight": 100 | |
203 | } | |
204 | ] | |
205 | }, | |
206 | "match": { | |
207 | "headers": [ | |
208 | { | |
209 | "invert": false, | |
210 | "match": { | |
211 | "prefix": "123" | |
212 | }, | |
213 | "name": "clientRequestId" | |
214 | } | |
215 | ], | |
216 | "method": "POST", | |
217 | "prefix": "/", | |
218 | "scheme": "https" | |
219 | } | |
220 | } | |
221 | }, | |
222 | "status": { | |
223 | "status": "ACTIVE" | |
224 | }, | |
225 | "virtualRouterName": "virtual-router1" | |
226 | } | |
227 | } | |
228 | ||
229 | For more information, see `HTTP Headers <https://docs.aws.amazon.com/app-mesh/latest/userguide/route-http-headers.html>`__ in the *AWS App Mesh User Guide*. | |
230 | ||
231 | **Example 4: To create a new route with a retry policy** | |
232 | ||
233 | The following ``create-route`` example uses a JSON input file to create a route with a retry policy.:: | |
234 | ||
235 | aws appmesh create-route \ | |
236 | --cli-input-json file://create-route-retry-policy.json | |
237 | ||
238 | Contents of ``create-route-retry-policy.json``:: | |
239 | ||
240 | { | |
241 | "meshName": "App1", | |
242 | "routeName": "Route-retries1", | |
243 | "spec": { | |
244 | "httpRoute": { | |
245 | "action": { | |
246 | "weightedTargets": [ | |
247 | { | |
248 | "virtualNode": "ServiceB", | |
249 | "weight": 100 | |
250 | } | |
251 | ] | |
252 | }, | |
253 | "match": { | |
254 | "prefix": "/" | |
255 | }, | |
256 | "retryPolicy": { | |
257 | "perRetryTimeout": { | |
258 | "value": 15, | |
259 | "unit": "s" | |
260 | }, | |
261 | "maxRetries": 3, | |
262 | "httpRetryEvents": [ | |
263 | "server-error", | |
264 | "gateway-error" | |
265 | ], | |
266 | "tcpRetryEvents": [ | |
267 | "connection-error" | |
268 | ] | |
269 | } | |
270 | } | |
271 | }, | |
272 | "virtualRouterName": "Virtual-router1" | |
273 | } | |
274 | ||
275 | Output:: | |
276 | ||
277 | { | |
278 | "route": { | |
279 | "meshName": "App1", | |
280 | "metadata": { | |
281 | "arn": "arn:aws:appmesh:us-east-1:123456789012:mesh/App1/virtualRouter/Virtual-router1/route/Route-retries1", | |
282 | "createdAt": 1568142345.942, | |
283 | "lastUpdatedAt": 1568142345.942, | |
284 | "uid": "a1b2c3d4-5678-90ab-cdef-11111EXAMPLE", | |
285 | "version": 1 | |
286 | }, | |
287 | "routeName": "Route-retries1", | |
288 | "spec": { | |
289 | "httpRoute": { | |
290 | "action": { | |
291 | "weightedTargets": [ | |
292 | { | |
293 | "virtualNode": "ServiceB", | |
294 | "weight": 100 | |
295 | } | |
296 | ] | |
297 | }, | |
298 | "match": { | |
299 | "prefix": "/" | |
300 | }, | |
301 | "retryPolicy": { | |
302 | "httpRetryEvents": [ | |
303 | "server-error", | |
304 | "gateway-error" | |
305 | ], | |
306 | "maxRetries": 3, | |
307 | "perRetryTimeout": { | |
308 | "unit": "s", | |
309 | "value": 15 | |
310 | }, | |
311 | "tcpRetryEvents": [ | |
312 | "connection-error" | |
313 | ] | |
314 | } | |
315 | } | |
316 | }, | |
317 | "status": { | |
318 | "status": "ACTIVE" | |
319 | }, | |
320 | "virtualRouterName": "Virtual-router1" | |
321 | } | |
322 | } | |
323 | ||
324 | For more information, see `Retry Policy <https://docs.aws.amazon.com/app-mesh/latest/userguide/route-retry-policy.html>`__ in the *AWS App Mesh User Guide*. |
7 | 7 | Contents of ``update-mesh.json``:: |
8 | 8 | |
9 | 9 | { |
10 | "clientToken": "500", | |
11 | 10 | "meshName": "app1", |
12 | 11 | "spec": { |
13 | 12 | "egressFilter": { |
0 | **To describe the scalable resources for a scaling plan** | |
1 | ||
2 | The following ``describe-scaling-plan-resources`` example displays details about the single scalable resource (an Auto Scaling group) that is associated with the specified scaling plan. :: | |
3 | ||
4 | aws autoscaling-plans describe-scaling-plan-resources \ | |
5 | --scaling-plan-name my-scaling-plan \ | |
6 | --scaling-plan-version 1 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "ScalingPlanResources": [ | |
12 | { | |
13 | "ScalableDimension": "autoscaling:autoScalingGroup:DesiredCapacity", | |
14 | "ScalingPlanVersion": 1, | |
15 | "ResourceId": "autoScalingGroup/my-asg", | |
16 | "ScalingStatusCode": "Active", | |
17 | "ScalingStatusMessage": "Target tracking scaling policies have been applied to the resource.", | |
18 | "ScalingPolicies": [ | |
19 | { | |
20 | "PolicyName": "AutoScaling-my-asg-b1ab65ae-4be3-4634-bd64-c7471662b251", | |
21 | "PolicyType": "TargetTrackingScaling", | |
22 | "TargetTrackingConfiguration": { | |
23 | "PredefinedScalingMetricSpecification": { | |
24 | "PredefinedScalingMetricType": "ALBRequestCountPerTarget", | |
25 | "ResourceLabel": "app/my-alb/f37c06a68c1748aa/targetgroup/my-target-group/6d4ea56ca2d6a18d" | |
26 | }, | |
27 | "TargetValue": 40.0 | |
28 | } | |
29 | } | |
30 | ], | |
31 | "ServiceNamespace": "autoscaling", | |
32 | "ScalingPlanName": "my-scaling-plan" | |
33 | } | |
34 | ] | |
35 | } | |
36 | ||
37 | For more information, see `What Is AWS Auto Scaling? <https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html>`__ in the *AWS Auto Scaling User Guide*. |
0 | **To describe a scaling plan** | |
1 | ||
2 | The following ``describe-scaling-plans`` example displays the details of the specified scaling plan. :: | |
3 | ||
4 | aws autoscaling-plans describe-scaling-plans \ | |
5 | --scaling-plan-names scaling-plan-with-asg-and-ddb | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ScalingPlans": [ | |
11 | { | |
12 | "LastMutatingRequestTime": 1565388443.963, | |
13 | "ScalingPlanVersion": 1, | |
14 | "CreationTime": 1565388443.963, | |
15 | "ScalingInstructions": [ | |
16 | { | |
17 | "ScalingPolicyUpdateBehavior": "ReplaceExternalPolicies", | |
18 | "ScalableDimension": "autoscaling:autoScalingGroup:DesiredCapacity", | |
19 | "TargetTrackingConfigurations": [ | |
20 | { | |
21 | "PredefinedScalingMetricSpecification": { | |
22 | "PredefinedScalingMetricType": "ASGAverageCPUUtilization" | |
23 | }, | |
24 | "TargetValue": 50.0, | |
25 | "EstimatedInstanceWarmup": 300, | |
26 | "DisableScaleIn": false | |
27 | } | |
28 | ], | |
29 | "ResourceId": "autoScalingGroup/my-asg", | |
30 | "DisableDynamicScaling": false, | |
31 | "MinCapacity": 1, | |
32 | "ServiceNamespace": "autoscaling", | |
33 | "MaxCapacity": 10 | |
34 | }, | |
35 | { | |
36 | "ScalingPolicyUpdateBehavior": "ReplaceExternalPolicies", | |
37 | "ScalableDimension": "dynamodb:table:ReadCapacityUnits", | |
38 | "TargetTrackingConfigurations": [ | |
39 | { | |
40 | "PredefinedScalingMetricSpecification": { | |
41 | "PredefinedScalingMetricType": "DynamoDBReadCapacityUtilization" | |
42 | }, | |
43 | "TargetValue": 50.0, | |
44 | "ScaleInCooldown": 60, | |
45 | "DisableScaleIn": false, | |
46 | "ScaleOutCooldown": 60 | |
47 | } | |
48 | ], | |
49 | "ResourceId": "table/my-table", | |
50 | "DisableDynamicScaling": false, | |
51 | "MinCapacity": 5, | |
52 | "ServiceNamespace": "dynamodb", | |
53 | "MaxCapacity": 10000 | |
54 | }, | |
55 | { | |
56 | "ScalingPolicyUpdateBehavior": "ReplaceExternalPolicies", | |
57 | "ScalableDimension": "dynamodb:table:WriteCapacityUnits", | |
58 | "TargetTrackingConfigurations": [ | |
59 | { | |
60 | "PredefinedScalingMetricSpecification": { | |
61 | "PredefinedScalingMetricType": "DynamoDBWriteCapacityUtilization" | |
62 | }, | |
63 | "TargetValue": 50.0, | |
64 | "ScaleInCooldown": 60, | |
65 | "DisableScaleIn": false, | |
66 | "ScaleOutCooldown": 60 | |
67 | } | |
68 | ], | |
69 | "ResourceId": "table/my-table", | |
70 | "DisableDynamicScaling": false, | |
71 | "MinCapacity": 5, | |
72 | "ServiceNamespace": "dynamodb", | |
73 | "MaxCapacity": 10000 | |
74 | } | |
75 | ], | |
76 | "ApplicationSource": { | |
77 | "TagFilters": [ | |
78 | { | |
79 | "Values": [ | |
80 | "my-application-id" | |
81 | ], | |
82 | "Key": "application" | |
83 | } | |
84 | ] | |
85 | }, | |
86 | "StatusStartTime": 1565388455.836, | |
87 | "ScalingPlanName": "scaling-plan-with-asg-and-ddb", | |
88 | "StatusMessage": "Scaling plan has been created and applied to all resources.", | |
89 | "StatusCode": "Active" | |
90 | } | |
91 | ] | |
92 | } | |
93 | ||
94 | For more information, see `What Is AWS Auto Scaling? <https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html>`__ in the *AWS Auto Scaling User Guide*. |
0 | **To retrieve load forecast data** | |
1 | ||
2 | This example retrieves load forecast data for a scalable resource (an Auto Scaling group) that is associated with the specified scaling plan. :: | |
3 | ||
4 | aws autoscaling-plans get-scaling-plan-resource-forecast-data \ | |
5 | --scaling-plan-name my-scaling-plan \ | |
6 | --scaling-plan-version 1 \ | |
7 | --service-namespace "autoscaling" \ | |
8 | --resource-id autoScalingGroup/my-asg \ | |
9 | --scalable-dimension "autoscaling:autoScalingGroup:DesiredCapacity" \ | |
10 | --forecast-data-type "LoadForecast" \ | |
11 | --start-time "2019-08-30T00:00:00Z" \ | |
12 | --end-time "2019-09-06T00:00:00Z" | |
13 | ||
14 | Output:: | |
15 | ||
16 | { | |
17 | "Datapoints": [...] | |
18 | } | |
19 | ||
20 | For more information, see `What Is AWS Auto Scaling <https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html>`__ in the *AWS Auto Scaling User Guide*. |
0 | **To update a scaling plan** | |
1 | ||
2 | The following ``update-scaling-plan`` example modifies the scaling metric for an Auto Scaling group in the specified scaling plan. :: | |
3 | ||
4 | aws autoscaling-plans update-scaling-plan \ | |
5 | --scaling-plan-name my-scaling-plan \ | |
6 | --scaling-plan-version 1 \ | |
7 | --scaling-instructions '{"ScalableDimension":"autoscaling:autoScalingGroup:DesiredCapacity","ResourceId":"autoScalingGroup/my-asg","ServiceNamespace":"autoscaling","TargetTrackingConfigurations":[{"PredefinedScalingMetricSpecification": {"PredefinedScalingMetricType":"ALBRequestCountPerTarget","ResourceLabel":"app/my-alb/f37c06a68c1748aa/targetgroup/my-target-group/6d4ea56ca2d6a18d"},"TargetValue":40.0}],"MinCapacity": 1,"MaxCapacity": 10}' | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `What Is AWS Auto Scaling? <https://docs.aws.amazon.com/autoscaling/plans/userguide/what-is-aws-auto-scaling.html>`__ in the *AWS Auto Scaling User Guide*. |
0 | **To create a backup plan** | |
1 | ||
2 | The following ``create-backup-plan`` example creates the specified backup plan with a 35 day retention. :: | |
3 | ||
4 | aws backup create-backup-plan \ | |
5 | --backup-plan "{\"BackupPlanName\":\"Example-Backup-Plan\",\"Rules\":[{\"RuleName\":\"DailyBackups\",\"ScheduleExpression\":\"cron(0 5 ? * * *)\",\"StartWindowMinutes\":480,\"TargetBackupVaultName\":\"Default\",\"Lifecycle\":{\"DeleteAfterDays\":35}}]}" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "BackupPlanId": "1fa3895c-a7f5-484a-a371-2dd6a1a9f729", | |
11 | "BackupPlanArn": "arn:aws:backup:us-west-2:123456789012:backup-plan:1fa3895c-a7f5-484a-a371-2dd6a1a9f729", | |
12 | "CreationDate": 1568928754.747, | |
13 | "VersionId": "ZjQ2ZTI5YWQtZDg5Yi00MzYzLWJmZTAtMDI1MzhlMDhjYjEz" | |
14 | } | |
15 | ||
16 | For more information, see `Creating a Backup Plan <https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-backup-plan.html>`__ in the *AWS Backup Developer Guide*. |
0 | **To create a backup vault** | |
1 | ||
2 | The following ``create-backup-vault`` example creates a backup vault with the specified name. :: | |
3 | ||
4 | aws backup create-backup-vault | |
5 | --backup-vault-name sample-vault | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "BackupVaultName": "sample-vault", | |
12 | "BackupVaultArn": "arn:aws:backup:us-west-2:123456789012:backup-vault:sample-vault", | |
13 | "CreationDate": 1568928338.385 | |
14 | } | |
15 | ||
16 | For more information, see `Creating a Backup Vault <https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-vault.html>`__ in the *AWS Backup Developer Guide*. |
0 | **To get an existing backup plan from a template** | |
1 | ||
2 | The following ``get-backup-plan-from-template`` example gets an existing backup plan from a template that specifies a daily backup with a 35 day retention. :: | |
3 | ||
4 | aws backup get-backup-plan-from-template \ | |
5 | --backup-plan-template-id "87c0c1ef-254d-4180-8fef-2e76a2c38aaa" | |
6 | ||
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "BackupPlanDocument": { | |
12 | "Rules": [ | |
13 | { | |
14 | "RuleName": "DailyBackups", | |
15 | "ScheduleExpression": "cron(0 5 ? * * *)", | |
16 | "StartWindowMinutes": 480, | |
17 | "Lifecycle": { | |
18 | "DeleteAfterDays": 35 | |
19 | } | |
20 | } | |
21 | ] | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Creating a Backup Plan <https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-backup-plan.html>`__ in the *AWS Backup Developer Guide*. |
0 | **To get the details of a backup plan** | |
1 | ||
2 | The following ``get-backup-plan`` example displays the details of the specified backup plan. :: | |
3 | ||
4 | aws backup get-backup-plan \ | |
5 | --backup-plan-id "fcbf5d8f-bd77-4f3a-9c97-f24fb3d373a5" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "BackupPlan": { | |
11 | "BackupPlanName": "Example-Backup-Plan", | |
12 | "Rules": [ | |
13 | { | |
14 | "RuleName": "DailyBackups", | |
15 | "TargetBackupVaultName": "Default", | |
16 | "ScheduleExpression": "cron(0 5 ? * * *)", | |
17 | "StartWindowMinutes": 480, | |
18 | "CompletionWindowMinutes": 10080, | |
19 | "Lifecycle": { | |
20 | "DeleteAfterDays": 35 | |
21 | }, | |
22 | "RuleId": "70e0ccdc-e9df-4e83-82ad-c1e5a9471cc3" | |
23 | } | |
24 | ] | |
25 | }, | |
26 | "BackupPlanId": "fcbf5d8f-bd77-4f3a-9c97-f24fb3d373a5", | |
27 | "BackupPlanArn": "arn:aws:backup:us-west-2:123456789012:backup-plan:fcbf5d8f-bd77-4f3a-9c97-f24fb3d373a5", | |
28 | "VersionId": "NjQ2ZTZkODktMGVhNy00MmQ0LWE4YjktZTkwNTQ3OTkyYTcw", | |
29 | "CreationDate": 1568926091.57 | |
30 | } | |
31 | ||
32 | For more information, see `Creating a Backup Plan <https://docs.aws.amazon.com/aws-backup/latest/devguide/creating-a-backup-plan.html>`__ in the *AWS Backup Developer Guide*. |
0 | **To associate a phone number with a user** | |
1 | ||
2 | The following ``associate-phone-number-with-user`` example associates the specified phone number with a user. :: | |
3 | ||
4 | aws chime associate-phone-number-with-user \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \ | |
6 | --user-id 1ab2345c-67de-8901-f23g-45h678901j2k \ | |
7 | --e164-phone-number "+12065550100" | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Managing User Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/user-phone.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To associate phone numbers with an Amazon Chime Voice Connector** | |
1 | ||
2 | The following ``associate-phone-numbers-with-voice-connector`` example associates the specified phone numbers with an Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime associate-phone-numbers-with-voice-connector \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 \ | |
6 | --e164-phone-numbers "+12065550100" "+12065550101" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "PhoneNumberErrors": [] | |
12 | } | |
13 | ||
14 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To delete multiple phone numbers** | |
1 | ||
2 | The following ``batch-delete-phone-number`` example deletes all of the specified phone numbers. :: | |
3 | ||
4 | aws chime batch-delete-phone-number \ | |
5 | --phone-number-ids "%2B12065550100" "%2B12065550101" | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "PhoneNumberErrors": [] | |
12 | } | |
13 | ||
14 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To update several phone numbers at the same time** | |
1 | ||
2 | The following ``batch-update-phone-number`` example updates the product types for all of the specified phone numbers. :: | |
3 | ||
4 | aws chime batch-update-phone-number \ | |
5 | --update-phone-number-request-items PhoneNumberId=%2B12065550100,ProductType=BusinessCalling PhoneNumberId=%2B12065550101,ProductType=BusinessCalling | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "PhoneNumberErrors": [] | |
11 | } | |
12 | ||
13 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To create an Amazon Chime bot** | |
1 | ||
2 | The following ``create-bot`` example creates a bot for the specified Amazon Chime Enterprise account. :: | |
3 | ||
4 | aws chime create-bot \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \ | |
6 | --display-name "myBot" \ | |
7 | --domain "example.com" | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Bot": { | |
13 | "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
14 | "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
15 | "DisplayName": "myBot (Bot)", | |
16 | "BotType": "ChatBot", | |
17 | "Disabled": false, | |
18 | "CreatedTimestamp": "2019-09-09T18:05:56.749Z", | |
19 | "UpdatedTimestamp": "2019-09-09T18:05:56.749Z", | |
20 | "BotEmail": "myBot-chimebot@example.com", | |
21 | "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Integrate a Chat Bot with Amazon Chime <https://docs.aws.amazon.com/chime/latest/dg/integrate-bots.html>`__ in the *Amazon Chime Developer Guide*. |
0 | **To create a phone number order** | |
1 | ||
2 | The following ``create-phone-number-order`` example creates a phone number order for the specified phone numbers. :: | |
3 | ||
4 | aws chime create-phone-number-order \ | |
5 | --product-type VoiceConnector \ | |
6 | --e164-phone-numbers "+12065550100" "+12065550101" "+12065550102" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "PhoneNumberOrder": { | |
12 | "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012", | |
13 | "ProductType": "VoiceConnector", | |
14 | "Status": "Processing", | |
15 | "OrderedPhoneNumbers": [ | |
16 | { | |
17 | "E164PhoneNumber": "+12065550100", | |
18 | "Status": "Processing" | |
19 | }, | |
20 | { | |
21 | "E164PhoneNumber": "+12065550101", | |
22 | "Status": "Processing" | |
23 | }, | |
24 | { | |
25 | "E164PhoneNumber": "+12065550102", | |
26 | "Status": "Processing" | |
27 | } | |
28 | ], | |
29 | "CreatedTimestamp": "2019-08-09T21:35:21.427Z", | |
30 | "UpdatedTimestamp": "2019-08-09T21:35:22.408Z" | |
31 | } | |
32 | } | |
33 | ||
34 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To create an Amazon Chime Voice Connector** | |
1 | ||
2 | The following ``create-voice-connector`` example creates an Amazon Chime Voice Connector with encryption enabled. :: | |
3 | ||
4 | aws chime create-voice-connector \ | |
5 | --name Test \ | |
6 | --require-encryption | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "VoiceConnector": { | |
12 | "VoiceConnectorId": "abcdef1ghij2klmno3pqr4", | |
13 | "Name": "Test", | |
14 | "OutboundHostName": "abcdef1ghij2klmno3pqr4.voiceconnector.chime.aws", | |
15 | "RequireEncryption": true, | |
16 | "CreatedTimestamp": "2019-06-04T18:46:56.508Z", | |
17 | "UpdatedTimestamp": "2019-06-04T18:46:56.508Z" | |
18 | } | |
19 | } | |
20 | ||
21 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To delete a phone number** | |
1 | ||
2 | The following ``delete-phone-number`` example moves the specified phone number into the deletion queue. :: | |
3 | ||
4 | aws chime delete-phone-number \ | |
5 | --phone-number-id "+12065550100" | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To delete origination settings** | |
1 | ||
2 | The following ``delete-voice-connector-origination`` example deletes the origination host, port, protocol, priority, and weight from the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime delete-voice-connector-origination \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To delete termination credentials** | |
1 | ||
2 | The following ``delete-voice-connector-termination-credentials`` example deletes the termination credentials for the specified user name and Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime delete-voice-connector-termination-credentials \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 \ | |
6 | --usernames "jdoe" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To delete termination settings** | |
1 | ||
2 | The following ``delete-voice-connector-termination`` example deletes the termination settings for the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime delete-voice-connector-termination \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To delete an Amazon Chime Voice Connector** | |
1 | ||
2 | The following ``delete-voice-connector`` example doesthis :: | |
3 | ||
4 | aws chime delete-voice-connector \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To disassociate a phone number from a user** | |
1 | ||
2 | The following ``disassociate-phone-number-from-user`` example disassociates a phone number from the specified user. :: | |
3 | ||
4 | aws chime disassociate-phone-number-from-user \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \ | |
6 | --user-id 1ab2345c-67de-8901-f23g-45h678901j2k | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Managing User Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/user-phone.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To disassociate phone numbers from an Amazon Chime Voice Connector** | |
1 | ||
2 | The following ``disassociate-phone-numbers-from-voice-connector`` example disassociates the specified phone numbers from an Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime disassociate-phone-numbers-from-voice-connector \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 \ | |
6 | --e164-phone-numbers "+12065550100" "+12065550101" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "PhoneNumberErrors": [] | |
12 | } | |
13 | ||
14 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To retrieve details about a bot** | |
1 | ||
2 | The following ``get-bot`` example displays the details for the specified bot. :: | |
3 | ||
4 | aws chime get-bot \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \ | |
6 | --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Bot": { | |
12 | "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
13 | "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
14 | "DisplayName": "myBot (Bot)", | |
15 | "BotType": "ChatBot", | |
16 | "Disabled": false, | |
17 | "CreatedTimestamp": "2019-09-09T18:05:56.749Z", | |
18 | "UpdatedTimestamp": "2019-09-09T18:05:56.749Z", | |
19 | "BotEmail": "myBot-chimebot@example.com", | |
20 | "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Update Chat Bots <https://docs.aws.amazon.com/chime/latest/dg/update-bots.html>`__ in the *Amazon Chime Developer Guide*. |
0 | **To get global settings** | |
1 | ||
2 | The following ``get-global-settings`` example retrieves the S3 bucket names used to store call detail records for Amazon Chime Business Calling and Amazon Chime Voice Connectors associated with the administrator's AWS account. :: | |
3 | ||
4 | aws chime get-global-settings | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "BusinessCalling": { | |
10 | "CdrBucket": "s3bucket" | |
11 | }, | |
12 | "VoiceConnector": { | |
13 | "CdrBucket": "s3bucket" | |
14 | } | |
15 | } | |
16 | ||
17 | For more information, see `Managing Global Settings <https://docs.aws.amazon.com/chime/latest/ag/manage-global.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To get details for a phone number order** | |
1 | ||
2 | The following ``get-phone-number-order`` example displays the details of the specified phone number order. :: | |
3 | ||
4 | aws chime get-phone-number-order \ | |
5 | --phone-number-order-id abc12345-de67-89f0-123g-h45i678j9012 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "PhoneNumberOrder": { | |
11 | "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012", | |
12 | "ProductType": "VoiceConnector", | |
13 | "Status": "Partial", | |
14 | "OrderedPhoneNumbers": [ | |
15 | { | |
16 | "E164PhoneNumber": "+12065550100", | |
17 | "Status": "Acquired" | |
18 | }, | |
19 | { | |
20 | "E164PhoneNumber": "+12065550101", | |
21 | "Status": "Acquired" | |
22 | }, | |
23 | { | |
24 | "E164PhoneNumber": "+12065550102", | |
25 | "Status": "Failed" | |
26 | } | |
27 | ], | |
28 | "CreatedTimestamp": "2019-08-09T21:35:21.427Z", | |
29 | "UpdatedTimestamp": "2019-08-09T21:35:31.926Z" | |
30 | } | |
31 | } | |
32 | ||
33 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To get phone number details** | |
1 | ||
2 | The following ``get-phone-number`` example displays the details of the specified phone number. :: | |
3 | ||
4 | aws chime get-phone-number \ | |
5 | --phone-number-id +12065550100 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "PhoneNumber": { | |
11 | "PhoneNumberId": "%2B12065550100", | |
12 | "E164PhoneNumber": "+12065550100", | |
13 | "Type": "Local", | |
14 | "ProductType": "VoiceConnector", | |
15 | "Status": "Unassigned", | |
16 | "Capabilities": { | |
17 | "InboundCall": true, | |
18 | "OutboundCall": true, | |
19 | "InboundSMS": true, | |
20 | "OutboundSMS": true, | |
21 | "InboundMMS": true, | |
22 | "OutboundMMS": true | |
23 | }, | |
24 | "Associations": [], | |
25 | "CreatedTimestamp": "2019-08-09T21:35:21.445Z", | |
26 | "UpdatedTimestamp": "2019-08-09T21:35:31.745Z" | |
27 | } | |
28 | } | |
29 | ||
30 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To retrieve user settings** | |
1 | ||
2 | The following ``get-user-settings`` example displays the specified user settings. :: | |
3 | ||
4 | aws chime get-user-settings \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \ | |
6 | --user-id 1ab2345c-67de-8901-f23g-45h678901j2k | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "UserSettings": { | |
12 | "Telephony": { | |
13 | "InboundCalling": true, | |
14 | "OutboundCalling": true, | |
15 | "SMS": true | |
16 | } | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Managing User Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/user-phone.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To retrieve origination settings** | |
1 | ||
2 | The following ``get-voice-connector-origination`` example retrieves the origination host, port, protocol, priority, and weight for the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime get-voice-connector-origination \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Origination": { | |
11 | "Routes": [ | |
12 | { | |
13 | "Host": "10.24.34.0", | |
14 | "Port": 1234, | |
15 | "Protocol": "TCP", | |
16 | "Priority": 1, | |
17 | "Weight": 5 | |
18 | } | |
19 | ], | |
20 | "Disabled": false | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To retrieve termination health details** | |
1 | ||
2 | The following ``get-voice-connector-termination-health`` example retrieves the termination health details for the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime get-voice-connector-termination-health \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TerminationHealth": { | |
11 | "Timestamp": "Fri Aug 23 16:45:55 UTC 2019", | |
12 | "Source": "10.24.34.0" | |
13 | } | |
14 | } | |
15 | ||
16 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To retrieve termination settings** | |
1 | ||
2 | The following ``get-voice-connector-termination`` example retrieves the termination settings for the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime get-voice-connector-termination \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "Termination": { | |
12 | "CpsLimit": 1, | |
13 | "DefaultPhoneNumber": "+12065550100", | |
14 | "CallingRegions": [ | |
15 | "US" | |
16 | ], | |
17 | "CidrAllowedList": [ | |
18 | "10.24.34.0/23" | |
19 | ], | |
20 | "Disabled": false | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To get details for an Amazon Chime Voice Connector** | |
1 | ||
2 | The following ``get-voice-connector`` example displays the details of the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime get-voice-connector \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "VoiceConnector": { | |
11 | "VoiceConnectorId": "abcdef1ghij2klmno3pqr4", | |
12 | "Name": "MyVoiceConnector", | |
13 | "OutboundHostName": "abcdef1ghij2klmno3pqr4.voiceconnector.chime.aws", | |
14 | "RequireEncryption": true, | |
15 | "CreatedTimestamp": "2019-06-04T18:46:56.508Z", | |
16 | "UpdatedTimestamp": "2019-08-09T21:47:48.641Z" | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To retrieve a list of bots** | |
1 | ||
2 | The following ``list-bots`` example lists the bots associated with the specified Amazon Chime Enterprise account. :: | |
3 | ||
4 | aws chime list-bots \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Bot": { | |
11 | "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
12 | "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
13 | "DisplayName": "myBot (Bot)", | |
14 | "BotType": "ChatBot", | |
15 | "Disabled": false, | |
16 | "CreatedTimestamp": "2019-09-09T18:05:56.749Z", | |
17 | "UpdatedTimestamp": "2019-09-09T18:05:56.749Z", | |
18 | "BotEmail": "myBot-chimebot@example.com", | |
19 | "SecurityToken": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Use Chat Bots with Amazon Chime <https://docs.aws.amazon.com/chime/latest/dg/use-bots.html>`__ in the *Amazon Chime Developer Guide*. |
0 | **To list phone number orders** | |
1 | ||
2 | The following ``list-phone-number-orders`` example lists the phone number orders associated with the Amazon Chime administrator's account. :: | |
3 | ||
4 | aws chime list-phone-number-orders | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "PhoneNumberOrders": [ | |
10 | { | |
11 | "PhoneNumberOrderId": "abc12345-de67-89f0-123g-h45i678j9012", | |
12 | "ProductType": "VoiceConnector", | |
13 | "Status": "Partial", | |
14 | "OrderedPhoneNumbers": [ | |
15 | { | |
16 | "E164PhoneNumber": "+12065550100", | |
17 | "Status": "Acquired" | |
18 | }, | |
19 | { | |
20 | "E164PhoneNumber": "+12065550101", | |
21 | "Status": "Acquired" | |
22 | }, | |
23 | { | |
24 | "E164PhoneNumber": "+12065550102", | |
25 | "Status": "Failed" | |
26 | } | |
27 | ], | |
28 | "CreatedTimestamp": "2019-08-09T21:35:21.427Z", | |
29 | "UpdatedTimestamp": "2019-08-09T21:35:31.926Z" | |
30 | } | |
31 | { | |
32 | "PhoneNumberOrderId": "cba54321-ed76-09f5-321g-h54i876j2109", | |
33 | "ProductType": "BusinessCalling", | |
34 | "Status": "Partial", | |
35 | "OrderedPhoneNumbers": [ | |
36 | { | |
37 | "E164PhoneNumber": "+12065550103", | |
38 | "Status": "Acquired" | |
39 | }, | |
40 | { | |
41 | "E164PhoneNumber": "+12065550104", | |
42 | "Status": "Acquired" | |
43 | }, | |
44 | { | |
45 | "E164PhoneNumber": "+12065550105", | |
46 | "Status": "Failed" | |
47 | } | |
48 | ], | |
49 | "CreatedTimestamp": "2019-08-09T21:35:21.427Z", | |
50 | "UpdatedTimestamp": "2019-08-09T21:35:31.926Z" | |
51 | } | |
52 | ] | |
53 | } | |
54 | ||
55 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To list phone numbers for an Amazon Chime account** | |
1 | ||
2 | The following ``list-phone-numbers`` example lists the phone numbers associated with the administrator's Amazon Chime account. :: | |
3 | ||
4 | aws chime list-phone-numbers | |
5 | ||
6 | This command produces no output. | |
7 | Output:: | |
8 | ||
9 | { | |
10 | "PhoneNumbers": [ | |
11 | { | |
12 | "PhoneNumberId": "%2B12065550100", | |
13 | "E164PhoneNumber": "+12065550100", | |
14 | "Type": "Local", | |
15 | "ProductType": "VoiceConnector", | |
16 | "Status": "Unassigned", | |
17 | "Capabilities": { | |
18 | "InboundCall": true, | |
19 | "OutboundCall": true, | |
20 | "InboundSMS": true, | |
21 | "OutboundSMS": true, | |
22 | "InboundMMS": true, | |
23 | "OutboundMMS": true | |
24 | }, | |
25 | "Associations": [], | |
26 | "CreatedTimestamp": "2019-08-09T21:35:21.445Z", | |
27 | "UpdatedTimestamp": "2019-08-09T21:35:31.745Z" | |
28 | } | |
29 | { | |
30 | "PhoneNumberId": "%2B12065550101", | |
31 | "E164PhoneNumber": "+12065550101", | |
32 | "Type": "Local", | |
33 | "ProductType": "VoiceConnector", | |
34 | "Status": "Unassigned", | |
35 | "Capabilities": { | |
36 | "InboundCall": true, | |
37 | "OutboundCall": true, | |
38 | "InboundSMS": true, | |
39 | "OutboundSMS": true, | |
40 | "InboundMMS": true, | |
41 | "OutboundMMS": true | |
42 | }, | |
43 | "Associations": [], | |
44 | "CreatedTimestamp": "2019-08-09T21:35:21.445Z", | |
45 | "UpdatedTimestamp": "2019-08-09T21:35:31.745Z" | |
46 | } | |
47 | ] | |
48 | } | |
49 | ||
50 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To retrieve a list of termination credentials** | |
1 | ||
2 | The following ``list-voice-connector-termination-credentials`` example retrieves a list of the termination credentials for the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime list-voice-connector-termination-credentials \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "Usernames": [ | |
12 | "jdoe" | |
13 | ] | |
14 | } | |
15 | ||
16 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To list Amazon Chime Voice Connectors for an account** | |
1 | ||
2 | The following ``list-voice-connectors`` example lists the Amazon Chime Voice Connectors associated with the administrator's account. :: | |
3 | ||
4 | aws chime list-voice-connectors | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "VoiceConnectors": [ | |
10 | { | |
11 | "VoiceConnectorId": "abcdef1ghij2klmno3pqr4", | |
12 | "Name": "MyVoiceConnector", | |
13 | "OutboundHostName": "abcdef1ghij2klmno3pqr4.voiceconnector.chime.aws", | |
14 | "RequireEncryption": true, | |
15 | "CreatedTimestamp": "2019-06-04T18:46:56.508Z", | |
16 | "UpdatedTimestamp": "2019-08-09T21:47:48.641Z" | |
17 | } | |
18 | ] | |
19 | } | |
20 | ||
21 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To set up origination settings** | |
1 | ||
2 | The following ``put-voice-connector-origination`` example sets up the origination host, port, protocol, priority, and weight for the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime put-voice-connector-origination \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 \ | |
6 | --origination Routes=[{Host="10.24.34.0",Port=1234,Protocol="TCP",Priority=1,Weight=5}],Disabled=false | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Origination": { | |
12 | "Routes": [ | |
13 | { | |
14 | "Host": "10.24.34.0", | |
15 | "Port": 1234, | |
16 | "Protocol": "TCP", | |
17 | "Priority": 1, | |
18 | "Weight": 5 | |
19 | } | |
20 | ], | |
21 | "Disabled": false | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To set up termination credentials** | |
1 | ||
2 | The following ``put-voice-connector-termination-credentials`` example sets termination credentials for the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime put-voice-connector-termination-credentials \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 \ | |
6 | --credentials Username="jdoe",Password="XXXXXXXX" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To set up termination settings** | |
1 | ||
2 | The following ``put-voice-connector-termination`` example sets the calling regions and allowed IP host termination settings for the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime put-voice-connector-termination \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 \ | |
6 | --termination CallingRegions="US",CidrAllowedList="10.24.34.0/23",Disabled=false | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Termination": { | |
12 | "CpsLimit": 0, | |
13 | "CallingRegions": [ | |
14 | "US" | |
15 | ], | |
16 | "CidrAllowedList": [ | |
17 | "10.24.34.0/23" | |
18 | ], | |
19 | "Disabled": false | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To regenerate a security token** | |
1 | ||
2 | The following ``regenerate-security-token`` example regenerates the security token for the specified bot. :: | |
3 | ||
4 | aws chime regenerate-security-token \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \ | |
6 | --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Bot": { | |
12 | "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
13 | "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
14 | "DisplayName": "myBot (Bot)", | |
15 | "BotType": "ChatBot", | |
16 | "Disabled": false, | |
17 | "CreatedTimestamp": "2019-09-09T18:05:56.749Z", | |
18 | "UpdatedTimestamp": "2019-09-09T18:05:56.749Z", | |
19 | "BotEmail": "myBot-chimebot@example.com", | |
20 | "SecurityToken": "je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY" | |
21 | } | |
22 | } | |
23 | ||
24 | ||
25 | For more information, see `Authenticate Chat Bot Requests <https://docs.aws.amazon.com/chime/latest/dg/auth-bots.html>`__ in the *Amazon Chime Developer Guide*. |
0 | **To restore a phone number** | |
1 | ||
2 | The following ``restore-phone-number`` example restores the specified phone number from the deletion queue. :: | |
3 | ||
4 | aws chime restore-phone-number \ | |
5 | --phone-number-id "+12065550100" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "PhoneNumber": { | |
11 | "PhoneNumberId": "%2B12065550100", | |
12 | "E164PhoneNumber": "+12065550100", | |
13 | "Type": "Local", | |
14 | "ProductType": "BusinessCalling", | |
15 | "Status": "Unassigned", | |
16 | "Capabilities": { | |
17 | "InboundCall": true, | |
18 | "OutboundCall": true, | |
19 | "InboundSMS": true, | |
20 | "OutboundSMS": true, | |
21 | "InboundMMS": true, | |
22 | "OutboundMMS": true | |
23 | }, | |
24 | "Associations": [], | |
25 | "CreatedTimestamp": "2019-08-09T21:35:21.445Z", | |
26 | "UpdatedTimestamp": "2019-08-12T22:06:36.355Z" | |
27 | } | |
28 | } | |
29 | ||
30 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To search available phone numbers** | |
1 | ||
2 | The following ``search-available-phone-numbers`` example searches available phone numbers by area code. :: | |
3 | ||
4 | aws chime search-available-phone-numbers \ | |
5 | --area-code "206" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "E164PhoneNumbers": [ | |
11 | "+12065550100", | |
12 | "+12065550101", | |
13 | "+12065550102", | |
14 | "+12065550103", | |
15 | "+12065550104", | |
16 | "+12065550105", | |
17 | "+12065550106", | |
18 | "+12065550107", | |
19 | "+12065550108", | |
20 | "+12065550109", | |
21 | ] | |
22 | } | |
23 | ||
24 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To update a bot** | |
1 | ||
2 | The following ``update-bot`` example updates the status of the specified bot to stop it from running. :: | |
3 | ||
4 | aws chime update-bot \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \ | |
6 | --bot-id 123abcd4-5ef6-789g-0h12-34j56789012k \ | |
7 | --disabled | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Bot": { | |
13 | "BotId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
14 | "UserId": "123abcd4-5ef6-789g-0h12-34j56789012k", | |
15 | "DisplayName": "myBot (Bot)", | |
16 | "BotType": "ChatBot", | |
17 | "Disabled": true, | |
18 | "CreatedTimestamp": "2019-09-09T18:05:56.749Z", | |
19 | "UpdatedTimestamp": "2019-09-09T18:05:56.749Z", | |
20 | "BotEmail": "myBot-chimebot@example.com", | |
21 | "SecurityToken": "je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY" | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Update Chat Bots <https://docs.aws.amazon.com/chime/latest/dg/update-bots.html>`__ in the *Amazon Chime Developer Guide*. |
0 | **To update global settings** | |
1 | ||
2 | The following ``update-global-settings`` example updates the S3 bucket used to store call detail records for Amazon Chime Business Calling and Amazon Chime Voice Connectors associated with the administrator's AWS account. :: | |
3 | ||
4 | aws chime update-global-settings \ | |
5 | --business-calling CdrBucket="s3bucket" \ | |
6 | --voice-connector CdrBucket="s3bucket" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Managing Global Settings <https://docs.aws.amazon.com/chime/latest/ag/manage-global.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To update the details for a phone number** | |
1 | ||
2 | The following ``update-phone-number`` example updates the specified phone number's product type. :: | |
3 | ||
4 | aws chime update-phone-number \ | |
5 | --phone-number-id "+12065550100" \ | |
6 | --product-type "BusinessCalling" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "PhoneNumber": { | |
12 | "PhoneNumberId": "%2B12065550100", | |
13 | "E164PhoneNumber": "+12065550100", | |
14 | "Type": "Local", | |
15 | "ProductType": "BusinessCalling", | |
16 | "Status": "Unassigned", | |
17 | "Capabilities": { | |
18 | "InboundCall": true, | |
19 | "OutboundCall": true, | |
20 | "InboundSMS": true, | |
21 | "OutboundSMS": true, | |
22 | "InboundMMS": true, | |
23 | "OutboundMMS": true | |
24 | }, | |
25 | "Associations": [], | |
26 | "CreatedTimestamp": "2019-08-09T21:35:21.445Z", | |
27 | "UpdatedTimestamp": "2019-08-12T21:44:07.591Z" | |
28 | } | |
29 | } | |
30 | ||
31 | For more information, see `Working with Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/phone-numbers.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To update user settings** | |
1 | ||
2 | The following ``update-user-settings`` example enables the specified user to make inbound and outbound calls and send and receive SMS messages. :: | |
3 | ||
4 | aws chime update-user-settings \ | |
5 | --account-id 12a3456b-7c89-012d-3456-78901e23fg45 \ | |
6 | --user-id 1ab2345c-67de-8901-f23g-45h678901j2k \ | |
7 | --user-settings "Telephony={InboundCalling=true,OutboundCalling=true,SMS=true}" | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Managing User Phone Numbers <https://docs.aws.amazon.com/chime/latest/ag/user-phone.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To update the details for an Amazon Chime Voice Connector** | |
1 | ||
2 | The following ``update-voice-connector`` example updates the name of the specified Amazon Chime Voice Connector. :: | |
3 | ||
4 | aws chime update-voice-connector \ | |
5 | --voice-connector-id abcdef1ghij2klmno3pqr4 \ | |
6 | --name MyVoiceConnector \ | |
7 | --require-encryption | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "VoiceConnector": { | |
13 | "VoiceConnectorId": "abcdef1ghij2klmno3pqr4", | |
14 | "Name": "MyVoiceConnector", | |
15 | "OutboundHostName": "abcdef1ghij2klmno3pqr4.voiceconnector.chime.aws", | |
16 | "RequireEncryption": true, | |
17 | "CreatedTimestamp": "2019-06-04T18:46:56.508Z", | |
18 | "UpdatedTimestamp": "2019-08-09T21:47:48.641Z" | |
19 | } | |
20 | } | |
21 | ||
22 | For more information, see `Working with Amazon Chime Voice Connectors <https://docs.aws.amazon.com/chime/latest/ag/voice-connectors.html>`__ in the *Amazon Chime Administration Guide*. |
0 | **To get information about merge conflicts in all files or a subset of files in a merge between two commit specifiers** | |
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``. :: | |
3 | ||
4 | aws codecommit batch-describe-merge-conflicts \ | |
5 | --source-commit-specifier feature-randomizationfeature \ | |
6 | --destination-commit-specifier master \ | |
7 | --merge-option THREE_WAY_MERGE \ | |
8 | --repository-name MyDemoRepo | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "conflicts": [ | |
14 | { | |
15 | "conflictMetadata": { | |
16 | "filePath": "readme.md", | |
17 | "fileSizes": { | |
18 | "source": 139, | |
19 | "destination": 230, | |
20 | "base": 85 | |
21 | }, | |
22 | "fileModes": { | |
23 | "source": "NORMAL", | |
24 | "destination": "NORMAL", | |
25 | "base": "NORMAL" | |
26 | }, | |
27 | "objectTypes": { | |
28 | "source": "FILE", | |
29 | "destination": "FILE", | |
30 | "base": "FILE" | |
31 | }, | |
32 | "numberOfConflicts": 1, | |
33 | "isBinaryFile": { | |
34 | "source": false, | |
35 | "destination": false, | |
36 | "base": false | |
37 | }, | |
38 | "contentConflict": true, | |
39 | "fileModeConflict": false, | |
40 | "objectTypeConflict": false, | |
41 | "mergeOperations": { | |
42 | "source": "M", | |
43 | "destination": "M" | |
44 | } | |
45 | }, | |
46 | "mergeHunks": [ | |
47 | { | |
48 | "isConflict": true, | |
49 | "source": { | |
50 | "startLine": 0, | |
51 | "endLine": 3, | |
52 | "hunkContent": "VGhpcyBpEXAMPLE==" | |
53 | }, | |
54 | "destination": { | |
55 | "startLine": 0, | |
56 | "endLine": 1, | |
57 | "hunkContent": "VXNlIHRoEXAMPLE=" | |
58 | } | |
59 | } | |
60 | ] | |
61 | } | |
62 | ], | |
63 | "errors": [], | |
64 | "destinationCommitId": "86958e0aEXAMPLE", | |
65 | "sourceCommitId": "6ccd57fdEXAMPLE", | |
66 | "baseCommitId": "767b6958EXAMPLE" | |
67 | } | |
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*. |
0 | **To view information about multiple commits** | |
1 | ||
2 | The following ``batch-get-commits`` example displays details about the specified commits. :: | |
3 | ||
4 | aws codecommit batch-get-commits \ | |
5 | --repository-name MyDemoRepo \ | |
6 | --commit-ids 317f8570EXAMPLE 4c925148EXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "commits": [ | |
12 | { | |
13 | "additionalData": "", | |
14 | "committer": { | |
15 | "date": "1508280564 -0800", | |
16 | "name": "Mary Major", | |
17 | "email": "mary_major@example.com" | |
18 | }, | |
19 | "author": { | |
20 | "date": "1508280564 -0800", | |
21 | "name": "Mary Major", | |
22 | "email": "mary_major@example.com" | |
23 | }, | |
24 | "commitId": "317f8570EXAMPLE", | |
25 | "treeId": "1f330709EXAMPLE", | |
26 | "parents": [ | |
27 | "6e147360EXAMPLE" | |
28 | ], | |
29 | "message": "Change variable name and add new response element" | |
30 | }, | |
31 | { | |
32 | "additionalData": "", | |
33 | "committer": { | |
34 | "date": "1508280542 -0800", | |
35 | "name": "Li Juan", | |
36 | "email": "li_juan@example.com" | |
37 | }, | |
38 | "author": { | |
39 | "date": "1508280542 -0800", | |
40 | "name": "Li Juan", | |
41 | "email": "li_juan@example.com" | |
42 | }, | |
43 | "commitId": "4c925148EXAMPLE", | |
44 | "treeId": "1f330709EXAMPLE", | |
45 | "parents": [ | |
46 | "317f8570EXAMPLE" | |
47 | ], | |
48 | "message": "Added new class" | |
49 | } | |
50 | } | |
51 | ||
52 | ||
53 | For more information, see `View Commit Details <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-view-commit-details.html#how-to-view-commit-details-cli-batch-get-commits>`__ in the *AWS CodeCommit User Guide*. |
0 | **To create an unreferenced commit that represents the result of merging two commit specifiers** | |
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``. :: | |
3 | ||
4 | aws codecommit create-unreferenced-merge-commit \ | |
5 | --source-commit-specifier bugfix-1234 \ | |
6 | --destination-commit-specifier master \ | |
7 | --merge-option THREE_WAY_MERGE \ | |
8 | --repository-name MyDemoRepo \ | |
9 | --name "Maria Garcia" \ | |
10 | --email "maria_garcia@example.com" \ | |
11 | --commit-message "Testing the results of this merge." | |
12 | ||
13 | Output:: | |
14 | ||
15 | { | |
16 | "commitId": "4f178133EXAMPLE", | |
17 | "treeId": "389765daEXAMPLE" | |
18 | } | |
19 | ||
20 | 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 | **To get detailed information about merge conflicts** | |
1 | ||
2 | The following ``describe-merge-conflicts`` example determines the merge conflicts for a file named ``readme.md`` in the specified source branch and destination branch using the THREE_WAY_MERGE strategy. :: | |
3 | ||
4 | aws codecommit describe-merge-conflicts \ | |
5 | --source-commit-specifier feature-randomizationfeature \ | |
6 | --destination-commit-specifier master \ | |
7 | --merge-option THREE_WAY_MERGE \ | |
8 | --file-path readme.md \ | |
9 | --repository-name MyDemoRepo | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "conflictMetadata": { | |
15 | "filePath": "readme.md", | |
16 | "fileSizes": { | |
17 | "source": 139, | |
18 | "destination": 230, | |
19 | "base": 85 | |
20 | }, | |
21 | "fileModes": { | |
22 | "source": "NORMAL", | |
23 | "destination": "NORMAL", | |
24 | "base": "NORMAL" | |
25 | }, | |
26 | "objectTypes": { | |
27 | "source": "FILE", | |
28 | "destination": "FILE", | |
29 | "base": "FILE" | |
30 | }, | |
31 | "numberOfConflicts": 1, | |
32 | "isBinaryFile": { | |
33 | "source": false, | |
34 | "destination": false, | |
35 | "base": false | |
36 | }, | |
37 | "contentConflict": true, | |
38 | "fileModeConflict": false, | |
39 | "objectTypeConflict": false, | |
40 | "mergeOperations": { | |
41 | "source": "M", | |
42 | "destination": "M" | |
43 | } | |
44 | }, | |
45 | "mergeHunks": [ | |
46 | { | |
47 | "isConflict": true, | |
48 | "source": { | |
49 | "startLine": 0, | |
50 | "endLine": 3, | |
51 | "hunkContent": "VGhpcyBpEXAMPLE=" | |
52 | }, | |
53 | "destination": { | |
54 | "startLine": 0, | |
55 | "endLine": 1, | |
56 | "hunkContent": "VXNlIHRoEXAMPLE=" | |
57 | } | |
58 | } | |
59 | ], | |
60 | "destinationCommitId": "86958e0aEXAMPLE", | |
61 | "sourceCommitId": "6ccd57fdEXAMPLE", | |
62 | "baseCommitId": "767b69580EXAMPLE" | |
63 | } | |
64 | ||
65 | 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#describe-merge-conflicts>`__ in the *AWS CodeCommit User Guide*. |
0 | **To get detailed information about a merge commit** | |
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``. :: | |
3 | ||
4 | aws codecommit get-merge-commit \ | |
5 | --source-commit-specifier bugfix-bug1234 \ | |
6 | --destination-commit-specifier master \ | |
7 | --merge-option THREE_WAY_MERGE \ | |
8 | --repository-name MyDemoRepo | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "sourceCommitId": "c5709475EXAMPLE", | |
14 | "destinationCommitId": "317f8570EXAMPLE", | |
15 | "baseCommitId": "fb12a539EXAMPLE", | |
16 | "mergeCommitId": "ffc4d608eEXAMPLE" | |
17 | } | |
18 | ||
19 | For more information, see `View Commit Details <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-view-commit-details.html#how-to-view-commit-details-cli-merge-commit>`__ in the *AWS CodeCommit User Guide*. |
0 | **To get information about the merge options available for merging two specified branches** | |
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``. :: | |
3 | ||
4 | aws codecommit get-merge-options \ | |
5 | --source-commit-specifier bugfix-bug1234 \ | |
6 | --destination-commit-specifier master \ | |
7 | --repository-name MyDemoRepo | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "mergeOptions": [ | |
13 | "FAST_FORWARD_MERGE", | |
14 | "SQUASH_MERGE", | |
15 | "THREE_WAY_MERGE" | |
16 | ], | |
17 | "sourceCommitId": "18059494EXAMPLE", | |
18 | "destinationCommitId": "ffd3311dEXAMPLE", | |
19 | "baseCommitId": "ffd3311dEXAMPLE" | |
20 | } | |
21 | ||
22 | ||
23 | 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 | **To view the AWS tags for a repository** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists tag keys and tag values for the specified repository. :: | |
3 | ||
4 | aws codecommit list-tags-for-resource \ | |
5 | --resource-arn arn:aws:codecommit:us-west-2:111111111111:MyDemoRepo | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "tags": { | |
11 | "Status": "Secret", | |
12 | "Team": "Saanvi" | |
13 | } | |
14 | } | |
15 | ||
16 | ||
17 | For more information, see `View Tags for a Repository <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-tag-repository-list.html#how-to-tag-repository-list-cli>`__ in the *AWS CodeCommit User Guide*. |
0 | **To merge two branches using the fast-forward merge strategy** | |
1 | ||
2 | The following ``merge-branches-by-fast-forward`` example merges the specified source branch with the specified destination branch in a repository named ``MyDemoRepo``. :: | |
3 | ||
4 | aws codecommit merge-branches-by-fast-forward \ | |
5 | --source-commit-specifier bugfix-bug1234 \ | |
6 | --destination-commit-specifier bugfix-bug1233 \ | |
7 | --repository-name MyDemoRepo | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "commitId": "4f178133EXAMPLE", | |
13 | "treeId": "389765daEXAMPLE" | |
14 | } | |
15 | ||
16 | For more information, see `Compare and Merge Branches <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-compare-branches.html#merge-branches-by-fast-forward>`__ in the *AWS CodeCommit User Guide*. |
0 | **To merge two branches using the squash merge strategy** | |
1 | ||
2 | The following ``merge-branches-by-squash`` example merges the specified source branch with the specified destination branch in a repository named ``MyDemoRepo``. :: | |
3 | ||
4 | aws codecommit merge-branches-by-squash \ | |
5 | --source-commit-specifier bugfix-bug1234 \ | |
6 | --destination-commit-specifier bugfix-bug1233 \ | |
7 | --author-name "Maria Garcia" \ | |
8 | --email "maria_garcia@example.com" \ | |
9 | --commit-message "Merging two fix branches to prepare for a general patch." \ | |
10 | --repository-name MyDemoRepo | |
11 | ||
12 | Output:: | |
13 | ||
14 | { | |
15 | "commitId": "4f178133EXAMPLE", | |
16 | "treeId": "389765daEXAMPLE" | |
17 | } | |
18 | ||
19 | ||
20 | For more information, see `Compare and Merge Branches <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-compare-branches.html#merge-branches-by-squash>`__ in the *AWS CodeCommit User Guide*. |
0 | **To merge two branches using the three-way merge strategy** | |
1 | ||
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 | ||
4 | aws codecommit merge-branches-by-three-way \ | |
5 | --source-commit-specifier master \ | |
6 | --destination-commit-specifier bugfix-bug1234 \ | |
7 | --author-name "Jorge Souza" --email "jorge_souza@example.com" \ | |
8 | --commit-message "Merging changes from master to bugfix branch before additional testing." \ | |
9 | --repository-name MyDemoRepo | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "commitId": "4f178133EXAMPLE", | |
15 | "treeId": "389765daEXAMPLE" | |
16 | } | |
17 | ||
18 | For more information, see `Compare and Merge Branches <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-compare-branches.html#merge-branches-by-three-way>`__ in the *AWS CodeCommit User Guide*. |
0 | **To merge a pull request using the squash merge strategy** | |
1 | ||
2 | The following ``merge-pull-request-by-squash`` example merges and closes the specified pull request using the conflict resolution strategy of ACCEPT_SOURCE in a repository named ``MyDemoRepo``. :: | |
3 | ||
4 | aws codecommit merge-pull-request-by-squash \ | |
5 | --pull-request-id 47 \ | |
6 | --source-commit-id 99132ab0EXAMPLE \ | |
7 | --repository-name MyDemoRepo \ | |
8 | --conflict-detail-level LINE_LEVEL \ | |
9 | --conflict-resolution-strategy ACCEPT_SOURCE \ | |
10 | --name "Jorge Souza" --email "jorge_souza@example.com" \ | |
11 | --commit-message "Merging pull request 47 by squash and accepting source in merge conflicts" | |
12 | ||
13 | Output:: | |
14 | ||
15 | { | |
16 | "pullRequest": { | |
17 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
18 | "clientRequestToken": "", | |
19 | "creationDate": 1508530823.142, | |
20 | "description": "Review the latest changes and updates to the global variables", | |
21 | "lastActivityDate": 1508887223.155, | |
22 | "pullRequestId": "47", | |
23 | "pullRequestStatus": "CLOSED", | |
24 | "pullRequestTargets": [ | |
25 | { | |
26 | "destinationCommit": "9f31c968EXAMPLE", | |
27 | "destinationReference": "refs/heads/master", | |
28 | "mergeMetadata": { | |
29 | "isMerged": true, | |
30 | "mergedBy": "arn:aws:iam::111111111111:user/Jorge_Souza" | |
31 | }, | |
32 | "repositoryName": "MyDemoRepo", | |
33 | "sourceCommit": "99132ab0EXAMPLE", | |
34 | "sourceReference": "refs/heads/variables-branch" | |
35 | } | |
36 | ], | |
37 | "title": "Consolidation of global variables" | |
38 | } | |
39 | } | |
40 | ||
41 | 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-squash>`__ in the *AWS CodeCommit User Guide*. |
0 | **To merge a pull request using the three-way merge strategy** | |
1 | ||
2 | The following ``merge-pull-request-by-three-way`` example merges and closes the specified pull request using the default options for conflict detail and conflict resolution strategy in a repository named ``MyDemoRepo``. :: | |
3 | ||
4 | aws codecommit merge-pull-request-by-three-way \ | |
5 | --pull-request-id 47 \ | |
6 | --source-commit-id 99132ab0EXAMPLE \ | |
7 | --repository-name MyDemoRepo \ | |
8 | --name "Maria Garcia" \ | |
9 | --email "maria_garcia@example.com" \ | |
10 | --commit-message "Merging pull request 47 by three-way with default options" | |
11 | ||
12 | Output:: | |
13 | ||
14 | { | |
15 | "pullRequest": { | |
16 | "authorArn": "arn:aws:iam::111111111111:user/Li_Juan", | |
17 | "clientRequestToken": "", | |
18 | "creationDate": 1508530823.142, | |
19 | "description": "Review the latest changes and updates to the global variables", | |
20 | "lastActivityDate": 1508887223.155, | |
21 | "pullRequestId": "47", | |
22 | "pullRequestStatus": "CLOSED", | |
23 | "pullRequestTargets": [ | |
24 | { | |
25 | "destinationCommit": "9f31c968EXAMPLE", | |
26 | "destinationReference": "refs/heads/master", | |
27 | "mergeMetadata": { | |
28 | "isMerged": true, | |
29 | "mergedBy": "arn:aws:iam::111111111111:user/Maria_Garcia" | |
30 | }, | |
31 | "repositoryName": "MyDemoRepo", | |
32 | "sourceCommit": "99132ab0EXAMPLE", | |
33 | "sourceReference": "refs/heads/variables-branch" | |
34 | } | |
35 | ], | |
36 | "title": "Consolidation of global variables" | |
37 | } | |
38 | } | |
39 | ||
40 | 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-three-way>`__ in the *AWS CodeCommit User Guide*. |
0 | **To add AWS tags to an existing repository** | |
1 | ||
2 | The following ``tag-resource`` example tags the specified repository with two tags. :: | |
3 | ||
4 | aws codecommit tag-resource \ | |
5 | --resource-arn arn:aws:codecommit:us-west-2:111111111111:MyDemoRepo \ | |
6 | --tags Status=Secret,Team=Saanvi | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Add a Tag to a Repository <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-tag-repository-add.html#how-to-tag-repository-add-cli>`__ in the *AWS CodeCommit User Guide*. |
0 | **To remove AWS tags from a repository** | |
1 | ||
2 | The following ``untag-resource`` example removes the tag with the specified key from the repository named ``MyDemoRepo``. :: | |
3 | ||
4 | aws codecommit untag-resource \ | |
5 | --resource-arn arn:aws:codecommit:us-west-2:111111111111:MyDemoRepo \ | |
6 | --tag-keys Status | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Remove a Tag from a Repository <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-tag-repository-delete.html#how-to-tag-repository-delete-cli>`__ in the *AWS CodeCommit User Guide*. |
0 | 0 | **To delete identity pool** |
1 | 1 | |
2 | This example deletes an identity ppol. | |
2 | The following ``delete-identity-pool`` example deletes the specified identity pool. | |
3 | 3 | |
4 | 4 | Command:: |
5 | 5 | |
6 | aws cognito-identity delete-identity-pool --identity-ids-to-delete "us-west-2:11111111-1111-1111-1111-111111111111" | |
6 | aws cognito-identity delete-identity-pool \ | |
7 | --identity-pool-id "us-west-2:11111111-1111-1111-1111-111111111111" | |
7 | 8 | |
9 | This command produces no output. |
+30
-0
0 | **To accept a gateway association proposal** | |
1 | ||
2 | The following ``accept-direct-connect-gateway-association-proposal`` accepts the specified proposal. :: | |
3 | ||
4 | aws directconnect accept-direct-connect-gateway-association-proposal \ | |
5 | --direct-connect-gateway-id 11460968-4ac1-4fd3-bdb2-00599EXAMPLE \ | |
6 | --proposal-id cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE \ | |
7 | --associated-gateway-owner-account 111122223333 | |
8 | ||
9 | { | |
10 | "directConnectGatewayAssociation": { | |
11 | "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", | |
12 | "directConnectGatewayOwnerAccount": "111122223333", | |
13 | "associationState": "associating", | |
14 | "associatedGateway": { | |
15 | "id": "tgw-02f776b1a7EXAMPLE", | |
16 | "type": "transitGateway", | |
17 | "ownerAccount": "111122223333", | |
18 | "region": "us-east-1" | |
19 | }, | |
20 | "associationId": "6441f8bf-5917-4279-ade1-9708bEXAMPLE", | |
21 | "allowedPrefixesToDirectConnectGateway": [ | |
22 | { | |
23 | "cidr": "192.168.1.0/30" | |
24 | } | |
25 | ] | |
26 | } | |
27 | } | |
28 | ||
29 | For more information, see `Accepting or Rejecting a Transit Gateway Association Proposal <https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-tgw.html#multi-account-tgw-accept-reject-proposal>`__ in the *AWS Direct Connect User Guide*. |
0 | **To provision a transit virtual interface to be owned by the specified AWS account** | |
1 | ||
2 | The following ``allocate-transit-virtual-interface`` example provisions a transit virtual interface for the specified account. :: | |
3 | ||
4 | aws directconnect allocate-transit-virtual-interface \ | |
5 | --connection-id dxlag-fEXAMPLE \ | |
6 | --owner-account 123456789012 \ | |
7 | --new-transit-virtual-interface-allocation "virtualInterfaceName=Example Transit Virtual Interface,vlan=126,asn=65110,mtu=1500,authKey=0xzxgA9YoW9h58u8SEXAMPLE,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,addressFamily=ipv4,tags=[{key=Tag,value=Example}]" | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "virtualInterface": { | |
13 | "ownerAccount": "123456789012", | |
14 | "virtualInterfaceId": "dxvif-fEXAMPLE", | |
15 | "location": "TIVIT", | |
16 | "connectionId": "dxlag-fEXAMPLE", | |
17 | "virtualInterfaceType": "transit", | |
18 | "virtualInterfaceName": "Example Transit Virtual Interface", | |
19 | "vlan": 126, | |
20 | "asn": 65110, | |
21 | "amazonSideAsn": 7224, | |
22 | "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", | |
23 | "amazonAddress": "192.168.1.1/30", | |
24 | "customerAddress": "192.168.1.2/30", | |
25 | "addressFamily": "ipv4", | |
26 | "virtualInterfaceState": "confirming", | |
27 | "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>126</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65110</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SEXAMPLE</bgp_auth_key>\n <amazon_bgp_asn>7224</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", | |
28 | "mtu": 1500, | |
29 | "jumboFrameCapable": true, | |
30 | "virtualGatewayId": "", | |
31 | "directConnectGatewayId": "", | |
32 | "routeFilterPrefixes": [], | |
33 | "bgpPeers": [ | |
34 | { | |
35 | "bgpPeerId": "dxpeer-fEXAMPLE", | |
36 | "asn": 65110, | |
37 | "authKey": "0xzxgA9YoW9h58u8EXAMPLE", | |
38 | "addressFamily": "ipv4", | |
39 | "amazonAddress": "192.168.1.1/30", | |
40 | "customerAddress": "192.168.1.2/30", | |
41 | "bgpPeerState": "pending", | |
42 | "bgpStatus": "down", | |
43 | "awsDeviceV2": "TIVIT-26wz6vEXAMPLE" | |
44 | } | |
45 | ], | |
46 | "region": "sa-east-1", | |
47 | "awsDeviceV2": "TIVIT-26wz6vEXAMPLE", | |
48 | "tags": [ | |
49 | { | |
50 | "key": "Tag", | |
51 | "value": "Example" | |
52 | } | |
53 | ] | |
54 | } | |
55 | } | |
56 | ||
57 | For more information, see `Creating a Hosted Transit Virtual Interface <https://docs.aws.amazon.com/directconnect/latest/UserGuide/createhostedvirtualinterface.html#create-hosted-transit-vif>`__ in the *AWS Direct Connect User Guide*. |
0 | **To accept ownership of a transit virtual interface** | |
1 | ||
2 | The following ``confirm-transit-virtual-interface`` accepts ownership of a transit virtual interface created by another customer. :: | |
3 | ||
4 | aws directconnect confirm-transit-virtual-interface \ | |
5 | --virtual-interface-id dxvif-fEXAMPLE \ | |
6 | --direct-connect-gateway-id 4112ccf9-25e9-4111-8237-b6c5dEXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "virtualInterfaceState": "pending" | |
12 | } | |
13 | ||
14 | For more information, see `Accepting a Hosted Virtual Interface <https://docs.aws.amazon.com/directconnect/latest/UserGuide/accepthostedvirtualinterface.html>`__ in the *AWS Direct Connect User Guide*. |
+33
-0
0 | **To create a proposal to associate the specified transit gateway with the specified Direct Connect gateway** | |
1 | ||
2 | The following ``create-direct-connect-gateway-association-proposal`` example creates a proposal that associates the specified transit gateway with the specified Direct Connect gateway. :: | |
3 | ||
4 | aws directconnect create-direct-connect-gateway-association-proposal \ | |
5 | --direct-connect-gateway-id 11460968-4ac1-4fd3-bdb2-00599EXAMPLE \ | |
6 | --direct-connect-gateway-owner-account 111122223333 \ | |
7 | --gateway-id tgw-02f776b1a7EXAMPLE \ | |
8 | --add-allowed-prefixes-to-direct-connect-gateway cidr=192.168.1.0/30 | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "directConnectGatewayAssociationProposal": { | |
14 | "proposalId": "cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE", | |
15 | "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", | |
16 | "directConnectGatewayOwnerAccount": "111122223333", | |
17 | "proposalState": "requested", | |
18 | "associatedGateway": { | |
19 | "id": "tgw-02f776b1a7EXAMPLE", | |
20 | "type": "transitGateway", | |
21 | "ownerAccount": "111122223333", | |
22 | "region": "us-east-1" | |
23 | }, | |
24 | "requestedAllowedPrefixesToDirectConnectGateway": [ | |
25 | { | |
26 | "cidr": "192.168.1.0/30" | |
27 | } | |
28 | ] | |
29 | } | |
30 | } | |
31 | ||
32 | For more information, see `Creating a Transit Gateway Association Proposal <https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-tgw.html#multi-account-tgw-create-proposal>`__ in the *AWS Direct Connect User Guide*. |
0 | **To create a transit virtual interface** | |
1 | ||
2 | The following ``create-transit-virtual-interface`` example creates a transit virtual interface for the specified connection. :: | |
3 | ||
4 | ws directconnect create-transit-virtual-interface \ | |
5 | --connection-id dxlag-fEXAMPLE \ | |
6 | --new-transit-virtual-interface "virtualInterfaceName=Example Transit Virtual Interface,vlan=126,asn=65110,mtu=1500,authKey=0xzxgA9YoW9h58u8SvEXAMPLE,amazonAddress=192.168.1.1/30,customerAddress=192.168.1.2/30,addressFamily=ipv4,directConnectGatewayId=8384da05-13ce-4a91-aada-5a1baEXAMPLE,tags=[{key=Tag,value=Example}]" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "virtualInterface": { | |
12 | "ownerAccount": "1111222233333", | |
13 | "virtualInterfaceId": "dxvif-fEXAMPLE", | |
14 | "location": "TIVIT", | |
15 | "connectionId": "dxlag-fEXAMPLE", | |
16 | "virtualInterfaceType": "transit", | |
17 | "virtualInterfaceName": "Example Transit Virtual Interface", | |
18 | "vlan": 126, | |
19 | "asn": 65110, | |
20 | "amazonSideAsn": 4200000000, | |
21 | "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", | |
22 | "amazonAddress": "192.168.1.1/30", | |
23 | "customerAddress": "192.168.1.2/30", | |
24 | "addressFamily": "ipv4", | |
25 | "virtualInterfaceState": "pending", | |
26 | "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>126</vlan>\n <customer_address>192.168.1.2/30</customer_address>\n <amazon_address>192.168.1.1/30</amazon_address>\n <bgp_asn>65110</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SvOmXRTw</bgp_auth_key>\n <amazon_bgp_asn>4200000000</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", | |
27 | "mtu": 1500, | |
28 | "jumboFrameCapable": true, | |
29 | "virtualGatewayId": "", | |
30 | "directConnectGatewayId": "8384da05-13ce-4a91-aada-5a1baEXAMPLE", | |
31 | "routeFilterPrefixes": [], | |
32 | "bgpPeers": [ | |
33 | { | |
34 | "bgpPeerId": "dxpeer-EXAMPLE", | |
35 | "asn": 65110, | |
36 | "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", | |
37 | "addressFamily": "ipv4", | |
38 | "amazonAddress": "192.168.1.1/30", | |
39 | "customerAddress": "192.168.1.2/30", | |
40 | "bgpPeerState": "pending", | |
41 | "bgpStatus": "down", | |
42 | "awsDeviceV2": "TIVIT-26wz6vEXAMPLE" | |
43 | } | |
44 | ], | |
45 | "region": "sa-east-1", | |
46 | "awsDeviceV2": "TIVIT-26wz6vEXAMPLE", | |
47 | "tags": [ | |
48 | { | |
49 | "key": "Tag", | |
50 | "value": "Example" | |
51 | } | |
52 | ] | |
53 | } | |
54 | } | |
55 | ||
56 | For more information, see `Creating a Transit Virtual Interface to the Direct Connect Gateway <https://docs.aws.amazon.com/directconnect/latest/UserGuide/create-vif.html#create-transit-vif>`__ in the *AWS Direct Connect User Guide*. |
+64
-0
0 | **To describe your Direct Connect gateway association proposals** | |
1 | ||
2 | The following ``describe-direct-connect-gateway-association-proposals`` example displays details about your Direct Connect gateway association proposals. :: | |
3 | ||
4 | aws directconnect describe-direct-connect-gateway-association-proposals | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "directConnectGatewayAssociationProposals": [ | |
10 | { | |
11 | "proposalId": "c2ede9b4-bbc6-4d33-923c-bc4feEXAMPLE", | |
12 | "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", | |
13 | "directConnectGatewayOwnerAccount": "111122223333", | |
14 | "proposalState": "requested", | |
15 | "associatedGateway": { | |
16 | "id": "tgw-02f776b1a7EXAMPLE", | |
17 | "type": "transitGateway", | |
18 | "ownerAccount": "111122223333", | |
19 | "region": "us-east-1" | |
20 | }, | |
21 | "existingAllowedPrefixesToDirectConnectGateway": [ | |
22 | { | |
23 | "cidr": "192.168.2.0/30" | |
24 | }, | |
25 | { | |
26 | "cidr": "192.168.1.0/30" | |
27 | } | |
28 | ], | |
29 | "requestedAllowedPrefixesToDirectConnectGateway": [ | |
30 | { | |
31 | "cidr": "192.168.1.0/30" | |
32 | } | |
33 | ] | |
34 | }, | |
35 | { | |
36 | "proposalId": "cb7f41cb-8128-43a5-93b1-dcaedEXAMPLE", | |
37 | "directConnectGatewayId": "11560968-4ac1-4fd3-bcb2-00599EXAMPLE", | |
38 | "directConnectGatewayOwnerAccount": "111122223333", | |
39 | "proposalState": "accepted", | |
40 | "associatedGateway": { | |
41 | "id": "tgw-045776b1a7EXAMPLE", | |
42 | "type": "transitGateway", | |
43 | "ownerAccount": "111122223333", | |
44 | "region": "us-east-1" | |
45 | }, | |
46 | "existingAllowedPrefixesToDirectConnectGateway": [ | |
47 | { | |
48 | "cidr": "192.168.4.0/30" | |
49 | }, | |
50 | { | |
51 | "cidr": "192.168.5.0/30" | |
52 | } | |
53 | ], | |
54 | "requestedAllowedPrefixesToDirectConnectGateway": [ | |
55 | { | |
56 | "cidr": "192.168.5.0/30" | |
57 | } | |
58 | ] | |
59 | } | |
60 | ] | |
61 | } | |
62 | ||
63 | For more information, see `Associating and Disassociating Transit Gateways <https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-transit-gateways.html#associate-tgw-with-direct-connect-gateway>`__ in the *AWS Direct Connect User Guide*. |
0 | **To update the specified attributes of the Direct Connect gateway association** | |
1 | ||
2 | The following ``update-direct-connect-gateway-association`` example adds the specified CIDR block to a Direct Connect gateway association. :: | |
3 | ||
4 | aws directconnect update-direct-connect-gateway-association \ | |
5 | --association-id 820a6e4f-5374-4004-8317-3f64bEXAMPLE \ | |
6 | --add-allowed-prefixes-to-direct-connect-gateway cidr=192.168.2.0/30 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "directConnectGatewayAssociation": { | |
12 | "directConnectGatewayId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", | |
13 | "directConnectGatewayOwnerAccount": "111122223333", | |
14 | "associationState": "updating", | |
15 | "associatedGateway": { | |
16 | "id": "tgw-02f776b1a7EXAMPLE", | |
17 | "type": "transitGateway", | |
18 | "ownerAccount": "111122223333", | |
19 | "region": "us-east-1" | |
20 | }, | |
21 | "associationId": "820a6e4f-5374-4004-8317-3f64bEXAMPLE", | |
22 | "allowedPrefixesToDirectConnectGateway": [ | |
23 | { | |
24 | "cidr": "192.168.2.0/30" | |
25 | }, | |
26 | { | |
27 | "cidr": "192.168.1.0/30" | |
28 | } | |
29 | ] | |
30 | } | |
31 | } | |
32 | ||
33 | For more information, see `Working with Direct Connect Gateways <https://docs.aws.amazon.com/directconnect/latest/UserGuide/direct-connect-gateways.html>`__ in the *AWS Direct Connect User Guide*. |
0 | **To update the MTU of a virtual interface** | |
1 | ||
2 | The following ``update-virtual-interface-attributes`` example updates the MTU of the specified virtual interface. :: | |
3 | ||
4 | aws directconnect update-virtual-interface-attributes \ | |
5 | --virtual-interface-id dxvif-fEXAMPLE \ | |
6 | --mtu 1500 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "ownerAccount": "1111222233333", | |
12 | "virtualInterfaceId": "dxvif-fEXAMPLE", | |
13 | "location": "TIVIT", | |
14 | "connectionId": "dxlag-fEXAMPLE", | |
15 | "virtualInterfaceType": "transit", | |
16 | "virtualInterfaceName": "example trasit virtual interface", | |
17 | "vlan": 125, | |
18 | "asn": 650001, | |
19 | "amazonSideAsn": 64512, | |
20 | "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", | |
21 | "amazonAddress": "169.254.248.1/30", | |
22 | "customerAddress": "169.254.248.2/30", | |
23 | "addressFamily": "ipv4", | |
24 | "virtualInterfaceState": "down", | |
25 | "customerRouterConfig": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<logical_connection id=\"dxvif-fEXAMPLE\">\n <vlan>125</vlan>\n <customer_address>169.254.248.2/30</customer_address>\n <amazon_address>169.254.248.1/30</amazon_address>\n <bgp_asn>650001</bgp_asn>\n <bgp_auth_key>0xzxgA9YoW9h58u8SEXAMPLE</bgp_auth_key>\n <amazon_bgp_asn>64512</amazon_bgp_asn>\n <connection_type>transit</connection_type>\n</logical_connection>\n", | |
26 | "mtu": 1500, | |
27 | "jumboFrameCapable": true, | |
28 | "virtualGatewayId": "", | |
29 | "directConnectGatewayId": "879b76a1-403d-4700-8b53-4a56ed85436e", | |
30 | "routeFilterPrefixes": [], | |
31 | "bgpPeers": [ | |
32 | { | |
33 | "bgpPeerId": "dxpeer-fEXAMPLE", | |
34 | "asn": 650001, | |
35 | "authKey": "0xzxgA9YoW9h58u8SEXAMPLE", | |
36 | "addressFamily": "ipv4", | |
37 | "amazonAddress": "169.254.248.1/30", | |
38 | "customerAddress": "169.254.248.2/30", | |
39 | "bgpPeerState": "available", | |
40 | "bgpStatus": "down", | |
41 | "awsDeviceV2": "TIVIT-26wz6vEXAMPLE" | |
42 | } | |
43 | ], | |
44 | "region": "sa-east-1", | |
45 | "awsDeviceV2": "TIVIT-26wz6vEXAMPLE", | |
46 | "tags": [] | |
47 | } | |
48 | ||
49 | ||
50 | For more information, see `Setting Network MTU for Private Virtual Interfaces or Transit Virtual Interfaces <https://docs.aws.amazon.com/directconnect/latest/UserGuide/set-jumbo-frames-vif.html>`__ in the *AWS Direct Connect User Guide*. |
0 | **To add one or more tags to a specified resource** | |
1 | ||
2 | The following ``add-tags-to-resource`` example adds three tags to ``sample-cluster``. One tag (``CropB``) has a key name but no value. :: | |
3 | ||
4 | aws docdb add-tags-to-resource \ | |
5 | --resource-name arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster \ | |
6 | --tags Key="CropA",Value="Apple" Key="CropB" Key="CropC",Value="Corn" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging Amazon DocumentDB Resources <https://docs.aws.amazon.com/documentdb/latest/developerguide/tagging.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To have pending maintenance actions take place during the next maintenance window** | |
1 | ||
2 | The following ``apply-pending-maintenance-action`` example causes all system-update actions to be performed during the next scheduled maintenance window. :: | |
3 | ||
4 | aws docdb apply-pending-maintenance-action \ | |
5 | --resource-identifier arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster \ | |
6 | --apply-action system-update \ | |
7 | --opt-in-type next-maintenance | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Applying Amazon DocumentDB Updates <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-maintain.html#db-instance-updates-apply>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To duplicate an existing DB cluster parameter group** | |
1 | ||
2 | The following ``copy-db-cluster-parameter-group`` example makes a copy of the parameter group ``custom-docdb3-6`` named ``custom-docdb3-6-copy``. When making the copy it adds tags to the new parameter group. :: | |
3 | ||
4 | aws docdb copy-db-cluster-parameter-group \ | |
5 | --source-db-cluster-parameter-group-identifier custom-docdb3-6 \ | |
6 | --target-db-cluster-parameter-group-identifier custom-docdb3-6-copy \ | |
7 | --target-db-cluster-parameter-group-description "Copy of custom-docdb3-6" \ | |
8 | --tags Key="CopyNumber",Value="1" Key="Modifiable",Value="Yes" | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "DBClusterParameterGroup": { | |
14 | "DBParameterGroupFamily": "docdb3.6", | |
15 | "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:12345678901:cluster-pg:custom-docdb3-6-copy", | |
16 | "DBClusterParameterGroupName": "custom-docdb3-6-copy", | |
17 | "Description": "Copy of custom-docdb3-6" | |
18 | } | |
19 | } | |
20 | ||
21 | For more information, see `Copying an Amazon DocumentDB Cluster Parameter Group <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-parameter-group-copy.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To create a copy of a snapshot** | |
1 | ||
2 | The following ``copy-db-cluster-snapshot`` example makes a copy of ``sample-cluster-snapshot`` named ``sample-cluster-snapshot-copy``. The copy has all the tags of the original plus a new tag with the key name ``CopyNumber``. :: | |
3 | ||
4 | aws docdb copy-db-cluster-snapshot \ | |
5 | --source-db-cluster-snapshot-identifier sample-cluster-snapshot \ | |
6 | --target-db-cluster-snapshot-identifier sample-cluster-snapshot-copy \ | |
7 | --copy-tags \ | |
8 | --tags Key="CopyNumber",Value="1" | |
9 | ||
10 | This command produces no output. | |
11 | ||
12 | For more information, see `Copying a Cluster Snapshot <https://docs.aws.amazon.com/documentdb/latest/developerguide/backup-restore.db-cluster-snapshot-copy.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To create an Amazon DocumentDB cluster parameter group** | |
1 | ||
2 | The following ``create-db-cluster-parameter-group`` example creates the DB cluster parameter group ``sample-parameter-group`` using the ``docdb3.6`` family. :: | |
3 | ||
4 | aws docdb create-db-cluster-parameter-group \ | |
5 | --db-cluster-parameter-group-name sample-parameter-group \ | |
6 | --db-parameter-group-family docdb3.6 \ | |
7 | --description "Sample parameter group based on docdb3.6" | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "DBClusterParameterGroup": { | |
13 | "Description": "Sample parameter group based on docdb3.6", | |
14 | "DBParameterGroupFamily": "docdb3.6", | |
15 | "DBClusterParameterGroupArn": "arn:aws:rds:us-west-2:123456789012:cluster-pg:sample-parameter-group", | |
16 | "DBClusterParameterGroupName": "sample-parameter-group" | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Creating an Amazon DocumentDB Cluster Parameter Group <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-parameter-group-create.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To create a manual Amazon DocumentDB cluster snapshot** | |
1 | ||
2 | The following ``create-db-cluster-snapshot`` example creates an Amazon DB cluster snapshot named sample-cluster-snapshot. :: | |
3 | ||
4 | aws docdb create-db-cluster-snapshot \ | |
5 | --db-cluster-identifier sample-cluster \ | |
6 | --db-cluster-snapshot-identifier sample-cluster-snapshot | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "DBClusterSnapshot": { | |
12 | "MasterUsername": "master-user", | |
13 | "SnapshotCreateTime": "2019-03-18T18:27:14.794Z", | |
14 | "AvailabilityZones": [ | |
15 | "us-west-2a", | |
16 | "us-west-2b", | |
17 | "us-west-2c", | |
18 | "us-west-2d", | |
19 | "us-west-2e", | |
20 | "us-west-2f" | |
21 | ], | |
22 | "SnapshotType": "manual", | |
23 | "DBClusterSnapshotArn": "arn:aws:rds:us-west-2:123456789012:cluster-snapshot:sample-cluster-snapshot", | |
24 | "EngineVersion": "3.6.0", | |
25 | "PercentProgress": 0, | |
26 | "DBClusterSnapshotIdentifier": "sample-cluster-snapshot", | |
27 | "Engine": "docdb", | |
28 | "DBClusterIdentifier": "sample-cluster", | |
29 | "Status": "creating", | |
30 | "ClusterCreateTime": "2019-03-15T20:29:58.836Z", | |
31 | "Port": 0, | |
32 | "StorageEncrypted": false, | |
33 | "VpcId": "vpc-91280df6" | |
34 | } | |
35 | } | |
36 | ||
37 | For more information, see `Creating a Manual Cluster Snapshot <https://docs.aws.amazon.com/documentdb/latest/developerguide/backup-restore.db-cluster-snapshot-create.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To create an Amazon DocumentDB cluster** | |
1 | ||
2 | The following ``create-db-cluster`` example creates an Amazon DocumentDB cluster named ``sample-cluster`` with the preferred maintenance window on Sundays between 20:30 and 11:00. :: | |
3 | ||
4 | aws docdb create-db-cluster \ | |
5 | --db-cluster-identifier sample-cluster \ | |
6 | --engine docdb \ | |
7 | --master-username master-user \ | |
8 | --master-user-password password \ | |
9 | --preferred-maintenance-window Sun:20:30-Sun:21:00 | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "DBCluster": { | |
15 | "DBClusterParameterGroup": "default.docdb3.6", | |
16 | "AssociatedRoles": [], | |
17 | "DBSubnetGroup": "default", | |
18 | "ClusterCreateTime": "2019-03-18T18:06:34.616Z", | |
19 | "Status": "creating", | |
20 | "Port": 27017, | |
21 | "PreferredMaintenanceWindow": "sun:20:30-sun:21:00", | |
22 | "HostedZoneId": "ZNKXH85TT8WVW", | |
23 | "DBClusterMembers": [], | |
24 | "Engine": "docdb", | |
25 | "DBClusterIdentifier": "sample-cluster", | |
26 | "PreferredBackupWindow": "10:12-10:42", | |
27 | "AvailabilityZones": [ | |
28 | "us-west-2d", | |
29 | "us-west-2f", | |
30 | "us-west-2e" | |
31 | ], | |
32 | "MasterUsername": "master-user", | |
33 | "BackupRetentionPeriod": 1, | |
34 | "ReaderEndpoint": "sample-cluster.cluster-ro-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
35 | "VpcSecurityGroups": [ | |
36 | { | |
37 | "VpcSecurityGroupId": "sg-77186e0d", | |
38 | "Status": "active" | |
39 | } | |
40 | ], | |
41 | "StorageEncrypted": false, | |
42 | "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster", | |
43 | "DbClusterResourceId": "cluster-L3R4YRSBUYDP4GLMTJ2WF5GH5Q", | |
44 | "MultiAZ": false, | |
45 | "Endpoint": "sample-cluster.cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
46 | "EngineVersion": "3.6.0" | |
47 | } | |
48 | } | |
49 | ||
50 | ||
51 | For more information, see `Creating an Amazon DocumentDB Cluster <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-create.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To create an Amazon DocumentDB cluster instance** | |
1 | ||
2 | The following ``create-db-instance`` example code creates the instance ``sample-cluster-instance-2`` in the Amazon DocumentDB cluster ``sample-cluster``. :: | |
3 | ||
4 | aws docdb create-db-instance \ | |
5 | --db-cluster-identifier sample-cluster \ | |
6 | --db-instance-class db.r4.xlarge \ | |
7 | --db-instance-identifier sample-cluster-instance-2 \ | |
8 | --engine docdb | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "DBInstance": { | |
14 | "DBInstanceStatus": "creating", | |
15 | "PendingModifiedValues": { | |
16 | "PendingCloudwatchLogsExports": { | |
17 | "LogTypesToEnable": [ | |
18 | "audit" | |
19 | ] | |
20 | } | |
21 | }, | |
22 | "PubliclyAccessible": false, | |
23 | "PreferredBackupWindow": "00:00-00:30", | |
24 | "PromotionTier": 1, | |
25 | "EngineVersion": "3.6.0", | |
26 | "BackupRetentionPeriod": 3, | |
27 | "DBInstanceIdentifier": "sample-cluster-instance-2", | |
28 | "PreferredMaintenanceWindow": "tue:10:28-tue:10:58", | |
29 | "StorageEncrypted": false, | |
30 | "Engine": "docdb", | |
31 | "DBClusterIdentifier": "sample-cluster", | |
32 | "DBSubnetGroup": { | |
33 | "Subnets": [ | |
34 | { | |
35 | "SubnetAvailabilityZone": { | |
36 | "Name": "us-west-2a" | |
37 | }, | |
38 | "SubnetStatus": "Active", | |
39 | "SubnetIdentifier": "subnet-4e26d263" | |
40 | }, | |
41 | { | |
42 | "SubnetAvailabilityZone": { | |
43 | "Name": "us-west-2c" | |
44 | }, | |
45 | "SubnetStatus": "Active", | |
46 | "SubnetIdentifier": "subnet-afc329f4" | |
47 | }, | |
48 | { | |
49 | "SubnetAvailabilityZone": { | |
50 | "Name": "us-west-2d" | |
51 | }, | |
52 | "SubnetStatus": "Active", | |
53 | "SubnetIdentifier": "subnet-53ab3636" | |
54 | }, | |
55 | { | |
56 | "SubnetAvailabilityZone": { | |
57 | "Name": "us-west-2b" | |
58 | }, | |
59 | "SubnetStatus": "Active", | |
60 | "SubnetIdentifier": "subnet-991cb8d0" | |
61 | } | |
62 | ], | |
63 | "DBSubnetGroupDescription": "default", | |
64 | "SubnetGroupStatus": "Complete", | |
65 | "VpcId": "vpc-91280df6", | |
66 | "DBSubnetGroupName": "default" | |
67 | }, | |
68 | "DBInstanceClass": "db.r4.xlarge", | |
69 | "VpcSecurityGroups": [ | |
70 | { | |
71 | "Status": "active", | |
72 | "VpcSecurityGroupId": "sg-77186e0d" | |
73 | } | |
74 | ], | |
75 | "AutoMinorVersionUpgrade": true, | |
76 | "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster-instance-2", | |
77 | "DbiResourceId": "db-XEKJLEMGRV5ZKCARUVA4HO3ITE" | |
78 | } | |
79 | } | |
80 | ||
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*. |
0 | **To create an Amazon DocumentDB subnet group** | |
1 | ||
2 | The following ``create-db-subnet-group`` example creates an Amazon DocumentDB subnet group named ``sample-subnet-group``. :: | |
3 | ||
4 | aws docdb create-db-subnet-group \ | |
5 | --db-subnet-group-description "a sample subnet group" \ | |
6 | --db-subnet-group-name sample-subnet-group \ | |
7 | --subnet-ids "subnet-29ab1025" "subnet-991cb8d0" "subnet-53ab3636" | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "DBSubnetGroup": { | |
13 | "SubnetGroupStatus": "Complete", | |
14 | "DBSubnetGroupName": "sample-subnet-group", | |
15 | "DBSubnetGroupDescription": "a sample subnet group", | |
16 | "VpcId": "vpc-91280df6", | |
17 | "DBSubnetGroupArn": "arn:aws:rds:us-west-2:123456789012:subgrp:sample-subnet-group", | |
18 | "Subnets": [ | |
19 | { | |
20 | "SubnetStatus": "Active", | |
21 | "SubnetIdentifier": "subnet-53ab3636", | |
22 | "SubnetAvailabilityZone": { | |
23 | "Name": "us-west-2d" | |
24 | } | |
25 | }, | |
26 | { | |
27 | "SubnetStatus": "Active", | |
28 | "SubnetIdentifier": "subnet-991cb8d0", | |
29 | "SubnetAvailabilityZone": { | |
30 | "Name": "us-west-2b" | |
31 | } | |
32 | }, | |
33 | { | |
34 | "SubnetStatus": "Active", | |
35 | "SubnetIdentifier": "subnet-29ab1025", | |
36 | "SubnetAvailabilityZone": { | |
37 | "Name": "us-west-2c" | |
38 | } | |
39 | } | |
40 | ] | |
41 | } | |
42 | } | |
43 | ||
44 | ||
45 | For more information, see `Creating an Amazon DocumentDB Subnet Group <https://docs.aws.amazon.com/documentdb/latest/developerguide/document-db-subnet-groups.html#document-db-subnet-group-create>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To delete an Amazon DocumentDB cluster parameter group** | |
1 | ||
2 | The following ``delete-db-cluster-parameter-group`` example deletes the Amazon DocumentDB parameter group ``sample-parameter-group``. :: | |
3 | ||
4 | aws docdb delete-db-cluster-parameter-group \ | |
5 | --db-cluster-parameter-group-name sample-parameter-group | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Deleting an Amazon DocumentDB Cluster Parameter Group <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-parameter-group-delete.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To delete an Amazon DocumentDB cluster snapshot** | |
1 | ||
2 | The following ``delete-db-cluster-snapshot`` example deletes the Amazon DocumentDB cluster snapshot ``sample-cluster-snapshot``. :: | |
3 | ||
4 | aws docdb delete-db-cluster-snapshot \ | |
5 | --db-cluster-snapshot-identifier sample-cluster-snapshot | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBClusterSnapshot": { | |
11 | "DBClusterIdentifier": "sample-cluster", | |
12 | "AvailabilityZones": [ | |
13 | "us-west-2a", | |
14 | "us-west-2b", | |
15 | "us-west-2c", | |
16 | "us-west-2d" | |
17 | ], | |
18 | "DBClusterSnapshotIdentifier": "sample-cluster-snapshot", | |
19 | "VpcId": "vpc-91280df6", | |
20 | "DBClusterSnapshotArn": "arn:aws:rds:us-west-2:123456789012:cluster-snapshot:sample-cluster-snapshot", | |
21 | "EngineVersion": "3.6.0", | |
22 | "Engine": "docdb", | |
23 | "SnapshotCreateTime": "2019-03-18T18:27:14.794Z", | |
24 | "Status": "available", | |
25 | "MasterUsername": "master-user", | |
26 | "ClusterCreateTime": "2019-03-15T20:29:58.836Z", | |
27 | "PercentProgress": 100, | |
28 | "StorageEncrypted": false, | |
29 | "SnapshotType": "manual", | |
30 | "Port": 0 | |
31 | } | |
32 | } | |
33 | ||
34 | ||
35 | For more information, see `Deleting a Cluster Snapshot <https://docs.aws.amazon.com/documentdb/latest/developerguide/backup-restore.db-cluster-snapshot-delete.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To delete an Amazon DocumentDB cluster** | |
1 | ||
2 | The following ``delete-db-cluster`` example deletes the Amazon DocumentDB cluster ``sample-cluster``. No backup of the cluster is made prior to deleting it. NOTE: You must delete all instances associated with the cluster before you can delete it. :: | |
3 | ||
4 | aws docdb delete-db-cluster \ | |
5 | --db-cluster-identifier sample-cluster \ | |
6 | --skip-final-snapshot | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "DBCluster": { | |
12 | "DBClusterIdentifier": "sample-cluster", | |
13 | "DBSubnetGroup": "default", | |
14 | "EngineVersion": "3.6.0", | |
15 | "Engine": "docdb", | |
16 | "LatestRestorableTime": "2019-03-18T18:07:24.610Z", | |
17 | "PreferredMaintenanceWindow": "sun:20:30-sun:21:00", | |
18 | "StorageEncrypted": false, | |
19 | "EarliestRestorableTime": "2019-03-18T18:07:24.610Z", | |
20 | "Port": 27017, | |
21 | "VpcSecurityGroups": [ | |
22 | { | |
23 | "Status": "active", | |
24 | "VpcSecurityGroupId": "sg-77186e0d" | |
25 | } | |
26 | ], | |
27 | "MultiAZ": false, | |
28 | "MasterUsername": "master-user", | |
29 | "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster", | |
30 | "Status": "available", | |
31 | "PreferredBackupWindow": "10:12-10:42", | |
32 | "ReaderEndpoint": "sample-cluster.cluster-ro-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
33 | "AvailabilityZones": [ | |
34 | "us-west-2c", | |
35 | "us-west-2b", | |
36 | "us-west-2a" | |
37 | ], | |
38 | "Endpoint": "sample-cluster.cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
39 | "DbClusterResourceId": "cluster-L3R4YRSBUYDP4GLMTJ2WF5GH5Q", | |
40 | "ClusterCreateTime": "2019-03-18T18:06:34.616Z", | |
41 | "AssociatedRoles": [], | |
42 | "DBClusterParameterGroup": "default.docdb3.6", | |
43 | "HostedZoneId": "ZNKXH85TT8WVW", | |
44 | "BackupRetentionPeriod": 1, | |
45 | "DBClusterMembers": [] | |
46 | } | |
47 | } | |
48 | ||
49 | ||
50 | For more information, see `Deleting an Amazon DocumentDB Cluster <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-delete.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To delete an Amazon DocumentDB instance** | |
1 | ||
2 | The following ``delete-db-instance`` example deletes the Amazon DocumentDB instance ``sample-cluster-instance-2``. :: | |
3 | ||
4 | aws docdb delete-db-instance \ | |
5 | --db-instance-identifier sample-cluster-instance-2 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBInstance": { | |
11 | "DBSubnetGroup": { | |
12 | "Subnets": [ | |
13 | { | |
14 | "SubnetAvailabilityZone": { | |
15 | "Name": "us-west-2a" | |
16 | }, | |
17 | "SubnetStatus": "Active", | |
18 | "SubnetIdentifier": "subnet-4e26d263" | |
19 | }, | |
20 | { | |
21 | "SubnetAvailabilityZone": { | |
22 | "Name": "us-west-2c" | |
23 | }, | |
24 | "SubnetStatus": "Active", | |
25 | "SubnetIdentifier": "subnet-afc329f4" | |
26 | }, | |
27 | { | |
28 | "SubnetAvailabilityZone": { | |
29 | "Name": "us-west-2d" | |
30 | }, | |
31 | "SubnetStatus": "Active", | |
32 | "SubnetIdentifier": "subnet-53ab3636" | |
33 | }, | |
34 | { | |
35 | "SubnetAvailabilityZone": { | |
36 | "Name": "us-west-2b" | |
37 | }, | |
38 | "SubnetStatus": "Active", | |
39 | "SubnetIdentifier": "subnet-991cb8d0" | |
40 | } | |
41 | ], | |
42 | "DBSubnetGroupName": "default", | |
43 | "DBSubnetGroupDescription": "default", | |
44 | "VpcId": "vpc-91280df6", | |
45 | "SubnetGroupStatus": "Complete" | |
46 | }, | |
47 | "PreferredBackupWindow": "00:00-00:30", | |
48 | "InstanceCreateTime": "2019-03-18T18:37:33.709Z", | |
49 | "DBInstanceClass": "db.r4.xlarge", | |
50 | "DbiResourceId": "db-XEKJLEMGRV5ZKCARUVA4HO3ITE", | |
51 | "BackupRetentionPeriod": 3, | |
52 | "Engine": "docdb", | |
53 | "VpcSecurityGroups": [ | |
54 | { | |
55 | "Status": "active", | |
56 | "VpcSecurityGroupId": "sg-77186e0d" | |
57 | } | |
58 | ], | |
59 | "AutoMinorVersionUpgrade": true, | |
60 | "PromotionTier": 1, | |
61 | "EngineVersion": "3.6.0", | |
62 | "Endpoint": { | |
63 | "Address": "sample-cluster-instance-2.corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
64 | "HostedZoneId": "ZNKXH85TT8WVW", | |
65 | "Port": 27017 | |
66 | }, | |
67 | "DBInstanceIdentifier": "sample-cluster-instance-2", | |
68 | "PreferredMaintenanceWindow": "tue:10:28-tue:10:58", | |
69 | "EnabledCloudwatchLogsExports": [ | |
70 | "audit" | |
71 | ], | |
72 | "PendingModifiedValues": {}, | |
73 | "DBInstanceStatus": "deleting", | |
74 | "PubliclyAccessible": false, | |
75 | "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster-instance-2", | |
76 | "DBClusterIdentifier": "sample-cluster", | |
77 | "AvailabilityZone": "us-west-2c", | |
78 | "StorageEncrypted": false | |
79 | } | |
80 | } | |
81 | ||
82 | For more information, see `Deleting an Amazon DocumentDB Instance <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-delete.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To delete an Amazon DocumentDB subnet group** | |
1 | ||
2 | The following ``delete-db-subnet-group`` example deletes the Amazon DocumentDB subnet group ``sample-subnet-group``. :: | |
3 | ||
4 | aws docdb delete-db-subnet-group \ | |
5 | --db-subnet-group-name sample-subnet-group | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Deleting an Amazon DocumentDB Subnet Group <https://docs.aws.amazon.com/documentdb/latest/developerguide/document-db-subnet-groups.html#document-db-subnet-group-delete>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To see the details of one or more Amazon DocumentDB cluster parameter groups** | |
1 | ||
2 | The following ``describe-db-cluster-parameter-groups`` example displays details for the Amazon DocumentDB cluster parameter group ``custom3-6-param-grp``. :: | |
3 | ||
4 | aws docdb describe-db-cluster-parameter-groups \ | |
5 | --db-cluster-parameter-group-name custom3-6-param-grp | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBClusterParameterGroups": [ | |
11 | { | |
12 | "DBParameterGroupFamily": "docdb3.6", | |
13 | "DBClusterParameterGroupArn": "arn:aws:rds:us-east-1:123456789012:cluster-pg:custom3-6-param-grp", | |
14 | "Description": "Custom docdb3.6 parameter group", | |
15 | "DBClusterParameterGroupName": "custom3-6-param-grp" | |
16 | } | |
17 | ] | |
18 | } | |
19 | ||
20 | For more information, see `Viewing Amazon DocumentDB Cluster Parameter Groups <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-parameter-group-describe.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To view the detailed parameter list for an Amazon DocumentDB cluster parameter group.** | |
1 | ||
2 | The following ``describe-db-cluster-parameters`` example lists the parameters for the Amazon DocumentDB parameter group custom3-6-param-grp. :: | |
3 | ||
4 | aws docdb describe-db-cluster-parameters \ | |
5 | --db-cluster-parameter-group-name custom3-6-param-grp | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Parameters": [ | |
11 | { | |
12 | "DataType": "string", | |
13 | "ParameterName": "audit_logs", | |
14 | "IsModifiable": true, | |
15 | "ApplyMethod": "pending-reboot", | |
16 | "Source": "system", | |
17 | "ApplyType": "dynamic", | |
18 | "AllowedValues": "enabled,disabled", | |
19 | "Description": "Enables auditing on cluster.", | |
20 | "ParameterValue": "disabled" | |
21 | }, | |
22 | { | |
23 | "DataType": "string", | |
24 | "ParameterName": "tls", | |
25 | "IsModifiable": true, | |
26 | "ApplyMethod": "pending-reboot", | |
27 | "Source": "system", | |
28 | "ApplyType": "static", | |
29 | "AllowedValues": "disabled,enabled", | |
30 | "Description": "Config to enable/disable TLS", | |
31 | "ParameterValue": "enabled" | |
32 | }, | |
33 | { | |
34 | "DataType": "string", | |
35 | "ParameterName": "ttl_monitor", | |
36 | "IsModifiable": true, | |
37 | "ApplyMethod": "pending-reboot", | |
38 | "Source": "user", | |
39 | "ApplyType": "dynamic", | |
40 | "AllowedValues": "disabled,enabled", | |
41 | "Description": "Enables TTL Monitoring", | |
42 | "ParameterValue": "enabled" | |
43 | } | |
44 | ] | |
45 | } | |
46 | ||
47 | For more information, see `Viewing Amazon DocumentDB Cluster Parameters <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-parameters-describe.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To list an Amazon DocumentDB snapshot attribute names and values** | |
1 | ||
2 | The following ``describe-db-cluster-snapshot-attributes`` example lists the attribute names and values for the Amazon DocumentDB snapshot ``sample-cluster-snapshot``. :: | |
3 | ||
4 | aws docdb describe-db-cluster-snapshot-attributes \ | |
5 | --db-cluster-snapshot-identifier sample-cluster-snapshot | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBClusterSnapshotAttributesResult": { | |
11 | "DBClusterSnapshotAttributes": [ | |
12 | { | |
13 | "AttributeName": "restore", | |
14 | "AttributeValues": [] | |
15 | } | |
16 | ], | |
17 | "DBClusterSnapshotIdentifier": "sample-cluster-snapshot" | |
18 | } | |
19 | } | |
20 | ||
21 | For more information, see `DescribeDBClusterSnapshotAttributes <https://docs.aws.amazon.com/documentdb/latest/developerguide/API_DescribeDBClusterSnapshotAttributes.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To describe Amazon DocumentDB snapshots** | |
1 | ||
2 | The following ``describe-db-cluster-snapshots`` example displays details for the Amazon DocumentDB snapshot ``sample-cluster-snapshot``. :: | |
3 | ||
4 | aws docdb describe-db-cluster-snapshots \ | |
5 | --db-cluster-snapshot-identifier sample-cluster-snapshot | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBClusterSnapshots": [ | |
11 | { | |
12 | "AvailabilityZones": [ | |
13 | "us-west-2a", | |
14 | "us-west-2b", | |
15 | "us-west-2c", | |
16 | "us-west-2d" | |
17 | ], | |
18 | "Status": "available", | |
19 | "DBClusterSnapshotArn": "arn:aws:rds:us-west-2:123456789012:cluster-snapshot:sample-cluster-snapshot", | |
20 | "SnapshotCreateTime": "2019-03-15T20:41:26.515Z", | |
21 | "SnapshotType": "manual", | |
22 | "DBClusterSnapshotIdentifier": "sample-cluster-snapshot", | |
23 | "DBClusterIdentifier": "sample-cluster", | |
24 | "MasterUsername": "master-user", | |
25 | "StorageEncrypted": false, | |
26 | "VpcId": "vpc-91280df6", | |
27 | "EngineVersion": "3.6.0", | |
28 | "PercentProgress": 100, | |
29 | "Port": 0, | |
30 | "Engine": "docdb", | |
31 | "ClusterCreateTime": "2019-03-15T20:29:58.836Z" | |
32 | } | |
33 | ] | |
34 | } | |
35 | ||
36 | For more information, see `DescribeDBClusterSnapshots <https://docs.aws.amazon.com/documentdb/latest/developerguide/API_DescribeDBClusterSnapshots.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To get detailed information about one or more Amazon DocumentDB clusters.** | |
1 | ||
2 | The following ``describe-db-clusters`` example displays details for the Amazon DocumentDB cluster ``sample-cluster``. By omitting the ``--db-cluster-identifier`` parameter you can get information of up to 100 clusters. :: | |
3 | ||
4 | aws docdb describe-db-clusters | |
5 | --db-cluster-identifier sample-cluster | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBClusters": [ | |
11 | { | |
12 | "DBClusterParameterGroup": "default.docdb3.6", | |
13 | "Endpoint": "sample-cluster.cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
14 | "PreferredBackupWindow": "00:00-00:30", | |
15 | "DBClusterIdentifier": "sample-cluster", | |
16 | "ClusterCreateTime": "2019-03-15T20:29:58.836Z", | |
17 | "LatestRestorableTime": "2019-03-18T20:28:03.239Z", | |
18 | "MasterUsername": "master-user", | |
19 | "DBClusterMembers": [ | |
20 | { | |
21 | "PromotionTier": 1, | |
22 | "DBClusterParameterGroupStatus": "in-sync", | |
23 | "IsClusterWriter": false, | |
24 | "DBInstanceIdentifier": "sample-cluster" | |
25 | }, | |
26 | { | |
27 | "PromotionTier": 1, | |
28 | "DBClusterParameterGroupStatus": "in-sync", | |
29 | "IsClusterWriter": true, | |
30 | "DBInstanceIdentifier": "sample-cluster2" | |
31 | } | |
32 | ], | |
33 | "PreferredMaintenanceWindow": "sat:04:30-sat:05:00", | |
34 | "VpcSecurityGroups": [ | |
35 | { | |
36 | "VpcSecurityGroupId": "sg-77186e0d", | |
37 | "Status": "active" | |
38 | } | |
39 | ], | |
40 | "Engine": "docdb", | |
41 | "ReaderEndpoint": "sample-cluster.cluster-ro-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
42 | "DBSubnetGroup": "default", | |
43 | "MultiAZ": true, | |
44 | "AvailabilityZones": [ | |
45 | "us-west-2a", | |
46 | "us-west-2c", | |
47 | "us-west-2b" | |
48 | ], | |
49 | "EarliestRestorableTime": "2019-03-15T20:30:47.020Z", | |
50 | "DbClusterResourceId": "cluster-UP4EF2PVDDFVHHDJQTYDAIGHLE", | |
51 | "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster", | |
52 | "BackupRetentionPeriod": 3, | |
53 | "HostedZoneId": "ZNKXH85TT8WVW", | |
54 | "StorageEncrypted": false, | |
55 | "EnabledCloudwatchLogsExports": [ | |
56 | "audit" | |
57 | ], | |
58 | "AssociatedRoles": [], | |
59 | "EngineVersion": "3.6.0", | |
60 | "Port": 27017, | |
61 | "Status": "available" | |
62 | } | |
63 | ] | |
64 | } | |
65 | ||
66 | For more information, see `Describing Amazon DocumentDB Clusters <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-view-details.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To list available Amazon DocumentDB engine versions** | |
1 | ||
2 | The following ``describe-db-engine-versions`` example lists all available Amazon DocumentDB engine versions. :: | |
3 | ||
4 | aws docdb describe-db-engine-versions \ | |
5 | --engine docdb | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBEngineVersions": [ | |
11 | { | |
12 | "DBEngineVersionDescription": "DocDB version 1.0.200837", | |
13 | "DBParameterGroupFamily": "docdb3.6", | |
14 | "EngineVersion": "3.6.0", | |
15 | "ValidUpgradeTarget": [], | |
16 | "DBEngineDescription": "Amazon DocumentDB (with MongoDB compatibility)", | |
17 | "SupportsLogExportsToCloudwatchLogs": true, | |
18 | "Engine": "docdb", | |
19 | "ExportableLogTypes": [ | |
20 | "audit" | |
21 | ] | |
22 | } | |
23 | ] | |
24 | } | |
25 | ||
26 | ||
27 | For more information, see `DescribeDBEngineVersions <https://docs.aws.amazon.com/documentdb/latest/developerguide/API_DescribeDBEngineVersions.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To find information about provisioned Amazon DocumentDB instances** | |
1 | ||
2 | The following ``describe-db-instances`` example displays details for about the Amazon DocumentDB instance ``sample-cluster-instance``. By omitting the ``--db-instance-identifier`` parameter you get information on up to 100 instances. :: | |
3 | ||
4 | awd docdb describe-db-instances \ | |
5 | --db-instance-identifier sample-cluster-instance | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBInstances": [ | |
11 | { | |
12 | "Endpoint": { | |
13 | "HostedZoneId": "ZNKXH85TT8WVW", | |
14 | "Address": "sample-cluster-instance.corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
15 | "Port": 27017 | |
16 | }, | |
17 | "PreferredBackupWindow": "00:00-00:30", | |
18 | "DBInstanceStatus": "available", | |
19 | "DBInstanceClass": "db.r4.large", | |
20 | "EnabledCloudwatchLogsExports": [ | |
21 | "audit" | |
22 | ], | |
23 | "DBInstanceIdentifier": "sample-cluster-instance", | |
24 | "DBSubnetGroup": { | |
25 | "Subnets": [ | |
26 | { | |
27 | "SubnetStatus": "Active", | |
28 | "SubnetIdentifier": "subnet-4e26d263", | |
29 | "SubnetAvailabilityZone": { | |
30 | "Name": "us-west-2a" | |
31 | } | |
32 | }, | |
33 | { | |
34 | "SubnetStatus": "Active", | |
35 | "SubnetIdentifier": "subnet-afc329f4", | |
36 | "SubnetAvailabilityZone": { | |
37 | "Name": "us-west-2c" | |
38 | } | |
39 | }, | |
40 | { | |
41 | "SubnetStatus": "Active", | |
42 | "SubnetIdentifier": "subnet-53ab3636", | |
43 | "SubnetAvailabilityZone": { | |
44 | "Name": "us-west-2d" | |
45 | } | |
46 | }, | |
47 | { | |
48 | "SubnetStatus": "Active", | |
49 | "SubnetIdentifier": "subnet-991cb8d0", | |
50 | "SubnetAvailabilityZone": { | |
51 | "Name": "us-west-2b" | |
52 | } | |
53 | } | |
54 | ], | |
55 | "DBSubnetGroupName": "default", | |
56 | "SubnetGroupStatus": "Complete", | |
57 | "DBSubnetGroupDescription": "default", | |
58 | "VpcId": "vpc-91280df6" | |
59 | }, | |
60 | "InstanceCreateTime": "2019-03-15T20:36:06.338Z", | |
61 | "Engine": "docdb", | |
62 | "StorageEncrypted": false, | |
63 | "AutoMinorVersionUpgrade": true, | |
64 | "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster-instance", | |
65 | "PreferredMaintenanceWindow": "tue:08:39-tue:09:09", | |
66 | "VpcSecurityGroups": [ | |
67 | { | |
68 | "Status": "active", | |
69 | "VpcSecurityGroupId": "sg-77186e0d" | |
70 | } | |
71 | ], | |
72 | "DBClusterIdentifier": "sample-cluster", | |
73 | "PendingModifiedValues": {}, | |
74 | "BackupRetentionPeriod": 3, | |
75 | "PubliclyAccessible": false, | |
76 | "EngineVersion": "3.6.0", | |
77 | "PromotionTier": 1, | |
78 | "AvailabilityZone": "us-west-2c", | |
79 | "DbiResourceId": "db-A2GIKUV6KPOHITGGKI2NHVISZA" | |
80 | } | |
81 | ] | |
82 | } | |
83 | ||
84 | For more information, see `Describing Amazon DocumentDB Instances <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-view-details.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To retrieve a list of Amazon DocumentDB subnet descriptions** | |
1 | ||
2 | The following ``describe-db-subnet-groups`` example describes details for the Amazon DocumentDB subnet named ``default``. :: | |
3 | ||
4 | aws docdb describe-db-subnet-groups \ | |
5 | --db-subnet-group-name default | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBSubnetGroups": [ | |
11 | { | |
12 | "VpcId": "vpc-91280df6", | |
13 | "DBSubnetGroupArn": "arn:aws:rds:us-west-2:123456789012:subgrp:default", | |
14 | "Subnets": [ | |
15 | { | |
16 | "SubnetIdentifier": "subnet-4e26d263", | |
17 | "SubnetStatus": "Active", | |
18 | "SubnetAvailabilityZone": { | |
19 | "Name": "us-west-2a" | |
20 | } | |
21 | }, | |
22 | { | |
23 | "SubnetIdentifier": "subnet-afc329f4", | |
24 | "SubnetStatus": "Active", | |
25 | "SubnetAvailabilityZone": { | |
26 | "Name": "us-west-2c" | |
27 | } | |
28 | }, | |
29 | { | |
30 | "SubnetIdentifier": "subnet-53ab3636", | |
31 | "SubnetStatus": "Active", | |
32 | "SubnetAvailabilityZone": { | |
33 | "Name": "us-west-2d" | |
34 | } | |
35 | }, | |
36 | { | |
37 | "SubnetIdentifier": "subnet-991cb8d0", | |
38 | "SubnetStatus": "Active", | |
39 | "SubnetAvailabilityZone": { | |
40 | "Name": "us-west-2b" | |
41 | } | |
42 | } | |
43 | ], | |
44 | "DBSubnetGroupName": "default", | |
45 | "SubnetGroupStatus": "Complete", | |
46 | "DBSubnetGroupDescription": "default" | |
47 | } | |
48 | ] | |
49 | } | |
50 | ||
51 | ||
52 | For more information, see `Describing Subnet Groups <https://docs.aws.amazon.com/documentdb/latest/developerguide/ document-db-subnet-groups.html#document-db-subnet-groups-describe>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To describe the default engine and system parameter information for Amazon DocumentDB** | |
1 | ||
2 | The following ``describe-engine-default-cluster-parameters`` example displays details for the default engine and system parameter information for the Amazon DocumentDB parameter group ``docdb3.6``. :: | |
3 | ||
4 | aws docdb describe-engine-default-cluster-parameters \ | |
5 | --db-parameter-group-family docdb3.6 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "EngineDefaults": { | |
11 | "DBParameterGroupFamily": "docdb3.6", | |
12 | "Parameters": [ | |
13 | { | |
14 | "ApplyType": "dynamic", | |
15 | "ParameterValue": "disabled", | |
16 | "Description": "Enables auditing on cluster.", | |
17 | "Source": "system", | |
18 | "DataType": "string", | |
19 | "MinimumEngineVersion": "3.6.0", | |
20 | "AllowedValues": "enabled,disabled", | |
21 | "ParameterName": "audit_logs", | |
22 | "IsModifiable": true | |
23 | }, | |
24 | { | |
25 | "ApplyType": "static", | |
26 | "ParameterValue": "enabled", | |
27 | "Description": "Config to enable/disable TLS", | |
28 | "Source": "system", | |
29 | "DataType": "string", | |
30 | "MinimumEngineVersion": "3.6.0", | |
31 | "AllowedValues": "disabled,enabled", | |
32 | "ParameterName": "tls", | |
33 | "IsModifiable": true | |
34 | }, | |
35 | { | |
36 | "ApplyType": "dynamic", | |
37 | "ParameterValue": "enabled", | |
38 | "Description": "Enables TTL Monitoring", | |
39 | "Source": "system", | |
40 | "DataType": "string", | |
41 | "MinimumEngineVersion": "3.6.0", | |
42 | "AllowedValues": "disabled,enabled", | |
43 | "ParameterName": "ttl_monitor", | |
44 | "IsModifiable": true | |
45 | } | |
46 | ] | |
47 | } | |
48 | } | |
49 | ||
50 | For more information, see `DescribeEngineDefaultClusterParameters <https://docs.aws.amazon.com/documentdb/latest/developerguide/API_DescribeEngineDefaultClusterParameters.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To describe all Amazon DocumentDB event categories** | |
1 | ||
2 | The following ``describe-event-categories`` example lists all categories for the Amazon DocumentDB event source type ``db-instance``. :: | |
3 | ||
4 | aws docdb describe-event-categories \ | |
5 | --source-type db-cluster | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "EventCategoriesMapList": [ | |
11 | { | |
12 | "SourceType": "db-cluster", | |
13 | "EventCategories": [ | |
14 | "failover", | |
15 | "maintenance", | |
16 | "notification", | |
17 | "failure" | |
18 | ] | |
19 | } | |
20 | ] | |
21 | } | |
22 | ||
23 | For more information, see `Viewing Event Categories <https://docs.aws.amazon.com/ documentdb/latest/developerguide/managing-events.html#viewing-event-categories>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To list Amazon DocumentDB events** | |
1 | ||
2 | The following ``describe-events`` example list all the Amazon DocumentDB events for the last 24 hours (1440 minutes). :: | |
3 | ||
4 | aws docdb describe-events \ | |
5 | --duration 1440 | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "Events": [ | |
12 | { | |
13 | "EventCategories": [ | |
14 | "failover" | |
15 | ], | |
16 | "Message": "Started cross AZ failover to DB instance: sample-cluster", | |
17 | "Date": "2019-03-18T21:36:29.807Z", | |
18 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster", | |
19 | "SourceIdentifier": "sample-cluster", | |
20 | "SourceType": "db-cluster" | |
21 | }, | |
22 | { | |
23 | "EventCategories": [ | |
24 | "availability" | |
25 | ], | |
26 | "Message": "DB instance restarted", | |
27 | "Date": "2019-03-18T21:36:40.793Z", | |
28 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster", | |
29 | "SourceIdentifier": "sample-cluster", | |
30 | "SourceType": "db-instance" | |
31 | }, | |
32 | { | |
33 | "EventCategories": [], | |
34 | "Message": "A new writer was promoted. Restarting database as a reader.", | |
35 | "Date": "2019-03-18T21:36:43.873Z", | |
36 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
37 | "SourceIdentifier": "sample-cluster2", | |
38 | "SourceType": "db-instance" | |
39 | }, | |
40 | { | |
41 | "EventCategories": [ | |
42 | "availability" | |
43 | ], | |
44 | "Message": "DB instance restarted", | |
45 | "Date": "2019-03-18T21:36:51.257Z", | |
46 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
47 | "SourceIdentifier": "sample-cluster2", | |
48 | "SourceType": "db-instance" | |
49 | }, | |
50 | { | |
51 | "EventCategories": [ | |
52 | "failover" | |
53 | ], | |
54 | "Message": "Completed failover to DB instance: sample-cluster", | |
55 | "Date": "2019-03-18T21:36:53.462Z", | |
56 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster", | |
57 | "SourceIdentifier": "sample-cluster", | |
58 | "SourceType": "db-cluster" | |
59 | }, | |
60 | { | |
61 | "Date": "2019-03-19T16:51:48.847Z", | |
62 | "EventCategories": [ | |
63 | "configuration change" | |
64 | ], | |
65 | "Message": "Updated parameter audit_logs to enabled with apply method pending-reboot", | |
66 | "SourceIdentifier": "custom3-6-param-grp", | |
67 | "SourceType": "db-parameter-group" | |
68 | }, | |
69 | { | |
70 | "EventCategories": [ | |
71 | "configuration change" | |
72 | ], | |
73 | "Message": "Applying modification to database instance class", | |
74 | "Date": "2019-03-19T17:55:20.095Z", | |
75 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
76 | "SourceIdentifier": "sample-cluster2", | |
77 | "SourceType": "db-instance" | |
78 | }, | |
79 | { | |
80 | "EventCategories": [ | |
81 | "availability" | |
82 | ], | |
83 | "Message": "DB instance shutdown", | |
84 | "Date": "2019-03-19T17:56:31.127Z", | |
85 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
86 | "SourceIdentifier": "sample-cluster2", | |
87 | "SourceType": "db-instance" | |
88 | }, | |
89 | { | |
90 | "EventCategories": [ | |
91 | "configuration change" | |
92 | ], | |
93 | "Message": "Finished applying modification to DB instance class", | |
94 | "Date": "2019-03-19T18:00:45.822Z", | |
95 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
96 | "SourceIdentifier": "sample-cluster2", | |
97 | "SourceType": "db-instance" | |
98 | }, | |
99 | { | |
100 | "EventCategories": [ | |
101 | "availability" | |
102 | ], | |
103 | "Message": "DB instance restarted", | |
104 | "Date": "2019-03-19T18:00:53.397Z", | |
105 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
106 | "SourceIdentifier": "sample-cluster2", | |
107 | "SourceType": "db-instance" | |
108 | }, | |
109 | { | |
110 | "EventCategories": [ | |
111 | "availability" | |
112 | ], | |
113 | "Message": "DB instance shutdown", | |
114 | "Date": "2019-03-19T18:23:36.045Z", | |
115 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
116 | "SourceIdentifier": "sample-cluster2", | |
117 | "SourceType": "db-instance" | |
118 | }, | |
119 | { | |
120 | "EventCategories": [ | |
121 | "availability" | |
122 | ], | |
123 | "Message": "DB instance restarted", | |
124 | "Date": "2019-03-19T18:23:46.209Z", | |
125 | "SourceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
126 | "SourceIdentifier": "sample-cluster2", | |
127 | "SourceType": "db-instance" | |
128 | }, | |
129 | { | |
130 | "Date": "2019-03-19T18:39:05.822Z", | |
131 | "EventCategories": [ | |
132 | "configuration change" | |
133 | ], | |
134 | "Message": "Updated parameter ttl_monitor to enabled with apply method immediate", | |
135 | "SourceIdentifier": "custom3-6-param-grp", | |
136 | "SourceType": "db-parameter-group" | |
137 | }, | |
138 | { | |
139 | "Date": "2019-03-19T18:39:48.067Z", | |
140 | "EventCategories": [ | |
141 | "configuration change" | |
142 | ], | |
143 | "Message": "Updated parameter audit_logs to disabled with apply method immediate", | |
144 | "SourceIdentifier": "custom3-6-param-grp", | |
145 | "SourceType": "db-parameter-group" | |
146 | } | |
147 | ] | |
148 | } | |
149 | ||
150 | For more information, see `Viewing Amazon DocumentDB Events <https://docs.aws.amazon.com/ documentdb/latest/developerguide/managing-events.html#viewing-events>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To find the Amazon DocumentDB instance options you can order** | |
1 | ||
2 | The following ``describe-orderable-db-instance-options`` example lists all instance options for Amazon DocumentDB for a region. :: | |
3 | ||
4 | aws docdb describe-orderable-db-instance-options \ | |
5 | --engine docdb \ | |
6 | --region us-east-1 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "OrderableDBInstanceOptions": [ | |
12 | { | |
13 | "Vpc": true, | |
14 | "AvailabilityZones": [ | |
15 | { | |
16 | "Name": "us-east-1a" | |
17 | }, | |
18 | { | |
19 | "Name": "us-east-1b" | |
20 | }, | |
21 | { | |
22 | "Name": "us-east-1c" | |
23 | }, | |
24 | { | |
25 | "Name": "us-east-1d" | |
26 | } | |
27 | ], | |
28 | "EngineVersion": "3.6.0", | |
29 | "DBInstanceClass": "db.r4.16xlarge", | |
30 | "LicenseModel": "na", | |
31 | "Engine": "docdb" | |
32 | }, | |
33 | { | |
34 | "Vpc": true, | |
35 | "AvailabilityZones": [ | |
36 | { | |
37 | "Name": "us-east-1a" | |
38 | }, | |
39 | { | |
40 | "Name": "us-east-1b" | |
41 | }, | |
42 | { | |
43 | "Name": "us-east-1c" | |
44 | }, | |
45 | { | |
46 | "Name": "us-east-1d" | |
47 | } | |
48 | } | |
49 | ], | |
50 | "EngineVersion": "3.6.0", | |
51 | "DBInstanceClass": "db.r4.2xlarge", | |
52 | "LicenseModel": "na", | |
53 | "Engine": "docdb" | |
54 | }, | |
55 | { | |
56 | "Vpc": true, | |
57 | "AvailabilityZones": [ | |
58 | { | |
59 | "Name": "us-east-1a" | |
60 | }, | |
61 | { | |
62 | "Name": "us-east-1b" | |
63 | }, | |
64 | { | |
65 | "Name": "us-east-1c" | |
66 | }, | |
67 | { | |
68 | "Name": "us-east-1d" | |
69 | } | |
70 | ], | |
71 | "EngineVersion": "3.6.0", | |
72 | "DBInstanceClass": "db.r4.4xlarge", | |
73 | "LicenseModel": "na", | |
74 | "Engine": "docdb" | |
75 | }, | |
76 | { | |
77 | "Vpc": true, | |
78 | "AvailabilityZones": [ | |
79 | { | |
80 | "Name": "us-east-1a" | |
81 | }, | |
82 | { | |
83 | "Name": "us-east-1b" | |
84 | }, | |
85 | { | |
86 | "Name": "us-east-1c" | |
87 | }, | |
88 | { | |
89 | "Name": "us-east-1d" | |
90 | } | |
91 | ], | |
92 | "EngineVersion": "3.6.0", | |
93 | "DBInstanceClass": "db.r4.8xlarge", | |
94 | "LicenseModel": "na", | |
95 | "Engine": "docdb" | |
96 | }, | |
97 | { | |
98 | "Vpc": true, | |
99 | "AvailabilityZones": [ | |
100 | { | |
101 | "Name": "us-east-1a" | |
102 | }, | |
103 | { | |
104 | "Name": "us-east-1b" | |
105 | }, | |
106 | { | |
107 | "Name": "us-east-1c" | |
108 | }, | |
109 | { | |
110 | "Name": "us-east-1d" | |
111 | } | |
112 | ], | |
113 | "EngineVersion": "3.6.0", | |
114 | "DBInstanceClass": "db.r4.large", | |
115 | "LicenseModel": "na", | |
116 | "Engine": "docdb" | |
117 | }, | |
118 | { | |
119 | "Vpc": true, | |
120 | "AvailabilityZones": [ | |
121 | { | |
122 | "Name": "us-east-1a" | |
123 | }, | |
124 | { | |
125 | "Name": "us-east-1b" | |
126 | }, | |
127 | { | |
128 | "Name": "us-east-1c" | |
129 | }, | |
130 | { | |
131 | "Name": "us-east-1d" | |
132 | } | |
133 | ], | |
134 | "EngineVersion": "3.6.0", | |
135 | "DBInstanceClass": "db.r4.xlarge", | |
136 | "LicenseModel": "na", | |
137 | "Engine": "docdb" | |
138 | } | |
139 | ] | |
140 | } | |
141 | ||
142 | ||
143 | 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*. |
0 | **To list your pending Amazon DocumentDB maintenance actions** | |
1 | ||
2 | The following ``describe-pending-maintenance-actions`` example lists all your pending Amazon DocumentDB maintenance actions. :: | |
3 | ||
4 | aws docdb describe-pending-maintenance-actions | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "PendingMaintenanceActions": [] | |
10 | } | |
11 | ||
12 | For more information, see `Maintaining Amazon DocumentDB <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-maintain.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To force an Amazon DocumentDB cluster to failover to a replica** | |
1 | ||
2 | The following ``failover-db-cluster`` example causes the primary instance in the Amazon DocumentDB cluster sample-cluster to failover to a replica. :: | |
3 | ||
4 | aws docdb failover-db-cluster \ | |
5 | --db-cluster-identifier sample-cluster | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBCluster": { | |
11 | "AssociatedRoles": [], | |
12 | "DBClusterIdentifier": "sample-cluster", | |
13 | "EngineVersion": "3.6.0", | |
14 | "DBSubnetGroup": "default", | |
15 | "MasterUsername": "master-user", | |
16 | "EarliestRestorableTime": "2019-03-15T20:30:47.020Z", | |
17 | "Endpoint": "sample-cluster.cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
18 | "AvailabilityZones": [ | |
19 | "us-west-2a", | |
20 | "us-west-2c", | |
21 | "us-west-2b" | |
22 | ], | |
23 | "LatestRestorableTime": "2019-03-18T21:35:23.548Z", | |
24 | "PreferredMaintenanceWindow": "sat:04:30-sat:05:00", | |
25 | "PreferredBackupWindow": "00:00-00:30", | |
26 | "Port": 27017, | |
27 | "VpcSecurityGroups": [ | |
28 | { | |
29 | "VpcSecurityGroupId": "sg-77186e0d", | |
30 | "Status": "active" | |
31 | } | |
32 | ], | |
33 | "StorageEncrypted": false, | |
34 | "ClusterCreateTime": "2019-03-15T20:29:58.836Z", | |
35 | "MultiAZ": true, | |
36 | "Status": "available", | |
37 | "DBClusterMembers": [ | |
38 | { | |
39 | "DBClusterParameterGroupStatus": "in-sync", | |
40 | "IsClusterWriter": false, | |
41 | "DBInstanceIdentifier": "sample-cluster", | |
42 | "PromotionTier": 1 | |
43 | }, | |
44 | { | |
45 | "DBClusterParameterGroupStatus": "in-sync", | |
46 | "IsClusterWriter": true, | |
47 | "DBInstanceIdentifier": "sample-cluster2", | |
48 | "PromotionTier": 2 | |
49 | } | |
50 | ], | |
51 | "EnabledCloudwatchLogsExports": [ | |
52 | "audit" | |
53 | ], | |
54 | "DBClusterParameterGroup": "default.docdb3.6", | |
55 | "HostedZoneId": "ZNKXH85TT8WVW", | |
56 | "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster", | |
57 | "BackupRetentionPeriod": 3, | |
58 | "DbClusterResourceId": "cluster-UP4EF2PVDDFVHHDJQTYDAIGHLE", | |
59 | "ReaderEndpoint": "sample-cluster.cluster-ro-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
60 | "Engine": "docdb" | |
61 | } | |
62 | } | |
63 | ||
64 | For more information, see `Amazon DocumentDB Failover <https://docs.aws.amazon.com/documentdb/latest/developerguide/failover.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To list all the tags on an Amazon DocumentDB resource** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists all tags on the Amazon DocumentDB cluster ``sample-cluster``. :: | |
3 | ||
4 | aws docdb list-tags-for-resource \ | |
5 | --resource-name arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TagList": [ | |
11 | { | |
12 | "Key": "A", | |
13 | "Value": "ALPHA" | |
14 | }, | |
15 | { | |
16 | "Key": "B", | |
17 | "Value": "" | |
18 | }, | |
19 | { | |
20 | "Key": "C", | |
21 | "Value": "CHARLIE" | |
22 | } | |
23 | ] | |
24 | } | |
25 | ||
26 | For more information, see `Listing Tags on an Amazon DocumentDB Resource <https://docs.aws.amazon.com/documentdb/latest/developerguide/tagging.html#tagging-list>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To modify an Amazon DocumentDB DB cluster parameter group** | |
1 | ||
2 | The following ``modify-db-cluster-parameter-group`` example modifies the Amazon DocumentDB cluster parameter group ``custom3-6-param-grp`` by setting the two parameters ``audit_logs`` and ``ttl_monitor`` to enabled. The changes are applied at the next reboot. :: | |
3 | ||
4 | aws docdb modify-db-cluster-parameter-group \ | |
5 | --db-cluster-parameter-group-name custom3-6-param-grp \ | |
6 | --parameters ParameterName=audit_logs,ParameterValue=enabled,ApplyMethod=pending-reboot \ | |
7 | ParameterName=ttl_monitor,ParameterValue=enabled,ApplyMethod=pending-reboot | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "DBClusterParameterGroupName": "custom3-6-param-grp" | |
13 | } | |
14 | ||
15 | For more information, see `Modifying an Amazon DocumentDB Cluster Parameter Group <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-parameter-group-modify.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **Example 1: To add an attribute to an Amazon DocumentDB snapshot** | |
1 | ||
2 | The following ``modify-db-cluster-snapshot-attribute`` example adds four attribute values to an Amazon DocumentDB cluster snapshot. :: | |
3 | ||
4 | aws docdb modify-db-cluster-snapshot-attribute \ | |
5 | --db-cluster-snapshot-identifier sample-cluster-snapshot \ | |
6 | --attribute-name restore \ | |
7 | --values-to-add all 123456789011 123456789012 123456789013 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "DBClusterSnapshotAttributesResult": { | |
13 | "DBClusterSnapshotAttributes": [ | |
14 | { | |
15 | "AttributeName": "restore", | |
16 | "AttributeValues": [ | |
17 | "all", | |
18 | "123456789011", | |
19 | "123456789012", | |
20 | "123456789013" | |
21 | ] | |
22 | } | |
23 | ], | |
24 | "DBClusterSnapshotIdentifier": "sample-cluster-snapshot" | |
25 | } | |
26 | } | |
27 | ||
28 | **Example 2: To remove attributes from an Amazon DocumentDB snapshot** | |
29 | ||
30 | The following ``modify-db-cluster-snapshot-attribute`` example removes two attribute values from an Amazon DocumentDB cluster snapshot. :: | |
31 | ||
32 | aws docdb modify-db-cluster-snapshot-attribute \ | |
33 | --db-cluster-snapshot-identifier sample-cluster-snapshot \ | |
34 | --attribute-name restore \ | |
35 | --values-to-remove 123456789012 all | |
36 | ||
37 | Output:: | |
38 | ||
39 | { | |
40 | "DBClusterSnapshotAttributesResult": { | |
41 | "DBClusterSnapshotAttributes": [ | |
42 | { | |
43 | "AttributeName": "restore", | |
44 | "AttributeValues": [ | |
45 | "123456789011", | |
46 | "123456789013" | |
47 | ] | |
48 | } | |
49 | ], | |
50 | "DBClusterSnapshotIdentifier": "sample-cluster-snapshot" | |
51 | } | |
52 | } | |
53 | ||
54 | For more information, see `ModifyDBClusterSnapshotAttribute <https://docs.aws.amazon.com/documentdb/latest/developerguide/API_ModifyDBClusterSnapshotAttribute.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To modify an Amazon DocumentDB cluster** | |
1 | ||
2 | The following ``modify-db-cluster`` example modifies the Amazon DocumentDB cluster ``sample-cluster`` by making the retention period for automatic backups 7 days, and changing the preferred windows for both backups and maintenance. All changes are applied at the next maintenance window. :: | |
3 | ||
4 | aws docdb modify-db-cluster \ | |
5 | --db-cluster-identifier sample-cluster \ | |
6 | --no-apply-immediately \ | |
7 | --backup-retention-period 7 \ | |
8 | --preferred-backup-window 18:00-18:30 \ | |
9 | --preferred-maintenance-window sun:20:00-sun:20:30 | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "DBCluster": { | |
15 | "Endpoint": "sample-cluster.cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
16 | "DBClusterMembers": [ | |
17 | { | |
18 | "DBClusterParameterGroupStatus": "in-sync", | |
19 | "DBInstanceIdentifier": "sample-cluster", | |
20 | "IsClusterWriter": true, | |
21 | "PromotionTier": 1 | |
22 | }, | |
23 | { | |
24 | "DBClusterParameterGroupStatus": "in-sync", | |
25 | "DBInstanceIdentifier": "sample-cluster2", | |
26 | "IsClusterWriter": false, | |
27 | "PromotionTier": 2 | |
28 | } | |
29 | ], | |
30 | "HostedZoneId": "ZNKXH85TT8WVW", | |
31 | "StorageEncrypted": false, | |
32 | "PreferredBackupWindow": "18:00-18:30", | |
33 | "MultiAZ": true, | |
34 | "EngineVersion": "3.6.0", | |
35 | "MasterUsername": "master-user", | |
36 | "ReaderEndpoint": "sample-cluster.cluster-ro-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
37 | "DBSubnetGroup": "default", | |
38 | "LatestRestorableTime": "2019-03-18T22:08:13.408Z", | |
39 | "EarliestRestorableTime": "2019-03-15T20:30:47.020Z", | |
40 | "PreferredMaintenanceWindow": "sun:20:00-sun:20:30", | |
41 | "AssociatedRoles": [], | |
42 | "EnabledCloudwatchLogsExports": [ | |
43 | "audit" | |
44 | ], | |
45 | "Engine": "docdb", | |
46 | "DBClusterParameterGroup": "default.docdb3.6", | |
47 | "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster", | |
48 | "BackupRetentionPeriod": 7, | |
49 | "DBClusterIdentifier": "sample-cluster", | |
50 | "AvailabilityZones": [ | |
51 | "us-west-2a", | |
52 | "us-west-2c", | |
53 | "us-west-2b" | |
54 | ], | |
55 | "Status": "available", | |
56 | "DbClusterResourceId": "cluster-UP4EF2PVDDFVHHDJQTYDAIGHLE", | |
57 | "ClusterCreateTime": "2019-03-15T20:29:58.836Z", | |
58 | "VpcSecurityGroups": [ | |
59 | { | |
60 | "VpcSecurityGroupId": "sg-77186e0d", | |
61 | "Status": "active" | |
62 | } | |
63 | ], | |
64 | "Port": 27017 | |
65 | } | |
66 | } | |
67 | ||
68 | For more information, see `Modifying an Amazon DocumentDB Cluster <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-modify.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To modify an Amazon DocumentDB instance** | |
1 | ||
2 | The following ``modify-db-instance`` example modifies the Amazon DocumentDB instance ``sample-cluster2`` by changing its instance class to ``db.r4.4xlarge`` and its promotion tier to ``5``. The changes are applied immediately but can only be seen after the instances status is available. :: | |
3 | ||
4 | aws docdb modify-db-instance \ | |
5 | --db-instance-identifier sample-cluster2 \ | |
6 | --apply-immediately \ | |
7 | --db-instance-class db.r4.4xlarge \ | |
8 | --promotion-tier 5 | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "DBInstance": { | |
14 | "EngineVersion": "3.6.0", | |
15 | "StorageEncrypted": false, | |
16 | "DBInstanceClass": "db.r4.large", | |
17 | "PreferredMaintenanceWindow": "mon:08:39-mon:09:09", | |
18 | "AutoMinorVersionUpgrade": true, | |
19 | "VpcSecurityGroups": [ | |
20 | { | |
21 | "VpcSecurityGroupId": "sg-77186e0d", | |
22 | "Status": "active" | |
23 | } | |
24 | ], | |
25 | "PreferredBackupWindow": "18:00-18:30", | |
26 | "EnabledCloudwatchLogsExports": [ | |
27 | "audit" | |
28 | ], | |
29 | "AvailabilityZone": "us-west-2f", | |
30 | "DBInstanceIdentifier": "sample-cluster2", | |
31 | "InstanceCreateTime": "2019-03-15T20:36:06.338Z", | |
32 | "Engine": "docdb", | |
33 | "BackupRetentionPeriod": 7, | |
34 | "DBSubnetGroup": { | |
35 | "DBSubnetGroupName": "default", | |
36 | "DBSubnetGroupDescription": "default", | |
37 | "SubnetGroupStatus": "Complete", | |
38 | "Subnets": [ | |
39 | { | |
40 | "SubnetIdentifier": "subnet-4e26d263", | |
41 | "SubnetAvailabilityZone": { | |
42 | "Name": "us-west-2a" | |
43 | }, | |
44 | "SubnetStatus": "Active" | |
45 | }, | |
46 | { | |
47 | "SubnetIdentifier": "subnet-afc329f4", | |
48 | "SubnetAvailabilityZone": { | |
49 | "Name": "us-west-2c" | |
50 | }, | |
51 | "SubnetStatus": "Active" | |
52 | }, | |
53 | { | |
54 | "SubnetIdentifier": "subnet-53ab3636", | |
55 | "SubnetAvailabilityZone": { | |
56 | "Name": "us-west-2d" | |
57 | }, | |
58 | "SubnetStatus": "Active" | |
59 | }, | |
60 | { | |
61 | "SubnetIdentifier": "subnet-991cb8d0", | |
62 | "SubnetAvailabilityZone": { | |
63 | "Name": "us-west-2b" | |
64 | }, | |
65 | "SubnetStatus": "Active" | |
66 | } | |
67 | ], | |
68 | "VpcId": "vpc-91280df6" | |
69 | }, | |
70 | "PromotionTier": 2, | |
71 | "Endpoint": { | |
72 | "Address": "sample-cluster2.corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
73 | "HostedZoneId": "ZNKXH85TT8WVW", | |
74 | "Port": 27017 | |
75 | }, | |
76 | "DbiResourceId": "db-A2GIKUV6KPOHITGGKI2NHVISZA", | |
77 | "DBClusterIdentifier": "sample-cluster", | |
78 | "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
79 | "PendingModifiedValues": { | |
80 | "DBInstanceClass": "db.r4.4xlarge" | |
81 | }, | |
82 | "PubliclyAccessible": false, | |
83 | "DBInstanceStatus": "available" | |
84 | } | |
85 | } | |
86 | ||
87 | For more information, see `Modifying an Amazon DocumentDB Instance <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-modify.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To modify an Amazon DocumentDB subnet group** | |
1 | ||
2 | The following ``modify-db-subnet-group`` example modifies the subnet group ``sample-subnet-group`` by adding the specified subnets and a new description. :: | |
3 | ||
4 | aws docdb modify-db-subnet-group \ | |
5 | --db-subnet-group-name sample-subnet-group \ | |
6 | --subnet-ids subnet-b3806e8f subnet-53ab3636 subnet-991cb8d0 \ | |
7 | --db-subnet-group-description "New subnet description" | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "DBSubnetGroup": { | |
13 | "DBSubnetGroupName": "sample-subnet-group", | |
14 | "SubnetGroupStatus": "Complete", | |
15 | "DBSubnetGroupArn": "arn:aws:rds:us-west-2:123456789012:subgrp:sample-subnet-group", | |
16 | "VpcId": "vpc-91280df6", | |
17 | "DBSubnetGroupDescription": "New subnet description", | |
18 | "Subnets": [ | |
19 | { | |
20 | "SubnetIdentifier": "subnet-b3806e8f", | |
21 | "SubnetStatus": "Active", | |
22 | "SubnetAvailabilityZone": { | |
23 | "Name": "us-west-2a" | |
24 | } | |
25 | }, | |
26 | { | |
27 | "SubnetIdentifier": "subnet-53ab3636", | |
28 | "SubnetStatus": "Active", | |
29 | "SubnetAvailabilityZone": { | |
30 | "Name": "us-west-2c" | |
31 | } | |
32 | }, | |
33 | { | |
34 | "SubnetIdentifier": "subnet-991cb8d0", | |
35 | "SubnetStatus": "Active", | |
36 | "SubnetAvailabilityZone": { | |
37 | "Name": "us-west-2b" | |
38 | } | |
39 | } | |
40 | ] | |
41 | } | |
42 | } | |
43 | ||
44 | For more information, see `Modifying an Amazon DocumentDB Subnet Group <https://docs.aws.amazon.com/documentdb/latest/developerguide/document-db-subnet-groups.html#document-db-subnet-group-modify>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To reboot an Amazon DocumentDB instance** | |
1 | ||
2 | The following ``reboot-db-instance`` example reboots the Amazon DocumentDB instance ``sample-cluster2``. :: | |
3 | ||
4 | aws docdb reboot-db-instance \ | |
5 | --db-instance-identifier sample-cluster2 | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "DBInstance": { | |
12 | "PreferredBackupWindow": "18:00-18:30", | |
13 | "DBInstanceIdentifier": "sample-cluster2", | |
14 | "VpcSecurityGroups": [ | |
15 | { | |
16 | "Status": "active", | |
17 | "VpcSecurityGroupId": "sg-77186e0d" | |
18 | } | |
19 | ], | |
20 | "DBSubnetGroup": { | |
21 | "VpcId": "vpc-91280df6", | |
22 | "Subnets": [ | |
23 | { | |
24 | "SubnetStatus": "Active", | |
25 | "SubnetAvailabilityZone": { | |
26 | "Name": "us-west-2a" | |
27 | }, | |
28 | "SubnetIdentifier": "subnet-4e26d263" | |
29 | }, | |
30 | { | |
31 | "SubnetStatus": "Active", | |
32 | "SubnetAvailabilityZone": { | |
33 | "Name": "us-west-2c" | |
34 | }, | |
35 | "SubnetIdentifier": "subnet-afc329f4" | |
36 | }, | |
37 | { | |
38 | "SubnetStatus": "Active", | |
39 | "SubnetAvailabilityZone": { | |
40 | "Name": "us-west-2d" | |
41 | }, | |
42 | "SubnetIdentifier": "subnet-53ab3636" | |
43 | }, | |
44 | { | |
45 | "SubnetStatus": "Active", | |
46 | "SubnetAvailabilityZone": { | |
47 | "Name": "us-west-2b" | |
48 | }, | |
49 | "SubnetIdentifier": "subnet-991cb8d0" | |
50 | } | |
51 | ], | |
52 | "SubnetGroupStatus": "Complete", | |
53 | "DBSubnetGroupName": "default", | |
54 | "DBSubnetGroupDescription": "default" | |
55 | }, | |
56 | "PendingModifiedValues": {}, | |
57 | "Endpoint": { | |
58 | "Address": "sample-cluster2.corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
59 | "HostedZoneId": "ZNKXH85TT8WVW", | |
60 | "Port": 27017 | |
61 | }, | |
62 | "EnabledCloudwatchLogsExports": [ | |
63 | "audit" | |
64 | ], | |
65 | "StorageEncrypted": false, | |
66 | "DbiResourceId": "db-A2GIKUV6KPOHITGGKI2NHVISZA", | |
67 | "AutoMinorVersionUpgrade": true, | |
68 | "Engine": "docdb", | |
69 | "InstanceCreateTime": "2019-03-15T20:36:06.338Z", | |
70 | "EngineVersion": "3.6.0", | |
71 | "PromotionTier": 5, | |
72 | "BackupRetentionPeriod": 7, | |
73 | "DBClusterIdentifier": "sample-cluster", | |
74 | "PreferredMaintenanceWindow": "mon:08:39-mon:09:09", | |
75 | "PubliclyAccessible": false, | |
76 | "DBInstanceClass": "db.r4.4xlarge", | |
77 | "AvailabilityZone": "us-west-2d", | |
78 | "DBInstanceArn": "arn:aws:rds:us-west-2:123456789012:db:sample-cluster2", | |
79 | "DBInstanceStatus": "rebooting" | |
80 | } | |
81 | } | |
82 | ||
83 | For more information, see `Rebooting an Amazon DocumentDB ILnstance <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-reboot.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To remove tags from an Amazon DocumentDB resource** | |
1 | ||
2 | The following ``remove-tags-from-resource`` example removes the tag with the key named ``B`` from the Amazon DocumentDB cluster ``sample-cluster``. :: | |
3 | ||
4 | aws docdb remove-tags-from-resource \ | |
5 | --resource-name arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster \ | |
6 | --tag-keys B | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Removing Tags from an Amazon DocumentDBResource <https://docs.aws.amazon.com/documentdb/latest/developerguide/tagging.html#tagging-remove>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To reset the specified parameter value to its defaults in an Amazon DocumentDB parameter group** | |
1 | ||
2 | The following ``reset-db-cluster-parameter-group`` example resets the parameter ``ttl_monitor`` in the Amazon DocumentDB parameter group ``custom3-6-param-grp`` to its default value. :: | |
3 | ||
4 | aws docdb reset-db-cluster-parameter-group \ | |
5 | --db-cluster-parameter-group-name custom3-6-param-grp \ | |
6 | --parameters ParameterName=ttl_monitor,ApplyMethod=immediate | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "DBClusterParameterGroupName": "custom3-6-param-grp" | |
12 | } | |
13 | ||
14 | For more information, see `title <link>`__ in the *Amazon DocumentDB Developer Guide*. | |
15 | ||
16 | **To reset specified or all parameter values to their defaults in an Amazon DocumentDB parameter group** | |
17 | ||
18 | The following ``reset-db-cluster-parameter-group`` example resets all parameters in the Amazon DocumentDB parameter group ``custom3-6-param-grp`` to their default value. :: | |
19 | ||
20 | aws docdb reset-db-cluster-parameter-group \ | |
21 | --db-cluster-parameter-group-name custom3-6-param-grp \ | |
22 | --reset-all-parameters | |
23 | ||
24 | Output:: | |
25 | ||
26 | { | |
27 | "DBClusterParameterGroupName": "custom3-6-param-grp" | |
28 | } | |
29 | ||
30 | For more information, see `Resetting an Amazon DocumentDB Cluster Parameter Group <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-parameter-group-reset.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To restore an Amazon DocumentDB cluster from an automatic or manual snapshot** | |
1 | ||
2 | The following ``restore-db-cluster-from-snapshot`` example creates a new Amazon DocumentDB cluster named ``sample-cluster-2019-03-16-00-01-restored`` from the snapshot ``rds:sample-cluster-2019-03-16-00-01``. :: | |
3 | ||
4 | aws docdb restore-db-cluster-from-snapshot \ | |
5 | --db-cluster-identifier sample-cluster-2019-03-16-00-01-restored \ | |
6 | --engine docdb \ | |
7 | --snapshot-identifier rds:sample-cluster-2019-03-16-00-01 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "DBCluster": { | |
13 | "ClusterCreateTime": "2019-03-19T18:45:01.857Z", | |
14 | "HostedZoneId": "ZNKXH85TT8WVW", | |
15 | "Engine": "docdb", | |
16 | "DBClusterMembers": [], | |
17 | "MultiAZ": false, | |
18 | "AvailabilityZones": [ | |
19 | "us-west-2a", | |
20 | "us-west-2c", | |
21 | "us-west-2b" | |
22 | ], | |
23 | "StorageEncrypted": false, | |
24 | "ReaderEndpoint": "sample-cluster-2019-03-16-00-01-restored.cluster-ro-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
25 | "Endpoint": "sample-cluster-2019-03-16-00-01-restored.cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
26 | "Port": 27017, | |
27 | "PreferredBackupWindow": "00:00-00:30", | |
28 | "DBSubnetGroup": "default", | |
29 | "DBClusterIdentifier": "sample-cluster-2019-03-16-00-01-restored", | |
30 | "PreferredMaintenanceWindow": "sat:04:30-sat:05:00", | |
31 | "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster-2019-03-16-00-01-restored", | |
32 | "DBClusterParameterGroup": "default.docdb3.6", | |
33 | "DbClusterResourceId": "cluster-XOO46Q3RH4LWSYNH3NMZKXPISU", | |
34 | "MasterUsername": "master-user", | |
35 | "EngineVersion": "3.6.0", | |
36 | "BackupRetentionPeriod": 3, | |
37 | "AssociatedRoles": [], | |
38 | "Status": "creating", | |
39 | "VpcSecurityGroups": [ | |
40 | { | |
41 | "Status": "active", | |
42 | "VpcSecurityGroupId": "sg-77186e0d" | |
43 | } | |
44 | ] | |
45 | } | |
46 | } | |
47 | ||
48 | ||
49 | For more information, see `Restoring from a Cluster Snapshot <https://docs.aws.amazon.com/documentdb/latest/developerguide/backup-restore.restore-from-snapshot.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To restore an Amazon DocumentDB cluster to a point-in-time from a manual snapshot** | |
1 | ||
2 | The following ``restore-db-cluster-to-point-in-time`` example uses the ``sample-cluster-snapshot`` to create a new Amazon DocumentDB cluster, ``sample-cluster-pit``, using the latest restorable time. :: | |
3 | ||
4 | aws docdb restore-db-cluster-to-point-in-time \ | |
5 | --db-cluster-identifier sample-cluster-pit \ | |
6 | --source-db-cluster-identifier arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster \ | |
7 | --use-latest-restorable-time | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "DBCluster": { | |
13 | "StorageEncrypted": false, | |
14 | "BackupRetentionPeriod": 3, | |
15 | "MasterUsername": "master-user", | |
16 | "HostedZoneId": "ZNKXH85TT8WVW", | |
17 | "PreferredBackupWindow": "00:00-00:30", | |
18 | "MultiAZ": false, | |
19 | "DBClusterIdentifier": "sample-cluster-pit", | |
20 | "DBSubnetGroup": "default", | |
21 | "ClusterCreateTime": "2019-04-03T15:55:21.320Z", | |
22 | "AssociatedRoles": [], | |
23 | "DBClusterParameterGroup": "default.docdb3.6", | |
24 | "DBClusterMembers": [], | |
25 | "Status": "creating", | |
26 | "AvailabilityZones": [ | |
27 | "us-west-2a", | |
28 | "us-west-2d", | |
29 | "us-west-2b" | |
30 | ], | |
31 | "ReaderEndpoint": "sample-cluster-pit.cluster-ro-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
32 | "Port": 27017, | |
33 | "Engine": "docdb", | |
34 | "EngineVersion": "3.6.0", | |
35 | "VpcSecurityGroups": [ | |
36 | { | |
37 | "VpcSecurityGroupId": "sg-77186e0d", | |
38 | "Status": "active" | |
39 | } | |
40 | ], | |
41 | "PreferredMaintenanceWindow": "sat:04:30-sat:05:00", | |
42 | "Endpoint": "sample-cluster-pit.cluster-corcjozrlsfc.us-west-2.docdb.amazonaws.com", | |
43 | "DbClusterResourceId": "cluster-NLCABBXOSE2QPQ4GOLZIFWEPLM", | |
44 | "DBClusterArn": "arn:aws:rds:us-west-2:123456789012:cluster:sample-cluster-pit" | |
45 | } | |
46 | } | |
47 | ||
48 | For more information, see `Restoring a Snapshot to a Point in Time <https://docs.aws.amazon.com/documentdb/latest/developerguide/backup-restore.point-in-time-recovery.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To start a stopped Amazon DocumentDB cluster** | |
1 | ||
2 | The following ``start-db-cluster`` example starts the specified Amazon DocumentDB cluster. :: | |
3 | ||
4 | aws docdb start-db-cluster \ | |
5 | --db-cluster-identifier sample-cluster | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBCluster": { | |
11 | "ClusterCreateTime": "2019-03-19T18:45:01.857Z", | |
12 | "HostedZoneId": "ZNKXH85TT8WVW", | |
13 | "Engine": "docdb", | |
14 | "DBClusterMembers": [], | |
15 | "MultiAZ": false, | |
16 | "AvailabilityZones": [ | |
17 | "us-east-1a", | |
18 | "us-east-1c", | |
19 | "us-east-1f" | |
20 | ], | |
21 | "StorageEncrypted": false, | |
22 | "ReaderEndpoint": "sample-cluster-2019-03-16-00-01-restored.cluster-ro-corcjozrlsfc.us-east-1.docdb.amazonaws.com", | |
23 | "Endpoint": "sample-cluster-2019-03-16-00-01-restored.cluster-corcjozrlsfc.us-east-1.docdb.amazonaws.com", | |
24 | "Port": 27017, | |
25 | "PreferredBackupWindow": "00:00-00:30", | |
26 | "DBSubnetGroup": "default", | |
27 | "DBClusterIdentifier": "sample-cluster-2019-03-16-00-01-restored", | |
28 | "PreferredMaintenanceWindow": "sat:04:30-sat:05:00", | |
29 | "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-cluster-2019-03-16-00-01-restored", | |
30 | "DBClusterParameterGroup": "default.docdb3.6", | |
31 | "DbClusterResourceId": "cluster-XOO46Q3RH4LWSYNH3NMZKXPISU", | |
32 | "MasterUsername": "master-user", | |
33 | "EngineVersion": "3.6.0", | |
34 | "BackupRetentionPeriod": 3, | |
35 | "AssociatedRoles": [], | |
36 | "Status": "creating", | |
37 | "VpcSecurityGroups": [ | |
38 | { | |
39 | "Status": "active", | |
40 | "VpcSecurityGroupId": "sg-77186e0d" | |
41 | } | |
42 | ] | |
43 | } | |
44 | } | |
45 | ||
46 | For more information, see `Stopping and Starting an Amazon DocumentDB Cluster <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-stop-start.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To stop a running Amazon DocumentDB cluster** | |
1 | ||
2 | The following ``stop-db-cluster`` example stops the specified Amazon DocumentDB cluster. :: | |
3 | ||
4 | aws docdb stop-db-cluster \ | |
5 | --db-cluster-identifier sample-cluster | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DBCluster": { | |
11 | "ClusterCreateTime": "2019-03-19T18:45:01.857Z", | |
12 | "HostedZoneId": "ZNKXH85TT8WVW", | |
13 | "Engine": "docdb", | |
14 | "DBClusterMembers": [], | |
15 | "MultiAZ": false, | |
16 | "AvailabilityZones": [ | |
17 | "us-east-1a", | |
18 | "us-east-1c", | |
19 | "us-east-1f" | |
20 | ], | |
21 | "StorageEncrypted": false, | |
22 | "ReaderEndpoint": "sample-cluster-2019-03-16-00-01-restored.cluster-ro-corcjozrlsfc.us-east-1.docdb.amazonaws.com", | |
23 | "Endpoint": "sample-cluster-2019-03-16-00-01-restored.cluster-corcjozrlsfc.us-east-1.docdb.amazonaws.com", | |
24 | "Port": 27017, | |
25 | "PreferredBackupWindow": "00:00-00:30", | |
26 | "DBSubnetGroup": "default", | |
27 | "DBClusterIdentifier": "sample-cluster-2019-03-16-00-01-restored", | |
28 | "PreferredMaintenanceWindow": "sat:04:30-sat:05:00", | |
29 | "DBClusterArn": "arn:aws:rds:us-east-1:123456789012:cluster:sample-cluster-2019-03-16-00-01-restored", | |
30 | "DBClusterParameterGroup": "default.docdb3.6", | |
31 | "DbClusterResourceId": "cluster-XOO46Q3RH4LWSYNH3NMZKXPISU", | |
32 | "MasterUsername": "master-user", | |
33 | "EngineVersion": "3.6.0", | |
34 | "BackupRetentionPeriod": 3, | |
35 | "AssociatedRoles": [], | |
36 | "Status": "creating", | |
37 | "VpcSecurityGroups": [ | |
38 | { | |
39 | "Status": "active", | |
40 | "VpcSecurityGroupId": "sg-77186e0d" | |
41 | } | |
42 | ] | |
43 | } | |
44 | } | |
45 | ||
46 | For more information, see `Stopping and Starting an Amazon DocumentDB Cluster <https://docs.aws.amazon.com/documentdb/latest/developerguide/db-cluster-stop-start.html>`__ in the *Amazon DocumentDB Developer Guide*. |
0 | **To pause running until the specified instance is available** | |
1 | ||
2 | The following ``wait role-exists`` command pauses and continues only after it can confirm that the specified database cluster instance exists. :: | |
3 | ||
4 | aws docdb wait db-instance-available \ | |
5 | --db-instance-identifier "sample-instance" | |
6 | ||
7 | This command produces no output. |
0 | **To pause running until the specified cluster instance is deleted** | |
1 | ||
2 | The following ``wait db-instance-deleted`` command pauses and continues only after it can confirm that the specified database cluster instance is deleted. :: | |
3 | ||
4 | aws docdb wait db-instance-deleted \ | |
5 | --db-instance-identifier "sample-instance" | |
6 | ||
7 | This command produces no output. |
0 | **To accept a request to attach a VPC to a transit gateway.** | |
1 | ||
2 | The following ``accept-transit-gateway-vpc-attachment`` example accepts the request forte specified attachment. :: | |
3 | ||
4 | accept-transit-gateway-vpc-attachment \ | |
5 | --transit-gateway-attachment-id tgw-attach-0a34fe6b4fEXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TransitGatewayVpcAttachment": { | |
11 | "TransitGatewayAttachmentId": "tgw-attach-0a34fe6b4fEXAMPLE", | |
12 | "TransitGatewayId": "tgw-0262a0e521EXAMPLE", | |
13 | "VpcId": "vpc-07e8ffd50fEXAMPLE", | |
14 | "VpcOwnerId": "123456789012", | |
15 | "State": "pending", | |
16 | "SubnetIds": [ | |
17 | "subnet-0752213d59EXAMPLE" | |
18 | ], | |
19 | "CreationTime": "2019-07-10T17:33:46.000Z", | |
20 | "Options": { | |
21 | "DnsSupport": "enable", | |
22 | "Ipv6Support": "disable" | |
23 | } | |
24 | } | |
25 | } | |
26 | ||
27 | For more information, see `Transit Gateway Attachments to a VPC<https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html>`__ in the *AWS Transit Gateways Guide*. |
0 | **To advertise an address range** | |
1 | ||
2 | The following ``advertise-byoip-cidr`` example advertises the specified public IPv4 address range. :: | |
3 | ||
4 | aws ec2 advertise-byoip-cidr \ | |
5 | --cidr 203.0.113.25/24 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ByoipCidr": { | |
11 | "Cidr": "203.0.113.25/24", | |
12 | "StatusMessage": "ipv4pool-ec2-1234567890abcdef0", | |
13 | "State": "provisioned" | |
14 | } | |
15 | } |
0 | **To allocate an Elastic IP address for EC2-Classic** | |
0 | **Example 1: To allocate an Elastic IP address for EC2-Classic** | |
1 | 1 | |
2 | This example allocates an Elastic IP address to use with an instance in EC2-Classic. | |
2 | The following ``allocate-address`` example allocates an Elastic IP address to use with an instance in EC2-Classic. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 allocate-address | |
4 | aws ec2 allocate-address | |
7 | 5 | |
8 | 6 | Output:: |
9 | 7 | |
10 | { | |
11 | "PublicIp": "198.51.100.0", | |
12 | "Domain": "standard" | |
13 | } | |
8 | { | |
9 | "PublicIp": "198.51.100.0", | |
10 | "PublicIpv4Pool": "amazon", | |
11 | "Domain": "standard" | |
12 | } | |
14 | 13 | |
15 | **To allocate an Elastic IP address for EC2-VPC** | |
14 | **Example 2: To allocate an Elastic IP address for EC2-VPC** | |
16 | 15 | |
17 | This example allocates an Elastic IP address to use with an instance in a VPC. | |
16 | The following ``allocate-address`` example allocates an Elastic IP address to use with an instance in a VPC. :: | |
18 | 17 | |
19 | Command:: | |
20 | ||
21 | aws ec2 allocate-address --domain vpc | |
18 | aws ec2 allocate-address \ | |
19 | --domain vpc | |
22 | 20 | |
23 | 21 | Output:: |
24 | 22 | |
25 | { | |
26 | "PublicIp": "203.0.113.0", | |
27 | "Domain": "vpc", | |
28 | "AllocationId": "eipalloc-64d5890a" | |
29 | } | |
30 | ||
23 | { | |
24 | "PublicIp": "203.0.113.0", | |
25 | "PublicIpv4Pool": "amazon", | |
26 | "Domain": "vpc", | |
27 | "AllocationId": "eipalloc-07b6d55388acd1884" | |
28 | } |
0 | **To allocate a Dedicated host to your account** | |
0 | **Example 1: To allocate a Dedicated Host** | |
1 | 1 | |
2 | This example allocates a single Dedicated host in a specific Availability Zone, onto which you can launch m3.medium instances, to your account. | |
2 | The following ``allocate-hosts`` example allocates a single Dedicated Host in the ``eu-west-1a`` Availability Zone, onto which you can launch ``m5.large`` instances. By default, the Dedicated Host accepts only target instance launches, and does not support host recovery. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 allocate-hosts --instance-type m3.medium --availability-zone us-east-1b --quantity 1 | |
4 | aws ec2 allocate-hosts \ | |
5 | --instance-type m5.large \ | |
6 | --availability-zone eu-west-1a \ | |
7 | --quantity 1 | |
7 | 8 | |
8 | 9 | Output:: |
9 | 10 | |
10 | { | |
11 | "HostIds": [ | |
12 | "h-029e7409a337631f" | |
13 | ] | |
14 | } | |
11 | { | |
12 | "HostIds": [ | |
13 | "h-07879acf49EXAMPLE" | |
14 | ] | |
15 | } | |
15 | 16 | |
17 | **Example 2: To allocate a Dedicated Host with auto-placement and host recovery enabled** | |
16 | 18 | |
19 | The following ``allocate-hosts`` example allocates a single Dedicated Host in the ``eu-west-1a`` Availability Zone with auto-placement and host recovery enabled. :: | |
20 | ||
21 | aws ec2 allocate-hosts \ | |
22 | --instance-type m5.large \ | |
23 | --availability-zone eu-west-1a \ | |
24 | --auto-placement on \ | |
25 | --host-recovery on \ | |
26 | --quantity 1 | |
27 | ||
28 | Output:: | |
29 | ||
30 | { | |
31 | "HostIds": [ | |
32 | "h-07879acf49EXAMPLE" | |
33 | ] | |
34 | } | |
35 | ||
36 | **Example 3: To allocate a Dedicated Host with tags** | |
37 | ||
38 | The following ``allocate-hosts`` example allocates a single Dedicated Host and applies a tag with a key named ``purpose`` and a value of ``production``. :: | |
39 | ||
40 | aws ec2 allocate-hosts \ | |
41 | --instance-type m5.large \ | |
42 | --availability-zone eu-west-1a \ | |
43 | --quantity 1 \ | |
44 | --tag-specifications 'ResourceType=dedicated-host,Tags={Key=purpose,Value=production}' | |
45 | ||
46 | Output:: | |
47 | ||
48 | { | |
49 | "HostIds": [ | |
50 | "h-07879acf49EXAMPLE" | |
51 | ] | |
52 | } | |
53 | ||
54 | For more information, see `Allocating Dedicated Hosts <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-allocating>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. |
0 | **To associate a transit gateway route table with a transit gateway attachment** | |
1 | ||
2 | The following example associates the specified transit gateway route table with the specified VPC attachment. :: | |
3 | ||
4 | aws ec2 associate-transit-gateway-route-table \ | |
5 | --transit-gateway-route-table-id tgw-rtb-002573ed1eEXAMPLE \ | |
6 | --transit-gateway-attachment-id tgw-attach-0b5968d3b6EXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Association": { | |
12 | "TransitGatewayRouteTableId": "tgw-rtb-002573ed1eEXAMPLE", | |
13 | "TransitGatewayAttachmentId": "tgw-attach-0b5968d3b6EXAMPLE", | |
14 | "ResourceId": "vpc-0065acced4EXAMPLE", | |
15 | "ResourceType": "vpc", | |
16 | "State": "associating" | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Associate a Transit Gateway Route Table <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#associate-tgw-route-table>`__ in the *AWS Transit Gateways Guide*. |
0 | **To cancel a capacity reservation** | |
1 | ||
2 | The following ``cancel-capacity-reservation`` example cancels the specified capacity reservation. :: | |
3 | ||
4 | aws ec2 cancel-capacity-reservation \ | |
5 | --capacity-reservation-id cr-1234abcd56EXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Return": true | |
11 | } | |
12 | ||
13 | For more information, see `Canceling a Capacity Reservation <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-release>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. |
0 | **To cancel an import task** | |
1 | ||
2 | The following ``cancel-import-task`` example cancels the specified import image task. :: | |
3 | ||
4 | aws ec2 cancel-import-task \ | |
5 | --import-task-id import-ami-1234567890abcdef0 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ImportTaskId": "import-ami-1234567890abcdef0", | |
11 | "PreviousState": "active", | |
12 | "State": "deleting" | |
13 | } |
0 | **Example 1: To create a Capacity Reservation** | |
1 | ||
2 | The following ``create-capacity-reservation`` example creates a capacity reservation in the ``eu-west-1a`` Availability Zone, into which you can launch three ``t2.medium`` instances running a Linux/Unix operating system. By default, the capacity reservation is created with open instance matching criteria and no support for ephemeral storage, and it remains active until you manually cancel it. :: | |
3 | ||
4 | aws ec2 create-capacity-reservation \ | |
5 | --availability-zone eu-west-1a \ | |
6 | --instance-type t2.medium \ | |
7 | --instance-platform Linux/UNIX \ | |
8 | --instance-count 3 | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "CapacityReservation": { | |
14 | "CapacityReservationId": "cr-1234abcd56EXAMPLE ", | |
15 | "EndDateType": "unlimited", | |
16 | "AvailabilityZone": "eu-west-1a", | |
17 | "InstanceMatchCriteria": "open", | |
18 | "EphemeralStorage": false, | |
19 | "CreateDate": "2019-08-16T09:27:35.000Z", | |
20 | "AvailableInstanceCount": 3, | |
21 | "InstancePlatform": "Linux/UNIX", | |
22 | "TotalInstanceCount": 3, | |
23 | "State": "active", | |
24 | "Tenancy": "default", | |
25 | "EbsOptimized": false, | |
26 | "InstanceType": "t2.medium" | |
27 | } | |
28 | } | |
29 | ||
30 | **Example 2: To create a Capacity Reservation that automatically ends at a specified date/time** | |
31 | ||
32 | The following ``create-capacity-reservation`` example creates a capacity reservation in the ``eu-west-1a`` Availability Zone, into which you can launch three ``m5.large`` instances running a Linux/Unix operating system. This capacity reservation automatically ends on 08/31/2019 at 23:59:59. | |
33 | ||
34 | aws ec2 create-capacity-reservation \ | |
35 | --availability-zone eu-west-1a \ | |
36 | --instance-type m5.large \ | |
37 | --instance-platform Linux/UNIX \ | |
38 | --instance-count 3 \ | |
39 | --end-date-type limited \ | |
40 | --end-date 2019-08-31T23:59:59Z | |
41 | ||
42 | Output:: | |
43 | ||
44 | { | |
45 | "CapacityReservation": { | |
46 | "CapacityReservationId": "cr-1234abcd56EXAMPLE ", | |
47 | "EndDateType": "limited", | |
48 | "AvailabilityZone": "eu-west-1a", | |
49 | "EndDate": "2019-08-31T23:59:59.000Z", | |
50 | "InstanceMatchCriteria": "open", | |
51 | "EphemeralStorage": false, | |
52 | "CreateDate": "2019-08-16T10:15:53.000Z", | |
53 | "AvailableInstanceCount": 3, | |
54 | "InstancePlatform": "Linux/UNIX", | |
55 | "TotalInstanceCount": 3, | |
56 | "State": "active", | |
57 | "Tenancy": "default", | |
58 | "EbsOptimized": false, | |
59 | "InstanceType": "m5.large" | |
60 | } | |
61 | } | |
62 | ||
63 | **Example 3: To create a Capacity Reservation that accepts only targeted instance launches** | |
64 | ||
65 | The following ``create-capacity-reservation`` example creates a capacity reservation that accepts only targeted instance launches | |
66 | ||
67 | aws ec2 create-capacity-reservation \ | |
68 | --availability-zone eu-west-1a \ | |
69 | --instance-type m5.large \ | |
70 | --instance-platform Linux/UNIX \ | |
71 | --instance-count 3 \ | |
72 | --instance-match-criteria targeted | |
73 | ||
74 | Output:: | |
75 | ||
76 | { | |
77 | "CapacityReservation": { | |
78 | "CapacityReservationId": "cr-1234abcd56EXAMPLE ", | |
79 | "EndDateType": "unlimited", | |
80 | "AvailabilityZone": "eu-west-1a", | |
81 | "InstanceMatchCriteria": "targeted", | |
82 | "EphemeralStorage": false, | |
83 | "CreateDate": "2019-08-16T10:21:57.000Z", | |
84 | "AvailableInstanceCount": 3, | |
85 | "InstancePlatform": "Linux/UNIX", | |
86 | "TotalInstanceCount": 3, | |
87 | "State": "active", | |
88 | "Tenancy": "default", | |
89 | "EbsOptimized": false, | |
90 | "InstanceType": "m5.large" | |
91 | } | |
92 | } | |
93 | ||
94 | For more information, see `Creating a Capacity Reservation <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-create>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. |
0 | **To create a flow log** | |
0 | **Example 1: To create a flow log** | |
1 | 1 | |
2 | This example creates a flow log that captures all rejected traffic for network interface ``eni-aa22bb33``. The flow logs are delivered to a log group in CloudWatch Logs called ``my-flow-logs`` in account 123456789101, using the IAM role ``publishFlowLogs``. | |
2 | The following ``create-flow-logs`` example creates a flow log that captures all rejected traffic for the specified network interface. The flow logs are delivered to a log group in CloudWatch Logs using the permissions in the specified IAM role. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 create-flow-logs --resource-type NetworkInterface --resource-ids eni-aa22bb33 --traffic-type REJECT --log-group-name my-flow-logs --deliver-logs-permission-arn arn:aws:iam::123456789101:role/publishFlowLogs | |
4 | aws ec2 create-flow-logs \ | |
5 | --resource-type NetworkInterface \ | |
6 | --resource-ids eni-11223344556677889 \ | |
7 | --traffic-type REJECT \ | |
8 | --log-group-name my-flow-logs \ | |
9 | --deliver-logs-permission-arn arn:aws:iam::123456789101:role/publishFlowLogs | |
7 | 10 | |
8 | 11 | Output:: |
9 | 12 | |
10 | { | |
11 | "Unsuccessful": [], | |
12 | "FlowLogIds": [ | |
13 | "fl-1a2b3c4d" | |
14 | ], | |
15 | "ClientToken": "lO+mDZGO+HCFEXAMPLEfWNO00bInKkBcLfrC" | |
16 | }⏎ | |
13 | { | |
14 | "ClientToken": "so0eNA2uSHUNlHI0S2cJ305GuIX1CezaRdGtexample", | |
15 | "FlowLogIds": [ | |
16 | "fl-12345678901234567" | |
17 | ], | |
18 | "Unsuccessful": [] | |
19 | } | |
20 | ||
21 | **Example 2: To create a flow log with a custom format** | |
22 | ||
23 | The following ``create-flow-logs`` example creates a flow log that captures all traffic for the specified VPC and delivers the flow logs to an Amazon S3 bucket. The ``--log-format`` parameter specifies a custom format for the flow log records. :: | |
24 | ||
25 | aws ec2 create-flow-logs \ | |
26 | --resource-type VPC \ | |
27 | --resource-ids vpc-00112233344556677 \ | |
28 | --traffic-type ALL \ | |
29 | --log-destination-type s3 \ | |
30 | --log-destination arn:aws:s3:::flow-log-bucket/my-custom-flow-logs/ \ | |
31 | --log-format '${version} ${vpc-id} ${subnet-id} ${instance-id} ${srcaddr} ${dstaddr} ${srcport} ${dstport} ${protocol} ${tcp-flags} ${type} ${pkt-srcaddr} ${pkt-dstaddr}' | |
32 | ||
33 | For more information, see `VPC Flow Logs <https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html>`__ in the *Amazon VPC User Guide*. |
0 | 0 | **To add a tag to a resource** |
1 | 1 | |
2 | This example adds the tag ``Stack=production`` to the specified image, or overwrites an existing tag for the AMI where the tag key is ``Stack``. If the command succeeds, no output is returned. | |
2 | The following ``create-tags`` example adds the tag ``Stack=production`` to the specified image, or overwrites an existing tag for the AMI where the tag key is ``Stack``. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 create-tags --resources ami-78a54011 --tags Key=Stack,Value=production | |
4 | aws ec2 create-tags \ | |
5 | --resources ami-1234567890abcdef0 --tags Key=Stack,Value=production | |
7 | 6 | |
8 | 7 | **To add tags to multiple resources** |
9 | 8 | |
10 | This example adds (or overwrites) two tags for an AMI and an instance. One of the tags contains just a key (``webserver``), with no value (we set the value to an empty string). The other tag consists of a key (``stack``) and value (``Production``). If the command succeeds, no output is returned. | |
9 | The following ``create-tags`` example adds (or overwrites) two tags for an AMI and an instance. One of the tags has a key (``webserver``) but no value (value is set to an empty string). The other tag has a key (``stack``) and a value (``Production``). :: | |
11 | 10 | |
12 | Command:: | |
11 | aws ec2 create-tags \ | |
12 | --resources ami-1a2b3c4d i-1234567890abcdef0 \ | |
13 | --tags Key=webserver,Value= Key=stack,Value=Production | |
13 | 14 | |
14 | aws ec2 create-tags --resources ami-1a2b3c4d i-1234567890abcdef0 --tags Key=webserver,Value= Key=stack,Value=Production | |
15 | **To add tags containing special characters** | |
15 | 16 | |
16 | **To add tags with special characters** | |
17 | The following ``create-tags`` example adds the tag ``[Group]=test`` for an instance. The square brackets ([ and ]) are special characters, and must be escaped. The following examples also use the line continuation character appropriate for each environment. | |
17 | 18 | |
18 | This example adds the tag ``[Group]=test`` for an instance. The square brackets ([ and ]) are special characters, and must be escaped. If you are using Windows, surround the value with (\"): | |
19 | If you are using Windows, surround the element that has special characters with double quotes ("), and then precede each double quote character with a backslash (\\) as follows:: | |
19 | 20 | |
20 | Command:: | |
21 | aws ec2 create-tags ^ | |
22 | --resources i-1234567890abcdef0 ^ | |
23 | --tags Key=\"[Group]\",Value=test | |
21 | 24 | |
22 | aws ec2 create-tags --resources i-1234567890abcdef0 --tags Key=\"[Group]\",Value=test | |
25 | If you are using Windows PowerShell, element the value that has special characters with double quotes ("), precede each double quote character with a backslash (\\), and then surround the entire key and value structure with single quotes (') as follows:: | |
23 | 26 | |
24 | If you are using Windows PowerShell, break out the characters with a backslash (\\), surround them with double quotes ("), and then surround the entire key and value structure with single quotes ('): | |
27 | aws ec2 create-tags ` | |
28 | --resources i-1234567890abcdef0 ` | |
29 | --tags 'Key=\"[Group]\",Value=test' | |
25 | 30 | |
26 | Command:: | |
31 | If you are using Linux or OS X, surround the element that has special characters with double quotes ("), and then surround the entire key and value structure with single quotes (') as follows:: | |
27 | 32 | |
28 | aws ec2 create-tags --resources i-1234567890abcdef0 --tags 'Key=\"[Group]\",Value=test' | |
29 | ||
30 | If you are using Linux or OS X, enclose the entire key and value structure with single quotes ('), and then enclose the element with the special character with double quotes ("): | |
31 | ||
32 | Command:: | |
33 | ||
34 | aws ec2 create-tags --resources i-1234567890abcdef0 --tags 'Key="[Group]",Value=test' | |
35 | ||
33 | aws ec2 create-tags \ | |
34 | --resources i-1234567890abcdef0 \ | |
35 | --tags 'Key="[Group]",Value=test' |
0 | **To create a Transit Gateway Route** | |
1 | ||
2 | The following ``create-transit-gateway-route`` example creates a route for the specified route table. :: | |
3 | ||
4 | aws ec2 create-transit-gateway-route \ | |
5 | --destination-cidr-block 10.0.2.0/24 \ | |
6 | --transit-gateway-route-table-id tgw-rtb-0b6f6aaa01EXAMPLE \ | |
7 | --transit-gateway-attachment-id tgw-attach-0b5968d3b6EXAMPLE | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Route": { | |
13 | "DestinationCidrBlock": "10.0.2.0/24", | |
14 | "TransitGatewayAttachments": [ | |
15 | { | |
16 | "ResourceId": "vpc-0065acced4EXAMPLE", | |
17 | "TransitGatewayAttachmentId": "tgw-attach-0b5968d3b6EXAMPLE", | |
18 | "ResourceType": "vpc" | |
19 | } | |
20 | ], | |
21 | "Type": "static", | |
22 | "State": "active" | |
23 | } | |
24 | } | |
25 | ||
26 | For more information, see `Create a Transit Gateway Route <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#create-tgw-route-table>`__ in the *AWS Transit Gateways Guide*. |
0 | 0 | **To delete a flow log** |
1 | 1 | |
2 | This example deletes flow log ``fl-1a2b3c4d``. | |
2 | The following ``delete-flow-logs`` example deletes the specified flow log. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 delete-flow-logs --flow-log-id fl-1a2b3c4d | |
4 | aws ec2 delete-flow-logs --flow-log-id fl-11223344556677889 | |
7 | 5 | |
8 | 6 | Output:: |
9 | 7 | |
10 | { | |
11 | "Unsuccessful": [] | |
12 | }⏎ | |
8 | { | |
9 | "Unsuccessful": [] | |
10 | } |
0 | **To delete a tag from a resource** | |
0 | **Example 1: To delete a tag from a resource** | |
1 | 1 | |
2 | This example deletes the tag ``Stack=Test`` from the specified image. If the command succeeds, no output is returned. | |
2 | The following ``delete-tags`` example deletes the tag ``Stack=Test`` from the specified image. When you specify both a value and a key name, the tag is deleted only if the tag's value matches the specified value. :: | |
3 | 3 | |
4 | Command:: | |
4 | aws ec2 delete-tags \ | |
5 | --resources ami-1234567890abcdef0 \ | |
6 | --tags Key=Stack,Value=Test | |
5 | 7 | |
6 | aws ec2 delete-tags --resources ami-78a54011 --tags Key=Stack,Value=Test | |
8 | It's optional to specify the value for a tag. The following ``delete-tags`` example deletes the tag with the key name ``purpose`` from the specified instance, regardless of the tag value for the tag. :: | |
7 | 9 | |
10 | aws ec2 delete-tags \ | |
11 | --resources i-1234567890abcdef0 \ | |
12 | --tags Key=purpose | |
8 | 13 | |
9 | It's optional to specify the value for any tag with a value. If you specify a value for the key, the tag is deleted only if the tag's value matches the one you specified. If you specify the empty string as the value, the tag is deleted only if the tag's value is the empty string. The following example specifies the empty string as the value for the tag to delete. | |
14 | If you specify the empty string as the tag value, the tag is deleted only if the tag's value is the empty string. The following ``delete-tags`` example specifies the empty string as the tag value for the tag to delete. :: | |
10 | 15 | |
11 | Command:: | |
16 | aws ec2 delete-tags \ | |
17 | --resources i-1234567890abcdef0 \ | |
18 | --tags Key=Name,Value= | |
19 | ||
20 | **Example 2: To delete a tag from multiple resources** | |
21 | ||
22 | The following ``delete-tags`` example deletes the tag``Purpose=Test`` from both an instance and an AMI. As shown in the previous example, you can omit the tag value from the command. :: | |
12 | 23 | |
13 | aws ec2 delete-tags --resources i-1234567890abcdef0 --tags Key=Name,Value= | |
14 | ||
15 | This example deletes the tag with the ``purpose`` key from the specified instance, regardless of the tag's value. | |
16 | ||
17 | Command:: | |
18 | ||
19 | aws ec2 delete-tags --resources i-1234567890abcdef0 --tags Key=purpose | |
20 | ||
21 | **To delete a tag from multiple resources** | |
22 | ||
23 | This example deletes the ``Purpose=Test`` tag from a specified instance and AMI. The tag's value can be omitted from the command. If the command succeeds, no output is returned. | |
24 | ||
25 | Command:: | |
26 | ||
27 | aws ec2 delete-tags --resources i-1234567890abcdef0 ami-78a54011 --tags Key=Purpose | |
24 | aws ec2 delete-tags \ | |
25 | --resources i-1234567890abcdef0 ami-1234567890abcdef0 \ | |
26 | --tags Key=Purpose |
0 | **To delete a transit gateway route table** | |
1 | ||
2 | The following ``delete-transit-gateway-route-table`` example deletes the specified transit gateway route table. :: | |
3 | ||
4 | aws ec2 delete-transit-gateway-route-table \ | |
5 | --transit-gateway-route-table-id tgw-rtb-0b6f6aaa01EXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TransitGatewayRouteTable": { | |
11 | "TransitGatewayRouteTableId": "tgw-rtb-0b6f6aaa01EXAMPLE", | |
12 | "TransitGatewayId": "tgw-02f776b1a7EXAMPLE", | |
13 | "State": "deleting", | |
14 | "DefaultAssociationRouteTable": false, | |
15 | "DefaultPropagationRouteTable": false, | |
16 | "CreationTime": "2019-07-17T20:27:26.000Z" | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Delete a Transit Gateway Route Table <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#delete-tgw-route-table>`__ in the *AWS Transit Gateways Guide*. |
0 | **To delete a CIDR block from a route table** | |
1 | ||
2 | The following command deletes the CIDR block from the specified transit gateway route table. :: | |
3 | ||
4 | aws ec2 delete-transit-gateway-route \ | |
5 | --transit-gateway-route-table-id tgw-rtb-0b6f6aaa01EXAMPLE \ | |
6 | --destination-cidr-block 10.0.2.0/24 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Route": { | |
12 | "DestinationCidrBlock": "10.0.2.0/24", | |
13 | "TransitGatewayAttachments": [ | |
14 | { | |
15 | "ResourceId": "vpc-0065acced4EXAMPLE", | |
16 | "TransitGatewayAttachmentId": "tgw-attach-0b5968d3b6EXAMPLE", | |
17 | "ResourceType": "vpc" | |
18 | } | |
19 | ], | |
20 | "Type": "static", | |
21 | "State": "deleted" | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Delete a Static Route <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#tgw-delete-static-route>`__ in the *AWS Transit Gateways*. |
0 | **To delete a transit gateway** | |
1 | ||
2 | The following ``delete-transit-gateway`` example deletes the specified transit gateway. :: | |
3 | ||
4 | aws ec2 delete-transit-gateway --transit-gateway-id tgw-01f04542b2EXAMPLE | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "TransitGateway": { | |
10 | "TransitGatewayId": "tgw-01f04542b2EXAMPLE", | |
11 | "State": "deleting", | |
12 | "OwnerId": "123456789012", | |
13 | "Description": "Example Transit Gateway", | |
14 | "CreationTime": "2019-08-27T15:04:35.000Z", | |
15 | "Options": { | |
16 | "AmazonSideAsn": 64515, | |
17 | "AutoAcceptSharedAttachments": "disable", | |
18 | "DefaultRouteTableAssociation": "enable", | |
19 | "AssociationDefaultRouteTableId": "tgw-rtb-0ce7a6948fEXAMPLE", | |
20 | "DefaultRouteTablePropagation": "enable", | |
21 | "PropagationDefaultRouteTableId": "tgw-rtb-0ce7a6948fEXAMPLE", | |
22 | "VpnEcmpSupport": "enable", | |
23 | "DnsSupport": "enable" | |
24 | } | |
25 | } | |
26 | } | |
27 | ||
28 | For more information, see `Delete a Transit Gateway<https://docs.aws.amazon.com/vpc/latest/tgw/tgw-transit-gateways.html#delete-tgw>`__ in the *AWS Transit Gateways Guide*. |
0 | **To remove an IP address range from use** | |
1 | ||
2 | The following example removes the specified address range from use with AWS. :: | |
3 | ||
4 | aws ec2 deprovision-byoip-cidr \ | |
5 | --cidr 203.0.113.25/24 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ByoipCidr": { | |
11 | "Cidr": "203.0.113.25/24", | |
12 | "State": "pending-deprovision" | |
13 | } | |
14 | } |
0 | **To describe your Elastic IP addresses** | |
0 | **Example 1: To retrieve details about all of your Elastic IP addresses** | |
1 | 1 | |
2 | This example describes your Elastic IP addresses. | |
2 | The following ``describe addresses`` example displays details about your Elastic IP addresses. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 describe-addresses | |
4 | aws ec2 describe-addresses | |
7 | 5 | |
8 | 6 | Output:: |
9 | 7 | |
10 | { | |
11 | "Addresses": [ | |
12 | { | |
13 | "InstanceId": "i-1234567890abcdef0", | |
14 | "PublicIp": "198.51.100.0", | |
15 | "Domain": "standard" | |
16 | }, | |
17 | { | |
18 | "Domain": "vpc", | |
19 | "InstanceId": "i-1234567890abcdef0", | |
20 | "NetworkInterfaceId": "eni-12345678", | |
21 | "AssociationId": "eipassoc-12345678", | |
22 | "NetworkInterfaceOwnerId": "123456789012", | |
23 | "PublicIp": "203.0.113.0", | |
24 | "AllocationId": "eipalloc-12345678", | |
25 | "PrivateIpAddress": "10.0.1.241" | |
26 | } | |
27 | ] | |
28 | } | |
8 | { | |
9 | "Addresses": [ | |
10 | { | |
11 | "InstanceId": "i-1234567890abcdef0", | |
12 | "PublicIp": "198.51.100.0", | |
13 | "PublicIpv4Pool": "amazon", | |
14 | "Domain": "standard" | |
15 | }, | |
16 | { | |
17 | "Domain": "vpc", | |
18 | "PublicIpv4Pool": "amazon", | |
19 | "InstanceId": "i-1234567890abcdef0", | |
20 | "NetworkInterfaceId": "eni-12345678", | |
21 | "AssociationId": "eipassoc-12345678", | |
22 | "NetworkInterfaceOwnerId": "123456789012", | |
23 | "PublicIp": "203.0.113.0", | |
24 | "AllocationId": "eipalloc-12345678", | |
25 | "PrivateIpAddress": "10.0.1.241" | |
26 | } | |
27 | ] | |
28 | } | |
29 | 29 | |
30 | **To describe your Elastic IP addresses for EC2-VPC** | |
30 | **Example 2: To retrieve details your Elastic IP addresses for EC2-VPC** | |
31 | 31 | |
32 | This example describes your Elastic IP addresses for use with instances in a VPC. | |
32 | The following ``describe-addresses`` example displays details about your Elastic IP addresses for use with instances in a VPC. :: | |
33 | 33 | |
34 | Command:: | |
35 | ||
36 | aws ec2 describe-addresses --filters "Name=domain,Values=vpc" | |
37 | ||
38 | Output:: | |
39 | ||
40 | { | |
41 | "Addresses": [ | |
42 | { | |
43 | "Domain": "vpc", | |
44 | "InstanceId": "i-1234567890abcdef0", | |
45 | "NetworkInterfaceId": "eni-12345678", | |
46 | "AssociationId": "eipassoc-12345678", | |
47 | "NetworkInterfaceOwnerId": "123456789012", | |
48 | "PublicIp": "203.0.113.0", | |
49 | "AllocationId": "eipalloc-12345678", | |
50 | "PrivateIpAddress": "10.0.1.241" | |
51 | } | |
52 | ] | |
53 | } | |
54 | ||
55 | This example describes the Elastic IP address with the allocation ID ``eipalloc-282d9641``, which is associated with an instance in EC2-VPC. | |
56 | ||
57 | Command:: | |
58 | ||
59 | aws ec2 describe-addresses --allocation-ids eipalloc-282d9641 | |
34 | aws ec2 describe-addresses \ | |
35 | --filters "Name=domain,Values=vpc" | |
60 | 36 | |
61 | 37 | Output:: |
62 | 38 | |
64 | 40 | "Addresses": [ |
65 | 41 | { |
66 | 42 | "Domain": "vpc", |
43 | "PublicIpv4Pool": "amazon", | |
44 | "InstanceId": "i-1234567890abcdef0", | |
45 | "NetworkInterfaceId": "eni-12345678", | |
46 | "AssociationId": "eipassoc-12345678", | |
47 | "NetworkInterfaceOwnerId": "123456789012", | |
48 | "PublicIp": "203.0.113.0", | |
49 | "AllocationId": "eipalloc-12345678", | |
50 | "PrivateIpAddress": "10.0.1.241" | |
51 | } | |
52 | ] | |
53 | } | |
54 | ||
55 | **Example 3: To retrieve details about an Elastic IP address specified by allocation ID** | |
56 | ||
57 | The following ``describe-addresses`` example displays details about the Elastic IP address with the specified allocation ID, which is associated with an instance in EC2-VPC. :: | |
58 | ||
59 | aws ec2 describe-addresses \ | |
60 | --allocation-ids eipalloc-282d9641 | |
61 | ||
62 | Output:: | |
63 | ||
64 | { | |
65 | "Addresses": [ | |
66 | { | |
67 | "Domain": "vpc", | |
68 | "PublicIpv4Pool": "amazon", | |
67 | 69 | "InstanceId": "i-1234567890abcdef0", |
68 | 70 | "NetworkInterfaceId": "eni-1a2b3c4d", |
69 | 71 | "AssociationId": "eipassoc-123abc12", |
75 | 77 | ] |
76 | 78 | } |
77 | 79 | |
78 | This example describes the Elastic IP address associated with a particular private IP address in EC2-VPC. | |
80 | **Example 4: To retrieve details about an Elastic IP address specified by its VPC private IP address** | |
79 | 81 | |
80 | Command:: | |
82 | The following ``describe-addresses`` example displays details about the Elastic IP address associated with a particular private IP address in EC2-VPC. :: | |
81 | 83 | |
82 | aws ec2 describe-addresses --filters "Name=private-ip-address,Values=10.251.50.12" | |
84 | aws ec2 describe-addresses \ | |
85 | --filters "Name=private-ip-address,Values=10.251.50.12" | |
83 | 86 | |
84 | **To describe your Elastic IP addresses in EC2-Classic** | |
87 | **Example 5: To retrieve details about Elastic IP addresses in EC2-Classic** | |
85 | 88 | |
86 | This example describes your Elastic IP addresses for use in EC2-Classic. | |
89 | TThe following ``describe-addresses`` example displays details about your Elastic IP addresses for use in EC2-Classic. :: | |
87 | 90 | |
88 | Command:: | |
89 | ||
90 | aws ec2 describe-addresses --filters "Name=domain,Values=standard" | |
91 | aws ec2 describe-addresses \ | |
92 | --filters "Name=domain,Values=standard" | |
91 | 93 | |
92 | 94 | Output:: |
93 | 95 | |
96 | 98 | { |
97 | 99 | "InstanceId": "i-1234567890abcdef0", |
98 | 100 | "PublicIp": "203.0.110.25", |
101 | "PublicIpv4Pool": "amazon", | |
99 | 102 | "Domain": "standard" |
100 | 103 | } |
101 | 104 | ] |
102 | 105 | } |
103 | 106 | |
104 | This example describes the Elastic IP address with the value ``203.0.110.25``, which is associated with an instance in EC2-Classic. | |
107 | **Example 6: To retrieve details about an Elastic IP addresses specified by its public IP address** | |
105 | 108 | |
106 | Command:: | |
109 | The following ``describe-addresses`` example displays details about the Elastic IP address with the value ``203.0.110.25``, which is associated with an instance in EC2-Classic. :: | |
107 | 110 | |
108 | aws ec2 describe-addresses --public-ips 203.0.110.25 | |
111 | aws ec2 describe-addresses \ | |
112 | --public-ips 203.0.110.25 | |
109 | 113 | |
110 | 114 | Output:: |
111 | 115 | |
114 | 118 | { |
115 | 119 | "InstanceId": "i-1234567890abcdef0", |
116 | 120 | "PublicIp": "203.0.110.25", |
121 | "PublicIpv4Pool": "amazon", | |
117 | 122 | "Domain": "standard" |
118 | 123 | } |
119 | 124 | ] |
0 | **To describe the longer ID format settings for all resource types in a specific region** | |
0 | **To describe the longer ID format settings for all resource types in a Region** | |
1 | 1 | |
2 | This example describes the overall longer ID format settings for the eu-west-1 Region. The output indicates that the following resource types can be enabled or disabled for longer IDs: bundle, conversion-task, customer-gateway, dhcp-options, elastic-ip-allocation, elastic-ip-association, export-task, flow-log, image, import-task, internet-gateway, network-acl, network-acl-association, network-interface, network-interface-attachment, prefix-list, route-table, route-table-association, security-group, subnet, subnet-cidr-block-association, vpc, vpc-cidr-block-association, vpc-endpoint, vpc-peering-connection, vpn-connection, and vpn-gateway. | |
2 | The following ``describe-aggregate-id-format`` example describes the overall long ID format status for the current Region. The ``Deadline`` value indicates that the deadlines for these resources to permanently switch from the short ID format to the long ID format expired. The ``UseLongIdsAggregated`` value indicates that all IAM users and IAM roles are configured to use long ID format for all resource types. :: | |
3 | 3 | |
4 | The ``Deadline`` value for the reservation, instance, volume, and snapshot resource types indicates that the deadline for those resources expired at 00:00 UTC on December 15, 2016. It also shows that all IAM users and IAM roles are configured to use longer IDs for all resource types, except vpc and subnet. One or more IAM users or IAM roles are not configured to use longer IDs for vpc and subnet resource types. ``UseLongIdsAggregated`` is ``false`` because not all IAM users and IAM roles are configured to use longer IDs for all resource types in the Region. | |
5 | ||
6 | Command:: | |
7 | ||
8 | aws ec2 describe-aggregate-id-format --region eu-west-1 | |
4 | aws ec2 describe-aggregate-id-format | |
9 | 5 | |
10 | 6 | Output:: |
11 | 7 | |
12 | { | |
13 | "UseLongIdsAggregated": false, | |
14 | "Statuses": [ | |
15 | { | |
16 | "Resource": "reservation", | |
17 | "Deadline": "2016-12-15T12:00:00.000Z", | |
18 | "UseLongIds": true | |
19 | }, | |
20 | { | |
21 | "Resource": "instance", | |
22 | "Deadline": "2016-12-15T12:00:00.000Z", | |
23 | "UseLongIds": true | |
24 | }, | |
25 | { | |
26 | "Resource": "volume", | |
27 | "Deadline": "2016-12-15T12:00:00.000Z", | |
28 | "UseLongIds": true | |
29 | }, | |
30 | { | |
31 | "Resource": "snapshot", | |
32 | "Deadline": "2016-12-15T12:00:00.000Z", | |
33 | "UseLongIds": true | |
34 | }, | |
35 | { | |
36 | "UseLongIds": true, | |
37 | "Resource": "network-interface-attachment" | |
38 | }, | |
39 | { | |
40 | "UseLongIds": true, | |
41 | "Resource": "network-interface" | |
42 | }, | |
43 | { | |
44 | "UseLongIds": true, | |
45 | "Resource": "elastic-ip-allocation" | |
46 | }, | |
47 | { | |
48 | "UseLongIds": true, | |
49 | "Resource": "elastic-ip-association" | |
50 | }, | |
51 | { | |
52 | "UseLongIds": false, | |
53 | "Resource": "vpc" | |
54 | }, | |
55 | { | |
56 | "UseLongIds": false, | |
57 | "Resource": "subnet" | |
58 | }, | |
59 | { | |
60 | "UseLongIds": true, | |
61 | "Resource": "route-table" | |
62 | }, | |
63 | { | |
64 | "UseLongIds": true, | |
65 | "Resource": "route-table-association" | |
66 | }, | |
67 | { | |
68 | "UseLongIds": true, | |
69 | "Resource": "network-acl" | |
70 | }, | |
71 | { | |
72 | "UseLongIds": true, | |
73 | "Resource": "network-acl-association" | |
74 | }, | |
75 | { | |
76 | "UseLongIds": true, | |
77 | "Resource": "dhcp-options" | |
78 | }, | |
79 | { | |
80 | "UseLongIds": true, | |
81 | "Resource": "internet-gateway" | |
82 | }, | |
83 | { | |
84 | "UseLongIds": true, | |
85 | "Resource": "vpc-cidr-block-association" | |
86 | }, | |
87 | { | |
88 | "UseLongIds": true, | |
89 | "Resource": "vpc-ipv6-cidr-block-association" | |
90 | }, | |
91 | { | |
92 | "UseLongIds": true, | |
93 | "Resource": "subnet-ipv6-cidr-block-association" | |
94 | }, | |
95 | { | |
96 | "UseLongIds": true, | |
97 | "Resource": "vpc-peering-connection" | |
98 | }, | |
99 | { | |
100 | "UseLongIds": true, | |
101 | "Resource": "security-group" | |
102 | }, | |
103 | { | |
104 | "UseLongIds": true, | |
105 | "Resource": "flow-log" | |
106 | }, | |
107 | { | |
108 | "UseLongIds": true, | |
109 | "Resource": "conversion-task" | |
110 | }, | |
111 | { | |
112 | "UseLongIds": true, | |
113 | "Resource": "export-task" | |
114 | }, | |
115 | { | |
116 | "UseLongIds": true, | |
117 | "Resource": "import-task" | |
118 | }, | |
119 | { | |
120 | "UseLongIds": true, | |
121 | "Resource": "image" | |
122 | }, | |
123 | { | |
124 | "UseLongIds": true, | |
125 | "Resource": "bundle" | |
126 | }, | |
127 | { | |
128 | "UseLongIds": true, | |
129 | "Resource": "vpc-endpoint" | |
130 | }, | |
131 | { | |
132 | "UseLongIds": true, | |
133 | "Resource": "customer-gateway" | |
134 | }, | |
135 | { | |
136 | "UseLongIds": true, | |
137 | "Resource": "vpn-connection" | |
138 | }, | |
139 | { | |
140 | "UseLongIds": true, | |
141 | "Resource": "vpn-gateway" | |
142 | } | |
143 | { | |
144 | } | |
8 | { | |
9 | "UseLongIdsAggregated": true, | |
10 | "Statuses": [ | |
11 | { | |
12 | "Deadline": "2018-08-13T02:00:00.000Z", | |
13 | "Resource": "network-interface-attachment", | |
14 | "UseLongIds": true | |
15 | }, | |
16 | { | |
17 | "Deadline": "2016-12-13T02:00:00.000Z", | |
18 | "Resource": "instance", | |
19 | "UseLongIds": true | |
20 | }, | |
21 | { | |
22 | "Deadline": "2018-08-13T02:00:00.000Z", | |
23 | "Resource": "elastic-ip-association", | |
24 | "UseLongIds": true | |
25 | }, | |
26 | ... | |
27 | ] | |
28 | }⏎ |
0 | 0 | **To describe your Availability Zones** |
1 | 1 | |
2 | This example describes the Availability Zones that are available to you. The response includes Availability Zones only for the current region. | |
2 | The following ``describe-availability-zones`` example describes the Availability Zones that are available to you. The response includes Availability Zones only for the current Region. :: | |
3 | 3 | |
4 | Command:: | |
4 | aws ec2 describe-availability-zones | |
5 | 5 | |
6 | aws ec2 describe-availability-zones | |
6 | The following is example example output for the US East (Ohio) Region. :: | |
7 | 7 | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "AvailabilityZones": [ | |
12 | { | |
13 | "State": "available", | |
14 | "Messages": [], | |
15 | "RegionName": "us-west-2", | |
16 | "ZoneName": "us-west-2a", | |
17 | "ZoneId": "usw2-az2" | |
18 | }, | |
19 | { | |
20 | "State": "available", | |
21 | "Messages": [], | |
22 | "RegionName": "us-west-2", | |
23 | "ZoneName": "us-west-2b", | |
24 | "ZoneId": "usw2-az1" | |
25 | }, | |
26 | { | |
27 | "State": "available", | |
28 | "Messages": [], | |
29 | "RegionName": "us-west-2", | |
30 | "ZoneName": "us-west-2c", | |
31 | "ZoneId": "usw2-az3" | |
32 | } | |
33 | ] | |
34 | } | |
8 | { | |
9 | "AvailabilityZones": [ | |
10 | { | |
11 | "State": "available", | |
12 | "Messages": [], | |
13 | "RegionName": "us-east-2", | |
14 | "ZoneName": "us-east-2a", | |
15 | "ZoneId": "use2-az1" | |
16 | }, | |
17 | { | |
18 | "State": "available", | |
19 | "Messages": [], | |
20 | "RegionName": "us-east-2", | |
21 | "ZoneName": "us-east-2b", | |
22 | "ZoneId": "use2-az2" | |
23 | }, | |
24 | { | |
25 | "State": "available", | |
26 | "Messages": [], | |
27 | "RegionName": "us-east-2", | |
28 | "ZoneName": "us-east-2c", | |
29 | "ZoneId": "use2-az3" | |
30 | } | |
31 | ] | |
32 | } |
0 | **To describe your provisioned address ranges** | |
1 | ||
2 | The following ``describe-byoip-cidrs`` example displays details about the public IPv4 address ranges that you provisioned for use by AWS. :: | |
3 | ||
4 | aws ec2 describe-byoip-cidrs | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "ByoipCidrs": [ | |
10 | { | |
11 | "Cidr": "203.0.113.25/24", | |
12 | "StatusMessage": "ipv4pool-ec2-1234567890abcdef0", | |
13 | "State": "provisioned" | |
14 | } | |
15 | ] | |
16 | } |
0 | **Example 1: To describe one or more of your capacity reservations** | |
1 | ||
2 | The following ``describe-capacity-reservations`` example displays details about all of your capacity reservations in the current AWS Region. :: | |
3 | ||
4 | aws ec2 describe-capacity-reservations | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "CapacityReservations": [ | |
10 | { | |
11 | "CapacityReservationId": "cr-1234abcd56EXAMPLE ", | |
12 | "EndDateType": "unlimited", | |
13 | "AvailabilityZone": "eu-west-1a", | |
14 | "InstanceMatchCriteria": "open", | |
15 | "Tags": [], | |
16 | "EphemeralStorage": false, | |
17 | "CreateDate": "2019-08-16T09:03:18.000Z", | |
18 | "AvailableInstanceCount": 1, | |
19 | "InstancePlatform": "Linux/UNIX", | |
20 | "TotalInstanceCount": 1, | |
21 | "State": "active", | |
22 | "Tenancy": "default", | |
23 | "EbsOptimized": true, | |
24 | "InstanceType": "a1.medium" | |
25 | }, | |
26 | { | |
27 | "CapacityReservationId": "cr-abcdEXAMPLE9876ef ", | |
28 | "EndDateType": "unlimited", | |
29 | "AvailabilityZone": "eu-west-1a", | |
30 | "InstanceMatchCriteria": "open", | |
31 | "Tags": [], | |
32 | "EphemeralStorage": false, | |
33 | "CreateDate": "2019-08-07T11:34:19.000Z", | |
34 | "AvailableInstanceCount": 3, | |
35 | "InstancePlatform": "Linux/UNIX", | |
36 | "TotalInstanceCount": 3, | |
37 | "State": "cancelled", | |
38 | "Tenancy": "default", | |
39 | "EbsOptimized": true, | |
40 | "InstanceType": "m5.large" | |
41 | } | |
42 | ] | |
43 | } | |
44 | ||
45 | **Example 2: To describe one or more of your capacity reservations** | |
46 | ||
47 | The following ``describe-capacity-reservations`` example displays details about the specified capacity reservation. :: | |
48 | ||
49 | aws ec2 describe-capacity-reservations \ | |
50 | --capacity-reserveration-id cr-1234abcd56EXAMPLE | |
51 | ||
52 | Output:: | |
53 | ||
54 | { | |
55 | "CapacityReservations": [ | |
56 | { | |
57 | "CapacityReservationId": "cr-1234abcd56EXAMPLE", | |
58 | "EndDateType": "unlimited", | |
59 | "AvailabilityZone": "eu-west-1a", | |
60 | "InstanceMatchCriteria": "open", | |
61 | "Tags": [], | |
62 | "EphemeralStorage": false, | |
63 | "CreateDate": "2019-08-16T09:03:18.000Z", | |
64 | "AvailableInstanceCount": 1, | |
65 | "InstancePlatform": "Linux/UNIX", | |
66 | "TotalInstanceCount": 1, | |
67 | "State": "active", | |
68 | "Tenancy": "default", | |
69 | "EbsOptimized": true, | |
70 | "InstanceType": "a1.medium" | |
71 | } | |
72 | ] | |
73 | } | |
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*. |
0 | **To monitor an export image task** | |
1 | ||
2 | The following ``describe-export-image-tasks`` example checks the status of the specified export image task. :: | |
3 | ||
4 | aws ec2 describe-export-image-tasks \ | |
5 | --export-image-task-id export-ami-1234567890abcdef0 | |
6 | ||
7 | Output for an export image task that is in progress:: | |
8 | ||
9 | { | |
10 | "ExportImageTasks": [ | |
11 | { | |
12 | "ExportImageTaskId": "export-ami-1234567890abcdef0" | |
13 | "Progress": "21", | |
14 | "S3ExportLocation": { | |
15 | "S3Bucket": "my-export-bucket", | |
16 | "S3Prefix": "exports/" | |
17 | }, | |
18 | "Status": "active", | |
19 | "StatusMessage": "updating" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ||
24 | Output for an export image task that is completed. The resulting image file in Amazon S3 is ``my-export-bucket/exports/export-ami-1234567890abcdef0.vmdk``. :: | |
25 | ||
26 | { | |
27 | "ExportImageTasks": [ | |
28 | { | |
29 | "ExportImageTaskId": "export-ami-1234567890abcdef0" | |
30 | "S3ExportLocation": { | |
31 | "S3Bucket": "my-export-bucket", | |
32 | "S3Prefix": "exports/" | |
33 | }, | |
34 | "Status": "completed" | |
35 | } | |
36 | ] | |
37 | } |
0 | **To describe flow logs** | |
0 | **To describe all of your flow logs** | |
1 | 1 | |
2 | This example describes all of your flow logs. | |
2 | The following ``describe-flow-logs`` example displays details for all of your flow logs. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 describe-flow-logs | |
4 | aws ec2 describe-flow-logs | |
7 | 5 | |
8 | 6 | Output:: |
9 | 7 | |
10 | { | |
11 | "FlowLogs": [ | |
12 | { | |
13 | "ResourceId": "eni-11aa22bb", | |
14 | "CreationTime": "2015-06-12T14:41:15Z", | |
15 | "LogGroupName": "MyFlowLogs", | |
16 | "TrafficType": "ALL", | |
17 | "FlowLogStatus": "ACTIVE", | |
18 | "FlowLogId": "fl-1a2b3c4d", | |
19 | "DeliverLogsPermissionArn": "arn:aws:iam::123456789101:role/flow-logs-role" | |
20 | } | |
21 | ] | |
22 | } | |
23 | ||
24 | This example uses a filter to describe only flow logs that are in the log group ``MyFlowLogs`` in Amazon CloudWatch Logs. | |
25 | ||
26 | Command:: | |
27 | ||
28 | aws ec2 describe-flow-logs --filter "Name=log-group-name,Values=MyFlowLogs"⏎ | |
8 | { | |
9 | "FlowLogs": [ | |
10 | { | |
11 | "CreationTime": "2018-02-21T13:22:12.644Z", | |
12 | "DeliverLogsPermissionArn": "arn:aws:iam::123456789012:role/flow-logs-role", | |
13 | "DeliverLogsStatus": "SUCCESS", | |
14 | "FlowLogId": "fl-aabbccdd112233445", | |
15 | "FlowLogStatus": "ACTIVE", | |
16 | "LogGroupName": "FlowLogGroup", | |
17 | "ResourceId": "subnet-12345678901234567", | |
18 | "TrafficType": "ALL", | |
19 | "LogDestinationType": "cloud-watch-logs", | |
20 | "LogFormat": "${version} ${account-id} ${interface-id} ${srcaddr} ${dstaddr} ${srcport} ${dstport} ${protocol} ${packets} ${bytes} ${start} ${end} ${action} ${log-status}" | |
21 | }, | |
22 | { | |
23 | "CreationTime": "2019-07-19T15:22:29.986Z", | |
24 | "DeliverLogsStatus": "SUCCESS", | |
25 | "FlowLogId": "fl-01234567890123456", | |
26 | "FlowLogStatus": "ACTIVE", | |
27 | "ResourceId": "vpc-00112233445566778", | |
28 | "TrafficType": "ACCEPT", | |
29 | "LogDestinationType": "s3", | |
30 | "LogDestination": "arn:aws:s3:::my-flow-log-bucket/custom", | |
31 | "LogFormat": "${version} ${vpc-id} ${subnet-id} ${instance-id} ${interface-id} ${account-id} ${type} ${srcaddr} ${dstaddr} ${srcport} ${dstport} ${pkt-srcaddr} ${pkt-dstaddr} ${protocol} ${bytes} ${packets} ${start} ${end} ${action} ${tcp-flags} ${log-status}" | |
32 | } | |
33 | ] | |
34 | } | |
35 | ||
36 | **To describe a subset of your flow logs** | |
37 | ||
38 | The following ``describe-flow-logs`` example uses a filter to display details for only those flow logs that are in the specified log group in Amazon CloudWatch Logs. :: | |
39 | ||
40 | aws ec2 describe-flow-logs \ | |
41 | --filter "Name=log-group-name,Values=MyFlowLogs" |
0 | **To describe Dedicated hosts in your account and generate a machine-readable list** | |
0 | **To view details about Dedicated Hosts** | |
1 | 1 | |
2 | To output a list of Dedicated host IDs in JSON (comma separated). | |
2 | The following ``describe-hosts`` example displays details for the ``available`` Dedicated Hosts in your AWS account. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 describe-hosts --query 'Hosts[].HostId' --output json | |
4 | aws ec2 describe-hosts --filter "Name=state,Values=available" | |
7 | 5 | |
8 | 6 | Output:: |
9 | 7 | |
10 | [ | |
11 | "h-085664df5899941c", | |
12 | "h-056c1b0724170dc38" | |
13 | ] | |
8 | { | |
9 | "Hosts": [ | |
10 | { | |
11 | "HostId": "h-07879acf49EXAMPLE", | |
12 | "Tags": [ | |
13 | { | |
14 | "Value": "production", | |
15 | "Key": "purpose" | |
16 | } | |
17 | ], | |
18 | "HostProperties": { | |
19 | "Cores": 48, | |
20 | "TotalVCpus": 96, | |
21 | "InstanceType": "m5.large", | |
22 | "Sockets": 2 | |
23 | }, | |
24 | "Instances": [], | |
25 | "State": "available", | |
26 | "AvailabilityZone": "eu-west-1a", | |
27 | "AvailableCapacity": { | |
28 | "AvailableInstanceCapacity": [ | |
29 | { | |
30 | "AvailableCapacity": 48, | |
31 | "InstanceType": "m5.large", | |
32 | "TotalCapacity": 48 | |
33 | } | |
34 | ], | |
35 | "AvailableVCpus": 96 | |
36 | }, | |
37 | "HostRecovery": "on", | |
38 | "AllocationTime": "2019-08-19T08:57:44.000Z", | |
39 | "AutoPlacement": "off" | |
40 | } | |
41 | ] | |
42 | } | |
14 | 43 | |
15 | To output a list of Dedicated host IDs in plaintext (comma separated). | |
16 | ||
17 | Command:: | |
18 | ||
19 | aws ec2 describe-hosts --query 'Hosts[].HostId' --output text | |
20 | ||
21 | Output:: | |
22 | h-085664df5899941c | |
23 | h-056c1b0724170dc38 | |
24 | ||
25 | **To describe available Dedicated hosts in your account** | |
26 | ||
27 | Command:: | |
28 | ||
29 | aws ec2 describe-hosts --filter "Name=state,Values=available" | |
30 | ||
31 | Output:: | |
32 | ||
33 | { | |
34 | "Hosts": [ | |
35 | { | |
36 | "HostId": "h-085664df5899941c" | |
37 | "HostProperties: { | |
38 | "Cores": 20, | |
39 | "Sockets": 2, | |
40 | "InstanceType": "m3.medium". | |
41 | "TotalVCpus": 32 | |
42 | }, | |
43 | "Instances": [], | |
44 | "State": "available", | |
45 | "AvailabilityZone": "us-east-1b", | |
46 | "AvailableCapacity": { | |
47 | "AvailableInstanceCapacity": [ | |
48 | { | |
49 | "AvailableCapacity": 32, | |
50 | "InstanceType": "m3.medium", | |
51 | "TotalCapacity": 32 | |
52 | } | |
53 | ], | |
54 | "AvailableVCpus": 32 | |
55 | }, | |
56 | "AutoPlacement": "off" | |
57 | } | |
58 | ] | |
59 | } | |
60 | ||
44 | For more information, see `Viewing Dedicated Hosts <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-managing>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. |
0 | **To describe the ID format for your resources** | |
0 | **Example 1: To describe the ID format of a resource** | |
1 | 1 | |
2 | This example describes the ID format for all resource types that support longer IDs. The output indicates that the bundle, conversion-task, customer-gateway, dhcp-options, elastic-ip-allocation, elastic-ip-association, export-task, flow-log, image, import-task, internet-gateway, network-acl, network-acl-association, network-interface, network-interface-attachment, prefix-list, route-table, route-table-association, security-group, subnet, subnet-cidr-block-association, vpc, vpc-cidr-block-association, vpc-endpoint, vpc-peering-connection, vpn-connection, and vpn-gateway resource types can be enabled or disabled for longer IDs. The ``Deadline`` for the reservation, instance, volume, and snapshot resource types indicates that the deadline for those resources expired at 00:00 UTC on December 15, 2016. It also shows that all of the resource types, except vpc, subnet, and security-group, are configured to use longer IDs. | |
2 | The following ``describe-id-format`` example describes the ID format for security groups. :: | |
3 | 3 | |
4 | Command:: | |
4 | aws ec2 describe-id-format \ | |
5 | --resource security-group | |
5 | 6 | |
6 | aws ec2 describe-id-format | |
7 | In the following example output, the ``Deadline`` value indicates that the deadline for this resource type to permanently switch from the short ID format to the long ID format expired at 00:00 UTC on August 15, 2018. :: | |
7 | 8 | |
8 | Output:: | |
9 | { | |
10 | "Statuses": [ | |
11 | { | |
12 | "Deadline": "2018-08-15T00:00:00.000Z", | |
13 | "Resource": "security-group", | |
14 | "UseLongIds": true | |
15 | } | |
16 | ] | |
17 | } | |
9 | 18 | |
10 | { | |
11 | "Statuses": [ | |
12 | { | |
13 | "Resource": "reservation", | |
14 | "Deadline": "2016-12-15T12:00:00.000Z", | |
15 | "UseLongIds": true | |
16 | }, | |
17 | { | |
18 | "Resource": "instance", | |
19 | "Deadline": "2016-12-15T12:00:00.000Z", | |
20 | "UseLongIds": true | |
21 | }, | |
22 | { | |
23 | "Resource": "volume", | |
24 | "Deadline": "2016-12-15T12:00:00.000Z", | |
25 | "UseLongIds": true | |
26 | }, | |
27 | { | |
28 | "Resource": "snapshot", | |
29 | "Deadline": "2016-12-15T12:00:00.000Z", | |
30 | "UseLongIds": true | |
31 | }, | |
32 | { | |
33 | "UseLongIds": true, | |
34 | "Resource": "network-interface-attachment" | |
35 | }, | |
36 | { | |
37 | "UseLongIds": true, | |
38 | "Resource": "network-interface" | |
39 | }, | |
40 | { | |
41 | "UseLongIds": true, | |
42 | "Resource": "elastic-ip-allocation" | |
43 | }, | |
44 | { | |
45 | "UseLongIds": true, | |
46 | "Resource": "elastic-ip-association" | |
47 | }, | |
48 | { | |
49 | "UseLongIds": false, | |
50 | "Resource": "vpc" | |
51 | }, | |
52 | { | |
53 | "UseLongIds": false, | |
54 | "Resource": "subnet" | |
55 | }, | |
56 | { | |
57 | "UseLongIds": true, | |
58 | "Resource": "route-table" | |
59 | }, | |
60 | { | |
61 | "UseLongIds": true, | |
62 | "Resource": "route-table-association" | |
63 | }, | |
64 | { | |
65 | "UseLongIds": true, | |
66 | "Resource": "network-acl" | |
67 | }, | |
68 | { | |
69 | "UseLongIds": true, | |
70 | "Resource": "network-acl-association" | |
71 | }, | |
72 | { | |
73 | "UseLongIds": true, | |
74 | "Resource": "dhcp-options" | |
75 | }, | |
76 | { | |
77 | "UseLongIds": true, | |
78 | "Resource": "internet-gateway" | |
79 | }, | |
80 | { | |
81 | "UseLongIds": true, | |
82 | "Resource": "vpc-cidr-block-association" | |
83 | }, | |
84 | { | |
85 | "UseLongIds": true, | |
86 | "Resource": "vpc-ipv6-cidr-block-association" | |
87 | }, | |
88 | { | |
89 | "UseLongIds": true, | |
90 | "Resource": "subnet-ipv6-cidr-block-association" | |
91 | }, | |
92 | { | |
93 | "UseLongIds": true, | |
94 | "Resource": "vpc-peering-connection" | |
95 | }, | |
96 | { | |
97 | "UseLongIds": false, | |
98 | "Resource": "security-group" | |
99 | }, | |
100 | { | |
101 | "UseLongIds": true, | |
102 | "Resource": "flow-log" | |
103 | }, | |
104 | { | |
105 | "UseLongIds": true, | |
106 | "Resource": "conversion-task" | |
107 | }, | |
108 | { | |
109 | "UseLongIds": true, | |
110 | "Resource": "export-task" | |
111 | }, | |
112 | { | |
113 | "UseLongIds": true, | |
114 | "Resource": "import-task" | |
115 | }, | |
116 | { | |
117 | "UseLongIds": true, | |
118 | "Resource": "image" | |
119 | }, | |
120 | { | |
121 | "UseLongIds": true, | |
122 | "Resource": "bundle" | |
123 | }, | |
124 | { | |
125 | "UseLongIds": true, | |
126 | "Resource": "vpc-endpoint" | |
127 | }, | |
128 | { | |
129 | "UseLongIds": true, | |
130 | "Resource": "customer-gateway" | |
131 | }, | |
132 | { | |
133 | "UseLongIds": true, | |
134 | "Resource": "vpn-connection" | |
135 | }, | |
136 | { | |
137 | "UseLongIds": true, | |
138 | "Resource": "vpn-gateway" | |
139 | } | |
140 | ] | |
141 | } | |
19 | **Example 2: To describe the ID format for all resources** | |
20 | ||
21 | The following ``describe-id-format`` example describes the ID format for all resource types. All resource types that supported the short ID format were switched to use the long ID format. :: | |
22 | ||
23 | aws ec2 describe-id-format |
0 | 0 | **To describe the ID format for an IAM role** |
1 | 1 | |
2 | This example describes the ID format of the ``instance`` resource for the IAM role ``EC2Role`` in your AWS account. The output indicates that instances are enabled for longer IDs - instances created by this role receive longer IDs. | |
2 | The following ``describe-identity-id-format`` example describes the ID format received by instances created by the IAM role ``EC2Role`` in your AWS account. :: | |
3 | 3 | |
4 | Command:: | |
4 | aws ec2 describe-identity-id-format \ | |
5 | --principal-arn arn:aws:iam::123456789012:role/my-iam-role \ | |
6 | --resource instance | |
5 | 7 | |
6 | aws ec2 describe-identity-id-format --principal-arn arn:aws:iam::123456789012:role/EC2Role --resource instance | |
8 | The following output indicates that instances created by this role receive IDs in long ID format. :: | |
7 | 9 | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "Statuses": [ | |
12 | { | |
13 | "UseLongIds": true, | |
14 | "Resource": "instance" | |
15 | } | |
16 | ] | |
17 | } | |
10 | { | |
11 | "Statuses": [ | |
12 | { | |
13 | "Deadline": "2016-12-15T00:00:00Z", | |
14 | "Resource": "instance", | |
15 | "UseLongIds": true | |
16 | } | |
17 | ] | |
18 | } | |
18 | 19 | |
19 | 20 | **To describe the ID format for an IAM user** |
20 | 21 | |
21 | This example describes the ID format of the ``snapshot`` resource for the IAM user ``AdminUser`` in your AWS account. The output indicates that snapshots are enabled for longer IDs - snapshots created by this user receive longer IDs. | |
22 | The following ``describe-identity-id-format`` example describes the ID format received by snapshots created by the IAM user ``AdminUser`` in your AWS account. :: | |
22 | 23 | |
23 | Command:: | |
24 | aws ec2 describe-identity-id-format \ | |
25 | --principal-arn arn:aws:iam::123456789012:user/AdminUser \ | |
26 | --resource snapshot | |
24 | 27 | |
25 | aws ec2 describe-identity-id-format --principal-arn arn:aws:iam::123456789012:user/AdminUser --resource snapshot | |
28 | The output indicates that snapshots created by this user receive IDs in long ID format. :: | |
26 | 29 | |
27 | Output:: | |
28 | ||
29 | { | |
30 | "Statuses": [ | |
31 | { | |
32 | "UseLongIds": true, | |
33 | "Resource": "snapshot" | |
34 | } | |
35 | ] | |
36 | }⏎ | |
30 | { | |
31 | "Statuses": [ | |
32 | { | |
33 | "Deadline": "2016-12-15T00:00:00Z", | |
34 | "Resource": "snapshot", | |
35 | "UseLongIds": true | |
36 | } | |
37 | ] | |
38 | }⏎ |
0 | **To monitor an import image task** | |
1 | ||
2 | The following ``describe-import-image-tasks`` example checks the status of the specified import image task. :: | |
3 | ||
4 | aws ec2 describe-import-image-tasks \ | |
5 | --import-task-ids import-ami-1234567890abcdef0 | |
6 | ||
7 | Output for an import image task that is in progress. :: | |
8 | ||
9 | { | |
10 | "ImportImageTasks": [ | |
11 | { | |
12 | "ImportTaskId": "import-ami-1234567890abcdef0", | |
13 | "Progress": "28", | |
14 | "SnapshotDetails": [ | |
15 | { | |
16 | "DiskImageSize": 705638400.0, | |
17 | "Format": "ova", | |
18 | "Status": "completed", | |
19 | "UserBucket": { | |
20 | "S3Bucket": "my-import-bucket", | |
21 | "S3Key": "vms/my-server-vm.ova" | |
22 | } | |
23 | } | |
24 | ], | |
25 | "Status": "active", | |
26 | "StatusMessage": "converting" | |
27 | } | |
28 | ] | |
29 | } | |
30 | ||
31 | Output for an import image task that is completed. The ID of the resulting AMI is provided by ``ImageId``. :: | |
32 | ||
33 | { | |
34 | "ImportImageTasks": [ | |
35 | { | |
36 | "ImportTaskId": "import-ami-1234567890abcdef0", | |
37 | "ImageId": "ami-1234567890abcdef0", | |
38 | "SnapshotDetails": [ | |
39 | { | |
40 | "DiskImageSize": 705638400.0, | |
41 | "Format": "ova", | |
42 | "SnapshotId": "snap-1234567890abcdef0" | |
43 | "Status": "completed", | |
44 | "UserBucket": { | |
45 | "S3Bucket": "my-import-bucket", | |
46 | "S3Key": "vms/my-server-vm.ova" | |
47 | } | |
48 | } | |
49 | ], | |
50 | "Status": "completed" | |
51 | } | |
52 | ] | |
53 | } |
0 | **To monitor an import snapshot task** | |
1 | ||
2 | The following ``describe-import-snapshot-tasks`` example checks the status of the specified import snapshot task. :: | |
3 | ||
4 | aws ec2 describe-import-snapshot-tasks \ | |
5 | --import-task-ids import-snap-1234567890abcdef0 | |
6 | ||
7 | Output for an import snapshot task that is in progress:: | |
8 | ||
9 | { | |
10 | "ImportSnapshotTasks": [ | |
11 | { | |
12 | "Description": "My server VMDK", | |
13 | "ImportTaskId": "import-snap-1234567890abcdef0", | |
14 | "SnapshotTaskDetail": { | |
15 | "Description": "My server VMDK", | |
16 | "DiskImageSize": "705638400.0", | |
17 | "Format": "VMDK", | |
18 | "Progress": "42", | |
19 | "Status": "active", | |
20 | "StatusMessage": "downloading/converting", | |
21 | "UserBucket": { | |
22 | "S3Bucket": "my-import-bucket", | |
23 | "S3Key": "vms/my-server-vm.vmdk" | |
24 | } | |
25 | } | |
26 | } | |
27 | ] | |
28 | } | |
29 | ||
30 | Output for an import snapshot task that is completed. The ID of the resulting snapshot is provided by ``SnapshotId``. :: | |
31 | ||
32 | { | |
33 | "ImportSnapshotTasks": [ | |
34 | { | |
35 | "Description": "My server VMDK", | |
36 | "ImportTaskId": "import-snap-1234567890abcdef0", | |
37 | "SnapshotTaskDetail": { | |
38 | "Description": "My server VMDK", | |
39 | "DiskImageSize": "705638400.0", | |
40 | "Format": "VMDK", | |
41 | "SnapshotId": "snap-1234567890abcdef0" | |
42 | "Status": "completed", | |
43 | "UserBucket": { | |
44 | "S3Bucket": "my-import-bucket", | |
45 | "S3Key": "vms/my-server-vm.vmdk" | |
46 | } | |
47 | } | |
48 | } | |
49 | ] | |
50 | } |
0 | **To describe an Amazon EC2 instance** | |
1 | ||
2 | Command:: | |
3 | ||
4 | aws ec2 describe-instances --instance-ids i-1234567890abcdef0 | |
5 | ||
6 | **To describe all instances with the instance type m1.small** | |
7 | ||
8 | Command:: | |
9 | ||
10 | aws ec2 describe-instances --filters "Name=instance-type,Values=m1.small" | |
11 | ||
12 | **To describe all instances with a Owner tag** | |
13 | ||
14 | Command:: | |
15 | ||
16 | aws ec2 describe-instances --filters "Name=tag-key,Values=Owner" | |
17 | ||
18 | **To describe all instances with a Purpose=test tag** | |
19 | ||
20 | Command:: | |
21 | ||
22 | aws ec2 describe-instances --filters "Name=tag:Purpose,Values=test" | |
23 | ||
24 | **To describe an EC2 instance and filter the result to return the AMI ID, and all tags associated with the instance.** | |
25 | ||
26 | Command:: | |
27 | ||
28 | aws ec2 describe-instances --instance-id i-1234567890abcdef0 --query "Reservations[*].Instances[*].[ImageId,Tags[*]]" | |
29 | ||
30 | **To describe all instances, and return all instance IDs and AMI IDs, but only show the tag value where the tag key is "Application".** | |
31 | ||
32 | Linux Command:: | |
33 | ||
34 | aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId,ImageId,Tags[?Key==`Application`].Value]' | |
35 | ||
36 | Windows Command:: | |
37 | ||
38 | aws ec2 describe-instances --query "Reservations[*].Instances[*].[InstanceId,ImageId,Tags[?Key==`Application`].Value]" | |
39 | ||
40 | **To describe all EC2 instances that have an instance type of m1.small or m1.medium that are also in the us-west-2c Availability Zone** | |
41 | ||
42 | Command:: | |
43 | ||
44 | aws ec2 describe-instances --filters "Name=instance-type,Values=m1.small,m1.medium" "Name=availability-zone,Values=us-west-2c" | |
45 | ||
46 | The following JSON input performs the same filtering. | |
47 | ||
48 | Command:: | |
49 | ||
50 | aws ec2 describe-instances --filters file://filters.json | |
51 | ||
52 | filters.json:: | |
53 | ||
54 | [ | |
55 | { | |
56 | "Name": "instance-type", | |
57 | "Values": ["m1.small", "m1.medium"] | |
58 | }, | |
59 | { | |
60 | "Name": "availability-zone", | |
61 | "Values": ["us-west-2c"] | |
62 | } | |
63 | ] | |
64 | ||
65 | For more information, see `Using Amazon EC2 Instances`_ in the *AWS Command Line Interface User Guide*. | |
66 | ||
67 | .. _`Using Amazon EC2 Instances`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html | |
68 | ||
0 | **Example 1: To describe an Amazon EC2 instance** | |
1 | ||
2 | The following ``describe-instances`` example displays details about the specified instance. :: | |
3 | ||
4 | aws ec2 describe-instances \ | |
5 | --instance-ids i-1234567890abcdef0 | |
6 | ||
7 | **Example 2: To describe instances based on instance type** | |
8 | ||
9 | The following ``describe-instances`` example displays details about only instances of the specified type. :: | |
10 | ||
11 | aws ec2 describe-instances \ | |
12 | --filters Name=instance-type,Values=m5.large | |
13 | ||
14 | **Example 3: To describe instances based on a tag key and value** | |
15 | ||
16 | The following ``describe-instances`` example displays details about only those instances that have a tag with the specified key name and value. :: | |
17 | ||
18 | aws ec2 describe-instances \ | |
19 | --filters "Name=tag-key,Values=Owner" | |
20 | ||
21 | **Example 4: To filter the results based on multiple conditions** | |
22 | ||
23 | The following ``describe-instances`` example displays details about all instances with the specified type that are also in the specified Availability Zone. :: | |
24 | ||
25 | aws ec2 describe-instances \ | |
26 | --filters Name=instance-type,Values=t2.micro,t3.micro Name=availability-zone,Values=us-east-2c | |
27 | ||
28 | 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. :: | |
29 | ||
30 | aws ec2 describe-instances \ | |
31 | --filters file://filters.json | |
32 | ||
33 | Contents of ``filters.json``:: | |
34 | ||
35 | [ | |
36 | { | |
37 | "Name": "instance-type", | |
38 | "Values": ["t2.micro", "t3.micro"] | |
39 | }, | |
40 | { | |
41 | "Name": "availability-zone", | |
42 | "Values": ["us-east-2c"] | |
43 | } | |
44 | ] | |
45 | ||
46 | **Example 5: To restrict the results to only specified fields** | |
47 | ||
48 | The following ``describe-instances`` example uses the ``--query`` parameter to display only the AMI ID and tags for the specified instance. :: | |
49 | ||
50 | aws ec2 describe-instances \ | |
51 | --instance-id i-1234567890abcdef0 \ | |
52 | --query "Reservations[*].Instances[*].[ImageId,Tags[*]]" | |
53 | ||
54 | The following ``describe-instances`` example uses the ``--query`` parameter to display only the instance and subnet IDs for all instances. | |
55 | ||
56 | Linux Command:: | |
57 | ||
58 | aws ec2 describe-instances \ | |
59 | --query 'Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}' \ | |
60 | --output json | |
61 | ||
62 | Windows Command:: | |
63 | ||
64 | aws ec2 describe-instances ^ | |
65 | --query "Reservations[*].Instances[*].{Instance:InstanceId,Subnet:SubnetId}" ^ | |
66 | --output json | |
67 | ||
68 | Output:: | |
69 | ||
70 | [ | |
71 | { | |
72 | "Instance": "i-057750d42936e468a", | |
73 | "Subnet": "subnet-069beee9b12030077" | |
74 | }, | |
75 | { | |
76 | "Instance": "i-001efd250faaa6ffa", | |
77 | "Subnet": "subnet-0b715c6b7db68927a" | |
78 | }, | |
79 | { | |
80 | "Instance": "i-027552a73f021f3bd", | |
81 | "Subnet": "subnet-0250c25a1f4e15235" | |
82 | } | |
83 | ] | |
84 | ||
85 | **Example 6: To describe instances with a specific tag and filter the results to specific fields** | |
86 | ||
87 | 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``. | |
88 | ||
89 | Linux Command:: | |
90 | ||
91 | aws ec2 describe-instances \ | |
92 | --filter Name=tag-key,Values=Name \ | |
93 | --query 'Reservations[*].Instances[*].{Instance:InstanceId,AZ:Placement.AvailabilityZone,Name:Tags[?Key==`Name`]|[0].Value}' \ | |
94 | --output table | |
95 | ||
96 | Windows Command:: | |
97 | ||
98 | aws ec2 describe-instances ^ | |
99 | --filter Name=tag-key,Values=Name ^ | |
100 | --query "Reservations[*].Instances[*].{Instance:InstanceId,AZ:Placement.AvailabilityZone,Name:Tags[?Key==`Name`]|[0].Value}" ^ | |
101 | --output table | |
102 | ||
103 | Output:: | |
104 | ||
105 | ------------------------------------------------------------- | |
106 | | DescribeInstances | | |
107 | +--------------+-----------------------+--------------------+ | |
108 | | AZ | Instance | Name | | |
109 | +--------------+-----------------------+--------------------+ | |
110 | | us-east-2b | i-057750d42936e468a | my-prod-server | | |
111 | | us-east-2a | i-001efd250faaa6ffa | test-server-1 | | |
112 | | us-east-2a | i-027552a73f021f3bd | test-server-2 | | |
113 | +--------------+-----------------------+--------------------+ | |
114 | ||
115 | **Example 7: To view the partition number for an instance in a partition placement group** | |
116 | ||
117 | The following ``describe-instances`` example displays details about 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. :: | |
118 | ||
119 | aws ec2 describe-instances \ | |
120 | --instance-id i-0123a456700123456 | |
121 | ||
122 | The following output is truncated to show only the relevant information:: | |
123 | ||
124 | "Placement": { | |
125 | "AvailabilityZone": "us-east-1c", | |
126 | "GroupName": "HDFS-Group-A", | |
127 | "PartitionNumber": 3, | |
128 | "Tenancy": "default" | |
129 | } | |
130 | ||
131 | 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 Elastic Compute Cloud Users Guide*. | |
132 | ||
133 | **Example 8: To filter instances for a specific partition placement group and partition number** | |
134 | ||
135 | The following ``describe-instances`` example filters the results to only those instances with the specified placement group and partition number. :: | |
136 | ||
137 | aws ec2 describe-instances \ | |
138 | --filters "Name = placement-group-name, Values = HDFS-Group-A" "Name = placement-partition-number, Values = 7" | |
139 | ||
140 | The following output is truncated to show only the relevant pieces:: | |
141 | ||
142 | "Instances": [ | |
143 | { | |
144 | "InstanceId": "i-0123a456700123456", | |
145 | "InstanceType": "r4.large", | |
146 | "Placement": { | |
147 | "AvailabilityZone": "us-east-1c", | |
148 | "GroupName": "HDFS-Group-A", | |
149 | "PartitionNumber": 7, | |
150 | "Tenancy": "default" | |
151 | } | |
152 | }, | |
153 | { | |
154 | "InstanceId": "i-9876a543210987654", | |
155 | "InstanceType": "r4.large", | |
156 | "Placement": { | |
157 | "AvailabilityZone": "us-east-1c", | |
158 | "GroupName": "HDFS-Group-A", | |
159 | "PartitionNumber": 7, | |
160 | "Tenancy": "default" | |
161 | } | |
162 | ], | |
163 | ||
164 | 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 Elastic Compute Cloud Users Guide*. |
0 | **To describe the longer ID settings for the root user and all IAM roles and IAM users that have explicitly specified a longer ID preference.** | |
0 | **To describe the ID format for IAM users and roles with long ID format enabled** | |
1 | 1 | |
2 | This example describes ID format for the root user and all IAM roles and IAM users that have explicitly specified a longer ID preference. The output indicates that the following resource types can be enabled or disabled for longer IDs: bundle, conversion-task, customer-gateway, dhcp-options, elastic-ip-allocation, elastic-ip-association, export-task, flow-log, image, import-task, internet-gateway, network-acl, network-acl-association, network-interface, network-interface-attachment, prefix-list, route-table, route-table-association, security-group, subnet, subnet-cidr-block-association, vpc, vpc-cidr-block-association, vpc-endpoint, vpc-peering-connection, vpn-connection, and vpn-gateway. | |
2 | The following ``describe-principal-id-format`` example describes the ID format for the root user, all IAM roles, and all IAM users with long ID format enabled. :: | |
3 | 3 | |
4 | The ``Deadline`` value for the reservation, instance, volume, and snapshot resource types indicates that the deadline for those resources expired at 00:00 UTC on December 15, 2016. It also shows that the root account has enabled longer IDs for all supported resource types, while the ``user1`` IAM user has disabled longer IDs for image and bundle resource types, and the ``Admin`` IAM role has disable longer IDs for vpc and subnet resource types. | |
5 | ||
6 | Command:: | |
7 | ||
8 | aws ec2 describe-aggregate-id-format --region eu-west-1 | |
4 | aws ec2 describe-principal-id-format \ | |
5 | --resource instance | |
9 | 6 | |
10 | 7 | Output:: |
11 | 8 | |
12 | { | |
13 | "Statuses": [ | |
14 | { | |
15 | "Resource": "reservation", | |
16 | "Deadline": "2016-12-15T12:00:00.000Z", | |
17 | "UseLongIds": true | |
18 | }, | |
19 | { | |
20 | "Resource": "instance", | |
21 | "Deadline": "2016-12-15T12:00:00.000Z", | |
22 | "UseLongIds": true | |
23 | }, | |
24 | { | |
25 | "Resource": "volume", | |
26 | "Deadline": "2016-12-15T12:00:00.000Z", | |
27 | "UseLongIds": true | |
28 | }, | |
29 | { | |
30 | "Resource": "snapshot", | |
31 | "Deadline": "2016-12-15T12:00:00.000Z", | |
32 | "UseLongIds": true | |
33 | }, | |
34 | { | |
35 | "UseLongIds": true, | |
36 | "Resource": "network-interface-attachment" | |
37 | }, | |
38 | { | |
39 | "UseLongIds": true, | |
40 | "Resource": "network-interface" | |
41 | }, | |
42 | { | |
43 | "UseLongIds": true, | |
44 | "Resource": "elastic-ip-allocation" | |
45 | }, | |
46 | { | |
47 | "UseLongIds": true, | |
48 | "Resource": "elastic-ip-association" | |
49 | }, | |
50 | { | |
51 | "UseLongIds": true, | |
52 | "Resource": "vpc" | |
53 | }, | |
54 | { | |
55 | "UseLongIds": true, | |
56 | "Resource": "subnet" | |
57 | }, | |
58 | { | |
59 | "UseLongIds": true, | |
60 | "Resource": "route-table" | |
61 | }, | |
62 | { | |
63 | "UseLongIds": true, | |
64 | "Resource": "route-table-association" | |
65 | }, | |
66 | { | |
67 | "UseLongIds": true, | |
68 | "Resource": "network-acl" | |
69 | }, | |
70 | { | |
71 | "UseLongIds": true, | |
72 | "Resource": "network-acl-association" | |
73 | }, | |
74 | { | |
75 | "UseLongIds": true, | |
76 | "Resource": "dhcp-options" | |
77 | }, | |
78 | { | |
79 | "UseLongIds": true, | |
80 | "Resource": "internet-gateway" | |
81 | }, | |
82 | { | |
83 | "UseLongIds": true, | |
84 | "Resource": "vpc-cidr-block-association" | |
85 | }, | |
86 | { | |
87 | "UseLongIds": true, | |
88 | "Resource": "vpc-ipv6-cidr-block-association" | |
89 | }, | |
90 | { | |
91 | "UseLongIds": true, | |
92 | "Resource": "subnet-ipv6-cidr-block-association" | |
93 | }, | |
94 | { | |
95 | "UseLongIds": true, | |
96 | "Resource": "vpc-peering-connection" | |
97 | }, | |
98 | { | |
99 | "UseLongIds": true, | |
100 | "Resource": "security-group" | |
101 | }, | |
102 | { | |
103 | "UseLongIds": true, | |
104 | "Resource": "flow-log" | |
105 | }, | |
106 | { | |
107 | "UseLongIds": true, | |
108 | "Resource": "conversion-task" | |
109 | }, | |
110 | { | |
111 | "UseLongIds": true, | |
112 | "Resource": "export-task" | |
113 | }, | |
114 | { | |
115 | "UseLongIds": true, | |
116 | "Resource": "import-task" | |
117 | }, | |
118 | { | |
119 | "UseLongIds": true, | |
120 | "Resource": "image" | |
121 | }, | |
122 | { | |
123 | "UseLongIds": true, | |
124 | "Resource": "bundle" | |
125 | }, | |
126 | { | |
127 | "UseLongIds": true, | |
128 | "Resource": "vpc-endpoint" | |
129 | }, | |
130 | { | |
131 | "UseLongIds": true, | |
132 | "Resource": "customer-gateway" | |
133 | }, | |
134 | { | |
135 | "UseLongIds": true, | |
136 | "Resource": "vpn-connection" | |
137 | }, | |
138 | { | |
139 | "UseLongIds": true, | |
140 | "Resource": "vpn-gateway" | |
141 | } | |
142 | ], | |
143 | "Arn": "arn:aws:iam::123456789098:root" | |
144 | }, | |
145 | { | |
146 | "Statuses": [ | |
147 | { | |
148 | "Resource": "reservation", | |
149 | "Deadline": "2016-12-15T12:00:00.000Z", | |
150 | "UseLongIds": true | |
151 | }, | |
152 | { | |
153 | "Resource": "instance", | |
154 | "Deadline": "2016-12-15T12:00:00.000Z", | |
155 | "UseLongIds": true | |
156 | }, | |
157 | { | |
158 | "Resource": "volume", | |
159 | "Deadline": "2016-12-15T12:00:00.000Z", | |
160 | "UseLongIds": true | |
161 | }, | |
162 | { | |
163 | "Resource": "snapshot", | |
164 | "Deadline": "2016-12-15T12:00:00.000Z", | |
165 | "UseLongIds": true | |
166 | }, | |
167 | { | |
168 | "UseLongIds": true, | |
169 | "Resource": "network-interface-attachment" | |
170 | }, | |
171 | { | |
172 | "UseLongIds": true, | |
173 | "Resource": "network-interface" | |
174 | }, | |
175 | { | |
176 | "UseLongIds": true, | |
177 | "Resource": "elastic-ip-allocation" | |
178 | }, | |
179 | { | |
180 | "UseLongIds": true, | |
181 | "Resource": "elastic-ip-association" | |
182 | }, | |
183 | { | |
184 | "UseLongIds": true, | |
185 | "Resource": "vpc" | |
186 | }, | |
187 | { | |
188 | "UseLongIds": true, | |
189 | "Resource": "subnet" | |
190 | }, | |
191 | { | |
192 | "UseLongIds": true, | |
193 | "Resource": "route-table" | |
194 | }, | |
195 | { | |
196 | "UseLongIds": true, | |
197 | "Resource": "route-table-association" | |
198 | }, | |
199 | { | |
200 | "UseLongIds": true, | |
201 | "Resource": "network-acl" | |
202 | }, | |
203 | { | |
204 | "UseLongIds": true, | |
205 | "Resource": "network-acl-association" | |
206 | }, | |
207 | { | |
208 | "UseLongIds": true, | |
209 | "Resource": "dhcp-options" | |
210 | }, | |
211 | { | |
212 | "UseLongIds": true, | |
213 | "Resource": "internet-gateway" | |
214 | }, | |
215 | { | |
216 | "UseLongIds": true, | |
217 | "Resource": "vpc-cidr-block-association" | |
218 | }, | |
219 | { | |
220 | "UseLongIds": true, | |
221 | "Resource": "vpc-ipv6-cidr-block-association" | |
222 | }, | |
223 | { | |
224 | "UseLongIds": true, | |
225 | "Resource": "subnet-ipv6-cidr-block-association" | |
226 | }, | |
227 | { | |
228 | "UseLongIds": true, | |
229 | "Resource": "vpc-peering-connection" | |
230 | }, | |
231 | { | |
232 | "UseLongIds": true, | |
233 | "Resource": "security-group" | |
234 | }, | |
235 | { | |
236 | "UseLongIds": true, | |
237 | "Resource": "flow-log" | |
238 | }, | |
239 | { | |
240 | "UseLongIds": true, | |
241 | "Resource": "conversion-task" | |
242 | }, | |
243 | { | |
244 | "UseLongIds": true, | |
245 | "Resource": "export-task" | |
246 | }, | |
247 | { | |
248 | "UseLongIds": true, | |
249 | "Resource": "import-task" | |
250 | }, | |
251 | { | |
252 | "UseLongIds": false, | |
253 | "Resource": "image" | |
254 | }, | |
255 | { | |
256 | "UseLongIds": false, | |
257 | "Resource": "bundle" | |
258 | }, | |
259 | { | |
260 | "UseLongIds": true, | |
261 | "Resource": "vpc-endpoint" | |
262 | }, | |
263 | { | |
264 | "UseLongIds": true, | |
265 | "Resource": "customer-gateway" | |
266 | }, | |
267 | { | |
268 | "UseLongIds": true, | |
269 | "Resource": "vpn-connection" | |
270 | }, | |
271 | { | |
272 | "UseLongIds": true, | |
273 | "Resource": "vpn-gateway" | |
274 | } | |
275 | ], | |
276 | "Arn": "arn:aws:iam::123456789098:user/user1" | |
277 | }, | |
278 | { | |
279 | "Statuses": [ | |
280 | { | |
281 | "Resource": "reservation", | |
282 | "Deadline": "2016-12-15T12:00:00.000Z", | |
283 | "UseLongIds": true | |
284 | }, | |
285 | { | |
286 | "Resource": "instance", | |
287 | "Deadline": "2016-12-15T12:00:00.000Z", | |
288 | "UseLongIds": true | |
289 | }, | |
290 | { | |
291 | "Resource": "volume", | |
292 | "Deadline": "2016-12-15T12:00:00.000Z", | |
293 | "UseLongIds": true | |
294 | }, | |
295 | { | |
296 | "Resource": "snapshot", | |
297 | "Deadline": "2016-12-15T12:00:00.000Z", | |
298 | "UseLongIds": true | |
299 | }, | |
300 | { | |
301 | "UseLongIds": true, | |
302 | "Resource": "network-interface-attachment" | |
303 | }, | |
304 | { | |
305 | "UseLongIds": true, | |
306 | "Resource": "network-interface" | |
307 | }, | |
308 | { | |
309 | "UseLongIds": true, | |
310 | "Resource": "elastic-ip-allocation" | |
311 | }, | |
312 | { | |
313 | "UseLongIds": true, | |
314 | "Resource": "elastic-ip-association" | |
315 | }, | |
316 | { | |
317 | "UseLongIds": false, | |
318 | "Resource": "vpc" | |
319 | }, | |
320 | { | |
321 | "UseLongIds": false, | |
322 | "Resource": "subnet" | |
323 | }, | |
324 | { | |
325 | "UseLongIds": true, | |
326 | "Resource": "route-table" | |
327 | }, | |
328 | { | |
329 | "UseLongIds": true, | |
330 | "Resource": "route-table-association" | |
331 | }, | |
332 | { | |
333 | "UseLongIds": true, | |
334 | "Resource": "network-acl" | |
335 | }, | |
336 | { | |
337 | "UseLongIds": true, | |
338 | "Resource": "network-acl-association" | |
339 | }, | |
340 | { | |
341 | "UseLongIds": true, | |
342 | "Resource": "dhcp-options" | |
343 | }, | |
344 | { | |
345 | "UseLongIds": true, | |
346 | "Resource": "internet-gateway" | |
347 | }, | |
348 | { | |
349 | "UseLongIds": true, | |
350 | "Resource": "vpc-cidr-block-association" | |
351 | }, | |
352 | { | |
353 | "UseLongIds": true, | |
354 | "Resource": "vpc-ipv6-cidr-block-association" | |
355 | }, | |
356 | { | |
357 | "UseLongIds": true, | |
358 | "Resource": "subnet-ipv6-cidr-block-association" | |
359 | }, | |
360 | { | |
361 | "UseLongIds": true, | |
362 | "Resource": "vpc-peering-connection" | |
363 | }, | |
364 | { | |
365 | "UseLongIds": true, | |
366 | "Resource": "security-group" | |
367 | }, | |
368 | { | |
369 | "UseLongIds": true, | |
370 | "Resource": "flow-log" | |
371 | }, | |
372 | { | |
373 | "UseLongIds": true, | |
374 | "Resource": "conversion-task" | |
375 | }, | |
376 | { | |
377 | "UseLongIds": true, | |
378 | "Resource": "export-task" | |
379 | }, | |
380 | { | |
381 | "UseLongIds": true, | |
382 | "Resource": "import-task" | |
383 | }, | |
384 | { | |
385 | "UseLongIds": true, | |
386 | "Resource": "image" | |
387 | }, | |
388 | { | |
389 | "UseLongIds": true, | |
390 | "Resource": "bundle" | |
391 | }, | |
392 | { | |
393 | "UseLongIds": true, | |
394 | "Resource": "vpc-endpoint" | |
395 | }, | |
396 | { | |
397 | "UseLongIds": true, | |
398 | "Resource": "customer-gateway" | |
399 | }, | |
400 | { | |
401 | "UseLongIds": true, | |
402 | "Resource": "vpn-connection" | |
403 | }, | |
404 | { | |
405 | "UseLongIds": true, | |
406 | "Resource": "vpn-gateway" | |
407 | } | |
408 | ] | |
409 | "Arn": "arn:aws:iam::123456789098:role/Admin" | |
410 | } | |
9 | { | |
10 | "Principals": [ | |
11 | { | |
12 | "Arn": "arn:aws:iam::123456789012:root", | |
13 | "Statuses": [ | |
14 | { | |
15 | "Deadline": "2016-12-15T00:00:00.000Z", | |
16 | "Resource": "reservation", | |
17 | "UseLongIds": true | |
18 | }, | |
19 | { | |
20 | "Deadline": "2016-12-15T00:00:00.000Z", | |
21 | "Resource": "instance", | |
22 | "UseLongIds": true | |
23 | }, | |
24 | { | |
25 | "Deadline": "2016-12-15T00:00:00.000Z", | |
26 | "Resource": "volume", | |
27 | "UseLongIds": true | |
28 | }, | |
29 | ] | |
30 | }, | |
31 | ... | |
32 | ] | |
33 | } |
0 | **To describe your public IPv4 address pools** | |
1 | ||
2 | The following ``describe-public-ipv4-pools`` example displays details about the address pools that were created when you provisioned public IPv4 address ranges using Bring Your Own IP Addresses (BYOIP). :: | |
3 | ||
4 | aws ec2 describe-public-ipv4-pools | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "PublicIpv4Pools": [ | |
10 | { | |
11 | "PoolId": "ipv4pool-ec2-1234567890abcdef0", | |
12 | "PoolAddressRanges": [ | |
13 | { | |
14 | "FirstAddress": "203.0.113.0", | |
15 | "LastAddress": "203.0.113.255", | |
16 | "AddressCount": 256, | |
17 | "AvailableAddressCount": 256 | |
18 | } | |
19 | ], | |
20 | "TotalAddressCount": 256, | |
21 | "TotalAvailableAddressCount": 256 | |
22 | } | |
23 | ] | |
24 | } |
0 | **Example 1: To describe all of your enabled regions** | |
1 | ||
2 | This example describes all Regions that are enabled for your account. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ec2 describe-regions | |
0 | **Example 1: To describe all of your enabled Regions** | |
1 | ||
2 | The following ``describe-regions`` example describes all of the Regions that are enabled for your account. :: | |
3 | ||
4 | aws ec2 describe-regions | |
7 | 5 | |
8 | 6 | Output:: |
9 | 7 | |
97 | 95 | ] |
98 | 96 | } |
99 | 97 | |
100 | **Example 2: To describe enabled regions with an endpoint whose name contains a specific string** | |
101 | ||
102 | This example describes all regions that you have enabled that have the string "us" in the endpoint. :: | |
98 | **Example 2: To describe enabled Regions with an endpoint whose name contains a specific string** | |
99 | ||
100 | The following ``describe-regions`` example describes all Regions that you have enabled that have the string "us" in the endpoint. :: | |
103 | 101 | |
104 | 102 | aws ec2 describe-regions --filters "Name=endpoint,Values=*us*" |
105 | 103 | |
126 | 124 | ] |
127 | 125 | } |
128 | 126 | |
129 | **Example 3: To describe all regions** | |
127 | **To describe all Regions** | |
130 | 128 | |
131 | 129 | The following ``describe-regions`` example describes all available Regions, including opt-in Regions like HKG and BAH. For a description of opt-in Regions, see `Available Regions <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions>`__ in the *Amazon EC2 User Guide*. :: |
132 | 130 | |
166 | 164 | "Endpoint": "ec2.ap-northeast-3.amazonaws.com", |
167 | 165 | "RegionName": "ap-northeast-3", |
168 | 166 | "OptInStatus": "opt-in-not-required" |
167 | }, | |
168 | { | |
169 | "Endpoint": "ec2.me-south-1.amazonaws.com", | |
170 | "RegionName": "me-south-1", | |
171 | "OptInStatus": "not-opted-in" | |
169 | 172 | }, |
170 | 173 | { |
171 | 174 | "Endpoint": "ec2.ap-northeast-2.amazonaws.com", |
230 | 233 | ] |
231 | 234 | } |
232 | 235 | |
233 | **Example 4: To describe region names only** | |
234 | ||
235 | This example uses the ``--query`` parameter to filter the output and return the names of the regions only. The output is returned as tab-delimited lines. :: | |
236 | ||
237 | aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text | |
238 | ||
239 | Output:: | |
240 | ||
241 | ap-south-1 | |
242 | eu-west-3 | |
243 | eu-west-2 | |
244 | eu-west-1 | |
245 | ap-northeast-3 | |
246 | ap-northeast-2 | |
247 | ap-northeast-1 | |
248 | sa-east-1 | |
249 | ca-central-1 | |
250 | ap-southeast-1 | |
251 | ap-southeast-2 | |
252 | eu-central-1 | |
253 | us-east-1 | |
254 | us-east-2 | |
255 | us-west-1 | |
256 | us-west-2 | |
236 | **To list the Region names only** | |
237 | ||
238 | The following ``describe-regions`` example uses the ``--query`` parameter to filter the output and return only the names of the Regions as text. :: | |
239 | ||
240 | aws ec2 describe-regions \ | |
241 | --all-regions \ | |
242 | --query "Regions[].{Name:RegionName}" \ | |
243 | --output text | |
244 | ||
245 | Output:: | |
246 | ||
247 | eu-north-1 | |
248 | ap-south-1 | |
249 | eu-west-3 | |
250 | eu-west-2 | |
251 | eu-west-1 | |
252 | ap-northeast-3 | |
253 | ap-northeast-2 | |
254 | me-south-1 | |
255 | ap-northeast-1 | |
256 | sa-east-1 | |
257 | ca-central-1 | |
258 | ap-east-1 | |
259 | ap-southeast-1 | |
260 | ap-southeast-2 | |
261 | eu-central-1 | |
262 | us-east-1 | |
263 | us-east-2 | |
264 | us-west-1 | |
265 | us-west-2 |
0 | **Example 1: To describe your tags** | |
1 | ||
2 | The following ``describe-tags`` example describes the tags for all your resources. :: | |
3 | ||
4 | aws ec2 describe-tags | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Tags": [ | |
10 | { | |
11 | "ResourceType": "image", | |
12 | "ResourceId": "ami-78a54011", | |
13 | "Value": "Production", | |
14 | "Key": "Stack" | |
15 | }, | |
16 | { | |
17 | "ResourceType": "image", | |
18 | "ResourceId": "ami-3ac33653", | |
19 | "Value": "Test", | |
20 | "Key": "Stack" | |
21 | }, | |
22 | { | |
23 | "ResourceType": "instance", | |
24 | "ResourceId": "i-1234567890abcdef0", | |
25 | "Value": "Production", | |
26 | "Key": "Stack" | |
27 | }, | |
28 | { | |
29 | "ResourceType": "instance", | |
30 | "ResourceId": "i-1234567890abcdef1", | |
31 | "Value": "Test", | |
32 | "Key": "Stack" | |
33 | }, | |
34 | { | |
35 | "ResourceType": "instance", | |
36 | "ResourceId": "i-1234567890abcdef5", | |
37 | "Value": "Beta Server", | |
38 | "Key": "Name" | |
39 | }, | |
40 | { | |
41 | "ResourceType": "volume", | |
42 | "ResourceId": "vol-049df61146c4d7901", | |
43 | "Value": "Project1", | |
44 | "Key": "Purpose" | |
45 | }, | |
46 | { | |
47 | "ResourceType": "volume", | |
48 | "ResourceId": "vol-1234567890abcdef0", | |
49 | "Value": "Logs", | |
50 | "Key": "Purpose" | |
51 | } | |
52 | ] | |
53 | } | |
54 | ||
55 | **Example 2: To describe the tags for a single resource** | |
0 | **Example 1: To describe all tags for a single resource** | |
56 | 1 | |
57 | 2 | The following ``describe-tags`` example describes the tags for the specified instance. :: |
58 | 3 | |
78 | 23 | ] |
79 | 24 | } |
80 | 25 | |
81 | **Example 3: To describe the tags for a type of resource** | |
26 | **Example 2: To describe all tags for a resource type** | |
82 | 27 | |
83 | 28 | The following ``describe-tags`` example describes the tags for your volumes. :: |
84 | 29 | |
104 | 49 | ] |
105 | 50 | } |
106 | 51 | |
107 | **Example 4: To describe the tags for your resources based on a key and a value** | |
52 | **Example 3: To describe all your tags** | |
108 | 53 | |
109 | The following ``describe-tags`` example describes the tags for your resources that have the key ``Stack`` and a value ``Test``. :: | |
54 | The following ``describe-tags`` example describes the tags for all your resources. :: | |
55 | ||
56 | aws ec2 describe-tags | |
57 | ||
58 | **Example 4: To describe the tags for your resources based on a tag key** | |
59 | ||
60 | The following ``describe-tags`` example describes the tags for your resources that have a tag with the key ``Stack``. :: | |
110 | 61 | |
111 | 62 | aws ec2 describe-tags \ |
112 | --filters "Name=key,Values=Stack" "Name=value,Values=Test" | |
63 | --filters Name=key,Values=Stack | |
113 | 64 | |
114 | 65 | Output:: |
115 | 66 | |
116 | 67 | { |
117 | 68 | "Tags": [ |
118 | 69 | { |
119 | "ResourceType": "image", | |
120 | "ResourceId": "ami-3ac33653", | |
121 | "Value": "Test", | |
70 | "ResourceType": "volume", | |
71 | "ResourceId": "vol-027552a73f021f3b", | |
72 | "Value": "Production", | |
122 | 73 | "Key": "Stack" |
123 | 74 | }, |
124 | 75 | { |
130 | 81 | ] |
131 | 82 | } |
132 | 83 | |
133 | **Example 5: To describe the tags for your resources based on a key and a value using the shortcut syntax** | |
84 | **Example 5: To describe the tags for your resources based on a tag key and tag value** | |
134 | 85 | |
135 | The following ``describe-tags`` example is an alternative syntax to describe resources with the key ``Stack`` and a value ``Test``. :: | |
86 | The following ``describe-tags`` example describes the tags for your resources that have the tag ``Stack=Test``. :: | |
136 | 87 | |
137 | aws ec2 describe-tags --filters "Name=tag:Stack,Values=Test" | |
88 | aws ec2 describe-tags \ | |
89 | --filters Name=key,Values=Stack Name=value,Values=Test | |
138 | 90 | |
139 | **Example 6: To describe the tags for your resources based on only a key** | |
91 | Output:: | |
140 | 92 | |
141 | This example describes the tags for all your instances that have a tag with the key ``Purpose`` and no value. :: | |
93 | { | |
94 | "Tags": [ | |
95 | { | |
96 | "ResourceType": "image", | |
97 | "ResourceId": "ami-3ac336533f021f3bd", | |
98 | "Value": "Test", | |
99 | "Key": "Stack" | |
100 | }, | |
101 | { | |
102 | "ResourceType": "instance", | |
103 | "ResourceId": "i-1234567890abcdef8", | |
104 | "Value": "Test", | |
105 | "Key": "Stack" | |
106 | } | |
107 | ] | |
108 | } | |
109 | ||
110 | The following ``describe-tags`` example uses alternate syntax to describe resources with the tag ``Stack=Test``. :: | |
111 | ||
112 | aws ec2 describe-tags \ | |
113 | --filters "Name=tag:Stack,Values=Test" | |
114 | ||
115 | The following ``describe-tags`` example describes the tags for all your instances that have a tag with the key ``Purpose`` and no value. :: | |
142 | 116 | |
143 | 117 | aws ec2 describe-tags \ |
144 | 118 | --filters "Name=resource-type,Values=instance" "Name=key,Values=Purpose" "Name=value,Values=" |
145 | 119 | |
146 | 120 | Output:: |
147 | 121 | |
148 | { | |
149 | "Tags": [ | |
150 | { | |
151 | "ResourceType": "instance", | |
152 | "ResourceId": "i-1234567890abcdef5", | |
153 | "Value": null, | |
154 | "Key": "Purpose" | |
155 | } | |
156 | ] | |
157 | } | |
158 | ||
122 | { | |
123 | "Tags": [ | |
124 | { | |
125 | "ResourceType": "instance", | |
126 | "ResourceId": "i-1234567890abcdef5", | |
127 | "Value": null, | |
128 | "Key": "Purpose" | |
129 | } | |
130 | ] | |
131 | } |
0 | **To view your traffic mirror filters** | |
1 | ||
2 | The following ``describe-traffic-mirror-filters`` example displays details for all of your traffic mirror filters. :: | |
3 | ||
4 | aws ec2 describe-traffic-mirror-filters | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "TrafficMirrorFilters": [ | |
10 | { | |
11 | "TrafficMirrorFilterId": "tmf-0293f26e86EXAMPLE", | |
12 | "IngressFilterRules": [ | |
13 | { | |
14 | "TrafficMirrorFilterRuleId": "tmfr-0ca76e0e08EXAMPLE", | |
15 | "TrafficMirrorFilterId": "tmf-0293f26e86EXAMPLE", | |
16 | "TrafficDirection": "ingress", | |
17 | "RuleNumber": 100, | |
18 | "RuleAction": "accept", | |
19 | "Protocol": 6, | |
20 | "DestinationCidrBlock": "10.0.0.0/24", | |
21 | "SourceCidrBlock": "10.0.0.0/24", | |
22 | "Description": "TCP Rule" | |
23 | } | |
24 | ], | |
25 | "EgressFilterRules": [], | |
26 | "NetworkServices": [], | |
27 | "Description": "Exanple Filter", | |
28 | "Tags": [] | |
29 | } | |
30 | ] | |
31 | } | |
32 | ||
33 | For more information, see `View Your Traffic Mirror Filters <https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-filter.html#view-traffic-mirroring-filter>`__ in the *AWS Traffic Mirroring Guide*. |
0 | **To view your transit gateway attachments** | |
1 | ||
2 | The following ``describe-transit-gateway-attachments`` example displays details for your transit gateway attachments. :: | |
3 | ||
4 | aws ec2 describe-transit-gateway-attachments | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "TransitGatewayAttachments": [ | |
10 | { | |
11 | "TransitGatewayAttachmentId": "tgw-attach-01f8100bc7EXAMPLE", | |
12 | "TransitGatewayId": "tgw-02f776b1a7EXAMPLE", | |
13 | "TransitGatewayOwnerId": "123456789012", | |
14 | "ResourceOwnerId": "123456789012", | |
15 | "ResourceType": "vpc", | |
16 | "ResourceId": "vpc-3EXAMPLE", | |
17 | "State": "available", | |
18 | "Association": { | |
19 | "TransitGatewayRouteTableId": "tgw-rtb-002573ed1eEXAMPLE", | |
20 | "State": "associated" | |
21 | }, | |
22 | "CreationTime": "2019-08-26T14:59:25.000Z", | |
23 | "Tags": [ | |
24 | { | |
25 | "Key": "Name", | |
26 | "Value": "Example" | |
27 | } | |
28 | ] | |
29 | }, | |
30 | { | |
31 | "TransitGatewayAttachmentId": "tgw-attach-0b5968d3b6EXAMPLE", | |
32 | "TransitGatewayId": "tgw-02f776b1a7EXAMPLE", | |
33 | "TransitGatewayOwnerId": "123456789012", | |
34 | "ResourceOwnerId": "123456789012", | |
35 | "ResourceType": "vpc", | |
36 | "ResourceId": "vpc-0065acced4EXAMPLE", | |
37 | "State": "available", | |
38 | "Association": { | |
39 | "TransitGatewayRouteTableId": "tgw-rtb-002573ed1eEXAMPLE", | |
40 | "State": "associated" | |
41 | }, | |
42 | "CreationTime": "2019-08-07T17:03:07.000Z", | |
43 | "Tags": [] | |
44 | }, | |
45 | { | |
46 | "TransitGatewayAttachmentId": "tgw-attach-08e0bc912cEXAMPLE", | |
47 | "TransitGatewayId": "tgw-02f776b1a7EXAMPLE", | |
48 | "TransitGatewayOwnerId": "123456789012", | |
49 | "ResourceOwnerId": "123456789012", | |
50 | "ResourceType": "direct-connect-gateway", | |
51 | "ResourceId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", | |
52 | "State": "available", | |
53 | "Association": { | |
54 | "TransitGatewayRouteTableId": "tgw-rtb-002573ed1eEXAMPLE", | |
55 | "State": "associated" | |
56 | }, | |
57 | "CreationTime": "2019-08-14T20:27:44.000Z", | |
58 | "Tags": [] | |
59 | }, | |
60 | { | |
61 | "TransitGatewayAttachmentId": "tgw-attach-0a89069f57EXAMPLE", | |
62 | "TransitGatewayId": "tgw-02f776b1a7EXAMPLE", | |
63 | "TransitGatewayOwnerId": "123456789012", | |
64 | "ResourceOwnerId": "123456789012", | |
65 | "ResourceType": "direct-connect-gateway", | |
66 | "ResourceId": "8384da05-13ce-4a91-aada-5a1baEXAMPLE", | |
67 | "State": "available", | |
68 | "Association": { | |
69 | "TransitGatewayRouteTableId": "tgw-rtb-002573ed1eEXAMPLE", | |
70 | "State": "associated" | |
71 | }, | |
72 | "CreationTime": "2019-08-14T20:33:02.000Z", | |
73 | "Tags": [] | |
74 | } | |
75 | ] | |
76 | } | |
77 | ||
78 | For more information, see `Working with Transit Gateways <https://docs.aws.amazon.com/vpc/latest/tgw/working-with-transit-gateways.html>`__ in the *AWS Transit Gateways Guide*. |
0 | **To describe your transit gateway route tables** | |
1 | ||
2 | The following ``describe-transit-gateway-route-tables`` examples displays details for all of your transit gateway route tables. :: | |
3 | ||
4 | aws ec2 describe-transit-gateway-route-tables | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "TransitGatewayRouteTables": [ | |
10 | { | |
11 | "TransitGatewayRouteTableId": "tgw-rtb-0ca78a549EXAMPLE", | |
12 | "TransitGatewayId": "tgw-0bc994abffEXAMPLE", | |
13 | "State": "available", | |
14 | "DefaultAssociationRouteTable": true, | |
15 | "DefaultPropagationRouteTable": true, | |
16 | "CreationTime": "2018-11-28T14:24:49.000Z", | |
17 | "Tags": [] | |
18 | }, | |
19 | { | |
20 | "TransitGatewayRouteTableId": "tgw-rtb-0e8f48f148EXAMPLE", | |
21 | "TransitGatewayId": "tgw-0043d72bb4EXAMPLE", | |
22 | "State": "available", | |
23 | "DefaultAssociationRouteTable": true, | |
24 | "DefaultPropagationRouteTable": true, | |
25 | "CreationTime": "2018-11-28T14:24:00.000Z", | |
26 | "Tags": [] | |
27 | } | |
28 | ] | |
29 | } | |
30 | ||
31 | For more information, see `View Transit Gateway Route Tables <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#view-tgw-route-tables>`__ in the *AWS Transit Gateways Guide*. |
0 | **To disassociate a transit gateway route table from a resource attachment** | |
1 | ||
2 | The following ``disassociate-transit-gateway-route-table`` example disasssociates the transit gateway route table from the specified attachment. :: | |
3 | ||
4 | aws ec2 disassociate-transit-gateway-route-table \ | |
5 | --transit-gateway-route-table-id tgw-rtb-002573ed1eEXAMPLE \ | |
6 | --transit-gateway-attachment-id tgw-attach-08e0bc912cEXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Association": { | |
12 | "TransitGatewayRouteTableId": "tgw-rtb-002573ed1eEXAMPLE", | |
13 | "TransitGatewayAttachmentId": "tgw-attach-08e0bc912cEXAMPLE", | |
14 | "ResourceId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", | |
15 | "ResourceType": "direct-connect-gateway", | |
16 | "State": "disassociating" | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Delete an Association for a Transit Gateway Route Table <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#disassociate-tgw-route-table>`__ in the *AWS Transit Gateways Guide*. |
0 | **To export a VM from an AMI** | |
1 | ||
2 | The following ``export-image`` example exports the specified AMI to the specified bucket in the specified format. :: | |
3 | ||
4 | aws ec2 export-image \ | |
5 | --image-id ami-1234567890abcdef0 \ | |
6 | --disk-image-format VMDK \ | |
7 | --s3-export-location S3Bucket=my-export-bucket,S3Prefix=exports/ | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "DiskImageFormat": "vmdk", | |
13 | "ExportImageTaskId": "export-ami-1234567890abcdef0" | |
14 | "ImageId": "ami-1234567890abcdef0", | |
15 | "RoleName": "vmimport", | |
16 | "Progress": "0", | |
17 | "S3ExportLocation": { | |
18 | "S3Bucket": "my-export-bucket", | |
19 | "S3Prefix": "exports/" | |
20 | }, | |
21 | "Status": "active", | |
22 | "StatusMessage": "validating" | |
23 | } |
0 | **To view capacity reservation usage across AWS accounts** | |
1 | ||
2 | The following ``get-capacity-reservation-usage`` example displays usage information for the specified capacity reservation. :: | |
3 | ||
4 | aws ec2 get-capacity-reservation-usage \ | |
5 | --capacity-reservation-id cr-1234abcd56EXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "CapacityReservationId": "cr-1234abcd56EXAMPLE ", | |
11 | "InstanceUsages": [ | |
12 | { | |
13 | "UsedInstanceCount": 1, | |
14 | "AccountId": "123456789012" | |
15 | } | |
16 | ], | |
17 | "AvailableInstanceCount": 4, | |
18 | "TotalInstanceCount": 5, | |
19 | "State": "active", | |
20 | "InstanceType": "t2.medium" | |
21 | } | |
22 | ||
23 | For more information, see `Viewing Shared Capacity Reservation Usage <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservation-sharing.html#shared-cr-usage>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. |
0 | **To retrieve a screenshot of a running instance** | |
1 | ||
2 | The following ``get-console-screenshot`` example retrieves a screenshot of the specified instance in .jpg format. The screenshot is returned as a Base64-encoded string. :: | |
3 | ||
4 | aws ec2 get-console-screenshot \ | |
5 | --instance-id i-1234567890abcdef0 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ImageData": "997987/8kgj49ikjhewkwwe0008084EXAMPLE", | |
11 | "InstanceId": "i-1234567890abcdef0" | |
12 | } |
0 | **To list the route tables to which the specified resource attachment propagates routes** | |
1 | ||
2 | The following ``get-transit-gateway-attachment-propagations`` example lists the route table to which the specified resource attachment propagates routes. :: | |
3 | ||
4 | aws ec2 get-transit-gateway-attachment-propagations \ | |
5 | --transit-gateway-attachment-id tgw-attach-09fbd47ddfEXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TransitGatewayAttachmentPropagations": [ | |
11 | { | |
12 | "TransitGatewayRouteTableId": "tgw-rtb-0882c61b97EXAMPLE", | |
13 | "State": "enabled" | |
14 | } | |
15 | ] | |
16 | } | |
17 | ||
18 | For more information, see `View Transit Gateway Route Tables <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#view-tgw-route-tables>`__ in the *AWS Transit Gateways Guide*. |
0 | **To display information about the route table propagations for the specified transit gateway route table** | |
1 | ||
2 | The following ``get-transit-gateway-route-table-propagations`` example returns the route table propagations for the specified route table. :: | |
3 | ||
4 | ec2 get-transit-gateway-route-table-propagations \ | |
5 | --transit-gateway-route-table-id tgw-rtb-002573ed1eEXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TransitGatewayRouteTablePropagations": [ | |
11 | { | |
12 | "TransitGatewayAttachmentId": "tgw-attach-01f8100bc7EXAMPLE", | |
13 | "ResourceId": "vpc-3EXAMPLE", | |
14 | "ResourceType": "vpc", | |
15 | "State": "enabled" | |
16 | }, | |
17 | { | |
18 | "TransitGatewayAttachmentId": "tgw-attach-08e0bc912cEXAMPLE", | |
19 | "ResourceId": "11460968-4ac1-4fd3-bdb2-00599EXAMPLE", | |
20 | "ResourceType": "direct-connect-gateway", | |
21 | "State": "enabled" | |
22 | }, | |
23 | { | |
24 | "TransitGatewayAttachmentId": "tgw-attach-0a89069f57EXAMPLE", | |
25 | "ResourceId": "8384da05-13ce-4a91-aada-5a1baEXAMPLE", | |
26 | "ResourceType": "direct-connect-gateway", | |
27 | "State": "enabled" | |
28 | } | |
29 | ] | |
30 | } | |
31 | ||
32 | For more information, see `View Transit Gateway Route Table Propagations<https://docs.aws.amazon.com/vpc/latest/tgw/tgw-route-tables.html#view-tgw-route-propagations>`__ in the *AWS Transit Gateways Guide*. |
0 | **To import a VM image file as an AMI** | |
1 | ||
2 | The following ``import-image`` example imports the specified OVA. :: | |
3 | ||
4 | aws ec2 import-image \ | |
5 | --disk-containers Format=ova,UserBucket="{S3Bucket=my-import-bucket,S3Key=vms/my-server-vm.ova}" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ImportTaskId": "import-ami-1234567890abcdef0", | |
11 | "Progress": "2", | |
12 | "SnapshotDetails": [ | |
13 | { | |
14 | "DiskImageSize": 0.0, | |
15 | "Format": "ova", | |
16 | "UserBucket": { | |
17 | "S3Bucket": "my-import-bucket", | |
18 | "S3Key": "vms/my-server-vm.ova" | |
19 | } | |
20 | } | |
21 | ], | |
22 | "Status": "active", | |
23 | "StatusMessage": "pending" | |
24 | } |
0 | **To import a snapshot** | |
1 | ||
2 | The following ``import-snapshot`` example imports the specified disk as a snapshot. :: | |
3 | ||
4 | aws ec2 import-snapshot \ | |
5 | --description "My server VMDK" \ | |
6 | --disk-container Format=VMDK,UserBucket={S3Bucket=my-import-bucket,S3Key=vms/my-server-vm.vmdk} | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Description": "My server VMDK", | |
12 | "ImportTaskId": "import-snap-1234567890abcdef0", | |
13 | "SnapshotTaskDetail": { | |
14 | "Description": "My server VMDK", | |
15 | "DiskImageSize": "0.0", | |
16 | "Format": "VMDK", | |
17 | "Progress": "3", | |
18 | "Status": "active", | |
19 | "StatusMessage": "pending" | |
20 | "UserBucket": { | |
21 | "S3Bucket": "my-import-bucket", | |
22 | "S3Key": "vms/my-server-vm.vmdk" | |
23 | } | |
24 | } | |
25 | } |
0 | **Example 1: To change the number of instances reserved by an existing capacity reservation** | |
1 | ||
2 | The following ``modify-capacity-reservation`` example changes the number of instances for which the capacity reservation reserves capacity. :: | |
3 | ||
4 | aws ec2 modify-capacity-reservation \ | |
5 | --capacity-reservation-id cr-1234abcd56EXAMPLE \ | |
6 | --instance-count 5 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Return": true | |
12 | } | |
13 | ||
14 | **Example 2: To change the end date and time for an existing capacity reservation** | |
15 | ||
16 | The following ``modify-capacity-reservation`` example modifies an existing capacity reservation to end at the specified date and time. :: | |
17 | ||
18 | aws ec2 modify-capacity-reservation \ | |
19 | --capacity-reservation-id cr-1234abcd56EXAMPLE \ | |
20 | --end-date-type limited \ | |
21 | --end-date 2019-08-31T23:59:59Z | |
22 | ||
23 | For more information, see `Modifying a Capacity Reservation <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-modify>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. |
0 | **To describe Dedicated hosts in your account and generate a machine-readable list** | |
0 | **Example 1: To enable auto-placement for a Dedicated Host** | |
1 | 1 | |
2 | To output a list of Dedicated host IDs in JSON (comma separated). | |
2 | The following ``modify-hosts`` example enables auto-placement for a Dedicated Host so that it accepts any untargeted instance launches that match its instance type configuration. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 describe-hosts --query 'Hosts[].HostId' --output json | |
4 | aws ec2 modify-hosts \ | |
5 | --host-id h-06c2f189b4EXAMPLE \ | |
6 | --auto-placement on | |
7 | 7 | |
8 | 8 | Output:: |
9 | 9 | |
10 | [ | |
11 | "h-085664df5899941c", | |
12 | "h-056c1b0724170dc38" | |
13 | ] | |
10 | { | |
11 | "Successful": [ | |
12 | "h-06c2f189b4EXAMPLE" | |
13 | ], | |
14 | "Unsuccessful": [] | |
15 | } | |
14 | 16 | |
15 | To output a list of Dedicated host IDs in plaintext (comma separated). | |
17 | **Example 2: To enable host recovery for a Dedicated Host** | |
16 | 18 | |
17 | Command:: | |
19 | The following ``modify-hosts`` example enables host recovery for the specified Dedicated Host. :: | |
18 | 20 | |
19 | aws ec2 describe-hosts --query 'Hosts[].HostId' --output text | |
20 | ||
21 | Output:: | |
22 | h-085664df5899941c | |
23 | h-056c1b0724170dc38 | |
24 | ||
25 | **To describe available Dedicated hosts in your account** | |
26 | ||
27 | Command:: | |
28 | ||
29 | aws ec2 describe-hosts --filter "Name=state,Values=available" | |
21 | aws ec2 modify-hosts \ | |
22 | --host-id h-06c2f189b4EXAMPLE \ | |
23 | --host-recovery on | |
30 | 24 | |
31 | 25 | Output:: |
32 | 26 | |
33 | { | |
34 | "Hosts": [ | |
35 | { | |
36 | "HostId": "h-085664df5899941c" | |
37 | "HostProperties: { | |
38 | "Cores": 20, | |
39 | "Sockets": 2, | |
40 | "InstanceType": "m3.medium". | |
41 | "TotalVCpus": 32 | |
42 | }, | |
43 | "Instances": [], | |
44 | "State": "available", | |
45 | "AvailabilityZone": "us-east-1b", | |
46 | "AvailableCapacity": { | |
47 | "AvailableInstanceCapacity": [ | |
48 | { | |
49 | "AvailableCapacity": 32, | |
50 | "InstanceType": "m3.medium", | |
51 | "TotalCapacity": 32 | |
52 | } | |
53 | ], | |
54 | "AvailableVCpus": 32 | |
55 | }, | |
56 | "AutoPlacement": "off" | |
57 | } | |
58 | ] | |
59 | } | |
60 | ||
27 | { | |
28 | "Successful": [ | |
29 | "h-06c2f189b4EXAMPLE" | |
30 | ], | |
31 | "Unsuccessful": [] | |
32 | } | |
33 | ||
34 | For more information, see `Modifying Dedicated Host Auto-Placement <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#modify-host-auto-placement>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. |
0 | 0 | **To enable the longer ID format for a resource** |
1 | 1 | |
2 | This example enables the longer ID format for the ``instance`` resource type. If the request is successful, no output is returned. | |
2 | The following ``modify-id-format`` example enables the longer ID format for the ``instance`` resource type. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 modify-id-format --resource instance --use-long-ids | |
4 | aws ec2 modify-id-format \ | |
5 | --resource instance \ | |
6 | --use-long-ids | |
7 | 7 | |
8 | 8 | **To disable the longer ID format for a resource** |
9 | 9 | |
10 | This example disables the longer ID format for the ``instance`` resource type. If the request is successful, no output is returned. | |
10 | The following ``modify-id-format`` example disables the longer ID format for the ``instance`` resource type. :: | |
11 | 11 | |
12 | Command:: | |
12 | aws ec2 modify-id-format \ | |
13 | --resource instance \ | |
14 | --no-use-long-ids | |
13 | 15 | |
14 | aws ec2 modify-id-format --resource instance --no-use-long-ids | |
16 | The following ``modify-id-format`` example enables the longer ID format for all supported resource types that are within their opt-in period. :: | |
15 | 17 | |
16 | This example enables the longer ID format for all supported resource types that are within their opt-in period. If the request is successful, no output is returned. | |
17 | ||
18 | Command:: | |
19 | ||
20 | aws ec2 modify-id-format --resource all-current --use-long-ids | |
18 | aws ec2 modify-id-format \ | |
19 | --resource all-current \ | |
20 | --use-long-ids |
0 | 0 | **To enable an IAM role to use longer IDs for a resource** |
1 | 1 | |
2 | This example enables the IAM role ``EC2Role`` in your AWS account to use the longer ID format for the ``instance`` resource type. If the request is successful, no output is returned. | |
2 | The following ``modify-identity-id-format`` example enables the IAM role ``EC2Role`` in your AWS account to use long ID format for the ``instance`` resource type. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 modify-identity-id-format --principal-arn arn:aws:iam::123456789012:role/EC2Role --resource instance --use-long-ids | |
4 | aws ec2 modify-identity-id-format \ | |
5 | --principal-arn arn:aws:iam::123456789012:role/EC2Role \ | |
6 | --resource instance \ | |
7 | --use-long-ids | |
7 | 8 | |
8 | 9 | **To enable an IAM user to use longer IDs for a resource** |
9 | 10 | |
10 | This example enables the IAM user ``AdminUser`` in your AWS account to use the longer ID format for the ``volume`` resource type. If the request is successful, no output is returned. | |
11 | The following ``modify-identity-id-format`` example enables the IAM user ``AdminUser`` in your AWS account to use the longer ID format for the ``volume`` resource type. :: | |
11 | 12 | |
12 | Command:: | |
13 | aws ec2 modify-identity-id-format \ | |
14 | --principal-arn arn:aws:iam::123456789012:user/AdminUser \ | |
15 | --resource volume \ | |
16 | --use-long-ids | |
13 | 17 | |
14 | aws ec2 modify-identity-id-format --principal-arn arn:aws:iam::123456789012:user/AdminUser --resource volume --use-long-ids | |
18 | The following ``modify-identity-id-format`` example enables the IAM user ``AdminUser`` in your AWS account to use the longer ID format for all supported resource types that are within their opt-in period. :: | |
15 | 19 | |
16 | This example enables the IAM user ``AdminUser`` in your AWS account to use the longer ID format for all supported resource types that are within their opt-in period. If the request is successful, no output is returned. | |
17 | ||
18 | Command:: | |
19 | ||
20 | aws ec2 modify-identity-id-format --principal-arn arn:aws:iam::123456789012:user/AdminUser --resource all-current --use-long-ids | |
20 | aws ec2 modify-identity-id-format \ | |
21 | --principal-arn arn:aws:iam::123456789012:user/AdminUser \ | |
22 | --resource all-current \ | |
23 | --use-long-ids |
0 | 0 | **Example 1: To modify the instance type** |
1 | 1 | |
2 | This example modifies the instance type of the specified instance. The instance must be in the ``stopped`` state. If the command succeeds, no output is returned. | |
2 | The following ``modify-instance-attribute`` example modifies the instance type of the specified instance. The instance must be in the ``stopped`` state. :: | |
3 | ||
4 | aws ec2 modify-instance-attribute \ | |
5 | --instance-id i-1234567890abcdef0 \ | |
6 | --instance-type "{\"Value\": \"m1.small\"}" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | **Example 2: To enable enhanced networking on an instance** | |
11 | ||
12 | The following ``modify-instance-attribute`` example enables enhanced networking for the specified instance. The instance must be in the ``stopped`` state. :: | |
13 | ||
14 | aws ec2 modify-instance-attribute \ | |
15 | --instance-id i-1234567890abcdef0 \ | |
16 | --sriov-net-support simple | |
17 | ||
18 | This command produces no output. | |
19 | ||
20 | **Example 3: To modify the sourceDestCheck attribute** | |
21 | ||
22 | The following ``modify-instance-attribute`` example sets the ``sourceDestCheck`` attribute of the specified instance to ``true``. The instance must be in a VPC. :: | |
23 | ||
24 | aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --source-dest-check "{\"Value\": true}" | |
25 | ||
26 | This command produces no output. | |
27 | ||
28 | **Example 4: To modify the deleteOnTermination attribute of the root volume** | |
29 | ||
30 | The following ``modify-instance-attribute`` example sets the ``deleteOnTermination`` attribute for the root volume of the specified Amazon EBS-backed instance to ``false``. By default, this attribute is ``true`` for the root volume. | |
3 | 31 | |
4 | 32 | Command:: |
5 | 33 | |
6 | aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --instance-type "{\"Value\": \"m1.small\"}" | |
34 | aws ec2 modify-instance-attribute \ | |
35 | --instance-id i-1234567890abcdef0 \ | |
36 | --block-device-mappings "[{\"DeviceName\": \"/dev/sda1\",\"Ebs\":{\"DeleteOnTermination\":false}}]" | |
7 | 37 | |
8 | **Example 2: To enable enhanced networking on an instance** | |
9 | ||
10 | This example enables enhanced networking for the specified instance. The instance must be in the ``stopped`` state. If the command succeeds, no output is returned. | |
11 | ||
12 | Command:: | |
13 | ||
14 | aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --sriov-net-support simple | |
15 | ||
16 | **Example 3: To modify the sourceDestCheck attribute** | |
17 | ||
18 | This example sets the ``sourceDestCheck`` attribute of the specified instance to ``true``. The instance must be in a VPC. If the command succeeds, no output is returned. | |
19 | ||
20 | Command:: | |
21 | ||
22 | aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --source-dest-check "{\"Value\": true}" | |
23 | ||
24 | **Example 4: To modify the deleteOnTermination attribute of the root volume** | |
25 | ||
26 | This example sets the ``deleteOnTermination`` attribute for the root volume of the specified Amazon EBS-backed instance to ``false``. By default, this attribute is ``true`` for the root volume. If the command succeeds, no output is returned. | |
27 | ||
28 | Command:: | |
29 | ||
30 | aws ec2 modify-instance-attribute --instance-id i-1234567890abcdef0 --block-device-mappings "[{\"DeviceName\": \"/dev/sda1\",\"Ebs\":{\"DeleteOnTermination\":false}}]" | |
38 | This command produces no output. | |
31 | 39 | |
32 | 40 | **Example 5: To modify the user data attached to an instance** |
33 | 41 | |
34 | The following ``modify-instance-attribute`` example adds the contents of the file ``UserData.txt`` as the UserData for the specified instance. The contents of the file must be base64 encoded. The first command converts the text file to base64 and saves it as a new file. That file is then referenced in the CLI command that follows. | |
42 | The following ``modify-instance-attribute`` example adds the contents of the file ``UserData.txt`` as the UserData for the specified instance. | |
35 | 43 | |
36 | Command:: | |
37 | ||
38 | base64 UserData.txt > UserData.base64.txt | |
39 | ||
40 | aws ec2 modify-image-attribute \ | |
41 | --instance-id=i-09b5a14dbca622e76 \ | |
42 | --attribute userData --value file://UserData.base64.txt" | |
43 | ||
44 | Contents of ``UserData.txt``:: | |
44 | Contents of original file ``UserData.txt``:: | |
45 | 45 | |
46 | 46 | #!/bin/bash |
47 | 47 | yum update -y |
48 | 48 | service httpd start |
49 | 49 | chkconfig httpd on |
50 | 50 | |
51 | The contents of the file must be base64 encoded. The first command converts the text file to base64 and saves it as a new file. | |
52 | ||
53 | Linux/macOS version of the command:: | |
54 | ||
55 | base64 UserData.txt > UserData.base64.txt | |
56 | ||
57 | This command produces no output. | |
58 | ||
59 | Windows version of the command:: | |
60 | ||
61 | certutil -encode UserData.txt tmp.b64 && findstr /v /c:- tmp.b64 > UserData.base64.txt | |
62 | ||
63 | Output:: | |
64 | ||
65 | Input Length = 67 | |
66 | Output Length = 152 | |
67 | CertUtil: -encode command completed successfully. | |
68 | ||
69 | Now you can reference that file in the CLI command that follows:: | |
70 | ||
71 | aws ec2 modify-instance-attribute \ | |
72 | --instance-id=i-09b5a14dbca622e76 \ | |
73 | --attribute userData --value file://UserData.base64.txt | |
74 | ||
51 | 75 | This command produces no output. |
52 | 76 | |
53 | 77 | For more information, see `User Data and the AWS CLI <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-api-cli>`__ in the *EC2 User Guide*. |
0 | **Example 1: To modify an instance's capacity reservation targeting settings** | |
1 | ||
2 | The following ``modify-instance-capacity-reservation-attributes`` example modifies a stopped instance to target a specific capacity reservation. :: | |
3 | ||
4 | aws ec2 modify-instance-capacity-reservation-attributes \ | |
5 | --instance-id i-EXAMPLE8765abcd4e \ | |
6 | --capacity-reservation-specification 'CapacityReservationTarget={CapacityReservationId= cr-1234abcd56EXAMPLE }' | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Return": true | |
12 | } | |
13 | ||
14 | **Example 2: To modify an instance's capacity reservation targeting settings** | |
15 | ||
16 | The following ``modify-instance-capacity-reservation-attributes`` example modifies a stopped instance that targets the specified capacity reservation to launch in any capacity reservation that has matching attributes (instance type, platform, Availability Zone) and that has open instance matching criteria. :: | |
17 | ||
18 | aws ec2 modify-instance-capacity-reservation-attributes \ | |
19 | --instance-id i-EXAMPLE8765abcd4e \ | |
20 | --capacity-reservation-specification 'CapacityReservationPreference=open' | |
21 | ||
22 | Output:: | |
23 | ||
24 | { | |
25 | "Return": true | |
26 | } | |
27 | ||
28 | For more information, see `Modifying an Instance's Capacity Reservation Settings <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-modify-instance>`__ in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*. |
0 | **To set the instance affinity value for a specific stopped Dedicated Host** | |
0 | **Example 1: To remove an instance's affinity with a Dedicated Host** | |
1 | 1 | |
2 | To modify the affinity of an instance so it always has affinity with the specified Dedicated Host . | |
2 | The following ``modify-instance-placement`` example removes an instance's affinity with a Dedicated Host and enables it to launch on any available Dedicated Host in your account that supports its instance type. :: | |
3 | 3 | |
4 | Command:: | |
5 | ||
6 | aws ec2 modify-instance-placement --instance-id=i-1234567890abcdef0 --host-id h-029e7409a3350a31f | |
4 | aws ec2 modify-instance-placement \ | |
5 | --instance-id i-0e6ddf6187EXAMPLE \ | |
6 | --affinity default | |
7 | 7 | |
8 | 8 | Output:: |
9 | 9 | |
10 | { | |
11 | "Return": true | |
12 | } | |
10 | { | |
11 | "Return": true | |
12 | } | |
13 | ||
14 | **Example 2: To establish affinity between an instance and the specified Dedicated Host** | |
15 | ||
16 | The following ``modify-instance-placement`` example establishes a launch relationship between an instance and a Dedicated Host. The instance is only able to run on the specified Dedicated Host. :: | |
17 | ||
18 | aws ec2 modify-instance-placement \ | |
19 | --instance-id i-0e6ddf6187EXAMPLE \ | |
20 | --affinity host \ | |
21 | --host-id i-0e6ddf6187EXAMPLE | |
22 | ||
23 | Output:: | |
24 | ||
25 | { | |
26 | "Return": true | |
27 | } | |
28 | ||
29 | 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*. | |
30 | ||
31 | **Example 3: To move an instance to a placement group** | |
32 | ||
33 | To move an instance to a placement group, stop the instance, modify the instance placement, and then restart the instance. :: | |
34 | ||
35 | aws ec2 stop-instances \ | |
36 | --instance-ids i-0123a456700123456 | |
37 | ||
38 | aws ec2 modify-instance-placement \ | |
39 | --instance-id i-0123a456700123456 \ | |
40 | --group-name MySpreadGroup | |
41 | ||
42 | aws ec2 start-instances \ | |
43 | --instance-ids i-0123a456700123456 | |
44 | ||
45 | For more information, see `Changing the Placement Group for an Instance <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#change-instance-placement-group>`__ in the *Amazon Elastic Compute Cloud Users Guide*. | |
46 | ||
47 | **Example 4: To remove an instance from a placement group** | |
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. | |
50 | ||
51 | aws ec2 stop-instances \ | |
52 | --instance-ids i-0123a456700123456 | |
53 | ||
54 | aws ec2 modify-instance-placement \ | |
55 | --instance-id i-0123a456700123456 \ | |
56 | --group-name " " | |
57 | ||
58 | aws ec2 start-instances \ | |
59 | --instance-ids i-0123a456700123456 | |
60 | ||
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*. |
0 | **To add network services to a Traffic Mirror filter** | |
1 | ||
2 | The following ``modify-traffic-mirror-filter-network-services`` example adds the Amazon DNS network services to the specified filter. :: | |
3 | ||
4 | aws ec2 modify-traffic-mirror-filter-network-services \ | |
5 | --traffic-mirror-filter-id tmf-04812ff784EXAMPLE \ | |
6 | --add-network-service amazon-dns | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "TrafficMirrorFilter": { | |
12 | "Tags": [ | |
13 | { | |
14 | "Key": "Name", | |
15 | "Value": "Production" | |
16 | } | |
17 | ], | |
18 | "EgressFilterRules": [], | |
19 | "NetworkServices": [ | |
20 | "amazon-dns" | |
21 | ], | |
22 | "TrafficMirrorFilterId": "tmf-04812ff784EXAMPLE", | |
23 | "IngressFilterRules": [ | |
24 | { | |
25 | "SourceCidrBlock": "0.0.0.0/0", | |
26 | "RuleNumber": 1, | |
27 | "DestinationCidrBlock": "0.0.0.0/0", | |
28 | "Description": "TCP Rule", | |
29 | "Protocol": 6, | |
30 | "TrafficDirection": "ingress", | |
31 | "TrafficMirrorFilterId": "tmf-04812ff784EXAMPLE", | |
32 | "RuleAction": "accept", | |
33 | "TrafficMirrorFilterRuleId": "tmf-04812ff784EXAMPLE" | |
34 | } | |
35 | ] | |
36 | } | |
37 | } | |
38 | ||
39 | For more information, see `Modify Traffic Mirror Filter Network Services <https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-filter.html#modify-traffic-mirroring-filter-network-services>`__ in the *AWS Traffic Mirroring Guide*. |
0 | **To modify a traffic mirror filter rule** | |
1 | ||
2 | The following ``modify-traffic-mirror-filter-rule`` example modifies the description of the specified traffic mirror filter rule. :: | |
3 | ||
4 | aws ec2 modify-traffic-mirror-filter-rule \ | |
5 | --traffic-mirror-filter-rule-id tmfr-0ca76e0e08EXAMPLE \ | |
6 | --description "TCP Rule" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "TrafficMirrorFilterRule": { | |
12 | "TrafficMirrorFilterRuleId": "tmfr-0ca76e0e08EXAMPLE", | |
13 | "TrafficMirrorFilterId": "tmf-0293f26e86EXAMPLE", | |
14 | "TrafficDirection": "ingress", | |
15 | "RuleNumber": 100, | |
16 | "RuleAction": "accept", | |
17 | "Protocol": 6, | |
18 | "DestinationCidrBlock": "10.0.0.0/24", | |
19 | "SourceCidrBlock": "10.0.0.0/24", | |
20 | "Description": "TCP Rule" | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Modify Your Traffic Mirror Filter Rules <https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-filter.html#modify-traffic-mirroring-filter-rules>`__ in the *AWS Traffic Mirroring Guide*. |
0 | **To modify a VPN connection** | |
1 | ||
2 | The following ``modify-vpn-connection`` example changes the target gateway for VPN connection ``vpn-12345678901234567`` to virtual private gateway ``vgw-11223344556677889``:: | |
3 | ||
4 | aws ec2 modify-vpn-connection \ | |
5 | --vpn-connection-id vpn-12345678901234567 \ | |
6 | --vpn-gateway-id vgw-11223344556677889 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "VpnConnection": { | |
12 | "CustomerGatewayConfiguration": "...configuration information...", | |
13 | "CustomerGatewayId": "cgw-aabbccddee1122334", | |
14 | "Category": "VPN", | |
15 | "State": "modifying", | |
16 | "Type": "ipsec.1", | |
17 | "VpnConnectionId": "vpn-12345678901234567", | |
18 | "VpnGatewayId": "vgw-11223344556677889", | |
19 | "Options": { | |
20 | "StaticRoutesOnly": false | |
21 | }, | |
22 | "VgwTelemetry": [ | |
23 | { | |
24 | "AcceptedRouteCount": 0, | |
25 | "LastStatusChange": "2019-07-17T07:34:00.000Z", | |
26 | "OutsideIpAddress": "18.210.3.222", | |
27 | "Status": "DOWN", | |
28 | "StatusMessage": "IPSEC IS DOWN" | |
29 | }, | |
30 | { | |
31 | "AcceptedRouteCount": 0, | |
32 | "LastStatusChange": "2019-07-20T21:20:16.000Z", | |
33 | "OutsideIpAddress": "34.193.129.33", | |
34 | "Status": "DOWN", | |
35 | "StatusMessage": "IPSEC IS DOWN" | |
36 | } | |
37 | ] | |
38 | } | |
39 | } |
0 | **To rotate a VPN tunnel certificate** | |
1 | ||
2 | The following ``modify-vpn-tunnel-certificate`` example rotates the certificate for the specified tunnel for a VPN connection :: | |
3 | ||
4 | aws ec2 modify-vpn-tunnel-certificate \ | |
5 | --vpn-tunnel-outside-ip-address 203.0.113.17 \ | |
6 | --vpn-connection-id vpn-12345678901234567 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "VpnConnection": { | |
12 | "CustomerGatewayConfiguration": ...configuration information..., | |
13 | "CustomerGatewayId": "cgw-aabbccddee1122334", | |
14 | "Category": "VPN", | |
15 | "State": "modifying", | |
16 | "Type": "ipsec.1", | |
17 | "VpnConnectionId": "vpn-12345678901234567", | |
18 | "VpnGatewayId": "vgw-11223344556677889", | |
19 | "Options": { | |
20 | "StaticRoutesOnly": false | |
21 | }, | |
22 | "VgwTelemetry": [ | |
23 | { | |
24 | "AcceptedRouteCount": 0, | |
25 | "LastStatusChange": "2019-09-11T17:27:14.000Z", | |
26 | "OutsideIpAddress": "203.0.113.17", | |
27 | "Status": "DOWN", | |
28 | "StatusMessage": "IPSEC IS DOWN", | |
29 | "CertificateArn": "arn:aws:acm:us-east-1:123456789101:certificate/c544d8ce-20b8-4fff-98b0-example" | |
30 | }, | |
31 | { | |
32 | "AcceptedRouteCount": 0, | |
33 | "LastStatusChange": "2019-09-11T17:26:47.000Z", | |
34 | "OutsideIpAddress": "203.0.114.18", | |
35 | "Status": "DOWN", | |
36 | "StatusMessage": "IPSEC IS DOWN", | |
37 | "CertificateArn": "arn:aws:acm:us-east-1:123456789101:certificate/5ab64566-761b-4ad3-b259-example" | |
38 | } | |
39 | ] | |
40 | } | |
41 | } |
0 | **To modify the tunnel options for a VPN connection** | |
1 | ||
2 | The following ``modify-vpn-tunnel-options`` example updates the Diffie-Hellmann groups that are permitted for the specified tunnel and VPN connection. :: | |
3 | ||
4 | aws ec2 modify-vpn-tunnel-options \ | |
5 | --vpn-connection-id vpn-12345678901234567 \ | |
6 | --vpn-tunnel-outside-ip-address 203.0.113.17 \ | |
7 | --tunnel-options Phase1DHGroupNumbers=[{Value=14},{Value=15},{Value=16},{Value=17},{Value=18}],Phase2DHGroupNumbers=[{Value=14},{Value=15},{Value=16},{Value=17},{Value=18}] | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "VpnConnection": { | |
13 | "CustomerGatewayConfiguration": "...configuration information...", | |
14 | "CustomerGatewayId": "cgw-aabbccddee1122334", | |
15 | "Category": "VPN", | |
16 | "State": "available", | |
17 | "Type": "ipsec.1", | |
18 | "VpnConnectionId": "vpn-12345678901234567", | |
19 | "VpnGatewayId": "vgw-11223344556677889", | |
20 | "Options": { | |
21 | "StaticRoutesOnly": false, | |
22 | "TunnelOptions": [ | |
23 | { | |
24 | "OutsideIpAddress": "203.0.113.17", | |
25 | "Phase1DHGroupNumbers": [ | |
26 | { | |
27 | "Value": 14 | |
28 | }, | |
29 | { | |
30 | "Value": 15 | |
31 | }, | |
32 | { | |
33 | "Value": 16 | |
34 | }, | |
35 | { | |
36 | "Value": 17 | |
37 | }, | |
38 | { | |
39 | "Value": 18 | |
40 | } | |
41 | ], | |
42 | "Phase2DHGroupNumbers": [ | |
43 | { | |
44 | "Value": 14 | |
45 | }, | |
46 | { | |
47 | "Value": 15 | |
48 | }, | |
49 | { | |
50 | "Value": 16 | |
51 | }, | |
52 | { | |
53 | "Value": 17 | |
54 | }, | |
55 | { | |
56 | "Value": 18 | |
57 | } | |
58 | ] | |
59 | }, | |
60 | { | |
61 | "OutsideIpAddress": "203.0.114.19" | |
62 | } | |
63 | ] | |
64 | }, | |
65 | "VgwTelemetry": [ | |
66 | { | |
67 | "AcceptedRouteCount": 0, | |
68 | "LastStatusChange": "2019-09-10T21:56:54.000Z", | |
69 | "OutsideIpAddress": "203.0.113.17", | |
70 | "Status": "DOWN", | |
71 | "StatusMessage": "IPSEC IS DOWN" | |
72 | }, | |
73 | { | |
74 | "AcceptedRouteCount": 0, | |
75 | "LastStatusChange": "2019-09-10T21:56:43.000Z", | |
76 | "OutsideIpAddress": "203.0.114.19", | |
77 | "Status": "DOWN", | |
78 | "StatusMessage": "IPSEC IS DOWN" | |
79 | } | |
80 | ] | |
81 | } | |
82 | } |
0 | **To provision an address range** | |
1 | ||
2 | The following ``provision-byoip-cidr`` example provisions a public IP address range for use with AWS. :: | |
3 | ||
4 | aws ec2 provision-byoip-cidr \ | |
5 | --cidr 203.0.113.25/24 \ | |
6 | --cidr-authorization-context Message="$text_message",Signature="$signed_message" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "ByoipCidr": { | |
12 | "Cidr": "203.0.113.25/24", | |
13 | "State": "pending-provision" | |
14 | } | |
15 | } | |
16 | ||
17 | For more information about creating the messages strings for the authorization context, see `Bring Your Own IP Addresses <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html>`__ in the *Amazon EC2 User Guide*. |
0 | **To reject a Transit Gateway VPC attachment** | |
1 | ||
2 | The following ``reject-transit-gateway-vpc-attachment`` example rejects the specified transit gateway VPC attachment. :: | |
3 | ||
4 | aws ec2 reject-transit-gateway-vpc-attachment \ | |
5 | --transit-gateway-attachment-id tgw-attach-0a34fe6b4fEXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "TransitGatewayVpcAttachment": { | |
11 | "TransitGatewayAttachmentId": "tgw-attach-0a34fe6b4fEXAMPLE", | |
12 | "TransitGatewayId": "tgw-0262a0e521EXAMPLE", | |
13 | "VpcId": "vpc-07e8ffd50fEXAMPLE", | |
14 | "VpcOwnerId": "123456789012", | |
15 | "State": "pending", | |
16 | "SubnetIds": [ | |
17 | "subnet-0752213d59EXAMPLE" | |
18 | ], | |
19 | "CreationTime": "2019-07-10T17:33:46.000Z", | |
20 | "Options": { | |
21 | "DnsSupport": "enable", | |
22 | "Ipv6Support": "disable" | |
23 | } | |
24 | } | |
25 | } | |
26 | ||
27 | For more information, see `Transit Gateway Attachments to a VPC <https://docs.aws.amazon.com/vpc/latest/tgw/tgw-vpc-attachments.html>`__ in the *AWS Transit Gateways*. |
0 | **To replace an IAM instance profile for an instance** | |
1 | ||
2 | This example replaces the IAM instance profile represented by the association ``iip-assoc-060bae234aac2e7fa`` with the IAM instance profile named ``AdminRole``. :: | |
3 | ||
4 | aws ec2 replace-iam-instance-profile-association \ | |
5 | --iam-instance-profile Name=AdminRole \ | |
6 | --association-id iip-assoc-060bae234aac2e7fa | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "IamInstanceProfileAssociation": { | |
12 | "InstanceId": "i-087711ddaf98f9489", | |
13 | "State": "associating", | |
14 | "AssociationId": "iip-assoc-0b215292fab192820", | |
15 | "IamInstanceProfile": { | |
16 | "Id": "AIPAJLNLDX3AMYZNWYYAY", | |
17 | "Arn": "arn:aws:iam::123456789012:instance-profile/AdminRole" | |
18 | } | |
19 | } | |
20 | } |
0 | **To replace an IAM instance profile for an instance** | |
1 | ||
2 | This example replaces the IAM instance profile represented by the association ``iip-assoc-060bae234aac2e7fa`` with the IAM instance profile named ``AdminRole``. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws ec2 replace-iam-instance-profile-association --iam-instance-profile Name=AdminRole --association-id iip-assoc-060bae234aac2e7fa | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "IamInstanceProfileAssociation": { | |
12 | "InstanceId": "i-087711ddaf98f9489", | |
13 | "State": "associating", | |
14 | "AssociationId": "iip-assoc-0b215292fab192820", | |
15 | "IamInstanceProfile": { | |
16 | "Id": "AIPAJLNLDX3AMYZNWYYAY", | |
17 | "Arn": "arn:aws:iam::123456789012:instance-profile/AdminRole" | |
18 | } | |
19 | } | |
20 | }⏎ |
0 | **To launch an instance in EC2-Classic** | |
1 | ||
2 | This example launches a single instance of type ``c3.large``. | |
3 | ||
4 | The key pair and security group, named ``MyKeyPair`` and ``MySecurityGroup``, must exist. | |
5 | ||
6 | Command:: | |
7 | ||
8 | aws ec2 run-instances --image-id ami-1a2b3c4d --count 1 --instance-type c3.large --key-name MyKeyPair --security-groups MySecurityGroup | |
0 | **Example 1: To launch an instance in EC2-Classic** | |
1 | ||
2 | The following ``run-instances`` example launches a single instance of type ``c3.large``. The key pair and security group must already exist. :: | |
3 | ||
4 | aws ec2 run-instances \ | |
5 | --image-id ami-1a2b3c4d \ | |
6 | --count 1 \ | |
7 | --instance-type c3.large \ | |
8 | --key-name MyKeyPair \ | |
9 | --security-groups MySecurityGroup | |
9 | 10 | |
10 | 11 | Output:: |
11 | 12 | |
12 | { | |
13 | "OwnerId": "123456789012", | |
14 | "ReservationId": "r-08626e73c547023b1", | |
15 | "Groups": [ | |
16 | { | |
17 | "GroupName": "MySecurityGroup", | |
18 | "GroupId": "sg-903004f8" | |
19 | } | |
20 | ], | |
21 | "Instances": [ | |
22 | { | |
23 | "Monitoring": { | |
24 | "State": "disabled" | |
25 | }, | |
26 | "PublicDnsName": null, | |
27 | "RootDeviceType": "ebs", | |
28 | "State": { | |
29 | "Code": 0, | |
30 | "Name": "pending" | |
31 | }, | |
32 | "EbsOptimized": false, | |
33 | "LaunchTime": "2018-05-10T08:03:30.000Z", | |
34 | "ProductCodes": [], | |
35 | "CpuOptions": { | |
36 | "CoreCount": 1, | |
37 | "ThreadsPerCore": 2 | |
38 | }, | |
39 | "StateTransitionReason": null, | |
40 | "InstanceId": "i-1234567890abcdef0", | |
41 | "ImageId": "ami-1a2b3c4d", | |
42 | "PrivateDnsName": null, | |
43 | "KeyName": "MyKeyPair", | |
44 | "SecurityGroups": [ | |
45 | { | |
46 | "GroupName": "MySecurityGroup", | |
47 | "GroupId": "sg-903004f8" | |
48 | } | |
49 | ], | |
50 | "ClientToken": null, | |
51 | "InstanceType": "c3.large", | |
52 | "NetworkInterfaces": [], | |
53 | "Placement": { | |
54 | "Tenancy": "default", | |
55 | "GroupName": null, | |
56 | "AvailabilityZone": "us-east-1b" | |
57 | }, | |
58 | "Hypervisor": "xen", | |
59 | "BlockDeviceMappings": [], | |
60 | "Architecture": "x86_64", | |
61 | "StateReason": { | |
62 | "Message": "pending", | |
63 | "Code": "pending" | |
64 | }, | |
65 | "RootDeviceName": "/dev/sda1", | |
66 | "VirtualizationType": "hvm", | |
67 | "AmiLaunchIndex": 0 | |
68 | } | |
69 | ] | |
70 | } | |
71 | ||
72 | **To launch an instance in EC2-VPC** | |
73 | ||
74 | This example launches a single instance of type ``t2.micro`` into the specified subnet. | |
75 | ||
76 | The key pair named ``MyKeyPair`` and the security group sg-1a2b3c4d must exist. | |
77 | ||
78 | Command:: | |
79 | ||
80 | aws ec2 run-instances --image-id ami-abc12345 --count 1 --instance-type t2.micro --key-name MyKeyPair --security-group-ids sg-1a2b3c4d --subnet-id subnet-6e7f829e | |
13 | { | |
14 | "OwnerId": "123456789012", | |
15 | "ReservationId": "r-08626e73c547023b1", | |
16 | "Groups": [ | |
17 | { | |
18 | "GroupName": "MySecurityGroup", | |
19 | "GroupId": "sg-903004f8" | |
20 | } | |
21 | ], | |
22 | "Instances": [ | |
23 | { | |
24 | "Monitoring": { | |
25 | "State": "disabled" | |
26 | }, | |
27 | "PublicDnsName": null, | |
28 | "RootDeviceType": "ebs", | |
29 | "State": { | |
30 | "Code": 0, | |
31 | "Name": "pending" | |
32 | }, | |
33 | "EbsOptimized": false, | |
34 | "LaunchTime": "2018-05-10T08:03:30.000Z", | |
35 | "ProductCodes": [], | |
36 | "CpuOptions": { | |
37 | "CoreCount": 1, | |
38 | "ThreadsPerCore": 2 | |
39 | }, | |
40 | "StateTransitionReason": null, | |
41 | "InstanceId": "i-1234567890abcdef0", | |
42 | "ImageId": "ami-1a2b3c4d", | |
43 | "PrivateDnsName": null, | |
44 | "KeyName": "MyKeyPair", | |
45 | "SecurityGroups": [ | |
46 | { | |
47 | "GroupName": "MySecurityGroup", | |
48 | "GroupId": "sg-903004f8" | |
49 | } | |
50 | ], | |
51 | "ClientToken": null, | |
52 | "InstanceType": "c3.large", | |
53 | "NetworkInterfaces": [], | |
54 | "Placement": { | |
55 | "Tenancy": "default", | |
56 | "GroupName": null, | |
57 | "AvailabilityZone": "us-east-1b" | |
58 | }, | |
59 | "Hypervisor": "xen", | |
60 | "BlockDeviceMappings": [], | |
61 | "Architecture": "x86_64", | |
62 | "StateReason": { | |
63 | "Message": "pending", | |
64 | "Code": "pending" | |
65 | }, | |
66 | "RootDeviceName": "/dev/sda1", | |
67 | "VirtualizationType": "hvm", | |
68 | "AmiLaunchIndex": 0 | |
69 | } | |
70 | ] | |
71 | } | |
72 | ||
73 | **Example 2: To launch an instance in EC2-VPC** | |
74 | ||
75 | The following ``run-instances`` example launches a single instance of type ``t2.micro`` into the specified subnet. The key pair and the security group must already exist. :: | |
76 | ||
77 | aws ec2 run-instances \ | |
78 | --image-id ami-abc12345 \ | |
79 | --count 1 \ | |
80 | --instance-type t2.micro \ | |
81 | --key-name MyKeyPair \ | |
82 | --security-group-ids sg-1a2b3c4d \ | |
83 | --subnet-id subnet-6e7f829e | |
81 | 84 | |
82 | 85 | Output:: |
83 | 86 | |
84 | { | |
85 | "Instances": [ | |
87 | { | |
88 | "Instances": [ | |
89 | { | |
90 | "Monitoring": { | |
91 | "State": "disabled" | |
92 | }, | |
93 | "PublicDnsName": "", | |
94 | "StateReason": { | |
95 | "Message": "pending", | |
96 | "Code": "pending" | |
97 | }, | |
98 | "State": { | |
99 | "Code": 0, | |
100 | "Name": "pending" | |
101 | }, | |
102 | "EbsOptimized": false, | |
103 | "LaunchTime": "2018-05-10T08:05:20.000Z", | |
104 | "PrivateIpAddress": "10.0.0.157", | |
105 | "ProductCodes": [], | |
106 | "VpcId": "vpc-11223344", | |
107 | "CpuOptions": { | |
108 | "CoreCount": 1, | |
109 | "ThreadsPerCore": 1 | |
110 | }, | |
111 | "StateTransitionReason": "", | |
112 | "InstanceId": "i-1231231230abcdef0", | |
113 | "ImageId": "ami-abc12345", | |
114 | "PrivateDnsName": "ip-10-0-0-157.ec2.internal", | |
115 | "SecurityGroups": [ | |
116 | { | |
117 | "GroupName": "MySecurityGroup", | |
118 | "GroupId": "sg-1a2b3c4d" | |
119 | } | |
120 | ], | |
121 | "ClientToken": "", | |
122 | "SubnetId": "subnet-6e7f829e", | |
123 | "InstanceType": "t2.micro", | |
124 | "NetworkInterfaces": [ | |
125 | { | |
126 | "Status": "in-use", | |
127 | "MacAddress": "0a:ab:58:e0:67:e2", | |
128 | "SourceDestCheck": true, | |
129 | "VpcId": "vpc-11223344", | |
130 | "Description": "", | |
131 | "NetworkInterfaceId": "eni-95c6390b", | |
132 | "PrivateIpAddresses": [ | |
133 | { | |
134 | "PrivateDnsName": "ip-10-0-0-157.ec2.internal", | |
135 | "Primary": true, | |
136 | "PrivateIpAddress": "10.0.0.157" | |
137 | } | |
138 | ], | |
139 | "PrivateDnsName": "ip-10-0-0-157.ec2.internal", | |
140 | "Attachment": { | |
141 | "Status": "attaching", | |
142 | "DeviceIndex": 0, | |
143 | "DeleteOnTermination": true, | |
144 | "AttachmentId": "eni-attach-bf87ca1f", | |
145 | "AttachTime": "2018-05-10T08:05:20.000Z" | |
146 | }, | |
147 | "Groups": [ | |
148 | { | |
149 | "GroupName": "MySecurityGroup", | |
150 | "GroupId": "sg-1a2b3c4d" | |
151 | } | |
152 | ], | |
153 | "Ipv6Addresses": [], | |
154 | "OwnerId": "123456789012", | |
155 | "SubnetId": "subnet-6e7f829e", | |
156 | "PrivateIpAddress": "10.0.0.157" | |
157 | } | |
158 | ], | |
159 | "SourceDestCheck": true, | |
160 | "Placement": { | |
161 | "Tenancy": "default", | |
162 | "GroupName": "", | |
163 | "AvailabilityZone": "us-east-1a" | |
164 | }, | |
165 | "Hypervisor": "xen", | |
166 | "BlockDeviceMappings": [], | |
167 | "Architecture": "x86_64", | |
168 | "RootDeviceType": "ebs", | |
169 | "RootDeviceName": "/dev/xvda", | |
170 | "VirtualizationType": "hvm", | |
171 | "AmiLaunchIndex": 0 | |
172 | } | |
173 | ], | |
174 | "ReservationId": "r-02a3f596d91211712", | |
175 | "Groups": [], | |
176 | "OwnerId": "123456789012" | |
177 | } | |
178 | ||
179 | **Example 3: To launch an instance into a non-default subnet and add a public IP address** | |
180 | ||
181 | The following ``run-instances`` example requests a public IP address for an instance that you're launching into a nondefault subnet. :: | |
182 | ||
183 | aws ec2 run-instances \ | |
184 | --image-id ami-c3b8d6aa \ | |
185 | --count 1 \ | |
186 | --instance-type t2.medium \ | |
187 | --key-name MyKeyPair \ | |
188 | --security-group-ids sg-903004f8 \ | |
189 | --subnet-id subnet-6e7f829e \ | |
190 | --associate-public-ip-address | |
191 | ||
192 | **Example 4: To launch an instance using a block device mapping** | |
193 | ||
194 | Add the following parameter to your ``run-instances`` command to specify a file that defines block devices to attach to the new instance:: | |
195 | ||
196 | --block-device-mappings file://mapping.json | |
197 | ||
198 | To add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100, specify the following in mapping.json:: | |
199 | ||
200 | [ | |
86 | 201 | { |
87 | "Monitoring": { | |
88 | "State": "disabled" | |
89 | }, | |
90 | "PublicDnsName": "", | |
91 | "StateReason": { | |
92 | "Message": "pending", | |
93 | "Code": "pending" | |
94 | }, | |
95 | "State": { | |
96 | "Code": 0, | |
97 | "Name": "pending" | |
98 | }, | |
99 | "EbsOptimized": false, | |
100 | "LaunchTime": "2018-05-10T08:05:20.000Z", | |
101 | "PrivateIpAddress": "10.0.0.157", | |
102 | "ProductCodes": [], | |
103 | "VpcId": "vpc-11223344", | |
104 | "CpuOptions": { | |
105 | "CoreCount": 1, | |
106 | "ThreadsPerCore": 1 | |
107 | }, | |
108 | "StateTransitionReason": "", | |
109 | "InstanceId": "i-1231231230abcdef0", | |
110 | "ImageId": "ami-abc12345", | |
111 | "PrivateDnsName": "ip-10-0-0-157.ec2.internal", | |
112 | "SecurityGroups": [ | |
113 | { | |
114 | "GroupName": "MySecurityGroup", | |
115 | "GroupId": "sg-1a2b3c4d" | |
116 | } | |
117 | ], | |
118 | "ClientToken": "", | |
119 | "SubnetId": "subnet-6e7f829e", | |
120 | "InstanceType": "t2.micro", | |
121 | "NetworkInterfaces": [ | |
122 | { | |
123 | "Status": "in-use", | |
124 | "MacAddress": "0a:ab:58:e0:67:e2", | |
125 | "SourceDestCheck": true, | |
126 | "VpcId": "vpc-11223344", | |
127 | "Description": "", | |
128 | "NetworkInterfaceId": "eni-95c6390b", | |
129 | "PrivateIpAddresses": [ | |
130 | { | |
131 | "PrivateDnsName": "ip-10-0-0-157.ec2.internal", | |
132 | "Primary": true, | |
133 | "PrivateIpAddress": "10.0.0.157" | |
134 | } | |
135 | ], | |
136 | "PrivateDnsName": "ip-10-0-0-157.ec2.internal", | |
137 | "Attachment": { | |
138 | "Status": "attaching", | |
139 | "DeviceIndex": 0, | |
140 | "DeleteOnTermination": true, | |
141 | "AttachmentId": "eni-attach-bf87ca1f", | |
142 | "AttachTime": "2018-05-10T08:05:20.000Z" | |
143 | }, | |
144 | "Groups": [ | |
145 | { | |
146 | "GroupName": "MySecurityGroup", | |
147 | "GroupId": "sg-1a2b3c4d" | |
148 | } | |
149 | ], | |
150 | "Ipv6Addresses": [], | |
151 | "OwnerId": "123456789012", | |
152 | "SubnetId": "subnet-6e7f829e", | |
153 | "PrivateIpAddress": "10.0.0.157" | |
154 | } | |
155 | ], | |
156 | "SourceDestCheck": true, | |
157 | "Placement": { | |
158 | "Tenancy": "default", | |
159 | "GroupName": "", | |
160 | "AvailabilityZone": "us-east-1a" | |
161 | }, | |
162 | "Hypervisor": "xen", | |
163 | "BlockDeviceMappings": [], | |
164 | "Architecture": "x86_64", | |
165 | "RootDeviceType": "ebs", | |
166 | "RootDeviceName": "/dev/xvda", | |
167 | "VirtualizationType": "hvm", | |
168 | "AmiLaunchIndex": 0 | |
169 | } | |
170 | ], | |
171 | "ReservationId": "r-02a3f596d91211712", | |
172 | "Groups": [], | |
173 | "OwnerId": "123456789012" | |
174 | } | |
175 | ||
176 | The following example requests a public IP address for an instance that you're launching into a nondefault subnet: | |
177 | ||
178 | Command:: | |
179 | ||
180 | aws ec2 run-instances --image-id ami-c3b8d6aa --count 1 --instance-type t2.medium --key-name MyKeyPair --security-group-ids sg-903004f8 --subnet-id subnet-6e7f829e --associate-public-ip-address | |
181 | ||
182 | **To launch an instance using a block device mapping** | |
183 | ||
184 | Add the following parameter to your ``run-instances`` command to specify block devices:: | |
185 | ||
186 | --block-device-mappings file://mapping.json | |
187 | ||
188 | To add an Amazon EBS volume with the device name ``/dev/sdh`` and a volume size of 100, specify the following in mapping.json:: | |
189 | ||
190 | [ | |
191 | { | |
192 | "DeviceName": "/dev/sdh", | |
193 | "Ebs": { | |
194 | "VolumeSize": 100 | |
195 | } | |
196 | } | |
197 | ] | |
202 | "DeviceName": "/dev/sdh", | |
203 | "Ebs": { | |
204 | "VolumeSize": 100 | |
205 | } | |
206 | } | |
207 | ] | |
198 | 208 | |
199 | 209 | To add ``ephemeral1`` as an instance store volume with the device name ``/dev/sdc``, specify the following in mapping.json:: |
200 | 210 | |
201 | [ | |
202 | { | |
203 | "DeviceName": "/dev/sdc", | |
204 | "VirtualName": "ephemeral1" | |
205 | } | |
206 | ] | |
211 | [ | |
212 | { | |
213 | "DeviceName": "/dev/sdc", | |
214 | "VirtualName": "ephemeral1" | |
215 | } | |
216 | ] | |
207 | 217 | |
208 | 218 | To omit a device specified by the AMI used to launch the instance (for example, ``/dev/sdf``), specify the following in mapping.json:: |
209 | 219 | |
210 | [ | |
211 | { | |
212 | "DeviceName": "/dev/sdf", | |
213 | "NoDevice": "" | |
214 | } | |
215 | ] | |
216 | ||
217 | You can view only the Amazon EBS volumes in your block device mapping using the console or the ``describe-instances`` command. To view all volumes, including the instance store volumes, use the following command. | |
218 | ||
219 | Command:: | |
220 | ||
221 | curl http://169.254.169.254/latest/meta-data/block-device-mapping/ | |
220 | [ | |
221 | { | |
222 | "DeviceName": "/dev/sdf", | |
223 | "NoDevice": "" | |
224 | } | |
225 | ] | |
226 | ||
227 | After you create an instance with block devices this way, you can view only the Amazon EBS volumes in your block device mapping by using the console or by running the ``describe-instances`` command. To view all volumes, including the instance store volumes, run the following command from within the instance:: | |
228 | ||
229 | curl http://169.254.169.254/latest/meta-data/block-device-mapping/ | |
222 | 230 | |
223 | 231 | Output:: |
224 | 232 | |
225 | 233 | ami |
226 | 234 | ephemeral1 |
227 | 235 | |
228 | Note that ``ami`` represents the root volume. To get details about the instance store volume ``ephemeral1``, use the following command. | |
229 | ||
230 | Command:: | |
231 | ||
232 | curl http://169.254.169.254/latest/meta-data/block-device-mapping/ephemeral1 | |
236 | Note that ``ami`` represents the root volume. To get details about the instance store volume ``ephemeral1``, run the following command from within the instance:: | |
237 | ||
238 | curl http://169.254.169.254/latest/meta-data/block-device-mapping/ephemeral1 | |
233 | 239 | |
234 | 240 | Output:: |
235 | 241 | |
236 | 242 | sdc |
237 | 243 | |
238 | **To launch an instance with a modified block device mapping** | |
244 | **Example 4: To launch an instance with a modified block device mapping** | |
239 | 245 | |
240 | 246 | You can change individual characteristics of existing AMI block device mappings to suit your needs. Perhaps you want to use an existing AMI, but you want a larger root volume than the usual 8 GiB. Or, you would like to use a General Purpose (SSD) volume for an AMI that currently uses a Magnetic volume. |
241 | 247 | |
242 | Use the ``describe-images`` command with the image ID of the AMI you want to use to find its existing block device mapping. You should see a block device mapping in the output:: | |
243 | ||
244 | { | |
245 | "DeviceName": "/dev/sda1", | |
246 | "Ebs": { | |
247 | "DeleteOnTermination": true, | |
248 | "SnapshotId": "snap-1234567890abcdef0", | |
249 | "VolumeSize": 8, | |
250 | "VolumeType": "standard", | |
251 | "Encrypted": false | |
248 | Start by running the ``describe-images`` command with the image ID of the AMI you want to use to find its existing block device mapping. You should see a block device mapping in the output similar to the following:: | |
249 | ||
250 | { | |
251 | "DeviceName": "/dev/sda1", | |
252 | "Ebs": { | |
253 | "DeleteOnTermination": true, | |
254 | "SnapshotId": "snap-1234567890abcdef0", | |
255 | "VolumeSize": 8, | |
256 | "VolumeType": "standard", | |
257 | "Encrypted": false | |
258 | } | |
252 | 259 | } |
253 | } | |
254 | ||
255 | You can modify the above mapping by changing the individual parameters. For example, to launch an instance with a modified block device mapping, add the following parameter to your ``run-instances`` command to change the above mapping's volume size and type:: | |
260 | ||
261 | You can modify the above mapping by including the modified individual parameters in a block device mapping file. For example, to launch an instance with a modified block device mapping, add the following parameter to your ``run-instances`` command to change the above mapping's volume size and type:: | |
256 | 262 | |
257 | 263 | --block-device-mappings file://mapping.json |
258 | 264 | |
259 | Where mapping.json contains the following:: | |
260 | ||
261 | [ | |
262 | { | |
263 | "DeviceName": "/dev/sda1", | |
264 | "Ebs": { | |
265 | "DeleteOnTermination": true, | |
266 | "SnapshotId": "snap-1234567890abcdef0", | |
267 | "VolumeSize": 100, | |
268 | "VolumeType": "gp2" | |
269 | } | |
270 | } | |
271 | ] | |
272 | ||
273 | **To launch an instance with user data** | |
274 | ||
275 | You can launch an instance and specify user data that performs instance configuration, or that runs a script. The user data needs to be passed as normal string, base64 encoding is handled internally. The following example passes user data in a file called ``my_script.txt`` that contains a configuration script for your instance. The script runs at launch. | |
276 | ||
277 | Command:: | |
278 | ||
279 | aws ec2 run-instances --image-id ami-abc1234 --count 1 --instance-type m4.large --key-name keypair --user-data file://my_script.txt --subnet-id subnet-abcd1234 --security-group-ids sg-abcd1234 | |
280 | ||
281 | For more information about launching instances, see `Using Amazon EC2 Instances`_ in the *AWS Command Line Interface User Guide*. | |
282 | ||
283 | .. _`Using Amazon EC2 Instances`: http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html | |
284 | ||
285 | **To launch an instance with an instance profile** | |
286 | ||
287 | This example shows the use of the ``iam-instance-profile`` option to specify an `IAM instance profile`_ by name. | |
288 | ||
289 | .. _`IAM instance profile`: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html | |
290 | ||
291 | Command:: | |
292 | ||
293 | aws ec2 run-instances --iam-instance-profile Name=MyInstanceProfile --image-id ami-1a2b3c4d --count 1 --instance-type t2.micro --key-name MyKeyPair --security-groups MySecurityGroup | |
294 | ||
295 | **To launch an instance with tags** | |
296 | ||
297 | You can launch an instance and specify tags for the instance, volumes, or both. The following example applies a tag with a key of ``webserver`` and value of ``production`` to the instance. The command also applies a tag with a key of ``cost-center`` and a value of ``cc123`` to any EBS volume that's created (in this case, the root volume). | |
298 | ||
299 | Command:: | |
300 | ||
301 | aws ec2 run-instances --image-id ami-abc12345 --count 1 --instance-type t2.micro --key-name MyKeyPair --subnet-id subnet-6e7f829e --tag-specifications 'ResourceType=instance,Tags=[{Key=webserver,Value=production}]' 'ResourceType=volume,Tags=[{Key=cost-center,Value=cc123}]' | |
302 | ||
303 | **To launch an instance with the credit option for CPU usage of ``unlimited``** | |
304 | ||
305 | You can launch a burstable performance instance (T2 and T3) and specify the credit option for CPU usage for the instance. If you do not specify the credit option, a T2 instance launches with the default ``standard`` credit option and a T3 instance launches with the default ``unlimited`` credit option. The following example launches a t2.micro instance with the ``unlimited`` credit option. | |
306 | ||
307 | Command:: | |
308 | ||
309 | aws ec2 run-instances --image-id ami-abc12345 --count 1 --instance-type t2.micro --key-name MyKeyPair --credit-specification CpuCredits=unlimited | |
310 | ||
311 | **To launch an instance into a partition placement group** | |
312 | ||
313 | You can launch an instance into a partition placement group without specifying the partition. In this example, the partition placement group is named ``HDFS-Group-A``. | |
314 | ||
315 | Command:: | |
316 | ||
317 | aws ec2 run-instances --placement "GroupName = HDFS-Group-A" | |
318 | ||
319 | **To launch an instance into a specific partition of a partition placement group** | |
320 | ||
321 | You can launch an instance into a specific partition of a partition placement group by specifying the partition number. In this example, the partition placement group is named ``HDFS-Group-A`` and the partition number is ``3``. | |
322 | ||
323 | Command:: | |
324 | ||
325 | aws ec2 run-instances --placement "GroupName = HDFS-Group-A, PartitionNumber = 3" | |
265 | Where ``mapping.json`` contains the following (note the change in ``VolumeSize`` from ``8`` to ``100`` and the change in ``VolumeType`` from ``standard`` to ``gp2``):: | |
266 | ||
267 | [ | |
268 | { | |
269 | "DeviceName": "/dev/sda1", | |
270 | "Ebs": { | |
271 | "DeleteOnTermination": true, | |
272 | "SnapshotId": "snap-1234567890abcdef0", | |
273 | "VolumeSize": 100, | |
274 | "VolumeType": "gp2" | |
275 | } | |
276 | } | |
277 | ] | |
278 | ||
279 | **Example 5: To launch an instance that includes user data** | |
280 | ||
281 | You can launch an instance and specify user data that performs instance configuration, or that runs a script. The user data needs to be passed as normal string, base64 encoding is handled internally. The following example passes user data in a file called ``my_script.txt`` that contains a configuration script for your instance. The script runs at launch. :: | |
282 | ||
283 | aws ec2 run-instances \ | |
284 | --image-id ami-abc1234 \ | |
285 | --count 1 \ | |
286 | --instance-type m4.large \ | |
287 | --key-name keypair \ | |
288 | --user-data file://my_script.txt \ | |
289 | --subnet-id subnet-abcd1234 \ | |
290 | --security-group-ids sg-abcd1234 | |
291 | ||
292 | For more information about launching instances, see `Using Amazon EC2 Instances <http://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-launch.html>`__ in the *AWS Command Line Interface User Guide*. | |
293 | ||
294 | **Example 6: To launch an instance with an instance profile** | |
295 | ||
296 | The following ``run-instances`` example shows the use of the ``iam-instance-profile`` option to specify an `IAM instance profile <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html>`__ by name. :: | |
297 | ||
298 | aws ec2 run-instances \ | |
299 | --iam-instance-profile Name=MyInstanceProfile \ | |
300 | --image-id ami-1a2b3c4d \ | |
301 | --count 1 \ | |
302 | --instance-type t2.micro \ | |
303 | --key-name MyKeyPair \ | |
304 | --security-groups MySecurityGroup | |
305 | ||
306 | **Example 7: To launch an instance with tags** | |
307 | ||
308 | You can launch an instance and specify tags for the instance, volumes, or both. The following example applies a tag with a key of ``webserver`` and value of ``production`` to the instance. The command also applies a tag with a key of ``cost-center`` and a value of ``cc123`` to any EBS volume that's created (in this case, the root volume). :: | |
309 | ||
310 | aws ec2 run-instances \ | |
311 | --image-id ami-abc12345 \ | |
312 | --count 1 \ | |
313 | --instance-type t2.micro \ | |
314 | --key-name MyKeyPair \ | |
315 | --subnet-id subnet-6e7f829e \ | |
316 | --tag-specifications 'ResourceType=instance,Tags=[{Key=webserver,Value=production}]' 'ResourceType=volume,Tags=[{Key=cost-center,Value=cc123}]' | |
317 | ||
318 | **Example 8: To launch an instance with the credit option for CPU usage of ``unlimited``** | |
319 | ||
320 | You can launch a burstable performance instance (T2 and T3) and specify the credit option for CPU usage for the instance. If you do not specify the credit option, a T2 instance launches with the default ``standard`` credit option and a T3 instance launches with the default ``unlimited`` credit option. The following example launches a t2.micro instance with the ``unlimited`` credit option. :: | |
321 | ||
322 | aws ec2 run-instances \ | |
323 | --image-id ami-abc12345 \ | |
324 | --count 1 \ | |
325 | --instance-type t2.micro \ | |
326 | --key-name MyKeyPair \ | |
327 | --credit-specification CpuCredits=unlimited | |
328 | ||
329 | **Example 9: To launch an instance into a partition placement group** | |
330 | ||
331 | You can launch an instance into a partition placement group without specifying the partition. The following ``run-instances`` example launches the instance into the specified partition placement group. :: | |
332 | ||
333 | aws ec2 run-instances \ | |
334 | --image-id ami-abc12345 \ | |
335 | --count 1 \ | |
336 | --instance-type t2.micro \ | |
337 | --key-name MyKeyPair \ | |
338 | --subnet-id subnet-6e7f829e \ | |
339 | --placement "GroupName = HDFS-Group-A" | |
340 | ||
341 | **Example 10: To launch an instance into a specific partition of a partition placement group** | |
342 | ||
343 | You can launch an instance into a specific partition of a partition placement group by specifying the partition number. The following ``run-instances`` example launches the instance into the specified partition placement group and into partition number ``3``. :: | |
344 | ||
345 | aws ec2 run-instances \ | |
346 | --image-id ami-abc12345 \ | |
347 | --count 1 \ | |
348 | --instance-type t2.micro \ | |
349 | --key-name MyKeyPair \ | |
350 | --subnet-id subnet-6e7f829e\ | |
351 | --placement "GroupName = HDFS-Group-A, PartitionNumber = 3" |
0 | **To wait until a customer gateway is available** | |
1 | ||
2 | The following ``wait customer-gateway-available`` example pauses and resumes running only after it confirms that the specified customer gateway is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait customer-gateway-available \ | |
5 | --customer-gateway-ids cgw-1234567890abcdef0 |
0 | **To wait until an image is available** | |
1 | ||
2 | The following ``wait image-available`` example pauses and resumes running only after it confirms that the specified Amazon Machine Image is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait image-available \ | |
5 | --image-ids ami-0abcdef1234567890 |
0 | **To wait until an image exists** | |
1 | ||
2 | The following ``wait image-exists`` example pauses and resumes running only after it confirms that the specified Amazon Machine Image exists. It produces no output. :: | |
3 | ||
4 | aws ec2 wait image-exists \ | |
5 | --image-ids ami-0abcdef1234567890 |
0 | **To wait until an instance exists** | |
1 | ||
2 | The following ``wait instance-exists`` example pauses and resumes running only after it confirms that the specified instance exists. It produces no output. :: | |
3 | ||
4 | aws ec2 wait instance-exists \ | |
5 | --instance-ids i-1234567890abcdef0 |
0 | **To wait until an instance is running** | |
1 | ||
2 | The following ``wait instance-running`` example pauses and resumes running only after it confirms that the specified instance is running. It produces no output. :: | |
3 | ||
4 | aws ec2 wait instance-running \ | |
5 | --instance-ids i-1234567890abcdef0 |
0 | **To wait until the status of an instance is OK** | |
1 | ||
2 | The following ``wait instance-status-ok`` example pauses and resumes running only after it confirms that the status of the specified instance is OK. It produces no output. :: | |
3 | ||
4 | aws ec2 wait instance-status-ok \ | |
5 | --instance-ids i-1234567890abcdef0 |
0 | **To wait until an instance is stopped** | |
1 | ||
2 | The following ``wait instance-stopped`` example pauses and resumes running only after it confirms that the specified instance is stopped. It produces no output. :: | |
3 | ||
4 | aws ec2 wait instance-stopped \ | |
5 | --instance-ids i-1234567890abcdef0 |
0 | **To wait until an instance terminates** | |
1 | ||
2 | The following ``wait instance-terminated`` example pauses and resumes running only after it confirms that the specified instance is terminated. It produces no output. :: | |
3 | ||
4 | aws ec2 wait instance-terminated \ | |
5 | --instance-ids i-1234567890abcdef0 |
0 | **To wait until a key pair exists** | |
1 | ||
2 | The following ``wait key-pair-exists`` example pauses and resumes running only after it confirms that the specified key pair exists. It produces no output. :: | |
3 | ||
4 | aws ec2 wait key-pair-exists \ | |
5 | --key-names my-key-pair |
0 | **To wait until a NAT gateway is available** | |
1 | ||
2 | The following ``wait nat-gateway-available`` example pauses and resumes running only after it confirms that the specified NAT gateway is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait nat-gateway-available \ | |
5 | --nat-gateway-ids nat-1234567890abcdef0 |
0 | **To wait until a network interface is available** | |
1 | ||
2 | The following ``wait network-interface-available`` example pauses and resumes running only after it confirms that the specified network interface is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait network-interface-available \ | |
5 | --network-interface-ids eni-1234567890abcdef0 |
0 | **To wait until the password data for a Windows instance is available** | |
1 | ||
2 | The following ``wait password-data-available`` example pauses and resumes running only after it confirms that the password data for the specified Windows instance is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait password-data-available \ | |
5 | --instance-id i-1234567890abcdef0 |
0 | **To wait until a snapshot is completed** | |
1 | ||
2 | The following ``wait snapshot-completed`` example pauses and resumes running only after it confirms that the specified snapshot is completed. It produces no output. :: | |
3 | ||
4 | aws ec2 wait snapshot-completed \ | |
5 | --snapshot-ids snap-1234567890abcdef0 |
0 | **To wait until an Spot Instance request is fulfilled** | |
1 | ||
2 | The following ``wait spot-instance-request-fulfilled`` example pauses and resumes running only after it confirms that a Spot Instance request is fulfilled in the specified Availability Zone. It produces no output. :: | |
3 | ||
4 | aws ec2 wait spot-instance-request-fulfilled \ | |
5 | --filters Name=launched-availability-zone,Values=us-east-1 |
0 | **To wait until a subnet is available** | |
1 | ||
2 | The following ``wait subnet-available`` example pauses and resumes running only after it confirms that the specified subnet is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait subnet-available \ | |
5 | --subnet-ids subnet-1234567890abcdef0 |
0 | **To wait until the system status is OK** | |
1 | ||
2 | The following ``wait system-status-ok`` example command pauses and resumes running only after it confirms that the system status of the specified instance is OK. It produces no output. :: | |
3 | ||
4 | aws ec2 wait system-status-ok \ | |
5 | --instance-ids i-1234567890abcdef0 |
0 | **To wait until a volume is available** | |
1 | ||
2 | The following ``wait volume-available`` example command pauses and resumes running only after it confirms that the specified volume is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait volume-available \ | |
5 | --volume-ids vol-1234567890abcdef0 |
0 | **To wait until a volume is deleted** | |
1 | ||
2 | The following ``wait volume-deleted`` example command pauses and resumes running only after it confirms that the specified volume is deleted. It produces no output. :: | |
3 | ||
4 | aws ec2 wait volume-deleted \ | |
5 | --volume-ids vol-1234567890abcdef0 |
0 | **To wait until a volume is in use** | |
1 | ||
2 | The following ``wait volume-in-use`` example pauses and resumes running only after it confirms that the specified volume is in use. It produces no output. :: | |
3 | ||
4 | aws ec2 wait volume-in-use \ | |
5 | --volume-ids vol-1234567890abcdef0 |
0 | **To wait until a virtual private cloud (VPC) is available** | |
1 | ||
2 | The following ``wait vpc-available`` example pauses and resumes running only after it confirms that the specified VPC is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait vpc-available \ | |
5 | --vpc-ids vpc-1234567890abcdef0 |
0 | **To wait until a virtual private cloud (VPC) exists** | |
1 | ||
2 | The following ``wait vpc-exists`` example command pauses and resumes running only after it confirms that the specified VPC exists. :: | |
3 | ||
4 | aws ec2 wait vpc-exists \ | |
5 | --vpc-ids vpc-1234567890abcdef0 |
0 | **To wait until a VPC peering connection is deleted** | |
1 | ||
2 | The following ``wait vpc-peering-connection-deleted`` example pauses and resumes running only after it confirms that the specified VPC peering connection is deleted. It produces no output. :: | |
3 | ||
4 | aws ec2 wait vpc-peering-connection-deleted \ | |
5 | --vpc-peering-connection-ids pcx-1234567890abcdef0 |
0 | **To wait until a VPC peering connection exists** | |
1 | ||
2 | The following ``wait vpc-peering-connection-exists`` example pauses and continues only when it can confirm that the specified VPC peering connection exists. :: | |
3 | ||
4 | aws ec2 wait vpc-peering-connection-exists \ | |
5 | --vpc-peering-connection-ids pcx-1234567890abcdef0 |
0 | **To wait until a VPN connection is available** | |
1 | ||
2 | The following ``vpn-connection-available`` example pauses and resumes running only after it confirms that the specified VPN connection is available. It produces no output. :: | |
3 | ||
4 | aws ec2 wait vpn-connection-available \ | |
5 | --vpn-connection-ids vpn-1234567890abcdef0 |
0 | **To wait until a VPN connection is deleted** | |
1 | ||
2 | The following ``waitt vpn-connection-deleted`` example command pauses and continues when it can confirm that the specified VPN connection is deleted. It produces no output. :: | |
3 | ||
4 | aws ec2 wait vpn-connection-deleted \ | |
5 | --vpn-connection-ids vpn-1234567890abcdef0 |
0 | **To stop advertising an address range** | |
1 | ||
2 | The following ``withdraw-byoip-cidr`` example stops advertising the specified address range. :: | |
3 | ||
4 | aws ec2 withdraw-byoip-cidr | |
5 | --cidr 203.0.113.25/24 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ByoipCidr": { | |
11 | "Cidr": "203.0.113.25/24", | |
12 | "StatusMessage": "ipv4pool-ec2-1234567890abcdef0", | |
13 | "State": "advertised" | |
14 | } | |
15 | } |
0 | **To check the availability of a layer** | |
1 | ||
2 | The following ``batch-check-layer-availability`` example checks the availability of a layer with the digest ``sha256:6171c7451a50945f8ddd72f7732cc04d7a0d1f48138a426b2e64387fdeb834ed`` in the ``cluster-autoscaler`` repository. :: | |
3 | ||
4 | aws ecr batch-check-layer-availability \ | |
5 | --repository-name cluster-autoscaler \ | |
6 | --layer-digests sha256:6171c7451a50945f8ddd72f7732cc04d7a0d1f48138a426b2e64387fdeb834ed | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "layers": [ | |
12 | { | |
13 | "layerDigest": "sha256:6171c7451a50945f8ddd72f7732cc04d7a0d1f48138a426b2e64387fdeb834ed", | |
14 | "layerAvailability": "AVAILABLE", | |
15 | "layerSize": 2777, | |
16 | "mediaType": "application/vnd.docker.container.image.v1+json" | |
17 | } | |
18 | ], | |
19 | "failures": [] | |
20 | } |
0 | **To describe an image** | |
0 | **To get an image** | |
1 | 1 | |
2 | This example describes an image with the tag ``precise`` in a repository called | |
3 | ``ubuntu`` in the default registry for an account. | |
2 | The following ``batch-get-image`` example gets an image with the tag ``v1.13.6`` in a repository called | |
3 | ``cluster-autoscaler`` in the default registry for an account. :: | |
4 | 4 | |
5 | Command:: | |
5 | aws ecr batch-get-image \ | |
6 | --repository-name cluster-autoscaler \ | |
7 | --image-ids imageTag=v1.13.6 | |
8 | ||
9 | Output:: | |
6 | 10 | |
7 | aws ecr batch-get-image --repository-name ubuntu --image-ids imageTag=precise | |
11 | { | |
12 | "images": [ | |
13 | { | |
14 | "registryId": "012345678910", | |
15 | "repositoryName": "cluster-autoscaler", | |
16 | "imageId": { | |
17 | "imageDigest": "sha256:4a1c6567c38904384ebc64e35b7eeddd8451110c299e3368d2210066487d97e5", | |
18 | "imageTag": "v1.13.6" | |
19 | }, | |
20 | "imageManifest": "{\n \"schemaVersion\": 2,\n \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n \"config\": {\n \"mediaType\": \"application/vnd.docker.container.image.v1+json\",\n \"size\": 2777,\n \"digest\": \"sha256:6171c7451a50945f8ddd72f7732cc04d7a0d1f48138a426b2e64387fdeb834ed\"\n },\n \"layers\": [\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 17743696,\n \"digest\": \"sha256:39fafc05754f195f134ca11ecdb1c9a691ab0848c697fffeb5a85f900caaf6e1\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 2565026,\n \"digest\": \"sha256:8c8a779d3a537b767ae1091fe6e00c2590afd16767aa6096d1b318d75494819f\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 28005981,\n \"digest\": \"sha256:c44ba47496991c9982ee493b47fd25c252caabf2b4ae7dd679c9a27b6a3c8fb7\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 775,\n \"digest\": \"sha256:e2c388b44226544363ca007be7b896bcce1baebea04da23cbd165eac30be650f\"\n }\n ]\n}" | |
21 | } | |
22 | ], | |
23 | "failures": [] | |
24 | } |
0 | **To complete an image layer upload** | |
1 | ||
2 | The following ``complete-layer-upload`` example completes an image layer upload to the ``layer-test`` repository. :: | |
3 | ||
4 | aws ecr complete-layer-upload \ | |
5 | --repository-name layer-test \ | |
6 | --upload-id 6cb64b8a-9378-0e33-2ab1-b780fab8a9e9 \ | |
7 | --layer-digests 6cb64b8a-9378-0e33-2ab1-b780fab8a9e9:48074e6d3a68b39aad8ccc002cdad912d4148c0f92b3729323e | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "uploadId": "6cb64b8a-9378-0e33-2ab1-b780fab8a9e9", | |
13 | "layerDigest": "sha256:9a77f85878aa1906f2020a0ecdf7a7e962d57e882250acd773383224b3fe9a02", | |
14 | "repositoryName": "layer-test", | |
15 | "registryId": "130757420319" | |
16 | } |
0 | **To delete the lifecycle policy for a repository** | |
1 | ||
2 | The following ``delete-lifecycle-policy`` example deletes the lifecycle policy for the ``hello-world`` repository. :: | |
3 | ||
4 | aws ecr delete-lifecycle-policy \ | |
5 | --repository-name hello-world | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "registryId": "012345678910", | |
11 | "repositoryName": "hello-world", | |
12 | "lifecyclePolicyText": "{\"rules\":[{\"rulePriority\":1,\"description\":\"Remove untagged images.\",\"selection\":{\"tagStatus\":\"untagged\",\"countType\":\"sinceImagePushed\",\"countUnit\":\"days\",\"countNumber\":10},\"action\":{\"type\":\"expire\"}}]}", | |
13 | "lastEvaluatedAt": 0.0 | |
14 | } |
0 | **To delete the repository policy for a repository** | |
1 | ||
2 | The following ``delete-repository-policy`` example deletes the repository policy for the ``cluster-autoscaler`` repository. :: | |
3 | ||
4 | aws ecr delete-repository-policy \ | |
5 | --repository-name cluster-autoscaler | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "registryId": "012345678910", | |
11 | "repositoryName": "cluster-autoscaler", | |
12 | "policyText": "{\n \"Version\" : \"2008-10-17\",\n \"Statement\" : [ {\n \"Sid\" : \"allow public pull\",\n \"Effect\" : \"Allow\",\n \"Principal\" : \"*\",\n \"Action\" : [ \"ecr:BatchCheckLayerAvailability\", \"ecr:BatchGetImage\", \"ecr:GetDownloadUrlForLayer\" ]\n } ]\n}" | |
13 | } |
0 | **To describe an image in a repository** | |
1 | ||
2 | The folowing ``describe-images`` example displays details about an image in the ``cluster-autoscaler`` repository with the tag ``v1.13.6``. :: | |
3 | ||
4 | aws ecr describe-images \ | |
5 | --repository-name cluster-autoscaler \ | |
6 | --image-ids imageTag=v1.13.6 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "imageDetails": [ | |
12 | { | |
13 | "registryId": "012345678910", | |
14 | "repositoryName": "cluster-autoscaler", | |
15 | "imageDigest": "sha256:4a1c6567c38904384ebc64e35b7eeddd8451110c299e3368d2210066487d97e5", | |
16 | "imageTags": [ | |
17 | "v1.13.6" | |
18 | ], | |
19 | "imageSizeInBytes": 48318255, | |
20 | "imagePushedAt": 1565128275.0 | |
21 | } | |
22 | ] | |
23 | } |
0 | **To get the download URL of a layer** | |
1 | ||
2 | The following ``get-download-url-for-layer`` example displays the download URL of a layer with the digest ``sha256:6171c7451a50945f8ddd72f7732cc04d7a0d1f48138a426b2e64387fdeb834ed`` in the ``cluster-autoscaler`` repository. :: | |
3 | ||
4 | aws ecr get-download-url-for-layer \ | |
5 | --repository-name cluster-autoscaler \ | |
6 | --layer-digest sha256:6171c7451a50945f8ddd72f7732cc04d7a0d1f48138a426b2e64387fdeb834ed | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "downloadUrl": "https://prod-us-west-2-starport-layer-bucket.s3.us-west-2.amazonaws.com/e501-012345678910-9cb60dc0-7284-5643-3987-da6dac0465f0/04620aac-66a5-4167-8232-55ee7ef6d565?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20190814T220617Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Credential=AKIA32P3D2JDNMVAJLGF%2F20190814%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=9161345894947a1672467a0da7a1550f2f7157318312fe4941b59976239c3337", | |
12 | "layerDigest": "sha256:6171c7451a50945f8ddd72f7732cc04d7a0d1f48138a426b2e64387fdeb834ed" | |
13 | } |
0 | 0 | **To retrieve details for a lifecycle policy preview** |
1 | 1 | |
2 | This example retrieves the result of a lifecycle policy preview for a repository called | |
3 | ``project-a/amazon-ecs-sample`` in the default registry for an account. | |
2 | The following ``get-lifecycle-policy-preview`` example retrieves the result of a lifecycle policy preview for a repository called ``project-a/amazon-ecs-sample`` in the default registry for an account. :: | |
4 | 3 | |
5 | Command:: | |
6 | ||
7 | aws ecr get-lifecycle-policy --repository-name "project-a/amazon-ecs-sample" | |
4 | aws ecr get-lifecycle-policy-preview \ | |
5 | --repository-name "project-a/amazon-ecs-sample" | |
8 | 6 | |
9 | 7 | Output:: |
10 | 8 | |
11 | { | |
12 | "registryId": "<aws_account_id>", | |
13 | "repositoryName": "project-a/amazon-ecs-sample", | |
14 | "lifecyclePolicyText": "{\n \"rules\": [\n {\n \"rulePriority\": 1,\n \"description\": \"Expire images older than 14 days\",\n \"selection\": {\n \"tagStatus\": \"untagged\",\n \"countType\": \"sinceImagePushed\",\n \"countUnit\": \"days\",\n \"countNumber\": 14\n },\n \"action\": {\n \"type\": \"expire\"\n }\n }\n ]\n}\n", | |
15 | "status": "COMPLETE", | |
16 | "previewResults": [], | |
17 | "summary": { | |
18 | "expiringImageTotalCount": 0 | |
19 | } | |
20 | } | |
9 | { | |
10 | "registryId": "<aws_account_id>", | |
11 | "repositoryName": "project-a/amazon-ecs-sample", | |
12 | "lifecyclePolicyText": "{\n \"rules\": [\n {\n \"rulePriority\": 1,\n \"description\": \"Expire images older than 14 days\",\n \"selection\": {\n \"tagStatus\": \"untagged\",\n \"countType\": \"sinceImagePushed\",\n \"countUnit\": \"days\",\n \"countNumber\": 14\n },\n \"action\": {\n \"type\": \"expire\"\n }\n }\n ]\n}\n", | |
13 | "status": "COMPLETE", | |
14 | "previewResults": [], | |
15 | "summary": { | |
16 | "expiringImageTotalCount": 0 | |
17 | } | |
18 | } |
0 | **To retrieve the repository policy for a repository** | |
1 | ||
2 | The following ``get-repository-policy`` example displays details about the repository policy for the ``cluster-autoscaler`` repository. :: | |
3 | ||
4 | aws ecr get-repository-policy \ | |
5 | --repository-name cluster-autoscaler | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "registryId": "012345678910", | |
11 | "repositoryName": "cluster-autoscaler", | |
12 | "policyText": "{\n \"Version\" : \"2008-10-17\",\n \"Statement\" : [ {\n \"Sid\" : \"allow public pull\",\n \"Effect\" : \"Allow\",\n \"Principal\" : \"*\",\n \"Action\" : [ \"ecr:BatchCheckLayerAvailability\", \"ecr:BatchGetImage\", \"ecr:GetDownloadUrlForLayer\" ]\n } ]\n}" | |
13 | } |
0 | **To initiate an image layer upload** | |
1 | ||
2 | The following ``initiate-layer-upload`` example initiates an image layer upload to the ``layer-test`` repository. :: | |
3 | ||
4 | aws ecr initiate-layer-upload \ | |
5 | --repository-name layer-test | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "partSize": 10485760, | |
11 | "uploadId": "6cb64b8a-9378-0e33-2ab1-b780fab8a9e9" | |
12 | } |
0 | **To list the images in a repository** | |
1 | ||
2 | The following ``list-images`` example displays a list of the images in the ``cluster-autoscaler`` repository. :: | |
3 | ||
4 | aws ecr list-images \ | |
5 | --repository-name cluster-autoscaler | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "imageIds": [ | |
11 | { | |
12 | "imageDigest": "sha256:99c6fb4377e9a420a1eb3b410a951c9f464eff3b7dbc76c65e434e39b94b6570", | |
13 | "imageTag": "v1.13.8" | |
14 | }, | |
15 | { | |
16 | "imageDigest": "sha256:99c6fb4377e9a420a1eb3b410a951c9f464eff3b7dbc76c65e434e39b94b6570", | |
17 | "imageTag": "v1.13.7" | |
18 | }, | |
19 | { | |
20 | "imageDigest": "sha256:4a1c6567c38904384ebc64e35b7eeddd8451110c299e3368d2210066487d97e5", | |
21 | "imageTag": "v1.13.6" | |
22 | } | |
23 | ] | |
24 | } |
0 | **To list the tags for repository** | |
1 | ||
2 | The following ``list-tags-for-resource`` example displays a list of the tags associated with the ``hello-world`` repository. :: | |
3 | ||
4 | aws ecr list-tags-for-resource \ | |
5 | --resource-arn arn:aws:ecr:us-west-2:012345678910:repository/hello-world | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "tags": [ | |
11 | { | |
12 | "Key": "Stage", | |
13 | "Value": "Integ" | |
14 | } | |
15 | ] | |
16 | } | |
17 |
0 | **To make a repository's image tags immutable** | |
1 | ||
2 | The following ``put-image-tag-mutability`` example sets immutable image tags on the ``hello-world`` repository. :: | |
3 | ||
4 | aws ecr put-image-tag-mutability \ | |
5 | --repository-name hello-world \ | |
6 | --image-tag-mutability IMMUTABLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "registryId": "012345678910", | |
12 | "repositoryName": "hello-world", | |
13 | "imageTagMutability": "IMMUTABLE" | |
14 | } |
0 | **To retag an image with its manifest** | |
1 | ||
2 | The following ``put-image`` example creates a new tag in the ``hello-world`` repository with an existing image manifest. :: | |
3 | ||
4 | aws ecr put-image \ | |
5 | --repository-name hello-world \ | |
6 | --image-tag 2019.08 \ | |
7 | --image-manifest file://hello-world.manifest.json | |
8 | ||
9 | Contents of ``hello-world.manifest.json``:: | |
10 | ||
11 | { | |
12 | "schemaVersion": 2, | |
13 | "mediaType": "application/vnd.docker.distribution.manifest.v2+json", | |
14 | "config": { | |
15 | "mediaType": "application/vnd.docker.container.image.v1+json", | |
16 | "size": 5695, | |
17 | "digest": "sha256:cea5fe7701b7db3dd1c372f3cea6f43cdda444fcc488f530829145e426d8b980" | |
18 | }, | |
19 | "layers": [ | |
20 | { | |
21 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
22 | "size": 39096921, | |
23 | "digest": "sha256:d8868e50ac4c7104d2200d42f432b661b2da8c1e417ccfae217e6a1e04bb9295" | |
24 | }, | |
25 | { | |
26 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
27 | "size": 57938, | |
28 | "digest": "sha256:83251ac64627fc331584f6c498b3aba5badc01574e2c70b2499af3af16630eed" | |
29 | }, | |
30 | { | |
31 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
32 | "size": 423, | |
33 | "digest": "sha256:589bba2f1b36ae56f0152c246e2541c5aa604b058febfcf2be32e9a304fec610" | |
34 | }, | |
35 | { | |
36 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
37 | "size": 680, | |
38 | "digest": "sha256:d62ecaceda3964b735cdd2af613d6bb136a52c1da0838b2ff4b4dab4212bcb1c" | |
39 | }, | |
40 | { | |
41 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
42 | "size": 162, | |
43 | "digest": "sha256:6d93b41cfc6bf0d2522b7cf61588de4cd045065b36c52bd3aec2ba0622b2b22b" | |
44 | }, | |
45 | { | |
46 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
47 | "size": 28268840, | |
48 | "digest": "sha256:6986b4d4c07932c680b3587f2eac8b0e013568c003cc23b04044628a5c5e599f" | |
49 | }, | |
50 | { | |
51 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
52 | "size": 35369152, | |
53 | "digest": "sha256:8c5ec60f10102dc8da0649d866c7c2f706e459d0bdc25c83ad2de86f4996c276" | |
54 | }, | |
55 | { | |
56 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
57 | "size": 155, | |
58 | "digest": "sha256:cde50b1c594539c5f67cbede9aef95c9ae321ccfb857f7b251b45b84198adc85" | |
59 | }, | |
60 | { | |
61 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
62 | "size": 28737, | |
63 | "digest": "sha256:2e102807ab72a73fc9abf53e8c50e421bdc337a0a8afcb242176edeec65977e4" | |
64 | }, | |
65 | { | |
66 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
67 | "size": 190, | |
68 | "digest": "sha256:fc379bbd5ed37808772bef016553a297356c59b8f134659e6ee4ecb563c2f5a7" | |
69 | }, | |
70 | { | |
71 | "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", | |
72 | "size": 28748, | |
73 | "digest": "sha256:021db240dfccf5a1aff19507d17c0177e5888e518acf295b52204b1825e8b7ee" | |
74 | } | |
75 | ] | |
76 | } | |
77 | ||
78 | Output:: | |
79 | ||
80 | { | |
81 | "image": { | |
82 | "registryId": "130757420319", | |
83 | "repositoryName": "hello-world", | |
84 | "imageId": { | |
85 | "imageDigest": "sha256:8ece96b74f87652876199d83bd107d0435a196133af383ac54cb82b6cc5283ae", | |
86 | "imageTag": "2019.08" | |
87 | }, | |
88 | "imageManifest": "{\n \"schemaVersion\": 2,\n \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n \"config\": {\n \"mediaType\": \"application/vnd.docker.container.image.v1+json\",\n \"size\": 5695,\n \"digest\": \"sha256:cea5fe7701b7db3dd1c372f3cea6f43cdda444fcc488f530829145e426d8b980\"\n },\n \"layers\": [\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 39096921,\n \"digest\": \"sha256:d8868e50ac4c7104d2200d42f432b661b2da8c1e417ccfae217e6a1e04bb9295\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 57938,\n \"digest\": \"sha256:83251ac64627fc331584f6c498b3aba5badc01574e2c70b2499af3af16630eed\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 423,\n \"digest\": \"sha256:589bba2f1b36ae56f0152c246e2541c5aa604b058febfcf2be32e9a304fec610\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 680,\n \"digest\": \"sha256:d62ecaceda3964b735cdd2af613d6bb136a52c1da0838b2ff4b4dab4212bcb1c\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 162,\n \"digest\": \"sha256:6d93b41cfc6bf0d2522b7cf61588de4cd045065b36c52bd3aec2ba0622b2b22b\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 28268840,\n \"digest\": \"sha256:6986b4d4c07932c680b3587f2eac8b0e013568c003cc23b04044628a5c5e599f\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 35369152,\n \"digest\": \"sha256:8c5ec60f10102dc8da0649d866c7c2f706e459d0bdc25c83ad2de86f4996c276\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 155,\n \"digest\": \"sha256:cde50b1c594539c5f67cbede9aef95c9ae321ccfb857f7b251b45b84198adc85\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 28737,\n \"digest\": \"sha256:2e102807ab72a73fc9abf53e8c50e421bdc337a0a8afcb242176edeec65977e4\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 190,\n \"digest\": \"sha256:fc379bbd5ed37808772bef016553a297356c59b8f134659e6ee4ecb563c2f5a7\"\n },\n {\n \"mediaType\": \"application/vnd.docker.image.rootfs.diff.tar.gzip\",\n \"size\": 28748,\n \"digest\": \"sha256:021db240dfccf5a1aff19507d17c0177e5888e518acf295b52204b1825e8b7ee\"\n }\n ]\n}\n" | |
89 | } | |
90 | } |
0 | **To set the repository policy for a repository** | |
1 | ||
2 | The following ``set-repository-polixy`` example attaches a repository policy contained in a file to the ``cluster-autoscaler`` repository. :: | |
3 | ||
4 | aws ecr set-repository-policy \ | |
5 | --repository-name cluster-autoscaler \ | |
6 | --policy-text file://my-policy.json | |
7 | ||
8 | Contents of ``my-policy.json``:: | |
9 | ||
10 | { | |
11 | "Version" : "2008-10-17", | |
12 | "Statement" : [ | |
13 | { | |
14 | "Sid" : "allow public pull", | |
15 | "Effect" : "Allow", | |
16 | "Principal" : "*", | |
17 | "Action" : [ | |
18 | "ecr:BatchCheckLayerAvailability", | |
19 | "ecr:BatchGetImage", | |
20 | "ecr:GetDownloadUrlForLayer" | |
21 | ] | |
22 | } | |
23 | ] | |
24 | } | |
25 | ||
26 | Output:: | |
27 | ||
28 | { | |
29 | "registryId": "012345678910", | |
30 | "repositoryName": "cluster-autoscaler", | |
31 | "policyText": "{\n \"Version\" : \"2008-10-17\",\n \"Statement\" : [ {\n \"Sid\" : \"allow public pull\",\n \"Effect\" : \"Allow\",\n \"Principal\" : \"*\",\n \"Action\" : [ \"ecr:BatchCheckLayerAvailability\", \"ecr:BatchGetImage\", \"ecr:GetDownloadUrlForLayer\" ]\n } ]\n}" | |
32 | } |
0 | **To tag a repository** | |
1 | ||
2 | The following ``tag-resource`` example sets a tag with key ``Stage`` and value ``Integ`` on the ``hello-world`` repository. :: | |
3 | ||
4 | aws ecr tag-resource \ | |
5 | --resource-arn arn:aws:ecr:us-west-2:012345678910:repository/hello-world \ | |
6 | --tags Key=Stage,Value=Integ | |
7 | ||
8 | This command produces no output. |
0 | **To untag a repository** | |
1 | ||
2 | The following ``untag-resource`` example removes the tag with the key ``Stage`` from the ``hello-world`` repository. :: | |
3 | ||
4 | aws ecr untag-resource \ | |
5 | --resource-arn arn:aws:ecr:us-west-2:012345678910:repository/hello-world \ | |
6 | --tag-keys Stage | |
7 | ||
8 | This command produces no output. |
0 | **To upload a layer part** | |
1 | ||
2 | This following ``upload-layer-part`` uploads an image layer part to the ``layer-test`` repository. :: | |
3 | ||
4 | aws ecr upload-layer-part \ | |
5 | --repository-name layer-test \ | |
6 | --upload-id 6cb64b8a-9378-0e33-2ab1-b780fab8a9e9 \ | |
7 | --part-first-byte 0 \ | |
8 | --part-last-byte 8323314 \ | |
9 | --layer-part-blob file:///var/lib/docker/image/overlay2/layerdb/sha256/ff986b10a018b48074e6d3a68b39aad8ccc002cdad912d4148c0f92b3729323e/layer.b64 | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "uploadId": "6cb64b8a-9378-0e33-2ab1-b780fab8a9e9", | |
15 | "registryId": "012345678910", | |
16 | "lastByteReceived": 8323314, | |
17 | "repositoryName": "layer-test" | |
18 | } |
0 | 0 | **To create a new cluster** |
1 | 1 | |
2 | This example command creates a cluster named `prod` in your default region. | |
2 | This example command creates a cluster named ``prod`` in your default region. | |
3 | 3 | |
4 | 4 | Command:: |
5 | 5 | |
6 | aws eks create-cluster --name prod --role-arn arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI --resources-vpc-config subnetIds=subnet-6782e71e,subnet-e7e761ac,securityGroupIds=sg-6979fe18 | |
6 | aws eks create-cluster --name prod \ | |
7 | --role-arn arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI \ | |
8 | --resources-vpc-config subnetIds=subnet-6782e71e,subnet-e7e761ac,securityGroupIds=sg-6979fe18 | |
7 | 9 | |
8 | 10 | Output:: |
9 | 11 | |
28 | 30 | "certificateAuthority": {} |
29 | 31 | } |
30 | 32 | } |
33 | ||
34 | **To create a new cluster with private endpoint access and logging enabled** | |
35 | ||
36 | This example command creates a cluster named ``example`` in your default region with public endpoint access disabled, private endpoint access enabled, and all logging types enabled. | |
37 | ||
38 | Command:: | |
39 | ||
40 | aws eks create-cluster --name example --kubernetes-version 1.12 \ | |
41 | --role-arn arn:aws:iam::012345678910:role/example-cluster-ServiceRole-1XWBQWYSFRE2Q \ | |
42 | --resources-vpc-config subnetIds=subnet-0a188dccd2f9a632f,subnet-09290d93da4278664,subnet-0f21dd86e0e91134a,subnet-0173dead68481a583,subnet-051f70a57ed6fcab6,subnet-01322339c5c7de9b4,securityGroupIds=sg-0c5b580845a031c10,endpointPublicAccess=false,endpointPrivateAccess=true \ | |
43 | --logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}' | |
44 | ||
45 | Output:: | |
46 | ||
47 | { | |
48 | "cluster": { | |
49 | "name": "example", | |
50 | "arn": "arn:aws:eks:us-west-2:012345678910:cluster/example", | |
51 | "createdAt": 1565804921.901, | |
52 | "version": "1.12", | |
53 | "roleArn": "arn:aws:iam::012345678910:role/example-cluster-ServiceRole-1XWBQWYSFRE2Q", | |
54 | "resourcesVpcConfig": { | |
55 | "subnetIds": [ | |
56 | "subnet-0a188dccd2f9a632f", | |
57 | "subnet-09290d93da4278664", | |
58 | "subnet-0f21dd86e0e91134a", | |
59 | "subnet-0173dead68481a583", | |
60 | "subnet-051f70a57ed6fcab6", | |
61 | "subnet-01322339c5c7de9b4" | |
62 | ], | |
63 | "securityGroupIds": [ | |
64 | "sg-0c5b580845a031c10" | |
65 | ], | |
66 | "vpcId": "vpc-0f622c01f68d4afec", | |
67 | "endpointPublicAccess": false, | |
68 | "endpointPrivateAccess": true | |
69 | }, | |
70 | "logging": { | |
71 | "clusterLogging": [ | |
72 | { | |
73 | "types": [ | |
74 | "api", | |
75 | "audit", | |
76 | "authenticator", | |
77 | "controllerManager", | |
78 | "scheduler" | |
79 | ], | |
80 | "enabled": true | |
81 | } | |
82 | ] | |
83 | }, | |
84 | "status": "CREATING", | |
85 | "certificateAuthority": {}, | |
86 | "platformVersion": "eks.3" | |
87 | } | |
88 | }⏎ |
0 | 0 | **To delete a cluster** |
1 | 1 | |
2 | This example command deletes a cluster named `devel` in your default region. | |
2 | This example command deletes a cluster named ``devel`` in your default region. | |
3 | 3 | |
4 | 4 | Command:: |
5 | 5 |
13 | 13 | "arn": "arn:aws:eks:us-west-2:012345678910:cluster/devel", |
14 | 14 | "createdAt": 1527807879.988, |
15 | 15 | "version": "1.10", |
16 | "endpoint": "https://A0DCCD80A04F01705DD065655C30CC3D.yl4.us-west-2.eks.amazonaws.com", | |
16 | "endpoint": "https://EXAMPLE0A04F01705DD065655C30CC3D.yl4.us-west-2.eks.amazonaws.com", | |
17 | 17 | "roleArn": "arn:aws:iam::012345678910:role/eks-service-role-AWSServiceRoleForAmazonEKS-J7ONKE3BQ4PI", |
18 | 18 | "resourcesVpcConfig": { |
19 | 19 | "subnetIds": [ |
27 | 27 | }, |
28 | 28 | "status": "ACTIVE", |
29 | 29 | "certificateAuthority": { |
30 | "data": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFNE1EVXpNVEl6TVRFek1Wb1hEVEk0TURVeU9ESXpNVEV6TVZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTTZWCjVUaG4rdFcySm9Xa2hQMzRlVUZMNitaRXJOZGIvWVdrTmtDdWNGS2RaaXl2TjlMVmdvUmV2MjlFVFZlN1ZGbSsKUTJ3ZURyRXJiQyt0dVlibkFuN1ZLYmE3ay9hb1BHekZMdmVnb0t6b0M1N2NUdGVwZzRIazRlK2tIWHNaME10MApyb3NzcjhFM1ROeExETnNJTThGL1cwdjhsTGNCbWRPcjQyV2VuTjFHZXJnaDNSZ2wzR3JIazBnNTU0SjFWenJZCm9hTi8zODFUczlOTFF2QTBXb0xIcjBFRlZpTFdSZEoyZ3lXaC9ybDVyOFNDOHZaQXg1YW1BU0hVd01aTFpWRC8KTDBpOW4wRVM0MkpVdzQyQmxHOEdpd3NhTkJWV3lUTHZKclNhRXlDSHFtVVZaUTFDZkFXUjl0L3JleVVOVXM3TApWV1FqM3BFbk9RMitMSWJrc0RzQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFNZ3RsQ1dIQ2U2YzVHMXl2YlFTS0Q4K2hUalkKSm1NSG56L2EvRGt0WG9YUjFVQzIrZUgzT1BZWmVjRVZZZHVaSlZCckNNQ2VWR0ZkeWdBYlNLc1FxWDg0S2RXbAp1MU5QaERDSmEyRHliN2pVMUV6VThTQjFGZUZ5ZFE3a0hNS1E1blpBRVFQOTY4S01hSGUrSm0yQ2x1UFJWbEJVCjF4WlhTS1gzTVZ0K1Q0SU1EV2d6c3JRSjVuQkRjdEtLcUZtM3pKdVVubHo5ZEpVckdscEltMjVJWXJDckxYUFgKWkUwRUtRNWEzMHhkVWNrTHRGQkQrOEtBdFdqSS9yZUZPNzM1YnBMdVoyOTBaNm42QlF3elRrS0p4cnhVc3QvOAppNGsxcnlsaUdWMm5SSjBUYjNORkczNHgrYWdzYTRoSTFPbU90TFM0TmgvRXJxT3lIUXNDc2hEQUtKUT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=" | |
30 | "data": "EXAMPLECRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRFNE1EVXpNVEl6TVRFek1Wb1hEVEk0TURVeU9ESXpNVEV6TVZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTTZWCjVUaG4rdFcySm9Xa2hQMzRlVUZMNitaRXJOZGIvWVdrTmtDdWNGS2RaaXl2TjlMVmdvUmV2MjlFVFZlN1ZGbSsKUTJ3ZURyRXJiQyt0dVlibkFuN1ZLYmE3ay9hb1BHekZMdmVnb0t6b0M1N2NUdGVwZzRIazRlK2tIWHNaME10MApyb3NzcjhFM1ROeExETnNJTThGL1cwdjhsTGNCbWRPcjQyV2VuTjFHZXJnaDNSZ2wzR3JIazBnNTU0SjFWenJZCm9hTi8zODFUczlOTFF2QTBXb0xIcjBFRlZpTFdSZEoyZ3lXaC9ybDVyOFNDOHZaQXg1YW1BU0hVd01aTFpWRC8KTDBpOW4wRVM0MkpVdzQyQmxHOEdpd3NhTkJWV3lUTHZKclNhRXlDSHFtVVZaUTFDZkFXUjl0L3JleVVOVXM3TApWV1FqM3BFbk9RMitMSWJrc0RzQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFNZ3RsQ1dIQ2U2YzVHMXl2YlFTS0Q4K2hUalkKSm1NSG56L2EvRGt0WG9YUjFVQzIrZUgzT1BZWmVjRVZZZHVaSlZCckNNQ2VWR0ZkeWdBYlNLc1FxWDg0S2RXbAp1MU5QaERDSmEyRHliN2pVMUV6VThTQjFGZUZ5ZFE3a0hNS1E1blpBRVFQOTY4S01hSGUrSm0yQ2x1UFJWbEJVCjF4WlhTS1gzTVZ0K1Q0SU1EV2d6c3JRSjVuQkRjdEtLcUZtM3pKdVVubHo5ZEpVckdscEltMjVJWXJDckxYUFgKWkUwRUtRNWEzMHhkVWNrTHRGQkQrOEtBdFdqSS9yZUZPNzM1YnBMdVoyOTBaNm42QlF3elRrS0p4cnhVc3QvOAppNGsxcnlsaUdWMm5SSjBUYjNORkczNHgrYWdzYTRoSTFPbU90TFM0TmgvRXJxT3lIUXNDc2hEQUtKUT0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=" | |
31 | 31 | } |
32 | 32 | } |
33 | 33 | } |
0 | **To describe an update for a cluster** | |
1 | ||
2 | This example command describes an update for a cluster named ``example`` in your default region. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws eks describe-update --name example \ | |
7 | --update-id 10bddb13-a71b-425a-b0a6-71cd03e59161 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "update": { | |
13 | "id": "10bddb13-a71b-425a-b0a6-71cd03e59161", | |
14 | "status": "Successful", | |
15 | "type": "EndpointAccessUpdate", | |
16 | "params": [ | |
17 | { | |
18 | "type": "EndpointPublicAccess", | |
19 | "value": "true" | |
20 | }, | |
21 | { | |
22 | "type": "EndpointPrivateAccess", | |
23 | "value": "false" | |
24 | } | |
25 | ], | |
26 | "createdAt": 1565806691.149, | |
27 | "errors": [] | |
28 | } | |
29 | } |
0 | **To get a cluster authentication token** | |
1 | ||
2 | This example command gets an authentication token for a cluster named ``example``. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws eks get-token --cluster-name example | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "kind": "ExecCredential", | |
12 | "apiVersion": "client.authentication.k8s.io/v1alpha1", | |
13 | "spec": {}, | |
14 | "status": { | |
15 | "expirationTimestamp": "2019-08-14T18:44:27Z", | |
16 | "token": "k8s-aws-v1EXAMPLE_TOKEN_DATA_STRING..." | |
17 | } | |
18 | } |
0 | **To list the updates for a cluster** | |
1 | ||
2 | This example command lists the current updates for a cluster named ``example`` in your default region. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws eks list-updates --name example | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "updateIds": [ | |
12 | "10bddb13-a71b-425a-b0a6-71cd03e59161" | |
13 | ] | |
14 | } |
0 | **To update cluster endpoint access** | |
1 | ||
2 | This example command updates a cluster to disable endpoint public access and enable private endpoint access. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws eks update-cluster-config --name example \ | |
7 | --resources-vpc-config endpointPublicAccess=false,endpointPrivateAccess=true | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "update": { | |
13 | "id": "ec883c93-2e9e-407c-a22f-8f6fa6e67d4f", | |
14 | "status": "InProgress", | |
15 | "type": "EndpointAccessUpdate", | |
16 | "params": [ | |
17 | { | |
18 | "type": "EndpointPublicAccess", | |
19 | "value": "false" | |
20 | }, | |
21 | { | |
22 | "type": "EndpointPrivateAccess", | |
23 | "value": "true" | |
24 | } | |
25 | ], | |
26 | "createdAt": 1565806986.506, | |
27 | "errors": [] | |
28 | } | |
29 | } | |
30 | ||
31 | **To enable logging for a cluster** | |
32 | ||
33 | This example command enables all cluster control plane logging types for a cluster named ``example``. | |
34 | ||
35 | Command:: | |
36 | ||
37 | aws eks update-cluster-config --name example \ | |
38 | --logging '{"clusterLogging":[{"types":["api","audit","authenticator","controllerManager","scheduler"],"enabled":true}]}' | |
39 | ||
40 | Output:: | |
41 | ||
42 | { | |
43 | "update": { | |
44 | "id": "7551c64b-1d27-4b1e-9f8e-c45f056eb6fd", | |
45 | "status": "InProgress", | |
46 | "type": "LoggingUpdate", | |
47 | "params": [ | |
48 | { | |
49 | "type": "ClusterLogging", | |
50 | "value": "{\"clusterLogging\":[{\"types\":[\"api\",\"audit\",\"authenticator\",\"controllerManager\",\"scheduler\"],\"enabled\":true}]}" | |
51 | } | |
52 | ], | |
53 | "createdAt": 1565807210.37, | |
54 | "errors": [] | |
55 | } | |
56 | } |
0 | **To update a cluster Kubernetes version** | |
1 | ||
2 | This example command updates a cluster named ``example`` from Kubernetes 1.12 to 1.13. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws eks update-cluster-version --name example --kubernetes-version 1.13 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "update": { | |
12 | "id": "161a74d1-7e8c-4224-825d-b32af149f23a", | |
13 | "status": "InProgress", | |
14 | "type": "VersionUpdate", | |
15 | "params": [ | |
16 | { | |
17 | "type": "Version", | |
18 | "value": "1.13" | |
19 | }, | |
20 | { | |
21 | "type": "PlatformVersion", | |
22 | "value": "eks.2" | |
23 | } | |
24 | ], | |
25 | "createdAt": 1565807633.514, | |
26 | "errors": [] | |
27 | } | |
28 | } |
5 | 5 | This command constructs a configuration with prepopulated server and certificate authority data values for a specified cluster. |
6 | 6 | You can specify an IAM role ARN with the --role-arn option to use for authentication when you issue kubectl commands. |
7 | 7 | Otherwise, the IAM entity in your default AWS CLI or SDK credential chain is used. |
8 | You can view your default AWS CLI or SDK identity by running the `aws sts get-caller-identity` command. | |
8 | You can view your default AWS CLI or SDK identity by running the ``aws sts get-caller-identity`` command. | |
9 | 9 | |
10 | 10 | The resulting kubeconfig is created as a new file or merged with an existing kubeconfig file using the following logic: |
11 | 11 |
0 | **To update a kubeconfig for your cluster** | |
1 | ||
2 | This example command updates the default kubeconfig file to use your cluster as the current context. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws eks update-kubeconfig --name example | |
7 | ||
8 | Output:: | |
9 | ||
10 | Added new context arn:aws:eks:us-west-2:012345678910:cluster/example to /Users/ericn/.kube/config⏎ |
0 | **To wait for a cluster to become active** | |
1 | ||
2 | This example command waits for a cluster named ``example`` to become active. | |
3 | ||
4 | Command:: | |
5 | ||
6 | aws eks wait cluster-active --name example | |
7 | ||
8 | **To wait for a cluster to be deleted** | |
9 | ||
10 | This example command waits for a cluster named ``example`` to be deleted. | |
11 | ||
12 | Command:: | |
13 | ||
14 | aws eks wait cluster-deleted --name example | |
15 |
0 | **Example 1: To create a basic Linux fleet** | |
1 | ||
2 | The following ``create-fleet`` example creates a minimally configured fleet of on-demand Linux instances to host a custom server build. You can complete the configuration by using ``update-fleet``. :: | |
3 | ||
4 | aws gamelift create-fleet \ | |
5 | --name MegaFrogRace.NA.v2 \ | |
6 | --description 'Hosts for v2 North America' \ | |
7 | --build-id build-1111aaaa-22bb-33cc-44dd-5555eeee66ff \ | |
8 | --certificate-configuration 'CertificateType=GENERATED' \ | |
9 | --ec2-instance-type c4.large \ | |
10 | --fleet-type ON_DEMAND \ | |
11 | --runtime-configuration 'ServerProcesses=[{LaunchPath=/local/game/release-na/MegaFrogRace_Server.exe,ConcurrentExecutions=1}]' | |
12 | ||
13 | Output:: | |
14 | ||
15 | { | |
16 | "FleetAttributes": { | |
17 | "BuildId": "build-1111aaaa-22bb-33cc-44dd-5555eeee66ff", | |
18 | "CertificateConfiguration": { | |
19 | "CertificateType": "GENERATED" | |
20 | }, | |
21 | "CreationTime": 1496365885.44, | |
22 | "Description": "Hosts for v2 North America", | |
23 | "FleetArn": "arn:aws:gamelift:us-west-2:444455556666:fleet/fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", | |
24 | "FleetId": "fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", | |
25 | "FleetType": "ON_DEMAND", | |
26 | "InstanceType": "c4.large", | |
27 | "MetricGroups": ["default"], | |
28 | "Name": "MegaFrogRace.NA.v2", | |
29 | "NewGameSessionProtectionPolicy": "NoProtection", | |
30 | "OperatingSystem": "AMAZON_LINUX", | |
31 | "ServerLaunchPath": "/local/game/release-na/MegaFrogRace_Server.exe", | |
32 | "Status": "NEW" | |
33 | } | |
34 | } | |
35 | ||
36 | **Example 2: To create a basic Windows fleet** | |
37 | ||
38 | The following ``create-fleet`` example creates a minimally configured fleet of spot Windows instances to host a custom server build. You can complete the configuration by using ``update-fleet``. :: | |
39 | ||
40 | aws gamelift create-fleet \ | |
41 | --name MegaFrogRace.NA.v2 \ | |
42 | --description 'Hosts for v2 North America' \ | |
43 | --build-id build-2222aaaa-33bb-44cc-55dd-6666eeee77ff \ | |
44 | --certificate-configuration 'CertificateType=GENERATED' \ | |
45 | --ec2-instance-type c4.large \ | |
46 | --fleet-type SPOT \ | |
47 | --runtime-configuration 'ServerProcesses=[{LaunchPath==C:\game\Bin64.Release.Dedicated\MegaFrogRace_Server.exe,ConcurrentExecutions=1}]' | |
48 | ||
49 | Output:: | |
50 | ||
51 | { | |
52 | "FleetAttributes": { | |
53 | "BuildId": "build-2222aaaa-33bb-44cc-55dd-6666eeee77ff", | |
54 | "CertificateConfiguration": { | |
55 | "CertificateType": "GENERATED" | |
56 | }, | |
57 | "CreationTime": 1496365885.44, | |
58 | "Description": "Hosts for v2 North America", | |
59 | "FleetArn": "arn:aws:gamelift:us-west-2:444455556666:fleet/fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", | |
60 | "FleetId": "fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", | |
61 | "FleetType": "SPOT", | |
62 | "InstanceType": "c4.large", | |
63 | "MetricGroups": ["default"], | |
64 | "Name": "MegaFrogRace.NA.v2", | |
65 | "NewGameSessionProtectionPolicy": "NoProtection", | |
66 | "OperatingSystem": "WINDOWS_2012", | |
67 | "ServerLaunchPath": "C:\game\Bin64.Release.Dedicated\MegaFrogRace_Server.exe", | |
68 | "Status": "NEW" | |
69 | } | |
70 | } | |
71 | ||
72 | **Example 3: To create a fully configured fleet** | |
73 | ||
74 | The following ``create-fleet`` example creates a fleet of Spot Windows instances for a custom server build, with most commonly used configuration settings provided. :: | |
75 | ||
76 | aws gamelift create-fleet \ | |
77 | --name MegaFrogRace.NA.v2 \ | |
78 | --description 'Hosts for v2 North America' \ | |
79 | --build-id build-2222aaaa-33bb-44cc-55dd-6666eeee77ff \ | |
80 | --certificate-configuration 'CertificateType=GENERATED' \ | |
81 | --ec2-instance-type c4.large \ | |
82 | --ec2-inbound-permissions 'FromPort=33435,ToPort=33435,IpRange=10.24.34.0/23,Protocol=UDP' \ | |
83 | --fleet-type SPOT \ | |
84 | --new-game-session-protection-policy FullProtection \ | |
85 | --runtime-configuration file://runtime-config.json \ | |
86 | --metric-groups default \ | |
87 | --instance-role-arn 'arn:aws:iam::444455556666:role/GameLiftS3Access' | |
88 | ||
89 | Contents of ``runtime-config.json``:: | |
90 | ||
91 | GameSessionActivationTimeoutSeconds=300, | |
92 | MaxConcurrentGameSessionActivations=2, | |
93 | ServerProcesses=[ | |
94 | {LaunchPath=C:\game\Bin64.Release.Dedicated\MegaFrogRace_Server.exe,Parameters=-debug,ConcurrentExecutions=1}, | |
95 | {LaunchPath=C:\game\Bin64.Release.Dedicated\MegaFrogRace_Server.exe,ConcurrentExecutions=1}] | |
96 | ||
97 | Output:: | |
98 | ||
99 | { | |
100 | "FleetAttributes": { | |
101 | "InstanceRoleArn": "arn:aws:iam::123456789012:role/GameLiftS3Access", | |
102 | "Status": "NEW", | |
103 | "InstanceType": "c4.large", | |
104 | "FleetArn": "arn:aws:gamelift:us-west-2:123456789012:fleet/fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", | |
105 | "FleetId": "fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", | |
106 | "Description": "Hosts for v2 North America", | |
107 | "FleetType": "SPOT", | |
108 | "OperatingSystem": "WINDOWS_2012", | |
109 | "Name": "MegaFrogRace.NA.v2", | |
110 | "CreationTime": 1569309011.11, | |
111 | "MetricGroups": [ | |
112 | "default" | |
113 | ], | |
114 | "BuildId": "build-2222aaaa-33bb-44cc-55dd-6666eeee77ff", | |
115 | "ServerLaunchParameters": "abc", | |
116 | "ServerLaunchPath": "C:\\game\\Bin64.Release.Dedicated\\MegaFrogRace_Server.exe", | |
117 | "NewGameSessionProtectionPolicy": "FullProtection", | |
118 | "CertificateConfiguration": { | |
119 | "CertificateType": "GENERATED" | |
120 | } | |
121 | } | |
122 | } | |
123 | ||
124 | **Example 4: To create a Realtime Servers fleet** | |
125 | ||
126 | The following ``create-fleet`` example creates a fleet of Spot instances with a Realtime configuration script that has been uploaded to Amazon GameLift. All Realtime servers are deployed onto Linux machines. For the purposes of this example, assume that the uploaded Realtime script includes multiple script files, with the Init() function located in the script file called "MainScript.js". As shown, this file is identified as the launch script in the runtime configuration. :: | |
127 | ||
128 | aws gamelift create-fleet \ | |
129 | --name MegaFrogRace.NA.realtime \ | |
130 | --description 'Mega Frog Race Realtime fleet' \ | |
131 | --script-id script-1111aaaa-22bb-33cc-44dd-5555eeee66ff \ | |
132 | --ec2-instance-type c4.large \ | |
133 | --fleet-type SPOT \ | |
134 | --certificate-configuration 'CertificateType=GENERATED' \ | |
135 | --runtime-configuration 'ServerProcesses=[{LaunchPath=/local/game/MainScript.js,Parameters=+map Winter444,ConcurrentExecutions=5}]' | |
136 | ||
137 | Output:: | |
138 | ||
139 | { | |
140 | "FleetAttributes": { | |
141 | "FleetId": "fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", | |
142 | "Status": "NEW", | |
143 | "CreationTime": 1569310745.212, | |
144 | "InstanceType": "c4.large", | |
145 | "NewGameSessionProtectionPolicy": "NoProtection", | |
146 | "CertificateConfiguration": { | |
147 | "CertificateType": "GENERATED" | |
148 | }, | |
149 | "Name": "MegaFrogRace.NA.realtime", | |
150 | "ScriptId": "script-1111aaaa-22bb-33cc-44dd-5555eeee66ff", | |
151 | "FleetArn": "arn:aws:gamelift:us-west-2:123456789012:fleet/fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", | |
152 | "FleetType": "SPOT", | |
153 | "MetricGroups": [ | |
154 | "default" | |
155 | ], | |
156 | "Description": "Mega Frog Race Realtime fleet", | |
157 | "OperatingSystem": "AMAZON_LINUX" | |
158 | } | |
159 | } |
0 | **To create an accelerator** | |
1 | ||
2 | The following ``create-accelerator`` example creates an accelerator. You must specify the ``US-West-2 (Oregon)`` Region to create or update an accelerator. :: | |
3 | ||
4 | aws globalaccelerator create-accelerator \ | |
5 | --name ExampleAccelerator \ | |
6 | --region us-west-2 \ | |
7 | --idempotencytoken dcba4321-dcba-4321-dcba-dcba4321 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Accelerator": { | |
13 | "AcceleratorArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh", | |
14 | "IpAddressType": "IPV4", | |
15 | "Name": "ExampleAccelerator", | |
16 | "Enabled": true, | |
17 | "Status": "IN_PROGRESS", | |
18 | "IpSets": [ | |
19 | { | |
20 | "IpAddresses": [ | |
21 | "192.0.2.250", | |
22 | "192.0.2.52" | |
23 | ], | |
24 | "IpFamily": "IPv4" | |
25 | } | |
26 | ], | |
27 | "CreatedTime": 1542394847.0, | |
28 | "LastModifiedTime": 1542394847.0 | |
29 | } | |
30 | } | |
31 | ||
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 create an endpoint group** | |
1 | ||
2 | The following ``create-endpoint-group`` example creates an endpoint group. :: | |
3 | ||
4 | aws globalaccelerator create-endpoint-group \ | |
5 | --listener-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz \ | |
6 | --endpoint-group-region us-east-1 \ | |
7 | --endpoint-configurations EndpointId=eipalloc-eip01234567890abc,Weight=128 \ | |
8 | --region us-west-2 \ | |
9 | --idempotencytoken dcba4321-dcba-4321-dcba-dcba4321 | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "EndpointGroup": { | |
15 | "TrafficDialPercentage": 100.0, | |
16 | "EndpointDescriptions": [ | |
17 | { | |
18 | "Weight": 128, | |
19 | "EndpointId": "eipalloc-eip01234567890abc" | |
20 | } | |
21 | ], | |
22 | "EndpointGroupArn": "arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz/endpoint-group/098765zyxwvu", | |
23 | "EndpointGroupRegion": "us-east-1" | |
24 | } | |
25 | } | |
26 | ||
27 | 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 | **To create a listener** | |
1 | ||
2 | The following ``create-listener`` example creates a listener. :: | |
3 | ||
4 | aws globalaccelerator create-listener \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --port-ranges FromPort=80,ToPort=80 FromPort=81,ToPort=81 \ | |
7 | --protocol TCP \ | |
8 | --region us-west-2 \ | |
9 | --idempotencytoken dcba4321-dcba-4321-dcba-dcba4321 | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "Listener": { | |
15 | "PortRanges": [ | |
16 | { | |
17 | "ToPort": 80, | |
18 | "FromPort": 80 | |
19 | }, | |
20 | { | |
21 | "ToPort": 81, | |
22 | "FromPort": 81 | |
23 | } | |
24 | ], | |
25 | "ClientAffinity": "NONE", | |
26 | "Protocol": "TCP", | |
27 | "ListenerArn": "arn:aws:globalaccelerator::012345678901:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/0123vxyz" | |
28 | } | |
29 | } | |
30 | ||
31 | 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 describe an accelerator** | |
1 | ||
2 | The following ``describe-accelerator`` example retrieves the details about an accelerator. :: | |
3 | ||
4 | aws globalaccelerator describe-accelerator \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --region us-west-2 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Accelerator": { | |
12 | "AcceleratorArn": "arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh", | |
13 | "IpAddressType": "IPV4", | |
14 | "Name": "ExampleAaccelerator", | |
15 | "Enabled": true, | |
16 | "Status": "IN_PROGRESS", | |
17 | "IpSets": [ | |
18 | { | |
19 | "IpAddresses": [ | |
20 | "192.0.2.250", | |
21 | "192.0.2.52" | |
22 | ], | |
23 | "IpFamily": "IPv4" | |
24 | } | |
25 | ], | |
26 | "CreatedTime": 1542394847, | |
27 | "LastModifiedTime": 1542395013 | |
28 | } | |
29 | } | |
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*. |
0 | **To update an accelerator** | |
1 | ||
2 | The following ``update-accelerator`` example modifies an accelerator. You must specify the ``US-West-2 (Oregon)`` Region to create or update accelerators. :: | |
3 | ||
4 | aws globalaccelerator update-accelerator \ | |
5 | --accelerator-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh \ | |
6 | --name ExampleAcceleratorNew \ | |
7 | --region us-west-2 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Accelerator": { | |
13 | "AcceleratorArn": "arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh", | |
14 | "IpAddressType": "IPV4", | |
15 | "Name": "ExampleAcceleratorNew", | |
16 | "Enabled": true, | |
17 | "Status": "IN_PROGRESS", | |
18 | "IpSets": [ | |
19 | { | |
20 | "IpAddresses": [ | |
21 | "192.0.2.250", | |
22 | "192.0.2.52" | |
23 | ], | |
24 | "IpFamily": "IPv4" | |
25 | } | |
26 | ], | |
27 | "CreatedTime": 1232394847, | |
28 | "LastModifiedTime": 1232395654 | |
29 | } | |
30 | } | |
31 | ||
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 an endpoint group** | |
1 | ||
2 | The following ``update-endpoint-group`` example updates an endpoint group. :: | |
3 | ||
4 | aws globalaccelerator update-endpoint-group \ | |
5 | --endpoint-group-arn arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/6789vxyz-vxyz-6789-vxyz-6789lmnopqrs \ | |
6 | --endpoint-configurations \ | |
7 | EndpointId=eipalloc-eip01234567890abc,Weight=128 \ | |
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 | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "EndpointGroup": { | |
15 | "TrafficDialPercentage": 100, | |
16 | "EndpointDescriptions": [ | |
17 | { | |
18 | "Weight": 128, | |
19 | "EndpointId": "eip01234567890abc" | |
20 | }, | |
21 | { | |
22 | "Weight": 128, | |
23 | "EndpointId": "arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/app/ALBTesting/alb01234567890xyz" | |
24 | }, | |
25 | { | |
26 | "Weight": 128, | |
27 | "EndpointId": "arn:aws:elasticloadbalancing:us-east-1:000123456789:loadbalancer/net/NLBTesting/alb01234567890qrs" | |
28 | } | |
29 | ], | |
30 | "EndpointGroupArn": "arn:aws:globalaccelerator::123456789012:accelerator/1234abcd-abcd-1234-abcd-1234abcdefgh/listener/6789vxyz-vxyz-6789-vxyz-6789lmnopqrs/endpoint-group/4321abcd-abcd-4321-abcd-4321abcdefg", | |
31 | "EndpointGroupRegion": "us-east-1" | |
32 | } | |
33 | } | |
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*. |
0 | **To associate a role with a Greengrass group** | |
1 | ||
2 | The following ``associate-role-to-group`` example associates the specified IAM role with a Greengrass group. The group role is used by local Lambda functions and connectors to access AWS services. For example, your group role might grant permissions required for CloudWatch Logs integration. :: | |
3 | ||
4 | aws greengrass associate-role-to-group \ | |
5 | --group-id 2494ee3f-7f8a-4e92-a78b-d205f808b84b \ | |
6 | --role-arn arn:aws:iam::123456789012:role/GG-Group-Role | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "AssociatedAt": "2019-09-10T20:03:30Z" | |
12 | } | |
13 | ||
14 | For more information, see `Configure the Group Role <https://docs.aws.amazon.com/greengrass/latest/developerguide/config-iam-roles.html>`__ in the *AWS IoT Greengrass Developer Guide*. |
0 | **To create a device definition version** | |
1 | ||
2 | The following ``create-device-definition-version`` example creates a device definition version and associates it with the specified device definition. The version defines two devices. | |
3 | Before you can create a Greengrass device, you must first create and provision the corresponding AWS IoT thing. This process includes the following ``iot`` commands that you must run to get the required information for the Greengrass command: | |
4 | ||
5 | * Create the AWS IoT thing that corresponds to the device:: | |
6 | ||
7 | aws iot create-thing \ | |
8 | --thing-name "InteriorTherm" | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "thingArn": "arn:aws:iot:us-west-2:123456789012:thing/InteriorTherm", | |
14 | "thingName": "InteriorTherm", | |
15 | "thingId": "01d4763c-78a6-46c6-92be-7add080394bf" | |
16 | } | |
17 | ||
18 | * Create public and private keys and the device certificate for the thing. This example uses the ``create-keys-and-certificate`` command and requires write permissions to the current directory. Alternatively, you can use the ``create-certificate-from-csr`` command:: | |
19 | ||
20 | aws iot create-keys-and-certificate \ | |
21 | --set-as-active \ | |
22 | --certificate-pem-outfile "myDevice.cert.pem" \ | |
23 | --public-key-outfile "myDevice.public.key" \ | |
24 | --private-key-outfile "myDevice.private.key" | |
25 | ||
26 | Output:: | |
27 | ||
28 | { | |
29 | "certificateArn": "arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92", | |
30 | "certificatePem": "-----BEGIN CERTIFICATE-----\nMIIDWTCAkGgAwIBATgIUCgq6EGqou6zFqWgIZRndgQEFW+gwDQYJKoZIhvc...KdGewQS\n-----END CERTIFICATE-----\n", | |
31 | "keyPair": { | |
32 | "PublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBzrqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqKpRgnn6yq26U3y...wIDAQAB\n-----END PUBLIC KEY-----\n", | |
33 | "PrivateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIABAKCAQEAqKpRgnn6yq26U3yt5YFZquyukfRjbMXDcNOK4rMCxDR...fvY4+te\n-----END RSA PRIVATE KEY-----\n" | |
34 | }, | |
35 | "certificateId": "66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92" | |
36 | } | |
37 | ||
38 | * Create an AWS IoT policy that allows ``iot`` and ``greengrass`` actions. For simplicity, the following policy allows actions on all resources, but your policy can be more restrictive:: | |
39 | ||
40 | aws iot create-policy \ | |
41 | --policy-name "GG_Devices" \ | |
42 | --policy-document "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iot:Publish\",\"iot:Subscribe\",\"iot:Connect\",\"iot:Receive\"],\"Resource\":[\"*\"]},{\"Effect\":\"Allow\",\"Action\":[\"iot:GetThingShadow\",\"iot:UpdateThingShadow\",\"iot:DeleteThingShadow\"],\"Resource\":[\"*\"]},{\"Effect\":\"Allow\",\"Action\":[\"greengrass:*\"],\"Resource\":[\"*\"]}]}" | |
43 | ||
44 | Output:: | |
45 | ||
46 | { | |
47 | "policyName": "GG_Devices", | |
48 | "policyArn": "arn:aws:iot:us-west-2:123456789012:policy/GG_Devices", | |
49 | "policyDocument": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iot:Publish\",\"iot:Subscribe\",\"iot:Connect\",\"iot:Receive\"],\"Resource\":[\"*\"]},{\"Effect\":\"Allow\",\"Action\":[\"iot:GetThingShadow\",\"iot:UpdateThingShadow\",\"iot:DeleteThingShadow\"],\"Resource\":[\"*\"]},{\"Effect\":\"Allow\",\"Action\":[\"greengrass:*\"],\"Resource\":[\"*\"]}]}", | |
50 | "policyVersionId": "1" | |
51 | } | |
52 | ||
53 | * Attach the policy to the certificate:: | |
54 | ||
55 | aws iot attach-policy \ | |
56 | --policy-name "GG_Devices" \ | |
57 | --target "arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92" | |
58 | ||
59 | * Attach the thing to the certificate :: | |
60 | ||
61 | aws iot attach-thing-principal \ | |
62 | --thing-name "InteriorTherm" \ | |
63 | --principal "arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92" | |
64 | ||
65 | After you create and configure the IoT thing as shown above, use the ``ThingArn`` and ``CertificateArn`` from the first two commands in the following example. :: | |
66 | ||
67 | aws greengrass create-device-definition-version \ | |
68 | --device-definition-id "f9ba083d-5ad4-4534-9f86-026a45df1ccd" \ | |
69 | --devices "[{\"Id\":\"InteriorTherm\",\"ThingArn\":\"arn:aws:iot:us-west-2:123456789012:thing/InteriorTherm\",\"CertificateArn\":\"arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92\",\"SyncShadow\":true},{\"Id\":\"ExteriorTherm\",\"ThingArn\":\"arn:aws:iot:us-west-2:123456789012:thing/ExteriorTherm\",\"CertificateArn\":\"arn:aws:iot:us-west-2:123456789012:cert/6c52ce1b47bde88a637e9ccdd45fe4e4c2c0a75a6866f8f63d980ee22fa51e02\",\"SyncShadow\":true}]" | |
70 | ||
71 | Output:: | |
72 | ||
73 | { | |
74 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd/versions/83c13984-6fed-447e-84d5-5b8aa45d5f71", | |
75 | "Version": "83c13984-6fed-447e-84d5-5b8aa45d5f71", | |
76 | "CreationTimestamp": "2019-09-11T00:15:09.838Z", | |
77 | "Id": "f9ba083d-5ad4-4534-9f86-026a45df1ccd" | |
78 | } |
0 | **To create a device definition** | |
1 | ||
2 | The following ``create-device-definition`` example creates a device definition that contains an initial device definition version. The initial version defines two devices. | |
3 | Before you can create a Greengrass device, you must first create and provision the corresponding AWS IoT thing. This process includes the following ``iot`` commands that you must run to get the required information for the Greengrass command: | |
4 | ||
5 | * Create the AWS IoT thing that corresponds to the device:: | |
6 | ||
7 | aws iot create-thing \ | |
8 | --thing-name "InteriorTherm" | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "thingArn": "arn:aws:iot:us-west-2:123456789012:thing/InteriorTherm", | |
14 | "thingName": "InteriorTherm", | |
15 | "thingId": "01d4763c-78a6-46c6-92be-7add080394bf" | |
16 | } | |
17 | ||
18 | * Create public and private keys and the device certificate for the thing. This example uses the ``create-keys-and-certificate`` command and requires write permissions to the current directory. Alternatively, you can use the ``create-certificate-from-csr`` command:: | |
19 | ||
20 | aws iot create-keys-and-certificate \ | |
21 | --set-as-active \ | |
22 | --certificate-pem-outfile "myDevice.cert.pem" \ | |
23 | --public-key-outfile "myDevice.public.key" \ | |
24 | --private-key-outfile "myDevice.private.key" | |
25 | ||
26 | Output:: | |
27 | ||
28 | { | |
29 | "certificateArn": "arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92", | |
30 | "certificatePem": "-----BEGIN CERTIFICATE-----\nMIIDWTCAkGgAwIBATgIUCgq6EGqou6zFqWgIZRndgQEFW+gwDQYJKoZIhvc...KdGewQS\n-----END CERTIFICATE-----\n", | |
31 | "keyPair": { | |
32 | "PublicKey": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBzrqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqKpRgnn6yq26U3y...wIDAQAB\n-----END PUBLIC KEY-----\n", | |
33 | "PrivateKey": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIABAKCAQEAqKpRgnn6yq26U3yt5YFZquyukfRjbMXDcNOK4rMCxDR...fvY4+te\n-----END RSA PRIVATE KEY-----\n" | |
34 | }, | |
35 | "certificateId": "66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92" | |
36 | } | |
37 | ||
38 | * Create an AWS IoT policy that allows ``iot`` and ``greengrass`` actions. For simplicity, the following policy allows actions on all resources, but your policy can be more restrictive:: | |
39 | ||
40 | aws iot create-policy \ | |
41 | --policy-name "GG_Devices" \ | |
42 | --policy-document "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iot:Publish\",\"iot:Subscribe\",\"iot:Connect\",\"iot:Receive\"],\"Resource\":[\"*\"]},{\"Effect\":\"Allow\",\"Action\":[\"iot:GetThingShadow\",\"iot:UpdateThingShadow\",\"iot:DeleteThingShadow\"],\"Resource\":[\"*\"]},{\"Effect\":\"Allow\",\"Action\":[\"greengrass:*\"],\"Resource\":[\"*\"]}]}" | |
43 | ||
44 | Output:: | |
45 | ||
46 | { | |
47 | "policyName": "GG_Devices", | |
48 | "policyArn": "arn:aws:iot:us-west-2:123456789012:policy/GG_Devices", | |
49 | "policyDocument": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"iot:Publish\",\"iot:Subscribe\",\"iot:Connect\",\"iot:Receive\"],\"Resource\":[\"*\"]},{\"Effect\":\"Allow\",\"Action\":[\"iot:GetThingShadow\",\"iot:UpdateThingShadow\",\"iot:DeleteThingShadow\"],\"Resource\":[\"*\"]},{\"Effect\":\"Allow\",\"Action\":[\"greengrass:*\"],\"Resource\":[\"*\"]}]}", | |
50 | "policyVersionId": "1" | |
51 | } | |
52 | ||
53 | * Attach the policy to the certificate:: | |
54 | ||
55 | aws iot attach-policy \ | |
56 | --policy-name "GG_Devices" \ | |
57 | --target "arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92" | |
58 | ||
59 | * Attach the thing to the certificate :: | |
60 | ||
61 | aws iot attach-thing-principal \ | |
62 | --thing-name "InteriorTherm" \ | |
63 | --principal "arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92" | |
64 | ||
65 | After you create and configure the IoT thing as shown above, use the ``ThingArn`` and ``CertificateArn`` from the first two commands in the following example. :: | |
66 | ||
67 | aws greengrass create-device-definition \ | |
68 | --name "Sensors" \ | |
69 | --initial-version "{\"Devices\":[{\"Id\":\"InteriorTherm\",\"ThingArn\":\"arn:aws:iot:us-west-2:123456789012:thing/InteriorTherm\",\"CertificateArn\":\"arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92\",\"SyncShadow\":true},{\"Id\":\"ExteriorTherm\",\"ThingArn\":\"arn:aws:iot:us-west-2:123456789012:thing/ExteriorTherm\",\"CertificateArn\":\"arn:aws:iot:us-west-2:123456789012:cert/6c52ce1b47bde88a637e9ccdd45fe4e4c2c0a75a6866f8f63d980ee22fa51e02\",\"SyncShadow\":true}]}" | |
70 | ||
71 | Output:: | |
72 | ||
73 | { | |
74 | "LatestVersionArn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd/versions/3b5cc510-58c1-44b5-9d98-4ad858ffa795", | |
75 | "Name": "Sensors", | |
76 | "LastUpdatedTimestamp": "2019-09-11T00:11:06.197Z", | |
77 | "LatestVersion": "3b5cc510-58c1-44b5-9d98-4ad858ffa795", | |
78 | "CreationTimestamp": "2019-09-11T00:11:06.197Z", | |
79 | "Id": "f9ba083d-5ad4-4534-9f86-026a45df1ccd", | |
80 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd" | |
81 | } |
0 | **To delete a device definition** | |
1 | ||
2 | The following ``delete-device-definition`` example deletes the specified device definition, including all of its versions. If you delete a device definition version that is used by a group version, the group version cannot be deployed successfully. :: | |
3 | ||
4 | aws greengrass delete-device-definition \ | |
5 | --device-definition-id "f9ba083d-5ad4-4534-9f86-026a45df1ccd" | |
6 | ||
7 | This command produces no output. |
0 | **To disassociate the role from a Greengrass group** | |
1 | ||
2 | The following ``disassociate-role-from-group`` example disassociates the IAM role from the specified Greengrass group. :: | |
3 | ||
4 | aws greengrass disassociate-role-from-group \ | |
5 | --group-id 2494ee3f-7f8a-4e92-a78b-d205f808b84b | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DisassociatedAt": "2019-09-10T20:05:49Z" | |
11 | } | |
12 | ||
13 | For more information, see `Configure the Group Role <https://docs.aws.amazon.com/greengrass/latest/developerguide/config-iam-roles.html>`__ in the *AWS IoT Greengrass Developer Guide*. |
0 | **To get the role associated with a Greengrass group** | |
1 | ||
2 | The following ``get-associated-role`` example gets the IAM role that's associated with the specified Greengrass group. The group role is used by local Lambda functions and connectors to access AWS services. :: | |
3 | ||
4 | aws greengrass get-associated-role \ | |
5 | --group-id 2494ee3f-7f8a-4e92-a78b-d205f808b84b | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "RoleArn": "arn:aws:iam::123456789012:role/GG-Group-Role", | |
11 | "AssociatedAt": "2019-09-10T20:03:30Z" | |
12 | } | |
13 | ||
14 | For more information, see `Configure the Group Role <https://docs.aws.amazon.com/greengrass/latest/developerguide/config-iam-roles.html>`__ in the *AWS IoT Greengrass Developer Guide*. |
0 | **To get the connectivity information for a Greengrass core** | |
1 | ||
2 | The following ``get-connectivity-info`` example displays the endpoints that devices can use to connect to the specified Greengrass core. Connectivity information is a list of IP addresses or domain names, with corresponding port numbers and optional customer-defined metadata. :: | |
3 | ||
4 | aws greengrass get-connectivity-info \ | |
5 | --thing-name "MyGroup_Core" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "ConnectivityInfo": [ | |
11 | { | |
12 | "Metadata": "", | |
13 | "PortNumber": 8883, | |
14 | "HostAddress": "127.0.0.1", | |
15 | "Id": "AUTOIP_127.0.0.1_0" | |
16 | }, | |
17 | { | |
18 | "Metadata": "", | |
19 | "PortNumber": 8883, | |
20 | "HostAddress": "192.168.1.3", | |
21 | "Id": "AUTOIP_192.168.1.3_1" | |
22 | }, | |
23 | { | |
24 | "Metadata": "", | |
25 | "PortNumber": 8883, | |
26 | "HostAddress": "::1", | |
27 | "Id": "AUTOIP_::1_2" | |
28 | }, | |
29 | { | |
30 | "Metadata": "", | |
31 | "PortNumber": 8883, | |
32 | "HostAddress": "fe80::1e69:ed93:f5b:f6d", | |
33 | "Id": "AUTOIP_fe80::1e69:ed93:f5b:f6d_3" | |
34 | } | |
35 | ] | |
36 | } |
0 | **To get a device definition version** | |
1 | ||
2 | The following ``get-device-definition-version`` example retrieves details for the specified device definition version from the specified device definition. :: | |
3 | ||
4 | aws greengrass get-device-definition-version \ | |
5 | --device-definition-id "f9ba083d-5ad4-4534-9f86-026a45df1ccd" \ | |
6 | --device-definition-version-id "83c13984-6fed-447e-84d5-5b8aa45d5f71" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Definition": { | |
12 | "Devices": [ | |
13 | { | |
14 | "CertificateArn": "arn:aws:iot:us-west-2:123456789012:cert/6c52ce1b47bde88a637e9ccdd45fe4e4c2c0a75a6866f8f63d980ee22fa51e02", | |
15 | "ThingArn": "arn:aws:iot:us-west-2:123456789012:thing/ExteriorTherm", | |
16 | "SyncShadow": true, | |
17 | "Id": "ExteriorTherm" | |
18 | }, | |
19 | { | |
20 | "CertificateArn": "arn:aws:iot:us-west-2:123456789012:cert/66a415ec415668c2349a76170b64ac0878231c1e21ec83c10e92a18bd568eb92", | |
21 | "ThingArn": "arn:aws:iot:us-west-2:123456789012:thing/InteriorTherm", | |
22 | "SyncShadow": true, | |
23 | "Id": "InteriorTherm" | |
24 | } | |
25 | ] | |
26 | }, | |
27 | "Version": "83c13984-6fed-447e-84d5-5b8aa45d5f71", | |
28 | "CreationTimestamp": "2019-09-11T00:15:09.838Z", | |
29 | "Id": "f9ba083d-5ad4-4534-9f86-026a45df1ccd", | |
30 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd/versions/83c13984-6fed-447e-84d5-5b8aa45d5f71" | |
31 | } |
0 | **To get a device definition** | |
1 | ||
2 | The following ``get-device-definition`` example displays the details for the specified device definition, including all associated device definition versions. :: | |
3 | ||
4 | aws greengrass get-device-definition \ | |
5 | --device-definition-id "f9ba083d-5ad4-4534-9f86-026a45df1ccd" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "LatestVersionArn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd/versions/83c13984-6fed-447e-84d5-5b8aa45d5f71", | |
11 | "Name": "TemperatureSensors", | |
12 | "tags": {}, | |
13 | "LastUpdatedTimestamp": "2019-09-11T00:19:03.698Z", | |
14 | "LatestVersion": "83c13984-6fed-447e-84d5-5b8aa45d5f71", | |
15 | "CreationTimestamp": "2019-09-11T00:11:06.197Z", | |
16 | "Id": "f9ba083d-5ad4-4534-9f86-026a45df1ccd", | |
17 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd" | |
18 | } |
0 | **To list the versions of a device definition** | |
1 | ||
2 | The following ``list-device-definition-versions`` example displays the device definition versions associated with the specified device definition. :: | |
3 | ||
4 | aws greengrass list-device-definition-versions \ | |
5 | --device-definition-id "f9ba083d-5ad4-4534-9f86-026a45df1ccd" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Versions": [ | |
11 | { | |
12 | "Version": "83c13984-6fed-447e-84d5-5b8aa45d5f71", | |
13 | "CreationTimestamp": "2019-09-11T00:15:09.838Z", | |
14 | "Id": "f9ba083d-5ad4-4534-9f86-026a45df1ccd", | |
15 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd/versions/83c13984-6fed-447e-84d5-5b8aa45d5f71" | |
16 | }, | |
17 | { | |
18 | "Version": "3b5cc510-58c1-44b5-9d98-4ad858ffa795", | |
19 | "CreationTimestamp": "2019-09-11T00:11:06.197Z", | |
20 | "Id": "f9ba083d-5ad4-4534-9f86-026a45df1ccd", | |
21 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd/versions/3b5cc510-58c1-44b5-9d98-4ad858ffa795" | |
22 | } | |
23 | ] | |
24 | } |
0 | **To list your device definitions** | |
1 | ||
2 | The following ``list-device-definitions`` example displays details about the device definitions in your AWS account in the specified AWS Region. :: | |
3 | ||
4 | aws greengrass list-device-definitions \ | |
5 | --region us-west-2 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Definitions": [ | |
11 | { | |
12 | "LatestVersionArn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/50f3274c-3f0a-4f57-b114-6f46085281ab/versions/c777b0f5-1059-449b-beaa-f003ebc56c34", | |
13 | "LastUpdatedTimestamp": "2019-06-14T15:42:09.059Z", | |
14 | "LatestVersion": "c777b0f5-1059-449b-beaa-f003ebc56c34", | |
15 | "CreationTimestamp": "2019-06-14T15:42:09.059Z", | |
16 | "Id": "50f3274c-3f0a-4f57-b114-6f46085281ab", | |
17 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/50f3274c-3f0a-4f57-b114-6f46085281ab" | |
18 | }, | |
19 | { | |
20 | "LatestVersionArn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/e01951c9-6134-479a-969a-1a15cac11c40/versions/514d57aa-4ee6-401c-9fac-938a9f7a51e5", | |
21 | "Name": "TestDeviceDefinition", | |
22 | "LastUpdatedTimestamp": "2019-04-16T23:17:43.245Z", | |
23 | "LatestVersion": "514d57aa-4ee6-401c-9fac-938a9f7a51e5", | |
24 | "CreationTimestamp": "2019-04-16T23:17:43.245Z", | |
25 | "Id": "e01951c9-6134-479a-969a-1a15cac11c40", | |
26 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/e01951c9-6134-479a-969a-1a15cac11c40" | |
27 | }, | |
28 | { | |
29 | "LatestVersionArn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd/versions/83c13984-6fed-447e-84d5-5b8aa45d5f71", | |
30 | "Name": "TemperatureSensors", | |
31 | "LastUpdatedTimestamp": "2019-09-10T00:19:03.698Z", | |
32 | "LatestVersion": "83c13984-6fed-447e-84d5-5b8aa45d5f71", | |
33 | "CreationTimestamp": "2019-09-11T00:11:06.197Z", | |
34 | "Id": "f9ba083d-5ad4-4534-9f86-026a45df1ccd", | |
35 | "Arn": "arn:aws:greengrass:us-west-2:123456789012:/greengrass/definition/devices/f9ba083d-5ad4-4534-9f86-026a45df1ccd" | |
36 | } | |
37 | ] | |
38 | } |
0 | **To update the connectivity information for a Greengrass core** | |
1 | ||
2 | The following ``update-connectivity-info`` example changes the endpoints that devices can use to connect to the specified Greengrass core. Connectivity information is a list of IP addresses or domain names, with corresponding port numbers and optional customer-defined metadata. You might need to update connectivity information when the local network changes. :: | |
3 | ||
4 | aws greengrass update-connectivity-info \ | |
5 | --thing-name "MyGroup_Core" \ | |
6 | --connectivity-info "[{\"Metadata\":\"\",\"PortNumber\":8883,\"HostAddress\":\"127.0.0.1\",\"Id\":\"localhost_127.0.0.1_0\"},{\"Metadata\":\"\",\"PortNumber\":8883,\"HostAddress\":\"192.168.1.3\",\"Id\":\"localIP_192.168.1.3\"}]" | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Version": "312de337-59af-4cf9-a278-2a23bd39c300" | |
12 | } |
0 | **To update a device definition** | |
1 | ||
2 | The following ``update-device-definition`` example changes the name of the specified device definition. You can only update the ``name`` property of a device definition. :: | |
3 | ||
4 | aws greengrass update-device-definition \ | |
5 | --device-definition-id "f9ba083d-5ad4-4534-9f86-026a45df1ccd" \ | |
6 | --name "TemperatureSensors" | |
7 | ||
8 | This command produces no output. |
0 | **To decode a authorization failure message** | |
1 | ||
2 | The following ``decode-authorization-message`` example decodes the message returned by the EC2 console when attempting to launch an instance without the required permissions. :: | |
3 | ||
4 | aws sts decode-authorization-message \ | |
5 | --encoded-message lxzA8VEjEvu-s0TTt3PgYCXik9YakOqsrFJGRZR98xNcyWAxwRq14xIvd-npzbgTevuufCTbjeBAaDARg9cbTK1rJbg3awM33o-Vy3ebPErE2-mWR9hVYdvX-0zKgVOWF9pWjZaJSMqxB-aLXo-I_8TTvBq88x8IFPbMArNdpu0IjxDjzf22PF3SOE3XvIQ-_PEO0aUqHCCcsSrFtvxm6yQD1nbm6VTIVrfa0Bzy8lsoMo7SjIaJ2r5vph6SY5vCCwg6o2JKe3hIHTa8zRrDbZSFMkcXOT6EOPkQXmaBsAC6ciG7Pz1JnEOvuj5NSTlSMljrAXczWuRKAs5GsMYiU8KZXZhokVzdQCUZkS5aVHumZbadu0io53jpgZqhMqvS4fyfK4auK0yKRMtS6JCXPlhkolEs7ZMFA0RVkutqhQqpSDPB5SX5l00lYipWyFK0_AyAx60vumPuVh8P0AzXwdFsT0l4D0m42NFIKxbWXsoJdqaOqVFyFEd0-Xx9AYAAIr6bhcis7C__bZh4dlAAWooHFGKgfoJcWGwgdzgbu9hWyVvKTpeot5hsb8qANYjJRCPXTKpi6PZfdijIkwb6gDMEsJ9qMtr62qP_989mwmtNgnVvBa_ir6oxJxVe_kL9SH1j5nsGDxQFajvPQhxWOHvEQIg_H0bnKWk | |
6 | ||
7 | The output is formatted as a single-line string of JSON text that you can parse with any JSON text processor:: | |
8 | ||
9 | { | |
10 | "DecodedMessage": "{\"allowed\":false,\"explicitDeny\":false,\"matchedStatements\":{\"items\":[]},\"failures\":{\"items\":[]},\"context\":{\"principal\":{\"id\":\"AIDAV3ZUEFP6J7GY7O6LO\",\"name\":\"chain-user\",\"arn\":\"arn:aws:iam::403299380220:user/chain-user\"},\"action\":\"ec2:RunInstances\",\"resource\":\"arn:aws:ec2:us-east-2:403299380220:instance/*\",\"conditions\":{\"items\":[{\"key\":\"ec2:InstanceMarketType\",\"values\":{\"items\":[{\"value\":\"on-demand\"}]}},{\"key\":\"aws:Resource\",\"values\":{\"items\":[{\"value\":\"instance/*\"}]}},{\"key\":\"aws:Account\",\"values\":{\"items\":[{\"value\":\"403299380220\"}]}},{\"key\":\"ec2:AvailabilityZone\",\"values\":{\"items\":[{\"value\":\"us-east-2b\"}]}},{\"key\":\"ec2:ebsOptimized\",\"values\":{\"items\":[{\"value\":\"false\"}]}},{\"key\":\"ec2:IsLaunchTemplateResource\",\"values\":{\"items\":[{\"value\":\"false\"}]}},{\"key\":\"ec2:InstanceType\",\"values\":{\"items\":[{\"value\":\"t2.micro\"}]}},{\"key\":\"ec2:RootDeviceType\",\"values\":{\"items\":[{\"value\":\"ebs\"}]}},{\"key\":\"aws:Region\",\"values\":{\"items\":[{\"value\":\"us-east-2\"}]}},{\"key\":\"aws:Service\",\"values\":{\"items\":[{\"value\":\"ec2\"}]}},{\"key\":\"ec2:InstanceID\",\"values\":{\"items\":[{\"value\":\"*\"}]}},{\"key\":\"aws:Type\",\"values\":{\"items\":[{\"value\":\"instance\"}]}},{\"key\":\"ec2:Tenancy\",\"values\":{\"items\":[{\"value\":\"default\"}]}},{\"key\":\"ec2:Region\",\"values\":{\"items\":[{\"value\":\"us-east-2\"}]}},{\"key\":\"aws:ARN\",\"values\":{\"items\":[{\"value\":\"arn:aws:ec2:us-east-2:403299380220:instance/*\"}]}}]}}}" | |
11 | } |
0 | **To create an OTA update for use with Amazon FreeRTOS** | |
1 | ||
2 | The following ``create-ota-update`` example creates an AWS IoT OTAUpdate on a target group of things or groups. This is part of an Amazon FreeRTOS over-the-air update which makes it possible for you to deploy new firmware images to a single device or a group of devices. :: | |
3 | ||
4 | aws iot create-ota-update \ | |
5 | --cli-input-json file://create-ota-update.json | |
6 | ||
7 | Contents of ``create-ota-update.json``:: | |
8 | ||
9 | { | |
10 | "otaUpdateId": "ota12345", | |
11 | "description": "A critical update needed right away.", | |
12 | "targets": [ | |
13 | "device1", | |
14 | "device2", | |
15 | "device3", | |
16 | "device4" | |
17 | ], | |
18 | "targetSelection": "SNAPSHOT", | |
19 | "awsJobExecutionsRolloutConfig": { | |
20 | "maximumPerMinute": 10 | |
21 | }, | |
22 | "files": [ | |
23 | { | |
24 | "fileName": "firmware.bin", | |
25 | "fileLocation": { | |
26 | "stream": { | |
27 | "streamId": "004", | |
28 | "fileId":123 | |
29 | } | |
30 | }, | |
31 | "codeSigning": { | |
32 | "awsSignerJobId": "48c67f3c-63bb-4f92-a98a-4ee0fbc2bef6" | |
33 | } | |
34 | } | |
35 | ] | |
36 | "roleArn": "arn:aws:iam:123456789012:role/service-role/my_ota_role" | |
37 | } | |
38 | ||
39 | Output:: | |
40 | ||
41 | { | |
42 | "otaUpdateId": "ota12345", | |
43 | "awsIotJobId": "job54321", | |
44 | "otaUpdateArn": "arn:aws:iot:us-west-2:123456789012:otaupdate/itsaupdate", | |
45 | "awsIotJobArn": "arn:aws:iot:us-west-2:123456789012:job/itsajob", | |
46 | "otaUpdateStatus": "CREATE_IN_PROGRESS" | |
47 | } | |
48 | ||
49 | For more information, see `CreateOTAUpdate <https://docs.aws.amazon.com/iot/latest/apireference/API_CreateOTAUpdate.html>`__ in the *AWS IoT API Reference*. |
0 | **To create a stream for delivering one or more large files in chunks over MQTT** | |
1 | ||
2 | The following ``create-stream`` example creates a stream for delivering one or more large files in chunks over MQTT. A stream transports data bytes in chunks or blocks packaged as MQTT messages from a source like S3. You can have one or more files associated with a stream. :: | |
3 | ||
4 | aws iot create-stream \ | |
5 | --cli-input-json file://create-stream.json | |
6 | ||
7 | Contents of ``create-stream.json``:: | |
8 | ||
9 | { | |
10 | "streamId": "stream12345", | |
11 | "description": "This stream is used for Amazon FreeRTOS OTA Update 12345.", | |
12 | "files": [ | |
13 | { | |
14 | "fileId": 123, | |
15 | "s3Location": { | |
16 | "bucket":"codesign-ota-bucket", | |
17 | "key":"48c67f3c-63bb-4f92-a98a-4ee0fbc2bef6" | |
18 | } | |
19 | } | |
20 | ] | |
21 | "roleArn": "arn:aws:iam:123456789012:role/service-role/my_ota_stream_role" | |
22 | } | |
23 | ||
24 | Output:: | |
25 | ||
26 | { | |
27 | "streamId": "stream12345", | |
28 | "streamArn": "arn:aws:iot:us-west-2:123456789012:stream/stream12345", | |
29 | "description": "This stream is used for Amazon FreeRTOS OTA Update 12345.", | |
30 | "streamVersion": "1" | |
31 | } | |
32 | ||
33 | For more information, see `CreateStream <https://docs.aws.amazon.com/iot/latest/apireference/API_CreateStream.html>`__ in the *AWS IoT API Reference*. |
0 | **To delete an OTA update** | |
1 | ||
2 | The following ``delete-ota-update`` example deletes the specified OTA update. :: | |
3 | ||
4 | aws iot delete-ota-update \ | |
5 | --ota-update-id ota12345 \ | |
6 | --delete-stream \ | |
7 | --force-delete-aws-job | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `DeleteOTAUpdate <https://docs.aws.amazon.com/iot/latest/apireference/API_DeleteOTAUpdate.html>`__ in the *AWS IoT API Reference*. |
0 | **To delete a stream** | |
1 | ||
2 | The following ``delete-stream`` example deletes the specified stream. :: | |
3 | ||
4 | aws iot delete-stream \ | |
5 | --stream-id stream12345 | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `DeleteStream <https://docs.aws.amazon.com/iot/latest/apireference/API_DeleteStream.html>`__ in the *AWS IoT API Reference*. |
13 | 13 | |
14 | 14 | **Example 2: To get your ATS endpoint** |
15 | 15 | |
16 | The following ``describe-endpoint`` example gets the Amazon Trust Services (ATS) endpoint. :: | |
16 | The following ``describe-endpoint`` example retrieves the Amazon Trust Services (ATS) endpoint. :: | |
17 | 17 | |
18 | aws iot describe-endpoint --endpoint-type:Data-ATS | |
18 | aws iot describe-endpoint \ | |
19 | --endpoint-type iot:Data-ATS | |
19 | 20 | |
20 | 21 | Output:: |
21 | 22 |
0 | **To get information about a stream** | |
1 | ||
2 | The following ``describe-stream`` example displays the details about the specified stream. :: | |
3 | ||
4 | aws iot describe-stream \ | |
5 | --stream-id stream12345 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "streamInfo": { | |
11 | "streamId": "stream12345", | |
12 | "streamArn": "arn:aws:iot:us-west-2:123456789012:stream/stream12345", | |
13 | "streamVersion": 1, | |
14 | "description": "This stream is used for Amazon FreeRTOS OTA Update 12345.", | |
15 | "files": [ | |
16 | { | |
17 | "fileId": "123", | |
18 | "s3Location": { | |
19 | "bucket":"codesign-ota-bucket", | |
20 | "key":"48c67f3c-63bb-4f92-a98a-4ee0fbc2bef6" | |
21 | } | |
22 | } | |
23 | ], | |
24 | "createdAt": 1557863215.995, | |
25 | "lastUpdatedAt": 1557863215.995, | |
26 | "roleArn": "arn:aws:iam:123456789012:role/service-role/my_ota_stream_role" | |
27 | } | |
28 | } | |
29 | ||
30 | For more information, see `DescribeStream <https://docs.aws.amazon.com/iot/latest/apireference/API_DescribeStream.html>`__ in the *AWS IoT API Reference*. |
0 | **To retrieve information about an OTA Update** | |
1 | ||
2 | The following ``get-ota-update`` example displays details about the specified OTA Update. :: | |
3 | ||
4 | aws iot get-ota-update \ | |
5 | --ota-update-id ota12345 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "otaUpdateInfo": { | |
11 | "otaUpdateId": "ota12345", | |
12 | "otaUpdateArn": "arn:aws:iot:us-west-2:123456789012:otaupdate/itsaupdate", | |
13 | "creationDate": 1557863215.995, | |
14 | "lastModifiedDate": 1557863215.995, | |
15 | "description": "A critical update needed right away.", | |
16 | "targets": [ | |
17 | "device1", | |
18 | "device2", | |
19 | "device3", | |
20 | "device4" | |
21 | ], | |
22 | "targetSelection": "SNAPSHOT", | |
23 | "awsJobExecutionsRolloutConfig": { | |
24 | "maximumPerMinute": 10 | |
25 | }, | |
26 | "otaUpdateFiles": [ | |
27 | { | |
28 | "fileName": "firmware.bin", | |
29 | "fileLocation": { | |
30 | "stream": { | |
31 | "streamId": "004", | |
32 | "fileId":123 | |
33 | } | |
34 | }, | |
35 | "codeSigning": { | |
36 | "awsSignerJobId": "48c67f3c-63bb-4f92-a98a-4ee0fbc2bef6" | |
37 | } | |
38 | } | |
39 | ], | |
40 | "roleArn": "arn:aws:iam:123456789012:role/service-role/my_ota_role" | |
41 | "otaUpdateStatus": "CREATE_COMPLETE", | |
42 | "awsIotJobId": "job54321", | |
43 | "awsIotJobArn": "arn:aws:iot:us-west-2:123456789012:job/job54321", | |
44 | "errorInfo": { | |
45 | } | |
46 | } | |
47 | } | |
48 | ||
49 | For more information, see `GetOTAUpdate <https://docs.aws.amazon.com/iot/latest/apireference/API_GetOTAUpdate.html>`__ in the *AWS IoT API Reference*. |
0 | **To list OTA Updates for the account** | |
1 | ||
2 | The following ``list-ota-updates`` example lists the available OTA updates. :: | |
3 | ||
4 | aws iot list-ota-updates | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "otaUpdates": [ | |
10 | { | |
11 | "otaUpdateId": "itsaupdate", | |
12 | "otaUpdateArn": "arn:aws:iot:us-west-2:123456789012:otaupdate/itsaupdate", | |
13 | "creationDate": 1557863215.995 | |
14 | } | |
15 | ] | |
16 | } | |
17 | ||
18 | For more information, see `ListOTAUpdates <https://docs.aws.amazon.com/iot/latest/apireference/API_ListOTAUpdates.html>`__ in the *AWS IoT API Reference*. |
0 | **To list the streams in the account** | |
1 | ||
2 | The following ``list-streams`` example lists all of the streams in your AWS account. :: | |
3 | ||
4 | aws iot list-streams | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "streams": [ | |
10 | { | |
11 | "streamId": "stream12345", | |
12 | "streamArn": "arn:aws:iot:us-west-2:123456789012:stream/stream12345", | |
13 | "streamVersion": 1, | |
14 | "description": "This stream is used for Amazon FreeRTOS OTA Update 12345." | |
15 | }, | |
16 | { | |
17 | "streamId": "stream54321", | |
18 | "streamArn": "arn:aws:iot:us-west-2:123456789012:stream/stream54321", | |
19 | "streamVersion": 1, | |
20 | "description": "This stream is used for Amazon FreeRTOS OTA Update 54321." | |
21 | } | |
22 | ] | |
23 | } | |
24 | ||
25 | For more information, see `ListStreams <https://docs.aws.amazon.com/iot/latest/apireference/API_ListStreams.html>`__ in the *AWS IoT API Reference*. |
0 | **To update a stream** | |
1 | ||
2 | The following ``update-stream`` example updates an existing stream. The stream version is incremented by one. :: | |
3 | ||
4 | aws iot update-stream \ | |
5 | --cli-input-json file://update-stream.json | |
6 | ||
7 | Contents of ``update-stream.json``:: | |
8 | ||
9 | { | |
10 | "streamId": "stream12345", | |
11 | "description": "This stream is used for Amazon FreeRTOS OTA Update 12345.", | |
12 | "files": [ | |
13 | { | |
14 | "fileId": 123, | |
15 | "s3Location": { | |
16 | "bucket":"codesign-ota-bucket", | |
17 | "key":"48c67f3c-63bb-4f92-a98a-4ee0fbc2bef6" | |
18 | } | |
19 | } | |
20 | ] | |
21 | "roleArn": "arn:aws:iam:us-west-2:123456789012:role/service-role/my_ota_stream_role" | |
22 | } | |
23 | ||
24 | Output:: | |
25 | ||
26 | { | |
27 | "streamId": "stream12345", | |
28 | "streamArn": "arn:aws:iot:us-west-2:123456789012:stream/stream12345", | |
29 | "description": "This stream is used for Amazon FreeRTOS OTA Update 12345.", | |
30 | "streamVersion": 2 | |
31 | } | |
32 | ||
33 | For more information, see `UpdateStream <https://docs.aws.amazon.com/iot/latest/apireference/API_UpdateStream.html>`__ in the *AWS IoT API Reference*. |
0 | **To get the current state of a device shadow** | |
0 | **To get a thing shadow document** | |
1 | 1 | |
2 | The following ``get-thing-shadow`` example gets the current state of the device shadow for the thing named ``MyRPi`` and saves it to the file ``output.txt``. :: | |
2 | The following ``get-thing-shadow`` example gets the thing shadow document for the specified IoT thing. :: | |
3 | 3 | |
4 | 4 | aws iot-data get-thing-shadow \ |
5 | 5 | --thing-name MyRPi \ |
6 | "output.txt" | |
6 | output.txt | |
7 | 7 | |
8 | The command produces no output on the display, but the following shows the contents of output.txt:: | |
8 | The command produces no output on the display, but the following shows the contents of ``output.txt``:: | |
9 | 9 | |
10 | {"state":{"reported":{"moisture":"low"}},"metadata":{"reported":{"moisture":{"timestamp":1560269319}}},"version":1,"timestamp":1560269405} | |
10 | { | |
11 | "state":{ | |
12 | "reported":{ | |
13 | "moisture":"low" | |
14 | } | |
15 | }, | |
16 | "metadata":{ | |
17 | "reported":{ | |
18 | "moisture":{ | |
19 | "timestamp":1560269319 | |
20 | } | |
21 | } | |
22 | }, | |
23 | "version":1,"timestamp":1560269405 | |
24 | } | |
11 | 25 | |
12 | 26 | For more information, see `Device Shadow Service Data Flow <https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-data-flow.html>`__ in the *AWS IoT Developers Guide*. |
13 |
0 | **To get the current state of a device shadow** | |
0 | **To update a thing shadow** | |
1 | 1 | |
2 | The following ``get-thing-shadow`` example gets the current state of the device shadow for the thing named ``MyRPi`` and saves it to the file ``output.txt``. :: | |
2 | The following ``update-thing-shadow`` example modifies the current state of the device shadow for the specified thing and saves it to the file ``output.txt``. :: | |
3 | 3 | |
4 | aws iot-data get-thing-shadow \ | |
4 | aws iot-data update-thing-shadow \ | |
5 | 5 | --thing-name MyRPi \ |
6 | --payload "{"state":{"reported":{"moisture":"okay"}}}" \ | |
6 | 7 | "output.txt" |
7 | 8 | |
8 | The command produces no output on the display, but the following shows the contents of output.txt:: | |
9 | The command produces no output on the display, but the following shows the contents of ``output.txt``:: | |
9 | 10 | |
10 | {"state":{"reported":{"moisture":"low"}},"metadata":{"reported":{"moisture":{"timestamp":1560269319}}},"version":1,"timestamp":1560269405} | |
11 | { | |
12 | "state": { | |
13 | "reported": { | |
14 | "moisture": "okay" | |
15 | } | |
16 | }, | |
17 | "metadata": { | |
18 | "reported": { | |
19 | "moisture": { | |
20 | "timestamp": 1560270036 | |
21 | } | |
22 | } | |
23 | }, | |
24 | "version": 2, | |
25 | "timestamp": 1560270036 | |
26 | } | |
11 | 27 | |
12 | 28 | For more information, see `Device Shadow Service Data Flow <https://docs.aws.amazon.com/iot/latest/developerguide/device-shadow-data-flow.html>`__ in the *AWS IoT Developers Guide*. |
13 |
0 | **To get the details of a job execution** | |
1 | ||
2 | The following ``describe-job-execution`` example retrieves the details of the latest execution of the specified job and thing. :: | |
3 | ||
4 | aws iot-jobs-data describe-job-execution \ | |
5 | --job-id SampleJob \ | |
6 | --thing-name MotionSensor1 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "execution": { | |
12 | "approximateSecondsBeforeTimedOut": 88, | |
13 | "executionNumber": 2939653338, | |
14 | "jobId": "SampleJob", | |
15 | "lastUpdatedAt": 1567701875.743, | |
16 | "queuedAt": 1567701902.444, | |
17 | "status": "QUEUED", | |
18 | "thingName": "MotionSensor1 ", | |
19 | "versionNumber": 3 | |
20 | } | |
21 | } | |
22 | ||
23 | For more information, see `Devices and Jobs <https://docs.aws.amazon.com/iot/latest/developerguide/jobs-devices.html>`__ in the *AWS IoT Developer Guide*. |
0 | **To get a list of all jobs that are not in a terminal status for a thing** | |
1 | ||
2 | The following ``get-pending-job-executions`` example displays a list of all jobs that aren't in a terminal state for the specified thing. :: | |
3 | ||
4 | aws iot-jobs-data get-pending-job-executions \ | |
5 | --thing-name MotionSensor1 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "inProgressJobs": [ | |
11 | ], | |
12 | "queuedJobs": [ | |
13 | { | |
14 | "executionNumber": 2939653338, | |
15 | "jobId": "SampleJob", | |
16 | "lastUpdatedAt": 1567701875.743, | |
17 | "queuedAt": 1567701902.444, | |
18 | "versionNumber": 3 | |
19 | } | |
20 | ] | |
21 | } | |
22 | ||
23 | For more information, see `Devices and Jobs <https://docs.aws.amazon.com/iot/latest/developerguide/jobs-devices.html>`__ in the *AWS IoT Developer Guide*. |
0 | **To get and start the next pending job execution for a thing** | |
1 | ||
2 | The following ``start-next-pending-job-execution`` example retrieves and starts the next job execution whose status is `IN_PROGRESS` or `QUEUED` for the specified thing. :: | |
3 | ||
4 | aws iot-jobs-data start-next-pending-job-execution \ | |
5 | --thing-name MotionSensor1 | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "execution": { | |
12 | "approximateSecondsBeforeTimedOut": 88, | |
13 | "executionNumber": 2939653338, | |
14 | "jobId": "SampleJob", | |
15 | "lastUpdatedAt": 1567714853.743, | |
16 | "queuedAt": 1567701902.444, | |
17 | "startedAt": 1567714871.690, | |
18 | "status": "IN_PROGRESS", | |
19 | "thingName": "MotionSensor1 ", | |
20 | "versionNumber": 3 | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Devices and Jobs <https://docs.aws.amazon.com/iot/latest/developerguide/jobs-devices.html>`__ in the *AWS IoT Developer Guide*. |
0 | **To update the status of a job execution** | |
1 | ||
2 | The following ``update-job-execution`` example updates the status of the specified job and thing. :: | |
3 | ||
4 | aws iot-jobs-data update-job-execution \ | |
5 | --job-id SampleJob \ | |
6 | --thing-name MotionSensor1 \ | |
7 | --status REMOVED | |
8 | ||
9 | This command produces no output. | |
10 | Output:: | |
11 | ||
12 | { | |
13 | "executionState": { | |
14 | "status": "REMOVED", | |
15 | "versionNumber": 3 | |
16 | }, | |
17 | } | |
18 | ||
19 | For more information, see `Devices and Jobs <https://docs.aws.amazon.com/iot/latest/developerguide/jobs-devices.html>`__ in the *AWS IoT Developer Guide*. |
0 | **To list the available methods for a device** | |
1 | ||
2 | The following ``get-device-methods`` example lists the available methods for a device. :: | |
3 | ||
4 | aws iot1click-devices get-device-methods \ | |
5 | --device-id G030PM0123456789 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "DeviceMethods": [ | |
11 | { | |
12 | "MethodName": "getDeviceHealthParameters" | |
13 | }, | |
14 | { | |
15 | "MethodName": "setDeviceHealthMonitorCallback" | |
16 | }, | |
17 | { | |
18 | "MethodName": "getDeviceHealthMonitorCallback" | |
19 | }, | |
20 | { | |
21 | "MethodName": "setOnClickCallback" | |
22 | }, | |
23 | { | |
24 | "MethodName": "getOnClickCallback" | |
25 | } | |
26 | ] | |
27 | } | |
28 | ||
29 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To invoke a device method on a device** | |
1 | ||
2 | The following ``invoke-device-method`` example invokes the specified method on a device. :: | |
3 | ||
4 | aws iot1click-devices invoke-device-method \ | |
5 | --cli-input-json file://invoke-device-method.json | |
6 | ||
7 | Contents of ``invoke-device-method.json``:: | |
8 | ||
9 | { | |
10 | "DeviceId": "G030PM0123456789", | |
11 | "DeviceMethod": { | |
12 | "DeviceType": "device", | |
13 | "MethodName": "getDeviceHealthParameters" | |
14 | } | |
15 | } | |
16 | ||
17 | Output:: | |
18 | ||
19 | { | |
20 | "DeviceMethodResponse": "{\"remainingLife\": 99.8}" | |
21 | } | |
22 | ||
23 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To list a device's events for a specified time range** | |
1 | ||
2 | The following ``list-device-events`` example lists the specified device's events for the specified time range. :: | |
3 | ||
4 | aws iot1click-devices list-device-events \ | |
5 | --device-id G030PM0123456789 \ | |
6 | --from-time-stamp 2019-07-17T15:45:12.880Z --to-time-stamp 2019-07-19T15:45:12.880Z | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Events": [ | |
12 | { | |
13 | "Device": { | |
14 | "Attributes": {}, | |
15 | "DeviceId": "G030PM0123456789", | |
16 | "Type": "button" | |
17 | }, | |
18 | "StdEvent": "{\"clickType\": \"SINGLE\", \"reportedTime\": \"2019-07-18T23:47:55.015Z\", \"certificateId\": \"fe8798a6c97c62ef8756b80eeefdcf2280f3352f82faa8080c74cc4f4a4d1811\", \"remainingLife\": 99.85000000000001, \"testMode\": false}" | |
19 | }, | |
20 | { | |
21 | "Device": { | |
22 | "Attributes": {}, | |
23 | "DeviceId": "G030PM0123456789", | |
24 | "Type": "button" | |
25 | }, | |
26 | "StdEvent": "{\"clickType\": \"DOUBLE\", \"reportedTime\": \"2019-07-19T00:14:41.353Z\", \"certificateId\": \"fe8798a6c97c62ef8756b80eeefdcf2280f3352f82faa8080c74cc4f4a4d1811\", \"remainingLife\": 99.8, \"testMode\": false}" | |
27 | } | |
28 | ] | |
29 | } | |
30 | ||
31 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To list the tags for a device** | |
1 | ||
2 | The following ``list-tags-for-resource`` example list the tags for the specified device. :: | |
3 | ||
4 | aws iot1click-devices list-tags-for-resource \ | |
5 | --resource-arn "arn:aws:iot1click:us-west-2:012345678901:devices/G030PM0123456789" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Tags": { | |
11 | "Driver Phone": "123-555-0199", | |
12 | "Driver": "Jorge Souza" | |
13 | } | |
14 | } | |
15 | ||
16 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To add tags to a device AWS resource** | |
1 | ||
2 | The following ``tag-resource`` example adds two tags to the specified resource. :: | |
3 | ||
4 | aws iot1click-devices tag-resource \ | |
5 | --cli-input-json file://devices-tag-resource.json | |
6 | ||
7 | Contents of ``devices-tag-resource.json``:: | |
8 | ||
9 | { | |
10 | "ResourceArn": "arn:aws:iot1click:us-west-2:123456789012:devices/G030PM0123456789", | |
11 | "Tags": { | |
12 | "Driver": "Jorge Souza", | |
13 | "Driver Phone": "123-555-0199" | |
14 | } | |
15 | } | |
16 | ||
17 | This command produces no output. | |
18 | ||
19 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To unclaim (deregister) a device from your AWS account** | |
1 | ||
2 | The following ``unclaim-device`` example unclaims (deregisters) the specified device from your AWS account. :: | |
3 | ||
4 | aws iot1click-devices unclaim-device \ | |
5 | --device-id G030PM0123456789 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "State": "UNCLAIMED" | |
11 | } | |
12 | ||
13 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To remove tags from a device AWS resource** | |
1 | ||
2 | The following ``untag-resource`` example removes the tags with the names ``Driver Phone`` and ``Driver`` from the specified device resource. :: | |
3 | ||
4 | aws iot1click-devices untag-resource \ | |
5 | --resource-arn "arn:aws:iot1click:us-west-2:123456789012:projects/AnytownDumpsters" \ | |
6 | --tag-keys "Driver Phone" "Driver" | |
7 | ||
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To update the ``enabled`` state for a device** | |
1 | ||
2 | The following ``update-device-state`` sets the state of the specified device to ``enabled``. :: | |
3 | ||
4 | aws iot1click-devices update-device-state \ | |
5 | --device-id G030PM0123456789 \ | |
6 | --enabled | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To delete a placement from a project** | |
1 | ||
2 | The following ``delete-placement`` example deletes the specified placement from a project. :: | |
3 | ||
4 | aws iot1click-projects delete-placement \ | |
5 | --project-name AnytownDumpsters \ | |
6 | --placement-name customer217 | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To delete a project from your AWS account** | |
1 | ||
2 | The following ``delete-project`` example deletes the specified project from your AWS account. :: | |
3 | ||
4 | aws iot1click-projects delete-project \ | |
5 | --project-name AnytownDumpsters | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To disassociate a device from a placement** | |
1 | ||
2 | The following ``disassociate-device-from-placement`` example disassociates the specified device from a placement. :: | |
3 | ||
4 | aws iot1click-projects disassociate-device-from-placement \ | |
5 | --project-name AnytownDumpsters \ | |
6 | --placement-name customer217 \ | |
7 | --device-template-name empty-dumpster-request | |
8 | ||
9 | This command produces no output. | |
10 | ||
11 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To list the tags for a project resource** | |
1 | ||
2 | The following ``list-tags-for-resource`` example list the tags for the specified project resource. :: | |
3 | ||
4 | aws iot1click-projects list-tags-for-resource \ | |
5 | --resource-arn "arn:aws:iot1click:us-west-2:123456789012:projects/AnytownDumpsters" | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "tags": { | |
11 | "Manager": "Li Juan", | |
12 | "Account": "45215" | |
13 | } | |
14 | } | |
15 | ||
16 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To add tags to a project resource** | |
1 | ||
2 | The following ``tag-resource`` example adds two tags to the specified project resource. :: | |
3 | ||
4 | aws iot1click-projects tag-resource \ | |
5 | --cli-input-json file://devices-tag-resource.json | |
6 | ||
7 | Contents of ``devices-tag-resource.json``:: | |
8 | ||
9 | { | |
10 | "resourceArn": "arn:aws:iot1click:us-west-2:123456789012:projects/AnytownDumpsters", | |
11 | "tags": { | |
12 | "Account": "45215", | |
13 | "Manager": "Li Juan" | |
14 | } | |
15 | } | |
16 | ||
17 | This command produces no output. | |
18 | ||
19 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To remove tags from a project resource** | |
1 | ||
2 | The following ``untag-resource`` example removes the tag with the key name ``Manager`` from the specified project. :: | |
3 | ||
4 | aws iot1click-projects untag-resource \ | |
5 | --resource-arn "arn:aws:iot1click:us-west-2:123456789012:projects/AnytownDumpsters" \ | |
6 | --tag-keys "Manager" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To update the "attributes" key-value pairs of a placement** | |
1 | ||
2 | The following ``update-placement`` example update the "attributes" key-value pairs of a placement. :: | |
3 | ||
4 | aws iot1click-projects update-placement \ | |
5 | --cli-input-json file://update-placement.json | |
6 | ||
7 | Contents of ``update-placement.json``:: | |
8 | ||
9 | { | |
10 | "projectName": "AnytownDumpsters", | |
11 | "placementName": "customer217", | |
12 | "attributes": { | |
13 | "phone": "123-456-7890", | |
14 | "location": "123 Any Street Anytown, USA 10001" | |
15 | } | |
16 | } | |
17 | ||
18 | This command produces no output. | |
19 | ||
20 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To update settings for a project** | |
1 | ||
2 | The following ``update-project`` example updates the description for a project. :: | |
3 | ||
4 | aws iot1click-projects update-project \ | |
5 | --project-name AnytownDumpsters \ | |
6 | --description "All dumpsters (yard waste, recycling, garbage) in the Anytown region." | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Using AWS IoT 1-Click with the AWS CLI <https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-cli.html>`__ in the *AWS IoT 1-Click Developer Guide*. |
0 | **To cancel the scheduled deletion of a customer managed CMK** | |
1 | ||
2 | The following ``cancel-key-deletion`` example cancels the scheduled deletion of a customer managed CMK and re-enables the CMK so you can use it in cryptographic operations. | |
3 | ||
4 | The first command in the example uses the ``cancel-key-deletion`` command to cancel the scheduled deletion of the CMK. It uses the ``--key-id`` parameter to identify the CMK. This example uses a key ID value, but you can use either the key ID or the key ARN of the CMK. | |
5 | ||
6 | ||
7 | To re-enable the CMK, use the ``enable-key`` command. To identify the CMK, use the ``--key-id`` parameter. This example uses a key ID value, but you can use either the key ID or the key ARN of the CMK. :: | |
8 | ||
9 | aws kms cancel-key-deletion \ | |
10 | --key-id 1234abcd-12ab-34cd-56ef-1234567890ab | |
11 | ||
12 | The ``cancel-key-deletion`` response returns the key ARN of the CMK whose deletion was canceled. :: | |
13 | ||
14 | { | |
15 | "KeyId": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab" | |
16 | } | |
17 | ||
18 | When the ``cancel-key-deletion`` command succeeds, the scheduled deletion is canceled. However, the key state of the CMK is ``Disabled``, so you can't use the CMK in cryptographic operations. To restore its functionality, you must re-enable the CMK. :: | |
19 | ||
20 | aws kms enable-key \ | |
21 | --key-id 1234abcd-12ab-34cd-56ef-1234567890ab | |
22 | ||
23 | The ``enable-key`` operation does not return a response. To verify that the CMK is re-enabled and there is no deletion date associated with the CMK, use the ``describe-key`` operation. | |
24 | ||
25 | For more information, see `Scheduling and Canceling Key Deletion <https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html#deleting-keys-scheduling-key-deletion>`__ in the *AWS Key Management Service Developer Guide*. |
0 | The following command creates an alias named ``example-alias`` for the customer master key (CMK) identified by key ID ``1234abcd-12ab-34cd-56ef-1234567890ab``. | |
0 | **To create an alias for a CMK** | |
1 | 1 | |
2 | .. code:: | |
2 | The following ``create-alias`` command creates an alias named ``example-alias`` for the customer master key (CMK) identified by key ID ``1234abcd-12ab-34cd-56ef-1234567890ab``. | |
3 | 3 | |
4 | aws kms create-alias --alias-name alias/example-alias --target-key-id 1234abcd-12ab-34cd-56ef-1234567890ab | |
4 | Alias names must begin with ``alias/``. Do not use alias names that begin with ``alias/aws``; these are reserved for use by AWS. :: | |
5 | 5 | |
6 | Alias names must begin with ``alias/``. Do not use alias names that begin with ``alias/aws``; these are reserved for use by AWS.⏎ | |
6 | aws kms create-alias \ | |
7 | --alias-name alias/example-alias \ | |
8 | --target-key-id 1234abcd-12ab-34cd-56ef-1234567890ab |
0 | **To create a customer managed CMK in AWS KMS** | |
1 | ||
2 | The following ``create-key`` example creates a customer managed CMK. | |
3 | ||
4 | * The ``--tags`` parameter uses shorthand syntax to add a tag with a key name ``Purpose`` and value of ``Test``. For information about using shorthand syntax, see `Using Shorthand Syntax with the AWS Command Line Interface <https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-shorthand.html>`__ in the *AWS CLI User Guide*. | |
5 | * The ``--description parameter`` adds an optional description. | |
6 | ||
7 | Because this doesn't specify a policy, the CMK gets the `default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default>__. To view the key policy, use the ``get-key-policy`` command. To change the key policy, use the ``put-key-policy`` command. :: | |
8 | ||
9 | aws kms create-key \ | |
10 | --tags TagKey=Purpose,TagValue=Test \ | |
11 | --description "Development test key" | |
12 | ||
13 | The ``create-key`` command returns the key metadata, including the key ID and ARN of the new CMK. You can use these values to identify the CMK to other AWS KMS operations. The output does not include the tags. To view the tags for a CMK, use the ``list-resource-tags command``. :: | |
14 | ||
15 | { | |
16 | "KeyMetadata": { | |
17 | "AWSAccountId": "123456789012", | |
18 | "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", | |
19 | "Arn": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab", | |
20 | "CreationDate": 1566160362.664, | |
21 | "Enabled": true, | |
22 | "Description": "Development test key", | |
23 | "KeyUsage": "ENCRYPT_DECRYPT", | |
24 | "KeyState": "Enabled", | |
25 | "Origin": "AWS_KMS", | |
26 | "KeyManager": "CUSTOMER" | |
27 | } | |
28 | } | |
29 | ||
30 | Note: The ``create-key`` command does not let you specify an alias, To create an alias that points to the new CMK, use the ``create-alias`` command. | |
31 | ||
32 | For more information, see `Creating Keys <https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html>`__ in the *AWS Key Management Service Developer Guide*. |
0 | The following command demonstrates the recommended way to decrypt data with the AWS CLI. | |
0 | **Example 1: To decrypt an encrypted file** | |
1 | 1 | |
2 | .. code:: | |
2 | The following ``decrypt`` command demonstrates the recommended way to decrypt data with the AWS CLI. :: | |
3 | 3 | |
4 | aws kms decrypt --ciphertext-blob fileb://ExampleEncryptedFile --output text --query Plaintext | base64 --decode > ExamplePlaintextFile | |
4 | aws kms decrypt \ | |
5 | --ciphertext-blob fileb://ExampleEncryptedFile \ | |
6 | --output text \ | |
7 | --query Plaintext | base64 --decode > ExamplePlaintextFile | |
5 | 8 | |
6 | 9 | The command does several things: |
7 | 10 | |
25 | 28 | |
26 | 29 | The final part of the command (``> ExamplePlaintextFile``) saves the binary plaintext data to a file. |
27 | 30 | |
28 | **Example: Using the AWS CLI to decrypt data from the Windows command prompt** | |
31 | **Example 2: Using the AWS CLI to decrypt data from the Windows command prompt** | |
29 | 32 | |
30 | 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. | |
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. :: | |
31 | 34 | |
32 | .. code:: | |
35 | aws kms decrypt \ | |
36 | --ciphertext-blob fileb://ExampleEncryptedFile \ | |
37 | --output text \ | |
38 | --query Plaintext > ExamplePlaintextFile.base64 | |
33 | 39 | |
34 | aws kms decrypt --ciphertext-blob fileb://ExampleEncryptedFile --output text --query Plaintext > ExamplePlaintextFile.base64 | |
35 | ||
36 | .. code:: | |
37 | ||
38 | certutil -decode ExamplePlaintextFile.base64 ExamplePlaintextFile⏎ | |
40 | certutil -decode ExamplePlaintextFile.base64 ExamplePlaintextFile |
0 | **To delete an AWS KMS alias** | |
1 | ||
2 | The following ``delete-alias`` example deletes the alias ``alias/example-alias``. | |
3 | ||
4 | * The ``--alias-name`` parameter specifies the alias to delete. The alias name must begin with `alias/`. :: | |
5 | ||
6 | aws kms delete-alias \ | |
7 | --alias-name alias/example-alias | |
8 | ||
9 | This command produces no output. To find the alias, use the ``list-aliases`` command. | |
10 | ||
11 | For more information, see `Working with Aliases <https://docs.aws.amazon.com/kms/latest/developerguide/programming-aliases.html>`__ in the *AWS Key Management Service Developer Guide*. |
0 | **To find detailed information about a customer master key (CMK)** | |
1 | ||
2 | The following ``describe-key`` example retrieves detailed information about the AWS managed CMK for Amazon S3. | |
3 | ||
4 | This example uses an alias name value for the ``--key-id`` parameter, but you can use a key ID, key ARN, alias name, or alias ARN in this command. :: | |
5 | ||
6 | aws kms describe-key --key-id alias/aws/s3 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "KeyMetadata": { | |
12 | "Description": "Default master key that protects my S3 objects when no other key is defined", | |
13 | "Arn": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab", | |
14 | "KeyState": "Enabled", | |
15 | "Origin": "AWS_KMS", | |
16 | "KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", | |
17 | "KeyUsage": "ENCRYPT_DECRYPT", | |
18 | "AWSAccountId": "123456789012", | |
19 | "Enabled": true, | |
20 | "KeyManager": "AWS", | |
21 | "CreationDate": 1566518783.394 | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Viewing Keys<https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html>`__ in the *AWS Key Management Service Developer Guide*.⏎ |
0 | The following command demonstrates the recommended way to encrypt data with the AWS CLI. | |
0 | **Example 1: To encrypt the contents of a file on Linux or MacOS** | |
1 | 1 | |
2 | .. code:: | |
2 | The following ``encrypt`` command demonstrates the recommended way to encrypt data with the AWS CLI. :: | |
3 | 3 | |
4 | aws kms encrypt --key-id 1234abcd-12ab-34cd-56ef-1234567890ab --plaintext fileb://ExamplePlaintextFile --output text --query CiphertextBlob | base64 --decode > ExampleEncryptedFile | |
4 | aws kms encrypt \ | |
5 | --key-id 1234abcd-12ab-34cd-56ef-1234567890ab \ | |
6 | --plaintext fileb://ExamplePlaintextFile \ | |
7 | --output text \ | |
8 | --query CiphertextBlob | base64 \ | |
9 | --decode > ExampleEncryptedFile | |
5 | 10 | |
6 | 11 | The command does several things: |
7 | 12 | |
9 | 14 | |
10 | 15 | The ``fileb://`` prefix instructs the CLI to read the data to encrypt, called the *plaintext*, from a file and pass the file's contents to the command's ``--plaintext`` parameter. If the file is not in the current directory, type the full path to file. For example: ``fileb:///var/tmp/ExamplePlaintextFile`` or ``fileb://C:\Temp\ExamplePlaintextFile``. |
11 | 16 | |
12 | 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. | |
17 | 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 | |
13 | 18 | |
14 | 19 | #. Uses the ``--output`` and ``--query`` parameters to control the command's output. |
15 | 20 | |
25 | 30 | |
26 | 31 | The final part of the command (``> ExampleEncryptedFile``) saves the binary ciphertext to a file to make decryption easier. For an example command that uses the AWS CLI to decrypt data, see the `decrypt examples <decrypt.html#examples>`_. |
27 | 32 | |
28 | **Example: Using the AWS CLI to encrypt data from the Windows command prompt** | |
33 | **Example 2: Using the AWS CLI to encrypt data on Windows** | |
29 | 34 | |
30 | 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. | |
35 | The preceding example assumes the ``base64`` utility is available, which is commonly the case on Linux and MacOS. For the Windows command prompt, use ``certutil`` instead of ``base64``. This requires two commands, as shown in the following examples. :: | |
31 | 36 | |
32 | .. code:: | |
37 | aws kms encrypt \ | |
38 | --key-id 1234abcd-12ab-34cd-56ef-1234567890ab \ | |
39 | --plaintext fileb://ExamplePlaintextFile \ | |
40 | --output text \ | |
41 | --query CiphertextBlob > C:\Temp\ExampleEncryptedFile.base64 | |
33 | 42 | |
34 | aws kms encrypt --key-id 1234abcd-12ab-34cd-56ef-1234567890ab --plaintext fileb://ExamplePlaintextFile --output text --query CiphertextBlob > C:\Temp\ExampleEncryptedFile.base64 | |
35 | ||
36 | .. code:: | |
37 | ||
38 | certutil -decode C:\Temp\ExampleEncryptedFile.base64 C:\Temp\ExampleEncryptedFile⏎ | |
43 | certutil -decode C:\Temp\ExampleEncryptedFile.base64 C:\Temp\ExampleEncryptedFile |
0 | **Example 1: To generate a 256-bit random number** | |
1 | ||
2 | The following ``generate-random`` example generates a 256-bit (32-byte) random number. | |
3 | ||
4 | When you run this command, you must use the ``number-of-bytes`` parameter to specify the length of the random number in bytes. | |
5 | ||
6 | You don't specify a CMK when you run this command. Unless you specify a `custom key store <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html>`__, AWS KMS generates the random number. It is not associated with any particular CMK. :: | |
7 | ||
8 | aws kms generate-random --number-of-bytes 32 | |
9 | ||
10 | In the output, the random number is in the ``Plaintext`` field. :: | |
11 | ||
12 | { | |
13 | "Plaintext": "Hcl7v6T2E+Iangu357rhmlKZUnsb/LqzhHiNt6XNfQ0=" | |
14 | } | |
15 | ||
16 | **Example 2: To generate a 256-bit random number and save it to a file (Linux or macOs)** | |
17 | ||
18 | The following example uses the ``generate-random`` command to generate a 256-bit (32-byte), base64-encoded random byte string on a Linix or macOS computer. The example decodes the byte string and saves it in the ``ExampleRandom`` file. | |
19 | ||
20 | When you run this command, you must use the ``number-of-bytes`` parameter to specify the length of the random number in bytes. | |
21 | ||
22 | You don't specify a CMK when you run this command. Unless you specify a `custom key store <https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html>`__, AWS KMS generates the random number. It is not associated with any particular CMK. | |
23 | ||
24 | * The ``--number-of-bytes`` parameter with a value of ``32`` requests a 32-byte (256-bit) string. | |
25 | * The ``--output`` parameter with a value of ``text`` directs the AWS CLI to return the output as text, instead of JSON. | |
26 | * The ``--query`` parameter extracts the value of the ``Plaintext`` property from the response. | |
27 | * The pipe operator ( | ) sends the output of the command to the ``base64`` utility, which decodes the extracted output. | |
28 | * The redirection operator (>) saves the decoded byte string to the ``ExampleRandom`` file. | |
29 | ||
30 | aws kms generate-random --number-of-bytes 32 --output text --query Plaintext | base64 --decode > ExampleRandom | |
31 | ||
32 | This command produces no output. | |
33 | ||
34 | **Example 3: To generate a 256-bit random number and save it to a file(Windows Command Prompt)** | |
35 | ||
36 | The following example uses the ``generate-random`` command to generate a 256-bit (32-byte), base64-encoded random byte string. The example decodes the byte string and saves it in the `ExampleRandom.base64` file. | |
37 | ||
38 | This example is the same as the previous example, except that it uses the ``certutil`` utility in Windows to base64-decode the random byte string before saving it in a file. | |
39 | ||
40 | The first command generates the base64-encoded random byte string and saves it in a temporary file, ``ExampleRandom.base64``. The second command uses the ``certutil -decode`` command to decode the base64-encoded byte string in the ``ExampleRandom.base64`` file. Then, it saves the decoded byte string in the ``ExampleRandom`` file. :: | |
41 | ||
42 | aws kms generate-random --number-of-bytes 32 --output text --query Plaintext > ExampleRandom.base64 | |
43 | certutil -decode ExampleRandom.base64 ExampleRandom | |
44 | ||
45 | Output:: | |
46 | ||
47 | Input Length = 18 | |
48 | Output Length = 12 | |
49 | CertUtil: -decode command completed successfully. | |
50 | ||
51 | For more information, see `GenerateRandom <https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateRandom.html>`__ in the *AWS Key Management Service API Reference*. |
0 | 0 | **To copy a key policy from one CMK to another CMK** |
1 | 1 | |
2 | 2 | The following ``get-key-policy`` example gets the key policy from one CMK and saves it in a text file. Then, it replaces the policy of a different CMK using the text file as the policy input. |
3 | Because the ``--policy`` parameter of ``put-key-policy`` requires a string, you must use the ``--output text`` option to return the output as a text string instead of JSON. | |
4 | Before running these commands, replace the example key IDs with valid ones from your AWS account. :: | |
3 | ||
4 | Because the ``--policy`` parameter of ``put-key-policy`` requires a string, you must use the ``--output text`` option to return the output as a text string instead of JSON. :: | |
5 | 5 | |
6 | 6 | aws kms get-key-policy \ |
7 | 7 | --policy-name default \ |
0 | **Example 1: To list all aliases in an AWS account and Region** | |
1 | ||
2 | The following example uses the ``list-aliases`` command to list all aliases in the default Region of the AWS account. The output includes aliases associated with AWS managed CMKs and customer managed CMKs. :: | |
3 | ||
4 | aws kms list-aliases | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Aliases": [ | |
10 | { | |
11 | "AliasArn": "arn:aws:kms:us-west-2:111122223333:alias/testKey", | |
12 | "AliasName": "alias/testKey", | |
13 | "TargetKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab" | |
14 | }, | |
15 | { | |
16 | "AliasArn": "arn:aws:kms:us-west-2:111122223333:alias/FinanceDept", | |
17 | "AliasName": "alias/FinanceDept", | |
18 | "TargetKeyId": "0987dcba-09fe-87dc-65ba-ab0987654321" | |
19 | }, | |
20 | { | |
21 | "AliasArn": "arn:aws:kms:us-west-2:111122223333:alias/aws/dynamodb", | |
22 | "AliasName": "alias/aws/dynamodb", | |
23 | "TargetKeyId": "1a2b3c4d-5e6f-1a2b-3c4d-5e6f1a2b3c4d" | |
24 | }, | |
25 | { | |
26 | "AliasArn": "arn:aws:kms:us-west-2:111122223333:alias/aws/ebs", | |
27 | "AliasName": "alias/aws/ebs", | |
28 | "TargetKeyId": "0987ab65-43cd-21ef-09ab-87654321cdef" | |
29 | }, | |
30 | ... | |
31 | ] | |
32 | } | |
33 | ||
34 | **Example 2: To list all aliases for a particular CMK** | |
35 | ||
36 | The following example uses the ``list-aliases`` command and its ``key-id`` parameter to list all aliases that are associated with a particular CMK. | |
37 | ||
38 | Each alias is associated with only one CMK, but a CMK can have multiple aliases. This command is very useful because the AWS KMS console lists only one alias for each CMK. To find all aliases for a CMK, you must use the ``list-aliases`` command. | |
39 | ||
40 | This example uses the key ID of the CMK for the ``--key-id`` parameter, but you can use a key ID, key ARN, alias name, or alias ARN in this command. :: | |
41 | ||
42 | aws kms list-aliases --key-id 1234abcd-12ab-34cd-56ef-1234567890ab | |
43 | ||
44 | Output:: | |
45 | ||
46 | { | |
47 | "Aliases": [ | |
48 | { | |
49 | "TargetKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", | |
50 | "AliasArn": "arn:aws:kms:us-west-2:111122223333:alias/oregon-test-key", | |
51 | "AliasName": "alias/oregon-test-key" | |
52 | }, | |
53 | { | |
54 | "TargetKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab", | |
55 | "AliasArn": "arn:aws:kms:us-west-2:111122223333:alias/project121-test", | |
56 | "AliasName": "alias/project121-test" | |
57 | } | |
58 | ] | |
59 | } | |
60 | ||
61 | For more information, see `Working with Aliases <https://docs.aws.amazon.com/kms/latest/developerguide/programming-aliases.html>`__ in the *AWS Key Management Service Developer Guide*.⏎ |
0 | **Example 1: To re-encrypt encrypted data under a different CMK** | |
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. | |
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. | |
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. | |
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. | |
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. :: | |
14 | ||
15 | aws kms re-encrypt \ | |
16 | --ciphertext-blob fileb://ExampleEncryptedFile \ | |
17 | --destination-key-id 0987dcba-09fe-87dc-65ba-ab0987654321 | |
18 | ||
19 | The output includes the following properties: | |
20 | ||
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. :: | |
24 | ||
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 | } | |
30 | ||
31 | **Example 2: To re-encrypt encrypted data under a different CMK (Linux or macOs)** | |
32 | ||
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. :: | |
61 | ||
62 | aws kms re-encrypt ^ | |
63 | --ciphertext-blob fileb://ExampleEncryptedFile ^ | |
64 | --destination-key-id 0987dcba-09fe-87dc-65ba-ab0987654321 ^ | |
65 | --output text ^ | |
66 | --query CiphertextBlob > ExampleReEncryptedFile.base64 | |
67 | certutil -decode ExampleReEncryptedFile.base64 ExampleReEncryptedFile | |
68 | ||
69 | Output:: | |
70 | ||
71 | Input Length = 18 | |
72 | Output Length = 12 | |
73 | CertUtil: -decode command completed successfully. | |
74 | ||
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*. |
0 | **To schedule the deletion of a customer managed CMK.** | |
1 | ||
2 | The following ``schedule-key-deletion`` example schedules the specified customer managed CMK to be deleted in 15 days. | |
3 | ||
4 | * The ``--key-id`` parameter identifies the CMK. This example uses a key ARN value, but you can use either the key ID or the ARN of the CMK. | |
5 | * The ``--pending-window-in-days`` parameter specifies the length of the waiting period. By default, the waiting period is 30 days. This example specifies a value of 15, which tells AWS to permanently delete the CMK 15 days after the command completes. :: | |
6 | ||
7 | aws kms schedule-key-deletion \ | |
8 | --key-id arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab \ | |
9 | --pending-window-in-days 15 | |
10 | ||
11 | The response returns the key ARN and the deletion date in Unix time. To view the deletion date in local time, use the AWS KMS console. :: | |
12 | ||
13 | { | |
14 | "KeyId": "arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab", | |
15 | "DeletionDate": 1567382400.0 | |
16 | } | |
17 | ||
18 | For more information, see `Deleting Customer Master Keys <https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html>`__ in the *AWS Key Management Service Developer Guide*. |
0 | **To associate an alias with a different CMK** | |
1 | ||
2 | The following ``update-alias`` example associates the alias ``alias/test-key`` with a different CMK. | |
3 | ||
4 | * The ``--alias-name`` parameter specifies the alias. The alias name value must begin with ``alias/``. | |
5 | * The ``--target-key-id`` parameter specifies the CMK to associate with the alias. You don't need to specify the current CMK for the alias. :: | |
6 | ||
7 | aws kms update-alias \ | |
8 | --alias-name alias/test-key \ | |
9 | --target-key-id 1234abcd-12ab-34cd-56ef-1234567890ab | |
10 | ||
11 | This command produces no output. To find the alias, use the ``list-aliases`` command. | |
12 | ||
13 | For more information, see `Working with Aliases <https://docs.aws.amazon.com/kms/latest/developerguide/programming-aliases.html>`__ in the *AWS Key Management Service Developer Guide*. |
0 | **Example 1: To delete the description of a customer managed CMK** | |
1 | ||
2 | The following ``update-key-description`` example deletes the description to a customer managed CMK. | |
3 | ||
4 | * The ``--key-id`` parameter identifies the CMK in the command. This example uses a key ID value, but you can use either the key ID or the key ARN of the CMK. | |
5 | * The ``--description`` parameter with an empty string value ('') deletes the existing description. :: | |
6 | ||
7 | aws kms update-key-description \ | |
8 | --key-id 0987dcba-09fe-87dc-65ba-ab0987654321 \ | |
9 | --description '' | |
10 | ||
11 | This command produces no output. To view the description of a CMK, use the the describe-key command. | |
12 | ||
13 | For more information, see `UpdateKeyDescription <https://docs.aws.amazon.com/cli/latest/reference/kms/update-key-description.html>`__ in the *AWS Key Management Service API Reference*. | |
14 | ||
15 | **Example 2: To add or change a description to a customer managed CMK** | |
16 | ||
17 | The following ``update-key-description`` example adds a description to a customer managed CMK. You can use the same command to change an existing description. | |
18 | ||
19 | * The ``--key-id`` parameter identifies the CMK in the command. This example uses a key ARN value, but you can use either the key ID or the key ARN of the CMK. | |
20 | * The ``--description`` parameter specifies the new description. The value of this parameter replaces the current description of the CMK, if any. :: | |
21 | ||
22 | aws kms update-key-description \ | |
23 | --key-id arn:aws:kms:us-west-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab \ | |
24 | --description "IT Department test key" | |
25 | ||
26 | This command produces no output. To view the description of a CMK, use the ``describe-key`` command. | |
27 | ||
28 | For more information, see `UpdateKeyDescription <https://docs.aws.amazon.com/cli/latest/reference/kms/update-key-description.html>`__ in the *AWS Key Management Service API Reference*.⏎ |
0 | **To add outputs to a flow** | |
1 | ||
2 | The following ``add-flow-outputs`` example adds outputs to the specified flow. :: | |
3 | ||
4 | aws mediaconnect add-flow-outputs \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame \ | |
6 | --outputs Description='NYC stream',Destination=192.0.2.12,Name=NYC,Port=3333,Protocol=rtp-fec,SmoothingLatency=100 Description='LA stream',Destination=203.0.113.9,Name=LA,Port=4444,Protocol=rtp-fec,SmoothingLatency=100 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Outputs": [ | |
12 | { | |
13 | "Port": 3333, | |
14 | "OutputArn": "arn:aws:mediaconnect:us-east-1:111122223333:output:2-3aBC45dEF67hiJ89-c34de5fG678h:NYC", | |
15 | "Name": "NYC", | |
16 | "Description": "NYC stream", | |
17 | "Destination": "192.0.2.12", | |
18 | "Transport": { | |
19 | "Protocol": "rtp-fec", | |
20 | "SmoothingLatency": 100 | |
21 | } | |
22 | }, | |
23 | { | |
24 | "Port": 4444, | |
25 | "OutputArn": "arn:aws:mediaconnect:us-east-1:111122223333:output:2-987655dEF67hiJ89-c34de5fG678h:LA", | |
26 | "Name": "LA", | |
27 | "Description": "LA stream", | |
28 | "Destination": "203.0.113.9", | |
29 | "Transport": { | |
30 | "Protocol": "rtp-fec", | |
31 | "SmoothingLatency": 100 | |
32 | } | |
33 | } | |
34 | ], | |
35 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame" | |
36 | } | |
37 | ||
38 | For more information, see `Adding Outputs to a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/outputs-add.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To create a flow** | |
1 | ||
2 | The following ``create-flow`` example creates a flow with the specified configuration. :: | |
3 | ||
4 | aws mediaconnect create-flow \ | |
5 | --availability-zone us-west-2c \ | |
6 | --name ExampleFlow \ | |
7 | --source Description='Example source, backup',IngestPort=1055,Name=BackupSource,Protocol=rtp,WhitelistCidr=10.24.34.0/23 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Flow": { | |
13 | "FlowArn": "arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:ExampleFlow", | |
14 | "AvailabilityZone": "us-west-2c", | |
15 | "EgressIp": "54.245.71.21", | |
16 | "Source": { | |
17 | "IngestPort": 1055, | |
18 | "SourceArn": "arn:aws:mediaconnect:us-east-1:123456789012:source:2-3aBC45dEF67hiJ89-c34de5fG678h:BackupSource", | |
19 | "Transport": { | |
20 | "Protocol": "rtp", | |
21 | "MaxBitrate": 80000000 | |
22 | }, | |
23 | "Description": "Example source, backup", | |
24 | "IngestIp": "54.245.71.21", | |
25 | "WhitelistCidr": "10.24.34.0/23", | |
26 | "Name": "mySource" | |
27 | }, | |
28 | "Entitlements": [], | |
29 | "Name": "ExampleFlow", | |
30 | "Outputs": [], | |
31 | "Status": "STANDBY", | |
32 | "Description": "Example source, backup" | |
33 | } | |
34 | } | |
35 | ||
36 | For more information, see `Creating a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/flows-create.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To delete a flow** | |
1 | ||
2 | The following ``delete-flow`` example deletes the specified flow. :: | |
3 | ||
4 | aws mediaconnect delete-flow \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "FlowArn": "arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow", | |
11 | "Status": "DELETING" | |
12 | } | |
13 | ||
14 | For more information, see `Deleting a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/flows-delete.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To view the details of a flow** | |
1 | ||
2 | The following ``describe-flow`` example displays the specified flow's details, such as ARN, Availability Zone, status, source, entitlements, and outputs. :: | |
3 | ||
4 | aws mediaconnect describe-flow \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Flow": { | |
11 | "EgressIp": "54.201.4.39", | |
12 | "AvailabilityZone": "us-west-2c", | |
13 | "Status": "ACTIVE", | |
14 | "FlowArn": "arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow", | |
15 | "Entitlements": [ | |
16 | { | |
17 | "EntitlementArn": "arn:aws:mediaconnect:us-west-2:123456789012:entitlement:1-AaBb11CcDd22EeFf-34DE5fG12AbC:MyEntitlement", | |
18 | "Description": "Assign to this account", | |
19 | "Name": "MyEntitlement", | |
20 | "Subscribers": [ | |
21 | "444455556666" | |
22 | ] | |
23 | } | |
24 | ], | |
25 | "Description": "NYC awards show", | |
26 | "Name": "AwardsShow", | |
27 | "Outputs": [ | |
28 | { | |
29 | "Port": 2355, | |
30 | "Name": "NYC", | |
31 | "Transport": { | |
32 | "SmoothingLatency": 0, | |
33 | "Protocol": "rtp-fec" | |
34 | }, | |
35 | "OutputArn": "arn:aws:mediaconnect:us-east-1:123456789012:output:2-3aBC45dEF67hiJ89-c34de5fG678h:NYC", | |
36 | "Destination": "192.0.2.0" | |
37 | }, | |
38 | { | |
39 | "Port": 3025, | |
40 | "Name": "LA", | |
41 | "Transport": { | |
42 | "SmoothingLatency": 0, | |
43 | "Protocol": "rtp-fec" | |
44 | }, | |
45 | "OutputArn": "arn:aws:mediaconnect:us-east-1:123456789012:output:2-987655dEF67hiJ89-c34de5fG678h:LA", | |
46 | "Destination": "192.0.2.0" | |
47 | } | |
48 | ], | |
49 | "Source": { | |
50 | "IngestIp": "54.201.4.39", | |
51 | "SourceArn": "arn:aws:mediaconnect:us-east-1:123456789012:source:3-4aBC56dEF78hiJ90-4de5fG6Hi78Jk:ShowSource", | |
52 | "Transport": { | |
53 | "MaxBitrate": 80000000, | |
54 | "Protocol": "rtp" | |
55 | }, | |
56 | "IngestPort": 1069, | |
57 | "Description": "Saturday night show", | |
58 | "Name": "ShowSource", | |
59 | "WhitelistCidr": "10.24.34.0/23" | |
60 | } | |
61 | } | |
62 | } | |
63 | ||
64 | For more information, see `Viewing the Details of a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/flows-view-details.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To grant an entitlement on a flow** | |
1 | ||
2 | The following ``grant-flow-entitlements`` example grants an entitlement to the specified existing flow to share your content with another AWS account. :: | |
3 | ||
4 | aws mediaconnect grant-flow-entitlements \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame \ | |
6 | --entitlements Description='For AnyCompany',Encryption={"Algorithm=aes128,KeyType=static-key,RoleArn=arn:aws:iam::111122223333:role/MediaConnect-ASM,SecretArn=arn:aws:secretsmanager:us-west-2:111122223333:secret:mySecret1"},Name=AnyCompany_Entitlement,Subscribers=444455556666 Description='For Example Corp',Name=ExampleCorp,Subscribers=777788889999 | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Entitlements": [ | |
12 | { | |
13 | "Name": "AnyCompany_Entitlement", | |
14 | "EntitlementArn": "arn:aws:mediaconnect:us-west-2:111122223333:entitlement:1-11aa22bb11aa22bb-3333cccc4444:AnyCompany_Entitlement", | |
15 | "Subscribers": [ | |
16 | "444455556666" | |
17 | ], | |
18 | "Description": "For AnyCompany", | |
19 | "Encryption": { | |
20 | "SecretArn": "arn:aws:secretsmanager:us-west-2:111122223333:secret:mySecret1", | |
21 | "Algorithm": "aes128", | |
22 | "RoleArn": "arn:aws:iam::111122223333:role/MediaConnect-ASM", | |
23 | "KeyType": "static-key" | |
24 | } | |
25 | }, | |
26 | { | |
27 | "Name": "ExampleCorp", | |
28 | "EntitlementArn": "arn:aws:mediaconnect:us-west-2:111122223333:entitlement:1-3333cccc4444dddd-1111aaaa2222:ExampleCorp", | |
29 | "Subscribers": [ | |
30 | "777788889999" | |
31 | ], | |
32 | "Description": "For Example Corp" | |
33 | } | |
34 | ], | |
35 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame" | |
36 | } | |
37 | ||
38 | For more information, see `Granting an Entitlement on a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/entitlements-grant.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To view a list of entitlements** | |
1 | ||
2 | The following ``list-entitlements`` example displays a list of all entitlements that have been granted to the account. :: | |
3 | ||
4 | aws mediaconnect list-entitlements | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Entitlements": [ | |
10 | { | |
11 | "EntitlementArn": "arn:aws:mediaconnect:us-west-2:111122223333:entitlement:1-11aa22bb11aa22bb-3333cccc4444:MyEntitlement", | |
12 | "EntitlementName": "MyEntitlement" | |
13 | } | |
14 | ] | |
15 | } | |
16 | ||
17 | For more information, see `ListEntitlements <https://docs.aws.amazon.com/mediaconnect/latest/api/v1-entitlements.html>`__ in the *AWS Elemental MediaConnect API Reference*. |
0 | **To view a list of flows** | |
1 | ||
2 | The following ``list-flows`` example displays a list of flows. :: | |
3 | ||
4 | aws mediaconnect list-flows | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Flows": [ | |
10 | { | |
11 | "Status": "STANDBY", | |
12 | "SourceType": "OWNED", | |
13 | "AvailabilityZone": "us-west-2a", | |
14 | "Description": "NYC awards show", | |
15 | "Name": "AwardsShow", | |
16 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow" | |
17 | }, | |
18 | { | |
19 | "Status": "STANDBY", | |
20 | "SourceType": "OWNED", | |
21 | "AvailabilityZone": "us-west-2c", | |
22 | "Description": "LA basketball game", | |
23 | "Name": "BasketballGame", | |
24 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BasketballGame" | |
25 | } | |
26 | ] | |
27 | } | |
28 | ||
29 | For more information, see `Viewing a List of Flows <https://docs.aws.amazon.com/mediaconnect/latest/ug/flows-view-list.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To list tags for a MediaConnect resource** | |
1 | ||
2 | The following ``list-tags-for-resource`` example displays the tag keys and values associated with the specified MediaConnect resource. :: | |
3 | ||
4 | aws mediaconnect list-tags-for-resource \ | |
5 | --resource-arn arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BasketballGame | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Tags": { | |
11 | "region": "west", | |
12 | "stage": "prod" | |
13 | } | |
14 | } | |
15 | ||
16 | For more information, see `ListTagsForResource, TagResource, UntagResource <https://docs.aws.amazon.com/mediaconnect/latest/api/tags-resourcearn.html>`__ in the *AWS Elemental MediaConnect API Reference*. |
0 | **To remove an output from a flow** | |
1 | ||
2 | The following ``remove-flow-output`` example removes an output from the specified flow. :: | |
3 | ||
4 | aws mediaconnect remove-flow-output \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame \ | |
6 | --output-arn arn:aws:mediaconnect:us-east-1:111122223333:output:2-3aBC45dEF67hiJ89-c34de5fG678h:NYC | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame", | |
12 | "OutputArn": "arn:aws:mediaconnect:us-east-1:111122223333:output:2-3aBC45dEF67hiJ89-c34de5fG678h:NYC" | |
13 | } | |
14 | ||
15 | For more information, see `Removing Outputs from a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/outputs-remove.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To revoke an entitlement** | |
1 | ||
2 | The following ``revoke-flow-entitlement`` example revokes an entitlement on the specified flow. :: | |
3 | ||
4 | aws mediaconnect revoke-flow-entitlement \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame \ | |
6 | --entitlement-arn arn:aws:mediaconnect:us-west-2:111122223333:entitlement:1-11aa22bb11aa22bb-3333cccc4444:AnyCompany_Entitlement | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame", | |
12 | "EntitlementArn": "arn:aws:mediaconnect:us-west-2:111122223333:entitlement:1-11aa22bb11aa22bb-3333cccc4444:AnyCompany_Entitlement" | |
13 | } | |
14 | ||
15 | For more information, see `Revoking an Entitlement <https://docs.aws.amazon.com/mediaconnect/latest/ug/entitlements-revoke.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To start a flow** | |
1 | ||
2 | The following ``start-flow`` example starts the specified flow. :: | |
3 | ||
4 | aws mediaconnect start-flow \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "FlowArn": "arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow", | |
12 | "Status": "STARTING" | |
13 | } | |
14 | ||
15 | For more information, see `Starting a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/flows-start.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To stop a flow** | |
1 | ||
2 | The following ``stop-flow`` example stops the specified flow. :: | |
3 | ||
4 | aws mediaconnect stop-flow \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Status": "STOPPING", | |
11 | "FlowArn": "arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow" | |
12 | } | |
13 | ||
14 | For more information, see `Stopping a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/flows-stop.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To add tags to a MediaConnect resource** | |
1 | ||
2 | The following ``tag-resource`` example adds a tag with a key name and value to the specified MediaConnect resource. :: | |
3 | ||
4 | aws mediaconnect tag-resource \ | |
5 | --resource-arn arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BasketballGame | |
6 | --tags region=west | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `ListTagsForResource, TagResource, UntagResource <https://docs.aws.amazon.com/mediaconnect/latest/api/tags-resourcearn.html>`__ in the *AWS Elemental MediaConnect API Reference*. |
0 | **To remove tags from a MediaConnect resource** | |
1 | ||
2 | The following ``untag-resource`` example remove the tag with the specified key name and its associated value from a MediaConnect resource. :: | |
3 | ||
4 | aws mediaconnect untag-resource \ | |
5 | --resource-arn arn:aws:mediaconnect:us-east-1:123456789012:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BasketballGame \ | |
6 | --tag-keys region | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `ListTagsForResource, TagResource, UntagResource <https://docs.aws.amazon.com/mediaconnect/latest/api/tags-resourcearn.html>`__ in the *AWS Elemental MediaConnect API Reference*. |
0 | **To update an entitlement** | |
1 | ||
2 | The following ``update-flow-entitlement`` example updates the specified entitlement with a new description and subscriber. :: | |
3 | ||
4 | aws mediaconnect update-flow-entitlement \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame \ | |
6 | --entitlement-arn arn:aws:mediaconnect:us-west-2:111122223333:entitlement:1-11aa22bb11aa22bb-3333cccc4444:AnyCompany_Entitlement \ | |
7 | --description 'For AnyCompany Affiliate' \ | |
8 | --subscribers 777788889999 | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame", | |
14 | "Entitlement": { | |
15 | "Name": "AnyCompany_Entitlement", | |
16 | "Description": "For AnyCompany Affiliate", | |
17 | "EntitlementArn": "arn:aws:mediaconnect:us-west-2:111122223333:entitlement:1-11aa22bb11aa22bb-3333cccc4444:AnyCompany_Entitlement", | |
18 | "Encryption": { | |
19 | "KeyType": "static-key", | |
20 | "Algorithm": "aes128", | |
21 | "RoleArn": "arn:aws:iam::111122223333:role/MediaConnect-ASM", | |
22 | "SecretArn": "arn:aws:secretsmanager:us-west-2:111122223333:secret:mySecret1" | |
23 | }, | |
24 | "Subscribers": [ | |
25 | "777788889999" | |
26 | ] | |
27 | } | |
28 | } | |
29 | ||
30 | For more information, see `Updating an Entitlement <https://docs.aws.amazon.com/mediaconnect/latest/ug/entitlements-update.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To update an output on a flow** | |
1 | ||
2 | The following ``update-flow-output`` example update an output on the specified flow. :: | |
3 | ||
4 | aws mediaconnect update-flow-output \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame \ | |
6 | --output-arn arn:aws:mediaconnect:us-east-1:111122223333:output:2-3aBC45dEF67hiJ89-c34de5fG678h:NYC \ | |
7 | --port 3331 | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:BaseballGame", | |
13 | "Output": { | |
14 | "Name": "NYC", | |
15 | "Port": 3331, | |
16 | "Description": "NYC stream", | |
17 | "Transport": { | |
18 | "Protocol": "rtp-fec", | |
19 | "SmoothingLatency": 100 | |
20 | }, | |
21 | "OutputArn": "arn:aws:mediaconnect:us-east-1:111122223333:output:2-3aBC45dEF67hiJ89-c34de5fG678h:NYC", | |
22 | "Destination": "192.0.2.12" | |
23 | } | |
24 | } | |
25 | ||
26 | For more information, see `Updating Outputs on a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/outputs-update.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To update the source of an existing flow** | |
1 | ||
2 | The following ``update-flow-source`` example updates the source of an existing flow. :: | |
3 | ||
4 | aws mediaconnect update-flow-source \ | |
5 | --flow-arn arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow \ | |
6 | --source-arn arn:aws:mediaconnect:us-east-1:111122223333:source:3-4aBC56dEF78hiJ90-4de5fG6Hi78Jk:ShowSource \ | |
7 | --description 'Friday night show' \ | |
8 | --ingest-port 3344 \ | |
9 | --protocol rtp-fec \ | |
10 | --whitelist-cidr 10.24.34.0/23 | |
11 | ||
12 | Output:: | |
13 | ||
14 | { | |
15 | "FlowArn": "arn:aws:mediaconnect:us-east-1:111122223333:flow:1-23aBC45dEF67hiJ8-12AbC34DE5fG:AwardsShow", | |
16 | "Source": { | |
17 | "IngestIp": "34.210.136.56", | |
18 | "WhitelistCidr": "10.24.34.0/23", | |
19 | "Transport": { | |
20 | "Protocol": "rtp-fec" | |
21 | }, | |
22 | "IngestPort": 3344, | |
23 | "Name": "ShowSource", | |
24 | "Description": "Friday night show", | |
25 | "SourceArn": "arn:aws:mediaconnect:us-east-1:111122223333:source:3-4aBC56dEF78hiJ90-4de5fG6Hi78Jk:ShowSource" | |
26 | } | |
27 | } | |
28 | ||
29 | For more information, see `Updating the Source of a Flow <https://docs.aws.amazon.com/mediaconnect/latest/ug/source-update.html>`__ in the *AWS Elemental MediaConnect User Guide*. |
0 | **To delete a job template** | |
1 | ||
2 | The following ``delete-job-template`` example deletes the specified custom job template. :: | |
3 | ||
4 | aws mediaconvert delete-job-template \ | |
5 | --name "DASH Streaming" \ | |
6 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
7 | ||
8 | This command produces no output. Run ``aws mediaconvert list-job-templates`` to confirm that your template was deleted. | |
9 | ||
10 | ||
11 | For more information, see `Working with AWS Elemental MediaConvert Job Templates <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-job-templates.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To delete a custom on-demand queue** | |
1 | ||
2 | The following ``delete-preset`` example deletes the specified custom preset. :: | |
3 | ||
4 | aws mediaconvert delete-preset \ | |
5 | --name SimpleMP4 \ | |
6 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
7 | ||
8 | This command produces no output. Run ``aws mediaconvert list-presets`` to confirm that your preset was deleted. | |
9 | ||
10 | For more information, see `Working with AWS Elemental MediaConvert Output Presets <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-presets.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To delete a custom on-demand queue** | |
1 | ||
2 | The following ``delete-queue`` example deletes the specified custom on-demand queue. | |
3 | ||
4 | You can't delete your default queue. You can't delete a reserved queue that has an active pricing plan or that contains unprocessed jobs. :: | |
5 | ||
6 | aws mediaconvert delete-queue \ | |
7 | --name Customer1 \ | |
8 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
9 | ||
10 | ||
11 | This command produces no output. Run ``aws mediaconvert list-queues`` to confirm that your queue was deleted. | |
12 | ||
13 | For more information, see `Working with AWS Elemental MediaConvert Queues <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To get details for a job template** | |
1 | ||
2 | The following ``get-job-template`` example displays the JSON definition of the specified custom job template. :: | |
3 | ||
4 | aws mediaconvert get-job-template \ | |
5 | --name "DASH Streaming" \ | |
6 | --endpoint-url https://abcd1234.mediaconvert.us-east-1.amazonaws.com | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "JobTemplate": { | |
12 | "StatusUpdateInterval": "SECONDS_60", | |
13 | "LastUpdated": 1568652998, | |
14 | "Description": "Create a DASH streaming ABR stack", | |
15 | "CreatedAt": 1568652998, | |
16 | "Priority": 0, | |
17 | "Name": "DASH Streaming", | |
18 | "Settings": { | |
19 | ...<truncatedforbrevity>... | |
20 | }, | |
21 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:jobTemplates/DASH Streaming", | |
22 | "Type": "CUSTOM" | |
23 | } | |
24 | } | |
25 | ||
26 | For more information, see `Working with AWS Elemental MediaConvert Job Templates <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-job-templates.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To get details for a particular preset** | |
1 | ||
2 | The following ``get-preset`` example requests the JSON definition of the specified custom preset. :: | |
3 | ||
4 | aws mediaconvert get-preset \ | |
5 | --name SimpleMP4 \ | |
6 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Preset": { | |
12 | "Description": "Creates basic MP4 file. No filtering or preproccessing.", | |
13 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:presets/SimpleMP4", | |
14 | "LastUpdated": 1568843141, | |
15 | "Name": "SimpleMP4", | |
16 | "Settings": { | |
17 | "ContainerSettings": { | |
18 | "Mp4Settings": { | |
19 | "FreeSpaceBox": "EXCLUDE", | |
20 | "CslgAtom": "INCLUDE", | |
21 | "MoovPlacement": "PROGRESSIVE_DOWNLOAD" | |
22 | }, | |
23 | "Container": "MP4" | |
24 | }, | |
25 | "AudioDescriptions": [ | |
26 | { | |
27 | "LanguageCodeControl": "FOLLOW_INPUT", | |
28 | "AudioTypeControl": "FOLLOW_INPUT", | |
29 | "CodecSettings": { | |
30 | "AacSettings": { | |
31 | "RawFormat": "NONE", | |
32 | "CodecProfile": "LC", | |
33 | "AudioDescriptionBroadcasterMix": "NORMAL", | |
34 | "SampleRate": 48000, | |
35 | "Bitrate": 96000, | |
36 | "RateControlMode": "CBR", | |
37 | "Specification": "MPEG4", | |
38 | "CodingMode": "CODING_MODE_2_0" | |
39 | }, | |
40 | "Codec": "AAC" | |
41 | } | |
42 | } | |
43 | ], | |
44 | "VideoDescription": { | |
45 | "RespondToAfd": "NONE", | |
46 | "TimecodeInsertion": "DISABLED", | |
47 | "Sharpness": 50, | |
48 | "ColorMetadata": "INSERT", | |
49 | "CodecSettings": { | |
50 | "H264Settings": { | |
51 | "FramerateControl": "INITIALIZE_FROM_SOURCE", | |
52 | "SpatialAdaptiveQuantization": "ENABLED", | |
53 | "Softness": 0, | |
54 | "Telecine": "NONE", | |
55 | "CodecLevel": "AUTO", | |
56 | "QualityTuningLevel": "SINGLE_PASS", | |
57 | "UnregisteredSeiTimecode": "DISABLED", | |
58 | "Slices": 1, | |
59 | "Syntax": "DEFAULT", | |
60 | "GopClosedCadence": 1, | |
61 | "AdaptiveQuantization": "HIGH", | |
62 | "EntropyEncoding": "CABAC", | |
63 | "InterlaceMode": "PROGRESSIVE", | |
64 | "ParControl": "INITIALIZE_FROM_SOURCE", | |
65 | "NumberBFramesBetweenReferenceFrames": 2, | |
66 | "GopSizeUnits": "FRAMES", | |
67 | "RepeatPps": "DISABLED", | |
68 | "CodecProfile": "MAIN", | |
69 | "FieldEncoding": "PAFF", | |
70 | "GopSize": 90.0, | |
71 | "SlowPal": "DISABLED", | |
72 | "SceneChangeDetect": "ENABLED", | |
73 | "GopBReference": "DISABLED", | |
74 | "RateControlMode": "CBR", | |
75 | "FramerateConversionAlgorithm": "DUPLICATE_DROP", | |
76 | "FlickerAdaptiveQuantization": "DISABLED", | |
77 | "DynamicSubGop": "STATIC", | |
78 | "MinIInterval": 0, | |
79 | "TemporalAdaptiveQuantization": "ENABLED", | |
80 | "Bitrate": 400000, | |
81 | "NumberReferenceFrames": 3 | |
82 | }, | |
83 | "Codec": "H_264" | |
84 | }, | |
85 | "AfdSignaling": "NONE", | |
86 | "AntiAlias": "ENABLED", | |
87 | "ScalingBehavior": "DEFAULT", | |
88 | "DropFrameTimecode": "ENABLED" | |
89 | } | |
90 | }, | |
91 | "Type": "CUSTOM", | |
92 | "CreatedAt": 1568841521 | |
93 | } | |
94 | } | |
95 | ||
96 | For more information, see `Working with AWS Elemental MediaConvert Output Presets <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-presets.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To get details for a queue** | |
1 | ||
2 | The following ``get-queue`` example retrieves the details of the specified custom queue. :: | |
3 | ||
4 | aws mediaconvert get-queue \ | |
5 | --name Customer1 \ | |
6 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Queue": { | |
12 | "LastUpdated": 1526428502, | |
13 | "Type": "CUSTOM", | |
14 | "SubmittedJobsCount": 0, | |
15 | "Status": "ACTIVE", | |
16 | "PricingPlan": "ON_DEMAND", | |
17 | "CreatedAt": 1526428502, | |
18 | "ProgressingJobsCount": 0, | |
19 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:queues/Customer1", | |
20 | "Name": "Customer1" | |
21 | } | |
22 | } | |
23 | ||
24 | For more information, see `Working with AWS Elemental MediaConvert Queues <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **Example 1: To list your custom job templates** | |
1 | ||
2 | The following ``list-job-templates`` example lists all custom job templates in the current Region. To list the system job templates, see the next example. :: | |
3 | ||
4 | aws mediaconvert list-job-templates \ | |
5 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "JobTemplates": [ | |
11 | { | |
12 | "Description": "Create a DASH streaming ABR stack", | |
13 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:jobTemplates/DASH Streaming", | |
14 | "Name": "DASH Streaming", | |
15 | "LastUpdated": 1568653007, | |
16 | "Priority": 0, | |
17 | "Settings": { | |
18 | ...<truncatedforbrevity>... | |
19 | }, | |
20 | "Type": "CUSTOM", | |
21 | "StatusUpdateInterval": "SECONDS_60", | |
22 | "CreatedAt": 1568653007 | |
23 | }, | |
24 | { | |
25 | "Description": "Create a high-res file", | |
26 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:jobTemplates/File", | |
27 | "Name": "File", | |
28 | "LastUpdated": 1568653007, | |
29 | "Priority": 0, | |
30 | "Settings": { | |
31 | ...<truncatedforbrevity>... | |
32 | }, | |
33 | "Type": "CUSTOM", | |
34 | "StatusUpdateInterval": "SECONDS_60", | |
35 | "CreatedAt": 1568653023 | |
36 | } | |
37 | ] | |
38 | } | |
39 | ||
40 | **Example 2: To list the MediaConvert system job templates** | |
41 | ||
42 | The following ``list-job-templates`` example lists all system job templates. :: | |
43 | ||
44 | aws mediaconvert list-job-templates \ | |
45 | --endpoint-url https://abcd1234.mediaconvert.us-east-1.amazonaws.com \ | |
46 | --list-by SYSTEM | |
47 | ||
48 | Output:: | |
49 | ||
50 | { | |
51 | "JobTemplates": [ | |
52 | { | |
53 | "CreatedAt": 1568321779, | |
54 | "Arn": "arn:aws:mediaconvert:us-east-1:123456789012:jobTemplates/System-Generic_Mp4_Hev1_Avc_Aac_Sdr_Qvbr", | |
55 | "Name": "System-Generic_Mp4_Hev1_Avc_Aac_Sdr_Qvbr", | |
56 | "Description": "GENERIC, MP4, AVC + HEV1(HEVC,SDR), AAC, SDR, QVBR", | |
57 | "Category": "GENERIC", | |
58 | "Settings": { | |
59 | "AdAvailOffset": 0, | |
60 | "OutputGroups": [ | |
61 | { | |
62 | "Outputs": [ | |
63 | { | |
64 | "Extension": "mp4", | |
65 | "Preset": "System-Generic_Hd_Mp4_Avc_Aac_16x9_Sdr_1280x720p_30Hz_5Mbps_Qvbr_Vq9", | |
66 | "NameModifier": "_Generic_Hd_Mp4_Avc_Aac_16x9_Sdr_1280x720p_30Hz_5000Kbps_Qvbr_Vq9" | |
67 | }, | |
68 | { | |
69 | "Extension": "mp4", | |
70 | "Preset": "System-Generic_Hd_Mp4_Avc_Aac_16x9_Sdr_1920x1080p_30Hz_10Mbps_Qvbr_Vq9", | |
71 | "NameModifier": "_Generic_Hd_Mp4_Avc_Aac_16x9_Sdr_1920x1080p_30Hz_10000Kbps_Qvbr_Vq9" | |
72 | }, | |
73 | { | |
74 | "Extension": "mp4", | |
75 | "Preset": "System-Generic_Sd_Mp4_Avc_Aac_16x9_Sdr_640x360p_30Hz_0.8Mbps_Qvbr_Vq7", | |
76 | "NameModifier": "_Generic_Sd_Mp4_Avc_Aac_16x9_Sdr_640x360p_30Hz_800Kbps_Qvbr_Vq7" | |
77 | }, | |
78 | { | |
79 | "Extension": "mp4", | |
80 | "Preset": "System-Generic_Hd_Mp4_Hev1_Aac_16x9_Sdr_1280x720p_30Hz_4Mbps_Qvbr_Vq9", | |
81 | "NameModifier": "_Generic_Hd_Mp4_Hev1_Aac_16x9_Sdr_1280x720p_30Hz_4000Kbps_Qvbr_Vq9" | |
82 | }, | |
83 | { | |
84 | "Extension": "mp4", | |
85 | "Preset": "System-Generic_Hd_Mp4_Hev1_Aac_16x9_Sdr_1920x1080p_30Hz_8Mbps_Qvbr_Vq9", | |
86 | "NameModifier": "_Generic_Hd_Mp4_Hev1_Aac_16x9_Sdr_1920x1080p_30Hz_8000Kbps_Qvbr_Vq9" | |
87 | }, | |
88 | { | |
89 | "Extension": "mp4", | |
90 | "Preset": "System-Generic_Uhd_Mp4_Hev1_Aac_16x9_Sdr_3840x2160p_30Hz_12Mbps_Qvbr_Vq9", | |
91 | "NameModifier": "_Generic_Uhd_Mp4_Hev1_Aac_16x9_Sdr_3840x2160p_30Hz_12000Kbps_Qvbr_Vq9" | |
92 | } | |
93 | ], | |
94 | "OutputGroupSettings": { | |
95 | "FileGroupSettings": { | |
96 | ||
97 | }, | |
98 | "Type": "FILE_GROUP_SETTINGS" | |
99 | }, | |
100 | "Name": "File Group" | |
101 | } | |
102 | ] | |
103 | }, | |
104 | "Type": "SYSTEM", | |
105 | "LastUpdated": 1568321779 | |
106 | }, | |
107 | ...<truncatedforbrevity>... | |
108 | ] | |
109 | } | |
110 | ||
111 | For more information, see `Working with AWS Elemental MediaConvert Job Templates <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-job-templates.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **Example 1: To list your custom output presets** | |
1 | ||
2 | The following ``list-presets`` example lists your custom output presets. To list the system presets, see the next example. :: | |
3 | ||
4 | aws mediaconvert list-presets \ | |
5 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Presets": [ | |
11 | { | |
12 | "Name": "SimpleMP4", | |
13 | "CreatedAt": 1568841521, | |
14 | "Settings": { | |
15 | ...... | |
16 | }, | |
17 | "Arn": "arn:aws:mediaconvert:us-east-1:003235472598:presets/SimpleMP4", | |
18 | "Type": "CUSTOM", | |
19 | "LastUpdated": 1568843141, | |
20 | "Description": "Creates basic MP4 file. No filtering or preproccessing." | |
21 | }, | |
22 | { | |
23 | "Name": "SimpleTS", | |
24 | "CreatedAt": 1568843113, | |
25 | "Settings": { | |
26 | ... truncated for brevity ... | |
27 | }, | |
28 | "Arn": "arn:aws:mediaconvert:us-east-1:003235472598:presets/SimpleTS", | |
29 | "Type": "CUSTOM", | |
30 | "LastUpdated": 1568843113, | |
31 | "Description": "Create a basic transport stream." | |
32 | } | |
33 | ] | |
34 | } | |
35 | ||
36 | **Example 2: To list the system output presets** | |
37 | ||
38 | The following ``list-presets`` example lists the available MediaConvert system presets. To list your custom presets, see the previous example. :: | |
39 | ||
40 | aws mediaconvert list-presets \ | |
41 | --list-by SYSTEM \ | |
42 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
43 | ||
44 | Output:: | |
45 | ||
46 | { | |
47 | "Presets": [ | |
48 | { | |
49 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:presets/System-Avc_16x9_1080p_29_97fps_8500kbps", | |
50 | "Name": "System-Avc_16x9_1080p_29_97fps_8500kbps", | |
51 | "CreatedAt": 1568321789, | |
52 | "Description": "Wifi, 1920x1080, 16:9, 29.97fps, 8500kbps", | |
53 | "LastUpdated": 1568321789, | |
54 | "Type": "SYSTEM", | |
55 | "Category": "HLS", | |
56 | "Settings": { | |
57 | ...<output settings removed for brevity>... | |
58 | } | |
59 | }, | |
60 | ||
61 | ...<list of presets shortened for brevity>... | |
62 | ||
63 | { | |
64 | "Arn": "arn:aws:mediaconvert:us-east-1:123456789012:presets/System-Xdcam_HD_1080i_29_97fps_35mpbs", | |
65 | "Name": "System-Xdcam_HD_1080i_29_97fps_35mpbs", | |
66 | "CreatedAt": 1568321790, | |
67 | "Description": "XDCAM MPEG HD, 1920x1080i, 29.97fps, 35mbps", | |
68 | "LastUpdated": 1568321790, | |
69 | "Type": "SYSTEM", | |
70 | "Category": "MXF", | |
71 | "Settings": { | |
72 | ...<output settings removed for brevity>... | |
73 | } | |
74 | } | |
75 | ] | |
76 | } | |
77 | ||
78 | For more information, see `Working with AWS Elemental MediaConvert Output Presets <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-presets.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To list your queues** | |
1 | ||
2 | The following ``list-queues`` example lists all of your MediaConvert queues. :: | |
3 | ||
4 | aws mediaconvert list-queues \ | |
5 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
6 | ||
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Queues": [ | |
12 | { | |
13 | "PricingPlan": "ON_DEMAND", | |
14 | "Type": "SYSTEM", | |
15 | "Status": "ACTIVE", | |
16 | "CreatedAt": 1503451595, | |
17 | "Name": "Default", | |
18 | "SubmittedJobsCount": 0, | |
19 | "ProgressingJobsCount": 0, | |
20 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:queues/Default", | |
21 | "LastUpdated": 1534549158 | |
22 | }, | |
23 | { | |
24 | "PricingPlan": "ON_DEMAND", | |
25 | "Type": "CUSTOM", | |
26 | "Status": "ACTIVE", | |
27 | "CreatedAt": 1537460025, | |
28 | "Name": "Customer1", | |
29 | "SubmittedJobsCount": 0, | |
30 | "Description": "Jobs we run for our cusotmer.", | |
31 | "ProgressingJobsCount": 0, | |
32 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:queues/Customer1", | |
33 | "LastUpdated": 1537460025 | |
34 | }, | |
35 | { | |
36 | "ProgressingJobsCount": 0, | |
37 | "Status": "ACTIVE", | |
38 | "Name": "transcode-library", | |
39 | "SubmittedJobsCount": 0, | |
40 | "LastUpdated": 1564066204, | |
41 | "ReservationPlan": { | |
42 | "Status": "ACTIVE", | |
43 | "ReservedSlots": 1, | |
44 | "PurchasedAt": 1564066203, | |
45 | "Commitment": "ONE_YEAR", | |
46 | "ExpiresAt": 1595688603, | |
47 | "RenewalType": "EXPIRE" | |
48 | }, | |
49 | "PricingPlan": "RESERVED", | |
50 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:queues/transcode-library", | |
51 | "Type": "CUSTOM", | |
52 | "CreatedAt": 1564066204 | |
53 | } | |
54 | ] | |
55 | } | |
56 | ||
57 | For more information, see `Working with AWS Elemental MediaConvert Queues <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To list the tags on a MediaConvert queue, job template, or output preset** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists the tags on the specified output preset. :: | |
3 | ||
4 | aws mediaconvert list-tags-for-resource \ | |
5 | --arn arn:aws:mediaconvert:us-west-2:123456789012:presets/SimpleMP4 \ | |
6 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "ResourceTags": { | |
12 | "Tags": { | |
13 | "customer": "zippyVideo" | |
14 | }, | |
15 | "Arn": "arn:aws:mediaconvert:us-west-2:123456789012:presets/SimpleMP4" | |
16 | } | |
17 | } | |
18 | ||
19 | For more information, see `Tagging AWS Elemental MediaConvert Queues, Job Templates, and Output Presets <https://docs.aws.amazon.com/mediaconvert/latest/ug/tagging-queues-templates-presets.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To change a job template** | |
1 | ||
2 | The following ``update-job-template`` example replaces the JSON definition of the specified custom job template with the JSON definition in the provided file. | |
3 | ||
4 | aws mediaconvert update-job-template \ | |
5 | --name File1 \ | |
6 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com \ | |
7 | --cli-input-json file://~/job-template-update.json | |
8 | ||
9 | Contents of ``job-template-update.json``:: | |
10 | ||
11 | { | |
12 | "Description": "A simple job template that generates a single file output.", | |
13 | "Queue": "arn:aws:mediaconvert:us-east-1:012345678998:queues/Default", | |
14 | "Name": "SimpleFile", | |
15 | "Settings": { | |
16 | "OutputGroups": [ | |
17 | { | |
18 | "Name": "File Group", | |
19 | "Outputs": [ | |
20 | { | |
21 | "ContainerSettings": { | |
22 | "Container": "MP4", | |
23 | "Mp4Settings": { | |
24 | "CslgAtom": "INCLUDE", | |
25 | "FreeSpaceBox": "EXCLUDE", | |
26 | "MoovPlacement": "PROGRESSIVE_DOWNLOAD" | |
27 | } | |
28 | }, | |
29 | "VideoDescription": { | |
30 | "ScalingBehavior": "DEFAULT", | |
31 | "TimecodeInsertion": "DISABLED", | |
32 | "AntiAlias": "ENABLED", | |
33 | "Sharpness": 50, | |
34 | "CodecSettings": { | |
35 | "Codec": "H_264", | |
36 | "H264Settings": { | |
37 | "InterlaceMode": "PROGRESSIVE", | |
38 | "NumberReferenceFrames": 3, | |
39 | "Syntax": "DEFAULT", | |
40 | "Softness": 0, | |
41 | "GopClosedCadence": 1, | |
42 | "GopSize": 90, | |
43 | "Slices": 1, | |
44 | "GopBReference": "DISABLED", | |
45 | "SlowPal": "DISABLED", | |
46 | "SpatialAdaptiveQuantization": "ENABLED", | |
47 | "TemporalAdaptiveQuantization": "ENABLED", | |
48 | "FlickerAdaptiveQuantization": "DISABLED", | |
49 | "EntropyEncoding": "CABAC", | |
50 | "Bitrate": 400000, | |
51 | "FramerateControl": "INITIALIZE_FROM_SOURCE", | |
52 | "RateControlMode": "CBR", | |
53 | "CodecProfile": "MAIN", | |
54 | "Telecine": "NONE", | |
55 | "MinIInterval": 0, | |
56 | "AdaptiveQuantization": "HIGH", | |
57 | "CodecLevel": "AUTO", | |
58 | "FieldEncoding": "PAFF", | |
59 | "SceneChangeDetect": "ENABLED", | |
60 | "QualityTuningLevel": "SINGLE_PASS", | |
61 | "FramerateConversionAlgorithm": "DUPLICATE_DROP", | |
62 | "UnregisteredSeiTimecode": "DISABLED", | |
63 | "GopSizeUnits": "FRAMES", | |
64 | "ParControl": "INITIALIZE_FROM_SOURCE", | |
65 | "NumberBFramesBetweenReferenceFrames": 2, | |
66 | "RepeatPps": "DISABLED", | |
67 | "DynamicSubGop": "STATIC" | |
68 | } | |
69 | }, | |
70 | "AfdSignaling": "NONE", | |
71 | "DropFrameTimecode": "ENABLED", | |
72 | "RespondToAfd": "NONE", | |
73 | "ColorMetadata": "INSERT" | |
74 | }, | |
75 | "AudioDescriptions": [ | |
76 | { | |
77 | "AudioTypeControl": "FOLLOW_INPUT", | |
78 | "CodecSettings": { | |
79 | "Codec": "AAC", | |
80 | "AacSettings": { | |
81 | "AudioDescriptionBroadcasterMix": "NORMAL", | |
82 | "Bitrate": 96000, | |
83 | "RateControlMode": "CBR", | |
84 | "CodecProfile": "LC", | |
85 | "CodingMode": "CODING_MODE_2_0", | |
86 | "RawFormat": "NONE", | |
87 | "SampleRate": 48000, | |
88 | "Specification": "MPEG4" | |
89 | } | |
90 | }, | |
91 | "LanguageCodeControl": "FOLLOW_INPUT" | |
92 | } | |
93 | ] | |
94 | } | |
95 | ], | |
96 | "OutputGroupSettings": { | |
97 | "Type": "FILE_GROUP_SETTINGS", | |
98 | "FileGroupSettings": {} | |
99 | } | |
100 | } | |
101 | ], | |
102 | "AdAvailOffset": 0 | |
103 | }, | |
104 | "StatusUpdateInterval": "SECONDS_60", | |
105 | "Priority": 0 | |
106 | } | |
107 | ||
108 | The system returns the JSON payload that you send with your request, even when the request results in an error. Therefore, the JSON returned is not necessarily the new definition of the job template. | |
109 | ||
110 | Because the JSON payload can be long, you might need to scroll up to see any error messages. | |
111 | ||
112 | For more information, see `Working with AWS Elemental MediaConvert Job Templates <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-job-templates.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To change a preset** | |
1 | ||
2 | The following ``update-preset`` example replaces the description for the specified preset. | |
3 | :: | |
4 | ||
5 | aws mediaconvert update-preset \ | |
6 | --name Customer1 \ | |
7 | --description "New description text." | |
8 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
9 | ||
10 | This command produces no output. | |
11 | Output:: | |
12 | ||
13 | { | |
14 | "Preset": { | |
15 | "Arn": "arn:aws:mediaconvert:us-east-1:003235472598:presets/SimpleMP4", | |
16 | "Settings": { | |
17 | ...<output settings removed for brevity>... | |
18 | }, | |
19 | "Type": "CUSTOM", | |
20 | "LastUpdated": 1568938411, | |
21 | "Description": "New description text.", | |
22 | "Name": "SimpleMP4", | |
23 | "CreatedAt": 1568938240 | |
24 | } | |
25 | } | |
26 | ||
27 | For more information, see `Working with AWS Elemental MediaConvert Output Presets <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-presets.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To change a queue** | |
1 | ||
2 | The following ``update-queue`` example pauses the specified queue, by changing its status to ``PAUSED``. :: | |
3 | ||
4 | aws mediaconvert update-queue \ | |
5 | --name Customer1 \ | |
6 | --status PAUSED | |
7 | --endpoint-url https://abcd1234.mediaconvert.us-west-2.amazonaws.com | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "Queue": { | |
13 | "LastUpdated": 1568839845, | |
14 | "Status": "PAUSED", | |
15 | "ProgressingJobsCount": 0, | |
16 | "CreatedAt": 1526428516, | |
17 | "Arn": "arn:aws:mediaconvert:us-west-1:123456789012:queues/Customer1", | |
18 | "Name": "Customer1", | |
19 | "SubmittedJobsCount": 0, | |
20 | "PricingPlan": "ON_DEMAND", | |
21 | "Type": "CUSTOM" | |
22 | } | |
23 | } | |
24 | ||
25 | For more information, see `Working with AWS Elemental MediaConvert Queues <https://docs.aws.amazon.com/mediaconvert/latest/ug/working-with-queues.html>`__ in the *AWS Elemental MediaConvert User Guide*. |
0 | **To delete a container policy** | |
1 | ||
2 | The following ``delete-container-policy`` example deletes the policy that is assigned to the specified container. When the policy is deleted, AWS Elemental MediaStore automatically assigns the default policy to the container. :: | |
3 | ||
4 | aws mediastore delete-container-policy \ | |
5 | --container-name LiveEvents | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `DeleteContainerPolicy <https://docs.aws.amazon.com/mediastore/latest/apireference/API_DeleteContainerPolicy.html>`__ in the *AWS Elemental MediaStore API reference*. |
0 | **To list tags for a container** | |
1 | ||
2 | The following ``list-tags-for-resource`` example displays the tag keys and values assigned to the specified container. :: | |
3 | ||
4 | aws mediastore list-tags-for-resource \ | |
5 | --resource arn:aws:mediastore:us-west-2:1213456789012:container/ExampleContainer | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Tags": [ | |
11 | { | |
12 | "Value": "Test", | |
13 | "Key": "Environment" | |
14 | }, | |
15 | { | |
16 | "Value": "West", | |
17 | "Key": "Region" | |
18 | } | |
19 | ] | |
20 | } | |
21 | ||
22 | For more information, see `ListTagsForResource <https://docs.aws.amazon.com/mediastore/latest/apireference/API_ListTagsForResource.html>`__ in the *AWS Elemental MediaStore API Reference*. |
0 | **To enable access logging on a container** | |
1 | ||
2 | The following ``start-access-logging`` example enable access logging on the specified container. :: | |
3 | ||
4 | aws mediastore start-access-logging \ | |
5 | --container-name LiveEvents | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Enabling Access Logging for a Container <https://docs.aws.amazon.com/mediastore/latest/ug/monitoring-cloudwatch-logs-enable.html>`__ in the *AWS Elemental MediaStore User Guide*. |
0 | **To disable access logging on a container** | |
1 | ||
2 | The following ``stop-access-logging`` example disables access logging on the specified container. :: | |
3 | ||
4 | aws mediastore stop-access-logging \ | |
5 | --container-name LiveEvents | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Disabling Access Logging for a Container <https://docs.aws.amazon.com/mediastore/latest/ug/monitoring-cloudwatch-logs-disable.html>`__ in the *AWS Elemental MediaStore User Guide*. |
0 | **To add tags to a container** | |
1 | ||
2 | The following ``tag-resource`` example adds tag keys and values to the specified container. :: | |
3 | ||
4 | aws mediastore tag-resource \ | |
5 | --resource arn:aws:mediastore:us-west-2:123456789012:container/ExampleContainer \ | |
6 | --tags '[{"Key": "Region", "Value": "West"}, {"Key": "Environment", "Value": "Test"}]' | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `TagResource <https://docs.aws.amazon.com/mediastore/latest/apireference/API_TagResource.html>`__ in the *AWS Elemental MediaStore API Reference*. |
0 | **To remove tags from a container** | |
1 | ||
2 | The following ``untag-resource`` example removes the specified tag key and its associated value from a container. :: | |
3 | ||
4 | aws mediastore untag-resource \ | |
5 | --resource arn:aws:mediastore:us-west-2:123456789012:container/ExampleContainer \ | |
6 | --tag-keys Region | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `UntagResource <https://docs.aws.amazon.com/mediastore/latest/apireference/API_UntagResource.html>`__ in the *AWS Elemental MediaStore API Reference.*. |
0 | **To view the headers for an object** | |
1 | ||
2 | The following ``describe-object`` example displays the headers for an object at the specified path. :: | |
3 | ||
4 | aws mediastore-data describe-object \ | |
5 | --endpoint https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com \ | |
6 | --path events/baseball/setup.jpg | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "LastModified": "Fri, 19 Jul 2019 21:50:31 GMT", | |
12 | "ContentType": "image/jpeg", | |
13 | "ContentLength": "3860266", | |
14 | "ETag": "2aa333bbcc8d8d22d777e999c88d4aa9eeeeee4dd89ff7f555555555555da6d3" | |
15 | } | |
16 | ||
17 | For more information, see `Viewing the Details of an Object <https://docs.aws.amazon.com/mediastore/latest/ug/objects-view-details.html>`__ in the *AWS Elemental MediaStore User Guide*. |
0 | **Example 1: To download an entire object** | |
1 | ||
2 | The following ``get-object`` example downloads the specified object. :: | |
3 | ||
4 | aws mediastore-data get-object \ | |
5 | --endpoint https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com \ | |
6 | --path events/baseball/setup.jpg setup.jpg | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "ContentType": "image/jpeg", | |
12 | "StatusCode": 200, | |
13 | "ETag": "2aa333bbcc8d8d22d777e999c88d4aa9eeeeee4dd89ff7f555555555555da6d3", | |
14 | "ContentLength": "3860266", | |
15 | "LastModified": "Fri, 19 Jul 2019 21:50:31 GMT" | |
16 | } | |
17 | ||
18 | **Example 2: To download part of an object** | |
19 | ||
20 | The following ``get-object`` example downloads the specified part of an object. :: | |
21 | ||
22 | aws mediastore-data get-object \ | |
23 | --endpoint https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com \ | |
24 | --path events/baseball/setup.jpg setup.jpg \ | |
25 | --range "bytes=0-100" | |
26 | ||
27 | Output:: | |
28 | ||
29 | { | |
30 | "StatusCode": 206, | |
31 | "LastModified": "Fri, 19 Jul 2019 21:50:31 GMT", | |
32 | "ContentType": "image/jpeg", | |
33 | "ContentRange": "bytes 0-100/3860266", | |
34 | "ETag": "2aa333bbcc8d8d22d777e999c88d4aa9eeeeee4dd89ff7f555555555555da6d3", | |
35 | "ContentLength": "101" | |
36 | } | |
37 | ||
38 | For more information, see `Downloading an Object <https://docs.aws.amazon.com/mediastore/latest/ug/objects-download.html>`__ in the *AWS Elemental MediaStore User Guide*. |
0 | **Example 1: To view a list of items (objects and folders) stored in a container** | |
1 | ||
2 | The following ``list-items`` example displays a list of items (objects and folders) stored in the specified container. :: | |
3 | ||
4 | aws mediastore-data list-items \ | |
5 | --endpoint https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Items": [ | |
11 | { | |
12 | "Type": "OBJECT", | |
13 | "ContentLength": 3784, | |
14 | "Name": "setup.jpg", | |
15 | "ETag": "2aa333bbcc8d8d22d777e999c88d4aa9eeeeee4dd89ff7f555555555555da6d3", | |
16 | "ContentType": "image/jpeg", | |
17 | "LastModified": 1563571859.379 | |
18 | }, | |
19 | { | |
20 | "Type": "FOLDER", | |
21 | "Name": "events" | |
22 | } | |
23 | ] | |
24 | } | |
25 | ||
26 | **Example 2: To view a list of items (objects and folders) stored in a folder** | |
27 | ||
28 | The following ``list-items`` example displays a list of items (objects and folders) stored in the specified folder. :: | |
29 | ||
30 | aws mediastore-data list-items \ | |
31 | --endpoint https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com \ | |
32 | --path events/baseball | |
33 | ||
34 | Output:: | |
35 | ||
36 | { | |
37 | "Items": [ | |
38 | { | |
39 | "ETag": "2aa333bbcc8d8d22d777e999c88d4aa9eeeeee4dd89ff7f555555555555da6d3", | |
40 | "ContentType": "image/jpeg", | |
41 | "Type": "OBJECT", | |
42 | "ContentLength": 3860266, | |
43 | "LastModified": 1563573031.872, | |
44 | "Name": "setup.jpg" | |
45 | } | |
46 | ] | |
47 | } | |
48 | ||
49 | For more information, see `Viewing a List of Objects <https://docs.aws.amazon.com/mediastore/latest/ug/objects-view-list.html>`__ in the *AWS Elemental MediaStore User Guide*. |
0 | **Example 1: To upload an object to a container** | |
1 | ||
2 | The following ``put-object`` example upload an object to the specified container. :: | |
3 | ||
4 | aws mediastore-data put-object \ | |
5 | --endpoint https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com \ | |
6 | --body ReadMe.md \ | |
7 | --path ReadMe.md \ | |
8 | --cache-control "max-age=6, public" \ | |
9 | --content-type binary/octet-stream | |
10 | ||
11 | Output:: | |
12 | ||
13 | { | |
14 | "ContentSHA256": "f29bc64a9d3732b4b9035125fdb3285f5b6455778edca72414671e0ca3b2e0de", | |
15 | "StorageClass": "TEMPORAL", | |
16 | "ETag": "2aa333bbcc8d8d22d777e999c88d4aa9eeeeee4dd89ff7f555555555555da6d3" | |
17 | } | |
18 | ||
19 | **Example 2: To upload an object to a folder within a container** | |
20 | ||
21 | The following ``put-object`` example upload an object to the specified folder within a container. :: | |
22 | ||
23 | aws mediastore-data put-object \ | |
24 | --endpoint https://aaabbbcccdddee.data.mediastore.us-west-2.amazonaws.com \ | |
25 | --body ReadMe.md \ | |
26 | --path /september-events/ReadMe.md \ | |
27 | --cache-control "max-age=6, public" \ | |
28 | --content-type binary/octet-stream | |
29 | ||
30 | Output:: | |
31 | ||
32 | { | |
33 | "ETag": "2aa333bbcc8d8d22d777e999c88d4aa9eeeeee4dd89ff7f555555555555da6d3", | |
34 | "ContentSHA256": "f29bc64a9d3732b4b9035125fdb3285f5b6455778edca72414671e0ca3b2e0de", | |
35 | "StorageClass": "TEMPORAL" | |
36 | } | |
37 | ||
38 | For more information, see `Uploading an Object <https://docs.aws.amazon.com/mediastore/latest/ug/objects-upload.html>`__ in the *AWS Elemental MediaStore User Guide*. |
0 | **Example 1: To create a ledger with default properties** | |
1 | ||
2 | The following ``create-ledger`` example creates a ledger with the name ``myExampleLedger`` and the permissions mode ``ALLOW_ALL``. The optional parameter for deletion protection is not specified, so it defaults to ``true``. :: | |
3 | ||
4 | aws qldb create-ledger \ | |
5 | --name myExampleLedger \ | |
6 | --permissions-mode ALLOW_ALL | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "State": "CREATING", | |
12 | "Arn": "arn:aws:qldb:us-west-2:123456789012:ledger/myExampleLedger", | |
13 | "DeletionProtection": true, | |
14 | "CreationDateTime": 1568839243.951, | |
15 | "Name": "myExampleLedger" | |
16 | } | |
17 | ||
18 | **Example 2: To create a ledger with deletion protection disabled and with specified tags** | |
19 | ||
20 | The following ``create-ledger`` example creates a ledger with the name ``myExampleLedger2`` and the permissions mode ``ALLOW_ALL``. The deletion protection feature is disabled, and the specified tags are attached to the resource. :: | |
21 | ||
22 | aws qldb create-ledger \ | |
23 | --name myExampleLedger \ | |
24 | --no-deletion-protection \ | |
25 | --permissions-mode ALLOW_ALL \ | |
26 | --tags IsTest=true,Domain=Test | |
27 | ||
28 | Output:: | |
29 | ||
30 | { | |
31 | "Arn": "arn:aws:qldb:us-west-2:123456789012:ledger/myExampleLedger2", | |
32 | "DeletionProtection": false, | |
33 | "CreationDateTime": 1568839543.557, | |
34 | "State": "CREATING", | |
35 | "Name": "myExampleLedger2" | |
36 | } | |
37 | ||
38 | ||
39 | For more information, see `Basic Operations for Amazon QLDB Ledgers <https://docs.aws.amazon.com/qldb/latest/developerguide/ledger-management.basics.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To delete a ledger** | |
1 | ||
2 | The following ``delete-ledger`` example deletes the specified ledger. :: | |
3 | ||
4 | aws qldb delete-ledger \ | |
5 | --name myExampleLedger | |
6 | ||
7 | This command produces no output. | |
8 | ||
9 | For more information, see `Basic Operations for Amazon QLDB Ledgers <https://docs.aws.amazon.com/qldb/latest/developerguide/ledger-management.basics.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To describe a journal export job** | |
1 | ||
2 | The following ``describe-journal-s3-export`` example displays the details for the specified export job from a ledger. :: | |
3 | ||
4 | aws qldb describe-journal-s3-export \ | |
5 | --name myExampleLedger \ | |
6 | --export-id ADR2ONPKN5LINYGb4dp7yZ | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "ExportDescription": { | |
12 | "S3ExportConfiguration": { | |
13 | "Bucket": "awsExampleBucket", | |
14 | "Prefix": "ledgerexport1/", | |
15 | "EncryptionConfiguration": { | |
16 | "ObjectEncryptionType": "SSE_S3" | |
17 | } | |
18 | }, | |
19 | "RoleArn": "arn:aws:iam::123456789012:role/my-s3-export-role", | |
20 | "Status": "COMPLETED", | |
21 | "ExportCreationTime": 1568847801.418, | |
22 | "InclusiveStartTime": 1568764800.0, | |
23 | "ExclusiveEndTime": 1568847599.0, | |
24 | "LedgerName": "myExampleLedger", | |
25 | "ExportId": "ADR2ONPKN5LINYGb4dp7yZ" | |
26 | } | |
27 | } | |
28 | ||
29 | For more information, see `Exporting Your Journal in Amazon QLDB <https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To describe a ledger** | |
1 | ||
2 | The following ``describe-ledger`` example displays the for about the specfied ledger. :: | |
3 | ||
4 | aws qldb describe-ledger \ | |
5 | --name myExampleLedger | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "CreationDateTime": 1568839243.951, | |
11 | "Arn": "arn:aws:qldb:us-west-2:123456789012:ledger/myExampleLedger", | |
12 | "State": "ACTIVE", | |
13 | "Name": "myExampleLedger", | |
14 | "DeletionProtection": true | |
15 | } | |
16 | ||
17 | For more information, see `Basic Operations for Amazon QLDB Ledgers <https://docs.aws.amazon.com/qldb/latest/developerguide/ledger-management.basics.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To export journal blocks to S3** | |
1 | ||
2 | The following ``export-journal-to-s3`` example creates an export job for journal blocks within a specified date and time range from a ledger with the name ``myExampleLedger``. The export job writes the blocks into a specified Amazon S3 bucket. :: | |
3 | ||
4 | aws qldb export-journal-to-s3 \ | |
5 | --name myExampleLedger \ | |
6 | --inclusive-start-time 2019-09-18T00:00:00Z \ | |
7 | --exclusive-end-time 2019-09-18T22:59:59Z \ | |
8 | --role-arn arn:aws:iam::123456789012:role/my-s3-export-role \ | |
9 | --s3-export-configuration file://my-s3-export-config.json | |
10 | ||
11 | Contents of ``my-s3-export-config.json``:: | |
12 | ||
13 | { | |
14 | "Bucket": "awsExampleBucket", | |
15 | "Prefix": "ledgerexport1/", | |
16 | "EncryptionConfiguration": { | |
17 | "ObjectEncryptionType": "SSE_S3" | |
18 | } | |
19 | } | |
20 | ||
21 | Output:: | |
22 | ||
23 | { | |
24 | "ExportId": "ADR2ONPKN5LINYGb4dp7yZ" | |
25 | } | |
26 | ||
27 | For more information, see `Exporting Your Journal in Amazon QLDB <https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To get a journal block and proof for verification** | |
1 | ||
2 | The following ``get-block`` example requests a block data object and a proof from the specified ledger. The request is for a specified digest tip address and block address. :: | |
3 | ||
4 | aws qldb get-block \ | |
5 | --name vehicle-registration \ | |
6 | --block-address file://myblockaddress.json \ | |
7 | --digest-tip-address file://mydigesttipaddress.json | |
8 | ||
9 | Contents of ``myblockaddress.json``:: | |
10 | ||
11 | { | |
12 | "IonText": "{strandId:\"KmA3ZZca7vAIiJAK9S5Iwl\",sequenceNo:100}" | |
13 | } | |
14 | ||
15 | Contents of ``mydigesttipaddress.json``:: | |
16 | ||
17 | { | |
18 | "IonText": "{strandId:\"KmA3ZZca7vAIiJAK9S5Iwl\",sequenceNo:123}" | |
19 | } | |
20 | ||
21 | Output:: | |
22 | ||
23 | { | |
24 | "Block": { | |
25 | "IonText": "{blockAddress:{strandId:\"KmA3ZZca7vAIiJAK9S5Iwl\",sequenceNo:100},transactionId:\"FnQeJBAicTX0Ah32ZnVtSX\",blockTimestamp:2019-09-16T19:37:05.360Z,blockHash:{{NoChM92yKRuJAb/jeLd1VnYn4DHiWIf071ACfic9uHc=}},entriesHash:{{l05LOsiKV14SDbuaYnH7uwXzUvqzIwUiRLXGbTyj/nY=}},previousBlockHash:{{7kewBXhpdbClcZKxhVmpoMHpUGOJtWQD0iY2LPfZkYA=}},entriesHashList:[{{eRSwnmAM7WWANWDd5iGOyK+T4tDXyzUq6HZ/0fgLHos=}},{{mHVex/yjHAWjFPpwhBuH2GKXmKJjK2FBa9faqoUVNtg=}},{{y5cCBr7pOAIUfsVQ1j0TqtE97b4b4oo1R0vnYyE5wWM=}},{{TvTXygML1bMe6NvEZtGkX+KR+W/EJl4qD1mmV77KZQg=}}],transactionInfo:{statements:[{statement:\"FROM VehicleRegistration AS r \\nWHERE r.VIN = '1N4AL11D75C109151'\\nINSERT INTO r.Owners.SecondaryOwners\\n VALUE { 'PersonId' : 'CMVdR77XP8zAglmmFDGTvt' }\",startTime:2019-09-16T19:37:05.302Z,statementDigest:{{jcgPX2vsOJ0waum4qmDYtn1pCAT9xKNIzA+2k4R+mxA=}}}],documents:{JUJgkIcNbhS2goq8RqLuZ4:{tableName:\"VehicleRegistration\",tableId:\"BFJKdXgzt9oF4wjMbuxy4G\",statements:[0]}}},revisions:[{blockAddress:{strandId:\"KmA3ZZca7vAIiJAK9S5Iwl\",sequenceNo:100},hash:{{mHVex/yjHAWjFPpwhBuH2GKXmKJjK2FBa9faqoUVNtg=}},data:{VIN:\"1N4AL11D75C109151\",LicensePlateNumber:\"LEWISR261LL\",State:\"WA\",PendingPenaltyTicketAmount:90.25,ValidFromDate:2017-08-21,ValidToDate:2020-05-11,Owners:{PrimaryOwner:{PersonId:\"BFJKdXhnLRT27sXBnojNGW\"},SecondaryOwners:[{PersonId:\"CMVdR77XP8zAglmmFDGTvt\"}]},City:\"Everett\"},metadata:{id:\"JUJgkIcNbhS2goq8RqLuZ4\",version:3,txTime:2019-09-16T19:37:05.344Z,txId:\"FnQeJBAicTX0Ah32ZnVtSX\"}}]}" | |
26 | }, | |
27 | "Proof": { | |
28 | "IonText": "[{{l3+EXs69K1+rehlqyWLkt+oHDlw4Zi9pCLW/t/mgTPM=}},{{48CXG3ehPqsxCYd34EEa8Fso0ORpWWAO8010RJKf3Do=}},{{9UnwnKSQT0i3ge1JMVa+tMIqCEDaOPTkWxmyHSn8UPQ=}},{{3nW6Vryghk+7pd6wFCtLufgPM6qXHyTNeCb1sCwcDaI=}},{{Irb5fNhBrNEQ1VPhzlnGT/ZQPadSmgfdtMYcwkNOxoI=}},{{+3CWpYG/ytf/vq9GidpzSx6JJiLXt1hMQWNnqOy3jfY=}},{{NPx6cRhwsiy5m9UEWS5JTJrZoUdO2jBOAAOmyZAT+qE=}}]" | |
29 | } | |
30 | } | |
31 | ||
32 | For more information, see `Data Verification in Amazon QLDB <https://docs.aws.amazon.com/qldb/latest/developerguide/verification.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To get a digest for a ledger** | |
1 | ||
2 | The following ``get-digest`` example requests a digest from the specified ledger at the latest committed block in the journal. :: | |
3 | ||
4 | aws qldb get-digest \ | |
5 | --name vehicle-registration | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Digest": "6m6BMXobbJKpMhahwVthAEsN6awgnHK62Qq5McGP1Gk=", | |
11 | "DigestTipAddress": { | |
12 | "IonText": "{strandId:\"KmA3ZZca7vAIiJAK9S5Iwl\",sequenceNo:123}" | |
13 | } | |
14 | } | |
15 | ||
16 | For more information, see `Data Verification in Amazon QLDB <https://docs.aws.amazon.com/qldb/latest/developerguide/verification.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To get a document revision and proof for verification** | |
1 | ||
2 | The following ``get-revision`` example requests a revision data object and a proof from the specified ledger. The request is for a specified digest tip address, document ID, and block address of the revision. :: | |
3 | ||
4 | aws qldb get-revision \ | |
5 | --name vehicle-registration \ | |
6 | --block-address file://myblockaddress.json \ | |
7 | --document-id JUJgkIcNbhS2goq8RqLuZ4 \ | |
8 | --digest-tip-address file://mydigesttipaddress.json | |
9 | ||
10 | Contents of ``myblockaddress.json``:: | |
11 | ||
12 | { | |
13 | "IonText": "{strandId:\"KmA3ZZca7vAIiJAK9S5Iwl\",sequenceNo:100}" | |
14 | } | |
15 | ||
16 | Contents of ``mydigesttipaddress.json``:: | |
17 | ||
18 | { | |
19 | "IonText": "{strandId:\"KmA3ZZca7vAIiJAK9S5Iwl\",sequenceNo:123}" | |
20 | } | |
21 | ||
22 | Output:: | |
23 | ||
24 | { | |
25 | "Revision": { | |
26 | "IonText": "{blockAddress:{strandId:\"KmA3ZZca7vAIiJAK9S5Iwl\",sequenceNo:100},hash:{{mHVex/yjHAWjFPpwhBuH2GKXmKJjK2FBa9faqoUVNtg=}},data:{VIN:\"1N4AL11D75C109151\",LicensePlateNumber:\"LEWISR261LL\",State:\"WA\",PendingPenaltyTicketAmount:90.25,ValidFromDate:2017-08-21,ValidToDate:2020-05-11,Owners:{PrimaryOwner:{PersonId:\"BFJKdXhnLRT27sXBnojNGW\"},SecondaryOwners:[{PersonId:\"CMVdR77XP8zAglmmFDGTvt\"}]},City:\"Everett\"},metadata:{id:\"JUJgkIcNbhS2goq8RqLuZ4\",version:3,txTime:2019-09-16T19:37:05.344Z,txId:\"FnQeJBAicTX0Ah32ZnVtSX\"}}" | |
27 | }, | |
28 | "Proof": { | |
29 | "IonText": "[{{eRSwnmAM7WWANWDd5iGOyK+T4tDXyzUq6HZ/0fgLHos=}},{{VV1rdaNuf+yJZVGlmsM6gr2T52QvBO8Lg+KgpjcnWAU=}},{{7kewBXhpdbClcZKxhVmpoMHpUGOJtWQD0iY2LPfZkYA=}},{{l3+EXs69K1+rehlqyWLkt+oHDlw4Zi9pCLW/t/mgTPM=}},{{48CXG3ehPqsxCYd34EEa8Fso0ORpWWAO8010RJKf3Do=}},{{9UnwnKSQT0i3ge1JMVa+tMIqCEDaOPTkWxmyHSn8UPQ=}},{{3nW6Vryghk+7pd6wFCtLufgPM6qXHyTNeCb1sCwcDaI=}},{{Irb5fNhBrNEQ1VPhzlnGT/ZQPadSmgfdtMYcwkNOxoI=}},{{+3CWpYG/ytf/vq9GidpzSx6JJiLXt1hMQWNnqOy3jfY=}},{{NPx6cRhwsiy5m9UEWS5JTJrZoUdO2jBOAAOmyZAT+qE=}}]" | |
30 | } | |
31 | } | |
32 | ||
33 | For more information, see `Data Verification in Amazon QLDB <https://docs.aws.amazon.com/qldb/latest/developerguide/verification.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To list journal export jobs for a ledger** | |
1 | ||
2 | The following ``list-journal-s3-exports-for-ledger`` example lists journal export jobs for the specified ledger. :: | |
3 | ||
4 | aws qldb list-journal-s3-exports-for-ledger \ | |
5 | --name myExampleLedger | |
6 | ||
7 | This command produces no output. | |
8 | Output:: | |
9 | ||
10 | { | |
11 | "JournalS3Exports": [ | |
12 | { | |
13 | "LedgerName": "myExampleLedger", | |
14 | "ExclusiveEndTime": 1568847599.0, | |
15 | "ExportCreationTime": 1568847801.418, | |
16 | "S3ExportConfiguration": { | |
17 | "Bucket": "awsExampleBucket", | |
18 | "Prefix": "ledgerexport1/", | |
19 | "EncryptionConfiguration": { | |
20 | "ObjectEncryptionType": "SSE_S3" | |
21 | } | |
22 | }, | |
23 | "ExportId": "ADR2ONPKN5LINYGb4dp7yZ", | |
24 | "RoleArn": "arn:aws:iam::123456789012:role/qldb-s3-export", | |
25 | "InclusiveStartTime": 1568764800.0, | |
26 | "Status": "IN_PROGRESS" | |
27 | } | |
28 | ] | |
29 | } | |
30 | ||
31 | For more information, see `Exporting Your Journal in Amazon QLDB <https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.html>`__ in the *Amazon QLDB Developer Guide*.⏎ |
0 | **To list journal export jobs** | |
1 | ||
2 | The following ``list-journal-s3-exports`` example lists journal export jobs for all ledgers that are associated with the current AWS account and Region. :: | |
3 | ||
4 | aws qldb list-journal-s3-exports | |
5 | ||
6 | This command produces no output. | |
7 | Output:: | |
8 | ||
9 | { | |
10 | "JournalS3Exports": [ | |
11 | { | |
12 | "Status": "IN_PROGRESS", | |
13 | "LedgerName": "myExampleLedger", | |
14 | "S3ExportConfiguration": { | |
15 | "EncryptionConfiguration": { | |
16 | "ObjectEncryptionType": "SSE_S3" | |
17 | }, | |
18 | "Bucket": "awsExampleBucket", | |
19 | "Prefix": "ledgerexport1/" | |
20 | }, | |
21 | "RoleArn": "arn:aws:iam::123456789012:role/my-s3-export-role", | |
22 | "ExportCreationTime": 1568847801.418, | |
23 | "ExportId": "ADR2ONPKN5LINYGb4dp7yZ", | |
24 | "InclusiveStartTime": 1568764800.0, | |
25 | "ExclusiveEndTime": 1568847599.0 | |
26 | }, | |
27 | { | |
28 | "Status": "COMPLETED", | |
29 | "LedgerName": "myExampleLedger2", | |
30 | "S3ExportConfiguration": { | |
31 | "EncryptionConfiguration": { | |
32 | "ObjectEncryptionType": "SSE_S3" | |
33 | }, | |
34 | "Bucket": "awsExampleBucket", | |
35 | "Prefix": "ledgerexport1/" | |
36 | }, | |
37 | "RoleArn": "arn:aws:iam::123456789012:role/my-s3-export-role", | |
38 | "ExportCreationTime": 1568846847.638, | |
39 | "ExportId": "2pdvW8UQrjBAiYTMehEJDI", | |
40 | "InclusiveStartTime": 1568592000.0, | |
41 | "ExclusiveEndTime": 1568764800.0 | |
42 | } | |
43 | ] | |
44 | } | |
45 | ||
46 | For more information, see `Exporting Your Journal in Amazon QLDB <https://docs.aws.amazon.com/qldb/latest/developerguide/export-journal.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To list your available ledgers** | |
1 | ||
2 | The following ``list-ledgers`` example lists all ledgers that are associated with the current AWS account and Region. :: | |
3 | ||
4 | aws qldb list-ledgers | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "Ledgers": [ | |
10 | { | |
11 | "State": "ACTIVE", | |
12 | "CreationDateTime": 1568839243.951, | |
13 | "Name": "myExampleLedger" | |
14 | }, | |
15 | { | |
16 | "State": "ACTIVE", | |
17 | "CreationDateTime": 1568839543.557, | |
18 | "Name": "myExampleLedger2" | |
19 | } | |
20 | ] | |
21 | } | |
22 | ||
23 | For more information, see `Basic Operations for Amazon QLDB Ledgers <https://docs.aws.amazon.com/qldb/latest/developerguide/ledger-management.basics.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To list the tags attached to a ledger** | |
1 | ||
2 | The following ``list-tags-for-resource`` example lists all tags attached to the specified ledger. :: | |
3 | ||
4 | aws qldb list-tags-for-resource \ | |
5 | --resource-arn arn:aws:qldb:us-west-2:123456789012:ledger/myExampleLedger | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Tags": { | |
11 | "IsTest": "true", | |
12 | "Domain": "Test" | |
13 | } | |
14 | } | |
15 | ||
16 | For more information, see `Tagging Amazon QLDB Resources <https://docs.aws.amazon.com/qldb/latest/developerguide/tagging.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To tag a ledger** | |
1 | ||
2 | The following ``tag-resource`` example adds a set of tags to a specified ledger. :: | |
3 | ||
4 | aws qldb tag-resource \ | |
5 | --resource-arn arn:aws:qldb:us-west-2:123456789012:ledger/myExampleLedger \ | |
6 | --tags IsTest=true,Domain=Test | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging Amazon QLDB Resources <https://docs.aws.amazon.com/qldb/latest/developerguide/tagging.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To remove tags from a resource** | |
1 | ||
2 | The following ``untag-resource`` example removes tags with the specified tag keys from a specified ledger. :: | |
3 | ||
4 | aws qldb untag-resource \ | |
5 | --resource-arn arn:aws:qldb:us-west-2:123456789012:ledger/myExampleLedger \ | |
6 | --tag-keys IsTest Domain | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Tagging Amazon QLDB Resources <https://docs.aws.amazon.com/qldb/latest/developerguide/tagging.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To update properties of a ledger** | |
1 | ||
2 | The following ``update-ledger`` example updates the specified ledger to disable the deletion protection feature. :: | |
3 | ||
4 | aws qldb update-ledger \ | |
5 | --name myExampleLedger \ | |
6 | --no-deletion-protection | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "CreationDateTime": 1568839243.951, | |
12 | "Arn": "arn:aws:qldb:us-west-2:123456789012:ledger/myExampleLedger", | |
13 | "DeletionProtection": false, | |
14 | "Name": "myExampleLedger", | |
15 | "State": "ACTIVE" | |
16 | } | |
17 | ||
18 | For more information, see `Basic Operations for Amazon QLDB Ledgers <https://docs.aws.amazon.com/qldb/latest/developerguide/ledger-management.basics.html>`__ in the *Amazon QLDB Developer Guide*. |
0 | **To accept a resource share invitation** | |
1 | ||
2 | The following ``reject-resource-share-invitation`` example rejects the specified resource share invitation. :: | |
3 | ||
4 | aws ram reject-resource-share-invitation \ | |
5 | --resource-share-invitation-arn arn:aws:ram:us-west-2:123456789012:resource-share-invitation/arn:aws:ram:us-east-1:210774411744:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourceShareInvitations": [ | |
11 | { | |
12 | "resourceShareInvitationArn": "arn:aws:ram:us-west2-1:21077EXAMPLE:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE", | |
13 | "resourceShareName": "project-resource-share", | |
14 | "resourceShareArn": "arn:aws:ram:us-west-2:21077EXAMPLE:resource-share/fcb639f0-1449-4744-35bc-a983fc0d4ce1", | |
15 | "senderAccountId": "21077EXAMPLE", | |
16 | "receiverAccountId": "123456789012", | |
17 | "invitationTimestamp": 1565319592.463, | |
18 | "status": "ACCEPTED" | |
19 | } | |
20 | ] | |
21 | } | |
22 |
0 | **To associate a resource with a resource share** | |
1 | ||
2 | The following ``associate-resource-share`` example associates the specified subnet with the specified resource share. :: | |
3 | ||
4 | aws ram associate-resource-share \ | |
5 | --resource-arns arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235 \ | |
6 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "resourceShareAssociations": [ | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
13 | "associatedEntity": "arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235", | |
14 | "associationType": "RESOURCE", | |
15 | "status": "ASSOCIATING", | |
16 | "external": false | |
17 | ] | |
18 | } |
0 | **Example 1: To create a resource share** | |
1 | ||
2 | The following ``create-resource-share`` example creates a resource share with the specified name. :: | |
3 | ||
4 | aws ram create-resource-share \ | |
5 | --name my-resource-share | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourceShare": { | |
11 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
12 | "name": "my-resource-share", | |
13 | "owningAccountId": "123456789012", | |
14 | "allowExternalPrincipals": true, | |
15 | "status": "ACTIVE", | |
16 | "creationTime": 1565295733.282, | |
17 | "lastUpdatedTime": 1565295733.282 | |
18 | } | |
19 | } | |
20 | ||
21 | **Example 2: To create a resource share with AWS accounts as principals** | |
22 | ||
23 | The following ``create-resource-share`` example creates a resource share and adds the specified principals. :: | |
24 | ||
25 | aws ram create-resource-share \ | |
26 | --name my-resource-share \ | |
27 | --principals 0abcdef1234567890 | |
28 | ||
29 | **EXAMPLE 3: To create a resource share restricted to your organization in AWS Organizations** | |
30 | ||
31 | The following ``create-resource-share`` example creates a resource share that is restricted to your organization and adds the specified OU as a principal. :: | |
32 | ||
33 | aws ram create-resource-share \ | |
34 | --name my-resource-share \ | |
35 | --no-allow-external-principals \ | |
36 | --principals arn:aws:organizations::123456789012:ou/o-gx7EXAMPLE/ou-29c5-zEXAMPLE | |
37 | ||
38 | Output:: | |
39 | ||
40 | { | |
41 | "resourceShare": { | |
42 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/3ab63985-99d9-1cd2-7d24-75e93EXAMPLE", | |
43 | "name": "my-resource-share", | |
44 | "owningAccountId": "123456789012", | |
45 | "allowExternalPrincipals": false, | |
46 | "status": "ACTIVE", | |
47 | "creationTime": 1565295733.282, | |
48 | "lastUpdatedTime": 1565295733.282 | |
49 | } | |
50 | } |
0 | **To delete a resource share** | |
1 | ||
2 | The following ``delete-resource-share`` example deletes the specified resource share. :: | |
3 | ||
4 | aws ram delete-resource-share \ | |
5 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
6 | ||
7 | The following output indicates success:: | |
8 | ||
9 | { | |
10 | "returnValue": true | |
11 | } |
0 | **To disassociate a resource from a resource share** | |
1 | ||
2 | The following ``disassociate-resource-share`` example disassociates the specified subnet from the specified resource share. :: | |
3 | ||
4 | aws ram disassociate-resource-share \ | |
5 | --resource-arns arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235 \ | |
6 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "resourceShareAssociations": [ | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
13 | "associatedEntity": "arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235", | |
14 | "associationType": "RESOURCE", | |
15 | "status": "DISASSOCIATING", | |
16 | "external": false | |
17 | ] | |
18 | } |
0 | **To enable resource sharing across AWS Organizations** | |
1 | ||
2 | The following ``enable-sharing-with-aws-organization`` example enables resource sharing across your organization or organizational units. :: | |
3 | ||
4 | aws ram enable-sharing-with-aws-organization | |
5 | ||
6 | The following output indicates success. :: | |
7 | ||
8 | { | |
9 | "returnValue": true | |
10 | } |
0 | **To get the policies for a resource** | |
1 | ||
2 | The following ``get-resource-policies`` example displays the policies for the specified subnet associated with a resource share. :: | |
3 | ||
4 | aws ram get-resource-policies \ | |
5 | --resource-arns arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "policies": [ | |
11 | "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Sid\":\"RamStatement1\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[]},\"Action\":[\"ec2:RunInstances\",\"ec2:CreateNetworkInterface\",\"ec2:DescribeSubnets\"],\"Resource\":\"arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235\"}]}" | |
12 | ] | |
13 | } |
0 | **Example 1: To list resource associations** | |
1 | ||
2 | The following ``get-resource-share-associations`` example lists your resource associations. :: | |
3 | ||
4 | aws ram get-resource-share-associations \ | |
5 | --association-type RESOURCE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourceShareAssociations": [ | |
11 | { | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
13 | "associatedEntity": "arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235", | |
14 | "associationType": "RESOURCE", | |
15 | "status": "ASSOCIATED", | |
16 | "creationTime": 1565303590.973, | |
17 | "lastUpdatedTime": 1565303591.695, | |
18 | "external": false | |
19 | } | |
20 | ] | |
21 | } | |
22 | ||
23 | **Example 2: To list principal associations** | |
24 | ||
25 | The following ``get-resource-share-associations`` example lists the principal associations for the specified resource share. :: | |
26 | ||
27 | aws ram get-resource-share-associations \ | |
28 | --association-type PRINCIPAL \ | |
29 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
30 | ||
31 | Output:: | |
32 | ||
33 | { | |
34 | "resourceShareAssociations": [ | |
35 | { | |
36 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
37 | "associatedEntity": "0abcdef1234567890", | |
38 | "associationType": "PRINCIPAL", | |
39 | "status": "ASSOCIATED", | |
40 | "creationTime": 1565296791.818, | |
41 | "lastUpdatedTime": 1565296792.119, | |
42 | "external": true | |
43 | } | |
44 | ] | |
45 | } |
0 | **To list your resource share invitations** | |
1 | ||
2 | The following ``get-resource-share-invitations`` example lists your resource share invitations. :: | |
3 | ||
4 | aws ram get-resource-share-invitations | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "resourceShareInvitations": [ | |
10 | { | |
11 | "resourceShareInvitationArn": "arn:aws:ram:us-west2-1:21077EXAMPLE:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE", | |
12 | "resourceShareName": "project-resource-share", | |
13 | "resourceShareArn": "arn:aws:ram:us-west-2:21077EXAMPLE:resource-share/fcb639f0-1449-4744-35bc-a983fc0d4ce1", | |
14 | "senderAccountId": "21077EXAMPLE", | |
15 | "receiverAccountId": "123456789012", | |
16 | "invitationTimestamp": 1565312166.258, | |
17 | "status": "PENDING" | |
18 | } | |
19 | ] | |
20 | } |
0 | **To list your resource shares** | |
1 | ||
2 | The following ``get-resource-shares`` example lists your resource shares. :: | |
3 | ||
4 | aws ram get-resource-shares \ | |
5 | --resource-owner SELF | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourceShares": [ | |
11 | { | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/3ab63985-99d9-1cd2-7d24-75e93EXAMPLE", | |
13 | "name": "my-resource-share", | |
14 | "owningAccountId": "123456789012", | |
15 | "allowExternalPrincipals": false, | |
16 | "status": "ACTIVE", | |
17 | "tags": [ | |
18 | { | |
19 | "key": "project", | |
20 | "value": "lima" | |
21 | } | |
22 | ] | |
23 | "creationTime": 1565295733.282, | |
24 | "lastUpdatedTime": 1565295733.282 | |
25 | }, | |
26 | { | |
27 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
28 | "name": "my-resource-share", | |
29 | "owningAccountId": "123456789012", | |
30 | "allowExternalPrincipals": true, | |
31 | "status": "ACTIVE", | |
32 | "creationTime": 1565295733.282, | |
33 | "lastUpdatedTime": 1565295733.282 | |
34 | } | |
35 | ] | |
36 | } |
+0
-23
0 | **To accept a resource share invitation** | |
1 | ||
2 | The following ``reject-resource-share-invitation`` example rejects the specified resource share invitation. :: | |
3 | ||
4 | aws ram reject-resource-share-invitation \ | |
5 | --resource-share-invitation-arn arn:aws:ram:us-west-2:123456789012:resource-share-invitation/arn:aws:ram:us-east-1:210774411744:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourceShareInvitations": [ | |
11 | { | |
12 | "resourceShareInvitationArn": "arn:aws:ram:us-west2-1:21077EXAMPLE:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE", | |
13 | "resourceShareName": "project-resource-share", | |
14 | "resourceShareArn": "arn:aws:ram:us-west-2:21077EXAMPLE:resource-share/fcb639f0-1449-4744-35bc-a983fc0d4ce1", | |
15 | "senderAccountId": "21077EXAMPLE", | |
16 | "receiverAccountId": "123456789012", | |
17 | "invitationTimestamp": 1565319592.463, | |
18 | "status": "ACCEPTED" | |
19 | } | |
20 | ] | |
21 | } | |
22 |
+0
-19
0 | **To associate a resource with a resource share** | |
1 | ||
2 | The following ``associate-resource-share`` example associates the specified subnet with the specified resource share. :: | |
3 | ||
4 | aws ram associate-resource-share \ | |
5 | --resource-arns arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235 \ | |
6 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "resourceShareAssociations": [ | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
13 | "associatedEntity": "arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235", | |
14 | "associationType": "RESOURCE", | |
15 | "status": "ASSOCIATING", | |
16 | "external": false | |
17 | ] | |
18 | } |
+0
-51
0 | **Example 1: To create a resource share** | |
1 | ||
2 | The following ``create-resource-share`` example creates a resource share with the specified name. :: | |
3 | ||
4 | aws ram create-resource-share \ | |
5 | --name my-resource-share | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourceShare": { | |
11 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
12 | "name": "my-resource-share", | |
13 | "owningAccountId": "123456789012", | |
14 | "allowExternalPrincipals": true, | |
15 | "status": "ACTIVE", | |
16 | "creationTime": 1565295733.282, | |
17 | "lastUpdatedTime": 1565295733.282 | |
18 | } | |
19 | } | |
20 | ||
21 | **Example 2: To create a resource share with AWS accounts as principals** | |
22 | ||
23 | The following ``create-resource-share`` example creates a resource share and adds the specified principals. :: | |
24 | ||
25 | aws ram create-resource-share \ | |
26 | --name my-resource-share \ | |
27 | --principals 0abcdef1234567890 | |
28 | ||
29 | **EXAMPLE 3: To create a resource share restricted to your organization in AWS Organizations** | |
30 | ||
31 | The following ``create-resource-share`` example creates a resource share that is restricted to your organization and adds the specified OU as a principal. :: | |
32 | ||
33 | aws ram create-resource-share \ | |
34 | --name my-resource-share \ | |
35 | --no-allow-external-principals \ | |
36 | --principals arn:aws:organizations::123456789012:ou/o-gx7EXAMPLE/ou-29c5-zEXAMPLE | |
37 | ||
38 | Output:: | |
39 | ||
40 | { | |
41 | "resourceShare": { | |
42 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/3ab63985-99d9-1cd2-7d24-75e93EXAMPLE", | |
43 | "name": "my-resource-share", | |
44 | "owningAccountId": "123456789012", | |
45 | "allowExternalPrincipals": false, | |
46 | "status": "ACTIVE", | |
47 | "creationTime": 1565295733.282, | |
48 | "lastUpdatedTime": 1565295733.282 | |
49 | } | |
50 | } |
+0
-12
0 | **To delete a resource share** | |
1 | ||
2 | The following ``delete-resource-share`` example deletes the specified resource share. :: | |
3 | ||
4 | aws ram delete-resource-share \ | |
5 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
6 | ||
7 | The following output indicates success:: | |
8 | ||
9 | { | |
10 | "returnValue": true | |
11 | } |
+0
-19
0 | **To disassociate a resource from a resource share** | |
1 | ||
2 | The following ``disassociate-resource-share`` example disassociates the specified subnet from the specified resource share. :: | |
3 | ||
4 | aws ram disassociate-resource-share \ | |
5 | --resource-arns arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235 \ | |
6 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "resourceShareAssociations": [ | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
13 | "associatedEntity": "arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235", | |
14 | "associationType": "RESOURCE", | |
15 | "status": "DISASSOCIATING", | |
16 | "external": false | |
17 | ] | |
18 | } |
+0
-11
0 | **To enable resource sharing across AWS Organizations** | |
1 | ||
2 | The following ``enable-sharing-with-aws-organization`` example enables resource sharing across your organization or organizational units. :: | |
3 | ||
4 | aws ram enable-sharing-with-aws-organization | |
5 | ||
6 | The following output indicates success. :: | |
7 | ||
8 | { | |
9 | "returnValue": true | |
10 | } |
+0
-14
0 | **To get the policies for a resource** | |
1 | ||
2 | The following ``get-resource-policies`` example displays the policies for the specified subnet associated with a resource share. :: | |
3 | ||
4 | aws ram get-resource-policies \ | |
5 | --resource-arns arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "policies": [ | |
11 | "{\"Version\":\"2008-10-17\",\"Statement\":[{\"Sid\":\"RamStatement1\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":[]},\"Action\":[\"ec2:RunInstances\",\"ec2:CreateNetworkInterface\",\"ec2:DescribeSubnets\"],\"Resource\":\"arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235\"}]}" | |
12 | ] | |
13 | } |
+0
-46
0 | **Example 1: To list resource associations** | |
1 | ||
2 | The following ``get-resource-share-associations`` example lists your resource associations. :: | |
3 | ||
4 | aws ram get-resource-share-associations \ | |
5 | --association-type RESOURCE | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourceShareAssociations": [ | |
11 | { | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
13 | "associatedEntity": "arn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235", | |
14 | "associationType": "RESOURCE", | |
15 | "status": "ASSOCIATED", | |
16 | "creationTime": 1565303590.973, | |
17 | "lastUpdatedTime": 1565303591.695, | |
18 | "external": false | |
19 | } | |
20 | ] | |
21 | } | |
22 | ||
23 | **Example 2: To list principal associations** | |
24 | ||
25 | The following ``get-resource-share-associations`` example lists the principal associations for the specified resource share. :: | |
26 | ||
27 | aws ram get-resource-share-associations \ | |
28 | --association-type PRINCIPAL \ | |
29 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
30 | ||
31 | Output:: | |
32 | ||
33 | { | |
34 | "resourceShareAssociations": [ | |
35 | { | |
36 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
37 | "associatedEntity": "0abcdef1234567890", | |
38 | "associationType": "PRINCIPAL", | |
39 | "status": "ASSOCIATED", | |
40 | "creationTime": 1565296791.818, | |
41 | "lastUpdatedTime": 1565296792.119, | |
42 | "external": true | |
43 | } | |
44 | ] | |
45 | } |
+0
-21
0 | **To list your resource share invitations** | |
1 | ||
2 | The following ``get-resource-share-invitations`` example lists your resource share invitations. :: | |
3 | ||
4 | aws ram get-resource-share-invitations | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "resourceShareInvitations": [ | |
10 | { | |
11 | "resourceShareInvitationArn": "arn:aws:ram:us-west2-1:21077EXAMPLE:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE", | |
12 | "resourceShareName": "project-resource-share", | |
13 | "resourceShareArn": "arn:aws:ram:us-west-2:21077EXAMPLE:resource-share/fcb639f0-1449-4744-35bc-a983fc0d4ce1", | |
14 | "senderAccountId": "21077EXAMPLE", | |
15 | "receiverAccountId": "123456789012", | |
16 | "invitationTimestamp": 1565312166.258, | |
17 | "status": "PENDING" | |
18 | } | |
19 | ] | |
20 | } |
+0
-37
0 | **To list your resource shares** | |
1 | ||
2 | The following ``get-resource-shares`` example lists your resource shares. :: | |
3 | ||
4 | aws ram get-resource-shares \ | |
5 | --resource-owner SELF | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "resourceShares": [ | |
11 | { | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/3ab63985-99d9-1cd2-7d24-75e93EXAMPLE", | |
13 | "name": "my-resource-share", | |
14 | "owningAccountId": "123456789012", | |
15 | "allowExternalPrincipals": false, | |
16 | "status": "ACTIVE", | |
17 | "tags": [ | |
18 | { | |
19 | "key": "project", | |
20 | "value": "lima" | |
21 | } | |
22 | ] | |
23 | "creationTime": 1565295733.282, | |
24 | "lastUpdatedTime": 1565295733.282 | |
25 | }, | |
26 | { | |
27 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
28 | "name": "my-resource-share", | |
29 | "owningAccountId": "123456789012", | |
30 | "allowExternalPrincipals": true, | |
31 | "status": "ACTIVE", | |
32 | "creationTime": 1565295733.282, | |
33 | "lastUpdatedTime": 1565295733.282 | |
34 | } | |
35 | ] | |
36 | } |
+0
-20
0 | **To list principals with access to a resource** | |
1 | ||
2 | The following ``list-principals`` example displays a list of the principals that can access the subnets associated with a resource share. :: | |
3 | ||
4 | aws ram list-principals \ | |
5 | --resource-type ec2:Subnet | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "principals": [ | |
11 | { | |
12 | "id": "arn:aws:organizations::123456789012:ou/o-gx7EXAMPLE/ou-29c5-zEXAMPLE", | |
13 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
14 | "creationTime": 1565298209.737, | |
15 | "lastUpdatedTime": 1565298211.019, | |
16 | "external": false | |
17 | } | |
18 | ] | |
19 | } |
+0
-22
0 | **To list the resources associated with a resource share** | |
1 | ||
2 | The following ``list-resources`` example lists the subnets that you added to the specified resource share. :: | |
3 | ||
4 | aws ram list-resources \ | |
5 | --resource-type ec2:Subnet \ | |
6 | --resource-owner SELF \ | |
7 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "resources": [ | |
13 | { | |
14 | "arn": "aarn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235", | |
15 | "type": "ec2:Subnet", | |
16 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
17 | "creationTime": 1565301545.023, | |
18 | "lastUpdatedTime": 1565301545.947 | |
19 | } | |
20 | ] | |
21 | } |
+0
-20
0 | **To reject a resource share invitation** | |
1 | ||
2 | The following ``reject-resource-share-invitation`` example rejects the specified resource share invitation. :: | |
3 | ||
4 | aws ram reject-resource-share-invitation \ | |
5 | --resource-share-invitation-arn arn:aws:ram:us-west-2:123456789012:resource-share-invitation/arn:aws:ram:us-east-1:210774411744:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | "resourceShareInvitations": [ | |
10 | { | |
11 | "resourceShareInvitationArn": "arn:aws:ram:us-west2-1:21077EXAMPLE:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE", | |
12 | "resourceShareName": "project-resource-share", | |
13 | "resourceShareArn": "arn:aws:ram:us-west-2:21077EXAMPLE:resource-share/fcb639f0-1449-4744-35bc-a983fc0d4ce1", | |
14 | "senderAccountId": "21077EXAMPLE", | |
15 | "receiverAccountId": "123456789012", | |
16 | "invitationTimestamp": 1565319592.463, | |
17 | "status": "REJECTED" | |
18 | } | |
19 | ] |
0 | **To add tags to a resource share** | |
1 | ||
2 | The following ``tag-resource`` example adds a tag key ``project`` and associated value ``lima`` to the specified resource share. :: | |
3 | ||
4 | aws ram tag-resource \ | |
5 | --tags key=project,value=lima | |
6 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
7 | ||
8 | This command produces no output.⏎ |
0 | **To remove tags from a resource share** | |
1 | ||
2 | The following ``untag-resource`` example removes the ``project`` tag key and associated value from the specified resource share. :: | |
3 | ||
4 | aws ram untag-resource \ | |
5 | --tag-keys project | |
6 | ||
7 | This command produces no output.⏎ |
+0
-21
0 | **To update a resource share** | |
1 | ||
2 | The following ``update-resource-share`` example makes changes to the specified resource share. :: | |
3 | ||
4 | aws ram update-resource-share \ | |
5 | --allow-external-principals \ | |
6 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "resourceShare": { | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
13 | "name": "my-resource-share", | |
14 | "owningAccountId": "123456789012", | |
15 | "allowExternalPrincipals": true, | |
16 | "status": "ACTIVE", | |
17 | "creationTime": 1565295733.282, | |
18 | "lastUpdatedTime": 1565303080.023 | |
19 | } | |
20 | } |
0 | **To list principals with access to a resource** | |
1 | ||
2 | The following ``list-principals`` example displays a list of the principals that can access the subnets associated with a resource share. :: | |
3 | ||
4 | aws ram list-principals \ | |
5 | --resource-type ec2:Subnet | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "principals": [ | |
11 | { | |
12 | "id": "arn:aws:organizations::123456789012:ou/o-gx7EXAMPLE/ou-29c5-zEXAMPLE", | |
13 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
14 | "creationTime": 1565298209.737, | |
15 | "lastUpdatedTime": 1565298211.019, | |
16 | "external": false | |
17 | } | |
18 | ] | |
19 | } |
0 | **To list the resources associated with a resource share** | |
1 | ||
2 | The following ``list-resources`` example lists the subnets that you added to the specified resource share. :: | |
3 | ||
4 | aws ram list-resources \ | |
5 | --resource-type ec2:Subnet \ | |
6 | --resource-owner SELF \ | |
7 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "resources": [ | |
13 | { | |
14 | "arn": "aarn:aws:ec2:us-west-2:123456789012:subnet/subnet-0250c25a1f4e15235", | |
15 | "type": "ec2:Subnet", | |
16 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
17 | "creationTime": 1565301545.023, | |
18 | "lastUpdatedTime": 1565301545.947 | |
19 | } | |
20 | ] | |
21 | } |
0 | **To reject a resource share invitation** | |
1 | ||
2 | The following ``reject-resource-share-invitation`` example rejects the specified resource share invitation. :: | |
3 | ||
4 | aws ram reject-resource-share-invitation \ | |
5 | --resource-share-invitation-arn arn:aws:ram:us-west-2:123456789012:resource-share-invitation/arn:aws:ram:us-east-1:210774411744:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE | |
6 | ||
7 | Output:: | |
8 | ||
9 | "resourceShareInvitations": [ | |
10 | { | |
11 | "resourceShareInvitationArn": "arn:aws:ram:us-west2-1:21077EXAMPLE:resource-share-invitation/32b639f0-14b8-7e8f-55ea-e6117EXAMPLE", | |
12 | "resourceShareName": "project-resource-share", | |
13 | "resourceShareArn": "arn:aws:ram:us-west-2:21077EXAMPLE:resource-share/fcb639f0-1449-4744-35bc-a983fc0d4ce1", | |
14 | "senderAccountId": "21077EXAMPLE", | |
15 | "receiverAccountId": "123456789012", | |
16 | "invitationTimestamp": 1565319592.463, | |
17 | "status": "REJECTED" | |
18 | } | |
19 | ] |
0 | **To add tags to a resource share** | |
1 | ||
2 | The following ``tag-resource`` example adds a tag key ``project`` and associated value ``lima`` to the specified resource share. :: | |
3 | ||
4 | aws ram tag-resource \ | |
5 | --tags key=project,value=lima | |
6 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
7 | ||
8 | This command produces no output.⏎ |
0 | **To remove tags from a resource share** | |
1 | ||
2 | The following ``untag-resource`` example removes the ``project`` tag key and associated value from the specified resource share. :: | |
3 | ||
4 | aws ram untag-resource \ | |
5 | --tag-keys project | |
6 | ||
7 | This command produces no output.⏎ |
0 | **To update a resource share** | |
1 | ||
2 | The following ``update-resource-share`` example makes changes to the specified resource share. :: | |
3 | ||
4 | aws ram update-resource-share \ | |
5 | --allow-external-principals \ | |
6 | --resource-share-arn arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "resourceShare": { | |
12 | "resourceShareArn": "arn:aws:ram:us-west-2:123456789012:resource-share/7ab63972-b505-7e2a-420d-6f5d3EXAMPLE", | |
13 | "name": "my-resource-share", | |
14 | "owningAccountId": "123456789012", | |
15 | "allowExternalPrincipals": true, | |
16 | "status": "ACTIVE", | |
17 | "creationTime": 1565295733.282, | |
18 | "lastUpdatedTime": 1565303080.023 | |
19 | } | |
20 | } |
0 | **To detect a label in an image** | |
1 | ||
2 | The following ``detect-labels`` example detects scenes and objects in an image stored in an Amazon S3 bucket. :: | |
3 | ||
4 | aws rekognition detect-labels \ | |
5 | --image '{"S3Object":{"Bucket":"bucket","Name":"image"}}' | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Labels": [ | |
11 | { | |
12 | "Instances": [], | |
13 | "Confidence": 99.15271759033203, | |
14 | "Parents": [ | |
15 | { | |
16 | "Name": "Vehicle" | |
17 | }, | |
18 | { | |
19 | "Name": "Transportation" | |
20 | } | |
21 | ], | |
22 | "Name": "Automobile" | |
23 | }, | |
24 | { | |
25 | "Instances": [], | |
26 | "Confidence": 99.15271759033203, | |
27 | "Parents": [ | |
28 | { | |
29 | "Name": "Transportation" | |
30 | } | |
31 | ], | |
32 | "Name": "Vehicle" | |
33 | }, | |
34 | { | |
35 | "Instances": [], | |
36 | "Confidence": 99.15271759033203, | |
37 | "Parents": [], | |
38 | "Name": "Transportation" | |
39 | }, | |
40 | { | |
41 | "Instances": [ | |
42 | { | |
43 | "BoundingBox": { | |
44 | "Width": 0.10616336017847061, | |
45 | "Top": 0.5039216876029968, | |
46 | "Left": 0.0037978808395564556, | |
47 | "Height": 0.18528179824352264 | |
48 | }, | |
49 | "Confidence": 99.15271759033203 | |
50 | }, | |
51 | { | |
52 | "BoundingBox": { | |
53 | "Width": 0.2429988533258438, | |
54 | "Top": 0.5251884460449219, | |
55 | "Left": 0.7309805154800415, | |
56 | "Height": 0.21577216684818268 | |
57 | }, | |
58 | "Confidence": 99.1286392211914 | |
59 | }, | |
60 | { | |
61 | "BoundingBox": { | |
62 | "Width": 0.14233611524105072, | |
63 | "Top": 0.5333095788955688, | |
64 | "Left": 0.6494812965393066, | |
65 | "Height": 0.15528248250484467 | |
66 | }, | |
67 | "Confidence": 98.48368072509766 | |
68 | }, | |
69 | { | |
70 | "BoundingBox": { | |
71 | "Width": 0.11086395382881165, | |
72 | "Top": 0.5354844927787781, | |
73 | "Left": 0.10355594009160995, | |
74 | "Height": 0.10271988064050674 | |
75 | }, | |
76 | "Confidence": 96.45606231689453 | |
77 | }, | |
78 | { | |
79 | "BoundingBox": { | |
80 | "Width": 0.06254628300666809, | |
81 | "Top": 0.5573825240135193, | |
82 | "Left": 0.46083059906959534, | |
83 | "Height": 0.053911514580249786 | |
84 | }, | |
85 | "Confidence": 93.65448760986328 | |
86 | }, | |
87 | { | |
88 | "BoundingBox": { | |
89 | "Width": 0.10105438530445099, | |
90 | "Top": 0.534368634223938, | |
91 | "Left": 0.5743985772132874, | |
92 | "Height": 0.12226245552301407 | |
93 | }, | |
94 | "Confidence": 93.06217193603516 | |
95 | }, | |
96 | { | |
97 | "BoundingBox": { | |
98 | "Width": 0.056389667093753815, | |
99 | "Top": 0.5235804319381714, | |
100 | "Left": 0.9427769780158997, | |
101 | "Height": 0.17163699865341187 | |
102 | }, | |
103 | "Confidence": 92.6864013671875 | |
104 | }, | |
105 | { | |
106 | "BoundingBox": { | |
107 | "Width": 0.06003860384225845, | |
108 | "Top": 0.5441341400146484, | |
109 | "Left": 0.22409997880458832, | |
110 | "Height": 0.06737709045410156 | |
111 | }, | |
112 | "Confidence": 90.4227066040039 | |
113 | }, | |
114 | { | |
115 | "BoundingBox": { | |
116 | "Width": 0.02848697081208229, | |
117 | "Top": 0.5107086896896362, | |
118 | "Left": 0, | |
119 | "Height": 0.19150497019290924 | |
120 | }, | |
121 | "Confidence": 86.65286254882812 | |
122 | }, | |
123 | { | |
124 | "BoundingBox": { | |
125 | "Width": 0.04067881405353546, | |
126 | "Top": 0.5566273927688599, | |
127 | "Left": 0.316415935754776, | |
128 | "Height": 0.03428703173995018 | |
129 | }, | |
130 | "Confidence": 85.36471557617188 | |
131 | }, | |
132 | { | |
133 | "BoundingBox": { | |
134 | "Width": 0.043411049991846085, | |
135 | "Top": 0.5394920110702515, | |
136 | "Left": 0.18293385207653046, | |
137 | "Height": 0.0893595889210701 | |
138 | }, | |
139 | "Confidence": 82.21705627441406 | |
140 | }, | |
141 | { | |
142 | "BoundingBox": { | |
143 | "Width": 0.031183116137981415, | |
144 | "Top": 0.5579366683959961, | |
145 | "Left": 0.2853088080883026, | |
146 | "Height": 0.03989990055561066 | |
147 | }, | |
148 | "Confidence": 81.0157470703125 | |
149 | }, | |
150 | { | |
151 | "BoundingBox": { | |
152 | "Width": 0.031113790348172188, | |
153 | "Top": 0.5504819750785828, | |
154 | "Left": 0.2580395042896271, | |
155 | "Height": 0.056484755128622055 | |
156 | }, | |
157 | "Confidence": 56.13441467285156 | |
158 | }, | |
159 | { | |
160 | "BoundingBox": { | |
161 | "Width": 0.08586374670267105, | |
162 | "Top": 0.5438792705535889, | |
163 | "Left": 0.5128012895584106, | |
164 | "Height": 0.08550430089235306 | |
165 | }, | |
166 | "Confidence": 52.37760925292969 | |
167 | } | |
168 | ], | |
169 | "Confidence": 99.15271759033203, | |
170 | "Parents": [ | |
171 | { | |
172 | "Name": "Vehicle" | |
173 | }, | |
174 | { | |
175 | "Name": "Transportation" | |
176 | } | |
177 | ], | |
178 | "Name": "Car" | |
179 | }, | |
180 | { | |
181 | "Instances": [], | |
182 | "Confidence": 98.9914321899414, | |
183 | "Parents": [], | |
184 | "Name": "Human" | |
185 | }, | |
186 | { | |
187 | "Instances": [ | |
188 | { | |
189 | "BoundingBox": { | |
190 | "Width": 0.19360728561878204, | |
191 | "Top": 0.35072067379951477, | |
192 | "Left": 0.43734854459762573, | |
193 | "Height": 0.2742200493812561 | |
194 | }, | |
195 | "Confidence": 98.9914321899414 | |
196 | }, | |
197 | { | |
198 | "BoundingBox": { | |
199 | "Width": 0.03801717236638069, | |
200 | "Top": 0.5010883808135986, | |
201 | "Left": 0.9155802130699158, | |
202 | "Height": 0.06597328186035156 | |
203 | }, | |
204 | "Confidence": 85.02790832519531 | |
205 | } | |
206 | ], | |
207 | "Confidence": 98.9914321899414, | |
208 | "Parents": [], | |
209 | "Name": "Person" | |
210 | }, | |
211 | { | |
212 | "Instances": [], | |
213 | "Confidence": 93.24951934814453, | |
214 | "Parents": [], | |
215 | "Name": "Machine" | |
216 | }, | |
217 | { | |
218 | "Instances": [ | |
219 | { | |
220 | "BoundingBox": { | |
221 | "Width": 0.03561960905790329, | |
222 | "Top": 0.6468243598937988, | |
223 | "Left": 0.7850857377052307, | |
224 | "Height": 0.08878646790981293 | |
225 | }, | |
226 | "Confidence": 93.24951934814453 | |
227 | }, | |
228 | { | |
229 | "BoundingBox": { | |
230 | "Width": 0.02217046171426773, | |
231 | "Top": 0.6149078607559204, | |
232 | "Left": 0.04757237061858177, | |
233 | "Height": 0.07136218994855881 | |
234 | }, | |
235 | "Confidence": 91.5025863647461 | |
236 | }, | |
237 | { | |
238 | "BoundingBox": { | |
239 | "Width": 0.016197510063648224, | |
240 | "Top": 0.6274210214614868, | |
241 | "Left": 0.6472989320755005, | |
242 | "Height": 0.04955997318029404 | |
243 | }, | |
244 | "Confidence": 85.14686584472656 | |
245 | }, | |
246 | { | |
247 | "BoundingBox": { | |
248 | "Width": 0.020207518711686134, | |
249 | "Top": 0.6348286867141724, | |
250 | "Left": 0.7295016646385193, | |
251 | "Height": 0.07059963047504425 | |
252 | }, | |
253 | "Confidence": 83.34547424316406 | |
254 | }, | |
255 | { | |
256 | "BoundingBox": { | |
257 | "Width": 0.020280985161662102, | |
258 | "Top": 0.6171894669532776, | |
259 | "Left": 0.08744934946298599, | |
260 | "Height": 0.05297485366463661 | |
261 | }, | |
262 | "Confidence": 79.9981460571289 | |
263 | }, | |
264 | { | |
265 | "BoundingBox": { | |
266 | "Width": 0.018318990245461464, | |
267 | "Top": 0.623889148235321, | |
268 | "Left": 0.6836880445480347, | |
269 | "Height": 0.06730121374130249 | |
270 | }, | |
271 | "Confidence": 78.87144470214844 | |
272 | }, | |
273 | { | |
274 | "BoundingBox": { | |
275 | "Width": 0.021310249343514442, | |
276 | "Top": 0.6167286038398743, | |
277 | "Left": 0.004064912907779217, | |
278 | "Height": 0.08317798376083374 | |
279 | }, | |
280 | "Confidence": 75.89361572265625 | |
281 | }, | |
282 | { | |
283 | "BoundingBox": { | |
284 | "Width": 0.03604431077837944, | |
285 | "Top": 0.7030032277107239, | |
286 | "Left": 0.9254803657531738, | |
287 | "Height": 0.04569442570209503 | |
288 | }, | |
289 | "Confidence": 64.402587890625 | |
290 | }, | |
291 | { | |
292 | "BoundingBox": { | |
293 | "Width": 0.009834849275648594, | |
294 | "Top": 0.5821820497512817, | |
295 | "Left": 0.28094568848609924, | |
296 | "Height": 0.01964157074689865 | |
297 | }, | |
298 | "Confidence": 62.79907989501953 | |
299 | }, | |
300 | { | |
301 | "BoundingBox": { | |
302 | "Width": 0.01475677452981472, | |
303 | "Top": 0.6137543320655823, | |
304 | "Left": 0.5950819253921509, | |
305 | "Height": 0.039063986390829086 | |
306 | }, | |
307 | "Confidence": 59.40483474731445 | |
308 | } | |
309 | ], | |
310 | "Confidence": 93.24951934814453, | |
311 | "Parents": [ | |
312 | { | |
313 | "Name": "Machine" | |
314 | } | |
315 | ], | |
316 | "Name": "Wheel" | |
317 | }, | |
318 | { | |
319 | "Instances": [], | |
320 | "Confidence": 92.61514282226562, | |
321 | "Parents": [], | |
322 | "Name": "Road" | |
323 | }, | |
324 | { | |
325 | "Instances": [], | |
326 | "Confidence": 92.37877655029297, | |
327 | "Parents": [ | |
328 | { | |
329 | "Name": "Person" | |
330 | } | |
331 | ], | |
332 | "Name": "Sport" | |
333 | }, | |
334 | { | |
335 | "Instances": [], | |
336 | "Confidence": 92.37877655029297, | |
337 | "Parents": [ | |
338 | { | |
339 | "Name": "Person" | |
340 | } | |
341 | ], | |
342 | "Name": "Sports" | |
343 | }, | |
344 | { | |
345 | "Instances": [ | |
346 | { | |
347 | "BoundingBox": { | |
348 | "Width": 0.12326609343290329, | |
349 | "Top": 0.6332163214683533, | |
350 | "Left": 0.44815489649772644, | |
351 | "Height": 0.058117982000112534 | |
352 | }, | |
353 | "Confidence": 92.37877655029297 | |
354 | } | |
355 | ], | |
356 | "Confidence": 92.37877655029297, | |
357 | "Parents": [ | |
358 | { | |
359 | "Name": "Person" | |
360 | }, | |
361 | { | |
362 | "Name": "Sport" | |
363 | } | |
364 | ], | |
365 | "Name": "Skateboard" | |
366 | }, | |
367 | { | |
368 | "Instances": [], | |
369 | "Confidence": 90.62931060791016, | |
370 | "Parents": [ | |
371 | { | |
372 | "Name": "Person" | |
373 | } | |
374 | ], | |
375 | "Name": "Pedestrian" | |
376 | }, | |
377 | { | |
378 | "Instances": [], | |
379 | "Confidence": 88.81334686279297, | |
380 | "Parents": [], | |
381 | "Name": "Asphalt" | |
382 | }, | |
383 | { | |
384 | "Instances": [], | |
385 | "Confidence": 88.81334686279297, | |
386 | "Parents": [], | |
387 | "Name": "Tarmac" | |
388 | }, | |
389 | { | |
390 | "Instances": [], | |
391 | "Confidence": 88.23201751708984, | |
392 | "Parents": [], | |
393 | "Name": "Path" | |
394 | }, | |
395 | { | |
396 | "Instances": [], | |
397 | "Confidence": 80.26520538330078, | |
398 | "Parents": [], | |
399 | "Name": "Urban" | |
400 | }, | |
401 | { | |
402 | "Instances": [], | |
403 | "Confidence": 80.26520538330078, | |
404 | "Parents": [ | |
405 | { | |
406 | "Name": "Building" | |
407 | }, | |
408 | { | |
409 | "Name": "Urban" | |
410 | } | |
411 | ], | |
412 | "Name": "Town" | |
413 | }, | |
414 | { | |
415 | "Instances": [], | |
416 | "Confidence": 80.26520538330078, | |
417 | "Parents": [], | |
418 | "Name": "Building" | |
419 | }, | |
420 | { | |
421 | "Instances": [], | |
422 | "Confidence": 80.26520538330078, | |
423 | "Parents": [ | |
424 | { | |
425 | "Name": "Building" | |
426 | }, | |
427 | { | |
428 | "Name": "Urban" | |
429 | } | |
430 | ], | |
431 | "Name": "City" | |
432 | }, | |
433 | { | |
434 | "Instances": [], | |
435 | "Confidence": 78.37934875488281, | |
436 | "Parents": [ | |
437 | { | |
438 | "Name": "Car" | |
439 | }, | |
440 | { | |
441 | "Name": "Vehicle" | |
442 | }, | |
443 | { | |
444 | "Name": "Transportation" | |
445 | } | |
446 | ], | |
447 | "Name": "Parking Lot" | |
448 | }, | |
449 | { | |
450 | "Instances": [], | |
451 | "Confidence": 78.37934875488281, | |
452 | "Parents": [ | |
453 | { | |
454 | "Name": "Car" | |
455 | }, | |
456 | { | |
457 | "Name": "Vehicle" | |
458 | }, | |
459 | { | |
460 | "Name": "Transportation" | |
461 | } | |
462 | ], | |
463 | "Name": "Parking" | |
464 | }, | |
465 | { | |
466 | "Instances": [], | |
467 | "Confidence": 74.37590026855469, | |
468 | "Parents": [ | |
469 | { | |
470 | "Name": "Building" | |
471 | }, | |
472 | { | |
473 | "Name": "Urban" | |
474 | }, | |
475 | { | |
476 | "Name": "City" | |
477 | } | |
478 | ], | |
479 | "Name": "Downtown" | |
480 | }, | |
481 | { | |
482 | "Instances": [], | |
483 | "Confidence": 69.84622955322266, | |
484 | "Parents": [ | |
485 | { | |
486 | "Name": "Road" | |
487 | } | |
488 | ], | |
489 | "Name": "Intersection" | |
490 | }, | |
491 | { | |
492 | "Instances": [], | |
493 | "Confidence": 57.68518829345703, | |
494 | "Parents": [ | |
495 | { | |
496 | "Name": "Sports Car" | |
497 | }, | |
498 | { | |
499 | "Name": "Car" | |
500 | }, | |
501 | { | |
502 | "Name": "Vehicle" | |
503 | }, | |
504 | { | |
505 | "Name": "Transportation" | |
506 | } | |
507 | ], | |
508 | "Name": "Coupe" | |
509 | }, | |
510 | { | |
511 | "Instances": [], | |
512 | "Confidence": 57.68518829345703, | |
513 | "Parents": [ | |
514 | { | |
515 | "Name": "Car" | |
516 | }, | |
517 | { | |
518 | "Name": "Vehicle" | |
519 | }, | |
520 | { | |
521 | "Name": "Transportation" | |
522 | } | |
523 | ], | |
524 | "Name": "Sports Car" | |
525 | }, | |
526 | { | |
527 | "Instances": [], | |
528 | "Confidence": 56.59492111206055, | |
529 | "Parents": [ | |
530 | { | |
531 | "Name": "Path" | |
532 | } | |
533 | ], | |
534 | "Name": "Sidewalk" | |
535 | }, | |
536 | { | |
537 | "Instances": [], | |
538 | "Confidence": 56.59492111206055, | |
539 | "Parents": [ | |
540 | { | |
541 | "Name": "Path" | |
542 | } | |
543 | ], | |
544 | "Name": "Pavement" | |
545 | }, | |
546 | { | |
547 | "Instances": [], | |
548 | "Confidence": 55.58770751953125, | |
549 | "Parents": [ | |
550 | { | |
551 | "Name": "Building" | |
552 | }, | |
553 | { | |
554 | "Name": "Urban" | |
555 | } | |
556 | ], | |
557 | "Name": "Neighborhood" | |
558 | } | |
559 | ], | |
560 | "LabelModelVersion": "2.0" | |
561 | } | |
562 | ||
563 | For more information, see `Detecting Labels in an Image <https://docs.aws.amazon.com/rekognition/latest/dg/labels-detect-labels-image.html>`__ in the *Amazon Rekognition Developer Guide*. |
0 | **To delete a signing profile** | |
1 | ||
2 | The following ``cancel-signing-profile`` example removes an existing signing profile from AWS Signer. :: | |
3 | ||
4 | aws signer cancel-signing-profile \ | |
5 | --profile-name MyProfile1 | |
6 | ||
7 | This command produces no output. |
0 | **To display details about a signing job** | |
1 | ||
2 | The following ``describe-signing-job`` example displays details about the specified signing job. :: | |
3 | ||
4 | aws signer describe-signing-job \ | |
5 | --job-id 2065c468-73e2-4385-a6c9-0123456789abc | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "status": "Succeeded", | |
11 | "completedAt": 1568412037, | |
12 | "platformId": "AmazonFreeRTOS-Default", | |
13 | "signingMaterial": { | |
14 | "certificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/6a55389b-306b-4e8c-a95c-0123456789abc" | |
15 | }, | |
16 | "statusReason": "Signing Succeeded", | |
17 | "jobId": "2065c468-73e2-4385-a6c9-0123456789abc", | |
18 | "source": { | |
19 | "s3": { | |
20 | "version": "PNyFaUTgsQh5ZdMCcoCe6pT1gOpgB_M4", | |
21 | "bucketName": "signer-source", | |
22 | "key": "MyCode.rb" | |
23 | } | |
24 | }, | |
25 | "profileName": "MyProfile2", | |
26 | "signedObject": { | |
27 | "s3": { | |
28 | "bucketName": "signer-destination", | |
29 | "key": "signed-2065c468-73e2-4385-a6c9-0123456789abc" | |
30 | } | |
31 | }, | |
32 | "requestedBy": "arn:aws:iam::123456789012:user/maria", | |
33 | "createdAt": 1568412036 | |
34 | } |
0 | **To display details about a signing platform** | |
1 | ||
2 | The following ``get-signing-platform`` example displays details about the specified signing platform. :: | |
3 | ||
4 | aws signer get-signing-platform \ | |
5 | --platform-id AmazonFreeRTOS-TI-CC3220SF | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "category": "AWS", | |
11 | "displayName": "Amazon FreeRTOS SHA1-RSA CC3220SF-Format", | |
12 | "target": "SHA1-RSA-TISHA1", | |
13 | "platformId": "AmazonFreeRTOS-TI-CC3220SF", | |
14 | "signingConfiguration": { | |
15 | "encryptionAlgorithmOptions": { | |
16 | "defaultValue": "RSA", | |
17 | "allowedValues": [ | |
18 | "RSA" | |
19 | ] | |
20 | }, | |
21 | "hashAlgorithmOptions": { | |
22 | "defaultValue": "SHA1", | |
23 | "allowedValues": [ | |
24 | "SHA1" | |
25 | ] | |
26 | } | |
27 | }, | |
28 | "maxSizeInMB": 16, | |
29 | "partner": "AmazonFreeRTOS", | |
30 | "signingImageFormat": { | |
31 | "defaultFormat": "JSONEmbedded", | |
32 | "supportedFormats": [ | |
33 | "JSONEmbedded" | |
34 | ] | |
35 | } | |
36 | } |
0 | **To display details about a signing profile** | |
1 | ||
2 | The following ``get-signing-profile`` example displays details about the specified signing profile. :: | |
3 | ||
4 | aws signer get-signing-profile \ | |
5 | --profile-name MyProfile3 | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "platformId": "AmazonFreeRTOS-TI-CC3220SF", | |
11 | "profileName": "MyProfile3", | |
12 | "status": "Active", | |
13 | "signingMaterial": { | |
14 | "certificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/6a55389b-306b-4e8c-a95c-0123456789abc" | |
15 | } | |
16 | } |
0 | **To list all signing jobs** | |
1 | ||
2 | The following ``list-signing-jobs`` example displays details about all signing jobs for the account. :: | |
3 | ||
4 | aws signer list-signing-jobs | |
5 | ||
6 | In this example, two jobs are returned, one successful, and one failed. :: | |
7 | ||
8 | { | |
9 | "jobs": [ | |
10 | { | |
11 | "status": "Succeeded", | |
12 | "signingMaterial": { | |
13 | "certificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/6a55389b-306b-4e8c-a95c-0123456789abc" | |
14 | }, | |
15 | "jobId": "2065c468-73e2-4385-a6c9-0123456789abc", | |
16 | "source": { | |
17 | "s3": { | |
18 | "version": "PNyFaUTgsQh5ZdMCcoCe6pT1gOpgB_M4", | |
19 | "bucketName": "signer-source", | |
20 | "key": "MyCode.rb" | |
21 | } | |
22 | }, | |
23 | "signedObject": { | |
24 | "s3": { | |
25 | "bucketName": "signer-destination", | |
26 | "key": "signed-2065c468-73e2-4385-a6c9-0123456789abc" | |
27 | } | |
28 | }, | |
29 | "createdAt": 1568412036 | |
30 | }, | |
31 | { | |
32 | "status": "Failed", | |
33 | "source": { | |
34 | "s3": { | |
35 | "version": "PNyFaUTgsQh5ZdMCcoCe6pT1gOpgB_M4", | |
36 | "bucketName": "signer-source", | |
37 | "key": "MyOtherCode.rb" | |
38 | } | |
39 | }, | |
40 | "signingMaterial": { | |
41 | "certificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/6a55389b-306b-4e8c-a95c-0123456789abc" | |
42 | }, | |
43 | "createdAt": 1568402690, | |
44 | "jobId": "74d9825e-22fc-4a0d-b962-0123456789abc" | |
45 | } | |
46 | ] | |
47 | } |
0 | **To list all signing platforms** | |
1 | ||
2 | The following ``list-signing-platforms`` example displays details about all available signing platforms. :: | |
3 | ||
4 | aws signer list-signing-platforms | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "platforms": [ | |
10 | { | |
11 | "category": "AWS", | |
12 | "displayName": "AWS IoT Device Management SHA256-ECDSA ", | |
13 | "target": "SHA256-ECDSA", | |
14 | "platformId": "AWSIoTDeviceManagement-SHA256-ECDSA", | |
15 | "signingConfiguration": { | |
16 | "encryptionAlgorithmOptions": { | |
17 | "defaultValue": "ECDSA", | |
18 | "allowedValues": [ | |
19 | "ECDSA" | |
20 | ] | |
21 | }, | |
22 | "hashAlgorithmOptions": { | |
23 | "defaultValue": "SHA256", | |
24 | "allowedValues": [ | |
25 | "SHA256" | |
26 | ] | |
27 | } | |
28 | }, | |
29 | "maxSizeInMB": 2048, | |
30 | "partner": "AWSIoTDeviceManagement", | |
31 | "signingImageFormat": { | |
32 | "defaultFormat": "JSONDetached", | |
33 | "supportedFormats": [ | |
34 | "JSONDetached" | |
35 | ] | |
36 | } | |
37 | }, | |
38 | { | |
39 | "category": "AWS", | |
40 | "displayName": "Amazon FreeRTOS SHA1-RSA CC3220SF-Format", | |
41 | "target": "SHA1-RSA-TISHA1", | |
42 | "platformId": "AmazonFreeRTOS-TI-CC3220SF", | |
43 | "signingConfiguration": { | |
44 | "encryptionAlgorithmOptions": { | |
45 | "defaultValue": "RSA", | |
46 | "allowedValues": [ | |
47 | "RSA" | |
48 | ] | |
49 | }, | |
50 | "hashAlgorithmOptions": { | |
51 | "defaultValue": "SHA1", | |
52 | "allowedValues": [ | |
53 | "SHA1" | |
54 | ] | |
55 | } | |
56 | }, | |
57 | "maxSizeInMB": 16, | |
58 | "partner": "AmazonFreeRTOS", | |
59 | "signingImageFormat": { | |
60 | "defaultFormat": "JSONEmbedded", | |
61 | "supportedFormats": [ | |
62 | "JSONEmbedded" | |
63 | ] | |
64 | } | |
65 | }, | |
66 | { | |
67 | "category": "AWS", | |
68 | "displayName": "Amazon FreeRTOS SHA256-ECDSA", | |
69 | "target": "SHA256-ECDSA", | |
70 | "platformId": "AmazonFreeRTOS-Default", | |
71 | "signingConfiguration": { | |
72 | "encryptionAlgorithmOptions": { | |
73 | "defaultValue": "ECDSA", | |
74 | "allowedValues": [ | |
75 | "ECDSA" | |
76 | ] | |
77 | }, | |
78 | "hashAlgorithmOptions": { | |
79 | "defaultValue": "SHA256", | |
80 | "allowedValues": [ | |
81 | "SHA256" | |
82 | ] | |
83 | } | |
84 | }, | |
85 | "maxSizeInMB": 16, | |
86 | "partner": "AmazonFreeRTOS", | |
87 | "signingImageFormat": { | |
88 | "defaultFormat": "JSONEmbedded", | |
89 | "supportedFormats": [ | |
90 | "JSONEmbedded" | |
91 | ] | |
92 | } | |
93 | } | |
94 | ] | |
95 | } |
0 | **To list all signing profiles** | |
1 | ||
2 | The following ``list-signing-profiles`` example displays details about all signing profiles for the account. :: | |
3 | ||
4 | aws signer list-signing-profiles | |
5 | ||
6 | Output:: | |
7 | ||
8 | { | |
9 | "profiles": [ | |
10 | { | |
11 | "platformId": "AmazonFreeRTOS-TI-CC3220SF", | |
12 | "profileName": "MyProfile4", | |
13 | "status": "Active", | |
14 | "signingMaterial": { | |
15 | "certificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/6a55389b-306b-4e8c-a95c-0123456789abc" | |
16 | } | |
17 | }, | |
18 | { | |
19 | "platformId": "AWSIoTDeviceManagement-SHA256-ECDSA", | |
20 | "profileName": "MyProfile5", | |
21 | "status": "Active", | |
22 | "signingMaterial": { | |
23 | "certificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/6a55389b-306b-4e8c-a95c-0123456789abc" | |
24 | } | |
25 | } | |
26 | ] | |
27 | } |
0 | **To create a signing profile** | |
1 | ||
2 | The following ``put-signing-profile`` example creates a signing profile using the specified certificate and platform. :: | |
3 | ||
4 | aws signer put-signing-profile \ | |
5 | --profile-name MyProfile6 \ | |
6 | --signing-material certificateArn=arn:aws:acm:us-west-2:123456789012:certificate/6a55389b-306b-4e8c-a95c-0123456789abc \ | |
7 | --platform AmazonFreeRTOS-TI-CC3220SF | |
8 | ||
9 | Output:: | |
10 | ||
11 | { | |
12 | "arn": "arn:aws:signer:us-west-2:123456789012:/signing-profiles/MyProfile6" | |
13 | } |
0 | **To start a signing job** | |
1 | ||
2 | The following ``start-signing-job`` example starts a signing job on the code found at the specified source. It uses the specified profile to do the signing and places the signed code in the specified destination. :: | |
3 | ||
4 | aws signer start-signing-job \ | |
5 | --source 's3={bucketName=signer-source,key=MyCode.rb,version=PNyFaUTgsQh5ZdMCcoCe6pT1gOpgB_M4}' \ | |
6 | --destination 's3={bucketName=signer-destination,prefix=signed-}' \ | |
7 | --profile-name MyProfile7 | |
8 | ||
9 | The output is the ID of the signing job. :: | |
10 | ||
11 | { | |
12 | "jobId": "2065c468-73e2-4385-a6c9-0123456789abc" | |
13 | } |
0 | **To list all cost allocation tags for a queue** | |
1 | ||
2 | The following ``list-queue-tags`` example displays all of the cost allocation tags associated with the specified queue. :: | |
3 | ||
4 | aws sqs list-queue-tags \ | |
5 | --queue-url https://sqs.us-west-2.amazonaws.com/123456789012/MyQueue | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Tags": { | |
11 | "Team": "Alpha" | |
12 | } | |
13 | } | |
14 | ||
15 | For more information, see `Listing Cost Allocation Tags <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html>`__ in the *Amazon Simple Queue Service Developer Guide*. |
0 | **To add cost allocation tags to a queue** | |
1 | ||
2 | The following ``tag-queue`` example adds a cost allocation tag to the specified Amazon SQS queue. :: | |
3 | ||
4 | aws sqs tag-queue \ | |
5 | --queue-url https://sqs.us-west-2.amazonaws.com/123456789012/MyQueue \ | |
6 | --tags Priority=Highest | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Adding Cost Allocation Tags <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html>`__ in the *Amazon Simple Queue Service Developer Guide*. |
0 | **To remove cost allocation tags from a queue** | |
1 | ||
2 | The following ``untag-queue`` example removes a cost allocation tag from the specified Amazon SQS queue. :: | |
3 | ||
4 | aws sqs tag-queue \ | |
5 | --queue-url https://sqs.us-west-2.amazonaws.com/123456789012/MyQueue \ | |
6 | --tag-keys "Priority" | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Adding Cost Allocation Tags <https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html>`__ in the *Amazon Simple Queue Service Developer Guide*. |
0 | **To create a notification subscription** | |
1 | ||
2 | The following ``create-notification-subscription`` example configures a notification subscription for the specified Amazon WorkDocs organization. :: | |
3 | ||
4 | aws workdocs create-notification-subscription \ | |
5 | --organization-id d-123456789c \ | |
6 | --protocol HTTPS \ | |
7 | --subscription-type ALL \ | |
8 | --notification-endpoint "https://example.com/example" | |
9 | ||
10 | Output:: | |
11 | ||
12 | { | |
13 | "Subscription": { | |
14 | "SubscriptionId": "123ab4c5-678d-901e-f23g-45h6789j0123", | |
15 | "EndPoint": "https://example.com/example", | |
16 | "Protocol": "HTTPS" | |
17 | } | |
18 | } | |
19 | ||
20 | For more information, see `Subscribe to Notifications <https://docs.aws.amazon.com/workdocs/latest/developerguide/subscribe-notifications.html>`__ in the *Amazon WorkDocs Developer Guide*. |
0 | **To delete a notification subscription** | |
1 | ||
2 | The following ``delete-notification-subscription`` example deletes the specified notification subscription. :: | |
3 | ||
4 | aws workdocs delete-notification-subscription \ | |
5 | --subscription-id 123ab4c5-678d-901e-f23g-45h6789j0123 \ | |
6 | --organization-id d-123456789c | |
7 | ||
8 | This command produces no output. | |
9 | ||
10 | For more information, see `Subscribe to Notifications <https://docs.aws.amazon.com/workdocs/latest/developerguide/subscribe-notifications.html>`__ in the *Amazon WorkDocs Developer Guide*. |
0 | **To retrieve a list of groups** | |
1 | ||
2 | The following ``describe-groups`` example lists the groups associated with the specified Amazon WorkDocs organization. :: | |
3 | ||
4 | aws workdocs describe-groups \ | |
5 | --search-query "e" \ | |
6 | --organization-id d-123456789c | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Groups": [ | |
12 | { | |
13 | "Id": "S-1-1-11-1122222222-2222233333-3333334444-4444&d-123456789c", | |
14 | "Name": "Example Group 1" | |
15 | }, | |
16 | { | |
17 | "Id": "S-1-1-11-1122222222-2222233333-3333334444-5555&d-123456789c", | |
18 | "Name": "Example Group 2" | |
19 | } | |
20 | ] | |
21 | } | |
22 | ||
23 | For more information, see `Getting Started with Amazon WorkDocs <https://docs.aws.amazon.com/workdocs/latest/adminguide/getting_started.html>`__ in the *Amazon WorkDocs Administration Guide*. |
0 | **To retrieve a list of notification subscriptions** | |
1 | ||
2 | The following ``describe-notification-subscriptions`` example retrieves the notification subscriptions for the specified Amazon WorkDocs organization. :: | |
3 | ||
4 | aws workdocs describe-notification-subscriptions \ | |
5 | --organization-id d-123456789c | |
6 | ||
7 | Output:: | |
8 | ||
9 | { | |
10 | "Subscriptions": [ | |
11 | { | |
12 | "SubscriptionId": "123ab4c5-678d-901e-f23g-45h6789j0123", | |
13 | "EndPoint": "https://example.com/example", | |
14 | "Protocol": "HTTPS" | |
15 | } | |
16 | ] | |
17 | } | |
18 | ||
19 | For more information, see `Subscribe to Notifications <https://docs.aws.amazon.com/workdocs/latest/developerguide/subscribe-notifications.html>`__ in the *Amazon WorkDocs Developer Guide*. |
0 | **To retrieve shared resources** | |
1 | ||
2 | The following ``get-resources`` example retrieves the resources shared with the specified Amazon WorkDocs user. :: | |
3 | ||
4 | aws workdocs get-resources \ | |
5 | --user-id "S-1-1-11-1111111111-2222222222-3333333333-3333" \ | |
6 | --collection-type SHARED_WITH_ME | |
7 | ||
8 | Output:: | |
9 | ||
10 | { | |
11 | "Folders": [], | |
12 | "Documents": [] | |
13 | } | |
14 | ||
15 | For more information, see `Sharing Files and Folders <https://docs.aws.amazon.com/workdocs/latest/userguide/share-docs.html>`__ in the *Amazon WorkDocs User Guide*. |
100 | 100 | 'serverlessapplicationrepository.update-application.home-page-url', |
101 | 101 | 'serverlessapplicationrepository.update-application.readme-url', |
102 | 102 | |
103 | 'service-catalog.create-product.support-url', | |
104 | 'service-catalog.update-product.support-url', | |
105 | ||
103 | 106 | 'sqs.add-permission.queue-url', |
104 | 107 | 'sqs.change-message-visibility.queue-url', |
105 | 108 | 'sqs.change-message-visibility-batch.queue-url', |
17 | 17 | |
18 | 18 | from awscli.utils import is_a_tty |
19 | 19 | from awscli.compat import six |
20 | ||
21 | ||
22 | # `autoreset` allows us to not have to sent reset sequences for every | |
23 | # string. `strip` lets us preserve color when redirecting. | |
24 | COLORAMA_KWARGS = { | |
25 | 'autoreset': True, | |
26 | 'strip': False, | |
27 | } | |
20 | 28 | |
21 | 29 | |
22 | 30 | def get_text_length(text): |
154 | 162 | |
155 | 163 | class ColorizedStyler(Styler): |
156 | 164 | def __init__(self): |
157 | # `autoreset` allows us to not have to sent reset sequences for every | |
158 | # string. `strip` lets us preserve color when redirecting. | |
159 | colorama.init(autoreset=True, strip=False) | |
165 | colorama.init(**COLORAMA_KWARGS) | |
160 | 166 | |
161 | 167 | def style_title(self, text): |
162 | 168 | # Originally bold + underline |
0 | 0 | Metadata-Version: 1.1 |
1 | 1 | Name: awscli |
2 | Version: 1.16.218 | |
2 | Version: 1.16.251 | |
3 | 3 | Summary: Universal Command Line Environment for AWS. |
4 | 4 | Home-page: http://aws.amazon.com/cli/ |
5 | 5 | Author: Amazon Web Services |
322 | 322 | awscli/examples/apigatewayv2/create-integration.rst |
323 | 323 | awscli/examples/apigatewayv2/create-route.rst |
324 | 324 | awscli/examples/application-autoscaling/delete-scaling-policy.rst |
325 | awscli/examples/application-autoscaling/delete-scheduled-action.rst | |
325 | 326 | awscli/examples/application-autoscaling/deregister-scalable-target.rst |
326 | 327 | awscli/examples/application-autoscaling/describe-scalable-targets.rst |
327 | 328 | awscli/examples/application-autoscaling/describe-scaling-activities.rst |
328 | 329 | awscli/examples/application-autoscaling/describe-scaling-policies.rst |
330 | awscli/examples/application-autoscaling/describe-scheduled-actions.rst | |
329 | 331 | awscli/examples/application-autoscaling/put-scaling-policy.rst |
330 | 332 | awscli/examples/application-autoscaling/put-scheduled-action.rst |
331 | 333 | awscli/examples/application-autoscaling/register-scalable-target.rst |
411 | 413 | awscli/examples/autoscaling/update-auto-scaling-group.rst |
412 | 414 | awscli/examples/autoscaling-plans/create-scaling-plan.rst |
413 | 415 | awscli/examples/autoscaling-plans/delete-scaling-plan.rst |
416 | awscli/examples/autoscaling-plans/describe-scaling-plan-resources.rst | |
417 | awscli/examples/autoscaling-plans/describe-scaling-plans.rst | |
418 | awscli/examples/autoscaling-plans/get-scaling-plan-resource-forecast-data.rst | |
419 | awscli/examples/autoscaling-plans/update-scaling-plan.rst | |
420 | awscli/examples/backup/create-backup-plan.rst | |
421 | awscli/examples/backup/create-backup-vault.rst | |
422 | awscli/examples/backup/get-backup-plan-from-template.rst | |
423 | awscli/examples/backup/get-backup-plan.rst | |
414 | 424 | awscli/examples/batch/cancel-job.rst |
415 | 425 | awscli/examples/batch/create-compute-environment.rst |
416 | 426 | awscli/examples/batch/create-job-queue.rst |
446 | 456 | awscli/examples/ce/get-reservation-purchase-recommendation.rst |
447 | 457 | awscli/examples/ce/get-reservation-utilization.rst |
448 | 458 | awscli/examples/ce/get-tags.rst |
459 | awscli/examples/chime/associate-phone-number-with-user.rst | |
460 | awscli/examples/chime/associate-phone-numbers-with-voice-connector.rst | |
461 | awscli/examples/chime/batch-delete-phone-number.rst | |
449 | 462 | awscli/examples/chime/batch-suspend-user.rst |
450 | 463 | awscli/examples/chime/batch-unsuspend-user.rst |
464 | awscli/examples/chime/batch-update-phone-number.rst | |
451 | 465 | awscli/examples/chime/batch-update-user.rst |
452 | 466 | awscli/examples/chime/create-account.rst |
467 | awscli/examples/chime/create-bot.rst | |
468 | awscli/examples/chime/create-phone-number-order.rst | |
469 | awscli/examples/chime/create-voice-connector.rst | |
453 | 470 | awscli/examples/chime/delete-account.rst |
471 | awscli/examples/chime/delete-phone-number.rst | |
472 | awscli/examples/chime/delete-voice-connector-origination.rst | |
473 | awscli/examples/chime/delete-voice-connector-termination-credentials.rst | |
474 | awscli/examples/chime/delete-voice-connector-termination.rst | |
475 | awscli/examples/chime/delete-voice-connector.rst | |
476 | awscli/examples/chime/disassociate-phone-number-from-user.rst | |
477 | awscli/examples/chime/disassociate-phone-numbers-from-voice-connector.rst | |
454 | 478 | awscli/examples/chime/get-account-settings.rst |
455 | 479 | awscli/examples/chime/get-account.rst |
480 | awscli/examples/chime/get-bot.rst | |
481 | awscli/examples/chime/get-global-settings.rst | |
482 | awscli/examples/chime/get-phone-number-order.rst | |
483 | awscli/examples/chime/get-phone-number.rst | |
484 | awscli/examples/chime/get-user-settings.rst | |
456 | 485 | awscli/examples/chime/get-user.rst |
486 | awscli/examples/chime/get-voice-connector-origination.rst | |
487 | awscli/examples/chime/get-voice-connector-termination-health.rst | |
488 | awscli/examples/chime/get-voice-connector-termination.rst | |
489 | awscli/examples/chime/get-voice-connector.rst | |
457 | 490 | awscli/examples/chime/invite-users.rst |
458 | 491 | awscli/examples/chime/list-accounts.rst |
492 | awscli/examples/chime/list-bots.rst | |
493 | awscli/examples/chime/list-phone-number-orders.rst | |
494 | awscli/examples/chime/list-phone-numbers.rst | |
459 | 495 | awscli/examples/chime/list-users.rst |
496 | awscli/examples/chime/list-voice-connector-termination-credentials.rst | |
497 | awscli/examples/chime/list-voice-connectors.rst | |
460 | 498 | awscli/examples/chime/logout-user.rst |
499 | awscli/examples/chime/put-voice-connector-origination.rst | |
500 | awscli/examples/chime/put-voice-connector-termination-credentials.rst | |
501 | awscli/examples/chime/put-voice-connector-termination.rst | |
502 | awscli/examples/chime/regenerate-security-token.rst | |
461 | 503 | awscli/examples/chime/reset-personal-pin.rst |
504 | awscli/examples/chime/restore-phone-number.rst | |
505 | awscli/examples/chime/search-available-phone-numbers.rst | |
462 | 506 | awscli/examples/chime/update-account-settings.rst |
463 | 507 | awscli/examples/chime/update-account.rst |
508 | awscli/examples/chime/update-bot.rst | |
509 | awscli/examples/chime/update-global-settings.rst | |
510 | awscli/examples/chime/update-phone-number.rst | |
511 | awscli/examples/chime/update-user-settings.rst | |
464 | 512 | awscli/examples/chime/update-user.rst |
513 | awscli/examples/chime/update-voice-connector.rst | |
465 | 514 | awscli/examples/cloud9/create-environment-ec2.rst |
466 | 515 | awscli/examples/cloud9/create-environment-membership.rst |
467 | 516 | awscli/examples/cloud9/delete-environment-membership.rst |
540 | 589 | awscli/examples/codebuild/stop-build.rst |
541 | 590 | awscli/examples/codebuild/update-project.rst |
542 | 591 | awscli/examples/codebuild/update-webhook.rst |
592 | awscli/examples/codecommit/batch-describe-merge-conflicts.rst | |
593 | awscli/examples/codecommit/batch-get-commits.rst | |
543 | 594 | awscli/examples/codecommit/batch-get-repositories.rst |
544 | 595 | awscli/examples/codecommit/create-branch.rst |
545 | 596 | awscli/examples/codecommit/create-commit.rst |
546 | 597 | awscli/examples/codecommit/create-pull-request.rst |
547 | 598 | awscli/examples/codecommit/create-repository.rst |
599 | awscli/examples/codecommit/create-unreferenced-merge-commit.rst | |
548 | 600 | awscli/examples/codecommit/credential-helper.rst |
549 | 601 | awscli/examples/codecommit/delete-branch.rst |
550 | 602 | awscli/examples/codecommit/delete-comment-content.rst |
551 | 603 | awscli/examples/codecommit/delete-file.rst |
552 | 604 | awscli/examples/codecommit/delete-repository.rst |
605 | awscli/examples/codecommit/describe-merge-conflicts.rst | |
553 | 606 | awscli/examples/codecommit/describe-pull-request-events.rst |
554 | 607 | awscli/examples/codecommit/get-blob.rst |
555 | 608 | awscli/examples/codecommit/get-branch.rst |
560 | 613 | awscli/examples/codecommit/get-differences.rst |
561 | 614 | awscli/examples/codecommit/get-file.rst |
562 | 615 | awscli/examples/codecommit/get-folder.rst |
616 | awscli/examples/codecommit/get-merge-commit.rst | |
563 | 617 | awscli/examples/codecommit/get-merge-conflicts.rst |
618 | awscli/examples/codecommit/get-merge-options.rst | |
564 | 619 | awscli/examples/codecommit/get-pull-request.rst |
565 | 620 | awscli/examples/codecommit/get-repository-triggers.rst |
566 | 621 | awscli/examples/codecommit/get-repository.rst |
567 | 622 | awscli/examples/codecommit/list-branches.rst |
568 | 623 | awscli/examples/codecommit/list-pull-requests.rst |
569 | 624 | awscli/examples/codecommit/list-repositories.rst |
625 | awscli/examples/codecommit/list-tags-for-resource.rst | |
626 | awscli/examples/codecommit/merge-branches-by-fast-forward.rst | |
627 | awscli/examples/codecommit/merge-branches-by-squash.rst | |
628 | awscli/examples/codecommit/merge-branches-by-three-way.rst | |
570 | 629 | awscli/examples/codecommit/merge-pull-request-by-fast-forward.rst |
630 | awscli/examples/codecommit/merge-pull-request-by-squash.rst | |
631 | awscli/examples/codecommit/merge-pull-request-by-three-way.rst | |
571 | 632 | awscli/examples/codecommit/post-comment-for-compared-commit.rst |
572 | 633 | awscli/examples/codecommit/post-comment-for-pull-request.rst |
573 | 634 | awscli/examples/codecommit/post-comment-reply.rst |
574 | 635 | awscli/examples/codecommit/put-file.rst |
575 | 636 | awscli/examples/codecommit/put-repository-triggers.rst |
637 | awscli/examples/codecommit/tag-resource.rst | |
576 | 638 | awscli/examples/codecommit/test-repository-triggers.rst |
639 | awscli/examples/codecommit/untag-resource.rst | |
577 | 640 | awscli/examples/codecommit/update-comment.rst |
578 | 641 | awscli/examples/codecommit/update-default-branch.rst |
579 | 642 | awscli/examples/codecommit/update-pull-request-description.rst |
772 | 835 | awscli/examples/devicefarm/create-upload.rst |
773 | 836 | awscli/examples/devicefarm/get-upload.rst |
774 | 837 | awscli/examples/devicefarm/list-projects.rst |
838 | awscli/examples/directconnect/accept-direct-connect-gateway-association-proposal.rst | |
775 | 839 | awscli/examples/directconnect/allocate-connection-on-interconnect.rst |
776 | 840 | awscli/examples/directconnect/allocate-hosted-connection.rst |
777 | 841 | awscli/examples/directconnect/allocate-private-virtual-interface.rst |
778 | 842 | awscli/examples/directconnect/allocate-public-virtual-interface.rst |
843 | awscli/examples/directconnect/allocate-transit-virtual-interface.rst | |
779 | 844 | awscli/examples/directconnect/associate-connection-with-lag.rst |
780 | 845 | awscli/examples/directconnect/associate-hosted-connection.rst |
781 | 846 | awscli/examples/directconnect/associate-virtual-interface.rst |
782 | 847 | awscli/examples/directconnect/confirm-connection.rst |
783 | 848 | awscli/examples/directconnect/confirm-private-virtual-interface.rst |
784 | 849 | awscli/examples/directconnect/confirm-public-virtual-interface.rst |
850 | awscli/examples/directconnect/confirm-transit-virtual-interface.rst | |
785 | 851 | awscli/examples/directconnect/create-bgp-peer.rst |
786 | 852 | awscli/examples/directconnect/create-connection.rst |
853 | awscli/examples/directconnect/create-direct-connect-gateway-association-proposal.rst | |
787 | 854 | awscli/examples/directconnect/create-direct-connect-gateway-association.rst |
788 | 855 | awscli/examples/directconnect/create-direct-connect-gateway.rst |
789 | 856 | awscli/examples/directconnect/create-interconnect.rst |
790 | 857 | awscli/examples/directconnect/create-lag.rst |
791 | 858 | awscli/examples/directconnect/create-private-virtual-interface.rst |
792 | 859 | awscli/examples/directconnect/create-public-virtual-interface.rst |
860 | awscli/examples/directconnect/create-transit-virtual-interface.rst | |
793 | 861 | awscli/examples/directconnect/delete-bgp-peer.rst |
794 | 862 | awscli/examples/directconnect/delete-connection.rst |
795 | 863 | awscli/examples/directconnect/delete-direct-connect-gateway-association.rst |
800 | 868 | awscli/examples/directconnect/describe-connection-loa.rst |
801 | 869 | awscli/examples/directconnect/describe-connections-on-interconnect.rst |
802 | 870 | awscli/examples/directconnect/describe-connections.rst |
871 | awscli/examples/directconnect/describe-direct-connect-gateway-association-proposals.rst | |
803 | 872 | awscli/examples/directconnect/describe-direct-connect-gateway-associations.rst |
804 | 873 | awscli/examples/directconnect/describe-direct-connect-gateway-attachments.rst |
805 | 874 | awscli/examples/directconnect/describe-direct-connect-gateways.rst |
815 | 884 | awscli/examples/directconnect/disassociate-connection-from-lag.rst |
816 | 885 | awscli/examples/directconnect/tag-resource.rst |
817 | 886 | awscli/examples/directconnect/untag-resource.rst |
887 | awscli/examples/directconnect/update-direct-connect-gateway-association.rst | |
818 | 888 | awscli/examples/directconnect/update-lag.rst |
889 | awscli/examples/directconnect/update-virtual-interface-attributes.rst | |
819 | 890 | awscli/examples/discovery/describe-agents.rst |
820 | 891 | awscli/examples/discovery/describe-configurations.rst |
821 | 892 | awscli/examples/discovery/list-configurations.rst |
830 | 901 | awscli/examples/dms/create-replication-task.rst |
831 | 902 | awscli/examples/dms/describe-connections.rst |
832 | 903 | awscli/examples/dms/describe-endpoints.rst |
904 | awscli/examples/docdb/add-tags-to-resource.rst | |
905 | awscli/examples/docdb/apply-pending-maintenance-action.rst | |
906 | awscli/examples/docdb/copy-db-cluster-parameter-group.rst | |
907 | awscli/examples/docdb/copy-db-cluster-snapshot.rst | |
908 | awscli/examples/docdb/create-db-cluster-parameter-group.rst | |
909 | awscli/examples/docdb/create-db-cluster-snapshot.rst | |
910 | awscli/examples/docdb/create-db-cluster.rst | |
911 | awscli/examples/docdb/create-db-instance.rst | |
912 | awscli/examples/docdb/create-db-subnet-group.rst | |
913 | awscli/examples/docdb/delete-db-cluster-parameter-group.rst | |
914 | awscli/examples/docdb/delete-db-cluster-snapshot.rst | |
915 | awscli/examples/docdb/delete-db-cluster.rst | |
916 | awscli/examples/docdb/delete-db-instance.rst | |
917 | awscli/examples/docdb/delete-db-subnet-group.rst | |
918 | awscli/examples/docdb/describe-db-cluster-parameter-groups.rst | |
919 | awscli/examples/docdb/describe-db-cluster-parameters.rst | |
920 | awscli/examples/docdb/describe-db-cluster-snapshot-attributes.rst | |
921 | awscli/examples/docdb/describe-db-cluster-snapshots.rst | |
922 | awscli/examples/docdb/describe-db-clusters.rst | |
923 | awscli/examples/docdb/describe-db-engine-versions.rst | |
924 | awscli/examples/docdb/describe-db-instances.rst | |
925 | awscli/examples/docdb/describe-db-subnet-groups.rst | |
926 | awscli/examples/docdb/describe-engine-default-cluster-parameters.rst | |
927 | awscli/examples/docdb/describe-event-categories.rst | |
928 | awscli/examples/docdb/describe-events.rst | |
929 | awscli/examples/docdb/describe-orderable-db-instance-options.rst | |
930 | awscli/examples/docdb/describe-pending-maintenance-actions.rst | |
931 | awscli/examples/docdb/failover-db-cluster.rst | |
932 | awscli/examples/docdb/list-tags-for-resource.rst | |
933 | awscli/examples/docdb/modify-db-cluster-parameter-group.rst | |
934 | awscli/examples/docdb/modify-db-cluster-snapshot-attribute.rst | |
935 | awscli/examples/docdb/modify-db-cluster.rst | |
936 | awscli/examples/docdb/modify-db-instance.rst | |
937 | awscli/examples/docdb/modify-db-subnet-group.rst | |
938 | awscli/examples/docdb/reboot-db-instance.rst | |
939 | awscli/examples/docdb/remove-tags-from-resource.rst | |
940 | awscli/examples/docdb/reset-db-cluster-parameter-group.rst | |
941 | awscli/examples/docdb/restore-db-cluster-from-snapshot.rst | |
942 | awscli/examples/docdb/restore-db-cluster-to-point-in-time.rst | |
943 | awscli/examples/docdb/start-db-cluster.rst | |
944 | awscli/examples/docdb/stop-db-cluster.rst | |
945 | awscli/examples/docdb/wait/db-instance-available.rst | |
946 | awscli/examples/docdb/wait/db-instance-deleted.rst | |
833 | 947 | awscli/examples/dynamodb/batch-get-item.rst |
834 | 948 | awscli/examples/dynamodb/batch-write-item.rst |
835 | 949 | awscli/examples/dynamodb/create-table.rst |
844 | 958 | awscli/examples/dynamodb/update-item.rst |
845 | 959 | awscli/examples/dynamodb/update-table.rst |
846 | 960 | awscli/examples/ec2/accept-reserved-instances-exchange-quote.rst |
961 | awscli/examples/ec2/accept-transit-gateway-vpc-attachment.rst | |
847 | 962 | awscli/examples/ec2/accept-vpc-endpoint-connections.rst |
848 | 963 | awscli/examples/ec2/accept-vpc-peering-connection.rst |
964 | awscli/examples/ec2/advertise-byoip-cidr.rst | |
849 | 965 | awscli/examples/ec2/allocate-address.rst |
850 | 966 | awscli/examples/ec2/allocate-hosts.rst |
851 | 967 | awscli/examples/ec2/apply-security-groups-to-client-vpn-target-network.rst |
857 | 973 | awscli/examples/ec2/associate-iam-instance-profile.rst |
858 | 974 | awscli/examples/ec2/associate-route-table.rst |
859 | 975 | awscli/examples/ec2/associate-subnet-cidr-block.rst |
976 | awscli/examples/ec2/associate-transit-gateway-route-table.rst | |
860 | 977 | awscli/examples/ec2/associate-vpc-cidr-block.rst |
861 | 978 | awscli/examples/ec2/attach-classic-link-vpc.rst |
862 | 979 | awscli/examples/ec2/attach-internet-gateway.rst |
868 | 985 | awscli/examples/ec2/authorize-security-group-ingress.rst |
869 | 986 | awscli/examples/ec2/bundle-instance.rst |
870 | 987 | awscli/examples/ec2/cancel-bundle-task.rst |
988 | awscli/examples/ec2/cancel-capacity-reservation.rst | |
871 | 989 | awscli/examples/ec2/cancel-conversion-task.rst |
872 | 990 | awscli/examples/ec2/cancel-export-task.rst |
991 | awscli/examples/ec2/cancel-import-task.rst | |
873 | 992 | awscli/examples/ec2/cancel-spot-fleet-requests.rst |
874 | 993 | awscli/examples/ec2/cancel-spot-instance-requests.rst |
875 | 994 | awscli/examples/ec2/confirm-product-instance.rst |
876 | 995 | awscli/examples/ec2/copy-fpga-image.rst |
877 | 996 | awscli/examples/ec2/copy-image.rst |
878 | 997 | awscli/examples/ec2/copy-snapshot.rst |
998 | awscli/examples/ec2/create-capacity-reservation.rst | |
879 | 999 | awscli/examples/ec2/create-client-vpn-endpoint.rst |
880 | 1000 | awscli/examples/ec2/create-client-vpn-route.rst |
881 | 1001 | awscli/examples/ec2/create-customer-gateway.rst |
911 | 1031 | awscli/examples/ec2/create-traffic-mirror-session.rst |
912 | 1032 | awscli/examples/ec2/create-traffic-mirror-target.rst |
913 | 1033 | awscli/examples/ec2/create-transit-gateway-route-table.rst |
1034 | awscli/examples/ec2/create-transit-gateway-route.rst | |
914 | 1035 | awscli/examples/ec2/create-transit-gateway-vpc-attachment.rst |
915 | 1036 | awscli/examples/ec2/create-transit-gateway.rst |
916 | 1037 | awscli/examples/ec2/create-volume.rst |
950 | 1071 | awscli/examples/ec2/delete-traffic-mirror-filter.rst |
951 | 1072 | awscli/examples/ec2/delete-traffic-mirror-session.rst |
952 | 1073 | awscli/examples/ec2/delete-traffic-mirror-target.rst |
1074 | awscli/examples/ec2/delete-transit-gateway-route-table.rst | |
1075 | awscli/examples/ec2/delete-transit-gateway-route.rst | |
953 | 1076 | awscli/examples/ec2/delete-transit-gateway-vpc-attachment.rst |
1077 | awscli/examples/ec2/delete-transit-gateway.rst | |
954 | 1078 | awscli/examples/ec2/delete-volume.rst |
955 | 1079 | awscli/examples/ec2/delete-vpc-endpoint-connection-notifications.rst |
956 | 1080 | awscli/examples/ec2/delete-vpc-endpoint-service-configurations.rst |
960 | 1084 | awscli/examples/ec2/delete-vpn-connection-route.rst |
961 | 1085 | awscli/examples/ec2/delete-vpn-connection.rst |
962 | 1086 | awscli/examples/ec2/delete-vpn-gateway.rst |
1087 | awscli/examples/ec2/deprovision-byoip-cidr.rst | |
963 | 1088 | awscli/examples/ec2/deregister-image.rst |
964 | 1089 | awscli/examples/ec2/describe-account-attributes.rst |
965 | 1090 | awscli/examples/ec2/describe-addresses.rst |
966 | 1091 | awscli/examples/ec2/describe-aggregate-id-format.rst |
967 | 1092 | awscli/examples/ec2/describe-availability-zones.rst |
968 | 1093 | awscli/examples/ec2/describe-bundle-tasks.rst |
1094 | awscli/examples/ec2/describe-byoip-cidrs.rst | |
1095 | awscli/examples/ec2/describe-capacity-reservations.rst | |
969 | 1096 | awscli/examples/ec2/describe-classic-link-instances.rst |
970 | 1097 | awscli/examples/ec2/describe-client-vpn-authorization-rules.rst |
971 | 1098 | awscli/examples/ec2/describe-client-vpn-connections.rst |
977 | 1104 | awscli/examples/ec2/describe-dhcp-options.rst |
978 | 1105 | awscli/examples/ec2/describe-egress-only-internet-gateways.rst |
979 | 1106 | awscli/examples/ec2/describe-elastic-gpus.rst |
1107 | awscli/examples/ec2/describe-export-image-tasks.rst | |
980 | 1108 | awscli/examples/ec2/describe-export-tasks.rst |
981 | 1109 | awscli/examples/ec2/describe-flow-logs.rst |
982 | 1110 | awscli/examples/ec2/describe-fpga-image-attribute.rst |
989 | 1117 | awscli/examples/ec2/describe-identity-id-format.rst |
990 | 1118 | awscli/examples/ec2/describe-image-attribute.rst |
991 | 1119 | awscli/examples/ec2/describe-images.rst |
1120 | awscli/examples/ec2/describe-import-image-tasks.rst | |
1121 | awscli/examples/ec2/describe-import-snapshot-tasks.rst | |
992 | 1122 | awscli/examples/ec2/describe-instance-attribute.rst |
993 | 1123 | awscli/examples/ec2/describe-instance-credit-specifications.rst |
994 | 1124 | awscli/examples/ec2/describe-instance-status.rst |
1006 | 1136 | awscli/examples/ec2/describe-placement-groups.rst |
1007 | 1137 | awscli/examples/ec2/describe-prefix-lists.rst |
1008 | 1138 | awscli/examples/ec2/describe-principal-id-format.rst |
1139 | awscli/examples/ec2/describe-public-ipv4-pools.rst | |
1009 | 1140 | awscli/examples/ec2/describe-regions.rst |
1010 | 1141 | awscli/examples/ec2/describe-reserved-instances-modifications.rst |
1011 | 1142 | awscli/examples/ec2/describe-reserved-instances-offerings.rst |
1026 | 1157 | awscli/examples/ec2/describe-stale-security-groups.rst |
1027 | 1158 | awscli/examples/ec2/describe-subnets.rst |
1028 | 1159 | awscli/examples/ec2/describe-tags.rst |
1160 | awscli/examples/ec2/describe-traffic-mirror-filters.rst | |
1029 | 1161 | awscli/examples/ec2/describe-traffic-mirror-sessions.rst |
1030 | 1162 | awscli/examples/ec2/describe-traffic-mirror-targets.rst |
1163 | awscli/examples/ec2/describe-transit-gateway-attachments.rst | |
1164 | awscli/examples/ec2/describe-transit-gateway-route-tables.rst | |
1031 | 1165 | awscli/examples/ec2/describe-transit-gateway-vpc-attachments.rst |
1032 | 1166 | awscli/examples/ec2/describe-transit-gateways.rst |
1033 | 1167 | awscli/examples/ec2/describe-volume-attribute.rst |
1062 | 1196 | awscli/examples/ec2/disassociate-iam-instance-profile.rst |
1063 | 1197 | awscli/examples/ec2/disassociate-route-table.rst |
1064 | 1198 | awscli/examples/ec2/disassociate-subnet-cidr-block.rst |
1199 | awscli/examples/ec2/disassociate-transit-gateway-route-table.rst | |
1065 | 1200 | awscli/examples/ec2/disassociate-vpc-cidr-block.rst |
1066 | 1201 | awscli/examples/ec2/enable-ebs-encryption-by-default.rst |
1067 | 1202 | awscli/examples/ec2/enable-transit-gateway-route-table-propagation.rst |
1071 | 1206 | awscli/examples/ec2/enable-vpc-classic-link.rst |
1072 | 1207 | awscli/examples/ec2/export-client-vpn-client-certificate-revocation-list.rst |
1073 | 1208 | awscli/examples/ec2/export-client-vpn-client-configuration.rst |
1209 | awscli/examples/ec2/export-image.rst | |
1210 | awscli/examples/ec2/get-capacity-reservation-usage.rst | |
1074 | 1211 | awscli/examples/ec2/get-console-output.rst |
1212 | awscli/examples/ec2/get-console-screenshot.rst | |
1075 | 1213 | awscli/examples/ec2/get-ebs-default-kms-key-id.rst |
1076 | 1214 | awscli/examples/ec2/get-ebs-encryption-by-default.rst |
1077 | 1215 | awscli/examples/ec2/get-host-reservation-purchase-preview.rst |
1078 | 1216 | awscli/examples/ec2/get-launch-template-data.rst |
1079 | 1217 | awscli/examples/ec2/get-password-data.rst |
1080 | 1218 | awscli/examples/ec2/get-reserved-instances-exchange-quote.rst |
1219 | awscli/examples/ec2/get-transit-gateway-attachment-propagations.rst | |
1081 | 1220 | awscli/examples/ec2/get-transit-gateway-route-table-associations.rst |
1221 | awscli/examples/ec2/get-transit-gateway-route-table-propagations.rst | |
1082 | 1222 | awscli/examples/ec2/import-client-vpn-client-certificate-revocation-list.rst |
1223 | awscli/examples/ec2/import-image.rst | |
1083 | 1224 | awscli/examples/ec2/import-key-pair.rst |
1225 | awscli/examples/ec2/import-snapshot.rst | |
1226 | awscli/examples/ec2/modify-capacity-reservation.rst | |
1084 | 1227 | awscli/examples/ec2/modify-client-vpn-endpoint.rst |
1085 | 1228 | awscli/examples/ec2/modify-ebs-default-kms-key-id.rst |
1086 | 1229 | awscli/examples/ec2/modify-fpga-image-attribute.rst |
1089 | 1232 | awscli/examples/ec2/modify-identity-id-format.rst |
1090 | 1233 | awscli/examples/ec2/modify-image-attribute.rst |
1091 | 1234 | awscli/examples/ec2/modify-instance-attribute.rst |
1235 | awscli/examples/ec2/modify-instance-capacity-reservation-attributes.rst | |
1092 | 1236 | awscli/examples/ec2/modify-instance-credit-specification.rst |
1093 | 1237 | awscli/examples/ec2/modify-instance-event-start-time.rst |
1094 | 1238 | awscli/examples/ec2/modify-instance-placement.rst |
1098 | 1242 | awscli/examples/ec2/modify-snapshot-attribute.rst |
1099 | 1243 | awscli/examples/ec2/modify-spot-fleet-request.rst |
1100 | 1244 | awscli/examples/ec2/modify-subnet-attribute.rst |
1245 | awscli/examples/ec2/modify-traffic-mirror-filter-network-services.rst | |
1246 | awscli/examples/ec2/modify-traffic-mirror-filter-rule.rst | |
1101 | 1247 | awscli/examples/ec2/modify-traffic-mirror-session.rst |
1102 | 1248 | awscli/examples/ec2/modify-transit-gateway-vpc-attachment.rst |
1103 | 1249 | awscli/examples/ec2/modify-volume-attribute.rst |
1109 | 1255 | awscli/examples/ec2/modify-vpc-endpoint.rst |
1110 | 1256 | awscli/examples/ec2/modify-vpc-peering-connection-options.rst |
1111 | 1257 | awscli/examples/ec2/modify-vpc-tenancy.rst |
1258 | awscli/examples/ec2/modify-vpn-connection.rst | |
1259 | awscli/examples/ec2/modify-vpn-tunnel-certificate.rst | |
1260 | awscli/examples/ec2/modify-vpn-tunnel-options.rst | |
1112 | 1261 | awscli/examples/ec2/monitor-instances.rst |
1113 | 1262 | awscli/examples/ec2/move-address-to-vpc.rst |
1263 | awscli/examples/ec2/provision-byoip-cidr.rst | |
1114 | 1264 | awscli/examples/ec2/purchase-host-reservation.rst |
1115 | 1265 | awscli/examples/ec2/purchase-reserved-instances-offering.rst |
1116 | 1266 | awscli/examples/ec2/purchase-scheduled-instances.rst |
1117 | 1267 | awscli/examples/ec2/reboot-instances.rst |
1118 | 1268 | awscli/examples/ec2/register-image.rst |
1269 | awscli/examples/ec2/reject-transit-gateway-vpc-attachments.rst | |
1119 | 1270 | awscli/examples/ec2/reject-vpc-endpoint-connections.rst |
1120 | 1271 | awscli/examples/ec2/reject-vpc-peering-connection.rst |
1121 | 1272 | awscli/examples/ec2/release-address.rst |
1122 | 1273 | awscli/examples/ec2/release-hosts.rst |
1123 | awscli/examples/ec2/replace-iam-instance-profile.rst | |
1274 | awscli/examples/ec2/replace-iam-instance-profile-association.rst | |
1124 | 1275 | awscli/examples/ec2/replace-network-acl-association.rst |
1125 | 1276 | awscli/examples/ec2/replace-network-acl-entry.rst |
1126 | 1277 | awscli/examples/ec2/replace-route-table-association.rst |
1150 | 1301 | awscli/examples/ec2/unmonitor-instances.rst |
1151 | 1302 | awscli/examples/ec2/update-security-group-rule-descriptions-egress.rst |
1152 | 1303 | awscli/examples/ec2/update-security-group-rule-descriptions-ingress.rst |
1304 | awscli/examples/ec2/withdraw-byoip-cidr.rst | |
1305 | awscli/examples/ec2/wait/customer-gateway-available.rst | |
1306 | awscli/examples/ec2/wait/image-available.rst | |
1307 | awscli/examples/ec2/wait/image-exists.rst | |
1308 | awscli/examples/ec2/wait/instance-exists.rst | |
1309 | awscli/examples/ec2/wait/instance-running.rst | |
1310 | awscli/examples/ec2/wait/instance-status-ok.rst | |
1311 | awscli/examples/ec2/wait/instance-stopped.rst | |
1312 | awscli/examples/ec2/wait/instance-terminated.rst | |
1313 | awscli/examples/ec2/wait/key-pair-exists.rst | |
1314 | awscli/examples/ec2/wait/nat-gateway-available.rst | |
1315 | awscli/examples/ec2/wait/network-interface-available.rst | |
1316 | awscli/examples/ec2/wait/password-data-available.rst | |
1317 | awscli/examples/ec2/wait/snapshot-completed.rst | |
1318 | awscli/examples/ec2/wait/spot-instance-request-fulfilled.rst | |
1319 | awscli/examples/ec2/wait/subnet-available.rst | |
1320 | awscli/examples/ec2/wait/system-status-ok.rst | |
1321 | awscli/examples/ec2/wait/volume-available.rst | |
1322 | awscli/examples/ec2/wait/volume-deleted.rst | |
1323 | awscli/examples/ec2/wait/volume-in-use.rst | |
1324 | awscli/examples/ec2/wait/vpc-available.rst | |
1325 | awscli/examples/ec2/wait/vpc-exists.rst | |
1326 | awscli/examples/ec2/wait/vpc-peering-connection-deleted.rst | |
1327 | awscli/examples/ec2/wait/vpc-peering-connection-exists.rst | |
1328 | awscli/examples/ec2/wait/vpn-connection-available.rst | |
1329 | awscli/examples/ec2/wait/vpn-connection-deleted.rst | |
1330 | awscli/examples/ecr/batch-check-layer-availability.rst | |
1153 | 1331 | awscli/examples/ecr/batch-delete-image.rst |
1154 | 1332 | awscli/examples/ecr/batch-get-image.rst |
1333 | awscli/examples/ecr/complete-layer-upload.rst | |
1155 | 1334 | awscli/examples/ecr/create-repository.rst |
1335 | awscli/examples/ecr/delete-lifecycle-policy.rst | |
1336 | awscli/examples/ecr/delete-repository-policy.rst | |
1156 | 1337 | awscli/examples/ecr/delete-repository.rst |
1338 | awscli/examples/ecr/describe-images.rst | |
1157 | 1339 | awscli/examples/ecr/describe-repositories.rst |
1158 | 1340 | awscli/examples/ecr/get-authorization-token.rst |
1341 | awscli/examples/ecr/get-download-url-for-layer.rst | |
1159 | 1342 | awscli/examples/ecr/get-lifecycle-policy-preview.rst |
1160 | 1343 | awscli/examples/ecr/get-lifecycle-policy.rst |
1161 | 1344 | awscli/examples/ecr/get-login.rst |
1162 | 1345 | awscli/examples/ecr/get-login_description.rst |
1346 | awscli/examples/ecr/get-repository-policy.rst | |
1347 | awscli/examples/ecr/initiate-layer-upload.rst | |
1348 | awscli/examples/ecr/list-images.rst | |
1349 | awscli/examples/ecr/list-tags-for-resource.rst | |
1350 | awscli/examples/ecr/put-image-tag-mutability.rst | |
1351 | awscli/examples/ecr/put-image.rst | |
1163 | 1352 | awscli/examples/ecr/put-lifecycle-policy.rst |
1353 | awscli/examples/ecr/set-repository-policy.rst | |
1164 | 1354 | awscli/examples/ecr/start-lifecycle-policy-preview.rst |
1355 | awscli/examples/ecr/tag-resource.rst | |
1356 | awscli/examples/ecr/untag-resource.rst | |
1357 | awscli/examples/ecr/upload-layer-part.rst | |
1165 | 1358 | awscli/examples/ecs/create-cluster.rst |
1166 | 1359 | awscli/examples/ecs/create-service.rst |
1167 | 1360 | awscli/examples/ecs/create-task-set.rst |
1205 | 1398 | awscli/examples/eks/create-cluster.rst |
1206 | 1399 | awscli/examples/eks/delete-cluster.rst |
1207 | 1400 | awscli/examples/eks/describe-cluster.rst |
1401 | awscli/examples/eks/describe-update.rst | |
1402 | awscli/examples/eks/get-token.rst | |
1208 | 1403 | awscli/examples/eks/list-clusters.rst |
1404 | awscli/examples/eks/list-updates.rst | |
1405 | awscli/examples/eks/update-cluster-config.rst | |
1406 | awscli/examples/eks/update-cluster-version.rst | |
1407 | awscli/examples/eks/update-kubeconfig.rst | |
1408 | awscli/examples/eks/wait.rst | |
1209 | 1409 | awscli/examples/eks/update-kubeconfig/_description.rst |
1210 | 1410 | awscli/examples/elasticache/create-replication-group.rst |
1211 | 1411 | awscli/examples/elasticache/modify-cache-parameter-group.rst |
1366 | 1566 | awscli/examples/events/put-targets.rst |
1367 | 1567 | awscli/examples/events/remove-targets.rst |
1368 | 1568 | awscli/examples/events/test-event-pattern.rst |
1569 | awscli/examples/gamelift/create-fleet.rst | |
1369 | 1570 | awscli/examples/glacier/abort-multipart-upload.rst |
1370 | 1571 | awscli/examples/glacier/abort-vault-lock.rst |
1371 | 1572 | awscli/examples/glacier/add-tags-to-vault.rst |
1392 | 1593 | awscli/examples/glacier/set-vault-notifications.rst |
1393 | 1594 | awscli/examples/glacier/upload-archive.rst |
1394 | 1595 | awscli/examples/glacier/upload-multipart-part.rst |
1596 | awscli/examples/globalaccelerator/create-accelerator.rst | |
1597 | awscli/examples/globalaccelerator/create-endpoint-group.rst | |
1598 | awscli/examples/globalaccelerator/create-listener.rst | |
1599 | awscli/examples/globalaccelerator/describe-accelerator.rst | |
1600 | awscli/examples/globalaccelerator/update-accelerator.rst | |
1601 | awscli/examples/globalaccelerator/update-endpoint-group.rst | |
1602 | awscli/examples/greengrass/associate-role-to-group.rst | |
1395 | 1603 | awscli/examples/greengrass/associate-service-role-to-account.rst |
1396 | 1604 | awscli/examples/greengrass/create-connector-definition-version.rst |
1397 | 1605 | awscli/examples/greengrass/create-connector-definition.rst |
1398 | 1606 | awscli/examples/greengrass/create-core-definition.rst |
1399 | 1607 | awscli/examples/greengrass/create-deployment.rst |
1608 | awscli/examples/greengrass/create-device-definition-version.rst | |
1609 | awscli/examples/greengrass/create-device-definition.rst | |
1400 | 1610 | awscli/examples/greengrass/create-function-definition-version.rst |
1401 | 1611 | awscli/examples/greengrass/create-function-definition.rst |
1402 | 1612 | awscli/examples/greengrass/create-group-version.rst |
1409 | 1619 | awscli/examples/greengrass/create-subscription-definition.rst |
1410 | 1620 | awscli/examples/greengrass/delete-connector-definition.rst |
1411 | 1621 | awscli/examples/greengrass/delete-core-definition.rst |
1622 | awscli/examples/greengrass/delete-device-definition.rst | |
1412 | 1623 | awscli/examples/greengrass/delete-function-definition.rst |
1413 | 1624 | awscli/examples/greengrass/delete-logger-definition.rst |
1414 | 1625 | awscli/examples/greengrass/delete-resource-definition.rst |
1415 | 1626 | awscli/examples/greengrass/delete-subscription-definition.rst |
1627 | awscli/examples/greengrass/disassociate-role-from-group.rst | |
1416 | 1628 | awscli/examples/greengrass/disassociate-service-role-from-account.rst |
1629 | awscli/examples/greengrass/get-associated-role.rst | |
1417 | 1630 | awscli/examples/greengrass/get-bulk-deployment-status.rst |
1631 | awscli/examples/greengrass/get-connectivity-info.rst | |
1418 | 1632 | awscli/examples/greengrass/get-connector-definition-version.rst |
1419 | 1633 | awscli/examples/greengrass/get-connector-definition.rst |
1420 | 1634 | awscli/examples/greengrass/get-core-definition-version.rst |
1421 | 1635 | awscli/examples/greengrass/get-core-definition.rst |
1422 | 1636 | awscli/examples/greengrass/get-deployment-status.rst |
1637 | awscli/examples/greengrass/get-device-definition-version.rst | |
1638 | awscli/examples/greengrass/get-device-definition.rst | |
1423 | 1639 | awscli/examples/greengrass/get-function-definition-version.rst |
1424 | 1640 | awscli/examples/greengrass/get-function-definition.rst |
1425 | 1641 | awscli/examples/greengrass/get-group-certificate-authority.rst |
1439 | 1655 | awscli/examples/greengrass/list-core-definition-versions.rst |
1440 | 1656 | awscli/examples/greengrass/list-core-definitions.rst |
1441 | 1657 | awscli/examples/greengrass/list-deployments.rst |
1658 | awscli/examples/greengrass/list-device-definition-versions.rst | |
1659 | awscli/examples/greengrass/list-device-definitions.rst | |
1442 | 1660 | awscli/examples/greengrass/list-function-definitions-versions.rst |
1443 | 1661 | awscli/examples/greengrass/list-function-definitions.rst |
1444 | 1662 | awscli/examples/greengrass/list-group-certificate-authorities.rst |
1456 | 1674 | awscli/examples/greengrass/stop-bulk-deployment.rst |
1457 | 1675 | awscli/examples/greengrass/tag-resource.rst |
1458 | 1676 | awscli/examples/greengrass/untag-resource.rst |
1677 | awscli/examples/greengrass/update-connectivity-info.rst | |
1678 | awscli/examples/greengrass/update-device-definition.rst | |
1459 | 1679 | awscli/examples/greengrass/update-logger-definition.rst |
1460 | 1680 | awscli/examples/iam/add-client-id-to-open-id-connect-provider.rst |
1461 | 1681 | awscli/examples/iam/add-role-to-instance-profile.rst |
1479 | 1699 | awscli/examples/iam/create-user.rst |
1480 | 1700 | awscli/examples/iam/create-virtual-mfa-device.rst |
1481 | 1701 | awscli/examples/iam/deactivate-mfa-device.rst |
1702 | awscli/examples/iam/decode-authorization-message.rst | |
1482 | 1703 | awscli/examples/iam/delete-access-key.rst |
1483 | 1704 | awscli/examples/iam/delete-account-alias.rst |
1484 | 1705 | awscli/examples/iam/delete-account-password-policy.rst |
1643 | 1864 | awscli/examples/iot/create-dynamic-thing-group.rst |
1644 | 1865 | awscli/examples/iot/create-job.rst |
1645 | 1866 | awscli/examples/iot/create-keys-and-certificate.rst |
1867 | awscli/examples/iot/create-ota-update.rst | |
1646 | 1868 | awscli/examples/iot/create-policy-version.rst |
1647 | 1869 | awscli/examples/iot/create-policy.rst |
1648 | 1870 | awscli/examples/iot/create-scheduled-audit.rst |
1649 | 1871 | awscli/examples/iot/create-security-profile.rst |
1872 | awscli/examples/iot/create-stream.rst | |
1650 | 1873 | awscli/examples/iot/create-thing-group.rst |
1651 | 1874 | awscli/examples/iot/create-thing-type.rst |
1652 | 1875 | awscli/examples/iot/create-thing.rst |
1656 | 1879 | awscli/examples/iot/delete-dynamic-thing-group.rst |
1657 | 1880 | awscli/examples/iot/delete-job-execution.rst |
1658 | 1881 | awscli/examples/iot/delete-job.rst |
1882 | awscli/examples/iot/delete-ota-update.rst | |
1659 | 1883 | awscli/examples/iot/delete-policy-version.rst |
1660 | 1884 | awscli/examples/iot/delete-policy.rst |
1661 | 1885 | awscli/examples/iot/delete-scheduled-audit.rst |
1662 | 1886 | awscli/examples/iot/delete-security-profile.rst |
1887 | awscli/examples/iot/delete-stream.rst | |
1663 | 1888 | awscli/examples/iot/delete-thing-group.rst |
1664 | 1889 | awscli/examples/iot/delete-thing-type.rst |
1665 | 1890 | awscli/examples/iot/delete-thing.rst |
1677 | 1902 | awscli/examples/iot/describe-job.rst |
1678 | 1903 | awscli/examples/iot/describe-scheduled-audit.rst |
1679 | 1904 | awscli/examples/iot/describe-security-profile.rst |
1905 | awscli/examples/iot/describe-stream.rst | |
1680 | 1906 | awscli/examples/iot/describe-thing-group.rst |
1681 | 1907 | awscli/examples/iot/describe-thing-type.rst |
1682 | 1908 | awscli/examples/iot/describe-thing.rst |
1689 | 1915 | awscli/examples/iot/get-indexing-configuration.rst |
1690 | 1916 | awscli/examples/iot/get-job-document.rst |
1691 | 1917 | awscli/examples/iot/get-logging-options.rst |
1918 | awscli/examples/iot/get-ota-update.rst | |
1692 | 1919 | awscli/examples/iot/get-policy-version.rst |
1693 | 1920 | awscli/examples/iot/get-policy.rst |
1694 | 1921 | awscli/examples/iot/get-statistics.rst |
1704 | 1931 | awscli/examples/iot/list-job-executions-for-job.rst |
1705 | 1932 | awscli/examples/iot/list-job-executions-for-thing.rst |
1706 | 1933 | awscli/examples/iot/list-jobs.rst |
1934 | awscli/examples/iot/list-ota-updates.rst | |
1707 | 1935 | awscli/examples/iot/list-policies.rst |
1708 | 1936 | awscli/examples/iot/list-policy-versions.rst |
1709 | 1937 | awscli/examples/iot/list-scheduled-audits.rst |
1710 | 1938 | awscli/examples/iot/list-security-profiles-for-target.rst |
1711 | 1939 | awscli/examples/iot/list-security-profiles.rst |
1940 | awscli/examples/iot/list-streams.rst | |
1712 | 1941 | awscli/examples/iot/list-tags-for-resource.rst |
1713 | 1942 | awscli/examples/iot/list-targets-for-policy.rst |
1714 | 1943 | awscli/examples/iot/list-targets-for-security-profile.rst |
1740 | 1969 | awscli/examples/iot/update-job.rst |
1741 | 1970 | awscli/examples/iot/update-scheduled-audit.rst |
1742 | 1971 | awscli/examples/iot/update-security-profile.rst |
1972 | awscli/examples/iot/update-stream.rst | |
1743 | 1973 | awscli/examples/iot/update-thing-group.rst |
1744 | 1974 | awscli/examples/iot/update-thing-groups-for-thing.rst |
1745 | 1975 | awscli/examples/iot/update-thing.rst |
1747 | 1977 | awscli/examples/iot-data/delete-thing-shadow.rst |
1748 | 1978 | awscli/examples/iot-data/get-thing-shadow.rst |
1749 | 1979 | awscli/examples/iot-data/update-thing-shadow.rst |
1980 | awscli/examples/iot-jobs-data/describe-job-execution.rst | |
1981 | awscli/examples/iot-jobs-data/get-pending-job-executions.rst | |
1982 | awscli/examples/iot-jobs-data/start-next-pending-job-execution.rst | |
1983 | awscli/examples/iot-jobs-data/update-job-execution.rst | |
1750 | 1984 | awscli/examples/iot1click-devices/claim-devices-by-claim-code.rst |
1751 | 1985 | awscli/examples/iot1click-devices/describe-device.rst |
1752 | 1986 | awscli/examples/iot1click-devices/finalize-device-claim.rst |
1987 | awscli/examples/iot1click-devices/get-device-methods.rst | |
1753 | 1988 | awscli/examples/iot1click-devices/initiate-device-claim.rst |
1989 | awscli/examples/iot1click-devices/invoke-device-method.rst | |
1990 | awscli/examples/iot1click-devices/list-device-events.rst | |
1754 | 1991 | awscli/examples/iot1click-devices/list-devices.rst |
1992 | awscli/examples/iot1click-devices/list-tags-for-resource.rst | |
1993 | awscli/examples/iot1click-devices/tag-resource.rst | |
1994 | awscli/examples/iot1click-devices/unclaim-device.rst | |
1995 | awscli/examples/iot1click-devices/untag-resource.rst | |
1996 | awscli/examples/iot1click-devices/update-device-state.rst | |
1755 | 1997 | awscli/examples/iot1click-projects/associate-device-with-placement.rst |
1756 | 1998 | awscli/examples/iot1click-projects/create-placement.rst |
1757 | 1999 | awscli/examples/iot1click-projects/create-project.rst |
2000 | awscli/examples/iot1click-projects/delete-placement.rst | |
2001 | awscli/examples/iot1click-projects/delete-project.rst | |
1758 | 2002 | awscli/examples/iot1click-projects/describe-placement.rst |
1759 | 2003 | awscli/examples/iot1click-projects/describe-project.rst |
2004 | awscli/examples/iot1click-projects/disassociate-device-from-placement.rst | |
1760 | 2005 | awscli/examples/iot1click-projects/get-devices-in-placement.rst |
1761 | 2006 | awscli/examples/iot1click-projects/list-placements.rst |
1762 | 2007 | awscli/examples/iot1click-projects/list-projects.rst |
2008 | awscli/examples/iot1click-projects/list-tags-for-resource.rst | |
2009 | awscli/examples/iot1click-projects/tag-resource.rst | |
2010 | awscli/examples/iot1click-projects/untag-resource.rst | |
2011 | awscli/examples/iot1click-projects/update-placement.rst | |
2012 | awscli/examples/iot1click-projects/update-project.rst | |
1763 | 2013 | awscli/examples/iotevents-data/batch-put-message.rst |
1764 | 2014 | awscli/examples/iotevents-data/batch-update-detector.rst |
1765 | 2015 | awscli/examples/iotevents-data/create-detector-model.rst |
1815 | 2065 | awscli/examples/iotthingsgraph/update-flow-template.rst |
1816 | 2066 | awscli/examples/iotthingsgraph/update-system-template.rst |
1817 | 2067 | awscli/examples/iotthingsgraph/upload-entity-definitions.rst |
2068 | awscli/examples/kms/cancel-key-deletion.rst | |
1818 | 2069 | awscli/examples/kms/create-alias.rst |
2070 | awscli/examples/kms/create-key.rst | |
1819 | 2071 | awscli/examples/kms/decrypt.rst |
2072 | awscli/examples/kms/delete-alias.rst | |
2073 | awscli/examples/kms/describe-key.rst | |
1820 | 2074 | awscli/examples/kms/encrypt.rst |
2075 | awscli/examples/kms/generate-random.rst | |
1821 | 2076 | awscli/examples/kms/get-key-policy.rst |
2077 | awscli/examples/kms/list-aliases.rst | |
2078 | awscli/examples/kms/re-encrypt.rst | |
2079 | awscli/examples/kms/schedule-key-deletion.rst | |
2080 | awscli/examples/kms/update-alias.rst | |
2081 | awscli/examples/kms/update-key-description.rst | |
1822 | 2082 | awscli/examples/lightsail/get-instance-metric-data.rst |
1823 | 2083 | awscli/examples/logs/create-log-group.rst |
1824 | 2084 | awscli/examples/logs/create-log-stream.rst |
1830 | 2090 | awscli/examples/logs/get-log-events.rst |
1831 | 2091 | awscli/examples/logs/put-log-events.rst |
1832 | 2092 | awscli/examples/logs/put-retention-policy.rst |
2093 | awscli/examples/mediaconnect/add-flow-outputs.rst | |
2094 | awscli/examples/mediaconnect/create-flow.rst | |
2095 | awscli/examples/mediaconnect/delete-flow.rst | |
2096 | awscli/examples/mediaconnect/describe-flow.rst | |
2097 | awscli/examples/mediaconnect/grant-flow-entitlements.rst | |
2098 | awscli/examples/mediaconnect/list-entitlements.rst | |
2099 | awscli/examples/mediaconnect/list-flows.rst | |
2100 | awscli/examples/mediaconnect/list-tags-for-resource.rst | |
2101 | awscli/examples/mediaconnect/remove-flow-output.rst | |
2102 | awscli/examples/mediaconnect/revoke-flow-entitlement.rst | |
2103 | awscli/examples/mediaconnect/start-flow.rst | |
2104 | awscli/examples/mediaconnect/stop-flow.rst | |
2105 | awscli/examples/mediaconnect/tag-resource.rst | |
2106 | awscli/examples/mediaconnect/untag-resource.rst | |
2107 | awscli/examples/mediaconnect/update-flow-entitlement.rst | |
2108 | awscli/examples/mediaconnect/update-flow-output.rst | |
2109 | awscli/examples/mediaconnect/update-flow-source.rst | |
1833 | 2110 | awscli/examples/mediaconvert/cancel-job.rst |
1834 | 2111 | awscli/examples/mediaconvert/create-job-template.rst |
1835 | 2112 | awscli/examples/mediaconvert/create-job.rst |
1836 | 2113 | awscli/examples/mediaconvert/create-preset.rst |
1837 | 2114 | awscli/examples/mediaconvert/create-queue.rst |
2115 | awscli/examples/mediaconvert/delete-job-template.rst | |
2116 | awscli/examples/mediaconvert/delete-preset.rst | |
2117 | awscli/examples/mediaconvert/delete-queue.rst | |
1838 | 2118 | awscli/examples/mediaconvert/describe-endpoints.rst |
2119 | awscli/examples/mediaconvert/get-job-template.rst | |
1839 | 2120 | awscli/examples/mediaconvert/get-job.rst |
2121 | awscli/examples/mediaconvert/get-preset.rst | |
2122 | awscli/examples/mediaconvert/get-queue.rst | |
2123 | awscli/examples/mediaconvert/list-job-templates.rst | |
1840 | 2124 | awscli/examples/mediaconvert/list-jobs.rst |
2125 | awscli/examples/mediaconvert/list-presets.rst | |
2126 | awscli/examples/mediaconvert/list-queues.rst | |
2127 | awscli/examples/mediaconvert/list-tags-for-resource.rst | |
2128 | awscli/examples/mediaconvert/update-job-template.rst | |
2129 | awscli/examples/mediaconvert/update-preset.rst | |
2130 | awscli/examples/mediaconvert/update-queue.rst | |
1841 | 2131 | awscli/examples/mediapackage/create-channel.rst |
1842 | 2132 | awscli/examples/mediapackage/create-origin-endpoint.rst |
1843 | 2133 | awscli/examples/mediapackage/delete-channel.rst |
1853 | 2143 | awscli/examples/mediapackage/update-channel.rst |
1854 | 2144 | awscli/examples/mediapackage/update-origin-endpoint.rst |
1855 | 2145 | awscli/examples/mediastore/create-container.rst |
2146 | awscli/examples/mediastore/delete-container-policy.rst | |
1856 | 2147 | awscli/examples/mediastore/delete-container.rst |
1857 | 2148 | awscli/examples/mediastore/delete-cors-policy.rst |
1858 | 2149 | awscli/examples/mediastore/delete-lifecycle-policy.rst |
1864 | 2155 | awscli/examples/mediastore/get-object.rst |
1865 | 2156 | awscli/examples/mediastore/list-containers.rst |
1866 | 2157 | awscli/examples/mediastore/list-items.rst |
2158 | awscli/examples/mediastore/list-tags-for-resource.rst | |
1867 | 2159 | awscli/examples/mediastore/put-container-policy.rst |
1868 | 2160 | awscli/examples/mediastore/put-cors-policy.rst |
1869 | 2161 | awscli/examples/mediastore/put-lifecycle-policy.rst |
1870 | 2162 | awscli/examples/mediastore/put-object.rst |
2163 | awscli/examples/mediastore/start-access-logging.rst | |
2164 | awscli/examples/mediastore/stop-access-logging.rst | |
2165 | awscli/examples/mediastore/tag-resource.rst | |
2166 | awscli/examples/mediastore/untag-resource.rst | |
1871 | 2167 | awscli/examples/mediastore-data/delete-object.rst |
2168 | awscli/examples/mediastore-data/describe-object.rst | |
2169 | awscli/examples/mediastore-data/get-object.rst | |
2170 | awscli/examples/mediastore-data/list-items.rst | |
2171 | awscli/examples/mediastore-data/put-object.rst | |
1872 | 2172 | awscli/examples/opsworks/assign-instance.rst |
1873 | 2173 | awscli/examples/opsworks/assign-volume.rst |
1874 | 2174 | awscli/examples/opsworks/associate-elastic-ip.rst |
1988 | 2288 | awscli/examples/pricing/describe-services.rst |
1989 | 2289 | awscli/examples/pricing/get-attribute-values.rst |
1990 | 2290 | awscli/examples/pricing/get-products.rst |
1991 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/accept-resource-share-invitation.rst | |
1992 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/associate-resource-share.rst | |
1993 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/create-resource-share.rst | |
1994 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/delete-resource-share.rst | |
1995 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/disassociate-resource-share.rst | |
1996 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/enable-sharing-with-aws-organization.rst | |
1997 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/get-resource-policies.rst | |
1998 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/get-resource-share-associations.rst | |
1999 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/get-resource-share-invitations.rst | |
2000 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/get-resource-shares.rst | |
2001 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/list-principals.rst | |
2002 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/list-resources.rst | |
2003 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/reject-resource-share-invitation.rst | |
2004 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/tag-resource.rst | |
2005 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/untag-resource.rst | |
2006 | awscli/examples/ram/julieso.aka.corp.amazon.com/cli-examples/ram/update-resource-share.rst | |
2291 | awscli/examples/qldb/create-ledger.rst | |
2292 | awscli/examples/qldb/delete-ledger.rst | |
2293 | awscli/examples/qldb/describe-journal-s3-export.rst | |
2294 | awscli/examples/qldb/describe-ledger.rst | |
2295 | awscli/examples/qldb/export-journal-to-s3.rst | |
2296 | awscli/examples/qldb/get-block.rst | |
2297 | awscli/examples/qldb/get-digest.rst | |
2298 | awscli/examples/qldb/get-revision.rst | |
2299 | awscli/examples/qldb/list-journal-s3-exports-for-ledger.rst | |
2300 | awscli/examples/qldb/list-journal-s3-exports.rst | |
2301 | awscli/examples/qldb/list-ledgers.rst | |
2302 | awscli/examples/qldb/list-tags-for-resource.rst | |
2303 | awscli/examples/qldb/tag-resource.rst | |
2304 | awscli/examples/qldb/untag-resource.rst | |
2305 | awscli/examples/qldb/update-ledger.rst | |
2306 | awscli/examples/ram/accept-resource-share-invitation.rst | |
2307 | awscli/examples/ram/associate-resource-share.rst | |
2308 | awscli/examples/ram/create-resource-share.rst | |
2309 | awscli/examples/ram/delete-resource-share.rst | |
2310 | awscli/examples/ram/disassociate-resource-share.rst | |
2311 | awscli/examples/ram/enable-sharing-with-aws-organization.rst | |
2312 | awscli/examples/ram/get-resource-policies.rst | |
2313 | awscli/examples/ram/get-resource-share-associations.rst | |
2314 | awscli/examples/ram/get-resource-share-invitations.rst | |
2315 | awscli/examples/ram/get-resource-shares.rst | |
2316 | awscli/examples/ram/list-principals.rst | |
2317 | awscli/examples/ram/list-resources.rst | |
2318 | awscli/examples/ram/reject-resource-share-invitation.rst | |
2319 | awscli/examples/ram/tag-resource.rst | |
2320 | awscli/examples/ram/untag-resource.rst | |
2321 | awscli/examples/ram/update-resource-share.rst | |
2007 | 2322 | awscli/examples/rds/add-option-to-option-group.rst |
2008 | 2323 | awscli/examples/rds/add-source-identifier-to-subscription.rst |
2009 | 2324 | awscli/examples/rds/add-tags-to-resource.rst |
2109 | 2424 | awscli/examples/redshift/restore-from-cluster-snapshot.rst |
2110 | 2425 | awscli/examples/redshift/revoke-cluster-security-group-ingress.rst |
2111 | 2426 | awscli/examples/redshift/revoke-snapshot-access.rst |
2427 | awscli/examples/rekognition/detect-labels.rst | |
2112 | 2428 | awscli/examples/resource-groups/create-group.rst |
2113 | 2429 | awscli/examples/resource-groups/update-group-query.rst |
2114 | 2430 | awscli/examples/resource-groups/update-group.rst |
2255 | 2571 | awscli/examples/ses/verify-domain-dkim.rst |
2256 | 2572 | awscli/examples/ses/verify-domain-identity.rst |
2257 | 2573 | awscli/examples/ses/verify-email-identity.rst |
2574 | awscli/examples/signer/cancel-signing-profile.rst | |
2575 | awscli/examples/signer/describe-signing-job.rst | |
2576 | awscli/examples/signer/get-signing-platform.rst | |
2577 | awscli/examples/signer/get-signing-profile.rst | |
2578 | awscli/examples/signer/list-signing-jobs.rst | |
2579 | awscli/examples/signer/list-signing-platforms.rst | |
2580 | awscli/examples/signer/list-signing-profiles.rst | |
2581 | awscli/examples/signer/put-signing-profile.rst | |
2582 | awscli/examples/signer/start-signing-job.rst | |
2258 | 2583 | awscli/examples/sns/confirm-subscription.rst |
2259 | 2584 | awscli/examples/sns/create-topic.rst |
2260 | 2585 | awscli/examples/sns/delete-topic.rst |
2277 | 2602 | awscli/examples/sqs/get-queue-attributes.rst |
2278 | 2603 | awscli/examples/sqs/get-queue-url.rst |
2279 | 2604 | awscli/examples/sqs/list-dead-letter-source-queues.rst |
2605 | awscli/examples/sqs/list-queue-tags.rst | |
2280 | 2606 | awscli/examples/sqs/list-queues.rst |
2281 | 2607 | awscli/examples/sqs/purge-queue.rst |
2282 | 2608 | awscli/examples/sqs/receive-message.rst |
2284 | 2610 | awscli/examples/sqs/send-message-batch.rst |
2285 | 2611 | awscli/examples/sqs/send-message.rst |
2286 | 2612 | awscli/examples/sqs/set-queue-attributes.rst |
2613 | awscli/examples/sqs/tag-queue.rst | |
2614 | awscli/examples/sqs/untag-queue.rst | |
2287 | 2615 | awscli/examples/ssm/add-tags-to-resource.rst |
2288 | 2616 | awscli/examples/ssm/cancel-command.rst |
2289 | 2617 | awscli/examples/ssm/cancel-maintenance-window-execution.rst |
2441 | 2769 | awscli/examples/workdocs/create-custom-metadata.rst |
2442 | 2770 | awscli/examples/workdocs/create-folder.rst |
2443 | 2771 | awscli/examples/workdocs/create-labels.rst |
2772 | awscli/examples/workdocs/create-notification-subscription.rst | |
2444 | 2773 | awscli/examples/workdocs/create-user.rst |
2445 | 2774 | awscli/examples/workdocs/deactivate-user.rst |
2446 | 2775 | awscli/examples/workdocs/delete-comment.rst |
2449 | 2778 | awscli/examples/workdocs/delete-folder-contents.rst |
2450 | 2779 | awscli/examples/workdocs/delete-folder.rst |
2451 | 2780 | awscli/examples/workdocs/delete-labels.rst |
2781 | awscli/examples/workdocs/delete-notification-subscription.rst | |
2452 | 2782 | awscli/examples/workdocs/delete-user.rst |
2453 | 2783 | awscli/examples/workdocs/describe-activities.rst |
2454 | 2784 | awscli/examples/workdocs/describe-comments.rst |
2455 | 2785 | awscli/examples/workdocs/describe-document-versions.rst |
2456 | 2786 | awscli/examples/workdocs/describe-folder-contents.rst |
2787 | awscli/examples/workdocs/describe-groups.rst | |
2788 | awscli/examples/workdocs/describe-notification-subscriptions.rst | |
2457 | 2789 | awscli/examples/workdocs/describe-resource-permissions.rst |
2458 | 2790 | awscli/examples/workdocs/describe-users.rst |
2459 | 2791 | awscli/examples/workdocs/get-document-path.rst |
2461 | 2793 | awscli/examples/workdocs/get-document.rst |
2462 | 2794 | awscli/examples/workdocs/get-folder-path.rst |
2463 | 2795 | awscli/examples/workdocs/get-folder.rst |
2796 | awscli/examples/workdocs/get-resources.rst | |
2464 | 2797 | awscli/examples/workdocs/initiate-document-version-upload.rst |
2465 | 2798 | awscli/examples/workdocs/remove-all-resource-permissions.rst |
2466 | 2799 | awscli/examples/workdocs/remove-resource-permission.rst |
0 | botocore==1.12.208 | |
0 | botocore==1.12.241 | |
1 | 1 | colorama<=0.3.9,>=0.2.5 |
2 | docutils<0.15,>=0.10 | |
2 | docutils<0.16,>=0.10 | |
3 | 3 | rsa<=3.5.0,>=3.1.2 |
4 | 4 | s3transfer<0.3.0,>=0.2.0 |
5 | PyYAML<=5.1,>=3.10 | |
5 | PyYAML<=5.2,>=3.10 | |
6 | 6 | |
7 | 7 | [:python_version=="2.6"] |
8 | 8 | argparse>=1.1 |
5 | 5 | -e git://github.com/boto/s3transfer.git@develop#egg=s3transfer |
6 | 6 | nose==1.3.7 |
7 | 7 | mock==1.3.0 |
8 | wheel==0.24.0 | |
8 | # 0.30.0 dropped support for python2.6 | |
9 | # remove this upper bound on the wheel version once 2.6 support | |
10 | # is dropped from aws-cli | |
11 | wheel>0.24.0,<0.30.0 |
2 | 2 | |
3 | 3 | [metadata] |
4 | 4 | requires-dist = |
5 | botocore==1.12.208 | |
5 | botocore==1.12.241 | |
6 | 6 | colorama>=0.2.5,<=0.3.9 |
7 | docutils>=0.10,<0.15 | |
7 | docutils>=0.10,<0.16 | |
8 | 8 | rsa>=3.1.2,<=3.5.0 |
9 | 9 | PyYAML>=3.10,<=3.13; python_version=="2.6" |
10 | PyYAML>=3.10,<=5.1;python_version!="2.6" | |
10 | PyYAML>=3.10,<=5.2;python_version!="2.6" | |
11 | 11 | s3transfer>=0.2.0,<0.3.0 |
12 | 12 | argparse>=1.1; python_version=="2.6" |
13 | 13 |
22 | 22 | raise RuntimeError("Unable to find version string.") |
23 | 23 | |
24 | 24 | |
25 | requires = ['botocore==1.12.208', | |
26 | 'colorama>=0.2.5,<=0.3.9', | |
27 | 'docutils>=0.10,<0.15', | |
28 | 'rsa>=3.1.2,<=3.5.0', | |
29 | 's3transfer>=0.2.0,<0.3.0'] | |
25 | install_requires = ['botocore==1.12.241', | |
26 | 'colorama>=0.2.5,<=0.3.9', | |
27 | 'docutils>=0.10,<0.16', | |
28 | 'rsa>=3.1.2,<=3.5.0', | |
29 | 's3transfer>=0.2.0,<0.3.0'] | |
30 | 30 | |
31 | 31 | |
32 | 32 | if sys.version_info[:2] == (2, 6): |
33 | 33 | # For python2.6 we have to require argparse since it |
34 | 34 | # was not in stdlib until 2.7. |
35 | requires.append('argparse>=1.1') | |
35 | install_requires.append('argparse>=1.1') | |
36 | 36 | |
37 | 37 | # For Python 2.6, we have to require a different verion of PyYAML since the latest |
38 | 38 | # versions dropped support for Python 2.6. |
39 | requires.append('PyYAML>=3.10,<=3.13') | |
39 | install_requires.append('PyYAML>=3.10,<=3.13') | |
40 | 40 | else: |
41 | requires.append('PyYAML>=3.10,<=5.1') | |
41 | install_requires.append('PyYAML>=3.10,<=5.2') | |
42 | 42 | |
43 | 43 | |
44 | 44 | setup_options = dict( |
56 | 56 | 'examples/*/*.txt', 'examples/*/*/*.txt', |
57 | 57 | 'examples/*/*/*.rst', 'topics/*.rst', |
58 | 58 | 'topics/*.json']}, |
59 | install_requires=requires, | |
59 | install_requires=install_requires, | |
60 | 60 | extras_require={ |
61 | 61 | ':python_version=="2.6"': [ |
62 | 62 | 'argparse>=1.1', |