Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::SAE::Ingress

Última atualização: Jun 27, 2026

O recurso ALIYUN::SAE::Ingress cria uma regra de roteamento.

Sintaxe

{
  "Type": "ALIYUN::SAE::Ingress",
  "Properties": {
    "DefaultRule": Map,
    "Description": String,
    "ListenerPort": Integer,
    "NamespaceId": String,
    "Rules": List,
    "SlbId": String,
    "CertIds": List,
    "CertId": String,
    "LoadBalanceType": String,
    "ListenerProtocol": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

DefaultRule

Map

Sim

Sim

Regra de encaminhamento padrão.

Especifique uma porta e um aplicativo na regra de encaminhamento padrão para encaminhar o tráfego com base no endereço IP do aplicativo.

Para mais informações, consulte a seção "Propriedades de DefaultRule" deste tópico.

Nota

Todas as solicitações que não correspondem às regras de encaminhamento especificadas pela propriedade Rules são encaminhadas para o aplicativo.

Description

String

Sim

Sim

Nome da regra de roteamento.

Nenhuma.

ListenerPort

Integer

Sim

Sim

Porta de escuta da instância do Server Load Balancer (SLB).

Especifique uma porta disponível.

NamespaceId

String

Sim

Não

ID do namespace ao qual o aplicativo pertence.

Não há suporte para aplicativos pertencentes a múltiplos namespaces.

Rules

List

Sim

Sim

Regras de encaminhamento personalizadas.

Defina uma porta e um aplicativo em uma regra de encaminhamento personalizada para encaminhar o tráfego com base no nome de domínio e no caminho da solicitação.

Para mais informações, consulte a seção "Propriedades de Rules" deste tópico.

SlbId

String

Sim

Não

Instância de SLB usada pela regra de roteamento.

Nenhuma.

CertIds

List

Não

Sim

IDs dos certificados associados à instância do Application Load Balancer (ALB).

Aplicam-se os seguintes limites:

  • Se você definir LoadBalanceType como alb, use CertIds para configurar vários certificados para o listener HTTPS. Separe múltiplos IDs de certificado por vírgulas (,).

  • Obtenha o ID do certificado SSL para a instância ALB no Certificate Management Service. Por exemplo, em 756-cn-hangzhou, 756 é o ID do certificado obtido na página do serviço, e -cn-hangzhou é um sufixo fixo. Para mais informações, consulte Gerenciar certificados.

CertId

String

Não

Sim

ID do certificado associado à instância do Classic Load Balancer (CLB).

Aplicam-se os seguintes limites:

  • Se você definir LoadBalanceType como clb, use CertId para configurar um certificado para o listener HTTPS.

Para mais informações sobre IDs de certificados SSL para instâncias CLB, consulte Criar um certificado.

LoadBalanceType

String

Não

Não

Tipo da instância de SLB.

Especifique o tipo ao criar a regra de roteamento. Não é possível alterar o tipo durante atualizações. Valores válidos:

  • clb: instância CLB (anteriormente SLB)

  • alb: instância ALB

ListenerProtocol

String

Não

Sim

Protocolo usado para encaminhar solicitações.

Valores válidos:

  • HTTP: adequado para aplicativos que precisam identificar os dados transmitidos.

  • HTTPS: recomendado para aplicativos que exigem transmissão de dados criptografados.

Sintaxe de DefaultRule

"DefaultRule": {
  "BackendProtocol": String,
  "AppId": String,
  "ContainerPort": Integer
}

Propriedades de DefaultRule

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

AppId

String

Sim

Sim

ID do aplicativo.

Nenhuma.

ContainerPort

Integer

Sim

Sim

Porta do contêiner.

Valores válidos:

0 a 65535.

BackendProtocol

String

Não

Sim

Protocolo usado pelo serviço de backend.

Valores válidos:

  • http

  • https

  • grpc

Sintaxe de Rules

"Rules": [
  {
    "Path": String,
    "BackendProtocol": String,
    "AppId": String,
    "RewritePath": String,
    "ContainerPort": Integer,
    "Domain": String
  }
]

Propriedades de Rules

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

AppId

String

Sim

Sim

ID do aplicativo.

Nenhuma.

ContainerPort

Integer

Sim

Sim

Porta do contêiner.

Valores válidos:

0 a 65535.

Domain

String

Sim

Sim

Nome de domínio.

Nenhuma.

Path

String

Sim

Sim

Caminho da solicitação.

Nenhuma.

BackendProtocol

String

Não

Sim

Protocolo usado pelo serviço de backend.

Valores válidos:

  • http

  • https

  • grpc

RewritePath

String

Não

Não

Caminho de reescrita.

Nenhuma.

Valores de retorno

Fn::GetAtt

IngressId: o ID da regra de roteamento.

Exemplos

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DefaultRule:
        AssociationPropertyMetadata:
          Parameters:
            BackendProtocol:
              Type: String
              Description:
                en: The protocol of the application.
              AllowedValues:
                - http
                - https
                - grpc
              Required: false
            AppId:
              Type: String
              Description:
                en: The application ID
              Required: true
            ContainerPort:
              Type: Number
              Description:
                en: The container port of the application.
              Required: true
              MinValue: 0
              MaxValue: 65535
        Type: Json
        Description:
          en: 'The default forwarding rule. You can specify a port and an application in the default forwarding rule to forward traffic based on the IP address of the application. '
        Required: true
      SlbId:
        Type: String
        AssociationProperty: ALIYUN::SLB::LoadBalancer::LoadBalancerId
        Description:
          en: The Server Load Balancer (SLB) instance that is used by the routing rule.
        Required: true
      ListenerPort:
        Type: Number
        Description:
          en: The listener port of the SLB instance. You must specify a vacant port.
        Required: true
        MinValue: 0
        MaxValue: 65535
      Description:
        AssociationProperty: TextArea
        Type: String
        Description:
          en: The name of the routing rule.
        AllowedPattern: ^[a-z0-9]([a-z0-9.-]{0,61}[a-z0-9])?$
        Required: true
      NamespaceId:
        Type: String
        Description:
          en: The ID of the namespace to which the application belongs. You can specify only one namespace ID each time you call this operation.
        Required: true
      Rules:
        AssociationPropertyMetadata:
          Parameters:
            Path:
              Type: String
              Description:
                en: The request path.
              Required: true
            BackendProtocol:
              Type: String
              Description:
                en: The protocol of the application.
              AllowedValues:
                - http
                - https
                - grpc
              Required: false
            AppId:
              Type: String
              Description:
                en: The application ID
              Required: true
            RewritePath:
              Type: String
              Description:
                en: The rewrite path.
              Required: false
            ContainerPort:
              Type: Number
              Description:
                en: The container port of the application.
              Required: true
              MinValue: 0
              MaxValue: 65535
            Domain:
              Type: String
              Description:
                en: The domain name.
              Required: true
        AssociationProperty: List[Parameters]
        Type: Json
        Description:
          en: The forwarding rules. You can specify a port and an application in a forwarding rule to forward traffic based on the specified domain name and request path.
        Required: true
        MinLength: 1
        MaxLength: 10
    Resources:
      Ingress:
        Type: ALIYUN::SAE::Ingress
        Properties:
          DefaultRule:
            Ref: DefaultRule
          SlbId:
            Ref: SlbId
          ListenerPort:
            Ref: ListenerPort
          Description:
            Ref: Description
          NamespaceId:
            Ref: NamespaceId
          Rules:
            Ref: Rules
    Outputs:
      IngressId:
        Description: The ID of the routing rule.
        Value:
          Fn::GetAtt:
            - Ingress
            - IngressId
    
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DefaultRule": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "BackendProtocol": {
                "Type": "String",
                "Description": {
                  "en": "The protocol of the application."
                },
                "AllowedValues": [
                  "http",
                  "https",
                  "grpc"
                ],
                "Required": false
              },
              "AppId": {
                "Type": "String",
                "Description": {
                  "en": "The application ID"
                },
                "Required": true
              },
              "ContainerPort": {
                "Type": "Number",
                "Description": {
                  "en": "The container port of the application."
                },
                "Required": true,
                "MinValue": 0,
                "MaxValue": 65535
              }
            }
          },
          "Type": "Json",
          "Description": {
            "en": "The default forwarding rule. You can specify a port and an application in the default forwarding rule to forward traffic based on the IP address of the application. "
          },
          "Required": true
        },
        "SlbId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::SLB::LoadBalancer::LoadBalancerId",
          "Description": {
            "en": "The Server Load Balancer (SLB) instance that is used by the routing rule."
          },
          "Required": true
        },
        "ListenerPort": {
          "Type": "Number",
          "Description": {
            "en": "The listener port of the SLB instance. You must specify a vacant port."
          },
          "Required": true,
          "MinValue": 0,
          "MaxValue": 65535
        },
        "Description": {
          "AssociationProperty": "TextArea",
          "Type": "String",
          "Description": {
            "en": "The name of the routing rule."
          },
          "AllowedPattern": "^[a-z0-9]([a-z0-9.-]{0,61}[a-z0-9])?$",
          "Required": true
        },
        "NamespaceId": {
          "Type": "String",
          "Description": {
            "en": "The ID of the namespace to which the application belongs. You can specify only one namespace ID each time you call this operation."
          },
          "Required": true
        },
        "Rules": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "Path": {
                "Type": "String",
                "Description": {
                  "en": "The request path."
                },
                "Required": true
              },
              "BackendProtocol": {
                "Type": "String",
                "Description": {
                  "en": "The protocol of the application."
                },
                "AllowedValues": [
                  "http",
                  "https",
                  "grpc"
                ],
                "Required": false
              },
              "AppId": {
                "Type": "String",
                "Description": {
                  "en": "The application ID"
                },
                "Required": true
              },
              "RewritePath": {
                "Type": "String",
                "Description": {
                  "en": "The rewrite path."
                },
                "Required": false
              },
              "ContainerPort": {
                "Type": "Number",
                "Description": {
                  "en": "The container port of the application."
                },
                "Required": true,
                "MinValue": 0,
                "MaxValue": 65535
              },
              "Domain": {
                "Type": "String",
                "Description": {
                  "en": "The domain name."
                },
                "Required": true
              }
            }
          },
          "AssociationProperty": "List[Parameters]",
          "Type": "Json",
          "Description": {
            "en": "The forwarding rules. You can specify a port and an application in a forwarding rule to forward traffic based on the specified domain name and request path."
          },
          "Required": true,
          "MinLength": 1,
          "MaxLength": 10
        }
      },
      "Resources": {
        "Ingress": {
          "Type": "ALIYUN::SAE::Ingress",
          "Properties": {
            "DefaultRule": {
              "Ref": "DefaultRule"
            },
            "SlbId": {
              "Ref": "SlbId"
            },
            "ListenerPort": {
              "Ref": "ListenerPort"
            },
            "Description": {
              "Ref": "Description"
            },
            "NamespaceId": {
              "Ref": "NamespaceId"
            },
            "Rules": {
              "Ref": "Rules"
            }
          }
        }
      },
      "Outputs": {
        "IngressId": {
          "Description": "The ID of the routing rule.",
          "Value": {
            "Fn::GetAtt": [
              "Ingress",
              "IngressId"
            ]
          }
        }
      }
    }