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',
    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 the principalArn are returned. If false , the account settings for the principalArn are returned if they're set. Otherwise, no account settings are returned.
  • nextToken (string) --

    The nextToken value returned from a ListAccountSettings request indicating that more results are available to fulfill the request and further calls will be needed. If maxResults was provided, it's possible the number of results to be fewer than maxResults .

    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 returns maxResults results in a single page along with a nextToken response element. The remaining results of the initial request can be seen by sending another ListAccountSettings request with the returned nextToken value. This value can be between 1 and 10. If this parameter isn't used, then ListAccountSettings returns up to 10 results and a nextToken value if applicable.
Return type

dict

Returns

Response Syntax

{
    'settings': [
        {
            'name': 'serviceLongArnFormat'|'taskLongArnFormat'|'containerInstanceLongArnFormat'|'awsvpcTrunking'|'containerInsights',
            '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 future ListAccountSettings request. When the results of a ListAccountSettings request exceed maxResults , this value can be used to retrieve the next page of results. This value is null 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': {
        '...': '...',
    },
}