Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ECS::SecurityGroupIngresses

Última atualização: Jun 27, 2026

O recurso ALIYUN::ECS::SecurityGroupIngresses associa várias regras de entrada a um grupo de segurança simultaneamente.

Sintaxe

{
  "Type": "ALIYUN::ECS::SecurityGroupIngresses",
  "Properties": {
    "SecurityGroupId": String,
    "Permissions": List
  }
}

Propriedades

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

Permissions

List

Sim

Sim

Configurações das regras de entrada a serem associadas ao grupo de segurança.

É possível associar até 100 regras de entrada. Para mais informações, consulte Propriedades de Permissions.

SecurityGroupId

String

Sim

Não

ID do grupo de segurança de origem.

Nenhuma.

Sintaxe de Permissions

"Permissions": [
  {
    "Policy": String,
    "SourceGroupId": String,
    "Description": String,
    "SourcePortRange": String,
    "Priority": Integer,
    "SourceGroupOwnerId": String,
    "Ipv6SourceCidrIp": String,
    "NicType": String,
    "PortRange": String,
    "SourceCidrIp": String,
    "IpProtocol": String,
    "DestCidrIp": String,
    "SourceGroupOwnerAccount": String,
    "Ipv6DestCidrIp": String,
    "SourcePrefixListId": String
  }
]

Propriedades de Permissions

Propriedade

Tipo

Obrigatória

Editável

Descrição

Restrição

IpProtocol

String

Sim

Não

Protocolo IP da regra.

Valores válidos:

  • tcp: oferece suporte ao Transmission Control Protocol (TCP).

  • udp: oferece suporte ao User Datagram Protocol (UDP).

  • icmp: oferece suporte ao Internet Control Message Protocol (ICMP).

  • gre: oferece suporte ao Generic Routing Encapsulation (GRE).

  • all: oferece suporte a todos os protocolos listados acima.

PortRange

String

Sim

Não

Intervalo de portas de destino para o protocolo da camada de transporte.

  • Formato do valor quando IpProtocol é definido como tcp ou udp: X/Y. X indica a porta inicial e Y, a porta final. Ambos variam de 1 a 65535. Separe X e Y com uma barra (/). Por exemplo, 1/200 é um valor válido, enquanto 200/1 é inválido.

  • Valor válido quando IpProtocol é definido como icmp: -1/-1.

  • Valor válido quando IpProtocol é definido como gre: -1/-1.

  • Valor válido quando IpProtocol é definido como all: -1/-1.

Description

String

Não

Não

Descrição da regra.

A descrição deve ter de 1 a 512 caracteres.

DestCidrIp

String

Não

Não

Intervalo de endereços IP de destino.

Oferece suporte a intervalos de endereços IPv4.

Ipv6DestCidrIp

String

Não

Não

Bloco CIDR IPv6 de destino.

Oferece suporte a endereços IPv6. Apenas endereços ip do tipo vpc são aceitos.

Ipv6SourceCidrIp

String

Não

Não

Bloco CIDR IPv6 de origem.

Oferece suporte a endereços IPv6. Apenas endereços ip do tipo vpc são aceitos.

NicType

String

Não

Não

Tipo da interface de rede (NIC).

Valores válidos:

  • internet (padrão): NIC pública

  • intranet: NIC interna

Se você especificar DestGroupId e deixar DestCidrIp vazio para configurar acesso mútuo entre grupos de segurança, defina NicType como intranet.

Policy

String

Não

Não

Ação de controle de acesso da regra.

Valores válidos:

  • accept (padrão): permite o acesso.

  • drop: nega o acesso.

Priority

Integer

Não

Não

Prioridade da regra.

Valores válidos: 1 a 100.

Valor padrão: 1.

SourceCidrIp

String

Não

Não

Intervalo de endereços IPv4 de origem.

Oferece suporte apenas a intervalos de endereços IPv4.

SourceGroupId

String

Não

Não

ID do grupo de segurança de origem referenciado na regra.

Especifique pelo menos SourceGroupId ou SourceCidrIp.

Se você especificar SourceGroupId e deixar SourceCidrIp vazio, defina NicType como intranet.

Caso especifique tanto SourceGroupId quanto SourceCidrIp, o valor de SourceCidrIp terá precedência por padrão.

SourceGroupOwnerAccount

String

Não

Não

Endereço de e-mail da conta Alibaba Cloud proprietária do grupo de segurança de origem.

Exemplo: T***@example.com.

SourceGroupOwnerId

String

Não

Não

ID da conta Alibaba Cloud proprietária do grupo de segurança de origem, usado para configuração de regras entre contas.

Se SourceGroupOwnerId estiver vazio, a regra controlará o acesso a outro grupo de segurança dentro da sua conta Alibaba Cloud por padrão.

Ao especificar SourceCidrIp, o valor de SourceGroupOwnerId será ignorado.

SourcePortRange

String

Não

Não

Intervalo de portas de origem para o protocolo da camada de transporte.

  • Formato do valor quando IpProtocol é definido como tcp ou udp: X/Y. X indica a porta inicial e Y, a porta final. Ambos variam de 1 a 65535. Separe X e Y com uma barra (/). Por exemplo, 1/200 é um valor válido, enquanto 200/1 é inválido.

  • Valor válido quando IpProtocol é definido como icmp: -1/-1.

  • Valor válido quando IpProtocol é definido como gre: -1/-1.

  • Valor válido quando IpProtocol é definido como all: -1/-1.

SourcePrefixListId

String

Não

Não

ID da lista de prefixos de origem referenciada na regra.

Chame a operação DescribePrefixLists para consultar os IDs das listas de prefixos disponíveis.

Grupos de segurança na rede clássica não permitem referenciar listas de prefixos em suas regras. Para mais detalhes, consulte Limites.

Se você especificar SourceCidrIp, Ipv6SourceCidrIp ou SourceGroupId, o valor de SourcePrefixListId será ignorado.

Valores de retorno

Fn::GetAtt

Nenhum.

Exemplos

Formato YAML

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SecurityGroupId:
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
    AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
    Type: String
    Description:
      en: Id of the security group.
    Required: true
  Permissions:
    AssociationPropertyMetadata:
      Parameters:
        Policy:
          Type: String
          Description:
            en: 'Authorization policies, parameter values can be: accept (accepted access), drop (denied access). Default value is accept.'
          AllowedValues:
            - accept
            - drop
          Required: false
        SourceGroupId:
          Type: String
          Description:
            en: Source Group Id
          Required: false
        Description:
          AssociationProperty: TextArea
          Type: String
          Description:
            en: Description of the security group rule, [1, 512] characters. The default is empty.
          Required: false
          MinLength: 1
          MaxLength: 512
        SourcePortRange:
          Type: String
          Description:
            en: 'The range of the ports enabled by the source security group for the transport layer protocol. Valid values: TCP/UDP: Value range: 1 to 65535. The start port and the end port are separated by a slash (/). Correct example: 1/200. Incorrect example: 200/1.ICMP: -1/-1.GRE: -1/-1.ALL: -1/-1.'
          Required: false
        Priority:
          Type: Number
          Description:
            en: Authorization policies priority range[1, 100]
          Required: false
          MinValue: 1
          MaxValue: 100
          Default: 1
        SourceGroupOwnerId:
          Type: String
          Description:
            en: Source Group Owner Account ID
          Required: false
        Ipv6SourceCidrIp:
          Type: String
          Description:
            en: |-
              Source IPv6 CIDR address segment. Supports IP address ranges in CIDR format and IPv6 format.
              Note Only VPC type IP addresses are supported.
          Required: false
        NicType:
          Type: String
          Description:
            en: Network type, could be 'internet' or 'intranet'. Default value is internet.
          AllowedValues:
            - internet
            - intranet
          Required: false
        PortRange:
          Type: String
          Description:
            en: Ip protocol relative port range. For tcp and udp, the port rang is [1,65535], using format '1/200'For icmp|gre|all protocel, the port range should be '-1/-1'
          Required: true
        SourceCidrIp:
          Type: String
          Description:
            en: The source IPv4 CIDR block to which you want to control access. CIDR blocks and IPv4 addresses are supported.
          Required: false
        IpProtocol:
          Type: String
          Description:
            en: Ip protocol for in rule.
          AllowedValues:
            - tcp
            - udp
            - icmp
            - gre
            - all
            - icmpv6
          Required: true
        DestCidrIp:
          Type: String
          Description:
            en: The destination IPv4 CIDR block to which you want to control access. CIDR blocks and IPv4 addresses are supported.
          Required: false
        SourceGroupOwnerAccount:
          Type: String
          Description:
            en: Source Group Owner Account
          Required: false
        Ipv6DestCidrIp:
          Type: String
          Description:
            en: Destination IPv6 CIDR address block for which access rights need to be set. CIDR format and IPv6 format IP address range are supported.
          Required: false
        SourcePrefixListId:
          Type: String
          Description:
            en: |-
              The ID of the source prefix list to which you want to control access. You can call the DescribePrefixLists operation to query the IDs of available prefix lists. Take note of the following items:
              - If a security group is in the classic network, you cannot configure prefix lists in the security group rules.
              - If you specify the SourceCidrIp, Ipv6SourceCidrIp, or SourceGroupId parameter, this parameter is ignored.
          Required: false
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: A list of security group rules. A hundred at most.
    Required: true
    MaxLength: 100
Resources:
  SecurityGroupIngresses:
    Type: ALIYUN::ECS::SecurityGroupIngresses
    Properties:
      SecurityGroupId:
        Ref: SecurityGroupId
      Permissions:
        Ref: Permissions

Formato JSON

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SecurityGroupId": {
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}"
      },
      "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
      "Type": "String",
      "Description": {
        "en": "Id of the security group."
      },
      "Required": true
    },
    "Permissions": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "Policy": {
            "Type": "String",
            "Description": {
              "en": "Authorization policies, parameter values can be: accept (accepted access), drop (denied access). Default value is accept."
            },
            "AllowedValues": [
              "accept",
              "drop"
            ],
            "Required": false
          },
          "SourceGroupId": {
            "Type": "String",
            "Description": {
              "en": "Source Group Id"
            },
            "Required": false
          },
          "Description": {
            "AssociationProperty": "TextArea",
            "Type": "String",
            "Description": {
              "en": "Description of the security group rule, [1, 512] characters. The default is empty."
            },
            "Required": false,
            "MinLength": 1,
            "MaxLength": 512
          },
          "SourcePortRange": {
            "Type": "String",
            "Description": {
              "en": "The range of the ports enabled by the source security group for the transport layer protocol. Valid values: TCP/UDP: Value range: 1 to 65535. The start port and the end port are separated by a slash (/). Correct example: 1/200. Incorrect example: 200/1.ICMP: -1/-1.GRE: -1/-1.ALL: -1/-1."
            },
            "Required": false
          },
          "Priority": {
            "Type": "Number",
            "Description": {
              "en": "Authorization policies priority range[1, 100]"
            },
            "Required": false,
            "MinValue": 1,
            "MaxValue": 100,
            "Default": 1
          },
          "SourceGroupOwnerId": {
            "Type": "String",
            "Description": {
              "en": "Source Group Owner Account ID"
            },
            "Required": false
          },
          "Ipv6SourceCidrIp": {
            "Type": "String",
            "Description": {
              "en": "Source IPv6 CIDR address segment. Supports IP address ranges in CIDR format and IPv6 format.\nNote Only VPC type IP addresses are supported."
            },
            "Required": false
          },
          "NicType": {
            "Type": "String",
            "Description": {
              "en": "Network type, could be 'internet' or 'intranet'. Default value is internet."
            },
            "AllowedValues": [
              "internet",
              "intranet"
            ],
            "Required": false
          },
          "PortRange": {
            "Type": "String",
            "Description": {
              "en": "Ip protocol relative port range. For tcp and udp, the port rang is [1,65535], using format '1/200'For icmp|gre|all protocel, the port range should be '-1/-1'"
            },
            "Required": true
          },
          "SourceCidrIp": {
            "Type": "String",
            "Description": {
              "en": "The source IPv4 CIDR block to which you want to control access. CIDR blocks and IPv4 addresses are supported."
            },
            "Required": false
          },
          "IpProtocol": {
            "Type": "String",
            "Description": {
              "en": "Ip protocol for in rule."
            },
            "AllowedValues": [
              "tcp",
              "udp",
              "icmp",
              "gre",
              "all",
              "icmpv6"
            ],
            "Required": true
          },
          "DestCidrIp": {
            "Type": "String",
            "Description": {
              "en": "The destination IPv4 CIDR block to which you want to control access. CIDR blocks and IPv4 addresses are supported."
            },
            "Required": false
          },
          "SourceGroupOwnerAccount": {
            "Type": "String",
            "Description": {
              "en": "Source Group Owner Account"
            },
            "Required": false
          },
          "Ipv6DestCidrIp": {
            "Type": "String",
            "Description": {
              "en": "Destination IPv6 CIDR address block for which access rights need to be set. CIDR format and IPv6 format IP address range are supported."
            },
            "Required": false
          },
          "SourcePrefixListId": {
            "Type": "String",
            "Description": {
              "en": "The ID of the source prefix list to which you want to control access. You can call the DescribePrefixLists operation to query the IDs of available prefix lists. Take note of the following items:\n- If a security group is in the classic network, you cannot configure prefix lists in the security group rules.\n- If you specify the SourceCidrIp, Ipv6SourceCidrIp, or SourceGroupId parameter, this parameter is ignored."
            },
            "Required": false
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "A list of security group rules. A hundred at most."
      },
      "Required": true,
      "MaxLength": 100
    }
  },
  "Resources": {
    "SecurityGroupIngresses": {
      "Type": "ALIYUN::ECS::SecurityGroupIngresses",
      "Properties": {
        "SecurityGroupId": {
          "Ref": "SecurityGroupId"
        },
        "Permissions": {
          "Ref": "Permissions"
        }
      }
    }
  }
}