1. Packages
  2. Ibm Provider
  3. API Docs
  4. getTgConnectionPrefixFilter
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.getTgConnectionPrefixFilter

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Retrieve information of an existing IBM Cloud infrastructure transit gateway connection prefix filter as a read only data source. For more information about Transit Gateway Prefix filters, see adding and deleting prefix filters.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const tgPrefixFilter = ibm.getTgConnectionPrefixFilter({
        gateway: ibm_tg_gateway.new_tg_gw.id,
        connectionId: ibm_tg_connection.test_ibm_tg_connection.connection_id,
        filterId: ibm_tg_connection_prefix_filter.test_tg_prefix_filter.filter_id,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    tg_prefix_filter = ibm.get_tg_connection_prefix_filter(gateway=ibm_tg_gateway["new_tg_gw"]["id"],
        connection_id=ibm_tg_connection["test_ibm_tg_connection"]["connection_id"],
        filter_id=ibm_tg_connection_prefix_filter["test_tg_prefix_filter"]["filter_id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupTgConnectionPrefixFilter(ctx, &ibm.LookupTgConnectionPrefixFilterArgs{
    			Gateway:      ibm_tg_gateway.New_tg_gw.Id,
    			ConnectionId: ibm_tg_connection.Test_ibm_tg_connection.Connection_id,
    			FilterId:     ibm_tg_connection_prefix_filter.Test_tg_prefix_filter.Filter_id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var tgPrefixFilter = Ibm.GetTgConnectionPrefixFilter.Invoke(new()
        {
            Gateway = ibm_tg_gateway.New_tg_gw.Id,
            ConnectionId = ibm_tg_connection.Test_ibm_tg_connection.Connection_id,
            FilterId = ibm_tg_connection_prefix_filter.Test_tg_prefix_filter.Filter_id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetTgConnectionPrefixFilterArgs;
    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 tgPrefixFilter = IbmFunctions.getTgConnectionPrefixFilter(GetTgConnectionPrefixFilterArgs.builder()
                .gateway(ibm_tg_gateway.new_tg_gw().id())
                .connectionId(ibm_tg_connection.test_ibm_tg_connection().connection_id())
                .filterId(ibm_tg_connection_prefix_filter.test_tg_prefix_filter().filter_id())
                .build());
    
        }
    }
    
    variables:
      tgPrefixFilter:
        fn::invoke:
          function: ibm:getTgConnectionPrefixFilter
          arguments:
            gateway: ${ibm_tg_gateway.new_tg_gw.id}
            connectionId: ${ibm_tg_connection.test_ibm_tg_connection.connection_id}
            filterId: ${ibm_tg_connection_prefix_filter.test_tg_prefix_filter.filter_id}
    

    Using getTgConnectionPrefixFilter

    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 getTgConnectionPrefixFilter(args: GetTgConnectionPrefixFilterArgs, opts?: InvokeOptions): Promise<GetTgConnectionPrefixFilterResult>
    function getTgConnectionPrefixFilterOutput(args: GetTgConnectionPrefixFilterOutputArgs, opts?: InvokeOptions): Output<GetTgConnectionPrefixFilterResult>
    def get_tg_connection_prefix_filter(connection_id: Optional[str] = None,
                                        filter_id: Optional[str] = None,
                                        gateway: Optional[str] = None,
                                        id: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetTgConnectionPrefixFilterResult
    def get_tg_connection_prefix_filter_output(connection_id: Optional[pulumi.Input[str]] = None,
                                        filter_id: Optional[pulumi.Input[str]] = None,
                                        gateway: Optional[pulumi.Input[str]] = None,
                                        id: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetTgConnectionPrefixFilterResult]
    func LookupTgConnectionPrefixFilter(ctx *Context, args *LookupTgConnectionPrefixFilterArgs, opts ...InvokeOption) (*LookupTgConnectionPrefixFilterResult, error)
    func LookupTgConnectionPrefixFilterOutput(ctx *Context, args *LookupTgConnectionPrefixFilterOutputArgs, opts ...InvokeOption) LookupTgConnectionPrefixFilterResultOutput

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

    public static class GetTgConnectionPrefixFilter 
    {
        public static Task<GetTgConnectionPrefixFilterResult> InvokeAsync(GetTgConnectionPrefixFilterArgs args, InvokeOptions? opts = null)
        public static Output<GetTgConnectionPrefixFilterResult> Invoke(GetTgConnectionPrefixFilterInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTgConnectionPrefixFilterResult> getTgConnectionPrefixFilter(GetTgConnectionPrefixFilterArgs args, InvokeOptions options)
    public static Output<GetTgConnectionPrefixFilterResult> getTgConnectionPrefixFilter(GetTgConnectionPrefixFilterArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getTgConnectionPrefixFilter:getTgConnectionPrefixFilter
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ConnectionId string
    The unique identifier of the gateway connection
    FilterId string
    • (Required, String) The unique identifier of the gateway connection prefix filter
    Gateway string
    The unique identifier of the gateway.
    Id string
    (String) The unique identifier of this prefix filter.
    ConnectionId string
    The unique identifier of the gateway connection
    FilterId string
    • (Required, String) The unique identifier of the gateway connection prefix filter
    Gateway string
    The unique identifier of the gateway.
    Id string
    (String) The unique identifier of this prefix filter.
    connectionId String
    The unique identifier of the gateway connection
    filterId String
    • (Required, String) The unique identifier of the gateway connection prefix filter
    gateway String
    The unique identifier of the gateway.
    id String
    (String) The unique identifier of this prefix filter.
    connectionId string
    The unique identifier of the gateway connection
    filterId string
    • (Required, String) The unique identifier of the gateway connection prefix filter
    gateway string
    The unique identifier of the gateway.
    id string
    (String) The unique identifier of this prefix filter.
    connection_id str
    The unique identifier of the gateway connection
    filter_id str
    • (Required, String) The unique identifier of the gateway connection prefix filter
    gateway str
    The unique identifier of the gateway.
    id str
    (String) The unique identifier of this prefix filter.
    connectionId String
    The unique identifier of the gateway connection
    filterId String
    • (Required, String) The unique identifier of the gateway connection prefix filter
    gateway String
    The unique identifier of the gateway.
    id String
    (String) The unique identifier of this prefix filter.

    getTgConnectionPrefixFilter Result

    The following output properties are available:

    Action string
    (String) Whether to permit or deny the prefix filter
    Before string
    (String) Identifier of prefix filter that handles the ordering and follow semantics. When a filter reference another filter in it's before field, then the filter making the reference is applied before the referenced filter. For example: if filter A references filter B in its before field, A is applied before B.
    ConnectionId string
    CreatedAt string
    (String) The date and time resource is created.
    FilterId string
    Gateway string
    Ge double
    (Int) The IP Prefix GE. The GE (greater than or equal to) value can be included to match all less-specific prefixes within a parent prefix above a certain length.
    Id string
    (String) The unique identifier of this prefix filter.
    Le double
    (Int) The IP Prefix LE. The LE (less than or equal to) value can be included to match all more-specific prefixes within a parent prefix up to a certain length.
    Prefix string
    (String) The IP Prefix
    UpdatedAt string
    (String) The date and time resource is last updated.
    Action string
    (String) Whether to permit or deny the prefix filter
    Before string
    (String) Identifier of prefix filter that handles the ordering and follow semantics. When a filter reference another filter in it's before field, then the filter making the reference is applied before the referenced filter. For example: if filter A references filter B in its before field, A is applied before B.
    ConnectionId string
    CreatedAt string
    (String) The date and time resource is created.
    FilterId string
    Gateway string
    Ge float64
    (Int) The IP Prefix GE. The GE (greater than or equal to) value can be included to match all less-specific prefixes within a parent prefix above a certain length.
    Id string
    (String) The unique identifier of this prefix filter.
    Le float64
    (Int) The IP Prefix LE. The LE (less than or equal to) value can be included to match all more-specific prefixes within a parent prefix up to a certain length.
    Prefix string
    (String) The IP Prefix
    UpdatedAt string
    (String) The date and time resource is last updated.
    action String
    (String) Whether to permit or deny the prefix filter
    before String
    (String) Identifier of prefix filter that handles the ordering and follow semantics. When a filter reference another filter in it's before field, then the filter making the reference is applied before the referenced filter. For example: if filter A references filter B in its before field, A is applied before B.
    connectionId String
    createdAt String
    (String) The date and time resource is created.
    filterId String
    gateway String
    ge Double
    (Int) The IP Prefix GE. The GE (greater than or equal to) value can be included to match all less-specific prefixes within a parent prefix above a certain length.
    id String
    (String) The unique identifier of this prefix filter.
    le Double
    (Int) The IP Prefix LE. The LE (less than or equal to) value can be included to match all more-specific prefixes within a parent prefix up to a certain length.
    prefix String
    (String) The IP Prefix
    updatedAt String
    (String) The date and time resource is last updated.
    action string
    (String) Whether to permit or deny the prefix filter
    before string
    (String) Identifier of prefix filter that handles the ordering and follow semantics. When a filter reference another filter in it's before field, then the filter making the reference is applied before the referenced filter. For example: if filter A references filter B in its before field, A is applied before B.
    connectionId string
    createdAt string
    (String) The date and time resource is created.
    filterId string
    gateway string
    ge number
    (Int) The IP Prefix GE. The GE (greater than or equal to) value can be included to match all less-specific prefixes within a parent prefix above a certain length.
    id string
    (String) The unique identifier of this prefix filter.
    le number
    (Int) The IP Prefix LE. The LE (less than or equal to) value can be included to match all more-specific prefixes within a parent prefix up to a certain length.
    prefix string
    (String) The IP Prefix
    updatedAt string
    (String) The date and time resource is last updated.
    action str
    (String) Whether to permit or deny the prefix filter
    before str
    (String) Identifier of prefix filter that handles the ordering and follow semantics. When a filter reference another filter in it's before field, then the filter making the reference is applied before the referenced filter. For example: if filter A references filter B in its before field, A is applied before B.
    connection_id str
    created_at str
    (String) The date and time resource is created.
    filter_id str
    gateway str
    ge float
    (Int) The IP Prefix GE. The GE (greater than or equal to) value can be included to match all less-specific prefixes within a parent prefix above a certain length.
    id str
    (String) The unique identifier of this prefix filter.
    le float
    (Int) The IP Prefix LE. The LE (less than or equal to) value can be included to match all more-specific prefixes within a parent prefix up to a certain length.
    prefix str
    (String) The IP Prefix
    updated_at str
    (String) The date and time resource is last updated.
    action String
    (String) Whether to permit or deny the prefix filter
    before String
    (String) Identifier of prefix filter that handles the ordering and follow semantics. When a filter reference another filter in it's before field, then the filter making the reference is applied before the referenced filter. For example: if filter A references filter B in its before field, A is applied before B.
    connectionId String
    createdAt String
    (String) The date and time resource is created.
    filterId String
    gateway String
    ge Number
    (Int) The IP Prefix GE. The GE (greater than or equal to) value can be included to match all less-specific prefixes within a parent prefix above a certain length.
    id String
    (String) The unique identifier of this prefix filter.
    le Number
    (Int) The IP Prefix LE. The LE (less than or equal to) value can be included to match all more-specific prefixes within a parent prefix up to a certain length.
    prefix String
    (String) The IP Prefix
    updatedAt String
    (String) The date and time resource is last updated.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud