1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. VpcFlowLogConfig
tencentcloud 1.81.182 published on Monday, Apr 14, 2025 by tencentcloudstack

tencentcloud.VpcFlowLogConfig

Explore with Pulumi AI

Provides a resource to create a vpc flow_log_config

Example Usage

If disable FlowLogs

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: "delogsetmo",
    tags: {
        test: "test",
    },
});
const topic = new tencentcloud.ClsTopic("topic", {
    topicName: "topic",
    logsetId: logset.clsLogsetId,
    autoSplit: false,
    maxSplitPartitions: 20,
    partitionCount: 1,
    period: 10,
    storageType: "hot",
    tags: {
        test: "test",
    },
});
const vpc = new tencentcloud.Vpc("vpc", {cidrBlock: "10.0.0.0/16"});
const subnet = new tencentcloud.Subnet("subnet", {
    availabilityZone: zones.then(zones => zones.zones?.[0]?.name),
    vpcId: vpc.vpcId,
    cidrBlock: "10.0.0.0/16",
    isMulticast: false,
});
const exampleEni = new tencentcloud.Eni("exampleEni", {
    vpcId: vpc.vpcId,
    subnetId: subnet.subnetId,
    description: "eni desc",
    ipv4Count: 1,
});
const exampleInstance = new tencentcloud.Instance("exampleInstance", {
    instanceName: "ci-test-eni-attach",
    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("exampleEniAttachment", {
    eniId: exampleEni.eniId,
    instanceId: exampleInstance.instanceId,
});
const exampleVpcFlowLog = new tencentcloud.VpcFlowLog("exampleVpcFlowLog", {
    flowLogName: "tf-example-vpc-flow-log",
    resourceType: "NETWORKINTERFACE",
    resourceId: exampleEniAttachment.eniId,
    trafficType: "ACCEPT",
    vpcId: vpc.vpcId,
    flowLogDescription: "this is a testing flow log",
    cloudLogId: topic.clsTopicId,
    storageType: "cls",
    tags: {
        testKey: "testValue",
    },
});
const config = new tencentcloud.VpcFlowLogConfig("config", {
    flowLogId: exampleVpcFlowLog.vpcFlowLogId,
    enable: false,
});
Copy
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="delogsetmo",
    tags={
        "test": "test",
    })
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={
        "test": "test",
    })
vpc = tencentcloud.Vpc("vpc", cidr_block="10.0.0.0/16")
subnet = tencentcloud.Subnet("subnet",
    availability_zone=zones.zones[0].name,
    vpc_id=vpc.vpc_id,
    cidr_block="10.0.0.0/16",
    is_multicast=False)
example_eni = tencentcloud.Eni("exampleEni",
    vpc_id=vpc.vpc_id,
    subnet_id=subnet.subnet_id,
    description="eni desc",
    ipv4_count=1)
