Created
July 19, 2024 04:23
-
-
Save virajkanwade/06f7c87d41e210e773f36e47354efc41 to your computer and use it in GitHub Desktop.
get private key from AWS key pair
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KEY_PAIR_NAME="XYZ"; aws ssm get-parameter --name /ec2/keypair/$(aws ec2 describe-key-pairs --filters "Name=key-name,Values=$KEY_PAIR_NAME" --query "KeyPairs[*].KeyPairId" --output text) --with-decryption --query "Parameter.Value" --output text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment