ALIYUN::MSE::GatewayService

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"
        ]
      }
    }
  }
}