1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. vpc
  5. getTrafficMirrorFilterEgressRules
Alibaba Cloud v3.43.1 published on Monday, Sep 11, 2023 by Pulumi

alicloud.vpc.getTrafficMirrorFilterEgressRules

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.43.1 published on Monday, Sep 11, 2023 by Pulumi

    This data source provides the Vpc Traffic Mirror Filter Egress Rules of the current Alibaba Cloud user.

    NOTE: Available in v1.140.0+.

    Example Usage

    Basic Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Vpc.GetTrafficMirrorFilterEgressRules.Invoke(new()
        {
            TrafficMirrorFilterId = "example_traffic_mirror_filter_id",
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var status = AliCloud.Vpc.GetTrafficMirrorFilterEgressRules.Invoke(new()
        {
            TrafficMirrorFilterId = "example_traffic_mirror_filter_id",
            Ids = new[]
            {
                "example_id",
            },
            Status = "Created",
        });
    
        return new Dictionary<string, object?>
        {
            ["vpcTrafficMirrorFilterEgressRuleId1"] = ids.Apply(getTrafficMirrorFilterEgressRulesResult => getTrafficMirrorFilterEgressRulesResult.Rules[0]?.Id),
            ["vpcTrafficMirrorFilterEgressRuleId2"] = status.Apply(getTrafficMirrorFilterEgressRulesResult => getTrafficMirrorFilterEgressRulesResult.Rules[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.GetTrafficMirrorFilterEgressRules(ctx, &vpc.GetTrafficMirrorFilterEgressRulesArgs{
    			TrafficMirrorFilterId: "example_traffic_mirror_filter_id",
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpcTrafficMirrorFilterEgressRuleId1", ids.Rules[0].Id)
    		status, err := vpc.GetTrafficMirrorFilterEgressRules(ctx, &vpc.GetTrafficMirrorFilterEgressRulesArgs{
    			TrafficMirrorFilterId: "example_traffic_mirror_filter_id",
    			Ids: []string{
    				"example_id",
    			},
    			Status: pulumi.StringRef("Created"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("vpcTrafficMirrorFilterEgressRuleId2", status.Rules[0].Id)
    		return nil
    	})
    }
    
    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.GetTrafficMirrorFilterEgressRulesArgs;
    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.getTrafficMirrorFilterEgressRules(GetTrafficMirrorFilterEgressRulesArgs.builder()
                .trafficMirrorFilterId("example_traffic_mirror_filter_id")
                .ids("example_id")
                .build());
    
            ctx.export("vpcTrafficMirrorFilterEgressRuleId1", ids.applyValue(getTrafficMirrorFilterEgressRulesResult -> getTrafficMirrorFilterEgressRulesResult.rules()[0].id()));
            final var status = VpcFunctions.getTrafficMirrorFilterEgressRules(GetTrafficMirrorFilterEgressRulesArgs.builder()
                .trafficMirrorFilterId("example_traffic_mirror_filter_id")
                .ids("example_id")
                .status("Created")
                .build());
    
            ctx.export("vpcTrafficMirrorFilterEgressRuleId2", status.applyValue(getTrafficMirrorFilterEgressRulesResult -> getTrafficMirrorFilterEgressRulesResult.rules()[0].id()));
        }
    }
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.vpc.get_traffic_mirror_filter_egress_rules(traffic_mirror_filter_id="example_traffic_mirror_filter_id",
        ids=["example_id"])
    pulumi.export("vpcTrafficMirrorFilterEgressRuleId1", ids.rules[0].id)
    status = alicloud.vpc.get_traffic_mirror_filter_egress_rules(traffic_mirror_filter_id="example_traffic_mirror_filter_id",
        ids=["example_id"],
        status="Created")
    pulumi.export("vpcTrafficMirrorFilterEgressRuleId2", status.rules[0].id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.vpc.getTrafficMirrorFilterEgressRules({
        trafficMirrorFilterId: "example_traffic_mirror_filter_id",
        ids: ["example_id"],
    });
    export const vpcTrafficMirrorFilterEgressRuleId1 = ids.then(ids => ids.rules?.[0]?.id);
    const status = alicloud.vpc.getTrafficMirrorFilterEgressRules({
        trafficMirrorFilterId: "example_traffic_mirror_filter_id",
        ids: ["example_id"],
        status: "Created",
    });
    export const vpcTrafficMirrorFilterEgressRuleId2 = status.then(status => status.rules?.[0]?.id);
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:vpc:getTrafficMirrorFilterEgressRules
          Arguments:
            trafficMirrorFilterId: example_traffic_mirror_filter_id
            ids:
              - example_id
      status:
        fn::invoke:
          Function: alicloud:vpc:getTrafficMirrorFilterEgressRules
          Arguments:
            trafficMirrorFilterId: example_traffic_mirror_filter_id
            ids:
              - example_id
            status: Created
    outputs:
      vpcTrafficMirrorFilterEgressRuleId1: ${ids.rules[0].id}
      vpcTrafficMirrorFilterEgressRuleId2: ${status.rules[0].id}
    

    Using getTrafficMirrorFilterEgressRules

    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 getTrafficMirrorFilterEgressRules(args: GetTrafficMirrorFilterEgressRulesArgs, opts?: InvokeOptions): Promise<GetTrafficMirrorFilterEgressRulesResult>
    function getTrafficMirrorFilterEgressRulesOutput(args: GetTrafficMirrorFilterEgressRulesOutputArgs, opts?: InvokeOptions): Output<GetTrafficMirrorFilterEgressRulesResult>
    def get_traffic_mirror_filter_egress_rules(ids: Optional[Sequence[str]] = None,
                                               output_file: Optional[str] = None,
                                               status: Optional[str] = None,
                                               traffic_mirror_filter_id: Optional[str] = None,
                                               opts: Optional[InvokeOptions] = None) -> GetTrafficMirrorFilterEgressRulesResult
    def get_traffic_mirror_filter_egress_rules_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                               output_file: Optional[pulumi.Input[str]] = None,
                                               status: Optional[pulumi.Input[str]] = None,
                                               traffic_mirror_filter_id: Optional[pulumi.Input[str]] = None,
                                               opts: Optional[InvokeOptions] = None) -> Output[GetTrafficMirrorFilterEgressRulesResult]
    func GetTrafficMirrorFilterEgressRules(ctx *Context, args *GetTrafficMirrorFilterEgressRulesArgs, opts ...InvokeOption) (*GetTrafficMirrorFilterEgressRulesResult, error)
    func GetTrafficMirrorFilterEgressRulesOutput(ctx *Context, args *GetTrafficMirrorFilterEgressRulesOutputArgs, opts ...InvokeOption) GetTrafficMirrorFilterEgressRulesResultOutput

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

    public static class GetTrafficMirrorFilterEgressRules 
    {
        public static Task<GetTrafficMirrorFilterEgressRulesResult> InvokeAsync(GetTrafficMirrorFilterEgressRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetTrafficMirrorFilterEgressRulesResult> Invoke(GetTrafficMirrorFilterEgressRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTrafficMirrorFilterEgressRulesResult> getTrafficMirrorFilterEgressRules(GetTrafficMirrorFilterEgressRulesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:vpc/getTrafficMirrorFilterEgressRules:getTrafficMirrorFilterEgressRules
      arguments:
        # arguments dictionary

    The following arguments are supported:

    TrafficMirrorFilterId string

    The ID of the filter associated with the outbound rule.

    Ids List<string>

    A list of Traffic Mirror Filter Egress Rule IDs.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    Status string

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    TrafficMirrorFilterId string

    The ID of the filter associated with the outbound rule.

    Ids []string

    A list of Traffic Mirror Filter Egress Rule IDs.

    OutputFile string

    File name where to save data source results (after running pulumi preview).

    Status string

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    trafficMirrorFilterId String

    The ID of the filter associated with the outbound rule.

    ids List<String>

    A list of Traffic Mirror Filter Egress Rule IDs.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    status String

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    trafficMirrorFilterId string

    The ID of the filter associated with the outbound rule.

    ids string[]

    A list of Traffic Mirror Filter Egress Rule IDs.

    outputFile string

    File name where to save data source results (after running pulumi preview).

    status string

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    traffic_mirror_filter_id str

    The ID of the filter associated with the outbound rule.

    ids Sequence[str]

    A list of Traffic Mirror Filter Egress Rule IDs.

    output_file str

    File name where to save data source results (after running pulumi preview).

    status str

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    trafficMirrorFilterId String

    The ID of the filter associated with the outbound rule.

    ids List<String>

    A list of Traffic Mirror Filter Egress Rule IDs.

    outputFile String

    File name where to save data source results (after running pulumi preview).

    status String

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    getTrafficMirrorFilterEgressRules Result

    The following output properties are available:

    Id string

    The provider-assigned unique ID for this managed resource.

    Ids List<string>
    Rules List<Pulumi.AliCloud.Vpc.Outputs.GetTrafficMirrorFilterEgressRulesRule>
    TrafficMirrorFilterId string
    OutputFile string
    Status string
    Id string

    The provider-assigned unique ID for this managed resource.

    Ids []string
    Rules []GetTrafficMirrorFilterEgressRulesRule
    TrafficMirrorFilterId string
    OutputFile string
    Status string
    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    rules List<GetTrafficMirrorFilterEgressRulesRule>
    trafficMirrorFilterId String
    outputFile String
    status String
    id string

    The provider-assigned unique ID for this managed resource.

    ids string[]
    rules GetTrafficMirrorFilterEgressRulesRule[]
    trafficMirrorFilterId string
    outputFile string
    status string
    id str

    The provider-assigned unique ID for this managed resource.

    ids Sequence[str]
    rules Sequence[GetTrafficMirrorFilterEgressRulesRule]
    traffic_mirror_filter_id str
    output_file str
    status str
    id String

    The provider-assigned unique ID for this managed resource.

    ids List<String>
    rules List<Property Map>
    trafficMirrorFilterId String
    outputFile String
    status String

    Supporting Types

    GetTrafficMirrorFilterEgressRulesRule

    DestinationCidrBlock string

    The destination CIDR block of the outbound traffic.

    DestinationPortRange string

    The destination port range of the outbound traffic.

    Id string

    The ID of the Traffic Mirror Filter Egress Rule.

    Priority int

    The priority of the outbound rule. A smaller value indicates a higher priority. The maximum value is 10, which indicates that you can configure at most 10 inbound rules for a filter.

    Protocol string

    The transport protocol used by outbound traffic that needs to be mirrored. Valid values: ALL, ICMP, TCP, UDP.

    RuleAction string

    The collection policy of the inbound rule. Valid values: accept or drop. accept: collects network traffic. drop: does not collect network traffic.

    SourceCidrBlock string

    The source CIDR block of the outbound traffic.

    SourcePortRange string

    The source port range of the outbound traffic.

    Status string

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    TrafficMirrorFilterId string

    The ID of the filter associated with the outbound rule.

    TrafficMirrorFilterRuleId string

    The first ID of the resource.

    DestinationCidrBlock string

    The destination CIDR block of the outbound traffic.

    DestinationPortRange string

    The destination port range of the outbound traffic.

    Id string

    The ID of the Traffic Mirror Filter Egress Rule.

    Priority int

    The priority of the outbound rule. A smaller value indicates a higher priority. The maximum value is 10, which indicates that you can configure at most 10 inbound rules for a filter.

    Protocol string

    The transport protocol used by outbound traffic that needs to be mirrored. Valid values: ALL, ICMP, TCP, UDP.

    RuleAction string

    The collection policy of the inbound rule. Valid values: accept or drop. accept: collects network traffic. drop: does not collect network traffic.

    SourceCidrBlock string

    The source CIDR block of the outbound traffic.

    SourcePortRange string

    The source port range of the outbound traffic.

    Status string

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    TrafficMirrorFilterId string

    The ID of the filter associated with the outbound rule.

    TrafficMirrorFilterRuleId string

    The first ID of the resource.

    destinationCidrBlock String

    The destination CIDR block of the outbound traffic.

    destinationPortRange String

    The destination port range of the outbound traffic.

    id String

    The ID of the Traffic Mirror Filter Egress Rule.

    priority Integer

    The priority of the outbound rule. A smaller value indicates a higher priority. The maximum value is 10, which indicates that you can configure at most 10 inbound rules for a filter.

    protocol String

    The transport protocol used by outbound traffic that needs to be mirrored. Valid values: ALL, ICMP, TCP, UDP.

    ruleAction String

    The collection policy of the inbound rule. Valid values: accept or drop. accept: collects network traffic. drop: does not collect network traffic.

    sourceCidrBlock String

    The source CIDR block of the outbound traffic.

    sourcePortRange String

    The source port range of the outbound traffic.

    status String

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    trafficMirrorFilterId String

    The ID of the filter associated with the outbound rule.

    trafficMirrorFilterRuleId String

    The first ID of the resource.

    destinationCidrBlock string

    The destination CIDR block of the outbound traffic.

    destinationPortRange string

    The destination port range of the outbound traffic.

    id string

    The ID of the Traffic Mirror Filter Egress Rule.

    priority number

    The priority of the outbound rule. A smaller value indicates a higher priority. The maximum value is 10, which indicates that you can configure at most 10 inbound rules for a filter.

    protocol string

    The transport protocol used by outbound traffic that needs to be mirrored. Valid values: ALL, ICMP, TCP, UDP.

    ruleAction string

    The collection policy of the inbound rule. Valid values: accept or drop. accept: collects network traffic. drop: does not collect network traffic.

    sourceCidrBlock string

    The source CIDR block of the outbound traffic.

    sourcePortRange string

    The source port range of the outbound traffic.

    status string

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    trafficMirrorFilterId string

    The ID of the filter associated with the outbound rule.

    trafficMirrorFilterRuleId string

    The first ID of the resource.

    destination_cidr_block str

    The destination CIDR block of the outbound traffic.

    destination_port_range str

    The destination port range of the outbound traffic.

    id str

    The ID of the Traffic Mirror Filter Egress Rule.

    priority int

    The priority of the outbound rule. A smaller value indicates a higher priority. The maximum value is 10, which indicates that you can configure at most 10 inbound rules for a filter.

    protocol str

    The transport protocol used by outbound traffic that needs to be mirrored. Valid values: ALL, ICMP, TCP, UDP.

    rule_action str

    The collection policy of the inbound rule. Valid values: accept or drop. accept: collects network traffic. drop: does not collect network traffic.

    source_cidr_block str

    The source CIDR block of the outbound traffic.

    source_port_range str

    The source port range of the outbound traffic.

    status str

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    traffic_mirror_filter_id str

    The ID of the filter associated with the outbound rule.

    traffic_mirror_filter_rule_id str

    The first ID of the resource.

    destinationCidrBlock String

    The destination CIDR block of the outbound traffic.

    destinationPortRange String

    The destination port range of the outbound traffic.

    id String

    The ID of the Traffic Mirror Filter Egress Rule.

    priority Number

    The priority of the outbound rule. A smaller value indicates a higher priority. The maximum value is 10, which indicates that you can configure at most 10 inbound rules for a filter.

    protocol String

    The transport protocol used by outbound traffic that needs to be mirrored. Valid values: ALL, ICMP, TCP, UDP.

    ruleAction String

    The collection policy of the inbound rule. Valid values: accept or drop. accept: collects network traffic. drop: does not collect network traffic.

    sourceCidrBlock String

    The source CIDR block of the outbound traffic.

    sourcePortRange String

    The source port range of the outbound traffic.

    status String

    The status of the resource. Valid values:Creating, Created, Modifying and Deleting.

    trafficMirrorFilterId String

    The ID of the filter associated with the outbound rule.

    trafficMirrorFilterRuleId String

    The first ID of the resource.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the alicloud Terraform Provider.

    alicloud logo
    Alibaba Cloud v3.43.1 published on Monday, Sep 11, 2023 by Pulumi