Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::VPC::FlowLog

Última atualização: Sep 21, 2026

ALIYUN::VPC::FlowLog cria um flow log.

Sintaxe

{
  "Type": "ALIYUN::VPC::FlowLog",
  "Properties": {
    "FlowLogName": String,
    "Description": String,
    "LogStoreName": String,
    "ResourceId": String,
    "ProjectName": String,
    "ResourceType": String,
    "TrafficType": String
  }
}

Propriedades

PropertyTypeRequiredEditableDescriptionConstraint
FlowLogNameStringNoYesO nome do flow log.O nome deve ter entre 2 e 128 caracteres e pode conter letras, dígitos, pontos (.), underscores (_) e hífens (-). Deve começar com uma letra e não pode começar com http:// ou https://.
DescriptionStringNoYesA descrição do flow log.A descrição deve ter entre 2 e 256 caracteres. Deve começar com uma letra e não pode começar com http:// ou https://.
LogStoreNameStringYesNoO nome do Logstore que armazena os dados de tráfego capturados.None
ResourceIdStringYesNoO ID do recurso cujo tráfego você deseja capturar.Os IDs de virtual private clouds (VPCs), vSwitches e elastic network interfaces (ENIs) são aceitos.

Não é possível criar um flow log para uma VPC que contenha instâncias das seguintes famílias: ecs.c1, ecs.c2, ecs.c4, ecs.c5, ecs.ce4, ecs.cm4, ecs.d1, ecs.e3, ecs.e4, ecs.ga1, ecs.gn4, ecs.gn5, ecs.i1, ecs.m1, ecs.m2, ecs.mn4, ecs.n1, ecs.n2, ecs.n4, ecs.s1, ecs.s2, ecs.s3, ecs.se1, ecs.sn1, ecs.sn2, ecs.t1 e ecs.xn4.

Para crie um flow log, atualize os tipos de instância primeiro. Para obter mais informações, consulte Change for pay-as-you-go instance e Upgrade the instance types of subscription instances.
Nota Se sua VPC contém instâncias das famílias mencionadas acima e você já criou um flow log, atualize os tipos de instância para garantir que o recurso de flow log funcione corretamente.
ProjectNameStringYesNoO nome do projeto do Log Service que armazena os dados de tráfego capturados.None
ResourceTypeStringYesNoO tipo do recurso cujo tráfego você deseja capturar.Valores válidos:
  • NetworkInterface: captura dados de tráfego de todas as ENIs.
  • VSwitch: captura dados de tráfego de todas as ENIs associadas a um vSwitch especificado.
  • VPC: captura dados de tráfego de todas as ENIs em uma VPC especificada.
TrafficTypeStringYesNoO tipo de tráfego que você deseja capturar.Valores válidos:
  • All: todo o tráfego
  • Allow: tráfego permitido pelo Resource Access Management (RAM)
  • Drop: tráfego negado pelo RAM

Parâmetros de resposta

Fn::GetAtt

  • FlowLogName: o nome do flow log.

  • Description: a descrição do flow log.

  • LogStoreName: o nome do Logstore.

  • ResourceId: o ID do recurso.

  • ProjectName: o nome do projeto do Log Service.

  • ResourceType: o tipo do recurso.

  • FlowLogId: o ID do flow log.

  • TrafficType: o tipo de tráfego.

Exemplos

