1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. vpc
  5. getVpcFlowLogs
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.vpc.getVpcFlowLogs

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

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);
Copy
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)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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.applyValue(getVpcFlowLogsResult -> getVpcFlowLogsResult.logs()[0].id()));
    }
}
Copy
variables:
  example:
    fn::invoke:
      function: alicloud:vpc:getVpcFlowLogs
      arguments:
        ids:
          - example_value
        nameRegex: the_resource_name
outputs:
  firstVpcFlowLogId: ${example.logs[0].id}
Copy

Using getVpcFlowLogs

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getVpcFlowLogs(args: GetVpcFlowLogsArgs, opts?: InvokeOptions): Promise<GetVpcFlowLogsResult>
function getVpcFlowLogsOutput(args: GetVpcFlowLogsOutputArgs, opts?: InvokeOptions): Output<GetVpcFlowLogsResult>
Copy
def get_vpc_flow_logs(description: Optional[str] = None,
                      flow_log_name: Optional[str] = None,
                      ids: Optional[Sequence[str]] = None,
                      log_store_name: Optional[str] = None,
                      name_regex: Optional[str] = None,
                      output_file: Optional[str] = None,
                      project_name: Optional[str] = None,
                      resource_id: Optional[str] = None,
                      resource_type: Optional[str] = None,
                      status: Optional[str] = None,
                      traffic_type: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetVpcFlowLogsResult
def get_vpc_flow_logs_output(description: Optional[pulumi.Input[str]] = None,
                      flow_log_name: Optional[pulumi.Input[str]] = None,
                      ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      log_store_name: Optional[pulumi.Input[str]] = None,
                      name_regex: Optional[pulumi.Input[str]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      project_name: Optional[pulumi.Input[str]] = None,
                      resource_id: Optional[pulumi.Input[str]] = None,
                      resource_type: Optional[pulumi.Input[str]] = None,
                      status: Optional[pulumi.Input[str]] = None,
                      traffic_type: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetVpcFlowLogsResult]
Copy
func GetVpcFlowLogs(ctx *Context, args *GetVpcFlowLogsArgs, opts ...InvokeOption) (*GetVpcFlowLogsResult, error)
func GetVpcFlowLogsOutput(ctx *Context, args *GetVpcFlowLogsOutputArgs, opts ...InvokeOption) GetVpcFlowLogsResultOutput
Copy

> Note: This function is named GetVpcFlowLogs in the Go SDK.

public static class GetVpcFlowLogs 
{
    public static Task<GetVpcFlowLogsResult> InvokeAsync(GetVpcFlowLogsArgs args, InvokeOptions? opts = null)
    public static Output<GetVpcFlowLogsResult> Invoke(GetVpcFlowLogsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVpcFlowLogsResult> getVpcFlowLogs(GetVpcFlowLogsArgs args, InvokeOptions options)
public static Output<GetVpcFlowLogsResult> getVpcFlowLogs(GetVpcFlowLogsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:vpc/getVpcFlowLogs:getVpcFlowLogs
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Description Changes to this property will trigger replacement. string
The Description of flow log.
FlowLogName Changes to this property will trigger replacement. string
The flow log name.
Ids Changes to this property will trigger replacement. List<string>
A list of Flow Log IDs.
LogStoreName Changes to this property will trigger replacement. string
The log store name.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Flow Log name.
OutputFile string
File name where to save data source results (after running pulumi preview).
ProjectName Changes to this property will trigger replacement. string
The project name.
ResourceId Changes to this property will trigger replacement. string
The resource id.
ResourceType Changes to this property will trigger replacement. string
The resource type. Valid values: NetworkInterface, VPC, VSwitch.
Status Changes to this property will trigger replacement. string
The status of flow log. Valid values: Active, Inactive.
TrafficType Changes to this property will trigger replacement. string
The traffic type. Valid values: All, Allow, Drop.
Description Changes to this property will trigger replacement. string
The Description of flow log.
FlowLogName Changes to this property will trigger replacement. string
The flow log name.
Ids Changes to this property will trigger replacement. []string
A list of Flow Log IDs.
LogStoreName Changes to this property will trigger replacement. string
The log store name.
NameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Flow Log name.
OutputFile string
File name where to save data source results (after running pulumi preview).
ProjectName Changes to this property will trigger replacement. string
The project name.
ResourceId Changes to this property will trigger replacement. string
The resource id.
ResourceType Changes to this property will trigger replacement. string
The resource type. Valid values: NetworkInterface, VPC, VSwitch.
Status Changes to this property will trigger replacement. string
The status of flow log. Valid values: Active, Inactive.
TrafficType Changes to this property will trigger replacement. string
The traffic type. Valid values: All, Allow, Drop.
description Changes to this property will trigger replacement. String
The Description of flow log.
flowLogName Changes to this property will trigger replacement. String
The flow log name.
ids Changes to this property will trigger replacement. List<String>
A list of Flow Log IDs.
logStoreName Changes to this property will trigger replacement. String
The log store name.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Flow Log name.
outputFile String
File name where to save data source results (after running pulumi preview).
projectName Changes to this property will trigger replacement. String
The project name.
resourceId Changes to this property will trigger replacement. String
The resource id.
resourceType Changes to this property will trigger replacement. String
The resource type. Valid values: NetworkInterface, VPC, VSwitch.
status Changes to this property will trigger replacement. String
The status of flow log. Valid values: Active, Inactive.
trafficType Changes to this property will trigger replacement. String
The traffic type. Valid values: All, Allow, Drop.
description Changes to this property will trigger replacement. string
The Description of flow log.
flowLogName Changes to this property will trigger replacement. string
The flow log name.
ids Changes to this property will trigger replacement. string[]
A list of Flow Log IDs.
logStoreName Changes to this property will trigger replacement. string
The log store name.
nameRegex Changes to this property will trigger replacement. string
A regex string to filter results by Flow Log name.
outputFile string
File name where to save data source results (after running pulumi preview).
projectName Changes to this property will trigger replacement. string
The project name.
resourceId Changes to this property will trigger replacement. string
The resource id.
resourceType Changes to this property will trigger replacement. string
The resource type. Valid values: NetworkInterface, VPC, VSwitch.
status Changes to this property will trigger replacement. string
The status of flow log. Valid values: Active, Inactive.
trafficType Changes to this property will trigger replacement. string
The traffic type. Valid values: All, Allow, Drop.
description Changes to this property will trigger replacement. str
The Description of flow log.
flow_log_name Changes to this property will trigger replacement. str
The flow log name.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Flow Log IDs.
log_store_name Changes to this property will trigger replacement. str
The log store name.
name_regex Changes to this property will trigger replacement. str
A regex string to filter results by Flow Log name.
output_file str
File name where to save data source results (after running pulumi preview).
project_name Changes to this property will trigger replacement. str
The project name.
resource_id Changes to this property will trigger replacement. str
The resource id.
resource_type Changes to this property will trigger replacement. str
The resource type. Valid values: NetworkInterface, VPC, VSwitch.
status Changes to this property will trigger replacement. str
The status of flow log. Valid values: Active, Inactive.
traffic_type Changes to this property will trigger replacement. str
The traffic type. Valid values: All, Allow, Drop.
description Changes to this property will trigger replacement. String
The Description of flow log.
flowLogName Changes to this property will trigger replacement. String
The flow log name.
ids Changes to this property will trigger replacement. List<String>
A list of Flow Log IDs.
logStoreName Changes to this property will trigger replacement. String
The log store name.
nameRegex Changes to this property will trigger replacement. String
A regex string to filter results by Flow Log name.
outputFile String
File name where to save data source results (after running pulumi preview).
projectName Changes to this property will trigger replacement. String
The project name.
resourceId Changes to this property will trigger replacement. String
The resource id.
resourceType Changes to this property will trigger replacement. String
The resource type. Valid values: NetworkInterface, VPC, VSwitch.
status Changes to this property will trigger replacement. String
The status of flow log. Valid values: Active, Inactive.
trafficType Changes to this property will trigger replacement. String
The traffic type. Valid values: All, Allow, Drop.

getVpcFlowLogs Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Logs List<Pulumi.AliCloud.Vpc.Outputs.GetVpcFlowLogsLog>
Names List<string>
Description string
FlowLogName string
LogStoreName string
NameRegex string
OutputFile string
ProjectName string
ResourceId string
ResourceType string
Status string
TrafficType string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Logs []GetVpcFlowLogsLog
Names []string
Description string
FlowLogName string
LogStoreName string
NameRegex string
OutputFile string
ProjectName string
ResourceId string
ResourceType string
Status string
TrafficType string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
logs List<GetVpcFlowLogsLog>
names List<String>
description String
flowLogName String
logStoreName String
nameRegex String
outputFile String
projectName String
resourceId String
resourceType String
status String
trafficType String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
logs GetVpcFlowLogsLog[]
names string[]
description string
flowLogName string
logStoreName string
nameRegex string
outputFile string
projectName string
resourceId string
resourceType string
status string
trafficType string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
logs Sequence[GetVpcFlowLogsLog]
names Sequence[str]
description str
flow_log_name str
log_store_name str
name_regex str
output_file str
project_name str
resource_id str
resource_type str
status str
traffic_type str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
logs List<Property Map>
names List<String>
description String
flowLogName String
logStoreName String
nameRegex String
outputFile String
projectName String
resourceId String
resourceType String
status String
trafficType String

Supporting Types

GetVpcFlowLogsLog

Description This property is required. string
The Description of flow log.
FlowLogId This property is required. string
The flow log ID.
FlowLogName This property is required. string
The flow log name.
Id This property is required. string
The ID of the Flow Log.
LogStoreName This property is required. string
The log store name.
ProjectName This property is required. string
The project name.
ResourceId This property is required. string
The resource id.
ResourceType This property is required. string
The resource type.
Status This property is required. string
The status of flow log.
TrafficType This property is required. string
The traffic type.
Description This property is required. string
The Description of flow log.
FlowLogId This property is required. string
The flow log ID.
FlowLogName This property is required. string
The flow log name.
Id This property is required. string
The ID of the Flow Log.
LogStoreName This property is required. string
The log store name.
ProjectName This property is required. string
The project name.
ResourceId This property is required. string
The resource id.
ResourceType This property is required. string
The resource type.
Status This property is required. string
The status of flow log.
TrafficType This property is required. string
The traffic type.
description This property is required. String
The Description of flow log.
flowLogId This property is required. String
The flow log ID.
flowLogName This property is required. String
The flow log name.
id This property is required. String
The ID of the Flow Log.
logStoreName This property is required. String
The log store name.
projectName This property is required. String
The project name.
resourceId This property is required. String
The resource id.
resourceType This property is required. String
The resource type.
status This property is required. String
The status of flow log.
trafficType This property is required. String
The traffic type.
description This property is required. string
The Description of flow log.
flowLogId This property is required. string
The flow log ID.
flowLogName This property is required. string
The flow log name.
id This property is required. string
The ID of the Flow Log.
logStoreName This property is required. string
The log store name.
projectName This property is required. string
The project name.
resourceId This property is required. string
The resource id.
resourceType This property is required. string
The resource type.
status This property is required. string
The status of flow log.
trafficType This property is required. string
The traffic type.
description This property is required. str
The Description of flow log.
flow_log_id This property is required. str
The flow log ID.
flow_log_name This property is required. str
The flow log name.
id This property is required. str
The ID of the Flow Log.
log_store_name This property is required. str
The log store name.
project_name This property is required. str
The project name.
resource_id This property is required. str
The resource id.
resource_type This property is required. str
The resource type.
status This property is required. str
The status of flow log.
traffic_type This property is required. str
The traffic type.
description This property is required. String
The Description of flow log.
flowLogId This property is required. String
The flow log ID.
flowLogName This property is required. String
The flow log name.
id This property is required. String
The ID of the Flow Log.
logStoreName This property is required. String
The log store name.
projectName This property is required. String
The project name.
resourceId This property is required. String
The resource id.
resourceType This property is required. String
The resource type.
status This property is required. String
The status of flow log.
trafficType This property is required. String
The traffic type.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi