Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 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)
// 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.
- Flow
Log stringName - The flow log name.
- Ids List<string>
- A list of Flow Log IDs.
- Log
Store stringName - The log store name.
- Name
Regex string - 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 string - The project name.
- Resource
Id string - The resource id.
- Resource
Type string - The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - Status string
- The status of flow log. Valid values:
Active
,Inactive
. - Traffic
Type string - The traffic type. Valid values:
All
,Allow
,Drop
.
- Description string
- The Description of flow log.
- Flow
Log stringName - The flow log name.
- Ids []string
- A list of Flow Log IDs.
- Log
Store stringName - The log store name.
- Name
Regex string - 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 string - The project name.
- Resource
Id string - The resource id.
- Resource
Type string - The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - Status string
- The status of flow log. Valid values:
Active
,Inactive
. - Traffic
Type string - The traffic type. Valid values:
All
,Allow
,Drop
.
- description String
- The Description of flow log.
- flow
Log StringName - The flow log name.
- ids List<String>
- A list of Flow Log IDs.
- log
Store StringName - The log store name.
- name
Regex String - 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 String - The project name.
- resource
Id String - The resource id.
- resource
Type String - The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - status String
- The status of flow log. Valid values:
Active
,Inactive
. - traffic
Type String - The traffic type. Valid values:
All
,Allow
,Drop
.
- description string
- The Description of flow log.
- flow
Log stringName - The flow log name.
- ids string[]
- A list of Flow Log IDs.
- log
Store stringName - The log store name.
- name
Regex string - 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 string - The project name.
- resource
Id string - The resource id.
- resource
Type string - The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - status string
- The status of flow log. Valid values:
Active
,Inactive
. - traffic
Type string - The traffic type. Valid values:
All
,Allow
,Drop
.
- description str
- The Description of flow log.
- flow_
log_ strname - The flow log name.
- ids Sequence[str]
- A list of Flow Log IDs.
- log_
store_ strname - 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.
- flow
Log StringName - The flow log name.
- ids List<String>
- A list of Flow Log IDs.
- log
Store StringName - The log store name.
- name
Regex String - 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 String - The project name.
- resource
Id String - The resource id.
- resource
Type String - The resource type. Valid values:
NetworkInterface
,VPC
,VSwitch
. - status String
- The status of flow log. Valid values:
Active
,Inactive
. - traffic
Type 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.
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 string
- The Description of flow log.
- Flow
Log stringId - The flow log ID.
- Flow
Log stringName - The flow log name.
- Id string
- The ID of the Flow Log.
- Log
Store stringName - The log store name.
- Project
Name string - The project name.
- Resource
Id string - The resource id.
- Resource
Type string - The resource type.
- Status string
- The status of flow log.
- Traffic
Type string - The traffic type.
- Description string
- The Description of flow log.
- Flow
Log stringId - The flow log ID.
- Flow
Log stringName - The flow log name.
- Id string
- The ID of the Flow Log.
- Log
Store stringName - The log store name.
- Project
Name string - The project name.
- Resource
Id string - The resource id.
- Resource
Type string - The resource type.
- Status string
- The status of flow log.
- Traffic
Type string - The traffic type.
- description String
- The Description of flow log.
- flow
Log StringId - The flow log ID.
- flow
Log StringName - The flow log name.
- id String
- The ID of the Flow Log.
- log
Store StringName - The log store name.
- project
Name String - The project name.
- resource
Id String - The resource id.
- resource
Type String - The resource type.
- status String
- The status of flow log.
- traffic
Type String - The traffic type.
- description string
- The Description of flow log.
- flow
Log stringId - The flow log ID.
- flow
Log stringName - The flow log name.
- id string
- The ID of the Flow Log.
- log
Store stringName - The log store name.
- project
Name string - The project name.
- resource
Id string - The resource id.
- resource
Type string - The resource type.
- status string
- The status of flow log.
- traffic
Type string - The traffic type.
- description str
- The Description of flow log.
- flow_
log_ strid - The flow log ID.
- flow_
log_ strname - The flow log name.
- id str
- The ID of the Flow Log.
- log_
store_ strname - 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.
- flow
Log StringId - The flow log ID.
- flow
Log StringName - The flow log name.
- id String
- The ID of the Flow Log.
- log
Store StringName - The log store name.
- project
Name String - The project name.
- resource
Id String - The resource id.
- resource
Type String - The resource type.
- status String
- The status of flow log.
- traffic
Type 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.