ALIYUN::MSE::GatewayService

Updated at:

ALIYUN::MSE::GatewayService类型用于导入网关的服务。

语法

{
  "Type": "ALIYUN::MSE::GatewayService",
  "Properties": {
    "GatewayUniqueId": String,
    "Name": String,
    "SourceType": String,
    "DnsServerList": List,
    "FcVersion": String,
    "FcAlias": String,
    "FcServiceName": String,
    "GroupName": String,
    "Ips": List,
    "Namespace": String,
    "ServicePort": Integer,
    "SaeAppId": String,
    "SourceId": Integer,
    "ServiceProtocol": String,
    "TlsSetting": Map
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

GatewayUniqueId

String

是

否

网关唯一标识 ID。

无

Name

String

是

否

服务名。

无

SourceType

String

是

否

服务来源。

取值范围:

  • MSE

  • K8s

  • VIP

  • DNS

  • FC

  • EDAS

  • MSE_ZK

  • SAE

DnsServerList

List

否

否

DNS服务器列表。

无

FcVersion

String

否

否

FC 服务版本号。

当SourceType配置为FC时生效。

FcAlias

String

否

否

FC 服务别名。

当SourceType配置为FC时生效。

FcServiceName

String

否

否

FC 服务名称。

当SourceType配置为FC时生效。

GroupName

String

否

否

服务分组。

无

Ips

List

否

否

IP 列表。

无

Namespace

String

否

否

命名空间。

无

ServicePort

Integer

否

否

服务的端口。

无

SaeAppId

String

否

否

SAE应用ID。

无

SourceId

Integer

否

否

服务来源 ID。

指定来源添加服务时使用。

ServiceProtocol

String

否

否

服务的协议版本。

取值:

  • DUBBO

  • HTTP

  • GRPC

TlsSetting

Map

否

否

TLS 设定。

取值:

  • TLS 模式:mode

  • 证书 ID:certId

  • CA 证书 ID:caCertId

  • CA 证书公钥:caCertContent

  • 服务名称标识:sni

示例:

{ "mode": "MUTUAL", "certId": "1*****-cn-hangzhou", "caCertContent": "123", "sni": "ceshi" }

返回值

Fn::GetAtt

  • ServiceId:服务来源 ID。

  • Name:服务名。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SourceType:
    Type: String
    Description:
      en: |
        Type of service source. Valid values:
        - MSE: MSE-NACOS
        - K8s: ACK container service
        - VIP: Fixed address
        - DNS: DNS domain name
        - FC: Function Compute
        - EDAS: EDAS
        - MSE_ZK: MSE-Zookeeper
        - SAE: SAE
    AllowedValues:
      - MSE
      - K8s
      - VIP
      - DNS
      - FC
      - EDAS
      - MSE_ZK
      - SAE
    Required: true
  Name:
    Type: String
    Description:
      en: Name of the service.
    Required: true
  GatewayUniqueId:
    Type: String
    Description:
      en: Unique identifier of the gateway.
    Required: true
Resources:
  GatewayService:
    Type: ALIYUN::MSE::GatewayService
    Properties:
      SourceType:
        Ref: SourceType
      Name:
        Ref: Name
      GatewayUniqueId:
        Ref: GatewayUniqueId
Outputs:
  ServiceId:
    Description: The ID of the gateway service.
    Value:
      Fn::GetAtt:
        - GatewayService
        - ServiceId
  Name:
    Description: The name of the service.
    Value:
      Fn::GetAtt:
        - GatewayService
        - Name
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SourceType": {
      "Type": "String",
      "Description": {
        "en": "Type of service source. Valid values:\n- MSE: MSE-NACOS\n- K8s: ACK container service\n- VIP: Fixed address\n- DNS: DNS domain name\n- FC: Function Compute\n- EDAS: EDAS\n- MSE_ZK: MSE-Zookeeper\n- SAE: SAE\n"
      },
      "AllowedValues": [
        "MSE",
        "K8s",
        "VIP",
        "DNS",
        "FC",
        "EDAS",
        "MSE_ZK",
        "SAE"
      ],
      "Required": true
    },
    "Name": {
      "Type": "String",
      "Description": {
        "en": "Name of the service."
      },
      "Required": true
    },
    "GatewayUniqueId": {
      "Type": "String",
      "Description": {
        "en": "Unique identifier of the gateway."
      },
      "Required": true
    }
  },
  "Resources": {
    "GatewayService": {
      "Type": "ALIYUN::MSE::GatewayService",
      "Properties": {
        "SourceType": {
          "Ref": "SourceType"
        },
        "Name": {
          "Ref": "Name"
        },
        "GatewayUniqueId": {
          "Ref": "GatewayUniqueId"
        }
      }
    }
  },
  "Outputs": {
    "ServiceId": {
      "Description": "The ID of the gateway service.",
      "Value": {
        "Fn::GetAtt": [
          "GatewayService",
          "ServiceId"
        ]
      }
    },
    "Name": {
      "Description": "The name of the service.",
      "Value": {
        "Fn::GetAtt": [
          "GatewayService",
          "Name"
        ]
      }
    }
  }
}