example_instance = tencentcloud.Instance("exampleInstance",
    instance_name="ci-test-eni-attach",
    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("exampleEniAttachment",
    eni_id=example_eni.eni_id,
    instance_id=example_instance.instance_id)
example_vpc_flow_log = tencentcloud.VpcFlowLog("exampleVpcFlowLog",
    flow_log_name="tf-example-vpc-flow-log",
    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={
        "testKey": "testValue",
    })
config = tencentcloud.VpcFlowLogConfig("config",
    flow_log_id=example_vpc_flow_log.vpc_flow_log_id,
    enable=False)
Copy
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("delogsetmo"),
Tags: pulumi.StringMap{
"test": pulumi.String("test"),
},
})
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{
"test": pulumi.String("test"),
},
})
if err != nil {
return err
}
vpc, err := tencentcloud.NewVpc(ctx, "vpc", &tencentcloud.VpcArgs{
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),
VpcId: vpc.VpcId,
CidrBlock: pulumi.String("10.0.0.0/16"),
IsMulticast: pulumi.Bool(false),
})
if err != nil {
return err
}
exampleEni, err := tencentcloud.NewEni(ctx, "exampleEni", &tencentcloud.EniArgs{
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, "exampleInstance", &tencentcloud.InstanceArgs{
InstanceName: pulumi.String("ci-test-eni-attach"),
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, "exampleEniAttachment", &tencentcloud.EniAttachmentArgs{
EniId: exampleEni.EniId,
InstanceId: exampleInstance.InstanceId,
})
if err != nil {
return err
}
exampleVpcFlowLog, err := tencentcloud.NewVpcFlowLog(ctx, "exampleVpcFlowLog", &tencentcloud.VpcFlowLogArgs{
FlowLogName: pulumi.String("tf-example-vpc-flow-log"),
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{
"testKey": pulumi.String("testValue"),
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewVpcFlowLogConfig(ctx, "config", &tencentcloud.VpcFlowLogConfigArgs{
FlowLogId: exampleVpcFlowLog.VpcFlowLogId,
Enable: pulumi.Bool(false),
})
if err != nil {
return err
}
return nil
})
}
Copy
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 = "delogsetmo",
        Tags = 
        {
            { "test", "test" },
        },
    });

    var topic = new Tencentcloud.ClsTopic("topic", new()
    {
        TopicName = "topic",
        LogsetId = logset.ClsLogsetId,
        AutoSplit = false,
        MaxSplitPartitions = 20,
        PartitionCount = 1,
        Period = 10,
        StorageType = "hot",
        Tags = 
        {
            { "test", "test" },
        },
    });

    var vpc = new Tencentcloud.Vpc("vpc", new()
    {
        CidrBlock = "10.0.0.0/16",
    });

    var subnet = new Tencentcloud.Subnet("subnet", new()
    {
        AvailabilityZone = zones.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.Zones[0]?.Name),
        VpcId = vpc.VpcId,
        CidrBlock = "10.0.0.0/16",
        IsMulticast = false,
    });

    var exampleEni = new Tencentcloud.Eni("exampleEni", new()
    {
        VpcId = vpc.VpcId,
        SubnetId = subnet.SubnetId,
        Description = "eni desc",
        Ipv4Count = 1,
    });

    var exampleInstance = new Tencentcloud.Instance("exampleInstance", new()
    {
        InstanceName = "ci-test-eni-attach",
        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("exampleEniAttachment", new()
    {
        EniId = exampleEni.EniId,
        InstanceId = exampleInstance.InstanceId,
    });

    var exampleVpcFlowLog = new Tencentcloud.VpcFlowLog("exampleVpcFlowLog", new()
    {
        FlowLogName = "tf-example-vpc-flow-log",
        ResourceType = "NETWORKINTERFACE",
        ResourceId = exampleEniAttachment.EniId,
        TrafficType = "ACCEPT",
        VpcId = vpc.VpcId,
        FlowLogDescription = "this is a testing flow log",
        CloudLogId = topic.ClsTopicId,
        StorageType = "cls",
        Tags = 
        {
            { "testKey", "testValue" },
        },
    });

    var config = new Tencentcloud.VpcFlowLogConfig("config", new()
    {
        FlowLogId = exampleVpcFlowLog.VpcFlowLogId,
        Enable = false,
    });

});
Copy
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 com.pulumi.tencentcloud.VpcFlowLogConfig;
import com.pulumi.tencentcloud.VpcFlowLogConfigArgs;
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();

        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.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.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("delogsetmo")
            .tags(Map.of("test", "test"))
            .build());

        var topic = new ClsTopic("topic", ClsTopicArgs.builder()
            .topicName("topic")
            .logsetId(logset.clsLogsetId())
            .autoSplit(false)
            .maxSplitPartitions(20)
            .partitionCount(1)
            .period(10)
            .storageType("hot")
            .tags(Map.of("test", "test"))
            .build());

        var vpc = new Vpc("vpc", VpcArgs.builder()
            .cidrBlock("10.0.0.0/16")
            .build());

        var subnet = new Subnet("subnet", SubnetArgs.builder()
            .availabilityZone(zones.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.zones()[0].name()))
            .vpcId(vpc.vpcId())
            .cidrBlock("10.0.0.0/16")
            .isMulticast(false)
            .build());

        var exampleEni = new Eni("exampleEni", EniArgs.builder()
            .vpcId(vpc.vpcId())
            .subnetId(subnet.subnetId())
            .description("eni desc")
            .ipv4Count(1)
            .build());

        var exampleInstance = new Instance("exampleInstance", InstanceArgs.builder()
            .instanceName("ci-test-eni-attach")
            .availabilityZone(zones.applyValue(getAvailabilityZonesResult -> getAvailabilityZonesResult.zones()[0].name()))
            .imageId(image.applyValue(getImagesResult -> getImagesResult.images()[0].imageId()))
            .instanceType(instanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.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(exampleEni.eniId())
            .instanceId(exampleInstance.instanceId())
            .build());

        var exampleVpcFlowLog = new VpcFlowLog("exampleVpcFlowLog", VpcFlowLogArgs.builder()
            .flowLogName("tf-example-vpc-flow-log")
            .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("testKey", "testValue"))
            .build());

        var config = new VpcFlowLogConfig("config", VpcFlowLogConfigArgs.builder()
            .flowLogId(exampleVpcFlowLog.vpcFlowLogId())
            .enable(false)
            .build());

    }
}
Copy
resources:
  logset:
    type: tencentcloud:ClsLogset
    properties:
      logsetName: delogsetmo
      tags:
        test: test
  topic:
    type: tencentcloud:ClsTopic
    properties:
      topicName: topic
      logsetId: ${logset.clsLogsetId}
      autoSplit: false
      maxSplitPartitions: 20
      partitionCount: 1
      period: 10
      storageType: hot
      tags:
        test: test
  vpc:
    type: tencentcloud:Vpc
    properties:
      cidrBlock: 10.0.0.0/16
  subnet:
    type: tencentcloud:Subnet
    properties:
      availabilityZone: ${zones.zones[0].name}
      vpcId: ${vpc.vpcId}
      cidrBlock: 10.0.0.0/16
      isMulticast: false
  exampleEni:
    type: tencentcloud:Eni
    properties:
      vpcId: ${vpc.vpcId}
      subnetId: ${subnet.subnetId}
      description: eni desc
      ipv4Count: 1
  exampleInstance:
    type: tencentcloud:Instance
    properties:
      instanceName: ci-test-eni-attach
      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
    properties:
      eniId: ${exampleEni.eniId}
      instanceId: ${exampleInstance.instanceId}
  exampleVpcFlowLog:
    type: tencentcloud:VpcFlowLog
    properties:
      flowLogName: tf-example-vpc-flow-log
      resourceType: NETWORKINTERFACE
      resourceId: ${exampleEniAttachment.eniId}
      trafficType: ACCEPT
      vpcId: ${vpc.vpcId}
      flowLogDescription: this is a testing flow log
      cloudLogId: ${topic.clsTopicId}
      storageType: cls
      tags:
        testKey: testValue
  config:
    type: tencentcloud:VpcFlowLogConfig
    properties:
      flowLogId: ${exampleVpcFlowLog.vpcFlowLogId}
      enable: false
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
Copy

If enable FlowLogs

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const config = new tencentcloud.VpcFlowLogConfig("config", {
    flowLogId: tencentcloud_vpc_flow_log.example.id,
    enable: true,
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

config = tencentcloud.VpcFlowLogConfig("config",
    flow_log_id=tencentcloud_vpc_flow_log["example"]["id"],
    enable=True)
Copy
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 {
		_, err := tencentcloud.NewVpcFlowLogConfig(ctx, "config", &tencentcloud.VpcFlowLogConfigArgs{
			FlowLogId: pulumi.Any(tencentcloud_vpc_flow_log.Example.Id),
			Enable:    pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var config = new Tencentcloud.VpcFlowLogConfig("config", new()
    {
        FlowLogId = tencentcloud_vpc_flow_log.Example.Id,
        Enable = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.VpcFlowLogConfig;
import com.pulumi.tencentcloud.VpcFlowLogConfigArgs;
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) {
        var config = new VpcFlowLogConfig("config", VpcFlowLogConfigArgs.builder()
            .flowLogId(tencentcloud_vpc_flow_log.example().id())
            .enable(true)
            .build());

    }
}
Copy
resources:
  config:
    type: tencentcloud:VpcFlowLogConfig
    properties:
      flowLogId: ${tencentcloud_vpc_flow_log.example.id}
      enable: true
Copy

Create VpcFlowLogConfig Resource

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

Constructor syntax

new VpcFlowLogConfig(name: string, args: VpcFlowLogConfigArgs, opts?: CustomResourceOptions);
@overload
def VpcFlowLogConfig(resource_name: str,
                     args: VpcFlowLogConfigArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def VpcFlowLogConfig(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     enable: Optional[bool] = None,
                     flow_log_id: Optional[str] = None,
                     vpc_flow_log_config_id: Optional[str] = None)
func NewVpcFlowLogConfig(ctx *Context, name string, args VpcFlowLogConfigArgs, opts ...ResourceOption) (*VpcFlowLogConfig, error)
public VpcFlowLogConfig(string name, VpcFlowLogConfigArgs args, CustomResourceOptions? opts = null)
public VpcFlowLogConfig(String name, VpcFlowLogConfigArgs args)
public VpcFlowLogConfig(String name, VpcFlowLogConfigArgs args, CustomResourceOptions options)
type: tencentcloud:VpcFlowLogConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

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

Enable This property is required. bool
If enable snapshot policy.
FlowLogId This property is required. string
Flow log ID.
VpcFlowLogConfigId string
ID of the resource.
Enable This property is required. bool
If enable snapshot policy.
FlowLogId This property is required. string
Flow log ID.
VpcFlowLogConfigId string
ID of the resource.
enable This property is required. Boolean
If enable snapshot policy.
flowLogId This property is required. String
Flow log ID.
vpcFlowLogConfigId String
ID of the resource.
enable This property is required. boolean
If enable snapshot policy.
flowLogId This property is required. string
Flow log ID.
vpcFlowLogConfigId string
ID of the resource.
enable This property is required. bool
If enable snapshot policy.
flow_log_id This property is required. str
Flow log ID.
vpc_flow_log_config_id str
ID of the resource.
enable This property is required. Boolean
If enable snapshot policy.
flowLogId This property is required. String
Flow log ID.
vpcFlowLogConfigId String
ID of the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the VpcFlowLogConfig 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 VpcFlowLogConfig Resource

Get an existing VpcFlowLogConfig 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?: VpcFlowLogConfigState, opts?: CustomResourceOptions): VpcFlowLogConfig
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enable: Optional[bool] = None,
        flow_log_id: Optional[str] = None,
        vpc_flow_log_config_id: Optional[str] = None) -> VpcFlowLogConfig
func GetVpcFlowLogConfig(ctx *Context, name string, id IDInput, state *VpcFlowLogConfigState, opts ...ResourceOption) (*VpcFlowLogConfig, error)
public static VpcFlowLogConfig Get(string name, Input<string> id, VpcFlowLogConfigState? state, CustomResourceOptions? opts = null)
public static VpcFlowLogConfig get(String name, Output<String> id, VpcFlowLogConfigState state, CustomResourceOptions options)
resources:  _:    type: tencentcloud:VpcFlowLogConfig    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Enable bool
If enable snapshot policy.
FlowLogId string
Flow log ID.
VpcFlowLogConfigId string
ID of the resource.
Enable bool
If enable snapshot policy.
FlowLogId string
Flow log ID.
VpcFlowLogConfigId string
ID of the resource.
enable Boolean
If enable snapshot policy.
flowLogId String
Flow log ID.
vpcFlowLogConfigId String
ID of the resource.
enable boolean
If enable snapshot policy.
flowLogId string
Flow log ID.
vpcFlowLogConfigId string
ID of the resource.
enable bool
If enable snapshot policy.
flow_log_id str
Flow log ID.
vpc_flow_log_config_id str
ID of the resource.
enable Boolean
If enable snapshot policy.
flowLogId String
Flow log ID.
vpcFlowLogConfigId String
ID of the resource.

Import

vpc flow_log_config can be imported using the id, e.g.

$ pulumi import tencentcloud:index/vpcFlowLogConfig:VpcFlowLogConfig flow_log_config flow_log_id
Copy

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.