Reverting to a previous AWS Systems Manager document version
Learn how to revert to a previous AWS Systems Manager document version. For more information about SSM documents, see AWS Systems Manager Documents in the AWS Systems Manager User Guide.
When using the AWS ParallelCluster command line interface (CLI) or API, you only pay for the AWS resources that are created when you create or update AWS ParallelCluster images and clusters. For more information, see AWS services used by AWS ParallelCluster.
The AWS ParallelCluster UI is built on a serverless architecture and you can use it within the AWS Free Tier category for most cases. For more information, see AWS ParallelCluster UI costs.
Prerequisites:
-
An AWS account with permissions to manage SSM documents.
-
The AWS CLI is installed and configured.
Revert to a previous SSM document version
-
In your terminal, run the following command to get the list of existing SSM documents that you own.
$
aws ssm list-documents --document-filter "key=Owner,value=Self"
-
Revert an SSM document to a previous version. In this example, we revert to a previous version of the
SessionManagerRunShell
document. You can use the SSMSessionManagerRunShell
document to customize every SSM shell session that you initiate.-
Find the
DocumentVersion
parameter forSessionManagerRunShell
by running the following command:$
aws ssm describe-document --name
"SSM-SessionManagerRunShell"
{ "Document": { "Hash": "...", "HashType": "Sha256", "Name": "SSM-SessionManagerRunShell", "Owner": "123456789012", "CreatedDate": "2023-02-20T19:04:32.390000+00:00", "Status": "Active", "DocumentVersion": "1", "Parameters": [ { "Name": "linuxcmd", "Type": "String", "Description": "The command to run on connection...", "DefaultValue": "if [ -d '/opt/parallelcluster' ]; then source /opt/parallelcluster/cfnconfig; sudo su - $cfn_cluster_user; fi; /bin/bash" } ], "PlatformTypes": [ "Windows", "Linux", "MacOS" ], "DocumentType": "Session", "SchemaVersion": "1.0", "LatestVersion": "2", "DefaultVersion": "1", "DocumentFormat": "JSON", "Tags": [] } }
The latest version is
2
. -
Revert to the previous version by running the following command:
$
aws ssm delete-document --name
"SSM-SessionManagerRunShell"
--document-version2
-
-
Verify that the document version has been reverted by running the
describe-document
command again:$
aws ssm describe-document --name
"SSM-SessionManagerRunShell"
{ "Document": { "Hash": "...", "HashType": "Sha256", "Name": "SSM-SessionManagerRunShell", "Owner": "123456789012", "CreatedDate": "2023-02-20T19:04:32.390000+00:00", "Status": "Active", "DocumentVersion": "1", "Parameters": [ { "Name": "linuxcmd", "Type": "String", "Description": "The command to run on connection...", "DefaultValue": "if [ -d '/opt/parallelcluster' ]; then source /opt/parallelcluster/cfnconfig; sudo su - $cfn_cluster_user; fi; /bin/bash" } ], "PlatformTypes": [ "Windows", "Linux", "MacOS" ], "DocumentType": "Session", "SchemaVersion": "1.0", "LatestVersion": "1", "DefaultVersion": "1", "DocumentFormat": "JSON", "Tags": [] } }
The latest version is
1
.