ALIYUN::APIG::Source

更新时间:
复制为 MD 格式

ALIYUN::APIG::Source类型用于创建来源。

语法

{
  "Type": "ALIYUN::APIG::Source",
  "Properties": {
    "GatewayId": String,
    "K8sSourceConfig": Map,
    "NacosSourceConfig": Map,
    "ResourceGroupId": String,
    "Type": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

GatewayId

String

网关 ID。

K8sSourceConfig

Map

容器服务来源配置。

更多信息,请参考K8sSourceConfig属性

NacosSourceConfig

Map

MSE Nacos 来源配置。

更多信息,请参考NacosSourceConfig属性

ResourceGroupId

String

资源组 ID。

Type

String

来源类型。

取值:

  • MSE_NACOS: MSE Nacos。

  • K8S: 容器服务。

NacosSourceConfig语法

"NacosSourceConfig": {
  "InstanceId": String
}

NacosSourceConfig属性

属性名称

类型

必须

允许更新

描述

约束

InstanceId

String

Nacos 实例 ID。

K8sSourceConfig语法

"K8sSourceConfig": {
  "ClusterId": String,
  "AuthorizeSecurityGroupRules": List
}

K8sSourceConfig属性

属性名称

类型

必须

允许更新

描述

约束

ClusterId

String

容器服务集群 ID。

AuthorizeSecurityGroupRules

List

网关安全组授权规则配置列表。

更多信息,请参考AuthorizeSecurityGroupRules属性

AuthorizeSecurityGroupRules语法

"AuthorizeSecurityGroupRules": [
  {
    "Description": String,
    "PortRanges": List,
    "SecurityGroupId": String
  }
]

AuthorizeSecurityGroupRules属性

属性名称

类型

必须

允许更新

描述

约束

Description

String

规则描述。

PortRanges

List

端口范围列表。

SecurityGroupId

String

安全组 ID。

返回值

Fn::GetAtt

SourceId:来源 ID

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  K8sSourceConfig:
    AssociationPropertyMetadata:
      Parameters:
        ClusterId:
          Type: String
          Description:
            en: The cluster ID of the container service source.
          Required: true
        AuthorizeSecurityGroupRules:
          AssociationPropertyMetadata:
            Parameter:
              AssociationPropertyMetadata:
                Parameters:
                  Description:
                    AssociationProperty: TextArea
                    Type: String
                    Description:
                      en: The description of the security group rule.
                    Required: false
                  PortRanges:
                    AssociationPropertyMetadata:
                      Parameter:
                        Type: String
                        Description:
                          en: The port range string.
                        Required: false
                    AssociationProperty: List[Parameter]
                    Type: Json
                    Description:
                      en: The port ranges for the security group rule.
                    Required: false
                    MaxLength: 100
                  SecurityGroupId:
                    AssociationPropertyMetadata:
                      VpcId: ${VpcId}
                    AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
                    Type: String
                    Description:
                      en: The ID of the security group.
                    Required: false
              Type: Json
              Description:
                en: Security group rule configuration.
              Required: false
          AssociationProperty: List[Parameter]
          Type: Json
          Description:
            en: The security group rules for authorization.
          Required: false
          MaxLength: 100
    Type: Json
    Description:
      en: The K8s source configuration.
    Required: false
  Type:
    Type: String
    Description:
      en: |-
        The source type:
        - MSE_NACOS: MSE Nacos.
        - K8S: Container service.
    AllowedValues:
      - MSE_NACOS
      - K8S
    Required: false
  GatewayId:
    Type: String
    Description:
      en: The gateway ID.
    Required: false
Resources:
  Source:
    Type: ALIYUN::APIG::Source
    Properties:
      K8sSourceConfig:
        Ref: K8sSourceConfig
      Type:
        Ref: Type
      GatewayId:
        Ref: GatewayId
Outputs:
  SourceId:
    Description: The ID of the source.
    Value:
      Fn::GetAtt:
        - Source
        - SourceId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "K8sSourceConfig": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "ClusterId": {
            "Type": "String",
            "Description": {
              "en": "The cluster ID of the container service source."
            },
            "Required": true
          },
          "AuthorizeSecurityGroupRules": {
            "AssociationPropertyMetadata": {
              "Parameter": {
                "AssociationPropertyMetadata": {
                  "Parameters": {
                    "Description": {
                      "AssociationProperty": "TextArea",
                      "Type": "String",
                      "Description": {
                        "en": "The description of the security group rule."
                      },
                      "Required": false
                    },
                    "PortRanges": {
                      "AssociationPropertyMetadata": {
                        "Parameter": {
                          "Type": "String",
                          "Description": {
                            "en": "The port range string."
                          },
                          "Required": false
                        }
                      },
                      "AssociationProperty": "List[Parameter]",
                      "Type": "Json",
                      "Description": {
                        "en": "The port ranges for the security group rule."
                      },
                      "Required": false,
                      "MaxLength": 100
                    },
                    "SecurityGroupId": {
                      "AssociationPropertyMetadata": {
                        "VpcId": "${VpcId}"
                      },
                      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
                      "Type": "String",
                      "Description": {
                        "en": "The ID of the security group."
                      },
                      "Required": false
                    }
                  }
                },
                "Type": "Json",
                "Description": {
                  "en": "Security group rule configuration."
                },
                "Required": false
              }
            },
            "AssociationProperty": "List[Parameter]",
            "Type": "Json",
            "Description": {
              "en": "The security group rules for authorization."
            },
            "Required": false,
            "MaxLength": 100
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "The K8s source configuration."
      },
      "Required": false
    },
    "Type": {
      "Type": "String",
      "Description": {
        "en": "The source type:\n- MSE_NACOS: MSE Nacos.\n- K8S: Container service."
      },
      "AllowedValues": [
        "MSE_NACOS",
        "K8S"
      ],
      "Required": false
    },
    "GatewayId": {
      "Type": "String",
      "Description": {
        "en": "The gateway ID."
      },
      "Required": false
    }
  },
  "Resources": {
    "Source": {
      "Type": "ALIYUN::APIG::Source",
      "Properties": {
        "K8sSourceConfig": {
          "Ref": "K8sSourceConfig"
        },
        "Type": {
          "Ref": "Type"
        },
        "GatewayId": {
          "Ref": "GatewayId"
        }
      }
    }
  },
  "Outputs": {
    "SourceId": {
      "Description": "The ID of the source.",
      "Value": {
        "Fn::GetAtt": [
          "Source",
          "SourceId"
        ]
      }
    }
  }
}