edit-icon download-icon

ALIYUN::ECS::SSHKeyPair

Last Updated: Jun 13, 2018

Creates a new pair of SSH keys, or imports an existing public key to ECS.

Syntax

  1. {
  2. "Type" : "ALIYUN::ECS::SSHKeyPair",
  3. "Properties" : {
  4. "PublicKeyBody" : String,
  5. "KeyPairName" : String
  6. }
  7. }

Properties

Name Type Required Description Constraints
KeyPairName String Yes Globally unique name of the SSH key pair. It can contain 2 to 128 characters. It must start an English letter and can contain English letters, numbers, periods(.), underscores(_), and hyphens(-). It cannot start with “http://“ or “https://“.
PublicKeyBody String No The public key. N/A

Return values

Fn::GetAtt

  • KeyPairFingerPrint: Public key fingerprint. It is a short sequence of bytes used to identify a longer public key. Fingerprints are created by applying a cryptographic hash function to a public key.

  • PrivateKeyBody: Private key of the key pair. RSA private key content of the unencrypted PEM code in PKCS#8 format. You must save and secure the private key file at the time of its creation. If you import an existing public key, no private key information will be available.

  • KeyPairName: Globally unique name of the SSH key pair.

Examples

  1. {
  2. "ROSTemplateFormatVersion" : "2015-09-01",
  3. "Resources" : {
  4. "SSHKeyPair": {
  5. "Type": "ALIYUN::ECS::SSHKeyPair",
  6. "Properties": {
  7. "KeyPairName" : "ssh_key_pair_v1",
  8. }
  9. }
  10. },
  11. "Outputs": {
  12. "KeyPairName": {
  13. "Value" : {"Fn::GetAtt": ["SSHKeyPair","KeyPairName"]}
  14. },
  15. "PrivateKeyBody": {
  16. "Value" : {"Fn::GetAtt": ["SSHKeyPair","PrivateKeyBody"]}
  17. },
  18. "KeyPairFingerPrint": {
  19. "Value" : {"Fn::GetAtt": ["SSHKeyPair","KeyPairFingerPrint"]}
  20. }
  21. }
  22. }
Thank you! We've received your feedback.