FlowLog

Provides a VPC Flow Log resource. For information about VPC Flow log and how to use it, see Flow log overview.

NOTE: Available in v1.117.0+ NOTE: While it uses alicloud.vpc.FlowLog to build a vpc flow log resource, it will be active by default.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.FlowLog;
import com.pulumi.alicloud.vpc.FlowLogArgs;
import com.pulumi.resources.CustomResourceOptions;
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("terratest_vpc_flow_log");
final var logStoreName = config.get("logStoreName").orElse("vpc-flow-log-for-vpc");
final var projectName = config.get("projectName").orElse("vpc-flow-log-for-vpc");
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.cidrBlock("192.168.0.0/24")
.build());
var defaultFlowLog = new FlowLog("defaultFlowLog", FlowLogArgs.builder()
.resourceId(defaultNetwork.id())
.resourceType("VPC")
.trafficType("All")
.logStoreName(logStoreName)
.projectName(projectName)
.flowLogName(name)
.status("Active")
.build(), CustomResourceOptions.builder()
.dependsOn("alicloud_vpc.default")
.build());
}
}

Import

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

$ pulumi import alicloud:vpc/flowLog:FlowLog example fl-abc123456

Properties

Link copied to clipboard
val description: Output<String>?

The Description of the VPC Flow Log.

Link copied to clipboard
val flowLogName: Output<String>?

The Name of the VPC Flow Log.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val logStoreName: Output<String>

The name of the logstore.

Link copied to clipboard
val projectName: Output<String>

The name of the project.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceId: Output<String>

The ID of the resource.

Link copied to clipboard
val resourceType: Output<String>

The type of the resource to capture traffic. Valid values NetworkInterface, VPC, and VSwitch.

Link copied to clipboard
val status: Output<String>

The status of the VPC Flow Log. Valid values Active and Inactive.

Link copied to clipboard
val trafficType: Output<String>

The type of traffic collected. Valid values All, Drop and Allow.

Link copied to clipboard
val urn: Output<String>