Skip to content

Instantly share code, notes, and snippets.

@virajkanwade
Created July 19, 2024 04:23
Show Gist options
  • Save virajkanwade/06f7c87d41e210e773f36e47354efc41 to your computer and use it in GitHub Desktop.
Save virajkanwade/06f7c87d41e210e773f36e47354efc41 to your computer and use it in GitHub Desktop.
get private key from AWS key pair
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