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 | 否 | 否 | 来源类型。 | 取值:
|
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"
]
}
}
}
}该文章对您有帮助吗?