Skip to content

Instantly share code, notes, and snippets.

@denzhel
Created January 22, 2021 02:26
Show Gist options
  • Save denzhel/a216b6c1001d6f7e26b7e3bd7696722a to your computer and use it in GitHub Desktop.
Save denzhel/a216b6c1001d6f7e26b7e3bd7696722a to your computer and use it in GitHub Desktop.
Upload SSH public key to AWS SecretManager

To create a ssh key:

ssh-keygen -f ~/.ssh/keyName_rsa -t rsa -b 4096

Then, upload it to AWS Secret Manager to be used as Terraform key_name when creating instances for example:

aws secretsmanager create-secret --name "Path/To/KeyName" --description "Added Manually" --secret-string "$(cat ~/.ssh/keyName_rsa.pub)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment