awscli 1.41.7__py3-none-any.whl → 1.41.9__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.
- awscli/__init__.py +1 -1
- awscli/clidriver.py +3 -2
- awscli/customizations/cloudformation/deploy.py +5 -4
- awscli/customizations/cloudformation/package.py +3 -2
- awscli/customizations/cloudfront.py +3 -1
- awscli/customizations/cloudtrail/subscribe.py +5 -5
- awscli/customizations/cloudtrail/validation.py +6 -6
- awscli/customizations/codedeploy/deregister.py +5 -2
- awscli/customizations/codedeploy/push.py +5 -3
- awscli/customizations/codedeploy/register.py +5 -2
- awscli/customizations/codedeploy/systems.py +3 -1
- awscli/customizations/configservice/getstatus.py +3 -3
- awscli/customizations/datapipeline/__init__.py +4 -2
- awscli/customizations/datapipeline/createdefaultroles.py +4 -2
- awscli/customizations/dlm/createdefaultrole.py +4 -2
- awscli/customizations/eks/get_token.py +3 -2
- awscli/customizations/eks/update_kubeconfig.py +3 -2
- awscli/customizations/gamelift/getlog.py +3 -2
- awscli/customizations/gamelift/uploadbuild.py +6 -4
- awscli/customizations/logs/startlivetail.py +3 -3
- awscli/customizations/rds.py +3 -1
- awscli/customizations/removals.py +2 -0
- awscli/customizations/utils.py +2 -1
- awscli/customizations/waiters.py +3 -2
- awscli/examples/eks/associate-access-policy.rst +29 -0
- awscli/examples/eks/create-access-entry.rst +54 -0
- awscli/examples/eks/create-pod-identity-association.rst +59 -0
- awscli/examples/eks/delete-access-entry.rst +11 -0
- awscli/examples/eks/delete-pod-identity-association.rst +28 -0
- awscli/examples/eks/describe-access-entry.rst +25 -0
- awscli/examples/eks/describe-insight.rst +36 -0
- awscli/examples/eks/describe-pod-identity-association.rst +28 -0
- awscli/examples/eks/disassociate-access-policy.rst +12 -0
- awscli/examples/eks/list-access-entries.rst +19 -0
- awscli/examples/eks/list-access-policies.rst +90 -0
- awscli/examples/eks/list-associated-access-policies.rst +27 -0
- awscli/examples/eks/list-insights.rst +67 -0
- awscli/examples/eks/list-pod-identity-associations.rst +61 -0
- awscli/examples/eks/update-access-entry.rst +28 -0
- awscli/examples/eks/update-pod-identity-association.rst +29 -0
- awscli/testutils.py +5 -4
- awscli/utils.py +14 -0
- {awscli-1.41.7.dist-info → awscli-1.41.9.dist-info}/METADATA +2 -2
- {awscli-1.41.7.dist-info → awscli-1.41.9.dist-info}/RECORD +52 -36
- {awscli-1.41.7.data → awscli-1.41.9.data}/scripts/aws +0 -0
- {awscli-1.41.7.data → awscli-1.41.9.data}/scripts/aws.cmd +0 -0
- {awscli-1.41.7.data → awscli-1.41.9.data}/scripts/aws_bash_completer +0 -0
- {awscli-1.41.7.data → awscli-1.41.9.data}/scripts/aws_completer +0 -0
- {awscli-1.41.7.data → awscli-1.41.9.data}/scripts/aws_zsh_completer.sh +0 -0
- {awscli-1.41.7.dist-info → awscli-1.41.9.dist-info}/LICENSE.txt +0 -0
- {awscli-1.41.7.dist-info → awscli-1.41.9.dist-info}/WHEEL +0 -0
- {awscli-1.41.7.dist-info → awscli-1.41.9.dist-info}/top_level.txt +0 -0
awscli/__init__.py
CHANGED
awscli/clidriver.py
CHANGED
@@ -48,7 +48,7 @@ from awscli.help import (
|
|
48
48
|
ServiceHelpCommand,
|
49
49
|
)
|
50
50
|
from awscli.plugin import load_plugins
|
51
|
-
from awscli.utils import emit_top_level_args_parsed_event, write_exception
|
51
|
+
from awscli.utils import emit_top_level_args_parsed_event, write_exception, create_nested_client
|
52
52
|
from botocore import __version__ as botocore_version
|
53
53
|
from botocore import xform_name
|
54
54
|
|
@@ -692,7 +692,8 @@ class CLIOperationCaller:
|
|
692
692
|
value is returned.
|
693
693
|
|
694
694
|
"""
|
695
|
-
client =
|
695
|
+
client = create_nested_client(
|
696
|
+
self._session,
|
696
697
|
service_name,
|
697
698
|
region_name=parsed_globals.region,
|
698
699
|
endpoint_url=parsed_globals.endpoint_url,
|
@@ -24,7 +24,7 @@ from awscli.customizations.cloudformation.yamlhelper import yaml_parse
|
|
24
24
|
|
25
25
|
from awscli.customizations.commands import BasicCommand
|
26
26
|
from awscli.compat import get_stdout_text_writer
|
27
|
-
from awscli.utils import write_exception
|
27
|
+
from awscli.utils import create_nested_client, write_exception
|
28
28
|
|
29
29
|
LOG = logging.getLogger(__name__)
|
30
30
|
|
@@ -267,8 +267,8 @@ class DeployCommand(BasicCommand):
|
|
267
267
|
|
268
268
|
def _run_main(self, parsed_args, parsed_globals):
|
269
269
|
cloudformation_client = \
|
270
|
-
|
271
|
-
'cloudformation', region_name=parsed_globals.region,
|
270
|
+
create_nested_client(
|
271
|
+
self._session, 'cloudformation', region_name=parsed_globals.region,
|
272
272
|
endpoint_url=parsed_globals.endpoint_url,
|
273
273
|
verify=parsed_globals.verify_ssl)
|
274
274
|
|
@@ -300,7 +300,8 @@ class DeployCommand(BasicCommand):
|
|
300
300
|
|
301
301
|
bucket = parsed_args.s3_bucket
|
302
302
|
if bucket:
|
303
|
-
s3_client =
|
303
|
+
s3_client = create_nested_client(
|
304
|
+
self._session,
|
304
305
|
"s3",
|
305
306
|
config=Config(signature_version='s3v4'),
|
306
307
|
region_name=parsed_globals.region,
|
@@ -24,6 +24,7 @@ from awscli.customizations.cloudformation.yamlhelper import yaml_dump
|
|
24
24
|
from awscli.customizations.cloudformation import exceptions
|
25
25
|
from awscli.customizations.commands import BasicCommand
|
26
26
|
from awscli.customizations.s3uploader import S3Uploader
|
27
|
+
from awscli.utils import create_nested_client
|
27
28
|
|
28
29
|
LOG = logging.getLogger(__name__)
|
29
30
|
|
@@ -124,8 +125,8 @@ class PackageCommand(BasicCommand):
|
|
124
125
|
]
|
125
126
|
|
126
127
|
def _run_main(self, parsed_args, parsed_globals):
|
127
|
-
s3_client =
|
128
|
-
"s3",
|
128
|
+
s3_client = create_nested_client(
|
129
|
+
self._session, "s3",
|
129
130
|
config=Config(signature_version='s3v4'),
|
130
131
|
region_name=parsed_globals.region,
|
131
132
|
verify=parsed_globals.verify_ssl)
|
@@ -21,6 +21,7 @@ from botocore.signers import CloudFrontSigner
|
|
21
21
|
from awscli.arguments import CustomArgument
|
22
22
|
from awscli.customizations.utils import validate_mutually_exclusive_handler
|
23
23
|
from awscli.customizations.commands import BasicCommand
|
24
|
+
from awscli.utils import create_nested_client
|
24
25
|
|
25
26
|
|
26
27
|
def register(event_handler):
|
@@ -172,7 +173,8 @@ class UpdateDefaultRootObject(CreateDefaultRootObject):
|
|
172
173
|
|
173
174
|
def add_to_params(self, parameters, value):
|
174
175
|
if value is not None:
|
175
|
-
client =
|
176
|
+
client = create_nested_client(
|
177
|
+
self.context['session'],
|
176
178
|
'cloudfront',
|
177
179
|
region_name=self.context['parsed_args'].region,
|
178
180
|
endpoint_url=self.context['parsed_args'].endpoint_url,
|
@@ -17,9 +17,9 @@ import sys
|
|
17
17
|
from .utils import get_account_id
|
18
18
|
from awscli.customizations.commands import BasicCommand
|
19
19
|
from awscli.customizations.utils import s3_bucket_exists
|
20
|
+
from awscli.utils import create_nested_client
|
20
21
|
from botocore.exceptions import ClientError
|
21
22
|
|
22
|
-
|
23
23
|
LOG = logging.getLogger(__name__)
|
24
24
|
S3_POLICY_TEMPLATE = 'policy/S3/AWSCloudTrail-S3BucketPolicy-2014-12-17.json'
|
25
25
|
SNS_POLICY_TEMPLATE = 'policy/SNS/AWSCloudTrail-SnsTopicPolicy-2014-12-17.json'
|
@@ -80,16 +80,16 @@ class CloudTrailSubscribe(BasicCommand):
|
|
80
80
|
|
81
81
|
# Initialize services
|
82
82
|
LOG.debug('Initializing S3, SNS and CloudTrail...')
|
83
|
-
self.sts = self._session
|
84
|
-
self.s3 = self._session
|
85
|
-
self.sns = self._session
|
83
|
+
self.sts = create_nested_client(self._session, 'sts', **client_args)
|
84
|
+
self.s3 = create_nested_client(self._session, 's3', **client_args)
|
85
|
+
self.sns = create_nested_client(self._session, 'sns', **client_args)
|
86
86
|
self.region_name = self.s3.meta.region_name
|
87
87
|
|
88
88
|
# If the endpoint is specified, it is designated for the cloudtrail
|
89
89
|
# service. Not all of the other services will use it.
|
90
90
|
if parsed_globals.endpoint_url is not None:
|
91
91
|
client_args['endpoint_url'] = parsed_globals.endpoint_url
|
92
|
-
self.cloudtrail = self._session
|
92
|
+
self.cloudtrail = create_nested_client(self._session, 'cloudtrail', **client_args)
|
93
93
|
|
94
94
|
def _call(self, options, parsed_globals):
|
95
95
|
"""
|
@@ -30,7 +30,7 @@ from awscli.customizations.cloudtrail.utils import get_trail_by_arn, \
|
|
30
30
|
from awscli.customizations.commands import BasicCommand
|
31
31
|
from botocore.exceptions import ClientError
|
32
32
|
from awscli.schema import ParameterRequiredError
|
33
|
-
|
33
|
+
from awscli.utils import create_nested_client
|
34
34
|
|
35
35
|
LOG = logging.getLogger(__name__)
|
36
36
|
DATE_FORMAT = '%Y%m%dT%H%M%SZ'
|
@@ -193,7 +193,7 @@ class S3ClientProvider(object):
|
|
193
193
|
def _create_client(self, region_name):
|
194
194
|
"""Creates an Amazon S3 client for the given region name"""
|
195
195
|
if region_name not in self._client_cache:
|
196
|
-
client = self._session
|
196
|
+
client = create_nested_client(self._session, 's3', region_name=region_name)
|
197
197
|
# Remove the CLI error event that prevents exceptions.
|
198
198
|
self._client_cache[region_name] = client
|
199
199
|
return self._client_cache[region_name]
|
@@ -753,13 +753,13 @@ class CloudTrailValidateLogs(BasicCommand):
|
|
753
753
|
self._session, self._source_region)
|
754
754
|
client_args = {'region_name': parsed_globals.region,
|
755
755
|
'verify': parsed_globals.verify_ssl}
|
756
|
-
self.organization_client =
|
757
|
-
'organizations', **client_args)
|
756
|
+
self.organization_client = create_nested_client(
|
757
|
+
self._session, 'organizations', **client_args)
|
758
758
|
|
759
759
|
if parsed_globals.endpoint_url is not None:
|
760
760
|
client_args['endpoint_url'] = parsed_globals.endpoint_url
|
761
|
-
self.cloudtrail_client =
|
762
|
-
'cloudtrail', **client_args)
|
761
|
+
self.cloudtrail_client = create_nested_client(
|
762
|
+
self._session, 'cloudtrail', **client_args)
|
763
763
|
|
764
764
|
def _call(self):
|
765
765
|
traverser = create_digest_traverser(
|
@@ -18,6 +18,7 @@ from botocore.exceptions import ClientError
|
|
18
18
|
from awscli.customizations.commands import BasicCommand
|
19
19
|
from awscli.customizations.codedeploy.utils import \
|
20
20
|
validate_region, validate_instance_name, INSTANCE_NAME_ARG
|
21
|
+
from awscli.utils import create_nested_client
|
21
22
|
|
22
23
|
|
23
24
|
class Deregister(BasicCommand):
|
@@ -48,13 +49,15 @@ class Deregister(BasicCommand):
|
|
48
49
|
validate_region(params, parsed_globals)
|
49
50
|
validate_instance_name(params)
|
50
51
|
|
51
|
-
self.codedeploy =
|
52
|
+
self.codedeploy = create_nested_client(
|
53
|
+
self._session,
|
52
54
|
'codedeploy',
|
53
55
|
region_name=params.region,
|
54
56
|
endpoint_url=parsed_globals.endpoint_url,
|
55
57
|
verify=parsed_globals.verify_ssl
|
56
58
|
)
|
57
|
-
self.iam =
|
59
|
+
self.iam = create_nested_client(
|
60
|
+
self._session,
|
58
61
|
'iam',
|
59
62
|
region_name=params.region
|
60
63
|
)
|
@@ -23,7 +23,7 @@ from botocore.exceptions import ClientError
|
|
23
23
|
from awscli.customizations.codedeploy.utils import validate_s3_location
|
24
24
|
from awscli.customizations.commands import BasicCommand
|
25
25
|
from awscli.compat import BytesIO, ZIP_COMPRESSION_MODE
|
26
|
-
|
26
|
+
from awscli.utils import create_nested_client
|
27
27
|
|
28
28
|
ONE_MB = 1 << 20
|
29
29
|
MULTIPART_LIMIT = 6 * ONE_MB
|
@@ -107,13 +107,15 @@ class Push(BasicCommand):
|
|
107
107
|
|
108
108
|
def _run_main(self, parsed_args, parsed_globals):
|
109
109
|
self._validate_args(parsed_args)
|
110
|
-
self.codedeploy =
|
110
|
+
self.codedeploy = create_nested_client(
|
111
|
+
self._session,
|
111
112
|
'codedeploy',
|
112
113
|
region_name=parsed_globals.region,
|
113
114
|
endpoint_url=parsed_globals.endpoint_url,
|
114
115
|
verify=parsed_globals.verify_ssl
|
115
116
|
)
|
116
|
-
self.s3 =
|
117
|
+
self.s3 = create_nested_client(
|
118
|
+
self._session,
|
117
119
|
's3',
|
118
120
|
region_name=parsed_globals.region
|
119
121
|
)
|
@@ -18,6 +18,7 @@ from awscli.customizations.codedeploy.systems import DEFAULT_CONFIG_FILE
|
|
18
18
|
from awscli.customizations.codedeploy.utils import \
|
19
19
|
validate_region, validate_instance_name, validate_tags, \
|
20
20
|
validate_iam_user_arn, INSTANCE_NAME_ARG, IAM_USER_ARN_ARG
|
21
|
+
from awscli.utils import create_nested_client
|
21
22
|
|
22
23
|
|
23
24
|
class Register(BasicCommand):
|
@@ -73,13 +74,15 @@ class Register(BasicCommand):
|
|
73
74
|
validate_tags(params)
|
74
75
|
validate_iam_user_arn(params)
|
75
76
|
|
76
|
-
self.codedeploy =
|
77
|
+
self.codedeploy = create_nested_client(
|
78
|
+
self._session,
|
77
79
|
'codedeploy',
|
78
80
|
region_name=params.region,
|
79
81
|
endpoint_url=parsed_globals.endpoint_url,
|
80
82
|
verify=parsed_globals.verify_ssl
|
81
83
|
)
|
82
|
-
self.iam =
|
84
|
+
self.iam = create_nested_client(
|
85
|
+
self._session,
|
83
86
|
'iam',
|
84
87
|
region_name=params.region
|
85
88
|
)
|
@@ -14,6 +14,7 @@
|
|
14
14
|
import ctypes
|
15
15
|
import os
|
16
16
|
import subprocess
|
17
|
+
from awscli.utils import create_nested_client
|
17
18
|
|
18
19
|
DEFAULT_CONFIG_FILE = 'codedeploy.onpremises.yml'
|
19
20
|
|
@@ -26,7 +27,8 @@ class System:
|
|
26
27
|
|
27
28
|
def __init__(self, params):
|
28
29
|
self.session = params.session
|
29
|
-
self.s3 =
|
30
|
+
self.s3 = create_nested_client(
|
31
|
+
self.session,
|
30
32
|
's3',
|
31
33
|
region_name=params.region
|
32
34
|
)
|
@@ -13,7 +13,7 @@
|
|
13
13
|
import sys
|
14
14
|
|
15
15
|
from awscli.customizations.commands import BasicCommand
|
16
|
-
|
16
|
+
from awscli.utils import create_nested_client
|
17
17
|
|
18
18
|
def register_get_status(cli):
|
19
19
|
cli.register('building-command-table.configservice', add_get_status)
|
@@ -44,8 +44,8 @@ class GetStatusCommand(BasicCommand):
|
|
44
44
|
'region_name': parsed_globals.region,
|
45
45
|
'endpoint_url': parsed_globals.endpoint_url
|
46
46
|
}
|
47
|
-
self._config_client = self._session
|
48
|
-
|
47
|
+
self._config_client = create_nested_client(self._session, 'config',
|
48
|
+
**client_args)
|
49
49
|
|
50
50
|
def _check_configuration_recorders(self):
|
51
51
|
status = self._config_client.describe_configuration_recorder_status()
|
@@ -22,7 +22,7 @@ from awscli.customizations.datapipeline.createdefaultroles \
|
|
22
22
|
import CreateDefaultRoles
|
23
23
|
from awscli.customizations.datapipeline.listrunsformatter \
|
24
24
|
import ListRunsFormatter
|
25
|
-
|
25
|
+
from awscli.utils import create_nested_client
|
26
26
|
|
27
27
|
DEFINITION_HELP_TEXT = """\
|
28
28
|
The JSON pipeline definition. If the pipeline definition
|
@@ -361,7 +361,9 @@ class ListRunsCommand(BasicCommand):
|
|
361
361
|
def _set_client(self, parsed_globals):
|
362
362
|
# This is called from _run_main and is used to ensure that we have
|
363
363
|
# a service/endpoint object to work with.
|
364
|
-
|
364
|
+
from awscli.utils import create_nested_client
|
365
|
+
self.client = create_nested_client(
|
366
|
+
self._session,
|
365
367
|
'datapipeline',
|
366
368
|
region_name=parsed_globals.region,
|
367
369
|
endpoint_url=parsed_globals.endpoint_url,
|
@@ -25,6 +25,8 @@ from awscli.customizations.datapipeline.constants \
|
|
25
25
|
from awscli.customizations.commands import BasicCommand
|
26
26
|
from awscli.customizations.datapipeline.translator \
|
27
27
|
import display_response, dict_to_string, get_region
|
28
|
+
from awscli.utils import create_nested_client
|
29
|
+
|
28
30
|
from botocore.exceptions import ClientError
|
29
31
|
|
30
32
|
LOG = logging.getLogger(__name__)
|
@@ -69,8 +71,8 @@ class CreateDefaultRoles(BasicCommand):
|
|
69
71
|
"""Call to run the commands"""
|
70
72
|
self._region = get_region(self._session, parsed_globals)
|
71
73
|
self._endpoint_url = parsed_globals.endpoint_url
|
72
|
-
self._iam_client =
|
73
|
-
'iam',
|
74
|
+
self._iam_client = create_nested_client(
|
75
|
+
self._session, 'iam',
|
74
76
|
region_name=self._region,
|
75
77
|
endpoint_url=self._endpoint_url,
|
76
78
|
verify=parsed_globals.verify_ssl
|
@@ -23,6 +23,7 @@ from awscli.customizations.dlm.constants \
|
|
23
23
|
POLICY_ARN_PATTERN, \
|
24
24
|
RESOURCE_TYPE_SNAPSHOT, \
|
25
25
|
RESOURCE_TYPE_IMAGE
|
26
|
+
from awscli.utils import create_nested_client
|
26
27
|
|
27
28
|
LOG = logging.getLogger(__name__)
|
28
29
|
|
@@ -98,8 +99,9 @@ class CreateDefaultRole(BasicCommand):
|
|
98
99
|
self._region = get_region(self._session, parsed_globals)
|
99
100
|
self._endpoint_url = parsed_args.iam_endpoint
|
100
101
|
self._resource_type = parsed_args.resource_type
|
101
|
-
|
102
|
-
|
102
|
+
from awscli.utils import create_nested_client
|
103
|
+
self._iam_client = IAM(create_nested_client(
|
104
|
+
self._session, 'iam',
|
103
105
|
region_name=self._region,
|
104
106
|
endpoint_url=self._endpoint_url,
|
105
107
|
verify=parsed_globals.verify_ssl
|
@@ -21,6 +21,7 @@ from botocore.signers import RequestSigner
|
|
21
21
|
from botocore.model import ServiceId
|
22
22
|
|
23
23
|
from awscli.formatter import get_formatter
|
24
|
+
from awscli.utils import create_nested_client
|
24
25
|
from awscli.customizations.commands import BasicCommand
|
25
26
|
from awscli.customizations.utils import uni_print
|
26
27
|
from awscli.customizations.utils import validate_mutually_exclusive
|
@@ -247,12 +248,12 @@ class STSClientFactory(object):
|
|
247
248
|
client_kwargs['aws_access_key_id'] = creds['AccessKeyId']
|
248
249
|
client_kwargs['aws_secret_access_key'] = creds['SecretAccessKey']
|
249
250
|
client_kwargs['aws_session_token'] = creds['SessionToken']
|
250
|
-
sts = self._session
|
251
|
+
sts = create_nested_client(self._session, 'sts', **client_kwargs)
|
251
252
|
self._register_k8s_aws_id_handlers(sts)
|
252
253
|
return sts
|
253
254
|
|
254
255
|
def _get_role_credentials(self, region_name, role_arn):
|
255
|
-
sts = self._session
|
256
|
+
sts = create_nested_client(self._session, 'sts', region_name=region_name)
|
256
257
|
return sts.assume_role(
|
257
258
|
RoleArn=role_arn, RoleSessionName='EKSGetTokenAuth'
|
258
259
|
)['Credentials']
|
@@ -26,6 +26,7 @@ from awscli.customizations.eks.kubeconfig import (Kubeconfig,
|
|
26
26
|
KubeconfigValidator,
|
27
27
|
KubeconfigAppender)
|
28
28
|
from awscli.customizations.eks.ordered_yaml import ordered_yaml_dump
|
29
|
+
from awscli.utils import create_nested_client
|
29
30
|
|
30
31
|
LOG = logging.getLogger(__name__)
|
31
32
|
|
@@ -270,7 +271,7 @@ class EKSClient(object):
|
|
270
271
|
|
271
272
|
# Handle role assumption if needed
|
272
273
|
if getattr(self._parsed_args, 'assume_role_arn', None):
|
273
|
-
sts_client = self._session
|
274
|
+
sts_client = create_nested_client(self._session, 'sts')
|
274
275
|
credentials = sts_client.assume_role(
|
275
276
|
RoleArn=self._parsed_args.assume_role_arn,
|
276
277
|
RoleSessionName='EKSDescribeClusterSession'
|
@@ -282,7 +283,7 @@ class EKSClient(object):
|
|
282
283
|
"aws_session_token": credentials["SessionToken"],
|
283
284
|
})
|
284
285
|
|
285
|
-
client = self._session
|
286
|
+
client = create_nested_client(self._session, "eks", **client_kwargs)
|
286
287
|
full_description = client.describe_cluster(name=self._cluster_name)
|
287
288
|
cluster = full_description.get("cluster")
|
288
289
|
|
@@ -15,6 +15,7 @@ from functools import partial
|
|
15
15
|
|
16
16
|
from awscli.compat import urlopen
|
17
17
|
from awscli.customizations.commands import BasicCommand
|
18
|
+
from awscli.utils import create_nested_client
|
18
19
|
|
19
20
|
|
20
21
|
class GetGameSessionLogCommand(BasicCommand):
|
@@ -28,8 +29,8 @@ class GetGameSessionLogCommand(BasicCommand):
|
|
28
29
|
]
|
29
30
|
|
30
31
|
def _run_main(self, args, parsed_globals):
|
31
|
-
client =
|
32
|
-
'gamelift', region_name=parsed_globals.region,
|
32
|
+
client = create_nested_client(
|
33
|
+
self._session, 'gamelift', region_name=parsed_globals.region,
|
33
34
|
endpoint_url=parsed_globals.endpoint_url,
|
34
35
|
verify=parsed_globals.verify_ssl
|
35
36
|
)
|
@@ -21,6 +21,7 @@ from s3transfer import S3Transfer
|
|
21
21
|
|
22
22
|
from awscli.customizations.commands import BasicCommand
|
23
23
|
from awscli.customizations.s3.utils import human_readable_size
|
24
|
+
from awscli.utils import create_nested_client
|
24
25
|
|
25
26
|
|
26
27
|
class UploadBuildCommand(BasicCommand):
|
@@ -43,8 +44,8 @@ class UploadBuildCommand(BasicCommand):
|
|
43
44
|
]
|
44
45
|
|
45
46
|
def _run_main(self, args, parsed_globals):
|
46
|
-
gamelift_client =
|
47
|
-
'gamelift', region_name=parsed_globals.region,
|
47
|
+
gamelift_client = create_nested_client(
|
48
|
+
self._session, 'gamelift', region_name=parsed_globals.region,
|
48
49
|
endpoint_url=parsed_globals.endpoint_url,
|
49
50
|
verify=parsed_globals.verify_ssl
|
50
51
|
)
|
@@ -81,8 +82,9 @@ class UploadBuildCommand(BasicCommand):
|
|
81
82
|
access_key = upload_credentials['AccessKeyId']
|
82
83
|
secret_key = upload_credentials['SecretAccessKey']
|
83
84
|
session_token = upload_credentials['SessionToken']
|
84
|
-
s3_client =
|
85
|
-
's3',
|
85
|
+
s3_client = create_nested_client(
|
86
|
+
self._session, 's3',
|
87
|
+
aws_access_key_id=access_key,
|
86
88
|
aws_secret_access_key=secret_key,
|
87
89
|
aws_session_token=session_token,
|
88
90
|
region_name=parsed_globals.region,
|
@@ -19,7 +19,7 @@ import time
|
|
19
19
|
|
20
20
|
from awscli.compat import get_stdout_text_writer
|
21
21
|
from awscli.customizations.commands import BasicCommand
|
22
|
-
from awscli.utils import is_a_tty
|
22
|
+
from awscli.utils import is_a_tty, create_nested_client
|
23
23
|
|
24
24
|
|
25
25
|
DESCRIPTION = (
|
@@ -240,8 +240,8 @@ class StartLiveTailCommand(BasicCommand):
|
|
240
240
|
self._output = get_stdout_text_writer()
|
241
241
|
|
242
242
|
def _get_client(self, parsed_globals):
|
243
|
-
return
|
244
|
-
"logs",
|
243
|
+
return create_nested_client(
|
244
|
+
self._session, "logs",
|
245
245
|
region_name=parsed_globals.region,
|
246
246
|
endpoint_url=parsed_globals.endpoint_url,
|
247
247
|
verify=parsed_globals.verify_ssl,
|
awscli/customizations/rds.py
CHANGED
@@ -29,6 +29,7 @@ from awscli.clidriver import CLIOperationCaller
|
|
29
29
|
from awscli.customizations import utils
|
30
30
|
from awscli.customizations.commands import BasicCommand
|
31
31
|
from awscli.customizations.utils import uni_print
|
32
|
+
from awscli.utils import create_nested_client
|
32
33
|
|
33
34
|
|
34
35
|
def register_rds_modify_split(cli):
|
@@ -95,7 +96,8 @@ class GenerateDBAuthTokenCommand(BasicCommand):
|
|
95
96
|
]
|
96
97
|
|
97
98
|
def _run_main(self, parsed_args, parsed_globals):
|
98
|
-
rds =
|
99
|
+
rds = create_nested_client(
|
100
|
+
self._session,
|
99
101
|
'rds',
|
100
102
|
region_name=parsed_globals.region,
|
101
103
|
endpoint_url=parsed_globals.endpoint_url,
|
@@ -66,6 +66,8 @@ def register_removals(event_handler):
|
|
66
66
|
remove_commands=['chat'])
|
67
67
|
cmd_remover.remove(on_event='building-command-table.iotsitewise',
|
68
68
|
remove_commands=['invoke-assistant'])
|
69
|
+
cmd_remover.remove(on_event='building-command-table.logs',
|
70
|
+
remove_commands=['get-log-object'])
|
69
71
|
|
70
72
|
|
71
73
|
class CommandRemover(object):
|
awscli/customizations/utils.py
CHANGED
@@ -18,6 +18,7 @@ import copy
|
|
18
18
|
import sys
|
19
19
|
|
20
20
|
from botocore.exceptions import ClientError
|
21
|
+
from awscli.utils import create_nested_client
|
21
22
|
|
22
23
|
|
23
24
|
def rename_argument(argument_table, existing_name, new_name):
|
@@ -172,7 +173,7 @@ def create_client_from_parsed_globals(session, service_name, parsed_globals,
|
|
172
173
|
client_args['verify'] = parsed_globals.verify_ssl
|
173
174
|
if overrides:
|
174
175
|
client_args.update(overrides)
|
175
|
-
return session
|
176
|
+
return create_nested_client(session, service_name, **client_args)
|
176
177
|
|
177
178
|
|
178
179
|
def uni_print(statement, out_file=None):
|
awscli/customizations/waiters.py
CHANGED
@@ -16,6 +16,7 @@ from botocore.exceptions import DataNotFoundError
|
|
16
16
|
from awscli.clidriver import ServiceOperation
|
17
17
|
from awscli.customizations.commands import BasicCommand, BasicHelp, \
|
18
18
|
BasicDocHandler
|
19
|
+
from awscli.utils import create_nested_client
|
19
20
|
|
20
21
|
|
21
22
|
def register_add_waiters(cli):
|
@@ -200,8 +201,8 @@ class WaiterCaller(object):
|
|
200
201
|
self._waiter_name = waiter_name
|
201
202
|
|
202
203
|
def invoke(self, service_name, operation_name, parameters, parsed_globals):
|
203
|
-
client =
|
204
|
-
service_name, region_name=parsed_globals.region,
|
204
|
+
client = create_nested_client(
|
205
|
+
self._session, service_name, region_name=parsed_globals.region,
|
205
206
|
endpoint_url=parsed_globals.endpoint_url,
|
206
207
|
verify=parsed_globals.verify_ssl)
|
207
208
|
waiter = client.get_waiter(xform_name(self._waiter_name))
|
@@ -0,0 +1,29 @@
|
|
1
|
+
**To associate an access policy and its scope to the access entry of the cluster**
|
2
|
+
|
3
|
+
The following ``associate-access-policy`` associates an access policy and its scope to the access entry of the specified cluster. ::
|
4
|
+
|
5
|
+
aws eks associate-access-policy \
|
6
|
+
--cluster-name eks-customer \
|
7
|
+
--principal-arn arn:aws:iam::111122223333:role/Admin \
|
8
|
+
--policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy \
|
9
|
+
--access-scope type=namespace,namespaces=default
|
10
|
+
|
11
|
+
Output::
|
12
|
+
|
13
|
+
{
|
14
|
+
"clusterName": "eks-customer",
|
15
|
+
"principalArn": "arn:aws:iam::111122223333:role/Admin",
|
16
|
+
"associatedAccessPolicy": {
|
17
|
+
"policyArn": "arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy",
|
18
|
+
"accessScope": {
|
19
|
+
"type": "namespace",
|
20
|
+
"namespaces": [
|
21
|
+
"default"
|
22
|
+
]
|
23
|
+
},
|
24
|
+
"associatedAt": "2025-05-24T15:59:51.981000-05:00",
|
25
|
+
"modifiedAt": "2025-05-24T15:59:51.981000-05:00"
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
For more information, see `Associate access policies with access entries <https://docs.aws.amazon.com/eks/latest/userguide/access-policies.html>`__ in the *Amazon EKS User Guide*.
|
@@ -0,0 +1,54 @@
|
|
1
|
+
**Example 1: To create the access entry for EKS cluster**
|
2
|
+
|
3
|
+
The following ``create-access-entry`` example creates an access entry that allows an IAM principal to access the EKS cluster. ::
|
4
|
+
|
5
|
+
aws eks create-access-entry \
|
6
|
+
--cluster-name eks-customer \
|
7
|
+
--principal-arn arn:aws:iam::111122223333:user/eks-user
|
8
|
+
|
9
|
+
Output::
|
10
|
+
|
11
|
+
{
|
12
|
+
"accessEntry": {
|
13
|
+
"clusterName": "eks-customer",
|
14
|
+
"principalArn": "arn:aws:iam::111122223333:user/eks-user",
|
15
|
+
"kubernetesGroups": [],
|
16
|
+
"accessEntryArn": "arn:aws:eks:us-west-2:111122223333:access-entry/eks-customer/user/111122223333/eks-user/a1b2c3d4-5678-90ab-cdef-a6506e3d36p0",
|
17
|
+
"createdAt": "2025-04-14T22:45:48.097000-05:00",
|
18
|
+
"modifiedAt": "2025-04-14T22:45:48.097000-05:00",
|
19
|
+
"tags": {},
|
20
|
+
"username": "arn:aws:iam::111122223333:user/eks-user",
|
21
|
+
"type": "STANDARD"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
For more information, see `Create access entries <https://docs.aws.amazon.com/eks/latest/userguide/creating-access-entries.html>`__ in the *Amazon EKS User Guide*.
|
26
|
+
|
27
|
+
**Example 2: To create the access entry for EKS cluster by specifying the type of access entry**
|
28
|
+
|
29
|
+
The following ``create-access-entry`` example creates an access entry of type ``EC2_LINUX`` in the EKS cluster. By default, a type ``STANDARD`` access entry is created. Apart from the default, if we specify any other access entry types, an IAM role ARN needs to be passed in the CLI. ::
|
30
|
+
|
31
|
+
aws eks create-access-entry \
|
32
|
+
--cluster-name eks-customer \
|
33
|
+
--principal-arn arn:aws:iam::111122223333:role/admin-test-ip \
|
34
|
+
--type EC2_LINUX
|
35
|
+
|
36
|
+
Output::
|
37
|
+
|
38
|
+
{
|
39
|
+
"accessEntry": {
|
40
|
+
"clusterName": "eks-customer",
|
41
|
+
"principalArn": "arn:aws:iam::111122223333:role/admin-test-ip",
|
42
|
+
"kubernetesGroups": [
|
43
|
+
"system:nodes"
|
44
|
+
],
|
45
|
+
"accessEntryArn": "arn:aws:eks:us-west-2:111122223333:access-entry/eks-customer/role/111122223333/admin-test-ip/accb5418-f493-f390-3e6e-c3f19f725fcp",
|
46
|
+
"createdAt": "2025-05-06T19:42:45.453000-05:00",
|
47
|
+
"modifiedAt": "2025-05-06T19:42:45.453000-05:00",
|
48
|
+
"tags": {},
|
49
|
+
"username": "system:node:{{EC2PrivateDNSName}}",
|
50
|
+
"type": "EC2_LINUX"
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
For more information, see `Create access entries <https://docs.aws.amazon.com/eks/latest/userguide/creating-access-entries.html>`__ in the *Amazon EKS User Guide*.
|