ALIYUN::CloudPhone::KeyPair类型用于导入由其他工具产生的RSA密钥对的公钥部分。
语法
{
"Type": "ALIYUN::CloudPhone::KeyPair",
"Properties": {
"KeyPairName": String,
"PublicKeyBody": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
KeyPairName | String | 是 | 否 | 密钥对名称。 | 必须保持名称唯一性。长度为2~128个英文或中文字符。必须以大小字母或中文开头,不能以 |
PublicKeyBody | String | 是 | 否 | 密钥对的公钥内容。 | 无 |
返回值
Fn::GetAtt
KeyPairFingerPrint:密钥对的指纹。根据RFC4716定义的公钥指纹格式,采用MD5信息摘要算法。
KeyPairName:密钥对的名称。
CreateTime:密钥对的创建时间。
示例
YAML
格式
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
格式
{
"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"
]
}
}
}
}