All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::CloudPhone::KeyPair

Last Updated:Feb 23, 2024

ALIYUN::CloudPhone::KeyPair is used to import the public key of a Rivest-Shamir-Adleman (RSA)-encrypted key pair that is generated by a third-party tool.

Syntax

{
  "Type": "ALIYUN::CloudPhone::KeyPair",
  "Properties": {
    "KeyPairName": String,
    "PublicKeyBody": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

KeyPairName

String

Yes

No

The name of the key pair.

The name must be unique. It must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

PublicKeyBody

String

Yes

No

The public key of the key pair.

None.

Return values

Fn::GetAtt

  • KeyPairFingerPrint: the fingerprint of the key pair. The message-digest algorithm 5 (MD5) is used based on the public key fingerprint format defined in Request for Comments (RFC) 4716.

  • KeyPairName: the name of the key pair.

  • CreateTime: the time when the key pair was generated.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      KeyPairName:
        Description:
          en: The name of the key pair. The name must be globally unique. The name must
            be 2 to 128 characters in length. The name must start with a letter but cannot
            start with http:// or https://. The name can contain letters, digits, colons
            (:), underscores (_), and hyphens (-).
        Required: true
        Type: String
      PublicKeyBody:
        Description:
          en: The public key content of the key pair.
        Required: true
        Type: String
    Resources:
      ExtensionResource:
        Properties:
          KeyPairName:
            Ref: KeyPairName
          PublicKeyBody:
            Ref: PublicKeyBody
        Type: ALIYUN::CloudPhone::KeyPair
    Outputs:
      CreateTime:
        Description: The creation time of the resource.
        Value:
          Fn::GetAtt:
          - ExtensionResource
          - CreateTime
      KeyPairFingerPrint:
        Description: The fingerprint of the key pair. The message-digest algorithm 5 (MD5)
          is used based on the public key fingerprint format defined in RFC 4716.
        Value:
          Fn::GetAtt:
          - ExtensionResource
          - KeyPairFingerPrint
      KeyPairName:
        Description: The name of the key pair.
        Value:
          Fn::GetAtt:
          - ExtensionResource
          - KeyPairName               
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "KeyPairName": {
          "Type": "String",
          "Description": {
            "en": "The name of the key pair. The name must be globally unique. The name must be 2 to 128 characters in length. The name must start with a letter but cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-)."
          },
          "Required": true
        },
        "PublicKeyBody": {
          "Type": "String",
          "Description": {
            "en": "The public key content of the key pair."
          },
          "Required": true
        }
      },
      "Resources": {
        "ExtensionResource": {
          "Type": "ALIYUN::CloudPhone::KeyPair",
          "Properties": {
            "KeyPairName": {
              "Ref": "KeyPairName"
            },
            "PublicKeyBody": {
              "Ref": "PublicKeyBody"
            }
          }
        }
      },
      "Outputs": {
        "KeyPairFingerPrint": {
          "Description": "The fingerprint of the key pair. The message-digest algorithm 5 (MD5) is used based on the public key fingerprint format defined in RFC 4716.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "KeyPairFingerPrint"
            ]
          }
        },
        "KeyPairName": {
          "Description": "The name of the key pair.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "KeyPairName"
            ]
          }
        },
        "CreateTime": {
          "Description": "The creation time of the resource.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionResource",
              "CreateTime"
            ]
          }
        }
      }
    }