ECS / Client / list_account_settings
list_account_settings#
- ECS.Client.list_account_settings(**kwargs)#
Lists the account settings for a specified principal.
See also: AWS API Documentation
Request Syntax
response = client.list_account_settings( name='serviceLongArnFormat'|'taskLongArnFormat'|'containerInstanceLongArnFormat'|'awsvpcTrunking'|'containerInsights'|'fargateFIPSMode', value='string', principalArn='string', effectiveSettings=True|False, nextToken='string', maxResults=123 )
- Parameters:
name (string) – The name of the account setting you want to list the settings for.
value (string) – The value of the account settings to filter results with. You must also specify an account setting name to use this parameter.
principalArn (string) –
The ARN of the principal, which can be a user, role, or the root user. If this field is omitted, the account settings are listed only for the authenticated user.
Note
Federated users assume the account setting of the root user and can’t have explicit account settings set for them.
effectiveSettings (boolean) – Determines whether to return the effective settings. If
true
, the account settings for the root user or the default setting for theprincipalArn
are returned. Iffalse
, the account settings for theprincipalArn
are returned if they’re set. Otherwise, no account settings are returned.nextToken (string) –
The
nextToken
value returned from aListAccountSettings
request indicating that more results are available to fulfill the request and further calls will be needed. IfmaxResults
was provided, it’s possible the number of results to be fewer thanmaxResults
.Note
This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
maxResults (integer) – The maximum number of account setting results returned by
ListAccountSettings
in paginated output. When this parameter is used,ListAccountSettings
only returnsmaxResults
results in a single page along with anextToken
response element. The remaining results of the initial request can be seen by sending anotherListAccountSettings
request with the returnednextToken
value. This value can be between 1 and 10. If this parameter isn’t used, thenListAccountSettings
returns up to 10 results and anextToken
value if applicable.
- Return type:
dict
- Returns:
Response Syntax
{ 'settings': [ { 'name': 'serviceLongArnFormat'|'taskLongArnFormat'|'containerInstanceLongArnFormat'|'awsvpcTrunking'|'containerInsights'|'fargateFIPSMode', 'value': 'string', 'principalArn': 'string' }, ], 'nextToken': 'string' }
Response Structure
(dict) –
settings (list) –
The account settings for the resource.
(dict) –
The current account setting for a resource.
name (string) –
The Amazon ECS resource name.
value (string) –
Determines whether the account setting is on or off for the specified resource.
principalArn (string) –
The ARN of the principal. It can be a user, role, or the root user. If this field is omitted, the authenticated user is assumed.
nextToken (string) –
The
nextToken
value to include in a futureListAccountSettings
request. When the results of aListAccountSettings
request exceedmaxResults
, this value can be used to retrieve the next page of results. This value isnull
when there are no more results to return.
Exceptions
ECS.Client.exceptions.ServerException
ECS.Client.exceptions.ClientException
ECS.Client.exceptions.InvalidParameterException
Examples
This example displays the effective account settings for your account.
response = client.list_account_settings( effectiveSettings=True, ) print(response)
Expected Output:
{ 'settings': [ { 'name': 'containerInstanceLongArnFormat', 'value': 'disabled', 'principalArn': 'arn:aws:iam::<aws_account_id>:user/principalName', }, { 'name': 'serviceLongArnFormat', 'value': 'enabled', 'principalArn': 'arn:aws:iam::<aws_account_id>:user/principalName', }, { 'name': 'taskLongArnFormat', 'value': 'disabled', 'principalArn': 'arn:aws:iam::<aws_account_id>:user/principalName', }, ], 'ResponseMetadata': { '...': '...', }, }
This example displays the effective account settings for the specified user or role.
response = client.list_account_settings( effectiveSettings=True, principalArn='arn:aws:iam::<aws_account_id>:user/principalName', ) print(response)
Expected Output:
{ 'settings': [ { 'name': 'containerInstanceLongArnFormat', 'value': 'disabled', 'principalArn': 'arn:aws:iam::<aws_account_id>:user/principalName', }, { 'name': 'serviceLongArnFormat', 'value': 'enabled', 'principalArn': 'arn:aws:iam::<aws_account_id>:user/principalName', }, { 'name': 'taskLongArnFormat', 'value': 'disabled', 'principalArn': 'arn:aws:iam::<aws_account_id>:user/principalName', }, ], 'ResponseMetadata': { '...': '...', }, }