1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. VpcFlowLog
tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack

tencentcloud.VpcFlowLog

Start a Neo task
Explain and create a tencentcloud.VpcFlowLog resource
tencentcloud logo
tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack

    Provides a resource to create a vpc flow_log

    NOTE: The cloud server instance specifications that support stream log collection include: M6ce, M6p, SA3se, S4m, DA3, ITA3, I6t, I6, S5se, SA2, SK1, S4, S5, SN3ne, S3ne, S2ne, SA2a, S3ne, SW3a, SW3b, SW3ne, ITA3, IT5c, IT5, IT5c, IT3, I3, D3, DA2, D2, M6, MA2, M4, C6, IT3a, IT3b, IT3c, C4ne, CN3ne, C3ne, GI1, PNV4, GNV4v, GNV4, GT4, GI3X, GN7, GN7vw.

    NOTE: The following models no longer support the collection of new stream logs, and the stock stream logs will no longer be reported for data from July 25, 2022: Standard models: S3, SA1, S2, S1;Memory type: M3, M2, M1;Calculation type: C4, CN3, C3, C2;Batch calculation type: BC1, BS1;HPCC: HCCIC5, HCCG5v.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const zones = tencentcloud.getAvailabilityZones({});
    const image = tencentcloud.getImages({
        imageTypes: ["PUBLIC_IMAGE"],
        imageNameRegex: "Final",
    });
    const instanceTypes = zones.then(zones => tencentcloud.getInstanceTypes({
        filters: [
            {
                name: "zone",
                values: [zones.zones?.[0]?.name],
            },
            {
                name: "instance-family",
                values: ["S5"],
            },
        ],
        cpuCoreCount: 2,
        excludeSoldOut: true,
    }));
    const logset = new tencentcloud.ClsLogset("logset", {
        logsetName: "logset",
        tags: {
            createBy: "Terraform",
        },
    });
    const topic = new tencentcloud.ClsTopic("topic", {
        topicName: "topic",
        logsetId: logset.clsLogsetId,
        autoSplit: false,
        maxSplitPartitions: 20,
        partitionCount: 1,
        period: 10,
        storageType: "hot",
        tags: {
            createBy: "Terraform",
        },
    });
    const vpc = new tencentcloud.Vpc("vpc", {
        name: "vpc",
        cidrBlock: "10.0.0.0/16",
    });
    const subnet = new tencentcloud.Subnet("subnet", {
        availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
        name: "subnet",
        vpcId: vpc.vpcId,
        cidrBlock: "10.0.0.0/16",
        isMulticast: false,
    });
    const example = new tencentcloud.Eni("example", {
        name: "tf-example",
        vpcId: vpc.vpcId,
        subnetId: subnet.subnetId,
        description: "eni desc",
        ipv4Count: 1,
    });
    const exampleInstance = new tencentcloud.Instance("example", {
        instanceName: "tf-example",
        availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
        imageId: image.then(image => image.images?.[0]?.imageId),
        instanceType: instanceTypes.then(instanceTypes => instanceTypes.instanceTypes?.[0]?.instanceType),
        systemDiskType: "CLOUD_PREMIUM",
        disableSecurityService: true,
        disableMonitorService: true,
        vpcId: vpc.vpcId,
        subnetId: subnet.subnetId,
    });
    const exampleEniAttachment = new tencentcloud.EniAttachment("example", {
        eniId: example.eniId,
        instanceId: exampleInstance.instanceId,
    });
    const exampleVpcFlowLog = new tencentcloud.VpcFlowLog("example", {
        flowLogName: "tf-example",
        resourceType: "NETWORKINTERFACE",
        resourceId: exampleEniAttachment.eniId,
        trafficType: "ACCEPT",
        vpcId: vpc.vpcId,
        flowLogDescription: "this is a testing flow log",
        cloudLogId: topic.clsTopicId,
        storageType: "cls",
        tags: {
            createBy: "Terraform",
        },
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    zones = tencentcloud.get_availability_zones()
    image = tencentcloud.get_images(image_types=["PUBLIC_IMAGE"],
        image_name_regex="Final")
    instance_types = tencentcloud.get_instance_types(filters=[
            {
                "name": "zone",
                "values": [zones.zones[0].name],
            },
            {
                "name": "instance-family",
                "values": ["S5"],
            },
        ],
        cpu_core_count=2,
        exclude_sold_out=True)
    logset = tencentcloud.ClsLogset("logset",
        logset_name="logset",
        tags={
            "createBy": "Terraform",
        })
    topic = tencentcloud.ClsTopic("topic",
        topic_name="topic",
        logset_id=logset.cls_logset_id,
        auto_split=False,
        max_split_partitions=20,
        partition_count=1,
        period=10,
        storage_type="hot",
        tags={
            "createBy": "Terraform",
        })
    vpc = tencentcloud.Vpc("vpc",
        name="vpc",
        cidr_block="10.0.0.0/16")
    subnet = tencentcloud.Subnet("subnet",
        availability_zone=zones.zones[0].name,
        name="subnet",
        vpc_id=vpc.vpc_id,
        cidr_block="10.0.0.0/16",
        is_multicast=False)
    example = tencentcloud.Eni("example",
        name="tf-example",
        vpc_id=vpc.vpc_id,
        subnet_id=subnet.subnet_id,
        description="eni desc",
        ipv4_count=1)
    example_instance = tencentcloud.Instance("example",
        instance_name="tf-example",
        availability_zone=zones.zones[0].name,
        image_id=image.images[0].image_id,
        instance_type=instance_types.instance_types[0].instance_type,
        system_disk_type="CLOUD_PREMIUM",
        disable_security_service=True,
        disable_monitor_service=True,
        vpc_id=vpc.vpc_id,
        subnet_id=subnet.subnet_id)
    example_eni_attachment = tencentcloud.EniAttachment("example",
        eni_id=example.eni_id,
        instance_id=example_instance.instance_id)
    example_vpc_flow_log = tencentcloud.VpcFlowLog("example",
        flow_log_name="tf-example",
        resource_type="NETWORKINTERFACE",
        resource_id=example_eni_attachment.eni_id,
        traffic_type="ACCEPT",
        vpc_id=vpc.vpc_id,
        flow_log_description="this is a testing flow log",
        cloud_log_id=topic.cls_topic_id,
        storage_type="cls",
        tags={
            "createBy": "Terraform",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    zones, err := tencentcloud.GetAvailabilityZones(ctx, &tencentcloud.GetAvailabilityZonesArgs{
    }, nil);
    if err != nil {
    return err
    }
    image, err := tencentcloud.GetImages(ctx, &tencentcloud.GetImagesArgs{
    ImageTypes: []string{
    "PUBLIC_IMAGE",
    },
    ImageNameRegex: pulumi.StringRef("Final"),
    }, nil);
    if err != nil {
    return err
    }
    instanceTypes, err := tencentcloud.GetInstanceTypes(ctx, &tencentcloud.GetInstanceTypesArgs{
    Filters: []tencentcloud.GetInstanceTypesFilter{
    {
    Name: "zone",
    Values: interface{}{
    zones.Zones[0].Name,
    },
    },
    {
    Name: "instance-family",
    Values: []string{
    "S5",
    },
    },
    },
    CpuCoreCount: pulumi.Float64Ref(2),
    ExcludeSoldOut: pulumi.BoolRef(true),
    }, nil);
    if err != nil {
    return err
    }
    logset, err := tencentcloud.NewClsLogset(ctx, "logset", &tencentcloud.ClsLogsetArgs{
    LogsetName: pulumi.String("logset"),
    Tags: pulumi.StringMap{
    "createBy": pulumi.String("Terraform"),
    },
    })
    if err != nil {
    return err
    }
    topic, err := tencentcloud.NewClsTopic(ctx, "topic", &tencentcloud.ClsTopicArgs{
    TopicName: pulumi.String("topic"),
    LogsetId: logset.ClsLogsetId,
    AutoSplit: pulumi.Bool(false),
    MaxSplitPartitions: pulumi.Float64(20),
    PartitionCount: pulumi.Float64(1),
    Period: pulumi.Float64(10),
    StorageType: pulumi.String("hot"),
    Tags: pulumi.StringMap{
    "createBy": pulumi.String("Terraform"),
    },
    })
    if err != nil {
    return err
    }
    vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
    Name: pulumi.String("vpc"),
    CidrBlock: pulumi.String("10.0.0.0/16"),
    })
    if err != nil {
    return err
    }
    subnet, err := tencentcloud.NewSubnet(ctx, "subnet", &tencentcloud.SubnetArgs{
    AvailabilityZone: pulumi.String(zones.Zones[0].Name),
    Name: pulumi.String("subnet"),
    VpcId: vpc.VpcId,
    CidrBlock: pulumi.String("10.0.0.0/16"),
    IsMulticast: pulumi.Bool(false),
    })
    if err != nil {
    return err
    }
    example, err := tencentcloud.NewEni(ctx, "example", &tencentcloud.EniArgs{
    Name: pulumi.String("tf-example"),
    VpcId: vpc.VpcId,
    SubnetId: subnet.SubnetId,
    Description: pulumi.String("eni desc"),
    Ipv4Count: pulumi.Float64(1),
    })
    if err != nil {
    return err
    }
    exampleInstance, err := tencentcloud.NewInstance(ctx, "example", &tencentcloud.InstanceArgs{
    InstanceName: pulumi.String("tf-example"),
    AvailabilityZone: pulumi.String(zones.Zones[0].Name),
    ImageId: pulumi.String(image.Images[0].ImageId),
    InstanceType: pulumi.String(instanceTypes.InstanceTypes[0].InstanceType),
    SystemDiskType: pulumi.String("CLOUD_PREMIUM"),
    DisableSecurityService: pulumi.Bool(true),
    DisableMonitorService: pulumi.Bool(true),
    VpcId: vpc.VpcId,
    SubnetId: subnet.SubnetId,
    })
    if err != nil {
    return err
    }
    exampleEniAttachment, err := tencentcloud.NewEniAttachment(ctx, "example", &tencentcloud.EniAttachmentArgs{
    EniId: example.EniId,
    InstanceId: exampleInstance.InstanceId,
    })
    if err != nil {
    return err
    }
    _, err = tencentcloud.NewVpcFlowLog(ctx, "example", &tencentcloud.VpcFlowLogArgs{
    FlowLogName: pulumi.String("tf-example"),
    ResourceType: pulumi.String("NETWORKINTERFACE"),
    ResourceId: exampleEniAttachment.EniId,
    TrafficType: pulumi.String("ACCEPT"),
    VpcId: vpc.VpcId,
    FlowLogDescription: pulumi.String("this is a testing flow log"),
    CloudLogId: topic.ClsTopicId,
    StorageType: pulumi.String("cls"),
    Tags: pulumi.StringMap{
    "createBy": pulumi.String("Terraform"),
    },
    })
    if err != nil {
    return err
    }
    return nil
    })
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var zones = Tencentcloud.GetAvailabilityZones.Invoke();
    
        var image = Tencentcloud.GetImages.Invoke(new()
        {
            ImageTypes = new[]
            {
                "PUBLIC_IMAGE",
            },
            ImageNameRegex = "Final",
        });
    
        var instanceTypes = Tencentcloud.GetInstanceTypes.Invoke(new()
        {
            Filters = new[]
            {
                new Tencentcloud.Inputs.GetInstanceTypesFilterInputArgs
                {
                    Name = "zone",
                    Values = new[]
                    {
                        zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
                    },
                },
                new Tencentcloud.Inputs.GetInstanceTypesFilterInputArgs
                {
                    Name = "instance-family",
                    Values = new[]
                    {
                        "S5",
                    },
                },
            },
            CpuCoreCount = 2,
            ExcludeSoldOut = true,
        });
    
        var logset = new Tencentcloud.ClsLogset("logset", new()
        {
            LogsetName = "logset",
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
        var topic = new Tencentcloud.ClsTopic("topic", new()
        {
            TopicName = "topic",
            LogsetId = logset.ClsLogsetId,
            AutoSplit = false,
            MaxSplitPartitions = 20,
            PartitionCount = 1,
            Period = 10,
            StorageType = "hot",
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
        var vpc = new Tencentcloud.Vpc("vpc", new()
        {
            Name = "vpc",
            CidrBlock = "10.0.0.0/16",
        });
    
        var subnet = new Tencentcloud.Subnet("subnet", new()
        {
            AvailabilityZone = zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
            Name = "subnet",
            VpcId = vpc.VpcId,
            CidrBlock = "10.0.0.0/16",
            IsMulticast = false,
        });
    
        var example = new Tencentcloud.Eni("example", new()
        {
            Name = "tf-example",
            VpcId = vpc.VpcId,
            SubnetId = subnet.SubnetId,
            Description = "eni desc",
            Ipv4Count = 1,
        });
    
        var exampleInstance = new Tencentcloud.Instance("example", new()
        {
            InstanceName = "tf-example",
            AvailabilityZone = zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
            ImageId = image.Apply(getImagesResult => getImagesResult.Images[0]?.ImageId),
            InstanceType = instanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.InstanceType),
            SystemDiskType = "CLOUD_PREMIUM",
            DisableSecurityService = true,
            DisableMonitorService = true,
            VpcId = vpc.VpcId,
            SubnetId = subnet.SubnetId,
        });
    
        var exampleEniAttachment = new Tencentcloud.EniAttachment("example", new()
        {
            EniId = example.EniId,
            InstanceId = exampleInstance.InstanceId,
        });
    
        var exampleVpcFlowLog = new Tencentcloud.VpcFlowLog("example", new()
        {
            FlowLogName = "tf-example",
            ResourceType = "NETWORKINTERFACE",
            ResourceId = exampleEniAttachment.EniId,
            TrafficType = "ACCEPT",
            VpcId = vpc.VpcId,
            FlowLogDescription = "this is a testing flow log",
            CloudLogId = topic.ClsTopicId,
            StorageType = "cls",
            Tags = 
            {
                { "createBy", "Terraform" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.TencentcloudFunctions;
    import com.pulumi.tencentcloud.inputs.GetAvailabilityZonesArgs;
    import com.pulumi.tencentcloud.inputs.GetImagesArgs;
    import com.pulumi.tencentcloud.inputs.GetInstanceTypesArgs;
    import com.pulumi.tencentcloud.ClsLogset;
    import com.pulumi.tencentcloud.ClsLogsetArgs;
    import com.pulumi.tencentcloud.ClsTopic;
    import com.pulumi.tencentcloud.ClsTopicArgs;
    import com.pulumi.tencentcloud.Vpc;
    import com.pulumi.tencentcloud.VpcArgs;
    import com.pulumi.tencentcloud.Subnet;
    import com.pulumi.tencentcloud.SubnetArgs;
    import com.pulumi.tencentcloud.Eni;
    import com.pulumi.tencentcloud.EniArgs;
    import com.pulumi.tencentcloud.Instance;
    import com.pulumi.tencentcloud.InstanceArgs;
    import com.pulumi.tencentcloud.EniAttachment;
    import com.pulumi.tencentcloud.EniAttachmentArgs;
    import com.pulumi.tencentcloud.VpcFlowLog;
    import com.pulumi.tencentcloud.VpcFlowLogArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var zones = TencentcloudFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
                .build());
    
            final var image = TencentcloudFunctions.getImages(GetImagesArgs.builder()
                .imageTypes("PUBLIC_IMAGE")
                .imageNameRegex("Final")
                .build());
    
            final var instanceTypes = TencentcloudFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
                .filters(            
                    GetInstanceTypesFilterArgs.builder()
                        .name("zone")
                        .values(zones.zones()[0].name())
                        .build(),
                    GetInstanceTypesFilterArgs.builder()
                        .name("instance-family")
                        .values("S5")
                        .build())
                .cpuCoreCount(2)
                .excludeSoldOut(true)
                .build());
    
            var logset = new ClsLogset("logset", ClsLogsetArgs.builder()
                .logsetName("logset")
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
            var topic = new ClsTopic("topic", ClsTopicArgs.builder()
                .topicName("topic")
                .logsetId(logset.clsLogsetId())
                .autoSplit(false)
                .maxSplitPartitions(20.0)
                .partitionCount(1.0)
                .period(10.0)
                .storageType("hot")
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
            var vpc = new Vpc("vpc", VpcArgs.builder()
                .name("vpc")
                .cidrBlock("10.0.0.0/16")
                .build());
    
            var subnet = new Subnet("subnet", SubnetArgs.builder()
                .availabilityZone(zones.zones()[0].name())
                .name("subnet")
                .vpcId(vpc.vpcId())
                .cidrBlock("10.0.0.0/16")
                .isMulticast(false)
                .build());
    
            var example = new Eni("example", EniArgs.builder()
                .name("tf-example")
                .vpcId(vpc.vpcId())
                .subnetId(subnet.subnetId())
                .description("eni desc")
                .ipv4Count(1.0)
                .build());
    
            var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
                .instanceName("tf-example")
                .availabilityZone(zones.zones()[0].name())
                .imageId(image.images()[0].imageId())
                .instanceType(instanceTypes.instanceTypes()[0].instanceType())
                .systemDiskType("CLOUD_PREMIUM")
                .disableSecurityService(true)
                .disableMonitorService(true)
                .vpcId(vpc.vpcId())
                .subnetId(subnet.subnetId())
                .build());
    
            var exampleEniAttachment = new EniAttachment("exampleEniAttachment", EniAttachmentArgs.builder()
                .eniId(example.eniId())
                .instanceId(exampleInstance.instanceId())
                .build());
    
            var exampleVpcFlowLog = new VpcFlowLog("exampleVpcFlowLog", VpcFlowLogArgs.builder()
                .flowLogName("tf-example")
                .resourceType("NETWORKINTERFACE")
                .resourceId(exampleEniAttachment.eniId())
                .trafficType("ACCEPT")
                .vpcId(vpc.vpcId())
                .flowLogDescription("this is a testing flow log")
                .cloudLogId(topic.clsTopicId())
                .storageType("cls")
                .tags(Map.of("createBy", "Terraform"))
                .build());
    
        }
    }
    
    resources:
      logset:
        type: tencentcloud:ClsLogset
        properties:
          logsetName: logset
          tags:
            createBy: Terraform
      topic:
        type: tencentcloud:ClsTopic
        properties:
          topicName: topic
          logsetId: ${logset.clsLogsetId}
          autoSplit: false
          maxSplitPartitions: 20
          partitionCount: 1
          period: 10
          storageType: hot
          tags:
            createBy: Terraform
      vpc:
        type: tencentcloud:Vpc
        properties:
          name: vpc
          cidrBlock: 10.0.0.0/16
      subnet:
        type: tencentcloud:Subnet
        properties:
          availabilityZone: ${zones.zones[0].name}
          name: subnet
          vpcId: ${vpc.vpcId}
          cidrBlock: 10.0.0.0/16
          isMulticast: false
      example:
        type: tencentcloud:Eni
        properties:
          name: tf-example
          vpcId: ${vpc.vpcId}
          subnetId: ${subnet.subnetId}
          description: eni desc
          ipv4Count: 1
      exampleInstance:
        type: tencentcloud:Instance
        name: example
        properties:
          instanceName: tf-example
          availabilityZone: ${zones.zones[0].name}
          imageId: ${image.images[0].imageId}
          instanceType: ${instanceTypes.instanceTypes[0].instanceType}
          systemDiskType: CLOUD_PREMIUM
          disableSecurityService: true
          disableMonitorService: true
          vpcId: ${vpc.vpcId}
          subnetId: ${subnet.subnetId}
      exampleEniAttachment:
        type: tencentcloud:EniAttachment
        name: example
        properties:
          eniId: ${example.eniId}
          instanceId: ${exampleInstance.instanceId}
      exampleVpcFlowLog:
        type: tencentcloud:VpcFlowLog
        name: example
        properties:
          flowLogName: tf-example
          resourceType: NETWORKINTERFACE
          resourceId: ${exampleEniAttachment.eniId}
          trafficType: ACCEPT
          vpcId: ${vpc.vpcId}
          flowLogDescription: this is a testing flow log
          cloudLogId: ${topic.clsTopicId}
          storageType: cls
          tags:
            createBy: Terraform
    variables:
      zones:
        fn::invoke:
          function: tencentcloud:getAvailabilityZones
          arguments: {}
      image:
        fn::invoke:
          function: tencentcloud:getImages
          arguments:
            imageTypes:
              - PUBLIC_IMAGE
            imageNameRegex: Final
      instanceTypes:
        fn::invoke:
          function: tencentcloud:getInstanceTypes
          arguments:
            filters:
              - name: zone
                values:
                  - ${zones.zones[0].name}
              - name: instance-family
                values:
                  - S5
            cpuCoreCount: 2
            excludeSoldOut: true
    

    Create VpcFlowLog Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VpcFlowLog(name: string, args: VpcFlowLogArgs, opts?: CustomResourceOptions);
    @overload
    def VpcFlowLog(resource_name: str,
                   args: VpcFlowLogArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcFlowLog(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   flow_log_name: Optional[str] = None,
                   resource_id: Optional[str] = None,
                   resource_type: Optional[str] = None,
                   traffic_type: Optional[str] = None,
                   cloud_log_id: Optional[str] = None,
                   cloud_log_region: Optional[str] = None,
                   flow_log_description: Optional[str] = None,
                   flow_log_storage: Optional[VpcFlowLogFlowLogStorageArgs] = None,
                   storage_type: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = None,
                   vpc_flow_log_id: Optional[str] = None,
                   vpc_id: Optional[str] = None)
    func NewVpcFlowLog(ctx *Context, name string, args VpcFlowLogArgs, opts ...ResourceOption) (*VpcFlowLog, error)
    public VpcFlowLog(string name, VpcFlowLogArgs args, CustomResourceOptions? opts = null)
    public VpcFlowLog(String name, VpcFlowLogArgs args)
    public VpcFlowLog(String name, VpcFlowLogArgs args, CustomResourceOptions options)
    
    type: tencentcloud:VpcFlowLog
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VpcFlowLogArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args VpcFlowLogArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args VpcFlowLogArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcFlowLogArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcFlowLogArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    VpcFlowLog Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The VpcFlowLog resource accepts the following input properties:

    FlowLogName string
    The name of the flow log instance.
    ResourceId string
    The unique ID of the resource.
    ResourceType string
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    TrafficType string
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    CloudLogId string
    The storage ID of the flow log.
    CloudLogRegion string
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    FlowLogDescription string
    The description of the flow log.
    FlowLogStorage VpcFlowLogFlowLogStorage
    Information of the flow log consumer, required while storage_type is ckafka.
    StorageType string
    Consumer types: cls and ckafka.
    Tags Dictionary<string, string>
    Tag description list.
    VpcFlowLogId string
    ID of the resource.
    VpcId string
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    FlowLogName string
    The name of the flow log instance.
    ResourceId string
    The unique ID of the resource.
    ResourceType string
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    TrafficType string
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    CloudLogId string
    The storage ID of the flow log.
    CloudLogRegion string
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    FlowLogDescription string
    The description of the flow log.
    FlowLogStorage VpcFlowLogFlowLogStorageArgs
    Information of the flow log consumer, required while storage_type is ckafka.
    StorageType string
    Consumer types: cls and ckafka.
    Tags map[string]string
    Tag description list.
    VpcFlowLogId string
    ID of the resource.
    VpcId string
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    flowLogName String
    The name of the flow log instance.
    resourceId String
    The unique ID of the resource.
    resourceType String
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    trafficType String
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    cloudLogId String
    The storage ID of the flow log.
    cloudLogRegion String
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    flowLogDescription String
    The description of the flow log.
    flowLogStorage VpcFlowLogFlowLogStorage
    Information of the flow log consumer, required while storage_type is ckafka.
    storageType String
    Consumer types: cls and ckafka.
    tags Map<String,String>
    Tag description list.
    vpcFlowLogId String
    ID of the resource.
    vpcId String
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    flowLogName string
    The name of the flow log instance.
    resourceId string
    The unique ID of the resource.
    resourceType string
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    trafficType string
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    cloudLogId string
    The storage ID of the flow log.
    cloudLogRegion string
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    flowLogDescription string
    The description of the flow log.
    flowLogStorage VpcFlowLogFlowLogStorage
    Information of the flow log consumer, required while storage_type is ckafka.
    storageType string
    Consumer types: cls and ckafka.
    tags {[key: string]: string}
    Tag description list.
    vpcFlowLogId string
    ID of the resource.
    vpcId string
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    flow_log_name str
    The name of the flow log instance.
    resource_id str
    The unique ID of the resource.
    resource_type str
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    traffic_type str
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    cloud_log_id str
    The storage ID of the flow log.
    cloud_log_region str
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    flow_log_description str
    The description of the flow log.
    flow_log_storage VpcFlowLogFlowLogStorageArgs
    Information of the flow log consumer, required while storage_type is ckafka.
    storage_type str
    Consumer types: cls and ckafka.
    tags Mapping[str, str]
    Tag description list.
    vpc_flow_log_id str
    ID of the resource.
    vpc_id str
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    flowLogName String
    The name of the flow log instance.
    resourceId String
    The unique ID of the resource.
    resourceType String
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    trafficType String
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    cloudLogId String
    The storage ID of the flow log.
    cloudLogRegion String
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    flowLogDescription String
    The description of the flow log.
    flowLogStorage Property Map
    Information of the flow log consumer, required while storage_type is ckafka.
    storageType String
    Consumer types: cls and ckafka.
    tags Map<String>
    Tag description list.
    vpcFlowLogId String
    ID of the resource.
    vpcId String
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VpcFlowLog resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing VpcFlowLog Resource

    Get an existing VpcFlowLog resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: VpcFlowLogState, opts?: CustomResourceOptions): VpcFlowLog
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cloud_log_id: Optional[str] = None,
            cloud_log_region: Optional[str] = None,
            flow_log_description: Optional[str] = None,
            flow_log_name: Optional[str] = None,
            flow_log_storage: Optional[VpcFlowLogFlowLogStorageArgs] = None,
            resource_id: Optional[str] = None,
            resource_type: Optional[str] = None,
            storage_type: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            traffic_type: Optional[str] = None,
            vpc_flow_log_id: Optional[str] = None,
            vpc_id: Optional[str] = None) -> VpcFlowLog
    func GetVpcFlowLog(ctx *Context, name string, id IDInput, state *VpcFlowLogState, opts ...ResourceOption) (*VpcFlowLog, error)
    public static VpcFlowLog Get(string name, Input<string> id, VpcFlowLogState? state, CustomResourceOptions? opts = null)
    public static VpcFlowLog get(String name, Output<String> id, VpcFlowLogState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:VpcFlowLog    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CloudLogId string
    The storage ID of the flow log.
    CloudLogRegion string
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    FlowLogDescription string
    The description of the flow log.
    FlowLogName string
    The name of the flow log instance.
    FlowLogStorage VpcFlowLogFlowLogStorage
    Information of the flow log consumer, required while storage_type is ckafka.
    ResourceId string
    The unique ID of the resource.
    ResourceType string
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    StorageType string
    Consumer types: cls and ckafka.
    Tags Dictionary<string, string>
    Tag description list.
    TrafficType string
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    VpcFlowLogId string
    ID of the resource.
    VpcId string
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    CloudLogId string
    The storage ID of the flow log.
    CloudLogRegion string
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    FlowLogDescription string
    The description of the flow log.
    FlowLogName string
    The name of the flow log instance.
    FlowLogStorage VpcFlowLogFlowLogStorageArgs
    Information of the flow log consumer, required while storage_type is ckafka.
    ResourceId string
    The unique ID of the resource.
    ResourceType string
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    StorageType string
    Consumer types: cls and ckafka.
    Tags map[string]string
    Tag description list.
    TrafficType string
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    VpcFlowLogId string
    ID of the resource.
    VpcId string
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    cloudLogId String
    The storage ID of the flow log.
    cloudLogRegion String
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    flowLogDescription String
    The description of the flow log.
    flowLogName String
    The name of the flow log instance.
    flowLogStorage VpcFlowLogFlowLogStorage
    Information of the flow log consumer, required while storage_type is ckafka.
    resourceId String
    The unique ID of the resource.
    resourceType String
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    storageType String
    Consumer types: cls and ckafka.
    tags Map<String,String>
    Tag description list.
    trafficType String
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    vpcFlowLogId String
    ID of the resource.
    vpcId String
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    cloudLogId string
    The storage ID of the flow log.
    cloudLogRegion string
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    flowLogDescription string
    The description of the flow log.
    flowLogName string
    The name of the flow log instance.
    flowLogStorage VpcFlowLogFlowLogStorage
    Information of the flow log consumer, required while storage_type is ckafka.
    resourceId string
    The unique ID of the resource.
    resourceType string
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    storageType string
    Consumer types: cls and ckafka.
    tags {[key: string]: string}
    Tag description list.
    trafficType string
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    vpcFlowLogId string
    ID of the resource.
    vpcId string
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    cloud_log_id str
    The storage ID of the flow log.
    cloud_log_region str
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    flow_log_description str
    The description of the flow log.
    flow_log_name str
    The name of the flow log instance.
    flow_log_storage VpcFlowLogFlowLogStorageArgs
    Information of the flow log consumer, required while storage_type is ckafka.
    resource_id str
    The unique ID of the resource.
    resource_type str
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    storage_type str
    Consumer types: cls and ckafka.
    tags Mapping[str, str]
    Tag description list.
    traffic_type str
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    vpc_flow_log_id str
    ID of the resource.
    vpc_id str
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.
    cloudLogId String
    The storage ID of the flow log.
    cloudLogRegion String
    The region corresponding to the flow log storage ID. If not passed in, this field defaults to the current region.
    flowLogDescription String
    The description of the flow log.
    flowLogName String
    The name of the flow log instance.
    flowLogStorage Property Map
    Information of the flow log consumer, required while storage_type is ckafka.
    resourceId String
    The unique ID of the resource.
    resourceType String
    The type of resource associated with the flow log. Valid values: VPC, SUBNET, NETWORKINTERFACE, CCN, NAT, and DCG.
    storageType String
    Consumer types: cls and ckafka.
    tags Map<String>
    Tag description list.
    trafficType String
    Type of the flow logs to be collected. Valid values: ACCEPT, REJECT and ALL.
    vpcFlowLogId String
    ID of the resource.
    vpcId String
    The VPC ID or unique ID of the resource. We recommend using the unique ID. This parameter is required unless the ResourceType is set to CCN.

    Supporting Types

    VpcFlowLogFlowLogStorage, VpcFlowLogFlowLogStorageArgs

    StorageId string
    Storage instance ID, required while storage_type is ckafka.
    StorageTopic string
    Topic ID, required while storage_type is ckafka.
    StorageId string
    Storage instance ID, required while storage_type is ckafka.
    StorageTopic string
    Topic ID, required while storage_type is ckafka.
    storageId String
    Storage instance ID, required while storage_type is ckafka.
    storageTopic String
    Topic ID, required while storage_type is ckafka.
    storageId string
    Storage instance ID, required while storage_type is ckafka.
    storageTopic string
    Topic ID, required while storage_type is ckafka.
    storage_id str
    Storage instance ID, required while storage_type is ckafka.
    storage_topic str
    Topic ID, required while storage_type is ckafka.
    storageId String
    Storage instance ID, required while storage_type is ckafka.
    storageTopic String
    Topic ID, required while storage_type is ckafka.

    Import

    vpc flow_log can be imported using the flow log Id combine vpc Id, e.g.

    $ pulumi import tencentcloud:index/vpcFlowLog:VpcFlowLog example fl-7k59x22l#vpc-n6qjlen5
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.82.35 published on Friday, Nov 7, 2025 by tencentcloudstack
      Meet Neo: Your AI Platform Teammate