Cria uma origem do API Gateway (APIG). Os tipos de origem compatíveis incluem Container Service (K8s) e MSE Nacos.
Sintaxe
{
"Type": "ALIYUN::APIG::Source",
"Properties": {
"GatewayId": String,
"K8sSourceConfig": Map,
"NacosSourceConfig": Map,
"ResourceGroupId": String,
"Type": String
}
}
Propriedades
|
Nome da propriedade |
Tipo |
Obrigatória |
Atualize permitida |
Descrição |
Restrições |
|
GatewayId |
String |
Não |
Não |
ID do gateway. |
Nenhuma |
|
K8sSourceConfig |
Map |
Não |
Não |
Configuração da origem do Container Service. |
Para obter mais informações, consulte Propriedades de K8sSourceConfig. |
|
NacosSourceConfig |
Map |
Não |
Não |
Configuração da origem do MSE Nacos. |
Para obter mais informações, consulte Propriedades de NacosSourceConfig. |
|
ResourceGroupId |
String |
Não |
Não |
ID do grupo de recursos. |
Nenhuma |
|
Type |
String |
Não |
Não |
Tipo da origem. |
Valores válidos:
|
Sintaxe de NacosSourceConfig
"NacosSourceConfig": {
"InstanceId": String
}
Propriedades de NacosSourceConfig
|
Nome da propriedade |
Tipo |
Obrigatória |
Atualize permitida |
Descrição |
Restrições |
|
InstanceId |
String |
Sim |
Não |
ID da instância do Nacos. |
Nenhuma |
Sintaxe de K8sSourceConfig
"K8sSourceConfig": {
"ClusterId": String,
"AuthorizeSecurityGroupRules": List
}
Propriedades de K8sSourceConfig
|
Nome da propriedade |
Tipo |
Obrigatória |
Atualize permitida |
Descrição |
Restrições |
|
ClusterId |
String |
Sim |
Não |
ID do cluster do Container Service. |
Nenhuma |
|
AuthorizeSecurityGroupRules |
List |
Não |
Não |
Lista de regras de autorização para o grupo de segurança do gateway. |
Para obter mais informações, consulte Propriedades de AuthorizeSecurityGroupRules. |
Sintaxe de AuthorizeSecurityGroupRules
"AuthorizeSecurityGroupRules": [
{
"Description": String,
"PortRanges": List,
"SecurityGroupId": String
}
]
Propriedades de AuthorizeSecurityGroupRules
|
Nome da propriedade |
Tipo |
Obrigatória |
Atualize permitida |
Descrição |
Restrições |
|
Description |
String |
Não |
Não |
Descrição da regra. |
Nenhuma |
|
PortRanges |
List |
Não |
Não |
Lista de intervalos de portas. |
Nenhuma |
|
SecurityGroupId |
String |
Não |
Não |
ID do grupo de segurança. |
Nenhuma |
Valor de retorno
Fn::GetAtt
SourceId: ID da origem.
Exemplos
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"
]
}
}
}
}