get Vpc Flow Logs
This data source provides the Vpc Flow Logs of the current Alibaba Cloud user.
NOTE: Available in v1.122.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.vpc.getVpcFlowLogs({
ids: ["example_value"],
nameRegex: "the_resource_name",
});
export const firstVpcFlowLogId = example.then(example => example.logs?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.vpc.get_vpc_flow_logs(ids=["example_value"],
name_regex="the_resource_name")
pulumi.export("firstVpcFlowLogId", example.logs[0].id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.Vpc.GetVpcFlowLogs.Invoke(new()
{
Ids = new[]
{
"example_value",
},
NameRegex = "the_resource_name",
});
return new Dictionary<string, object?>
{
["firstVpcFlowLogId"] = example.Apply(getVpcFlowLogsResult => getVpcFlowLogsResult.Logs[0]?.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := vpc.GetVpcFlowLogs(ctx, &vpc.GetVpcFlowLogsArgs{
Ids: []string{
"example_value",
},
NameRegex: pulumi.StringRef("the_resource_name"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstVpcFlowLogId", example.Logs[0].Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.VpcFunctions;
import com.pulumi.alicloud.vpc.inputs.GetVpcFlowLogsArgs;
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 example = VpcFunctions.getVpcFlowLogs(GetVpcFlowLogsArgs.builder()
.ids("example_value")
.nameRegex("the_resource_name")
.build());
ctx.export("firstVpcFlowLogId", example.logs()[0].id());
}
}
variables:
example:
fn::invoke:
function: alicloud:vpc:getVpcFlowLogs
arguments:
ids:
- example_value
nameRegex: the_resource_name
outputs:
firstVpcFlowLogId: ${example.logs[0].id}
Return
A collection of values returned by getVpcFlowLogs.
Parameters
A collection of arguments for invoking getVpcFlowLogs.
Return
A collection of values returned by getVpcFlowLogs.
Parameters
The Description of flow log.
The flow log name.
A list of Flow Log IDs.
The log store name.
A regex string to filter results by Flow Log name.
File name where to save data source results (after running pulumi preview
).
The project name.
The resource id.
The resource type. Valid values: NetworkInterface
, VPC
, VSwitch
.
The status of flow log. Valid values: Active
, Inactive
.
The traffic type. Valid values: All
, Allow
, Drop
.
See also
Return
A collection of values returned by getVpcFlowLogs.
Parameters
Builder for com.pulumi.alicloud.vpc.kotlin.inputs.GetVpcFlowLogsPlainArgs.