Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 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 since 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)
public static Output<GetTrafficMirrorFiltersResult> getTrafficMirrorFilters(GetTrafficMirrorFiltersArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:vpc/getTrafficMirrorFilters:getTrafficMirrorFilters
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Ids List<string>
- A list of Traffic Mirror Filter IDs.
- NameRegex string
- A regex string to filter results by Traffic Mirror Filter name.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- Status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- TrafficMirror stringFilter Name 
- The name of the filter. The name must be 2to128characters 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.
- NameRegex string
- A regex string to filter results by Traffic Mirror Filter name.
- OutputFile string
- File name where to save data source results (after running pulumi preview).
- Status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- TrafficMirror stringFilter Name 
- The name of the filter. The name must be 2to128characters 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.
- nameRegex String
- A regex string to filter results by Traffic Mirror Filter name.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- status String
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror StringFilter Name 
- The name of the filter. The name must be 2to128characters 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.
- nameRegex string
- A regex string to filter results by Traffic Mirror Filter name.
- outputFile string
- File name where to save data source results (after running pulumi preview).
- status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror stringFilter Name 
- The name of the filter. The name must be 2to128characters 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,ModifyingandDeleting.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 2to128characters 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.
- nameRegex String
- A regex string to filter results by Traffic Mirror Filter name.
- outputFile String
- File name where to save data source results (after running pulumi preview).
- status String
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror StringFilter Name 
- The name of the filter. The name must be 2to128characters 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> 
- A list of Vpc Traffic Mirror Filters. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- A list of Traffic Mirror Filter names.
- NameRegex string
- OutputFile string
- Status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- TrafficMirror stringFilter Name 
- The name of the filter.
- Filters
[]GetTraffic Mirror Filters Filter 
- A list of Vpc Traffic Mirror Filters. Each element contains the following attributes:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- A list of Traffic Mirror Filter names.
- NameRegex string
- OutputFile string
- Status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- TrafficMirror stringFilter Name 
- The name of the filter.
- filters
List<GetTraffic Mirror Filters Filter> 
- A list of Vpc Traffic Mirror Filters. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Traffic Mirror Filter names.
- nameRegex String
- outputFile String
- status String
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror StringFilter Name 
- The name of the filter.
- filters
GetTraffic Mirror Filters Filter[] 
- A list of Vpc Traffic Mirror Filters. Each element contains the following attributes:
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- A list of Traffic Mirror Filter names.
- nameRegex string
- outputFile string
- status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror stringFilter Name 
- The name of the filter.
- filters
Sequence[GetTraffic Mirror Filters Filter] 
- A list of Vpc Traffic Mirror Filters. Each element contains the following attributes:
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- A list of Traffic Mirror Filter names.
- name_regex str
- output_file str
- status str
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.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.
- filters List<Property Map>
- A list of Vpc Traffic Mirror Filters. Each element contains the following attributes:
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Traffic Mirror Filter names.
- nameRegex String
- outputFile String
- status String
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror StringFilter Name 
- The name of the filter.
Supporting Types
GetTrafficMirrorFiltersFilter    
- Id string
- The ID of the Traffic Mirror Filter.
- Status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- TrafficMirror stringFilter Description 
- The description of the filter.
- TrafficMirror stringFilter Id 
- The ID of the filter.
- TrafficMirror stringFilter Name 
- The name of the filter. The name must be 2to128characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://orhttps://.
- Id string
- The ID of the Traffic Mirror Filter.
- Status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- TrafficMirror stringFilter Description 
- The description of the filter.
- TrafficMirror stringFilter Id 
- The ID of the filter.
- TrafficMirror stringFilter Name 
- The name of the filter. The name must be 2to128characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://orhttps://.
- id String
- The ID of the Traffic Mirror Filter.
- status String
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror StringFilter Description 
- The description of the filter.
- trafficMirror StringFilter Id 
- The ID of the filter.
- trafficMirror StringFilter Name 
- The name of the filter. The name must be 2to128characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://orhttps://.
- id string
- The ID of the Traffic Mirror Filter.
- status string
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror stringFilter Description 
- The description of the filter.
- trafficMirror stringFilter Id 
- The ID of the filter.
- trafficMirror stringFilter Name 
- The name of the filter. The name must be 2to128characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://orhttps://.
- id str
- The ID of the Traffic Mirror Filter.
- status str
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.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. The name must be 2to128characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://orhttps://.
- id String
- The ID of the Traffic Mirror Filter.
- status String
- The state of the filter. Valid values:Creating,Created,ModifyingandDeleting.Creating: The filter is being created.Created: The filter is created.Modifying: The filter is being modified.Deleting: The filter is being deleted.
- trafficMirror StringFilter Description 
- The description of the filter.
- trafficMirror StringFilter Id 
- The ID of the filter.
- trafficMirror StringFilter Name 
- The name of the filter. The name must be 2to128characters in length, and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start withhttp://orhttps://.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.