1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. databasegateway
  5. getGateways
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.databasegateway.getGateways

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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);
Copy
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)
Copy
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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetGateways(ctx *Context, args *GetGatewaysArgs, opts ...InvokeOption) (*GetGatewaysResult, error)
func GetGatewaysOutput(ctx *Context, args *GetGatewaysOutputArgs, opts ...InvokeOption) GetGatewaysResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetGatewaysResult> getGateways(GetGatewaysArgs args, InvokeOptions options)
public static Output<GetGatewaysResult> getGateways(GetGatewaysArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:databasegateway/getGateways:getGateways
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EnableDetails bool
Default to false. Set it to true can output more details about resource attributes.
Ids Changes to this property will trigger replacement. List<string>
A list of Gateway IDs.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The search key.
Status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []string
A list of Gateway IDs.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The search key.
Status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
A list of Gateway IDs.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The search key.
status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string[]
A list of Gateway IDs.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The search key.
status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[str]
A list of Gateway IDs.
name_regex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The search key.
status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
A list of Gateway IDs.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The search key.
status Changes to this property will trigger replacement. 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 This property is required. string
The creation time of Gateway.
GatewayDesc This property is required. string
The description of Gateway.
GatewayInstances This property is required. List<Pulumi.AliCloud.DatabaseGateway.Inputs.GetGatewaysGatewayGatewayInstance>
GatewayName This property is required. string
The name of the Gateway.
Hosts This property is required. string
A host of information.
Id This property is required. string
The ID of Gateway.
ModifiedTime This property is required. string
The Modify time of Gateway.
ParentId This property is required. string
The parent node Id of Gateway.
Status This property is required. string
The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
UserId This property is required. string
The user's id.
CreateTime This property is required. string
The creation time of Gateway.
GatewayDesc This property is required. string
The description of Gateway.
GatewayInstances This property is required. []GetGatewaysGatewayGatewayInstance
GatewayName This property is required. string
The name of the Gateway.
Hosts This property is required. string
A host of information.
Id This property is required. string
The ID of Gateway.
ModifiedTime This property is required. string
The Modify time of Gateway.
ParentId This property is required. string
The parent node Id of Gateway.
Status This property is required. string
The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
UserId This property is required. string
The user's id.
createTime This property is required. String
The creation time of Gateway.
gatewayDesc This property is required. String
The description of Gateway.
gatewayInstances This property is required. List<GetGatewaysGatewayGatewayInstance>
gatewayName This property is required. String
The name of the Gateway.
hosts This property is required. String
A host of information.
id This property is required. String
The ID of Gateway.
modifiedTime This property is required. String
The Modify time of Gateway.
parentId This property is required. String
The parent node Id of Gateway.
status This property is required. String
The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
userId This property is required. String
The user's id.
createTime This property is required. string
The creation time of Gateway.
gatewayDesc This property is required. string
The description of Gateway.
gatewayInstances This property is required. GetGatewaysGatewayGatewayInstance[]
gatewayName This property is required. string
The name of the Gateway.
hosts This property is required. string
A host of information.
id This property is required. string
The ID of Gateway.
modifiedTime This property is required. string
The Modify time of Gateway.
parentId This property is required. string
The parent node Id of Gateway.
status This property is required. string
The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
userId This property is required. string
The user's id.
create_time This property is required. str
The creation time of Gateway.
gateway_desc This property is required. str
The description of Gateway.
gateway_instances This property is required. Sequence[GetGatewaysGatewayGatewayInstance]
gateway_name This property is required. str
The name of the Gateway.
hosts This property is required. str
A host of information.
id This property is required. str
The ID of Gateway.
modified_time This property is required. str
The Modify time of Gateway.
parent_id This property is required. str
The parent node Id of Gateway.
status This property is required. str
The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
user_id This property is required. str
The user's id.
createTime This property is required. String
The creation time of Gateway.
gatewayDesc This property is required. String
The description of Gateway.
gatewayInstances This property is required. List<Property Map>
gatewayName This property is required. String
The name of the Gateway.
hosts This property is required. String
A host of information.
id This property is required. String
The ID of Gateway.
modifiedTime This property is required. String
The Modify time of Gateway.
parentId This property is required. String
The parent node Id of Gateway.
status This property is required. String
The status of gateway. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
userId This property is required. String
The user's id.

GetGatewaysGatewayGatewayInstance

ConnectEndpointType This property is required. string
The connection type of Gateway instance.
CurrentDaemonVersion This property is required. string
The process of version number of Gateway instance.
CurrentVersion This property is required. string
The version of Gateway instance.
EndPoint This property is required. string
The endpoint address of Gateway instance.
GatewayInstanceId This property is required. string
The id of Gateway instance.
GatewayInstanceStatus This property is required. string
The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
LastUpdateTime This property is required. string
The last Updated time stamp of Gateway instance.
LocalIp This property is required. string
The Local IP ADDRESS of Gateway instance.
Message This property is required. string
The prompt information of Gateway instance.
OutputIp This property is required. string
The host of Gateway instance.
ConnectEndpointType This property is required. string
The connection type of Gateway instance.
CurrentDaemonVersion This property is required. string
The process of version number of Gateway instance.
CurrentVersion This property is required. string
The version of Gateway instance.
EndPoint This property is required. string
The endpoint address of Gateway instance.
GatewayInstanceId This property is required. string
The id of Gateway instance.
GatewayInstanceStatus This property is required. string
The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
LastUpdateTime This property is required. string
The last Updated time stamp of Gateway instance.
LocalIp This property is required. string
The Local IP ADDRESS of Gateway instance.
Message This property is required. string
The prompt information of Gateway instance.
OutputIp This property is required. string
The host of Gateway instance.
connectEndpointType This property is required. String
The connection type of Gateway instance.
currentDaemonVersion This property is required. String
The process of version number of Gateway instance.
currentVersion This property is required. String
The version of Gateway instance.
endPoint This property is required. String
The endpoint address of Gateway instance.
gatewayInstanceId This property is required. String
The id of Gateway instance.
gatewayInstanceStatus This property is required. String
The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
lastUpdateTime This property is required. String
The last Updated time stamp of Gateway instance.
localIp This property is required. String
The Local IP ADDRESS of Gateway instance.
message This property is required. String
The prompt information of Gateway instance.
outputIp This property is required. String
The host of Gateway instance.
connectEndpointType This property is required. string
The connection type of Gateway instance.
currentDaemonVersion This property is required. string
The process of version number of Gateway instance.
currentVersion This property is required. string
The version of Gateway instance.
endPoint This property is required. string
The endpoint address of Gateway instance.
gatewayInstanceId This property is required. string
The id of Gateway instance.
gatewayInstanceStatus This property is required. string
The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
lastUpdateTime This property is required. string
The last Updated time stamp of Gateway instance.
localIp This property is required. string
The Local IP ADDRESS of Gateway instance.
message This property is required. string
The prompt information of Gateway instance.
outputIp This property is required. string
The host of Gateway instance.
connect_endpoint_type This property is required. str
The connection type of Gateway instance.
current_daemon_version This property is required. str
The process of version number of Gateway instance.
current_version This property is required. str
The version of Gateway instance.
end_point This property is required. str
The endpoint address of Gateway instance.
gateway_instance_id This property is required. str
The id of Gateway instance.
gateway_instance_status This property is required. str
The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
last_update_time This property is required. str
The last Updated time stamp of Gateway instance.
local_ip This property is required. str
The Local IP ADDRESS of Gateway instance.
message This property is required. str
The prompt information of Gateway instance.
output_ip This property is required. str
The host of Gateway instance.
connectEndpointType This property is required. String
The connection type of Gateway instance.
currentDaemonVersion This property is required. String
The process of version number of Gateway instance.
currentVersion This property is required. String
The version of Gateway instance.
endPoint This property is required. String
The endpoint address of Gateway instance.
gatewayInstanceId This property is required. String
The id of Gateway instance.
gatewayInstanceStatus This property is required. String
The status of Gateway instance. Valid values: EXCEPTION, NEW, RUNNING, STOPPED.
lastUpdateTime This property is required. String
The last Updated time stamp of Gateway instance.
localIp This property is required. String
The Local IP ADDRESS of Gateway instance.
message This property is required. String
The prompt information of Gateway instance.
outputIp This property is required. 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi