This documentation is for the current version of Anthos clusters on AWS, released in November 2021. See the Release notes for more information. For documentation on the previous generation of Anthos clusters on AWS, see Previous generation.

Create an EC2 key pair

You can associate a specific SSH key pair with control plane or node pool instances during creation.

To generate an asymmetric private key and import its public key into AWS, run the following commands:

ssh-keygen -t rsa -m PEM -b 4096 -C "COMMENT" \
      -f SSH_PRIVATE_KEY -N "" 1>/dev/null

aws ec2 import-key-pair --key-name SSH_KEY_PAIR_NAME \
      --public-key-material fileb://SSH_PRIVATE_KEY.pub

Replace the following:

  • SSH_PRIVATE_KEY: a file name to save the key in
  • SSH_KEY_PAIR_NAME: a name you choose for the key pair
  • COMMENT: a text string describing the key

What's next