Formato JSON

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "FlowLogName": {
      "Type": "String",
      "Description": "The flow log name."
    },
    "Description": {
      "Type": "String",
      "Description": "The Description of flow log."
    },
    "LogStoreName": {
      "Type": "String",
      "Description": "The log store name."
    },
    "ResourceId": {
      "Type": "String",
      "Description": "The resource id."
    },
    "ProjectName": {
      "Type": "String",
      "Description": "The project name."
    },
    "ResourceType": {
      "Type": "String",
      "Description": "The resource type."
    },
    "TrafficType": {
      "Type": "String",
      "Description": "The traffic type."
    }
  },
  "Resources": {
    "VPCFlowLog": {
      "Type": "ALIYUN::VPC::FlowLog",
      "Properties": {
        "FlowLogName": {
          "Ref": "FlowLogName"
        },
        "Description": {
          "Ref": "Description"
        },
        "LogStoreName": {
          "Ref": "LogStoreName"
        },
        "ResourceId": {
          "Ref": "ResourceId"
        },
        "ProjectName": {
          "Ref": "ProjectName"
        },
        "ResourceType": {
          "Ref": "ResourceType"
        },
        "TrafficType": {
          "Ref": "TrafficType"
        }
      }
    }
  },
  "Outputs": {
    "FlowLogName": {
      "Description": "The flow log name.",
      "Value": {
        "Fn::GetAtt": [
          "VPCFlowLog",
          "FlowLogName"
        ]
      }
    },
    "Description": {
      "Description": "The Description of flow log.",
      "Value": {
        "Fn::GetAtt": [
          "VPCFlowLog",
          "Description"
        ]
      }
    },
    "LogStoreName": {
      "Description": "The log store name.",
      "Value": {
        "Fn::GetAtt": [
          "VPCFlowLog",
          "LogStoreName"
        ]
      }
    },
    "ResourceId": {
      "Description": "The resource id.",
      "Value": {
        "Fn::GetAtt": [
          "VPCFlowLog",
          "ResourceId"
        ]
      }
    },
    "ProjectName": {
      "Description": "The project name.",
      "Value": {
        "Fn::GetAtt": [
          "VPCFlowLog",
          "ProjectName"
        ]
      }
    },
    "ResourceType": {
      "Description": "The resource type.",
      "Value": {
        "Fn::GetAtt": [
          "VPCFlowLog",
          "ResourceType"
        ]
      }
    },
    "FlowLogId": {
      "Description": "The flow log ID.",
      "Value": {
        "Fn::GetAtt": [
          "VPCFlowLog",
          "FlowLogId"
        ]
      }
    },
    "TrafficType": {
      "Description": "The traffic type.",
      "Value": {
        "Fn::GetAtt": [
          "VPCFlowLog",
          "TrafficType"
        ]
      }
    }
  }
}

Formato YAML

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Description:
    Description: The Description of flow log.
    Type: String
  FlowLogName:
    Description: The flow log name.
    Type: String
  LogStoreName:
    Description: The log store name.
    Type: String
  ProjectName:
    Description: The project name.
    Type: String
  ResourceId:
    Description: The resource id.
    Type: String
  ResourceType:
    Description: The resource type.
    Type: String
  TrafficType:
    Description: The traffic type.
    Type: String
Resources:
  VPCFlowLog:
    Properties:
      Description:
        Ref: Description
      FlowLogName:
        Ref: FlowLogName
      LogStoreName:
        Ref: LogStoreName
      ProjectName:
        Ref: ProjectName
      ResourceId:
        Ref: ResourceId
      ResourceType:
        Ref: ResourceType
      TrafficType:
        Ref: TrafficType
    Type: ALIYUN::VPC::FlowLog
Outputs:
  Description:
    Description: The Description of flow log.
    Value:
      Fn::GetAtt:
      - VPCFlowLog
      - Description
  FlowLogId:
    Description: The flow log ID.
    Value:
      Fn::GetAtt:
      - VPCFlowLog
      - FlowLogId
  FlowLogName:
    Description: The flow log name.
    Value:
      Fn::GetAtt:
      - VPCFlowLog
      - FlowLogName
  LogStoreName:
    Description: The log store name.
    Value:
      Fn::GetAtt:
      - VPCFlowLog
      - LogStoreName
  ProjectName:
    Description: The project name.
    Value:
      Fn::GetAtt:
      - VPCFlowLog
      - ProjectName
  ResourceId:
    Description: The resource id.
    Value:
      Fn::GetAtt:
      - VPCFlowLog
      - ResourceId
  ResourceType:
    Description: The resource type.
    Value:
      Fn::GetAtt:
      - VPCFlowLog
      - ResourceType
  TrafficType:
    Description: The traffic type.
    Value:
      Fn::GetAtt:
      - VPCFlowLog
      - TrafficType