ALIYUN::CEN::CenRouteService类型用于设置访问云服务。

关于云服务的更多信息,请参见ResolveAndRouteServiceInCen

语法

{
  "Type": "ALIYUN::CEN::CenRouteService",
  "Properties": {
    "Description": String,
    "HostRegionId": String,
    "CenId": String,
    "AccessRegionId": String,
    "Host": String,
    "HostVpcId": String,
    "ConflictIgnore": Boolean
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
Description String 云服务的描述信息。 长度为2~256个字符,必须以汉字或者英文字母开头,不能以http://https://开头。可包含汉字、英文字母、数字、短划线(-)、半角句号(.)和下划线(_)。
HostRegionId String 云服务所在的地域ID。
CenId String 云企业网实例ID。 您可以通过调用CreateCen接口获取云企业网实例ID。
AccessRegionId String 访问云服务的地域ID。 您可以通过调用DescribeChildInstanceRegions接口查询地域ID。
Host String 云服务IP地址或地址段。

通常云服务会使用多个地址或地址段,建议您重复调用本接口,添加该云服务所有地址或地址段。

ConflictIgnore Boolean 为云企业网设置访问云服务,遇到错误冲突时是否忽略冲突。 取值:
  • true:不忽略冲突。
  • false(默认值):忽略冲突。
HostVpcId String 云服务关联的VPC实例ID。

返回值

Fn::GetAtt

Id:云服务的ID。格式为{CenId}/{HostRegionId}/{Host}/{AccessRegionId}

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      CenId:
        Type: String
        Description: The ID of the Cloud Enterprise Network (CEN) instance.
        Default: cen-2****
      HostVpcId:
        Type: String
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Resources:
      CenRouteService:
        Type: ALIYUN::CEN::CenRouteService
        Properties:
          HostRegionId: cn-beijing
          CenId:
            Ref: CenId
          AccessRegionId: cn-hangzhou
          Host: 100.118.28.0/24
          HostVpcId:
            Ref: HostVpcId
    Outputs:
      Id:
        Description: The ID of the cloud service. It is formatted to {CenId}/{HostRegionId}/{Host}/{AccessRegionId}
        Value:
          Fn::GetAtt:
            - CenRouteService
            - Id
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "CenId": {
          "Type": "String",
          "Description": "The ID of the Cloud Enterprise Network (CEN) instance.",
          "Default": "cen-2****"
        },
        "HostVpcId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
        }
      },
      "Resources": {
        "CenRouteService": {
          "Type": "ALIYUN::CEN::CenRouteService",
          "Properties": {
            "HostRegionId": "cn-beijing",
            "CenId": {
              "Ref": "CenId"
            },
            "AccessRegionId": "cn-hangzhou",
            "Host": "100.118.28.0/24",
            "HostVpcId": {
              "Ref": "HostVpcId"
            }
          }
        }
      },
      "Outputs": {
        "Id": {
          "Description": "The ID of the cloud service. It is formatted to {CenId}/{HostRegionId}/{Host}/{AccessRegionId}",
          "Value": {
            "Fn::GetAtt": [
              "CenRouteService",
              "Id"
            ]
          }
        }
      }
    }