ALIYUN::BastionHost::HostAccount

更新时间:
复制为 MD 格式

ALIYUN::BastionHost::HostAccount类型用于创建主机账户

语法

{
  "Type": "ALIYUN::BastionHost::HostAccount",
  "Properties": {
    "HostAccountName": String,
    "HostId": String,
    "InstanceId": String,
    "ProtocolName": String,
    "HostShareKeyId": String,
    "PrivateKey": String,
    "PassPhrase": String,
    "PrivilegeType": String,
    "Password": String,
    "RotationMode": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

HostAccountName

String

主机账户的名称。

HostId

String

主机的ID。

InstanceId

String

堡垒主机实例的ID。

ProtocolName

String

主机账户的协议名称。

有效值:SSH、RDP。

HostShareKeyId

String

主机共享密钥的ID。

当协议为SSH时,此参数为必需。

PassPhrase

String

主机账户的密码短语。

当协议为SSH且私钥已加密时,此参数为必需。

Password

String

主机账户的密码。

当协议为SSHRDP时,此参数为必需。

PrivateKey

String

主机账户的私钥。

当协议为SSH时,此参数为必需。

PrivilegeType

String

主机账户的权限类型。

有效值:Normal(普通)、Administrator(管理员)。

RotationMode

String

主机账户的轮换模式。

有效值:Manual(手动)、Automatic(自动)。

返回值

Fn::GetAtt

HostAccountId:主机账户的ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  HostAccountName:
    Type: String
    Description:
      en: The name of the host account.
      zh: 主机账户的名称。
    Required: true
  ProtocolName:
    Type: String
    Description:
      en: 'The protocol name of the host account. Valid values: SSH, RDP.'
      zh: 主机账户的协议名称。有效值:SSH、RDP。
    Required: true
  InstanceId:
    Type: String
    Description:
      en: The ID of the bastion host instance.
      zh: 堡垒主机实例的ID。
    Required: true
  HostId:
    Type: String
    Description:
      en: The ID of the host.
      zh: 主机的ID。
    Required: true
  Password:
    Type: String
    Description:
      en: The password of the host account. This parameter is required when the protocol is SSH or RDP.
      zh: 主机账户的密码。当协议为SSH或RDP时,此参数为必需。
    Required: false
Resources:
  HostAccount:
    Type: ALIYUN::BastionHost::HostAccount
    Properties:
      HostAccountName:
        Ref: HostAccountName
      ProtocolName:
        Ref: ProtocolName
      InstanceId:
        Ref: InstanceId
      HostId:
        Ref: HostId
      Password:
        Ref: Password
Outputs:
  HostAccountId:
    Description:
      en: The ID of the host account.
      zh: 主机账户的ID。
    Value:
      Fn::GetAtt:
        - HostAccount
        - HostAccountId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "HostAccountName": {
      "Type": "String",
      "Description": {
        "en": "The name of the host account.",
        "zh": "主机账户的名称。"
      },
      "Required": true
    },
    "ProtocolName": {
      "Type": "String",
      "Description": {
        "en": "The protocol name of the host account. Valid values: SSH, RDP.",
        "zh": "主机账户的协议名称。有效值:SSH、RDP。"
      },
      "Required": true
    },
    "InstanceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the bastion host instance.",
        "zh": "堡垒主机实例的ID。"
      },
      "Required": true
    },
    "HostId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the host.",
        "zh": "主机的ID。"
      },
      "Required": true
    },
    "Password": {
      "Type": "String",
      "Description": {
        "en": "The password of the host account. This parameter is required when the protocol is SSH or RDP.",
        "zh": "主机账户的密码。当协议为SSH或RDP时,此参数为必需。"
      },
      "Required": false
    }
  },
  "Resources": {
    "HostAccount": {
      "Type": "ALIYUN::BastionHost::HostAccount",
      "Properties": {
        "HostAccountName": {
          "Ref": "HostAccountName"
        },
        "ProtocolName": {
          "Ref": "ProtocolName"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "HostId": {
          "Ref": "HostId"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
    "HostAccountId": {
      "Description": {
        "en": "The ID of the host account.",
        "zh": "主机账户的ID。"
      },
      "Value": {
        "Fn::GetAtt": [
          "HostAccount",
          "HostAccountId"
        ]
      }
    }
  }
}