1. Packages
  2. Ibm Provider
  3. API Docs
  4. getIsFlowLogs
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getIsFlowLogs

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Retrieve an information of an existing IBM Cloud Infrastructure flow logs as a read-only data source. For more information, about VPC flow log, see creating a flow log collector.

    Note: VPC infrastructure services are a regional specific based endpoint, by default targets to us-south. Please make sure to target right region in the provider block as shown in the provider.tf file, if VPC service is created in region other than us-south.

    provider.tf

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const example = ibm.getIsFlowLogs({});
    const example1 = ibm.getIsFlowLogs({
        name: "my-flow-log",
        vpcName: ibm_is_vpc.example.name,
        vpcCrn: ibm_is_vpc.example.crn,
        vpc: ibm_is_vpc.example.id,
        resourceGroup: ibm_is_vpc.example.resource_group,
        target: ibm_is_vpc.example.id,
        targetResourceType: "vpc",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    example = ibm.get_is_flow_logs()
    example1 = ibm.get_is_flow_logs(name="my-flow-log",
        vpc_name=ibm_is_vpc["example"]["name"],
        vpc_crn=ibm_is_vpc["example"]["crn"],
        vpc=ibm_is_vpc["example"]["id"],
        resource_group=ibm_is_vpc["example"]["resource_group"],
        target=ibm_is_vpc["example"]["id"],
        target_resource_type="vpc")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.GetIsFlowLogs(ctx, &ibm.GetIsFlowLogsArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ibm.GetIsFlowLogs(ctx, &ibm.GetIsFlowLogsArgs{
    			Name:               pulumi.StringRef("my-flow-log"),
    			VpcName:            pulumi.StringRef(ibm_is_vpc.Example.Name),
    			VpcCrn:             pulumi.StringRef(ibm_is_vpc.Example.Crn),
    			Vpc:                pulumi.StringRef(ibm_is_vpc.Example.Id),
    			ResourceGroup:      pulumi.StringRef(ibm_is_vpc.Example.Resource_group),
    			Target:             pulumi.StringRef(ibm_is_vpc.Example.Id),
    			TargetResourceType: pulumi.StringRef("vpc"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ibm.GetIsFlowLogs.Invoke();
    
        var example1 = Ibm.GetIsFlowLogs.Invoke(new()
        {
            Name = "my-flow-log",
            VpcName = ibm_is_vpc.Example.Name,
            VpcCrn = ibm_is_vpc.Example.Crn,
            Vpc = ibm_is_vpc.Example.Id,
            ResourceGroup = ibm_is_vpc.Example.Resource_group,
            Target = ibm_is_vpc.Example.Id,
            TargetResourceType = "vpc",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetIsFlowLogsArgs;
    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 = IbmFunctions.getIsFlowLogs();
    
            final var example1 = IbmFunctions.getIsFlowLogs(GetIsFlowLogsArgs.builder()
                .name("my-flow-log")
                .vpcName(ibm_is_vpc.example().name())
                .vpcCrn(ibm_is_vpc.example().crn())
                .vpc(ibm_is_vpc.example().id())
                .resourceGroup(ibm_is_vpc.example().resource_group())
                .target(ibm_is_vpc.example().id())
                .targetResourceType("vpc")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ibm:getIsFlowLogs
          arguments: {}
      example1:
        fn::invoke:
          function: ibm:getIsFlowLogs
          arguments:
            name: my-flow-log
            vpcName: ${ibm_is_vpc.example.name}
            vpcCrn: ${ibm_is_vpc.example.crn}
            vpc: ${ibm_is_vpc.example.id}
            resourceGroup: ${ibm_is_vpc.example.resource_group}
            target: ${ibm_is_vpc.example.id}
            targetResourceType: vpc
    

    Using getIsFlowLogs

    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 getIsFlowLogs(args: GetIsFlowLogsArgs, opts?: InvokeOptions): Promise<GetIsFlowLogsResult>
    function getIsFlowLogsOutput(args: GetIsFlowLogsOutputArgs, opts?: InvokeOptions): Output<GetIsFlowLogsResult>
    def get_is_flow_logs(id: Optional[str] = None,
                         name: Optional[str] = None,
                         resource_group: Optional[str] = None,
                         target: Optional[str] = None,
                         target_resource_type: Optional[str] = None,
                         vpc: Optional[str] = None,
                         vpc_crn: Optional[str] = None,
                         vpc_name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetIsFlowLogsResult
    def get_is_flow_logs_output(id: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         resource_group: Optional[pulumi.Input[str]] = None,
                         target: Optional[pulumi.Input[str]] = None,
                         target_resource_type: Optional[pulumi.Input[str]] = None,
                         vpc: Optional[pulumi.Input[str]] = None,
                         vpc_crn: Optional[pulumi.Input[str]] = None,
                         vpc_name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetIsFlowLogsResult]
    func GetIsFlowLogs(ctx *Context, args *GetIsFlowLogsArgs, opts ...InvokeOption) (*GetIsFlowLogsResult, error)
    func GetIsFlowLogsOutput(ctx *Context, args *GetIsFlowLogsOutputArgs, opts ...InvokeOption) GetIsFlowLogsResultOutput

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

    public static class GetIsFlowLogs 
    {
        public static Task<GetIsFlowLogsResult> InvokeAsync(GetIsFlowLogsArgs args, InvokeOptions? opts = null)
        public static Output<GetIsFlowLogsResult> Invoke(GetIsFlowLogsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIsFlowLogsResult> getIsFlowLogs(GetIsFlowLogsArgs args, InvokeOptions options)
    public static Output<GetIsFlowLogsResult> getIsFlowLogs(GetIsFlowLogsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getIsFlowLogs:getIsFlowLogs
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    (String) The unique identifier of the flow log collector.
    Name string
    The name of the flow log collector
    ResourceGroup string
    The ID of the Resource group this flow log collector belongs to
    Target string
    The ID of the target this collector is collecting flow logs for.
    TargetResourceType string
    The target resource type for this flow log collector. Available options are instance, instance_network_attachment, network_interface, subnet, vpc, virtual_network_interface
    Vpc string
    The ID of the VPC this flow log collector resides in
    VpcCrn string
    The CRN of the VPC this flow log collector resides in
    VpcName string
    The name of the VPC this flow log collector resides in
    Id string
    (String) The unique identifier of the flow log collector.
    Name string
    The name of the flow log collector
    ResourceGroup string
    The ID of the Resource group this flow log collector belongs to
    Target string
    The ID of the target this collector is collecting flow logs for.
    TargetResourceType string
    The target resource type for this flow log collector. Available options are instance, instance_network_attachment, network_interface, subnet, vpc, virtual_network_interface
    Vpc string
    The ID of the VPC this flow log collector resides in
    VpcCrn string
    The CRN of the VPC this flow log collector resides in
    VpcName string
    The name of the VPC this flow log collector resides in
    id String
    (String) The unique identifier of the flow log collector.
    name String
    The name of the flow log collector
    resourceGroup String
    The ID of the Resource group this flow log collector belongs to
    target String
    The ID of the target this collector is collecting flow logs for.
    targetResourceType String
    The target resource type for this flow log collector. Available options are instance, instance_network_attachment, network_interface, subnet, vpc, virtual_network_interface
    vpc String
    The ID of the VPC this flow log collector resides in
    vpcCrn String
    The CRN of the VPC this flow log collector resides in
    vpcName String
    The name of the VPC this flow log collector resides in
    id string
    (String) The unique identifier of the flow log collector.
    name string
    The name of the flow log collector
    resourceGroup string
    The ID of the Resource group this flow log collector belongs to
    target string
    The ID of the target this collector is collecting flow logs for.
    targetResourceType string
    The target resource type for this flow log collector. Available options are instance, instance_network_attachment, network_interface, subnet, vpc, virtual_network_interface
    vpc string
    The ID of the VPC this flow log collector resides in
    vpcCrn string
    The CRN of the VPC this flow log collector resides in
    vpcName string
    The name of the VPC this flow log collector resides in
    id str
    (String) The unique identifier of the flow log collector.
    name str
    The name of the flow log collector
    resource_group str
    The ID of the Resource group this flow log collector belongs to
    target str
    The ID of the target this collector is collecting flow logs for.
    target_resource_type str
    The target resource type for this flow log collector. Available options are instance, instance_network_attachment, network_interface, subnet, vpc, virtual_network_interface
    vpc str
    The ID of the VPC this flow log collector resides in
    vpc_crn str
    The CRN of the VPC this flow log collector resides in
    vpc_name str
    The name of the VPC this flow log collector resides in
    id String
    (String) The unique identifier of the flow log collector.
    name String
    The name of the flow log collector
    resourceGroup String
    The ID of the Resource group this flow log collector belongs to
    target String
    The ID of the target this collector is collecting flow logs for.
    targetResourceType String
    The target resource type for this flow log collector. Available options are instance, instance_network_attachment, network_interface, subnet, vpc, virtual_network_interface
    vpc String
    The ID of the VPC this flow log collector resides in
    vpcCrn String
    The CRN of the VPC this flow log collector resides in
    vpcName String
    The name of the VPC this flow log collector resides in

    getIsFlowLogs Result

    The following output properties are available:

    FlowLogCollectors List<GetIsFlowLogsFlowLogCollector>
    (List) Lists all the flow logs in the IBM Cloud.
    Id string
    (String) The unique identifier of the flow log collector.
    Name string
    (String) The flow log collector name.
    ResourceGroup string
    (String) The resource group Id of the flow log.
    Target string
    (String) The target ID that the flow log collector collects the flow logs.
    TargetResourceType string
    Vpc string
    (String) The VPC of the flow log collector that are associated.
    VpcCrn string
    VpcName string
    FlowLogCollectors []GetIsFlowLogsFlowLogCollector
    (List) Lists all the flow logs in the IBM Cloud.
    Id string
    (String) The unique identifier of the flow log collector.
    Name string
    (String) The flow log collector name.
    ResourceGroup string
    (String) The resource group Id of the flow log.
    Target string
    (String) The target ID that the flow log collector collects the flow logs.
    TargetResourceType string
    Vpc string
    (String) The VPC of the flow log collector that are associated.
    VpcCrn string
    VpcName string
    flowLogCollectors List<GetIsFlowLogsFlowLogCollector>
    (List) Lists all the flow logs in the IBM Cloud.
    id String
    (String) The unique identifier of the flow log collector.
    name String
    (String) The flow log collector name.
    resourceGroup String
    (String) The resource group Id of the flow log.
    target String
    (String) The target ID that the flow log collector collects the flow logs.
    targetResourceType String
    vpc String
    (String) The VPC of the flow log collector that are associated.
    vpcCrn String
    vpcName String
    flowLogCollectors GetIsFlowLogsFlowLogCollector[]
    (List) Lists all the flow logs in the IBM Cloud.
    id string
    (String) The unique identifier of the flow log collector.
    name string
    (String) The flow log collector name.
    resourceGroup string
    (String) The resource group Id of the flow log.
    target string
    (String) The target ID that the flow log collector collects the flow logs.
    targetResourceType string
    vpc string
    (String) The VPC of the flow log collector that are associated.
    vpcCrn string
    vpcName string
    flow_log_collectors Sequence[GetIsFlowLogsFlowLogCollector]
    (List) Lists all the flow logs in the IBM Cloud.
    id str
    (String) The unique identifier of the flow log collector.
    name str
    (String) The flow log collector name.
    resource_group str
    (String) The resource group Id of the flow log.
    target str
    (String) The target ID that the flow log collector collects the flow logs.
    target_resource_type str
    vpc str
    (String) The VPC of the flow log collector that are associated.
    vpc_crn str
    vpc_name str
    flowLogCollectors List<Property Map>
    (List) Lists all the flow logs in the IBM Cloud.
    id String
    (String) The unique identifier of the flow log collector.
    name String
    (String) The flow log collector name.
    resourceGroup String
    (String) The resource group Id of the flow log.
    target String
    (String) The target ID that the flow log collector collects the flow logs.
    targetResourceType String
    vpc String
    (String) The VPC of the flow log collector that are associated.
    vpcCrn String
    vpcName String

    Supporting Types

    GetIsFlowLogsFlowLogCollector

    AccessTags List<string>
    (String) Access management tags associated for flow log.
    Active bool
    (String) Indicates whether the collector is active.
    CreatedAt string
    (Timestamp) The date and time the flow log created.
    Crn string
    (String) The CRN of the flow log collector.
    Href string
    (String) The URL of the flow log collector.
    Id string
    (String) The unique identifier of the flow log collector.
    LifecycleState string
    (String) The lifecycle state of the flow log collector.
    Name string
    The name of the flow log collector
    ResourceGroup string
    The ID of the Resource group this flow log collector belongs to
    StorageBucket string
    (String) The IBM Cloud Object Storage bucket name where the flow logs are logged.
    Tags List<string>
    Target string
    The ID of the target this collector is collecting flow logs for.
    Vpc string
    The ID of the VPC this flow log collector resides in
    AccessTags []string
    (String) Access management tags associated for flow log.
    Active bool
    (String) Indicates whether the collector is active.
    CreatedAt string
    (Timestamp) The date and time the flow log created.
    Crn string
    (String) The CRN of the flow log collector.
    Href string
    (String) The URL of the flow log collector.
    Id string
    (String) The unique identifier of the flow log collector.
    LifecycleState string
    (String) The lifecycle state of the flow log collector.
    Name string
    The name of the flow log collector
    ResourceGroup string
    The ID of the Resource group this flow log collector belongs to
    StorageBucket string
    (String) The IBM Cloud Object Storage bucket name where the flow logs are logged.
    Tags []string
    Target string
    The ID of the target this collector is collecting flow logs for.
    Vpc string
    The ID of the VPC this flow log collector resides in
    accessTags List<String>
    (String) Access management tags associated for flow log.
    active Boolean
    (String) Indicates whether the collector is active.
    createdAt String
    (Timestamp) The date and time the flow log created.
    crn String
    (String) The CRN of the flow log collector.
    href String
    (String) The URL of the flow log collector.
    id String
    (String) The unique identifier of the flow log collector.
    lifecycleState String
    (String) The lifecycle state of the flow log collector.
    name String
    The name of the flow log collector
    resourceGroup String
    The ID of the Resource group this flow log collector belongs to
    storageBucket String
    (String) The IBM Cloud Object Storage bucket name where the flow logs are logged.
    tags List<String>
    target String
    The ID of the target this collector is collecting flow logs for.
    vpc String
    The ID of the VPC this flow log collector resides in
    accessTags string[]
    (String) Access management tags associated for flow log.
    active boolean
    (String) Indicates whether the collector is active.
    createdAt string
    (Timestamp) The date and time the flow log created.
    crn string
    (String) The CRN of the flow log collector.
    href string
    (String) The URL of the flow log collector.
    id string
    (String) The unique identifier of the flow log collector.
    lifecycleState string
    (String) The lifecycle state of the flow log collector.
    name string
    The name of the flow log collector
    resourceGroup string
    The ID of the Resource group this flow log collector belongs to
    storageBucket string
    (String) The IBM Cloud Object Storage bucket name where the flow logs are logged.
    tags string[]
    target string
    The ID of the target this collector is collecting flow logs for.
    vpc string
    The ID of the VPC this flow log collector resides in
    access_tags Sequence[str]
    (String) Access management tags associated for flow log.
    active bool
    (String) Indicates whether the collector is active.
    created_at str
    (Timestamp) The date and time the flow log created.
    crn str
    (String) The CRN of the flow log collector.
    href str
    (String) The URL of the flow log collector.
    id str
    (String) The unique identifier of the flow log collector.
    lifecycle_state str
    (String) The lifecycle state of the flow log collector.
    name str
    The name of the flow log collector
    resource_group str
    The ID of the Resource group this flow log collector belongs to
    storage_bucket str
    (String) The IBM Cloud Object Storage bucket name where the flow logs are logged.
    tags Sequence[str]
    target str
    The ID of the target this collector is collecting flow logs for.
    vpc str
    The ID of the VPC this flow log collector resides in
    accessTags List<String>
    (String) Access management tags associated for flow log.
    active Boolean
    (String) Indicates whether the collector is active.
    createdAt String
    (Timestamp) The date and time the flow log created.
    crn String
    (String) The CRN of the flow log collector.
    href String
    (String) The URL of the flow log collector.
    id String
    (String) The unique identifier of the flow log collector.
    lifecycleState String
    (String) The lifecycle state of the flow log collector.
    name String
    The name of the flow log collector
    resourceGroup String
    The ID of the Resource group this flow log collector belongs to
    storageBucket String
    (String) The IBM Cloud Object Storage bucket name where the flow logs are logged.
    tags List<String>
    target String
    The ID of the target this collector is collecting flow logs for.
    vpc String
    The ID of the VPC this flow log collector resides in

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud