CmdID

CmdID / aws / aws ssm

aws ssm list-associations

Returns all State Manager associations in the current Amazon Web Services account and Amazon Web Services Region. AWS CLI reference

2 examples 3 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

Example 1: To list your associations for a specific instance

The following list-associations example lists all associations with the AssociationName, UpdateSSMAgent.

aws ssm list-associations --association-filter-list "key=AssociationName,value=UpdateSSMAgent"Identify
--association-filter-listOne or more filters.
Its output
{
    "Associations": [
        {
            "Name": "AWS-UpdateSSMAgent",
            "InstanceId": "i-1234567890abcdef0",
            "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
            "AssociationVersion": "1",
            "Targets": [
                {
                    "Key": "InstanceIds",
                    "Values": [
                        "i-016648b75dd622dab"
                    ]
                }
            ],
            "Overview": {
                "Status": "Pending",
                "DetailedStatus": "Associated",
                "AssociationStatusAggregatedCount": {
                    "Pending": 1
                }
            },
            "ScheduleExpression": "cron(0 00 12 ? * SUN *)",
            "AssociationName": "UpdateSSMAgent"
        }
    ]
}

For more information, see Working with associations in Systems Manager in the Systems Manager User Guide.

Example 2: To list your associations for a specific document

The following list-associations example lists all associations for the specified document.

aws ssm list-associations --association-filter-list "key=Name,value=AWS-UpdateSSMAgent"Identify
--association-filter-listOne or more filters.
Its output, shortened
{
    "Associations": [
        {
            "Name": "AWS-UpdateSSMAgent",
            "InstanceId": "i-1234567890abcdef0",
            "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111",
            "AssociationVersion": "1",
            "Targets": [
                {
                    "Key": "InstanceIds",
                    "Values": [
                        "i-1234567890abcdef0"
                    ]
                }
            ],
            "LastExecutionDate": 1550505828.548,
            "Overview": {
                "Status": "Success",
                "DetailedStatus": "Success",
                "AssociationStatusAggregatedCount": {
                    "Success": 1
                }
            },
            "ScheduleExpression": "cron(0 00 12 ? * SUN *)",
            "AssociationName": "UpdateSSMAgent"
        },
    {
            "Name": "AWS-UpdateSSMAgent",
            "InstanceId": "i-9876543210abcdef0",
            "AssociationId": "a1b2c3d4-5678-90ab-cdef-EXAMPLE22222",
… 19 more lines

For more information, see Working with associations in Systems Manager in the Systems Manager User Guide.

Options

3 in the AWS CLI reference
--association-filter-listOne or more filters.
--max-resultsThe maximum number of items to return for this call.
--next-tokenThe token for the next set of items to return.