Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.vpc.getTrafficMirrorFilters
Explore with Pulumi AI
This data source provides the Vpc Traffic Mirror Filters of the current Alibaba Cloud user.
NOTE: Available in v1.140.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.vpc.getTrafficMirrorFilters({
ids: ["example_id"],
});
export const vpcTrafficMirrorFilterId1 = ids.then(ids => ids.filters?.[0]?.id);
const nameRegex = alicloud.vpc.getTrafficMirrorFilters({
nameRegex: "^my-TrafficMirrorFilter",
});
export const vpcTrafficMirrorFilterId2 = nameRegex.then(nameRegex => nameRegex.filters?.[0]?.id);
const filterName = alicloud.vpc.getTrafficMirrorFilters({
trafficMirrorFilterName: "example_traffic_mirror_filter_name",
});
export const vpcTrafficMirrorFilterId3 = filterName.then(filterName => filterName.filters?.[0]?.id);
const status = alicloud.vpc.getTrafficMirrorFilters({
status: "^my-TrafficMirrorFilter",
});
export const vpcTrafficMirrorFilterId4 = status.then(status => status.filters?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.vpc.get_traffic_mirror_filters(ids=["example_id"])
pulumi.export("vpcTrafficMirrorFilterId1", ids.filters[0].id)
name_regex = alicloud.vpc.get_traffic_mirror_filters(name_regex="^my-TrafficMirrorFilter")
pulumi.export("vpcTrafficMirrorFilterId2", name_regex.filters[0].id)
filter_name = alicloud.vpc.get_traffic_mirror_filters(traffic_mirror_filter_name="example_traffic_mirror_filter_name")
pulumi.export("vpcTrafficMirrorFilterId3", filter_name.filters[0].id)
status = alicloud.vpc.get_traffic_mirror_filters(status="^my-TrafficMirrorFilter")
pulumi.export("vpcTrafficMirrorFilterId4", status.filters[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 {
ids, err := vpc.GetTrafficMirrorFilters(ctx, &vpc.GetTrafficMirrorFiltersArgs{
Ids: []string{
"example_id",
},
}, nil)
if err != nil {
return err
}
ctx.Export("vpcTrafficMirrorFilterId1", ids.Filters[0].Id)
nameRegex, err := vpc.GetTrafficMirrorFilters(ctx, &vpc.GetTrafficMirrorFiltersArgs{
NameRegex: pulumi.StringRef("^my-TrafficMirrorFilter"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcTrafficMirrorFilterId2", nameRegex.Filters[0].Id)
filterName, err := vpc.GetTrafficMirrorFilters(ctx, &vpc.GetTrafficMirrorFiltersArgs{
TrafficMirrorFilterName: pulumi.StringRef("example_traffic_mirror_filter_name"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcTrafficMirrorFilterId3", filterName.Filters[0].Id)
status, err := vpc.GetTrafficMirrorFilters(ctx, &vpc.GetTrafficMirrorFiltersArgs{
Status: pulumi.StringRef("^my-TrafficMirrorFilter"),
}, nil)
if err != nil {
return err
}
ctx.Export("vpcTrafficMirrorFilterId4", status.Filters[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Vpc.GetTrafficMirrorFilters.Invoke(new()
{
Ids = new[]
{
"example_id",
},
});
var nameRegex = AliCloud.Vpc.GetTrafficMirrorFilters.Invoke(new()
{
NameRegex = "^my-TrafficMirrorFilter",
});
var filterName = AliCloud.Vpc.GetTrafficMirrorFilters.Invoke(new()
{
TrafficMirrorFilterName = "example_traffic_mirror_filter_name",
});
var status = AliCloud.Vpc.GetTrafficMirrorFilters.Invoke(new()
{
Status = "^my-TrafficMirrorFilter",
});
return new Dictionary<string, object?>
{
["vpcTrafficMirrorFilterId1"] = ids.Apply(getTrafficMirrorFiltersResult => getTrafficMirrorFiltersResult.Filters[0]?.Id),
["vpcTrafficMirrorFilterId2"] = nameRegex.Apply(getTrafficMirrorFiltersResult => getTrafficMirrorFiltersResult.Filters[0]?.Id),
["vpcTrafficMirrorFilterId3"] = filterName.Apply(getTrafficMirrorFiltersResult => getTrafficMirrorFiltersResult.Filters[0]?.Id),
["vpcTrafficMirrorFilterId4"] = status.Apply(getTrafficMirrorFiltersResult => getTrafficMirrorFiltersResult.Filters[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.GetTrafficMirrorFiltersArgs;
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 ids = VpcFunctions.getTrafficMirrorFilters(GetTrafficMirrorFiltersArgs.builder()
.ids("example_id")
.build());
ctx.export("vpcTrafficMirrorFilterId1", ids.applyValue(getTrafficMirrorFiltersResult -> getTrafficMirrorFiltersResult.filters()[0].id()));
final var nameRegex = VpcFunctions.getTrafficMirrorFilters(GetTrafficMirrorFiltersArgs.builder()
.nameRegex("^my-TrafficMirrorFilter")
.build());
ctx.export("vpcTrafficMirrorFilterId2", nameRegex.applyValue(getTrafficMirrorFiltersResult -> getTrafficMirrorFiltersResult.filters()[0].id()));
final var filterName = VpcFunctions.getTrafficMirrorFilters(GetTrafficMirrorFiltersArgs.builder()
.trafficMirrorFilterName("example_traffic_mirror_filter_name")
.build());
ctx.export("vpcTrafficMirrorFilterId3", filterName.applyValue(getTrafficMirrorFiltersResult -> getTrafficMirrorFiltersResult.filters()[0].id()));
final var status = VpcFunctions.getTrafficMirrorFilters(GetTrafficMirrorFiltersArgs.builder()
.status("^my-TrafficMirrorFilter")
.build());
ctx.export("vpcTrafficMirrorFilterId4", status.applyValue(getTrafficMirrorFiltersResult -> getTrafficMirrorFiltersResult.filters()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:vpc:getTrafficMirrorFilters
Arguments:
ids:
- example_id
nameRegex:
fn::invoke:
Function: alicloud:vpc:getTrafficMirrorFilters
Arguments:
nameRegex: ^my-TrafficMirrorFilter
filterName:
fn::invoke:
Function: alicloud:vpc:getTrafficMirrorFilters
Arguments:
trafficMirrorFilterName: example_traffic_mirror_filter_name
status:
fn::invoke:
Function: alicloud:vpc:getTrafficMirrorFilters
Arguments:
status: ^my-TrafficMirrorFilter
outputs:
vpcTrafficMirrorFilterId1: ${ids.filters[0].id}
vpcTrafficMirrorFilterId2: ${nameRegex.filters[0].id}
vpcTrafficMirrorFilterId3: ${filterName.filters[0].id}
vpcTrafficMirrorFilterId4: ${status.filters[0].id}
Using getTrafficMirrorFilters
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 getTrafficMirrorFilters(args: GetTrafficMirrorFiltersArgs, opts?: InvokeOptions): Promise<GetTrafficMirrorFiltersResult>
function getTrafficMirrorFiltersOutput(args: GetTrafficMirrorFiltersOutputArgs, opts?: InvokeOptions): Output<GetTrafficMirrorFiltersResult>
def get_traffic_mirror_filters(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
status: Optional[str] = None,
traffic_mirror_filter_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTrafficMirrorFiltersResult
def get_traffic_mirror_filters_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
traffic_mirror_filter_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetTrafficMirrorFiltersResult]
func GetTrafficMirrorFilters(ctx *Context, args *GetTrafficMirrorFiltersArgs, opts ...InvokeOption) (*GetTrafficMirrorFiltersResult, error)
func GetTrafficMirrorFiltersOutput(ctx *Context, args *GetTrafficMirrorFiltersOutputArgs, opts ...InvokeOption) GetTrafficMirrorFiltersResultOutput
> Note: This function is named GetTrafficMirrorFilters
in the Go SDK.
public static class GetTrafficMirrorFilters
{
public static Task<GetTrafficMirrorFiltersResult> InvokeAsync(GetTrafficMirrorFiltersArgs args, InvokeOptions? opts = null)
public static Output<GetTrafficMirrorFiltersResult> Invoke(GetTrafficMirrorFiltersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTrafficMirrorFiltersResult> getTrafficMirrorFilters(GetTrafficMirrorFiltersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:vpc/getTrafficMirrorFilters:getTrafficMirrorFilters
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of Traffic Mirror Filter IDs.
- Name
Regex string - A regex string to filter results by Traffic Mirror Filter name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - Traffic
Mirror stringFilter Name - The name of the filter. The name must be
2
to128
characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://
orhttps://
.
- Ids []string
- A list of Traffic Mirror Filter IDs.
- Name
Regex string - A regex string to filter results by Traffic Mirror Filter name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status string
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - Traffic
Mirror stringFilter Name - The name of the filter. The name must be
2
to128
characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://
orhttps://
.
- ids List<String>
- A list of Traffic Mirror Filter IDs.
- name
Regex String - A regex string to filter results by Traffic Mirror Filter name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - traffic
Mirror StringFilter Name - The name of the filter. The name must be
2
to128
characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://
orhttps://
.
- ids string[]
- A list of Traffic Mirror Filter IDs.
- name
Regex string - A regex string to filter results by Traffic Mirror Filter name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - status string
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - traffic
Mirror stringFilter Name - The name of the filter. The name must be
2
to128
characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://
orhttps://
.
- ids Sequence[str]
- A list of Traffic Mirror Filter IDs.
- name_
regex str - A regex string to filter results by Traffic Mirror Filter name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - status str
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - traffic_
mirror_ strfilter_ name - The name of the filter. The name must be
2
to128
characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://
orhttps://
.
- ids List<String>
- A list of Traffic Mirror Filter IDs.
- name
Regex String - A regex string to filter results by Traffic Mirror Filter name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status String
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - traffic
Mirror StringFilter Name - The name of the filter. The name must be
2
to128
characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://
orhttps://
.
getTrafficMirrorFilters Result
The following output properties are available:
- Filters
List<Pulumi.
Ali Cloud. Vpc. Outputs. Get Traffic Mirror Filters Filter> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Name
Regex string - Output
File string - Status string
- Traffic
Mirror stringFilter Name
- Filters
[]Get
Traffic Mirror Filters Filter - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Name
Regex string - Output
File string - Status string
- Traffic
Mirror stringFilter Name
- filters
List<Get
Traffic Mirror Filters Filter> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- name
Regex String - output
File String - status String
- traffic
Mirror StringFilter Name
- filters
Get
Traffic Mirror Filters Filter[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- name
Regex string - output
File string - status string
- traffic
Mirror stringFilter Name
- filters
Sequence[Get
Traffic Mirror Filters Filter] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- name_
regex str - output_
file str - status str
- traffic_
mirror_ strfilter_ name
- filters List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- name
Regex String - output
File String - status String
- traffic
Mirror StringFilter Name
Supporting Types
GetTrafficMirrorFiltersFilter
- Id string
- The ID of the Traffic Mirror Filter.
- Status string
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - Traffic
Mirror stringFilter Description - The description of the filter.
- Traffic
Mirror stringFilter Id - The ID of the filter.
- Traffic
Mirror stringFilter Name - The name of the filter.
- Id string
- The ID of the Traffic Mirror Filter.
- Status string
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - Traffic
Mirror stringFilter Description - The description of the filter.
- Traffic
Mirror stringFilter Id - The ID of the filter.
- Traffic
Mirror stringFilter Name - The name of the filter.
- id String
- The ID of the Traffic Mirror Filter.
- status String
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - traffic
Mirror StringFilter Description - The description of the filter.
- traffic
Mirror StringFilter Id - The ID of the filter.
- traffic
Mirror StringFilter Name - The name of the filter.
- id string
- The ID of the Traffic Mirror Filter.
- status string
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - traffic
Mirror stringFilter Description - The description of the filter.
- traffic
Mirror stringFilter Id - The ID of the filter.
- traffic
Mirror stringFilter Name - The name of the filter.
- id str
- The ID of the Traffic Mirror Filter.
- status str
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - traffic_
mirror_ strfilter_ description - The description of the filter.
- traffic_
mirror_ strfilter_ id - The ID of the filter.
- traffic_
mirror_ strfilter_ name - The name of the filter.
- id String
- The ID of the Traffic Mirror Filter.
- status String
- The state of the filter. Valid values:
Creating
,Created
,Modifying
andDeleting
.Creating
: The filter is being created.Created
: The filter is created.Modifying
: The filter is being modified.Deleting
: The filter is being deleted. - traffic
Mirror StringFilter Description - The description of the filter.
- traffic
Mirror StringFilter Id - The ID of the filter.
- traffic
Mirror StringFilter Name - The name of the filter.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.