How to retrieve earlier version of AWS SSM password?

Viewed 589

I use the AWS parameter store like so aws ssm get-parameters --names WINDOWS_PASSWORD --with-decryption --query Parameters[0].Value --output text, but sometimes I need the earlier previous of the password when it rotates.

I don't understand for example how to retrieve version 1 of the password with the CLI, as opposed to say the latest version 2.

3 Answers

Normally you would just append version to the name:

For example, to get the first version:

aws ssm get-parameters --names WINDOWS_PASSWORD:1 --with-decryption --query Parameters[0].Value --output text

use below command aws ssm get-parameters --names : --with-decryption --query Parameters[0].Value --output text

Try with below

aws ssm get-parameter-history \
    --name "MyParameter"
Related