1. Registry
  2. Packages
  3. Ibm Provider
  4. API Docs
  5. getTgGateways
Viewing docs for ibm 2.9.0
published on Thursday, Nov 5, 2026 by ibm-cloud
ibm
Viewing docs for ibm 2.9.0
published on Thursday, Nov 5, 2026 by ibm-cloud

    Imports the information of an existing IBM Cloud infrastructure transit gateway as a read only data source. For more information, about transit gateways, see managing transit gateways.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    // List all gateways
    const all = ibm.getTgGateways({});
    // List only gateways in a specific redundancy group
    const inRg = ibm.getTgGateways({
        redundancyGroup: "my-redundancy-group",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    # List all gateways
    all = ibm.get_tg_gateways()
    # List only gateways in a specific redundancy group
    in_rg = ibm.get_tg_gateways(redundancy_group="my-redundancy-group")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// List all gateways
    		_, err := ibm.GetTgGateways(ctx, &ibm.GetTgGatewaysArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		// List only gateways in a specific redundancy group
    		_, err = ibm.GetTgGateways(ctx, &ibm.GetTgGatewaysArgs{
    			RedundancyGroup: pulumi.StringRef("my-redundancy-group"),
    		}, 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(() => 
    {
        // List all gateways
        var all = Ibm.GetTgGateways.Invoke();
    
        // List only gateways in a specific redundancy group
        var inRg = Ibm.GetTgGateways.Invoke(new()
        {
            RedundancyGroup = "my-redundancy-group",
        });
    
    });
    
    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.GetTgGatewaysArgs;
    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) {
            // List all gateways
            final var all = IbmFunctions.getTgGateways(GetTgGatewaysArgs.builder()
                .build());
    
            // List only gateways in a specific redundancy group
            final var inRg = IbmFunctions.getTgGateways(GetTgGatewaysArgs.builder()
                .redundancyGroup("my-redundancy-group")
                .build());
    
        }
    }
    
    variables:
      # List all gateways
      all:
        fn::invoke:
          function: ibm:getTgGateways
          arguments: {}
      # List only gateways in a specific redundancy group
      inRg:
        fn::invoke:
          function: ibm:getTgGateways
          arguments:
            redundancyGroup: my-redundancy-group
    
    Example coming soon!
    

    Using getTgGateways

    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 getTgGateways(args: GetTgGatewaysArgs, opts?: InvokeOptions): Promise<GetTgGatewaysResult>
    function getTgGatewaysOutput(args: GetTgGatewaysOutputArgs, opts?: InvokeOutputOptions): Output<GetTgGatewaysResult>
    def get_tg_gateways(id: Optional[str] = None,
                        redundancy_group: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetTgGatewaysResult
    def get_tg_gateways_output(id: pulumi.Input[Optional[str]] = None,
                        redundancy_group: pulumi.Input[Optional[str]] = None,
                        opts: Optional[InvokeOutputOptions] = None) -> Output[GetTgGatewaysResult]
    func GetTgGateways(ctx *Context, args *GetTgGatewaysArgs, opts ...InvokeOption) (*GetTgGatewaysResult, error)
    func GetTgGatewaysOutput(ctx *Context, args *GetTgGatewaysOutputArgs, opts ...InvokeOption) GetTgGatewaysResultOutput

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

    public static class GetTgGateways 
    {
        public static Task<GetTgGatewaysResult> InvokeAsync(GetTgGatewaysArgs args, InvokeOptions? opts = null)
        public static Output<GetTgGatewaysResult> Invoke(GetTgGatewaysInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetTgGatewaysResult> Invoke(GetTgGatewaysInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetTgGatewaysResult> getTgGateways(GetTgGatewaysArgs args, InvokeOptions options)
    public static Output<GetTgGatewaysResult> getTgGateways(GetTgGatewaysArgs args, InvokeOptions options)
    public static Output<GetTgGatewaysResult> getTgGateways(GetTgGatewaysArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: ibm:index/getTgGateways:getTgGateways
      arguments:
        # arguments dictionary
    data "ibm_get_tg_gateways" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    (String) The unique identifier of this gateway.
    RedundancyGroup string
    Filter the results to only gateways belonging to this redundancy group name.
    Id string
    (String) The unique identifier of this gateway.
    RedundancyGroup string
    Filter the results to only gateways belonging to this redundancy group name.
    id string
    (String) The unique identifier of this gateway.
    redundancy_group string
    Filter the results to only gateways belonging to this redundancy group name.
    id String
    (String) The unique identifier of this gateway.
    redundancyGroup String
    Filter the results to only gateways belonging to this redundancy group name.
    id string
    (String) The unique identifier of this gateway.
    redundancyGroup string
    Filter the results to only gateways belonging to this redundancy group name.
    id str
    (String) The unique identifier of this gateway.
    redundancy_group str
    Filter the results to only gateways belonging to this redundancy group name.
    id String
    (String) The unique identifier of this gateway.
    redundancyGroup String
    Filter the results to only gateways belonging to this redundancy group name.

    getTgGateways Result

    The following output properties are available:

    Id string
    (String) The unique identifier of this gateway.
    TransitGateways List<GetTgGatewaysTransitGateway>
    (List) List of all transit gateways.
    RedundancyGroup string
    (String) The name of the redundancy group this gateway belongs to.
    Id string
    (String) The unique identifier of this gateway.
    TransitGateways []GetTgGatewaysTransitGateway
    (List) List of all transit gateways.
    RedundancyGroup string
    (String) The name of the redundancy group this gateway belongs to.
    id string
    (String) The unique identifier of this gateway.
    transit_gateways list(object)
    (List) List of all transit gateways.
    redundancy_group string
    (String) The name of the redundancy group this gateway belongs to.
    id String
    (String) The unique identifier of this gateway.
    transitGateways List<GetTgGatewaysTransitGateway>
    (List) List of all transit gateways.
    redundancyGroup String
    (String) The name of the redundancy group this gateway belongs to.
    id string
    (String) The unique identifier of this gateway.
    transitGateways GetTgGatewaysTransitGateway[]
    (List) List of all transit gateways.
    redundancyGroup string
    (String) The name of the redundancy group this gateway belongs to.
    id str
    (String) The unique identifier of this gateway.
    transit_gateways Sequence[GetTgGatewaysTransitGateway]
    (List) List of all transit gateways.
    redundancy_group str
    (String) The name of the redundancy group this gateway belongs to.
    id String
    (String) The unique identifier of this gateway.
    transitGateways List<Property Map>
    (List) List of all transit gateways.
    redundancyGroup String
    (String) The name of the redundancy group this gateway belongs to.

    Supporting Types

    GetTgGatewaysTransitGateway

    ConnectionCount double
    (Integer) The number of connections associated with this gateway.
    ConnectionNeedsAttention bool
    (Bool) Indicates if this gateway has a connection that needs attention, such as a cross-account approval.
    CreatedAt string
    (String) The date and time resource is created.
    Crn string
    (String) The CRN of the gateway.
    Global bool
    (Bool) The gateways with global routing true to connect to the networks outside the associated region.
    GreEnhancedRoutePropagation bool
    (Bool) The gateways with GRE enhanced route propagation true to share routes across all GRE connections on the same gateway.
    Id string
    (String) The unique identifier of this gateway.
    Location string
    (String) The gateway location.
    Name string
    (String) The user-defined name for the transit gateway.
    RedundancyGroup string
    Filter the results to only gateways belonging to this redundancy group name.
    RedundancyGroupId string
    (String) The unique identifier of the redundancy group this gateway belongs to.
    ResourceGroup string
    (String) The resource group identifier.
    Status string
    (String) The gateway status.
    UpdatedAt string
    (String) The date and time resource is last updated.
    ConnectionCount float64
    (Integer) The number of connections associated with this gateway.
    ConnectionNeedsAttention bool
    (Bool) Indicates if this gateway has a connection that needs attention, such as a cross-account approval.
    CreatedAt string
    (String) The date and time resource is created.
    Crn string
    (String) The CRN of the gateway.
    Global bool
    (Bool) The gateways with global routing true to connect to the networks outside the associated region.
    GreEnhancedRoutePropagation bool
    (Bool) The gateways with GRE enhanced route propagation true to share routes across all GRE connections on the same gateway.
    Id string
    (String) The unique identifier of this gateway.
    Location string
    (String) The gateway location.
    Name string
    (String) The user-defined name for the transit gateway.
    RedundancyGroup string
    Filter the results to only gateways belonging to this redundancy group name.
    RedundancyGroupId string
    (String) The unique identifier of the redundancy group this gateway belongs to.
    ResourceGroup string
    (String) The resource group identifier.
    Status string
    (String) The gateway status.
    UpdatedAt string
    (String) The date and time resource is last updated.
    connection_count number
    (Integer) The number of connections associated with this gateway.
    connection_needs_attention bool
    (Bool) Indicates if this gateway has a connection that needs attention, such as a cross-account approval.
    created_at string
    (String) The date and time resource is created.
    crn string
    (String) The CRN of the gateway.
    global bool
    (Bool) The gateways with global routing true to connect to the networks outside the associated region.
    gre_enhanced_route_propagation bool
    (Bool) The gateways with GRE enhanced route propagation true to share routes across all GRE connections on the same gateway.
    id string
    (String) The unique identifier of this gateway.
    location string
    (String) The gateway location.
    name string
    (String) The user-defined name for the transit gateway.
    redundancy_group string
    Filter the results to only gateways belonging to this redundancy group name.
    redundancy_group_id string
    (String) The unique identifier of the redundancy group this gateway belongs to.
    resource_group string
    (String) The resource group identifier.
    status string
    (String) The gateway status.
    updated_at string
    (String) The date and time resource is last updated.
    connectionCount Double
    (Integer) The number of connections associated with this gateway.
    connectionNeedsAttention Boolean
    (Bool) Indicates if this gateway has a connection that needs attention, such as a cross-account approval.
    createdAt String
    (String) The date and time resource is created.
    crn String
    (String) The CRN of the gateway.
    global Boolean
    (Bool) The gateways with global routing true to connect to the networks outside the associated region.
    greEnhancedRoutePropagation Boolean
    (Bool) The gateways with GRE enhanced route propagation true to share routes across all GRE connections on the same gateway.
    id String
    (String) The unique identifier of this gateway.
    location String
    (String) The gateway location.
    name String
    (String) The user-defined name for the transit gateway.
    redundancyGroup String
    Filter the results to only gateways belonging to this redundancy group name.
    redundancyGroupId String
    (String) The unique identifier of the redundancy group this gateway belongs to.
    resourceGroup String
    (String) The resource group identifier.
    status String
    (String) The gateway status.
    updatedAt String
    (String) The date and time resource is last updated.
    connectionCount number
    (Integer) The number of connections associated with this gateway.
    connectionNeedsAttention boolean
    (Bool) Indicates if this gateway has a connection that needs attention, such as a cross-account approval.
    createdAt string
    (String) The date and time resource is created.
    crn string
    (String) The CRN of the gateway.
    global boolean
    (Bool) The gateways with global routing true to connect to the networks outside the associated region.
    greEnhancedRoutePropagation boolean
    (Bool) The gateways with GRE enhanced route propagation true to share routes across all GRE connections on the same gateway.
    id string
    (String) The unique identifier of this gateway.
    location string
    (String) The gateway location.
    name string
    (String) The user-defined name for the transit gateway.
    redundancyGroup string
    Filter the results to only gateways belonging to this redundancy group name.
    redundancyGroupId string
    (String) The unique identifier of the redundancy group this gateway belongs to.
    resourceGroup string
    (String) The resource group identifier.
    status string
    (String) The gateway status.
    updatedAt string
    (String) The date and time resource is last updated.
    connection_count float
    (Integer) The number of connections associated with this gateway.
    connection_needs_attention bool
    (Bool) Indicates if this gateway has a connection that needs attention, such as a cross-account approval.
    created_at str
    (String) The date and time resource is created.
    crn str
    (String) The CRN of the gateway.
    global_ bool
    (Bool) The gateways with global routing true to connect to the networks outside the associated region.
    gre_enhanced_route_propagation bool
    (Bool) The gateways with GRE enhanced route propagation true to share routes across all GRE connections on the same gateway.
    id str
    (String) The unique identifier of this gateway.
    location str
    (String) The gateway location.
    name str
    (String) The user-defined name for the transit gateway.
    redundancy_group str
    Filter the results to only gateways belonging to this redundancy group name.
    redundancy_group_id str
    (String) The unique identifier of the redundancy group this gateway belongs to.
    resource_group str
    (String) The resource group identifier.
    status str
    (String) The gateway status.
    updated_at str
    (String) The date and time resource is last updated.
    connectionCount Number
    (Integer) The number of connections associated with this gateway.
    connectionNeedsAttention Boolean
    (Bool) Indicates if this gateway has a connection that needs attention, such as a cross-account approval.
    createdAt String
    (String) The date and time resource is created.
    crn String
    (String) The CRN of the gateway.
    global Boolean
    (Bool) The gateways with global routing true to connect to the networks outside the associated region.
    greEnhancedRoutePropagation Boolean
    (Bool) The gateways with GRE enhanced route propagation true to share routes across all GRE connections on the same gateway.
    id String
    (String) The unique identifier of this gateway.
    location String
    (String) The gateway location.
    name String
    (String) The user-defined name for the transit gateway.
    redundancyGroup String
    Filter the results to only gateways belonging to this redundancy group name.
    redundancyGroupId String
    (String) The unique identifier of the redundancy group this gateway belongs to.
    resourceGroup String
    (String) The resource group identifier.
    status String
    (String) The gateway status.
    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
    Viewing docs for ibm 2.9.0
    published on Thursday, Nov 5, 2026 by ibm-cloud

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial