FlowLogArgs

data class FlowLogArgs(val cenId: Output<String>? = null, val description: Output<String>? = null, val flowLogName: Output<String>? = null, val interval: Output<Int>? = null, val logFormatString: Output<String>? = null, val logStoreName: Output<String>? = null, val projectName: Output<String>? = null, val status: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val transitRouterAttachmentId: Output<String>? = null, val transitRouterId: Output<String>? = null) : ConvertibleToJava<FlowLogArgs>

Provides a CEN Flow Log resource. For information about CEN Flow Log and how to use it, see What is Flow Log.

NOTE: Available since v1.73.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Create a cen flowlog resource and use it to publish a route entry pointing to an ECS.
const _default = new alicloud.cen.Instance("default", {name: "my-cen"});
const defaultProject = new alicloud.log.Project("default", {
name: "sls-for-flowlog",
description: "create by terraform",
});
const defaultStore = new alicloud.log.Store("default", {
project: defaultProject.name,
name: "sls-for-flowlog",
retentionPeriod: 3650,
shardCount: 3,
autoSplit: true,
maxSplitShardCount: 60,
appendMeta: true,
});
const defaultFlowLog = new alicloud.cen.FlowLog("default", {
flowLogName: "my-flowlog",
cenId: _default.id,
projectName: defaultProject.name,
logStoreName: defaultStore.name,
});
import pulumi
import pulumi_alicloud as alicloud
# Create a cen flowlog resource and use it to publish a route entry pointing to an ECS.
default = alicloud.cen.Instance("default", name="my-cen")
default_project = alicloud.log.Project("default",
name="sls-for-flowlog",
description="create by terraform")
default_store = alicloud.log.Store("default",
project=default_project.name,
name="sls-for-flowlog",
retention_period=3650,
shard_count=3,
auto_split=True,
max_split_shard_count=60,
append_meta=True)
default_flow_log = alicloud.cen.FlowLog("default",
flow_log_name="my-flowlog",
cen_id=default.id,
project_name=default_project.name,
log_store_name=default_store.name)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
// Create a cen flowlog resource and use it to publish a route entry pointing to an ECS.
var @default = new AliCloud.Cen.Instance("default", new()
{
Name = "my-cen",
});
var defaultProject = new AliCloud.Log.Project("default", new()
{
Name = "sls-for-flowlog",
Description = "create by terraform",
});
var defaultStore = new AliCloud.Log.Store("default", new()
{
Project = defaultProject.Name,
Name = "sls-for-flowlog",
RetentionPeriod = 3650,
ShardCount = 3,
AutoSplit = true,
MaxSplitShardCount = 60,
AppendMeta = true,
});
var defaultFlowLog = new AliCloud.Cen.FlowLog("default", new()
{
FlowLogName = "my-flowlog",
CenId = @default.Id,
ProjectName = defaultProject.Name,
LogStoreName = defaultStore.Name,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create a cen flowlog resource and use it to publish a route entry pointing to an ECS.
_default, err := cen.NewInstance(ctx, "default", &cen.InstanceArgs{
Name: pulumi.String("my-cen"),
})
if err != nil {
return err
}
defaultProject, err := log.NewProject(ctx, "default", &log.ProjectArgs{
Name: pulumi.String("sls-for-flowlog"),
Description: pulumi.String("create by terraform"),
})
if err != nil {
return err
}
defaultStore, err := log.NewStore(ctx, "default", &log.StoreArgs{
Project: defaultProject.Name,
Name: pulumi.String("sls-for-flowlog"),
RetentionPeriod: pulumi.Int(3650),
ShardCount: pulumi.Int(3),
AutoSplit: pulumi.Bool(true),
MaxSplitShardCount: pulumi.Int(60),
AppendMeta: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = cen.NewFlowLog(ctx, "default", &cen.FlowLogArgs{
FlowLogName: pulumi.String("my-flowlog"),
CenId: _default.ID(),
ProjectName: defaultProject.Name,
LogStoreName: defaultStore.Name,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cen.Instance;
import com.pulumi.alicloud.cen.InstanceArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.cen.FlowLog;
import com.pulumi.alicloud.cen.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) {
// Create a cen flowlog resource and use it to publish a route entry pointing to an ECS.
var default_ = new Instance("default", InstanceArgs.builder()
.name("my-cen")
.build());
var defaultProject = new Project("defaultProject", ProjectArgs.builder()
.name("sls-for-flowlog")
.description("create by terraform")
.build());
var defaultStore = new Store("defaultStore", StoreArgs.builder()
.project(defaultProject.name())
.name("sls-for-flowlog")
.retentionPeriod(3650)
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
var defaultFlowLog = new FlowLog("defaultFlowLog", FlowLogArgs.builder()
.flowLogName("my-flowlog")
.cenId(default_.id())
.projectName(defaultProject.name())
.logStoreName(defaultStore.name())
.build());
}
}
resources:
# Create a cen flowlog resource and use it to publish a route entry pointing to an ECS.
default:
type: alicloud:cen:Instance
properties:
name: my-cen
defaultProject:
type: alicloud:log:Project
name: default
properties:
name: sls-for-flowlog
description: create by terraform
defaultStore:
type: alicloud:log:Store
name: default
properties:
project: ${defaultProject.name}
name: sls-for-flowlog
retentionPeriod: 3650
shardCount: 3
autoSplit: true
maxSplitShardCount: 60
appendMeta: true
defaultFlowLog:
type: alicloud:cen:FlowLog
name: default
properties:
flowLogName: my-flowlog
cenId: ${default.id}
projectName: ${defaultProject.name}
logStoreName: ${defaultStore.name}

Import

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

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

Constructors

Link copied to clipboard
constructor(cenId: Output<String>? = null, description: Output<String>? = null, flowLogName: Output<String>? = null, interval: Output<Int>? = null, logFormatString: Output<String>? = null, logStoreName: Output<String>? = null, projectName: Output<String>? = null, status: Output<String>? = null, tags: Output<Map<String, String>>? = null, transitRouterAttachmentId: Output<String>? = null, transitRouterId: Output<String>? = null)

Properties

Link copied to clipboard
val cenId: Output<String>? = null

cen id

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

The description of the flowlog.

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

The name of the flowlog.

Link copied to clipboard
val interval: Output<Int>? = null

The duration of the capture window for the flow log to capture traffic. Unit: seconds. Valid values: 60 or **600 * *. Default value: **600 * *.

Link copied to clipboard
val logFormatString: Output<String>? = null

Log Format

Link copied to clipboard
val logStoreName: Output<String>? = null

The LogStore that stores the flowlog.

Link copied to clipboard
val projectName: Output<String>? = null

The Project that stores the flowlog.

Link copied to clipboard
val status: Output<String>? = null

The status of the flow log. Valid values:

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

The tag of the resource

Link copied to clipboard
val transitRouterAttachmentId: Output<String>? = null

Cross-region Connection ID or VBR connection ID.

Link copied to clipboard
val transitRouterId: Output<String>? = null

Transit Router ID

Functions

Link copied to clipboard
open override fun toJava(): FlowLogArgs