hendry
hendry

Reputation: 10843

How to retrieve earlier version of AWS SSM password?

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.

Upvotes: 4

Views: 4219

Answers (3)

Abhishek Kumar
Abhishek Kumar

Reputation: 183

use below command

aws ssm get-parameters --names <your-paramter-name>:<version-number> --with-decryption --query Parameters[0].Value --output text

Upvotes: 0

GRVPrasad
GRVPrasad

Reputation: 1142

Try with below

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

Upvotes: 1

Marcin
Marcin

Reputation: 238707

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

Upvotes: 5

Related Questions