1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. databasegateway
  5. getGateways
Alibaba Cloud v3.68.0 published on Monday, Dec 2, 2024 by Pulumi

alicloud.databasegateway.getGateways

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.68.0 published on Monday, Dec 2, 2024 by Pulumi

    This data source provides the Database Gateway Gateways of the current Alibaba Cloud user.

    NOTE: Available in v1.135.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.databasegateway.getGateways({
        ids: ["example_id"],
    });
    export const databaseGatewayGatewayId1 = ids.then(ids => ids.gateways?.[0]?.id);
    const nameRegex = alicloud.databasegateway.getGateways({
        nameRegex: "^my-Gateway",
    });
    export const databaseGatewayGatewayId2 = nameRegex.then(nameRegex => nameRegex.gateways?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.databasegateway.get_gateways(ids=["example_id"])
    pulumi.export("databaseGatewayGatewayId1", ids.gateways[0].id)
    name_regex = alicloud.databasegateway.get_gateways(name_regex="^my-Gateway")
    pulumi.export("databaseGatewayGatewayId2", name_regex.gateways[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/databasegateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := databasegateway.GetGateways(ctx, &databasegateway.GetGatewaysArgs{
    			Ids: []string{
    				"example_id",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("databaseGatewayGatewayId1", ids.Gateways[0].Id)
    		nameRegex, err := databasegateway.GetGateways(ctx, &databasegateway.GetGatewaysArgs{
    			NameRegex: pulumi.StringRef("^my-Gateway"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("databaseGatewayGatewayId2", nameRegex.Gateways[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.DatabaseGateway.GetGateways.Invoke(new()
        {
            Ids = new[]
            {
                "example_id",
            },
        });
    
        var nameRegex = AliCloud.DatabaseGateway.GetGateways.Invoke(new()
        {
            NameRegex = "^my-Gateway",
        });
    
        return new Dictionary<string, object?>
        {
            ["databaseGatewayGatewayId1"] = ids.Apply(getGatewaysResult => getGatewaysResult.Gateways[0]?.Id),
            ["databaseGatewayGatewayId2"] = nameRegex.Apply(getGatewaysResult => getGatewaysResult.Gateways[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.databasegateway.DatabasegatewayFunctions;
    import com.pulumi.alicloud.databasegateway.inputs.GetGatewaysArgs;
    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 = DatabasegatewayFunctions.getGateways(GetGatewaysArgs.builder()
                .ids("example_id")
                .build());
    
            ctx.export("databaseGatewayGatewayId1", ids.applyValue(getGatewaysResult -> getGatewaysResult.gateways()[0].id()));
            final var nameRegex = DatabasegatewayFunctions.getGateways(GetGatewaysArgs.builder()
                .nameRegex("^my-Gateway")
                .build());
    
            ctx.export("databaseGatewayGatewayId2", nameRegex.applyValue(getGatewaysResult -> getGatewaysResult.gateways()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:databasegateway:getGateways
          Arguments:
            ids:
              - example_id
      nameRegex:
        fn::invoke:
          Function: alicloud:databasegateway:getGateways
          Arguments:
            nameRegex: ^my-Gateway
    outputs:
      databaseGatewayGatewayId1: ${ids.gateways[0].id}
      databaseGatewayGatewayId2: ${nameRegex.gateways[0].id}
    

    Using getGateways

    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 getGateways(args: GetGatewaysArgs, opts?: InvokeOptions): Promise<GetGatewaysResult>
    function getGatewaysOutput(args: GetGatewaysOutputArgs, opts?: InvokeOptions): Output<GetGatewaysResult>
    def get_gateways(enable_details: Optional[bool] = None,
                     ids: Optional[Sequence[str]] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     search_key: Optional[str] = None,
                     status: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetGatewaysResult
    def get_gateways_output(enable_details: Optional[pulumi.Input[bool]] = None,
                     ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     search_key: Optional[pulumi.Input[str]] = None,
                     status: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetGatewaysResult]
    func GetGateways(ctx *Context, args *GetGatewaysArgs, opts ...InvokeOption) (*GetGatewaysResult, error)
    func GetGatewaysOutput(ctx *Context, args *GetGatewaysOutputArgs, opts ...InvokeOption) GetGatewaysResultOutput

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

    public static class GetGateways 
    {
        public static Task<GetGatewaysResult> InvokeAsync(GetGatewaysArgs args, InvokeOptions? opts = null)
        public static Output<GetGatewaysResult> Invoke(GetGatewaysInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetGatewaysResult> getGateways(GetGatewaysArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:databasegateway/getGateways:getGateways
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of Gateway IDs.
    NameRegex string
    A regex string to filter results by Gateway name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SearchKey string
    The search key.
    Status string
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Gateway IDs.
    NameRegex string
    A regex string to filter results by Gateway name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SearchKey string
    The search key.
    Status string
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Gateway IDs.
    nameRegex String
    A regex string to filter results by Gateway name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    searchKey String
    The search key.
    status String
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Gateway IDs.
    nameRegex string
    A regex string to filter results by Gateway name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    searchKey string
    The search key.
    status string
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of Gateway IDs.
    name_regex str
    A regex string to filter results by Gateway name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    search_key str
    The search key.
    status str
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Gateway IDs.
    nameRegex String
    A regex string to filter results by Gateway name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    searchKey String
    The search key.
    status String
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.

    getGateways Result

    The following output properties are available:

    Gateways List<Pulumi.AliCloud.DatabaseGateway.Outputs.GetGatewaysGateway>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    EnableDetails bool
    NameRegex string
    OutputFile string
    SearchKey string
    Status string
    Gateways []GetGatewaysGateway
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    EnableDetails bool
    NameRegex string
    OutputFile string
    SearchKey string
    Status string
    gateways List<GetGatewaysGateway>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    enableDetails Boolean
    nameRegex String
    outputFile String
    searchKey String
    status String
    gateways GetGatewaysGateway[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    enableDetails boolean
    nameRegex string
    outputFile string
    searchKey string
    status string
    gateways Sequence[GetGatewaysGateway]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    enable_details bool
    name_regex str
    output_file str
    search_key str
    status str
    gateways List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    enableDetails Boolean
    nameRegex String
    outputFile String
    searchKey String
    status String

    Supporting Types

    GetGatewaysGateway

    CreateTime string
    The creation time of Gateway.
    GatewayDesc string
    The description of Gateway.
    GatewayInstances List<Pulumi.AliCloud.DatabaseGateway.Inputs.GetGatewaysGatewayGatewayInstance>
    GatewayName string
    The name of the Gateway.
    Hosts string
    A host of information.
    Id string
    The ID of Gateway.
    ModifiedTime string
    The Modify time of Gateway.
    ParentId string
    The parent node Id of Gateway.
    Status string
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    UserId string
    The user's id.
    CreateTime string
    The creation time of Gateway.
    GatewayDesc string
    The description of Gateway.
    GatewayInstances []GetGatewaysGatewayGatewayInstance
    GatewayName string
    The name of the Gateway.
    Hosts string
    A host of information.
    Id string
    The ID of Gateway.
    ModifiedTime string
    The Modify time of Gateway.
    ParentId string
    The parent node Id of Gateway.
    Status string
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    UserId string
    The user's id.
    createTime String
    The creation time of Gateway.
    gatewayDesc String
    The description of Gateway.
    gatewayInstances List<GetGatewaysGatewayGatewayInstance>
    gatewayName String
    The name of the Gateway.
    hosts String
    A host of information.
    id String
    The ID of Gateway.
    modifiedTime String
    The Modify time of Gateway.
    parentId String
    The parent node Id of Gateway.
    status String
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    userId String
    The user's id.
    createTime string
    The creation time of Gateway.
    gatewayDesc string
    The description of Gateway.
    gatewayInstances GetGatewaysGatewayGatewayInstance[]
    gatewayName string
    The name of the Gateway.
    hosts string
    A host of information.
    id string
    The ID of Gateway.
    modifiedTime string
    The Modify time of Gateway.
    parentId string
    The parent node Id of Gateway.
    status string
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    userId string
    The user's id.
    create_time str
    The creation time of Gateway.
    gateway_desc str
    The description of Gateway.
    gateway_instances Sequence[GetGatewaysGatewayGatewayInstance]
    gateway_name str
    The name of the Gateway.
    hosts str
    A host of information.
    id str
    The ID of Gateway.
    modified_time str
    The Modify time of Gateway.
    parent_id str
    The parent node Id of Gateway.
    status str
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    user_id str
    The user's id.
    createTime String
    The creation time of Gateway.
    gatewayDesc String
    The description of Gateway.
    gatewayInstances List<Property Map>
    gatewayName String
    The name of the Gateway.
    hosts String
    A host of information.
    id String
    The ID of Gateway.
    modifiedTime String
    The Modify time of Gateway.
    parentId String
    The parent node Id of Gateway.
    status String
    The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    userId String
    The user's id.

    GetGatewaysGatewayGatewayInstance

    ConnectEndpointType string
    The connection type of Gateway instance.
    CurrentDaemonVersion string
    The process of version number of Gateway instance.
    CurrentVersion string
    The version of Gateway instance.
    EndPoint string
    The endpoint address of Gateway instance.
    GatewayInstanceId string
    The id of Gateway instance.
    GatewayInstanceStatus string
    The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    LastUpdateTime string
    The last Updated time stamp of Gateway instance.
    LocalIp string
    The Local IP ADDRESS of Gateway instance.
    Message string
    The prompt information of Gateway instance.
    OutputIp string
    The host of Gateway instance.
    ConnectEndpointType string
    The connection type of Gateway instance.
    CurrentDaemonVersion string
    The process of version number of Gateway instance.
    CurrentVersion string
    The version of Gateway instance.
    EndPoint string
    The endpoint address of Gateway instance.
    GatewayInstanceId string
    The id of Gateway instance.
    GatewayInstanceStatus string
    The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    LastUpdateTime string
    The last Updated time stamp of Gateway instance.
    LocalIp string
    The Local IP ADDRESS of Gateway instance.
    Message string
    The prompt information of Gateway instance.
    OutputIp string
    The host of Gateway instance.
    connectEndpointType String
    The connection type of Gateway instance.
    currentDaemonVersion String
    The process of version number of Gateway instance.
    currentVersion String
    The version of Gateway instance.
    endPoint String
    The endpoint address of Gateway instance.
    gatewayInstanceId String
    The id of Gateway instance.
    gatewayInstanceStatus String
    The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    lastUpdateTime String
    The last Updated time stamp of Gateway instance.
    localIp String
    The Local IP ADDRESS of Gateway instance.
    message String
    The prompt information of Gateway instance.
    outputIp String
    The host of Gateway instance.
    connectEndpointType string
    The connection type of Gateway instance.
    currentDaemonVersion string
    The process of version number of Gateway instance.
    currentVersion string
    The version of Gateway instance.
    endPoint string
    The endpoint address of Gateway instance.
    gatewayInstanceId string
    The id of Gateway instance.
    gatewayInstanceStatus string
    The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    lastUpdateTime string
    The last Updated time stamp of Gateway instance.
    localIp string
    The Local IP ADDRESS of Gateway instance.
    message string
    The prompt information of Gateway instance.
    outputIp string
    The host of Gateway instance.
    connect_endpoint_type str
    The connection type of Gateway instance.
    current_daemon_version str
    The process of version number of Gateway instance.
    current_version str
    The version of Gateway instance.
    end_point str
    The endpoint address of Gateway instance.
    gateway_instance_id str
    The id of Gateway instance.
    gateway_instance_status str
    The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    last_update_time str
    The last Updated time stamp of Gateway instance.
    local_ip str
    The Local IP ADDRESS of Gateway instance.
    message str
    The prompt information of Gateway instance.
    output_ip str
    The host of Gateway instance.
    connectEndpointType String
    The connection type of Gateway instance.
    currentDaemonVersion String
    The process of version number of Gateway instance.
    currentVersion String
    The version of Gateway instance.
    endPoint String
    The endpoint address of Gateway instance.
    gatewayInstanceId String
    The id of Gateway instance.
    gatewayInstanceStatus String
    The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
    lastUpdateTime String
    The last Updated time stamp of Gateway instance.
    localIp String
    The Local IP ADDRESS of Gateway instance.
    message String
    The prompt information of Gateway instance.
    outputIp String
    The host of Gateway instance.

    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.68.0 published on Monday, Dec 2, 2024 by Pulumi