1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpc
  5. getVpcFlowLogs
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.vpc.getVpcFlowLogs

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 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);
    
    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)
    
    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
    	})
    }
    
    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 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()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:vpc:getVpcFlowLogs
          Arguments:
            ids:
              - example_value
            nameRegex: the_resource_name
    outputs:
      firstVpcFlowLogId: ${example.logs[0].id}
    

    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>
    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]
    func GetVpcFlowLogs(ctx *Context, args *GetVpcFlowLogsArgs, opts ...InvokeOption) (*GetVpcFlowLogsResult, error)
    func GetVpcFlowLogsOutput(ctx *Context, args *GetVpcFlowLogsOutputArgs, opts ...InvokeOption) GetVpcFlowLogsResultOutput

    > 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)
    }
    public static CompletableFuture<GetVpcFlowLogsResult> getVpcFlowLogs(GetVpcFlowLogsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:vpc/getVpcFlowLogs:getVpcFlowLogs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    The Description of flow log.
    FlowLogName string
    The flow log name.
    Ids List<string>
    A list of Flow Log IDs.
    LogStoreName string
    The log store name.
    NameRegex 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 string
    The project name.
    ResourceId string
    The resource id.
    ResourceType string
    The resource type. Valid values: NetworkInterface, VPC, VSwitch.
    Status string
    The status of flow log. Valid values: Active, Inactive.
    TrafficType string
    The traffic type. Valid values: All, Allow, Drop.
    Description string
    The Description of flow log.
    FlowLogName string
    The flow log name.
    Ids []string
    A list of Flow Log IDs.
    LogStoreName string
    The log store name.
    NameRegex 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 string
    The project name.
    ResourceId string
    The resource id.
    ResourceType string
    The resource type. Valid values: NetworkInterface, VPC, VSwitch.
    Status string
    The status of flow log. Valid values: Active, Inactive.
    TrafficType string
    The traffic type. Valid values: All, Allow, Drop.
    description String
    The Description of flow log.
    flowLogName String
    The flow log name.
    ids List<String>
    A list of Flow Log IDs.
    logStoreName String
    The log store name.
    nameRegex 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 String
    The project name.
    resourceId String
    The resource id.
    resourceType String
    The resource type. Valid values: NetworkInterface, VPC, VSwitch.
    status String
    The status of flow log. Valid values: Active, Inactive.
    trafficType String
    The traffic type. Valid values: All, Allow, Drop.
    description string
    The Description of flow log.
    flowLogName string
    The flow log name.
    ids string[]
    A list of Flow Log IDs.
    logStoreName string
    The log store name.
    nameRegex 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 string
    The project name.
    resourceId string
    The resource id.
    resourceType string
    The resource type. Valid values: NetworkInterface, VPC, VSwitch.
    status string
    The status of flow log. Valid values: Active, Inactive.
    trafficType string
    The traffic type. Valid values: All, Allow, Drop.
    description str
    The Description of flow log.
    flow_log_name str
    The flow log name.
    ids Sequence[str]
    A list of Flow Log IDs.
    log_store_name str
    The log store name.
    name_regex 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 str
    The project name.
    resource_id str
    The resource id.
    resource_type str
    The resource type. Valid values: NetworkInterface, VPC, VSwitch.
    status str
    The status of flow log. Valid values: Active, Inactive.
    traffic_type str
    The traffic type. Valid values: All, Allow, Drop.
    description String
    The Description of flow log.
    flowLogName String
    The flow log name.
    ids List<String>
    A list of Flow Log IDs.
    logStoreName String
    The log store name.
    nameRegex 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 String
    The project name.
    resourceId String
    The resource id.
    resourceType String
    The resource type. Valid values: NetworkInterface, VPC, VSwitch.
    status String
    The status of flow log. Valid values: Active, Inactive.
    trafficType 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 string
    The Description of flow log.
    FlowLogId string
    The flow log ID.
    FlowLogName string
    The flow log name.
    Id string
    The ID of the Flow Log.
    LogStoreName string
    The log store name.
    ProjectName string
    The project name.
    ResourceId string
    The resource id.
    ResourceType string
    The resource type.
    Status string
    The status of flow log.
    TrafficType string
    The traffic type.
    Description string
    The Description of flow log.
    FlowLogId string
    The flow log ID.
    FlowLogName string
    The flow log name.
    Id string
    The ID of the Flow Log.
    LogStoreName string
    The log store name.
    ProjectName string
    The project name.
    ResourceId string
    The resource id.
    ResourceType string
    The resource type.
    Status string
    The status of flow log.
    TrafficType string
    The traffic type.
    description String
    The Description of flow log.
    flowLogId String
    The flow log ID.
    flowLogName String
    The flow log name.
    id String
    The ID of the Flow Log.
    logStoreName String
    The log store name.
    projectName String
    The project name.
    resourceId String
    The resource id.
    resourceType String
    The resource type.
    status String
    The status of flow log.
    trafficType String
    The traffic type.
    description string
    The Description of flow log.
    flowLogId string
    The flow log ID.
    flowLogName string
    The flow log name.
    id string
    The ID of the Flow Log.
    logStoreName string
    The log store name.
    projectName string
    The project name.
    resourceId string
    The resource id.
    resourceType string
    The resource type.
    status string
    The status of flow log.
    trafficType string
    The traffic type.
    description str
    The Description of flow log.
    flow_log_id str
    The flow log ID.
    flow_log_name str
    The flow log name.
    id str
    The ID of the Flow Log.
    log_store_name str
    The log store name.
    project_name str
    The project name.
    resource_id str
    The resource id.
    resource_type str
    The resource type.
    status str
    The status of flow log.
    traffic_type str
    The traffic type.
    description String
    The Description of flow log.
    flowLogId String
    The flow log ID.
    flowLogName String
    The flow log name.
    id String
    The ID of the Flow Log.
    logStoreName String
    The log store name.
    projectName String
    The project name.
    resourceId String
    The resource id.
    resourceType String
    The resource type.
    status String
    The status of flow log.
    trafficType 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.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi