Reverting to a previous Amazon Systems Manager document version - Amazon ParallelCluster
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).

Reverting to a previous Amazon Systems Manager document version

Learn how to revert to a previous Amazon Systems Manager document version. For more information about SSM documents, see Amazon Systems Manager Documents in the Amazon Systems Manager User Guide.

When using the Amazon ParallelCluster command line interface (CLI) or API, you only pay for the Amazon resources that are created when you create or update Amazon ParallelCluster images and clusters. For more information, see Amazon services used by Amazon ParallelCluster.

The Amazon ParallelCluster UI is built on a serverless architecture and you can use it within the Amazon Free Tier category for most cases. For more information, see Amazon ParallelCluster UI costs.

Prerequisites:

Revert to a previous SSM document version

  1. 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"
  2. 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 SSM SessionManagerRunShell document to customize every SSM shell session that you initiate.

    1. Find the DocumentVersion parameter for SessionManagerRunShell 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.

    2. Revert to the previous version by running the following command:

      $ aws ssm delete-document --name "SSM-SessionManagerRunShell" --document-version 2
  3. 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.