1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. FlowLog
Alibaba Cloud v3.86.1 published on Saturday, Sep 27, 2025 by Pulumi

alicloud.vpc.FlowLog

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.86.1 published on Saturday, Sep 27, 2025 by Pulumi

    Provides a VPC Flow Log resource.

    While it uses alicloud.vpc.FlowLog to build a vpc flow log resource, it will be active by default.

    For information about VPC Flow Log and how to use it, see What is Flow Log.

    NOTE: Available since v1.117.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    import * as std from "@pulumi/std";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf-example";
    const _default = alicloud.resourcemanager.getResourceGroups({
        status: "OK",
    });
    const example = new alicloud.vpc.Network("example", {
        vpcName: name,
        cidrBlock: "10.4.0.0/16",
    });
    const exampleUuid = new random.index.Uuid("example", {});
    const exampleProject = new alicloud.log.Project("example", {
        projectName: std.replace({
            text: exampleUuid.result,
            search: "-",
            replace: "",
        }).then(invoke => std.substr({
            input: `tf-example-${invoke.result}`,
            offset: 0,
            length: 16,
        })).then(invoke => invoke.result),
        description: name,
    });
    const exampleStore = new alicloud.log.Store("example", {
        projectName: exampleProject.projectName,
        logstoreName: name,
        shardCount: 3,
        autoSplit: true,
        maxSplitShardCount: 60,
        appendMeta: true,
    });
    const exampleFlowLog = new alicloud.vpc.FlowLog("example", {
        flowLogName: name,
        logStoreName: exampleStore.logstoreName,
        description: name,
        trafficPaths: ["all"],
        projectName: exampleProject.projectName,
        resourceType: "VPC",
        resourceGroupId: _default.then(_default => _default.ids?.[0]),
        resourceId: example.id,
        aggregationInterval: "1",
        trafficType: "All",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    import pulumi_std as std
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.resourcemanager.get_resource_groups(status="OK")
    example = alicloud.vpc.Network("example",
        vpc_name=name,
        cidr_block="10.4.0.0/16")
    example_uuid = random.index.Uuid("example")
    example_project = alicloud.log.Project("example",
        project_name=std.substr(input=f"tf-example-{std.replace(text=example_uuid['result'],
                search='-',
                replace='').result}",
            offset=0,
            length=16).result,
        description=name)
    example_store = alicloud.log.Store("example",
        project_name=example_project.project_name,
        logstore_name=name,
        shard_count=3,
        auto_split=True,
        max_split_shard_count=60,
        append_meta=True)
    example_flow_log = alicloud.vpc.FlowLog("example",
        flow_log_name=name,
        log_store_name=example_store.logstore_name,
        description=name,
        traffic_paths=["all"],
        project_name=example_project.project_name,
        resource_type="VPC",
        resource_group_id=default.ids[0],
        resource_id=example.id,
        aggregation_interval="1",
        traffic_type="All")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi-std/sdk/go/std"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := resourcemanager.GetResourceGroups(ctx, &resourcemanager.GetResourceGroupsArgs{
    			Status: pulumi.StringRef("OK"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		example, err := vpc.NewNetwork(ctx, "example", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(name),
    			CidrBlock: pulumi.String("10.4.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleUuid, err := random.NewUuid(ctx, "example", nil)
    		if err != nil {
    			return err
    		}
    		invokeSubstr, err := std.Substr(ctx, &std.SubstrArgs{
    			Input: fmt.Sprintf("tf-example-%v", std.Replace(ctx, &std.ReplaceArgs{
    				Text:    exampleUuid.Result,
    				Search:  "-",
    				Replace: "",
    			}, nil).Result),
    			Offset: 0,
    			Length: 16,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleProject, err := log.NewProject(ctx, "example", &log.ProjectArgs{
    			ProjectName: pulumi.String(invokeSubstr.Result),
    			Description: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		exampleStore, err := log.NewStore(ctx, "example", &log.StoreArgs{
    			ProjectName:        exampleProject.ProjectName,
    			LogstoreName:       pulumi.String(name),
    			ShardCount:         pulumi.Int(3),
    			AutoSplit:          pulumi.Bool(true),
    			MaxSplitShardCount: pulumi.Int(60),
    			AppendMeta:         pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewFlowLog(ctx, "example", &vpc.FlowLogArgs{
    			FlowLogName:  pulumi.String(name),
    			LogStoreName: exampleStore.LogstoreName,
    			Description:  pulumi.String(name),
    			TrafficPaths: pulumi.StringArray{
    				pulumi.String("all"),
    			},
    			ProjectName:         exampleProject.ProjectName,
    			ResourceType:        pulumi.String("VPC"),
    			ResourceGroupId:     pulumi.String(_default.Ids[0]),
    			ResourceId:          example.ID(),
    			AggregationInterval: pulumi.String("1"),
    			TrafficType:         pulumi.String("All"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tf-example";
        var @default = AliCloud.ResourceManager.GetResourceGroups.Invoke(new()
        {
            Status = "OK",
        });
    
        var example = new AliCloud.Vpc.Network("example", new()
        {
            VpcName = name,
            CidrBlock = "10.4.0.0/16",
        });
    
        var exampleUuid = new Random.Index.Uuid("example");
    
        var exampleProject = new AliCloud.Log.Project("example", new()
        {
            ProjectName = Std.Replace.Invoke(new()
            {
                Text = exampleUuid.Result,
                Search = "-",
                Replace = "",
            }).Apply(invoke => Std.Substr.Invoke(new()
            {
                Input = $"tf-example-{invoke.Result}",
                Offset = 0,
                Length = 16,
            })).Apply(invoke => invoke.Result),
            Description = name,
        });
    
        var exampleStore = new AliCloud.Log.Store("example", new()
        {
            ProjectName = exampleProject.ProjectName,
            LogstoreName = name,
            ShardCount = 3,
            AutoSplit = true,
            MaxSplitShardCount = 60,
            AppendMeta = true,
        });
    
        var exampleFlowLog = new AliCloud.Vpc.FlowLog("example", new()
        {
            FlowLogName = name,
            LogStoreName = exampleStore.LogstoreName,
            Description = name,
            TrafficPaths = new[]
            {
                "all",
            },
            ProjectName = exampleProject.ProjectName,
            ResourceType = "VPC",
            ResourceGroupId = @default.Apply(@default => @default.Apply(getResourceGroupsResult => getResourceGroupsResult.Ids[0])),
            ResourceId = example.Id,
            AggregationInterval = "1",
            TrafficType = "All",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.resourcemanager.ResourcemanagerFunctions;
    import com.pulumi.alicloud.resourcemanager.inputs.GetResourceGroupsArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.random.Uuid;
    import com.pulumi.alicloud.log.Project;
    import com.pulumi.alicloud.log.ProjectArgs;
    import com.pulumi.std.StdFunctions;
    import com.pulumi.std.inputs.ReplaceArgs;
    import com.pulumi.std.inputs.SubstrArgs;
    import com.pulumi.alicloud.log.Store;
    import com.pulumi.alicloud.log.StoreArgs;
    import com.pulumi.alicloud.vpc.FlowLog;
    import com.pulumi.alicloud.vpc.FlowLogArgs;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            final var default = ResourcemanagerFunctions.getResourceGroups(GetResourceGroupsArgs.builder()
                .status("OK")
                .build());
    
            var example = new Network("example", NetworkArgs.builder()
                .vpcName(name)
                .cidrBlock("10.4.0.0/16")
                .build());
    
            var exampleUuid = new Uuid("exampleUuid");
    
            var exampleProject = new Project("exampleProject", ProjectArgs.builder()
                .projectName(StdFunctions.substr(SubstrArgs.builder()
                    .input(String.format("tf-example-%s", StdFunctions.replace(ReplaceArgs.builder()
                        .text(exampleUuid.result())
                        .search("-")
                        .replace("")
                        .build()).result()))
                    .offset(0)
                    .length(16)
                    .build()).result())
                .description(name)
                .build());
    
            var exampleStore = new Store("exampleStore", StoreArgs.builder()
                .projectName(exampleProject.projectName())
                .logstoreName(name)
                .shardCount(3)
                .autoSplit(true)
                .maxSplitShardCount(60)
                .appendMeta(true)
                .build());
    
            var exampleFlowLog = new FlowLog("exampleFlowLog", FlowLogArgs.builder()
                .flowLogName(name)
                .logStoreName(exampleStore.logstoreName())
                .description(name)
                .trafficPaths("all")
                .projectName(exampleProject.projectName())
                .resourceType("VPC")
                .resourceGroupId(default_.ids()[0])
                .resourceId(example.id())
                .aggregationInterval("1")
                .trafficType("All")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      example:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${name}
          cidrBlock: 10.4.0.0/16
      exampleUuid:
        type: random:Uuid
        name: example
      exampleProject:
        type: alicloud:log:Project
        name: example
        properties:
          projectName:
            fn::invoke:
              function: std:substr
              arguments:
                input:
                  fn::join:
                    - ""
                    - - tf-example-
                      - fn::invoke:
                          function: std:replace
                          arguments:
                            text: ${exampleUuid.result}
                            search: '-'
                            replace: ""
                          return: result
                offset: 0
                length: 16
              return: result
          description: ${name}
      exampleStore:
        type: alicloud:log:Store
        name: example
        properties:
          projectName: ${exampleProject.projectName}
          logstoreName: ${name}
          shardCount: 3
          autoSplit: true
          maxSplitShardCount: 60
          appendMeta: true
      exampleFlowLog:
        type: alicloud:vpc:FlowLog
        name: example
        properties:
          flowLogName: ${name}
          logStoreName: ${exampleStore.logstoreName}
          description: ${name}
          trafficPaths:
            - all
          projectName: ${exampleProject.projectName}
          resourceType: VPC
          resourceGroupId: ${default.ids[0]}
          resourceId: ${example.id}
          aggregationInterval: '1'
          trafficType: All
    variables:
      default:
        fn::invoke:
          function: alicloud:resourcemanager:getResourceGroups
          arguments:
            status: OK
    

    Create FlowLog Resource

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

    Constructor syntax

    new FlowLog(name: string, args: FlowLogArgs, opts?: CustomResourceOptions);
    @overload
    def FlowLog(resource_name: str,
                args: FlowLogArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def FlowLog(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                project_name: Optional[str] = None,
                traffic_type: Optional[str] = None,
                resource_type: Optional[str] = None,
                resource_id: Optional[str] = None,
                log_store_name: Optional[str] = None,
                resource_group_id: Optional[str] = None,
                aggregation_interval: Optional[str] = None,
                ip_version: Optional[str] = None,
                flow_log_name: Optional[str] = None,
                status: Optional[str] = None,
                tags: Optional[Mapping[str, str]] = None,
                traffic_paths: Optional[Sequence[str]] = None,
                description: Optional[str] = None)
    func NewFlowLog(ctx *Context, name string, args FlowLogArgs, opts ...ResourceOption) (*FlowLog, error)
    public FlowLog(string name, FlowLogArgs args, CustomResourceOptions? opts = null)
    public FlowLog(String name, FlowLogArgs args)
    public FlowLog(String name, FlowLogArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:FlowLog
    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 FlowLogArgs
    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 FlowLogArgs
    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 FlowLogArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FlowLogArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FlowLogArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var alicloudFlowLogResource = new AliCloud.Vpc.FlowLog("alicloudFlowLogResource", new()
    {
        ProjectName = "string",
        TrafficType = "string",
        ResourceType = "string",
        ResourceId = "string",
        LogStoreName = "string",
        ResourceGroupId = "string",
        AggregationInterval = "string",
        IpVersion = "string",
        FlowLogName = "string",
        Status = "string",
        Tags = 
        {
            { "string", "string" },
        },
        TrafficPaths = new[]
        {
            "string",
        },
        Description = "string",
    });
    
    example, err := vpc.NewFlowLog(ctx, "alicloudFlowLogResource", &vpc.FlowLogArgs{
    	ProjectName:         pulumi.String("string"),
    	TrafficType:         pulumi.String("string"),
    	ResourceType:        pulumi.String("string"),
    	ResourceId:          pulumi.String("string"),
    	LogStoreName:        pulumi.String("string"),
    	ResourceGroupId:     pulumi.String("string"),
    	AggregationInterval: pulumi.String("string"),
    	IpVersion:           pulumi.String("string"),
    	FlowLogName:         pulumi.String("string"),
    	Status:              pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	TrafficPaths: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Description: pulumi.String("string"),
    })
    
    var alicloudFlowLogResource = new com.pulumi.alicloud.vpc.FlowLog("alicloudFlowLogResource", com.pulumi.alicloud.vpc.FlowLogArgs.builder()
        .projectName("string")
        .trafficType("string")
        .resourceType("string")
        .resourceId("string")
        .logStoreName("string")
        .resourceGroupId("string")
        .aggregationInterval("string")
        .ipVersion("string")
        .flowLogName("string")
        .status("string")
        .tags(Map.of("string", "string"))
        .trafficPaths("string")
        .description("string")
        .build());
    
    alicloud_flow_log_resource = alicloud.vpc.FlowLog("alicloudFlowLogResource",
        project_name="string",
        traffic_type="string",
        resource_type="string",
        resource_id="string",
        log_store_name="string",
        resource_group_id="string",
        aggregation_interval="string",
        ip_version="string",
        flow_log_name="string",
        status="string",
        tags={
            "string": "string",
        },
        traffic_paths=["string"],
        description="string")
    
    const alicloudFlowLogResource = new alicloud.vpc.FlowLog("alicloudFlowLogResource", {
        projectName: "string",
        trafficType: "string",
        resourceType: "string",
        resourceId: "string",
        logStoreName: "string",
        resourceGroupId: "string",
        aggregationInterval: "string",
        ipVersion: "string",
        flowLogName: "string",
        status: "string",
        tags: {
            string: "string",
        },
        trafficPaths: ["string"],
        description: "string",
    });
    
    type: alicloud:vpc:FlowLog
    properties:
        aggregationInterval: string
        description: string
        flowLogName: string
        ipVersion: string
        logStoreName: string
        projectName: string
        resourceGroupId: string
        resourceId: string
        resourceType: string
        status: string
        tags:
            string: string
        trafficPaths:
            - string
        trafficType: string
    

    FlowLog 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 FlowLog resource accepts the following input properties:

    LogStoreName string
    The Logstore that stores the captured traffic data.
    ProjectName string
    The project that manages the captured traffic data.
    ResourceId string
    The ID of the resource.
    ResourceType string
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    TrafficType string
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    AggregationInterval string
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    Description string
    The Description of the VPC Flow Log.
    FlowLogName string
    The Name of the VPC Flow Log.
    IpVersion string
    The IP address type of the collected traffic.
    ResourceGroupId string
    The ID of the resource group.
    Status string
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    Tags Dictionary<string, string>
    The tag of the current instance resource.
    TrafficPaths List<string>
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    LogStoreName string
    The Logstore that stores the captured traffic data.
    ProjectName string
    The project that manages the captured traffic data.
    ResourceId string
    The ID of the resource.
    ResourceType string
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    TrafficType string
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    AggregationInterval string
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    Description string
    The Description of the VPC Flow Log.
    FlowLogName string
    The Name of the VPC Flow Log.
    IpVersion string
    The IP address type of the collected traffic.
    ResourceGroupId string
    The ID of the resource group.
    Status string
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    Tags map[string]string
    The tag of the current instance resource.
    TrafficPaths []string
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    logStoreName String
    The Logstore that stores the captured traffic data.
    projectName String
    The project that manages the captured traffic data.
    resourceId String
    The ID of the resource.
    resourceType String
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    trafficType String
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    aggregationInterval String
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    description String
    The Description of the VPC Flow Log.
    flowLogName String
    The Name of the VPC Flow Log.
    ipVersion String
    The IP address type of the collected traffic.
    resourceGroupId String
    The ID of the resource group.
    status String
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    tags Map<String,String>
    The tag of the current instance resource.
    trafficPaths List<String>
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    logStoreName string
    The Logstore that stores the captured traffic data.
    projectName string
    The project that manages the captured traffic data.
    resourceId string
    The ID of the resource.
    resourceType string
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    trafficType string
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    aggregationInterval string
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    description string
    The Description of the VPC Flow Log.
    flowLogName string
    The Name of the VPC Flow Log.
    ipVersion string
    The IP address type of the collected traffic.
    resourceGroupId string
    The ID of the resource group.
    status string
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    tags {[key: string]: string}
    The tag of the current instance resource.
    trafficPaths string[]
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    log_store_name str
    The Logstore that stores the captured traffic data.
    project_name str
    The project that manages the captured traffic data.
    resource_id str
    The ID of the resource.
    resource_type str
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    traffic_type str
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    aggregation_interval str
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    description str
    The Description of the VPC Flow Log.
    flow_log_name str
    The Name of the VPC Flow Log.
    ip_version str
    The IP address type of the collected traffic.
    resource_group_id str
    The ID of the resource group.
    status str
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    tags Mapping[str, str]
    The tag of the current instance resource.
    traffic_paths Sequence[str]
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    logStoreName String
    The Logstore that stores the captured traffic data.
    projectName String
    The project that manages the captured traffic data.
    resourceId String
    The ID of the resource.
    resourceType String
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    trafficType String
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    aggregationInterval String
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    description String
    The Description of the VPC Flow Log.
    flowLogName String
    The Name of the VPC Flow Log.
    ipVersion String
    The IP address type of the collected traffic.
    resourceGroupId String
    The ID of the resource group.
    status String
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    tags Map<String>
    The tag of the current instance resource.
    trafficPaths List<String>
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.

    Outputs

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

    BusinessStatus string
    Business status
    CreateTime string
    Creation time
    FlowLogId string
    The flow log ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    The region ID.
    BusinessStatus string
    Business status
    CreateTime string
    Creation time
    FlowLogId string
    The flow log ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    The region ID.
    businessStatus String
    Business status
    createTime String
    Creation time
    flowLogId String
    The flow log ID.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    The region ID.
    businessStatus string
    Business status
    createTime string
    Creation time
    flowLogId string
    The flow log ID.
    id string
    The provider-assigned unique ID for this managed resource.
    regionId string
    The region ID.
    business_status str
    Business status
    create_time str
    Creation time
    flow_log_id str
    The flow log ID.
    id str
    The provider-assigned unique ID for this managed resource.
    region_id str
    The region ID.
    businessStatus String
    Business status
    createTime String
    Creation time
    flowLogId String
    The flow log ID.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    The region ID.

    Look up Existing FlowLog Resource

    Get an existing FlowLog 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?: FlowLogState, opts?: CustomResourceOptions): FlowLog
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            aggregation_interval: Optional[str] = None,
            business_status: Optional[str] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            flow_log_id: Optional[str] = None,
            flow_log_name: Optional[str] = None,
            ip_version: Optional[str] = None,
            log_store_name: Optional[str] = None,
            project_name: Optional[str] = None,
            region_id: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            resource_id: Optional[str] = None,
            resource_type: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            traffic_paths: Optional[Sequence[str]] = None,
            traffic_type: Optional[str] = None) -> FlowLog
    func GetFlowLog(ctx *Context, name string, id IDInput, state *FlowLogState, opts ...ResourceOption) (*FlowLog, error)
    public static FlowLog Get(string name, Input<string> id, FlowLogState? state, CustomResourceOptions? opts = null)
    public static FlowLog get(String name, Output<String> id, FlowLogState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:vpc:FlowLog    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:
    AggregationInterval string
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    BusinessStatus string
    Business status
    CreateTime string
    Creation time
    Description string
    The Description of the VPC Flow Log.
    FlowLogId string
    The flow log ID.
    FlowLogName string
    The Name of the VPC Flow Log.
    IpVersion string
    The IP address type of the collected traffic.
    LogStoreName string
    The Logstore that stores the captured traffic data.
    ProjectName string
    The project that manages the captured traffic data.
    RegionId string
    The region ID.
    ResourceGroupId string
    The ID of the resource group.
    ResourceId string
    The ID of the resource.
    ResourceType string
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    Status string
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    Tags Dictionary<string, string>
    The tag of the current instance resource.
    TrafficPaths List<string>
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    TrafficType string
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    AggregationInterval string
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    BusinessStatus string
    Business status
    CreateTime string
    Creation time
    Description string
    The Description of the VPC Flow Log.
    FlowLogId string
    The flow log ID.
    FlowLogName string
    The Name of the VPC Flow Log.
    IpVersion string
    The IP address type of the collected traffic.
    LogStoreName string
    The Logstore that stores the captured traffic data.
    ProjectName string
    The project that manages the captured traffic data.
    RegionId string
    The region ID.
    ResourceGroupId string
    The ID of the resource group.
    ResourceId string
    The ID of the resource.
    ResourceType string
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    Status string
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    Tags map[string]string
    The tag of the current instance resource.
    TrafficPaths []string
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    TrafficType string
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    aggregationInterval String
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    businessStatus String
    Business status
    createTime String
    Creation time
    description String
    The Description of the VPC Flow Log.
    flowLogId String
    The flow log ID.
    flowLogName String
    The Name of the VPC Flow Log.
    ipVersion String
    The IP address type of the collected traffic.
    logStoreName String
    The Logstore that stores the captured traffic data.
    projectName String
    The project that manages the captured traffic data.
    regionId String
    The region ID.
    resourceGroupId String
    The ID of the resource group.
    resourceId String
    The ID of the resource.
    resourceType String
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    status String
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    tags Map<String,String>
    The tag of the current instance resource.
    trafficPaths List<String>
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    trafficType String
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    aggregationInterval string
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    businessStatus string
    Business status
    createTime string
    Creation time
    description string
    The Description of the VPC Flow Log.
    flowLogId string
    The flow log ID.
    flowLogName string
    The Name of the VPC Flow Log.
    ipVersion string
    The IP address type of the collected traffic.
    logStoreName string
    The Logstore that stores the captured traffic data.
    projectName string
    The project that manages the captured traffic data.
    regionId string
    The region ID.
    resourceGroupId string
    The ID of the resource group.
    resourceId string
    The ID of the resource.
    resourceType string
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    status string
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    tags {[key: string]: string}
    The tag of the current instance resource.
    trafficPaths string[]
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    trafficType string
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    aggregation_interval str
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    business_status str
    Business status
    create_time str
    Creation time
    description str
    The Description of the VPC Flow Log.
    flow_log_id str
    The flow log ID.
    flow_log_name str
    The Name of the VPC Flow Log.
    ip_version str
    The IP address type of the collected traffic.
    log_store_name str
    The Logstore that stores the captured traffic data.
    project_name str
    The project that manages the captured traffic data.
    region_id str
    The region ID.
    resource_group_id str
    The ID of the resource group.
    resource_id str
    The ID of the resource.
    resource_type str
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    status str
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    tags Mapping[str, str]
    The tag of the current instance resource.
    traffic_paths Sequence[str]
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    traffic_type str
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.
    aggregationInterval String
    The sampling interval of the flow log. Unit: seconds. Valid values: 1, 5, and 10 (default).
    businessStatus String
    Business status
    createTime String
    Creation time
    description String
    The Description of the VPC Flow Log.
    flowLogId String
    The flow log ID.
    flowLogName String
    The Name of the VPC Flow Log.
    ipVersion String
    The IP address type of the collected traffic.
    logStoreName String
    The Logstore that stores the captured traffic data.
    projectName String
    The project that manages the captured traffic data.
    regionId String
    The region ID.
    resourceGroupId String
    The ID of the resource group.
    resourceId String
    The ID of the resource.
    resourceType String
    The resource type of the traffic captured by the flow log:

    • NetworkInterface: ENI.
    • VSwitch: All ENIs in the VSwitch.
    • VPC: All ENIs in the VPC.
    status String
    The status of the VPC Flow Log. Valid values: Active and Inactive.
    tags Map<String>
    The tag of the current instance resource.
    trafficPaths List<String>
    The collected flow path. Value:

    • all*: indicates full acquisition.
    • internetGateway*: indicates public network traffic collection.
    trafficType String
    The type of traffic collected. Valid values:

    • All*: All traffic.
    • Allow*: Access control allowedtraffic.
    • Drop*: Access control denied traffic.

    Import

    VPC Flow Log can be imported using the id, e.g.

    $ pulumi import alicloud:vpc/flowLog:FlowLog example <id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.86.1 published on Saturday, Sep 27, 2025 by Pulumi
      AI Agentic Workflows: Register now