1. Packages
  2. Volcengine
  3. API Docs
  4. vpc
  5. FlowLogActive
Volcengine v0.0.34 published on Wednesday, Jul 2, 2025 by Volcengine

volcengine.vpc.FlowLogActive

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.34 published on Wednesday, Jul 2, 2025 by Volcengine

    Provides a resource to manage flow log active

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooZones = volcengine.ecs.getZones({});
    const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
        vpcName: "acc-test-vpc",
        cidrBlock: "172.16.0.0/16",
        projectName: "default",
    });
    const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
        subnetName: "acc-test-subnet",
        cidrBlock: "172.16.0.0/24",
        zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
        vpcId: fooVpc.id,
    });
    const fooFlowLog = new volcengine.vpc.FlowLog("fooFlowLog", {
        flowLogName: "acc-test-flow-log",
        description: "acc-test",
        resourceType: "subnet",
        resourceId: fooSubnet.id,
        trafficType: "All",
        logProjectName: "acc-test-project",
        logTopicName: "acc-test-topic",
        aggregationInterval: 10,
        projectName: "default",
        tags: [{
            key: "k1",
            value: "v1",
        }],
    });
    const fooFlowLogActive = new volcengine.vpc.FlowLogActive("fooFlowLogActive", {flowLogId: fooFlowLog.id});
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_zones = volcengine.ecs.get_zones()
    foo_vpc = volcengine.vpc.Vpc("fooVpc",
        vpc_name="acc-test-vpc",
        cidr_block="172.16.0.0/16",
        project_name="default")
    foo_subnet = volcengine.vpc.Subnet("fooSubnet",
        subnet_name="acc-test-subnet",
        cidr_block="172.16.0.0/24",
        zone_id=foo_zones.zones[0].id,
        vpc_id=foo_vpc.id)
    foo_flow_log = volcengine.vpc.FlowLog("fooFlowLog",
        flow_log_name="acc-test-flow-log",
        description="acc-test",
        resource_type="subnet",
        resource_id=foo_subnet.id,
        traffic_type="All",
        log_project_name="acc-test-project",
        log_topic_name="acc-test-topic",
        aggregation_interval=10,
        project_name="default",
        tags=[volcengine.vpc.FlowLogTagArgs(
            key="k1",
            value="v1",
        )])
    foo_flow_log_active = volcengine.vpc.FlowLogActive("fooFlowLogActive", flow_log_id=foo_flow_log.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooZones, err := ecs.GetZones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
    			VpcName:     pulumi.String("acc-test-vpc"),
    			CidrBlock:   pulumi.String("172.16.0.0/16"),
    			ProjectName: pulumi.String("default"),
    		})
    		if err != nil {
    			return err
    		}
    		fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
    			SubnetName: pulumi.String("acc-test-subnet"),
    			CidrBlock:  pulumi.String("172.16.0.0/24"),
    			ZoneId:     pulumi.String(fooZones.Zones[0].Id),
    			VpcId:      fooVpc.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		fooFlowLog, err := vpc.NewFlowLog(ctx, "fooFlowLog", &vpc.FlowLogArgs{
    			FlowLogName:         pulumi.String("acc-test-flow-log"),
    			Description:         pulumi.String("acc-test"),
    			ResourceType:        pulumi.String("subnet"),
    			ResourceId:          fooSubnet.ID(),
    			TrafficType:         pulumi.String("All"),
    			LogProjectName:      pulumi.String("acc-test-project"),
    			LogTopicName:        pulumi.String("acc-test-topic"),
    			AggregationInterval: pulumi.Int(10),
    			ProjectName:         pulumi.String("default"),
    			Tags: vpc.FlowLogTagArray{
    				&vpc.FlowLogTagArgs{
    					Key:   pulumi.String("k1"),
    					Value: pulumi.String("v1"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewFlowLogActive(ctx, "fooFlowLogActive", &vpc.FlowLogActiveArgs{
    			FlowLogId: fooFlowLog.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooZones = Volcengine.Ecs.GetZones.Invoke();
    
        var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
        {
            VpcName = "acc-test-vpc",
            CidrBlock = "172.16.0.0/16",
            ProjectName = "default",
        });
    
        var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
        {
            SubnetName = "acc-test-subnet",
            CidrBlock = "172.16.0.0/24",
            ZoneId = fooZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            VpcId = fooVpc.Id,
        });
    
        var fooFlowLog = new Volcengine.Vpc.FlowLog("fooFlowLog", new()
        {
            FlowLogName = "acc-test-flow-log",
            Description = "acc-test",
            ResourceType = "subnet",
            ResourceId = fooSubnet.Id,
            TrafficType = "All",
            LogProjectName = "acc-test-project",
            LogTopicName = "acc-test-topic",
            AggregationInterval = 10,
            ProjectName = "default",
            Tags = new[]
            {
                new Volcengine.Vpc.Inputs.FlowLogTagArgs
                {
                    Key = "k1",
                    Value = "v1",
                },
            },
        });
    
        var fooFlowLogActive = new Volcengine.Vpc.FlowLogActive("fooFlowLogActive", new()
        {
            FlowLogId = fooFlowLog.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.ecs.EcsFunctions;
    import com.pulumi.volcengine.ecs.inputs.GetZonesArgs;
    import com.pulumi.volcengine.vpc.Vpc;
    import com.pulumi.volcengine.vpc.VpcArgs;
    import com.pulumi.volcengine.vpc.Subnet;
    import com.pulumi.volcengine.vpc.SubnetArgs;
    import com.pulumi.volcengine.vpc.FlowLog;
    import com.pulumi.volcengine.vpc.FlowLogArgs;
    import com.pulumi.volcengine.vpc.inputs.FlowLogTagArgs;
    import com.pulumi.volcengine.vpc.FlowLogActive;
    import com.pulumi.volcengine.vpc.FlowLogActiveArgs;
    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 fooZones = EcsFunctions.getZones();
    
            var fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
                .vpcName("acc-test-vpc")
                .cidrBlock("172.16.0.0/16")
                .projectName("default")
                .build());
    
            var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()        
                .subnetName("acc-test-subnet")
                .cidrBlock("172.16.0.0/24")
                .zoneId(fooZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .vpcId(fooVpc.id())
                .build());
    
            var fooFlowLog = new FlowLog("fooFlowLog", FlowLogArgs.builder()        
                .flowLogName("acc-test-flow-log")
                .description("acc-test")
                .resourceType("subnet")
                .resourceId(fooSubnet.id())
                .trafficType("All")
                .logProjectName("acc-test-project")
                .logTopicName("acc-test-topic")
                .aggregationInterval(10)
                .projectName("default")
                .tags(FlowLogTagArgs.builder()
                    .key("k1")
                    .value("v1")
                    .build())
                .build());
    
            var fooFlowLogActive = new FlowLogActive("fooFlowLogActive", FlowLogActiveArgs.builder()        
                .flowLogId(fooFlowLog.id())
                .build());
    
        }
    }
    
    resources:
      fooVpc:
        type: volcengine:vpc:Vpc
        properties:
          vpcName: acc-test-vpc
          cidrBlock: 172.16.0.0/16
          projectName: default
      fooSubnet:
        type: volcengine:vpc:Subnet
        properties:
          subnetName: acc-test-subnet
          cidrBlock: 172.16.0.0/24
          zoneId: ${fooZones.zones[0].id}
          vpcId: ${fooVpc.id}
      fooFlowLog:
        type: volcengine:vpc:FlowLog
        properties:
          flowLogName: acc-test-flow-log
          description: acc-test
          resourceType: subnet
          resourceId: ${fooSubnet.id}
          trafficType: All
          logProjectName: acc-test-project
          logTopicName: acc-test-topic
          aggregationInterval: 10
          projectName: default
          tags:
            - key: k1
              value: v1
      fooFlowLogActive:
        type: volcengine:vpc:FlowLogActive
        properties:
          flowLogId: ${fooFlowLog.id}
    variables:
      fooZones:
        fn::invoke:
          Function: volcengine:ecs:getZones
          Arguments: {}
    

    Create FlowLogActive Resource

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

    Constructor syntax

    new FlowLogActive(name: string, args: FlowLogActiveArgs, opts?: CustomResourceOptions);
    @overload
    def FlowLogActive(resource_name: str,
                      args: FlowLogActiveArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def FlowLogActive(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      flow_log_id: Optional[str] = None)
    func NewFlowLogActive(ctx *Context, name string, args FlowLogActiveArgs, opts ...ResourceOption) (*FlowLogActive, error)
    public FlowLogActive(string name, FlowLogActiveArgs args, CustomResourceOptions? opts = null)
    public FlowLogActive(String name, FlowLogActiveArgs args)
    public FlowLogActive(String name, FlowLogActiveArgs args, CustomResourceOptions options)
    
    type: volcengine:vpc:FlowLogActive
    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 FlowLogActiveArgs
    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 FlowLogActiveArgs
    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 FlowLogActiveArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FlowLogActiveArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FlowLogActiveArgs
    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 flowLogActiveResource = new Volcengine.Vpc.FlowLogActive("flowLogActiveResource", new()
    {
        FlowLogId = "string",
    });
    
    example, err := vpc.NewFlowLogActive(ctx, "flowLogActiveResource", &vpc.FlowLogActiveArgs{
    	FlowLogId: pulumi.String("string"),
    })
    
    var flowLogActiveResource = new FlowLogActive("flowLogActiveResource", FlowLogActiveArgs.builder()
        .flowLogId("string")
        .build());
    
    flow_log_active_resource = volcengine.vpc.FlowLogActive("flowLogActiveResource", flow_log_id="string")
    
    const flowLogActiveResource = new volcengine.vpc.FlowLogActive("flowLogActiveResource", {flowLogId: "string"});
    
    type: volcengine:vpc:FlowLogActive
    properties:
        flowLogId: string
    

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

    FlowLogId string
    The ID of flow log.
    FlowLogId string
    The ID of flow log.
    flowLogId String
    The ID of flow log.
    flowLogId string
    The ID of flow log.
    flow_log_id str
    The ID of flow log.
    flowLogId String
    The ID of flow log.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of flow log.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of flow log.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of flow log.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of flow log.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of flow log.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of flow log.

    Look up Existing FlowLogActive Resource

    Get an existing FlowLogActive 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?: FlowLogActiveState, opts?: CustomResourceOptions): FlowLogActive
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            flow_log_id: Optional[str] = None,
            status: Optional[str] = None) -> FlowLogActive
    func GetFlowLogActive(ctx *Context, name string, id IDInput, state *FlowLogActiveState, opts ...ResourceOption) (*FlowLogActive, error)
    public static FlowLogActive Get(string name, Input<string> id, FlowLogActiveState? state, CustomResourceOptions? opts = null)
    public static FlowLogActive get(String name, Output<String> id, FlowLogActiveState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:vpc:FlowLogActive    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:
    FlowLogId string
    The ID of flow log.
    Status string
    The status of flow log.
    FlowLogId string
    The ID of flow log.
    Status string
    The status of flow log.
    flowLogId String
    The ID of flow log.
    status String
    The status of flow log.
    flowLogId string
    The ID of flow log.
    status string
    The status of flow log.
    flow_log_id str
    The ID of flow log.
    status str
    The status of flow log.
    flowLogId String
    The ID of flow log.
    status String
    The status of flow log.

    Import

    FlowLogActive can be imported using the id, e.g.

    $ pulumi import volcengine:vpc/flowLogActive:FlowLogActive default resource_id
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.34 published on Wednesday, Jul 2, 2025 by Volcengine