Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi
alicloud.vpc.getVpcFlowLogs
Explore with Pulumi AI
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)
public static Output<GetVpcFlowLogsResult> getVpcFlowLogs(GetVpcFlowLogsArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:vpc/getVpcFlowLogs:getVpcFlowLogs
arguments:
# arguments dictionary
The following arguments are supported:
- Description
Changes to this property will trigger replacement.
- The Description of flow log.
- Flow
Log Name Changes to this property will trigger replacement.
- The flow log name.
- Ids
Changes to this property will trigger replacement.
- A list of Flow Log IDs.
- Log
Store Name Changes to this property will trigger replacement.
- The log store name.
- Name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Flow Log name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Project
Name Changes to this property will trigger replacement.
- The project name.
- Resource
Id Changes to this property will trigger replacement.
- The resource id.
- Resource
Type Changes to this property will trigger replacement.
- The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - Status
Changes to this property will trigger replacement.
- The status of flow log. Valid values:
Active
,Inactive
. - Traffic
Type Changes to this property will trigger replacement.
- The traffic type. Valid values:
All
,Allow
,Drop
.
- Description
Changes to this property will trigger replacement.
- The Description of flow log.
- Flow
Log Name Changes to this property will trigger replacement.
- The flow log name.
- Ids
Changes to this property will trigger replacement.
- A list of Flow Log IDs.
- Log
Store Name Changes to this property will trigger replacement.
- The log store name.
- Name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Flow Log name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Project
Name Changes to this property will trigger replacement.
- The project name.
- Resource
Id Changes to this property will trigger replacement.
- The resource id.
- Resource
Type Changes to this property will trigger replacement.
- The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - Status
Changes to this property will trigger replacement.
- The status of flow log. Valid values:
Active
,Inactive
. - Traffic
Type Changes to this property will trigger replacement.
- The traffic type. Valid values:
All
,Allow
,Drop
.
- description
Changes to this property will trigger replacement.
- The Description of flow log.
- flow
Log Name Changes to this property will trigger replacement.
- The flow log name.
- ids
Changes to this property will trigger replacement.
- A list of Flow Log IDs.
- log
Store Name Changes to this property will trigger replacement.
- The log store name.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Flow Log name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - project
Name Changes to this property will trigger replacement.
- The project name.
- resource
Id Changes to this property will trigger replacement.
- The resource id.
- resource
Type Changes to this property will trigger replacement.
- The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - status
Changes to this property will trigger replacement.
- The status of flow log. Valid values:
Active
,Inactive
. - traffic
Type Changes to this property will trigger replacement.
- The traffic type. Valid values:
All
,Allow
,Drop
.
- description
Changes to this property will trigger replacement.
- The Description of flow log.
- flow
Log Name Changes to this property will trigger replacement.
- The flow log name.
- ids
Changes to this property will trigger replacement.
- A list of Flow Log IDs.
- log
Store Name Changes to this property will trigger replacement.
- The log store name.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Flow Log name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - project
Name Changes to this property will trigger replacement.
- The project name.
- resource
Id Changes to this property will trigger replacement.
- The resource id.
- resource
Type Changes to this property will trigger replacement.
- The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - status
Changes to this property will trigger replacement.
- The status of flow log. Valid values:
Active
,Inactive
. - traffic
Type Changes to this property will trigger replacement.
- The traffic type. Valid values:
All
,Allow
,Drop
.
- description
Changes to this property will trigger replacement.
- The Description of flow log.
- flow_
log_ name Changes to this property will trigger replacement.
- The flow log name.
- ids
Changes to this property will trigger replacement.
- A list of Flow Log IDs.
- log_
store_ name Changes to this property will trigger replacement.
- The log store name.
- name_
regex Changes to this property will trigger replacement.
- 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.
- The project name.
- resource_
id Changes to this property will trigger replacement.
- The resource id.
- resource_
type Changes to this property will trigger replacement.
- The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - status
Changes to this property will trigger replacement.
- The status of flow log. Valid values:
Active
,Inactive
. - traffic_
type Changes to this property will trigger replacement.
- The traffic type. Valid values:
All
,Allow
,Drop
.
- description
Changes to this property will trigger replacement.
- The Description of flow log.
- flow
Log Name Changes to this property will trigger replacement.
- The flow log name.
- ids
Changes to this property will trigger replacement.
- A list of Flow Log IDs.
- log
Store Name Changes to this property will trigger replacement.
- The log store name.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Flow Log name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - project
Name Changes to this property will trigger replacement.
- The project name.
- resource
Id Changes to this property will trigger replacement.
- The resource id.
- resource
Type Changes to this property will trigger replacement.
- The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - status
Changes to this property will trigger replacement.
- The status of flow log. Valid values:
Active
,Inactive
. - traffic
Type Changes to this property will trigger replacement.
- 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.
Ali Cloud. Vpc. Outputs. Get Vpc Flow Logs Log> - Names List<string>
- Description string
- Flow
Log stringName - Log
Store stringName - Name
Regex string - Output
File string - Project
Name string - Resource
Id string - Resource
Type string - Status string
- Traffic
Type string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Logs
[]Get
Vpc Flow Logs Log - Names []string
- Description string
- Flow
Log stringName - Log
Store stringName - Name
Regex string - Output
File string - Project
Name string - Resource
Id string - Resource
Type string - Status string
- Traffic
Type string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- logs
List<Get
Vpc Flow Logs Log> - names List<String>
- description String
- flow
Log StringName - log
Store StringName - name
Regex String - output
File String - project
Name String - resource
Id String - resource
Type String - status String
- traffic
Type String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- logs
Get
Vpc Flow Logs Log[] - names string[]
- description string
- flow
Log stringName - log
Store stringName - name
Regex string - output
File string - project
Name string - resource
Id string - resource
Type string - status string
- traffic
Type string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- logs
Sequence[Get
Vpc Flow Logs Log] - names Sequence[str]
- description str
- flow_
log_ strname - log_
store_ strname - 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
- flow
Log StringName - log
Store StringName - name
Regex String - output
File String - project
Name String - resource
Id String - resource
Type String - status String
- traffic
Type String
Supporting Types
GetVpcFlowLogsLog
- Description
This property is required. string - The Description of flow log.
- Flow
Log Id This property is required. string - The flow log ID.
- Flow
Log Name This property is required. string - The flow log name.
- Id
This property is required. string - The ID of the Flow Log.
- Log
Store Name This property is required. string - The log store name.
- Project
Name This property is required. string - The project name.
- Resource
Id This property is required. string - The resource id.
- Resource
Type This property is required. string - The resource type.
- Status
This property is required. string - The status of flow log.
- Traffic
Type This property is required. string - The traffic type.
- Description
This property is required. string - The Description of flow log.
- Flow
Log Id This property is required. string - The flow log ID.
- Flow
Log Name This property is required. string - The flow log name.
- Id
This property is required. string - The ID of the Flow Log.
- Log
Store Name This property is required. string - The log store name.
- Project
Name This property is required. string - The project name.
- Resource
Id This property is required. string - The resource id.
- Resource
Type This property is required. string - The resource type.
- Status
This property is required. string - The status of flow log.
- Traffic
Type This property is required. string - The traffic type.
- description
This property is required. String - The Description of flow log.
- flow
Log Id This property is required. String - The flow log ID.
- flow
Log Name This property is required. String - The flow log name.
- id
This property is required. String - The ID of the Flow Log.
- log
Store Name This property is required. String - The log store name.
- project
Name This property is required. String - The project name.
- resource
Id This property is required. String - The resource id.
- resource
Type This property is required. String - The resource type.
- status
This property is required. String - The status of flow log.
- traffic
Type This property is required. String - The traffic type.
- description
This property is required. string - The Description of flow log.
- flow
Log Id This property is required. string - The flow log ID.
- flow
Log Name This property is required. string - The flow log name.
- id
This property is required. string - The ID of the Flow Log.
- log
Store Name This property is required. string - The log store name.
- project
Name This property is required. string - The project name.
- resource
Id This property is required. string - The resource id.
- resource
Type This property is required. string - The resource type.
- status
This property is required. string - The status of flow log.
- traffic
Type 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.
- flow
Log Id This property is required. String - The flow log ID.
- flow
Log Name This property is required. String - The flow log name.
- id
This property is required. String - The ID of the Flow Log.
- log
Store Name This property is required. String - The log store name.
- project
Name This property is required. String - The project name.
- resource
Id This property is required. String - The resource id.
- resource
Type This property is required. String - The resource type.
- status
This property is required. String - The status of flow log.
- traffic
Type 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.