awscli 1.42.33__py3-none-any.whl → 1.44.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of awscli might be problematic. Click here for more details.
- awscli/__init__.py +1 -1
- awscli/alias.py +3 -3
- awscli/argprocess.py +2 -1
- awscli/arguments.py +1 -1
- awscli/bcdoc/docevents.py +3 -0
- awscli/clidocs.py +19 -2
- awscli/clidriver.py +55 -9
- awscli/customizations/argrename.py +1 -0
- awscli/customizations/cliinputjson.py +4 -0
- awscli/customizations/cloudformation/deploy.py +19 -3
- awscli/customizations/cloudtrail/validation.py +22 -2
- awscli/customizations/commands.py +2 -1
- awscli/customizations/eks/update_kubeconfig.py +12 -1
- awscli/customizations/emr/argumentschema.py +355 -344
- awscli/customizations/emr/createcluster.py +12 -0
- awscli/customizations/emr/emrutils.py +83 -50
- awscli/customizations/emr/helptext.py +10 -0
- awscli/customizations/emr/steputils.py +92 -52
- awscli/customizations/globalargs.py +169 -0
- awscli/customizations/paginate.py +66 -1
- awscli/customizations/s3/filegenerator.py +4 -1
- awscli/customizations/s3/fileinfo.py +4 -1
- awscli/customizations/s3/fileinfobuilder.py +6 -0
- awscli/customizations/s3/s3handler.py +9 -0
- awscli/customizations/s3/subcommands.py +147 -6
- awscli/customizations/s3/syncstrategy/base.py +9 -0
- awscli/customizations/s3/syncstrategy/caseconflict.py +92 -0
- awscli/customizations/s3/utils.py +14 -0
- awscli/customizations/scalarparse.py +48 -9
- awscli/data/cli.json +5 -0
- awscli/examples/cloudformation/create-generated-template.rst +50 -0
- awscli/examples/cloudformation/create-stack-refactor.rst +16 -0
- awscli/examples/cloudformation/delete-generated-template.rst +10 -0
- awscli/examples/cloudformation/describe-generated-template.rst +62 -0
- awscli/examples/cloudformation/describe-resource-scan.rst +38 -0
- awscli/examples/cloudformation/describe-stack-refactor.rst +20 -0
- awscli/examples/cloudformation/execute-stack-refactor.rst +10 -0
- awscli/examples/cloudformation/list-generated-templates.rst +41 -0
- awscli/examples/cloudformation/list-resource-scan-related-resources.rst +47 -0
- awscli/examples/cloudformation/list-resource-scan-resources.rst +30 -0
- awscli/examples/cloudformation/list-stack-refactor-actions.rst +71 -0
- awscli/examples/cloudformation/start-resource-scan.rst +14 -0
- awscli/examples/global_options.rst +4 -0
- awscli/examples/global_synopsis.rst +1 -0
- awscli/examples/ivs-realtime/get-composition.rst +7 -4
- awscli/examples/ivs-realtime/start-composition.rst +88 -3
- awscli/examples/lambda/create-function.rst +4 -4
- awscli/examples/lambda/get-function.rst +3 -3
- awscli/examples/lambda/list-functions.rst +6 -6
- awscli/examples/medical-imaging/create-datastore.rst +19 -2
- awscli/examples/medical-imaging/get-datastore.rst +24 -1
- awscli/examples/securityhub/describe-hub.rst +6 -4
- awscli/examples/servicediscovery/create-service.rst +50 -10
- awscli/examples/servicediscovery/delete-namespace.rst +18 -4
- awscli/examples/servicediscovery/delete-service-attributes.rst +15 -3
- awscli/examples/servicediscovery/delete-service.rst +13 -3
- awscli/examples/servicediscovery/deregister-instance.rst +18 -2
- awscli/examples/servicediscovery/discover-instances-revision.rst +18 -1
- awscli/examples/servicediscovery/discover-instances.rst +32 -2
- awscli/examples/servicediscovery/get-instance.rst +30 -4
- awscli/examples/servicediscovery/get-instances-health-status.rst +19 -1
- awscli/examples/servicediscovery/get-namespace.rst +40 -9
- awscli/examples/servicediscovery/get-operation.rst +32 -6
- awscli/examples/servicediscovery/get-service-attributes.rst +25 -3
- awscli/examples/servicediscovery/get-service.rst +35 -7
- awscli/examples/servicediscovery/list-instances.rst +38 -3
- awscli/examples/servicediscovery/list-namespaces.rst +45 -22
- awscli/examples/servicediscovery/list-services.rst +30 -2
- awscli/examples/servicediscovery/register-instance.rst +18 -2
- awscli/examples/servicediscovery/update-http-namespace.rst +22 -5
- awscli/examples/servicediscovery/update-instance-custom-health-status.rst +14 -1
- awscli/examples/servicediscovery/update-private-dns-namespace.rst +22 -5
- awscli/examples/servicediscovery/update-public-dns-namespace.rst +22 -5
- awscli/examples/servicediscovery/update-service-attributes.rst +14 -2
- awscli/examples/servicediscovery/update-service.rst +20 -4
- awscli/paramfile.py +21 -4
- awscli/testutils.py +17 -0
- awscli/topics/config-vars.rst +1 -1
- awscli/topics/s3-case-insensitivity.rst +105 -0
- awscli/topics/topic-tags.json +16 -0
- awscli/utils.py +19 -2
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/METADATA +5 -3
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/RECORD +91 -132
- awscli/examples/qldb/cancel-journal-kinesis-stream.rst +0 -15
- awscli/examples/qldb/create-ledger.rst +0 -43
- awscli/examples/qldb/delete-ledger.rst +0 -10
- awscli/examples/qldb/describe-journal-kinesis-stream.rst +0 -29
- awscli/examples/qldb/describe-journal-s3-export.rst +0 -30
- awscli/examples/qldb/describe-ledger.rst +0 -23
- awscli/examples/qldb/export-journal-to-s3.rst +0 -28
- awscli/examples/qldb/get-block.rst +0 -55
- awscli/examples/qldb/get-digest.rst +0 -17
- awscli/examples/qldb/get-revision.rst +0 -57
- awscli/examples/qldb/list-journal-kinesis-streams-for-ledger.rst +0 -30
- awscli/examples/qldb/list-journal-s3-exports-for-ledger.rst +0 -31
- awscli/examples/qldb/list-journal-s3-exports.rst +0 -46
- awscli/examples/qldb/list-ledgers.rst +0 -24
- awscli/examples/qldb/list-tags-for-resource.rst +0 -17
- awscli/examples/qldb/stream-journal-to-kinesis.rst +0 -46
- awscli/examples/qldb/tag-resource.rst +0 -11
- awscli/examples/qldb/untag-resource.rst +0 -11
- awscli/examples/qldb/update-ledger-permissions-mode.rst +0 -34
- awscli/examples/qldb/update-ledger.rst +0 -63
- awscli/examples/robomaker/batch-describe-simulation-job.rst +0 -150
- awscli/examples/robomaker/cancel-simulation-job.rst +0 -6
- awscli/examples/robomaker/create-deployment-job.rst +0 -37
- awscli/examples/robomaker/create-fleet.rst +0 -18
- awscli/examples/robomaker/create-robot-application-version.rst +0 -31
- awscli/examples/robomaker/create-robot-application.rst +0 -29
- awscli/examples/robomaker/create-robot.rst +0 -20
- awscli/examples/robomaker/create-simulation-application-version.rst +0 -39
- awscli/examples/robomaker/create-simulation-application.rst +0 -38
- awscli/examples/robomaker/create-simulation-job.rst +0 -43
- awscli/examples/robomaker/delete-fleet.rst +0 -7
- awscli/examples/robomaker/delete-robot-application.rst +0 -7
- awscli/examples/robomaker/delete-robot.rst +0 -7
- awscli/examples/robomaker/delete-simulation-application.rst +0 -7
- awscli/examples/robomaker/deregister-robot.rst +0 -14
- awscli/examples/robomaker/describe-deployment-job.rst +0 -38
- awscli/examples/robomaker/describe-fleet.rst +0 -28
- awscli/examples/robomaker/describe-robot-application.rst +0 -29
- awscli/examples/robomaker/describe-robot.rst +0 -21
- awscli/examples/robomaker/describe-simulation-application.rst +0 -37
- awscli/examples/robomaker/describe-simulation-job.rst +0 -45
- awscli/examples/robomaker/list-deployment-jobs.rst +0 -57
- awscli/examples/robomaker/list-fleets.rst +0 -22
- awscli/examples/robomaker/list-robot-applications.rst +0 -32
- awscli/examples/robomaker/list-robots.rst +0 -45
- awscli/examples/robomaker/list-simulation-applications.rst +0 -50
- awscli/examples/robomaker/list-simulation-jobs.rst +0 -80
- awscli/examples/robomaker/list-tags-for-resource.rst +0 -16
- awscli/examples/robomaker/register-robot.rst +0 -14
- awscli/examples/robomaker/restart-simulation-job.rst +0 -7
- awscli/examples/robomaker/sync-deployment-job.rst +0 -30
- awscli/examples/robomaker/tag-resource.rst +0 -7
- awscli/examples/robomaker/untag-resource.rst +0 -7
- awscli/examples/robomaker/update-robot-application.rst +0 -28
- awscli/examples/robomaker/update-simulation-application.rst +0 -36
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws +0 -0
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws.cmd +0 -0
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_bash_completer +0 -0
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_completer +0 -0
- {awscli-1.42.33.data → awscli-1.44.6.data}/scripts/aws_zsh_completer.sh +0 -0
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/LICENSE.txt +0 -0
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/WHEEL +0 -0
- {awscli-1.42.33.dist-info → awscli-1.44.6.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import logging
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
from awscli.customizations.s3.syncstrategy.base import BaseSync
|
|
8
|
+
from awscli.customizations.utils import uni_print
|
|
9
|
+
|
|
10
|
+
LOG = logging.getLogger(__name__)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class CaseConflictException(Exception):
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class CaseConflictSync(BaseSync):
|
|
18
|
+
DOC_URI = (
|
|
19
|
+
"https://docs.aws.amazon.com/cli/v1/topic/"
|
|
20
|
+
"s3-case-insensitivity.html"
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
def __init__(
|
|
24
|
+
self,
|
|
25
|
+
sync_type='file_not_at_dest',
|
|
26
|
+
on_case_conflict='warn',
|
|
27
|
+
submitted=None,
|
|
28
|
+
):
|
|
29
|
+
super().__init__(sync_type)
|
|
30
|
+
self._on_case_conflict = on_case_conflict
|
|
31
|
+
if submitted is None:
|
|
32
|
+
submitted = set()
|
|
33
|
+
self._submitted = submitted
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def submitted(self):
|
|
37
|
+
return self._submitted
|
|
38
|
+
|
|
39
|
+
def determine_should_sync(self, src_file, dest_file):
|
|
40
|
+
# `src_file.compare_key` and `dest_file.compare_key` are not equal.
|
|
41
|
+
# This could mean that they're completely different or differ
|
|
42
|
+
# only by case. eg, `/tmp/a` and `/tmp/b` versus `/tmp/a` and `/tmp/A`.
|
|
43
|
+
# If the source file's destination already exists, that means it
|
|
44
|
+
# differs only by case and the conflict needs to be handled.
|
|
45
|
+
should_sync = True
|
|
46
|
+
# Normalize compare key for case sensitivity.
|
|
47
|
+
lower_compare_key = src_file.compare_key.lower()
|
|
48
|
+
if lower_compare_key in self._submitted or os.path.exists(
|
|
49
|
+
src_file.dest
|
|
50
|
+
):
|
|
51
|
+
handler = getattr(self, f"_handle_{self._on_case_conflict}")
|
|
52
|
+
should_sync = handler(src_file)
|
|
53
|
+
if should_sync:
|
|
54
|
+
LOG.debug(f"syncing: {src_file.src} -> {src_file.dest}")
|
|
55
|
+
self._submitted.add(lower_compare_key)
|
|
56
|
+
# Set properties so that a subscriber can be created
|
|
57
|
+
# that removes the key from the set after download finishes.
|
|
58
|
+
src_file.case_conflict_submitted = self._submitted
|
|
59
|
+
src_file.case_conflict_key = lower_compare_key
|
|
60
|
+
return should_sync
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
def _handle_skip(src_file):
|
|
64
|
+
msg = (
|
|
65
|
+
f"warning: Skipping {src_file.src} -> {src_file.dest} "
|
|
66
|
+
"because a file whose name differs only by case either exists "
|
|
67
|
+
"or is being downloaded.\n"
|
|
68
|
+
)
|
|
69
|
+
uni_print(msg, sys.stderr)
|
|
70
|
+
return False
|
|
71
|
+
|
|
72
|
+
@staticmethod
|
|
73
|
+
def _handle_warn(src_file):
|
|
74
|
+
msg = (
|
|
75
|
+
f"warning: Downloading {src_file.src} -> {src_file.dest} "
|
|
76
|
+
"despite a file whose name differs only by case either existing "
|
|
77
|
+
"or being downloaded. This behavior is not defined on "
|
|
78
|
+
"case-insensitive filesystems and may result in overwriting "
|
|
79
|
+
"existing files or race conditions between concurrent downloads. "
|
|
80
|
+
f"For more information, see {CaseConflictSync.DOC_URI}.\n"
|
|
81
|
+
)
|
|
82
|
+
uni_print(msg, sys.stderr)
|
|
83
|
+
return True
|
|
84
|
+
|
|
85
|
+
@staticmethod
|
|
86
|
+
def _handle_error(src_file):
|
|
87
|
+
msg = (
|
|
88
|
+
f"Failed to download {src_file.src} -> {src_file.dest} "
|
|
89
|
+
"because a file whose name differs only by case either exists "
|
|
90
|
+
"or is being downloaded."
|
|
91
|
+
)
|
|
92
|
+
raise CaseConflictException(msg)
|
|
@@ -690,6 +690,20 @@ class OnDoneFilteredSubscriber(BaseSubscriber):
|
|
|
690
690
|
pass
|
|
691
691
|
|
|
692
692
|
|
|
693
|
+
class CaseConflictCleanupSubscriber(BaseSubscriber):
|
|
694
|
+
"""
|
|
695
|
+
A subscriber which removes object compare key from case conflict set
|
|
696
|
+
when download finishes.
|
|
697
|
+
"""
|
|
698
|
+
|
|
699
|
+
def __init__(self, submitted, case_conflict_key):
|
|
700
|
+
self._submitted = submitted
|
|
701
|
+
self._key = case_conflict_key
|
|
702
|
+
|
|
703
|
+
def on_done(self, future, **kwargs):
|
|
704
|
+
self._submitted.discard(self._key)
|
|
705
|
+
|
|
706
|
+
|
|
693
707
|
class DeleteSourceSubscriber(OnDoneFilteredSubscriber):
|
|
694
708
|
"""A subscriber which deletes the source of the transfer."""
|
|
695
709
|
def _on_success(self, future):
|
|
@@ -27,9 +27,14 @@ There's nothing currently done for timestamps, but this will change
|
|
|
27
27
|
in the future.
|
|
28
28
|
|
|
29
29
|
"""
|
|
30
|
+
import sys
|
|
31
|
+
|
|
30
32
|
from botocore.utils import parse_timestamp
|
|
31
33
|
from botocore.exceptions import ProfileNotFound
|
|
32
34
|
|
|
35
|
+
from awscli.customizations.utils import uni_print
|
|
36
|
+
from awscli.utils import resolve_v2_debug_mode
|
|
37
|
+
|
|
33
38
|
|
|
34
39
|
def register_scalar_parser(event_handlers):
|
|
35
40
|
event_handlers.register_first(
|
|
@@ -44,12 +49,20 @@ def iso_format(value):
|
|
|
44
49
|
return parse_timestamp(value).isoformat()
|
|
45
50
|
|
|
46
51
|
|
|
47
|
-
def add_timestamp_parser(session):
|
|
52
|
+
def add_timestamp_parser(session, v2_debug=False):
|
|
48
53
|
factory = session.get_component('response_parser_factory')
|
|
54
|
+
print_v2_debug_warnings = v2_debug
|
|
49
55
|
try:
|
|
50
56
|
timestamp_format = session.get_scoped_config().get(
|
|
51
57
|
'cli_timestamp_format',
|
|
52
|
-
|
|
58
|
+
None)
|
|
59
|
+
if timestamp_format is not None:
|
|
60
|
+
# We do not want to print v2 debug warnings if the user explicitly
|
|
61
|
+
# configured the cli_timestamp_format, they would not be
|
|
62
|
+
# broken in that case.
|
|
63
|
+
print_v2_debug_warnings = False
|
|
64
|
+
else:
|
|
65
|
+
timestamp_format = 'wire'
|
|
53
66
|
except ProfileNotFound:
|
|
54
67
|
# If a --profile is provided that does not exist, loading
|
|
55
68
|
# a value from get_scoped_config will crash the CLI.
|
|
@@ -57,23 +70,49 @@ def add_timestamp_parser(session):
|
|
|
57
70
|
# the session-initialized event, which happens before a
|
|
58
71
|
# profile can be created, even if the command would have
|
|
59
72
|
# successfully created a profile. Instead of crashing here
|
|
60
|
-
# on a ProfileNotFound the CLI should just use '
|
|
61
|
-
timestamp_format = '
|
|
62
|
-
|
|
73
|
+
# on a ProfileNotFound the CLI should just use 'wire'.
|
|
74
|
+
timestamp_format = 'wire'
|
|
75
|
+
# We also support 'none' for backwards compatibility reasons, though we
|
|
76
|
+
# document 'wire' instead.
|
|
77
|
+
if timestamp_format == 'wire' or timestamp_format == 'none':
|
|
63
78
|
# For backwards compatibility reasons, we replace botocore's timestamp
|
|
64
79
|
# parser (which parses to a datetime.datetime object) with the
|
|
65
80
|
# identity function which prints the date exactly the same as it comes
|
|
66
81
|
# across the wire.
|
|
67
|
-
|
|
82
|
+
encountered_timestamp = False
|
|
83
|
+
def identity_with_warning(x):
|
|
84
|
+
# To prevent printing the same warning for each timestamp in the
|
|
85
|
+
# response, we utilize a reference to a nonlocal variable to track
|
|
86
|
+
# if we have already printed the warning.
|
|
87
|
+
nonlocal encountered_timestamp
|
|
88
|
+
if not encountered_timestamp:
|
|
89
|
+
encountered_timestamp = True
|
|
90
|
+
uni_print(
|
|
91
|
+
'\nAWS CLI v2 UPGRADE WARNING: In AWS CLI v2, all '
|
|
92
|
+
'timestamp response values are returned in the ISO 8601 '
|
|
93
|
+
'format. This is different from v1 behavior, where the '
|
|
94
|
+
'timestamps are returned as they appear in the service '
|
|
95
|
+
'API response. To retain AWS CLI v1 behavior in AWS CLI '
|
|
96
|
+
'v2, set the configuration variable '
|
|
97
|
+
'`cli_timestamp_format` to `wire`. See '
|
|
98
|
+
'https://docs.aws.amazon.com/cli/latest/userguide/'
|
|
99
|
+
'cliv2-migration-changes.html'
|
|
100
|
+
'#cliv2-migration-timestamp.\n',
|
|
101
|
+
out_file=sys.stderr
|
|
102
|
+
)
|
|
103
|
+
return identity(x)
|
|
104
|
+
|
|
105
|
+
timestamp_parser = identity_with_warning \
|
|
106
|
+
if print_v2_debug_warnings else identity
|
|
68
107
|
elif timestamp_format == 'iso8601':
|
|
69
108
|
timestamp_parser = iso_format
|
|
70
109
|
else:
|
|
71
110
|
raise ValueError('Unknown cli_timestamp_format value: %s, valid values'
|
|
72
|
-
' are "none" or "iso8601"' % timestamp_format)
|
|
111
|
+
' are "none", "wire" or "iso8601"' % timestamp_format)
|
|
73
112
|
factory.set_parser_defaults(timestamp_parser=timestamp_parser)
|
|
74
113
|
|
|
75
114
|
|
|
76
|
-
def add_scalar_parsers(session, **kwargs):
|
|
115
|
+
def add_scalar_parsers(session, parsed_args=None, **kwargs):
|
|
77
116
|
factory = session.get_component('response_parser_factory')
|
|
78
117
|
factory.set_parser_defaults(blob_parser=identity)
|
|
79
|
-
add_timestamp_parser(session)
|
|
118
|
+
add_timestamp_parser(session, resolve_v2_debug_mode(parsed_args))
|
awscli/data/cli.json
CHANGED
|
@@ -64,6 +64,11 @@
|
|
|
64
64
|
"dest": "connect_timeout",
|
|
65
65
|
"type": "int",
|
|
66
66
|
"help": "<p>The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.</p>"
|
|
67
|
+
},
|
|
68
|
+
"v2-debug": {
|
|
69
|
+
"action": "store_true",
|
|
70
|
+
"dest": "v2_debug",
|
|
71
|
+
"help": "<p>Enable AWS CLI v2 migration assistance. Prints warnings if the command would face a breaking change after swapping AWS CLI v1 for AWS CLI v2 in the current environment. Prints one warning for each breaking change detected.</p>"
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
**To create a generated template from scanned resources**
|
|
2
|
+
|
|
3
|
+
The following ``create-generated-template`` example creates a generated template named ``MyTemplate`` from scanned resources. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation create-generated-template \
|
|
6
|
+
--generated-template-name MyTemplate \
|
|
7
|
+
--resources file://resources.json
|
|
8
|
+
|
|
9
|
+
Contents of ``resources.json``::
|
|
10
|
+
|
|
11
|
+
[
|
|
12
|
+
{
|
|
13
|
+
"ResourceType": "AWS::EKS::Cluster",
|
|
14
|
+
"LogicalResourceId":"MyCluster",
|
|
15
|
+
"ResourceIdentifier": {
|
|
16
|
+
"ClusterName": "MyAppClusterName"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"ResourceType": "AWS::AutoScaling::AutoScalingGroup",
|
|
21
|
+
"LogicalResourceId":"MyASG",
|
|
22
|
+
"ResourceIdentifier": {
|
|
23
|
+
"AutoScalingGroupName": "MyAppASGName"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"ResourceType": "AWS::EKS::Nodegroup",
|
|
28
|
+
"LogicalResourceId":"MyNodegroup",
|
|
29
|
+
"ResourceIdentifier": {
|
|
30
|
+
"NodegroupName": "MyAppNodegroupName"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"ResourceType": "AWS::IAM::Role",
|
|
35
|
+
"LogicalResourceId":"MyRole",
|
|
36
|
+
"ResourceIdentifier": {
|
|
37
|
+
"RoleId": "arn:aws::iam::123456789012:role/MyAppIAMRole"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
Output::
|
|
43
|
+
|
|
44
|
+
{
|
|
45
|
+
"Arn":
|
|
46
|
+
"arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/7fc8512c-d8cb-4e02-b266-d39c48344e48",
|
|
47
|
+
"Name": "MyTemplate"
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
For more information, see `Create a CloudFormation template from resources scanned with IaC generator <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/iac-generator-create-template-from-scanned-resources.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
**To create the stack definition for a stack refactor operation**
|
|
2
|
+
|
|
3
|
+
The following ``create-stack-refactor`` example creates the stack definition for stack refactoring. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation create-stack-refactor \
|
|
6
|
+
--stack-definitions \
|
|
7
|
+
StackName=Stack1,TemplateBody@=file://template1-updated.yaml \
|
|
8
|
+
StackName=Stack2,TemplateBody@=file://template2-updated.yaml
|
|
9
|
+
|
|
10
|
+
Output::
|
|
11
|
+
|
|
12
|
+
{
|
|
13
|
+
"StackRefactorId": "9c384f70-4e07-4ed7-a65d-fee5eb430841"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
For more information, see `Stack refactoring <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stack-refactoring.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
**To delete a generated template**
|
|
2
|
+
|
|
3
|
+
The following ``delete-generated-template`` example deletes the specified template. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation delete-generated-template \
|
|
6
|
+
--generated-template-name MyTemplate
|
|
7
|
+
|
|
8
|
+
This command produces no output.
|
|
9
|
+
|
|
10
|
+
For more information, see `Generating templates from existing resources <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/generate-IaC.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
**To describe a generated template**
|
|
2
|
+
|
|
3
|
+
The following ``describe-generated-template`` example describes the specified template. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation describe-generated-template \
|
|
6
|
+
--generated-template-name MyTemplate
|
|
7
|
+
|
|
8
|
+
Output::
|
|
9
|
+
|
|
10
|
+
{
|
|
11
|
+
"GeneratedTemplateId": "arn:aws:cloudformation:us-east-1:123456789012:generatedTemplate/7d881acf-f307-4ded-910e-f8fb49b96894",
|
|
12
|
+
"GeneratedTemplateName": "MyTemplate",
|
|
13
|
+
"Resources": [
|
|
14
|
+
{
|
|
15
|
+
"ResourceType": "AWS::EC2::SecurityGroup",
|
|
16
|
+
"LogicalResourceId": "EC2SecurityGroup",
|
|
17
|
+
"ResourceIdentifier": {
|
|
18
|
+
"Id": "sg-1234567890abcdef0"
|
|
19
|
+
},
|
|
20
|
+
"ResourceStatus": "COMPLETE",
|
|
21
|
+
"ResourceStatusReason": "Resource Template complete",
|
|
22
|
+
"Warnings": []
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"ResourceType": "AWS::EC2::Instance",
|
|
26
|
+
"LogicalResourceId": "EC2Instance",
|
|
27
|
+
"ResourceIdentifier": {
|
|
28
|
+
"InstanceId": "i-1234567890abcdef0"
|
|
29
|
+
},
|
|
30
|
+
"ResourceStatus": "COMPLETE",
|
|
31
|
+
"ResourceStatusReason": "Resource Template complete",
|
|
32
|
+
"Warnings": []
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"ResourceType": "AWS::EC2::KeyPair",
|
|
36
|
+
"LogicalResourceId": "EC2KeyPairSshkeypair",
|
|
37
|
+
"ResourceIdentifier": {
|
|
38
|
+
"KeyName": "sshkeypair"
|
|
39
|
+
},
|
|
40
|
+
"ResourceStatus": "COMPLETE",
|
|
41
|
+
"ResourceStatusReason": "Resource Template complete",
|
|
42
|
+
"Warnings": []
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"Status": "COMPLETE",
|
|
46
|
+
"StatusReason": "All resources complete",
|
|
47
|
+
"CreationTime": "2025-09-23T19:38:06.435000+00:00",
|
|
48
|
+
"LastUpdatedTime": "2025-09-23T19:38:10.798000+00:00",
|
|
49
|
+
"Progress": {
|
|
50
|
+
"ResourcesSucceeded": 3,
|
|
51
|
+
"ResourcesFailed": 0,
|
|
52
|
+
"ResourcesProcessing": 0,
|
|
53
|
+
"ResourcesPending": 0
|
|
54
|
+
},
|
|
55
|
+
"TemplateConfiguration": {
|
|
56
|
+
"DeletionPolicy": "RETAIN",
|
|
57
|
+
"UpdateReplacePolicy": "RETAIN"
|
|
58
|
+
},
|
|
59
|
+
"TotalWarnings": 0
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
For more information, see `Generating templates from existing resources <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/generate-IaC.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
**To describe a resource scan**
|
|
2
|
+
|
|
3
|
+
The following ``describe-resource-scan`` example describes the resource scan with the specified scan ID. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation describe-resource-scan --region \
|
|
6
|
+
--resource-scan-id arn:aws:cloudformation:us-east-1:123456789012:resourceScan/0a699f15-489c-43ca-a3ef-3e6ecfa5da60
|
|
7
|
+
|
|
8
|
+
Output::
|
|
9
|
+
|
|
10
|
+
{
|
|
11
|
+
"ResourceScanId": "arn:aws:cloudformation:us-east-1:123456789012:resourceScan/0a699f15-489c-43ca-a3ef-3e6ecfa5da60",
|
|
12
|
+
"Status": "COMPLETE",
|
|
13
|
+
"StartTime": "2025-08-21T03:10:38.485000+00:00",
|
|
14
|
+
"EndTime": "2025-08-21T03:20:28.485000+00:00",
|
|
15
|
+
"PercentageCompleted": 100.0,
|
|
16
|
+
"ResourceTypes": [
|
|
17
|
+
"AWS::CloudFront::CachePolicy",
|
|
18
|
+
"AWS::CloudFront::OriginRequestPolicy",
|
|
19
|
+
"AWS::EC2::DHCPOptions",
|
|
20
|
+
"AWS::EC2::InternetGateway",
|
|
21
|
+
"AWS::EC2::KeyPair",
|
|
22
|
+
"AWS::EC2::NetworkAcl",
|
|
23
|
+
"AWS::EC2::NetworkInsightsPath",
|
|
24
|
+
"AWS::EC2::NetworkInterface",
|
|
25
|
+
"AWS::EC2::PlacementGroup",
|
|
26
|
+
"AWS::EC2::Route",
|
|
27
|
+
"AWS::EC2::RouteTable",
|
|
28
|
+
"AWS::EC2::SecurityGroup",
|
|
29
|
+
"AWS::EC2::Subnet",
|
|
30
|
+
"AWS::EC2::SubnetCidrBlock",
|
|
31
|
+
"AWS::EC2::SubnetNetworkAclAssociation",
|
|
32
|
+
"AWS::EC2::SubnetRouteTableAssociation",
|
|
33
|
+
...
|
|
34
|
+
],
|
|
35
|
+
"ResourcesRead": 676
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
For more information, see `Generating templates from existing resources <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/generate-IaC.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
**To describe a stack refactor operation**
|
|
2
|
+
|
|
3
|
+
The following ``describe-stack-refactor`` example describes the stack refactor operation with the specified stack refactor ID. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation describe-stack-refactor \
|
|
6
|
+
--stack-refactor-id 9c384f70-4e07-4ed7-a65d-fee5eb430841
|
|
7
|
+
|
|
8
|
+
Output::
|
|
9
|
+
|
|
10
|
+
{
|
|
11
|
+
"StackRefactorId": "9c384f70-4e07-4ed7-a65d-fee5eb430841",
|
|
12
|
+
"StackIds": [
|
|
13
|
+
"arn:aws:cloudformation:us-east-1:123456789012:stack/Stack1/3e6a1ff0-94b1-11f0-aa6f-0a88d2e03acf",
|
|
14
|
+
"arn:aws:cloudformation:us-east-1:123456789012:stack/Stack2/5da91650-94b1-11f0-81cf-0a23500e151b"
|
|
15
|
+
],
|
|
16
|
+
"ExecutionStatus": "AVAILABLE",
|
|
17
|
+
"Status": "CREATE_COMPLETE"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
For more information, see `Stack refactoring <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stack-refactoring.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
**To complete a stack refactor operation**
|
|
2
|
+
|
|
3
|
+
The following ``execute-stack-refactor`` example completes the stack refactor operation with the specified stack refactor ID. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation execute-stack-refactor \
|
|
6
|
+
--stack-refactor-id 9c384f70-4e07-4ed7-a65d-fee5eb430841
|
|
7
|
+
|
|
8
|
+
This command produces no output.
|
|
9
|
+
|
|
10
|
+
For more information, see `Stack refactoring <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stack-refactoring.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
**To list generated templates**
|
|
2
|
+
|
|
3
|
+
The following ``list-generated-templates`` example lists all generated templates. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation list-generated-templates
|
|
6
|
+
|
|
7
|
+
Output::
|
|
8
|
+
|
|
9
|
+
{
|
|
10
|
+
"Summaries": [
|
|
11
|
+
{
|
|
12
|
+
"GeneratedTemplateId": "arn:aws:cloudformation:us-east-1:123456789012:generatedtemplate/7fc8512c-d8cb-4e02-b266-d39c48344e48",
|
|
13
|
+
"GeneratedTemplateName": "MyTemplate",
|
|
14
|
+
"Status": "COMPLETE",
|
|
15
|
+
"StatusReason": "All resources complete",
|
|
16
|
+
"CreationTime": "2025-09-23T20:13:24.283000+00:00",
|
|
17
|
+
"LastUpdatedTime": "2025-09-23T20:13:28.610000+00:00",
|
|
18
|
+
"NumberOfResources": 4
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"GeneratedTemplateId": "arn:aws:cloudformation:us-east-1:123456789012:generatedTemplate/f10dd1c4-edc6-4823-8153-ab6112b8d051",
|
|
22
|
+
"GeneratedTemplateName": "MyEC2InstanceTemplate",
|
|
23
|
+
"Status": "COMPLETE",
|
|
24
|
+
"StatusReason": "All resources complete",
|
|
25
|
+
"CreationTime": "2024-08-08T19:35:49.790000+00:00",
|
|
26
|
+
"LastUpdatedTime": "2024-08-08T19:35:52.207000+00:00",
|
|
27
|
+
"NumberOfResources": 3
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"GeneratedTemplateId": "arn:aws:cloudformation:us-east-1:123456789012:generatedTemplate/e5a1c89f-7ce2-41bd-9bdf-75b7c852e3ca",
|
|
31
|
+
"GeneratedTemplateName": "MyEKSNodeGroupTemplate",
|
|
32
|
+
"Status": "COMPLETE",
|
|
33
|
+
"StatusReason": "All resources complete",
|
|
34
|
+
"CreationTime": "2024-07-16T20:39:27.883000+00:00",
|
|
35
|
+
"LastUpdatedTime": "2024-07-16T20:39:35.766000+00:00",
|
|
36
|
+
"NumberOfResources": 4
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
For more information, see `Generating templates from existing resources <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/generate-IaC.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
**To list related resources from a resource scan**
|
|
2
|
+
|
|
3
|
+
The following ``list-resource-scan-related-resources`` example lists resources from the specified resource scan that are related to resources in ``resources.json``. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation list-resource-scan-related-resources \
|
|
6
|
+
--resource-scan-id arn:aws:cloudformation:us-east-1:123456789012:resourceScan/0a699f15-489c-43ca-a3ef-3e6ecfa5da60 \
|
|
7
|
+
--resources file://resources.json
|
|
8
|
+
|
|
9
|
+
Contents of ``resources.json``::
|
|
10
|
+
|
|
11
|
+
[
|
|
12
|
+
{
|
|
13
|
+
"ResourceType": "AWS::EKS::Cluster",
|
|
14
|
+
"ResourceIdentifier": {
|
|
15
|
+
"ClusterName": "MyAppClusterName"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"ResourceType": "AWS::AutoScaling::AutoScalingGroup",
|
|
20
|
+
"ResourceIdentifier": {
|
|
21
|
+
"AutoScalingGroupName": "MyAppASGName"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
Output::
|
|
27
|
+
|
|
28
|
+
{
|
|
29
|
+
"RelatedResources": [
|
|
30
|
+
{
|
|
31
|
+
"ResourceType": "AWS::EKS::Nodegroup",
|
|
32
|
+
"ResourceIdentifier": {
|
|
33
|
+
"NodegroupName": "MyAppNodegroupName"
|
|
34
|
+
},
|
|
35
|
+
"ManagedByStack": false
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"ResourceType": "AWS::IAM::Role",
|
|
39
|
+
"ResourceIdentifier": {
|
|
40
|
+
"RoleId": "arn:aws::iam::123456789012:role/MyAppIAMRole"
|
|
41
|
+
},
|
|
42
|
+
"ManagedByStack": false
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
For more information, see `Create a CloudFormation template from resources scanned with IaC generator <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/iac-generator-create-template-from-scanned-resources.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
**To list resources from a resource scan**
|
|
2
|
+
|
|
3
|
+
The following ``list-resource-scan-resources`` example lists resources from the specified resource scan, filtered by resource identifier. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation list-resource-scan-resources \
|
|
6
|
+
--resource-scan-id arn:aws:cloudformation:us-east-1:123456789012:resourceScan/0a699f15-489c-43ca-a3ef-3e6ecfa5da60 \
|
|
7
|
+
--resource-identifier MyApp
|
|
8
|
+
|
|
9
|
+
Output::
|
|
10
|
+
|
|
11
|
+
{
|
|
12
|
+
"Resources": [
|
|
13
|
+
{
|
|
14
|
+
"ResourceType": "AWS::EKS::Cluster",
|
|
15
|
+
"ResourceIdentifier": {
|
|
16
|
+
"ClusterName": "MyAppClusterName"
|
|
17
|
+
},
|
|
18
|
+
"ManagedByStack": false
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"ResourceType": "AWS::AutoScaling::AutoScalingGroup",
|
|
22
|
+
"ResourceIdentifier": {
|
|
23
|
+
"AutoScalingGroupName": "MyAppASGName"
|
|
24
|
+
},
|
|
25
|
+
"ManagedByStack": false
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
For more information, see `Create a CloudFormation template from resources scanned with IaC generator <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/iac-generator-create-template-from-scanned-resources.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
**To list actions for a stack refactor operation**
|
|
2
|
+
|
|
3
|
+
The following ``list-stack-refactor-actions`` example lists actions for the stack refactor operation with the specified stack refactor ID. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation list-stack-refactor-actions \
|
|
6
|
+
--stack-refactor-id 9c384f70-4e07-4ed7-a65d-fee5eb430841
|
|
7
|
+
|
|
8
|
+
Output::
|
|
9
|
+
|
|
10
|
+
{
|
|
11
|
+
"StackRefactorActions": [
|
|
12
|
+
{
|
|
13
|
+
"Action": "MOVE",
|
|
14
|
+
"Entity": "RESOURCE",
|
|
15
|
+
"PhysicalResourceId": "MyTestLambdaRole",
|
|
16
|
+
"Description": "No configuration changes detected.",
|
|
17
|
+
"Detection": "AUTO",
|
|
18
|
+
"TagResources": [],
|
|
19
|
+
"UntagResources": [],
|
|
20
|
+
"ResourceMapping": {
|
|
21
|
+
"Source": {
|
|
22
|
+
"StackName": "arn:aws:cloudformation:us-east-1:123456789012:stack/Stack1/3e6a1ff0-94b1-11f0-aa6f-0a88d2e03acf",
|
|
23
|
+
"LogicalResourceId": "MyLambdaRole"
|
|
24
|
+
},
|
|
25
|
+
"Destination": {
|
|
26
|
+
"StackName": "arn:aws:cloudformation:us-east-1:123456789012:stack/Stack2/5da91650-94b1-11f0-81cf-0a23500e151b",
|
|
27
|
+
"LogicalResourceId": "MyLambdaRole"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"Action": "MOVE",
|
|
33
|
+
"Entity": "RESOURCE",
|
|
34
|
+
"PhysicalResourceId": "MyTestFunction",
|
|
35
|
+
"Description": "Resource configuration changes will be validated during refactor execution.",
|
|
36
|
+
"Detection": "AUTO",
|
|
37
|
+
"TagResources": [
|
|
38
|
+
{
|
|
39
|
+
"Key": "aws:cloudformation:stack-name",
|
|
40
|
+
"Value": "Stack2"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"Key": "aws:cloudformation:logical-id",
|
|
44
|
+
"Value": "MyFunction"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"Key": "aws:cloudformation:stack-id",
|
|
48
|
+
"Value": "arn:aws:cloudformation:us-east-1:123456789012:stack/Stack2/5da91650-94b1-11f0-81cf-0a23500e151b"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"UntagResources": [
|
|
52
|
+
"aws:cloudformation:stack-name",
|
|
53
|
+
"aws:cloudformation:logical-id",
|
|
54
|
+
"aws:cloudformation:stack-id"
|
|
55
|
+
],
|
|
56
|
+
"ResourceMapping": {
|
|
57
|
+
"Source": {
|
|
58
|
+
"StackName": "arn:aws:cloudformation:us-east-1:123456789012:stack/Stack1/3e6a1ff0-94b1-11f0-aa6f-0a88d2e03acf",
|
|
59
|
+
"LogicalResourceId": "MyFunction"
|
|
60
|
+
},
|
|
61
|
+
"Destination": {
|
|
62
|
+
"StackName": "arn:aws:cloudformation:us-east-1:123456789012:stack/Stack2/5da91650-94b1-11f0-81cf-0a23500e151b",
|
|
63
|
+
"LogicalResourceId": "MyFunction"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
For more information, see `Stack refactoring <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stack-refactoring.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
**To start a resource scan**
|
|
2
|
+
|
|
3
|
+
The following ``start-resource-scan`` example starts a resource scan that scans all existing resources in the current account and Region. ::
|
|
4
|
+
|
|
5
|
+
aws cloudformation start-resource-scan
|
|
6
|
+
|
|
7
|
+
Output::
|
|
8
|
+
|
|
9
|
+
{
|
|
10
|
+
"ResourceScanId":
|
|
11
|
+
"arn:aws:cloudformation:us-east-1:123456789012:resourceScan/0a699f15-489c-43ca-a3ef-3e6ecfa5da60"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
For more information, see `Start a resource scan with CloudFormation IaC generator <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/iac-generator-start-resource-scan.html>`__ in the *AWS CloudFormation User Guide*.
|
|
@@ -70,3 +70,7 @@
|
|
|
70
70
|
|
|
71
71
|
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
|
|
72
72
|
|
|
73
|
+
``--v2-debug`` (boolean)
|
|
74
|
+
|
|
75
|
+
Enable AWS CLI v2 migration assistance. Prints warnings if the command would face a breaking change after swapping AWS CLI v1 for AWS CLI v2 in the current environment. Prints one warning for each breaking change detected.
|
|
76
|
+
|