Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use ListAssociationVersions
with an Amazon SDK or CLI
The following code examples show how to use ListAssociationVersions
.
- CLI
-
- Amazon CLI
-
To list all versions of an association for a specific association ID
The following list-association-versions
example lists all versions of the specified associations.
aws ssm list-association-versions \
--association-id "8dfe3659-4309-493a-8755-0123456789ab"
Output:
{
"AssociationVersions": [
{
"AssociationId": "8dfe3659-4309-493a-8755-0123456789ab",
"AssociationVersion": "1",
"CreatedDate": 1550505536.726,
"Name": "AWS-UpdateSSMAgent",
"Parameters": {
"allowDowngrade": [
"false"
],
"version": [
""
]
},
"Targets": [
{
"Key": "InstanceIds",
"Values": [
"i-1234567890abcdef0"
]
}
],
"ScheduleExpression": "cron(0 00 12 ? * SUN *)",
"AssociationName": "UpdateSSMAgent"
}
]
}
For more information, see Working with associations in Systems Manager in the Amazon Systems Manager User Guide.
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example retrieves all versions of the association provided.
Get-SSMAssociationVersionList -AssociationId 123a45a0-c678-9012-3456-78901234db5e
Output:
AssociationId : 123a45a0-c678-9012-3456-78901234db5e
AssociationName :
AssociationVersion : 2
ComplianceSeverity :
CreatedDate : 3/12/2019 9:21:01 AM
DocumentVersion :
MaxConcurrency :
MaxErrors :
Name : AWS-GatherSoftwareInventory
OutputLocation :
Parameters : {}
ScheduleExpression :
Targets : {InstanceIds}
AssociationId : 123a45a0-c678-9012-3456-78901234db5e
AssociationName : test-case-1234567890
AssociationVersion : 1
ComplianceSeverity :
CreatedDate : 3/2/2019 8:53:29 AM
DocumentVersion :
MaxConcurrency :
MaxErrors :
Name : AWS-GatherSoftwareInventory
OutputLocation :
Parameters : {}
ScheduleExpression : rate(30minutes)
Targets : {InstanceIds}
For a complete list of Amazon SDK developer guides and code examples, see
Using Systems Manager with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.