全部產品
Search
文件中心

:ALIYUN::BastionHost::Host

更新時間:Jun 20, 2024

ALIYUN::BastionHost::Host類型用於在Bastionhost中建立需要營運的主機。

文法

{
  "Type": "ALIYUN::BastionHost::Host",
  "Properties": {
    "Comment": String,
    "ActiveAddressType": String,
    "HostPrivateAddress": String,
    "InstanceRegionId": String,
    "HostPublicAddress": String,
    "InstanceId": String,
    "OSType": String,
    "SourceInstanceId": String,
    "HostName": String,
    "Source": String
  }
}

屬性

屬性名稱

類型

必須

允許更新

描述

約束

ActiveAddressType

String

指定新建立主機的地址類型。

取值:

  • Public:公網地址。

  • Private:私網地址。

HostName

String

指定新建立主機的名稱。

最多支援128個字元。

InstanceId

String

指定新建立主機所在Bastionhost的執行個體ID。

說明

您可以通過調用DescribeInstances介面擷取該參數。

OSType

String

指定新建立主機的作業系統。

取值:

  • Linux

  • Windows

Source

String

指定新建立主機的來源。

取值:

  • Local:本地主機。

  • Ecs:ECS執行個體主機。

  • Rds:RDS專屬叢集主機。

Comment

String

指定主機的備忘資訊。

最多支援500個字元。

HostPrivateAddress

String

指定新建立主機的私網地址。

可使用網域名稱或IP地址。

說明

當ActiveAddressType參數取值為Private時,該參數為必填項。

HostPublicAddress

String

指定新建立主機的公網地址。

可使用網域名稱或IP地址。

說明

當ActiveAddressType取值為Public時,該參數為必填項。

InstanceRegionId

String

指定新建立的ECS執行個體或專屬叢集主機所屬地區ID。

SourceInstanceId

String

指定新建立的ECS執行個體ID或專屬叢集主機ID。

傳回值

Fn::GetAtt

HostId:新建立主機的ID。

樣本

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ActiveAddressType:
    Type: String
    Description: |-
      The endpoint type of the host that you want to create. Valid values:
      Public: a public endpoint
      Private: an internal endpoint
    AllowedValues:
      - Private
      - Public
  InstanceId:
    Type: String
    Description: |-
      The ID of the Bastionhost instance where you want to create the host.
      Note: You can call the DescribeInstances operation to query the ID of the Bastionhost instance.
  OSType:
    Type: String
    Description: |-
      The operating system of the host that you want to create. Valid values:
      - Linux
      - Windows
    AllowedValues:
      - Linux
      - Windows
  HostName:
    Type: String
    Description: The name of the host that you want to create. The name can be up to 128 characters in length.
    MaxLength: 128
  Source:
    Type: String
    Description: |-
      The source of the host that you want to create. Valid values:
      - Local: an on-premises host
      - Ecs: an Elastic Compute Service (ECS) instance
      - Rds: a host in a dedicated cluster
    AllowedValues:
      - Ecs
      - Local
      - Rds
Resources:
  Host:
    Type: ALIYUN::BastionHost::Host
    Properties:
      ActiveAddressType:
        Ref: ActiveAddressType
      InstanceId:
        Ref: InstanceId
      OSType:
        Ref: OSType
      HostName:
        Ref: HostName
      Source:
        Ref: Source
Outputs:
  HostId:
    Description: The ID of the host that was created.
    Value:
      Fn::GetAtt:
        - Host
        - HostId

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ActiveAddressType": {
      "Type": "String",
      "Description": "The endpoint type of the host that you want to create. Valid values:\nPublic: a public endpoint\nPrivate: an internal endpoint",
      "AllowedValues": [
        "Private",
        "Public"
      ]
    },
    "InstanceId": {
      "Type": "String",
      "Description": "The ID of the Bastionhost instance where you want to create the host.\nNote: You can call the DescribeInstances operation to query the ID of the Bastionhost instance."
    },
    "OSType": {
      "Type": "String",
      "Description": "The operating system of the host that you want to create. Valid values:\n- Linux\n- Windows",
      "AllowedValues": [
        "Linux",
        "Windows"
      ]
    },
    "HostName": {
      "Type": "String",
      "Description": "The name of the host that you want to create. The name can be up to 128 characters in length.",
      "MaxLength": 128
    },
    "Source": {
      "Type": "String",
      "Description": "The source of the host that you want to create. Valid values:\n- Local: an on-premises host\n- Ecs: an Elastic Compute Service (ECS) instance\n- Rds: a host in a dedicated cluster",
      "AllowedValues": [
        "Ecs",
        "Local",
        "Rds"
      ]
    }
  },
  "Resources": {
    "Host": {
      "Type": "ALIYUN::BastionHost::Host",
      "Properties": {
        "ActiveAddressType": {
          "Ref": "ActiveAddressType"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "OSType": {
          "Ref": "OSType"
        },
        "HostName": {
          "Ref": "HostName"
        },
        "Source": {
          "Ref": "Source"
        }
      }
    }
  },
  "Outputs": {
    "HostId": {
      "Description": "The ID of the host that was created.",
      "Value": {
        "Fn::GetAtt": [
          "Host",
          "HostId"
        ]
      }
    }
  }
}