Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi
alicloud.databasegateway.getGateways
Explore with Pulumi AI
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)
public static Output<GetGatewaysResult> getGateways(GetGatewaysArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:databasegateway/getGateways:getGateways
arguments:
# arguments dictionary
The following arguments are supported:
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids
Changes to this property will trigger replacement.
- A list of Gateway IDs.
- Name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Gateway name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Search
Key Changes to this property will trigger replacement.
- The search key.
- Status
Changes to this property will trigger replacement.
- The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids
Changes to this property will trigger replacement.
- A list of Gateway IDs.
- Name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Gateway name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Search
Key Changes to this property will trigger replacement.
- The search key.
- Status
Changes to this property will trigger replacement.
- The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids
Changes to this property will trigger replacement.
- A list of Gateway IDs.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Gateway name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - search
Key Changes to this property will trigger replacement.
- The search key.
- status
Changes to this property will trigger replacement.
- The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.
- enable
Details boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids
Changes to this property will trigger replacement.
- A list of Gateway IDs.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Gateway name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - search
Key Changes to this property will trigger replacement.
- The search key.
- status
Changes to this property will trigger replacement.
- The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.
- enable_
details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - ids
Changes to this property will trigger replacement.
- A list of Gateway IDs.
- name_
regex Changes to this property will trigger replacement.
- 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.
- The search key.
- status
Changes to this property will trigger replacement.
- The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids
Changes to this property will trigger replacement.
- A list of Gateway IDs.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Gateway name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - search
Key Changes to this property will trigger replacement.
- The search key.
- status
Changes to this property will trigger replacement.
- The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.
getGateways Result
The following output properties are available:
- Gateways
List<Pulumi.
Ali Cloud. Database Gateway. Outputs. Get Gateways Gateway> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Enable
Details bool - Name
Regex string - Output
File string - Search
Key string - Status string
- Gateways
[]Get
Gateways Gateway - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Enable
Details bool - Name
Regex string - Output
File string - Search
Key string - Status string
- gateways
List<Get
Gateways Gateway> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- enable
Details Boolean - name
Regex String - output
File String - search
Key String - status String
- gateways
Get
Gateways Gateway[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- enable
Details boolean - name
Regex string - output
File string - search
Key string - status string
- gateways
Sequence[Get
Gateways Gateway] - 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>
- enable
Details Boolean - name
Regex String - output
File String - search
Key String - status String
Supporting Types
GetGatewaysGateway
- Create
Time This property is required. string - The creation time of Gateway.
- Gateway
Desc This property is required. string - The description of Gateway.
- Gateway
Instances This property is required. List<Pulumi.Ali Cloud. Database Gateway. Inputs. Get Gateways Gateway Gateway Instance> - Gateway
Name 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.
- Modified
Time This property is required. string - The Modify time of Gateway.
- Parent
Id 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
. - User
Id This property is required. string - The user's id.
- Create
Time This property is required. string - The creation time of Gateway.
- Gateway
Desc This property is required. string - The description of Gateway.
- Gateway
Instances This property is required. []GetGateways Gateway Gateway Instance - Gateway
Name 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.
- Modified
Time This property is required. string - The Modify time of Gateway.
- Parent
Id 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
. - User
Id This property is required. string - The user's id.
- create
Time This property is required. String - The creation time of Gateway.
- gateway
Desc This property is required. String - The description of Gateway.
- gateway
Instances This property is required. List<GetGateways Gateway Gateway Instance> - gateway
Name 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.
- modified
Time This property is required. String - The Modify time of Gateway.
- parent
Id 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
. - user
Id This property is required. String - The user's id.
- create
Time This property is required. string - The creation time of Gateway.
- gateway
Desc This property is required. string - The description of Gateway.
- gateway
Instances This property is required. GetGateways Gateway Gateway Instance[] - gateway
Name 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.
- modified
Time This property is required. string - The Modify time of Gateway.
- parent
Id 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
. - user
Id 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[GetGateways Gateway Gateway Instance] - 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.
- create
Time This property is required. String - The creation time of Gateway.
- gateway
Desc This property is required. String - The description of Gateway.
- gateway
Instances This property is required. List<Property Map> - gateway
Name 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.
- modified
Time This property is required. String - The Modify time of Gateway.
- parent
Id 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
. - user
Id This property is required. String - The user's id.
GetGatewaysGatewayGatewayInstance
- Connect
Endpoint Type This property is required. string - The connection type of Gateway instance.
- Current
Daemon Version This property is required. string - The process of version number of Gateway instance.
- Current
Version This property is required. string - The version of Gateway instance.
- End
Point This property is required. string - The endpoint address of Gateway instance.
- Gateway
Instance Id This property is required. string - The id of Gateway instance.
- Gateway
Instance Status This property is required. string - The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
. - Last
Update Time This property is required. string - The last Updated time stamp of Gateway instance.
- Local
Ip This property is required. string - The Local IP ADDRESS of Gateway instance.
- Message
This property is required. string - The prompt information of Gateway instance.
- Output
Ip This property is required. string - The host of Gateway instance.
- Connect
Endpoint Type This property is required. string - The connection type of Gateway instance.
- Current
Daemon Version This property is required. string - The process of version number of Gateway instance.
- Current
Version This property is required. string - The version of Gateway instance.
- End
Point This property is required. string - The endpoint address of Gateway instance.
- Gateway
Instance Id This property is required. string - The id of Gateway instance.
- Gateway
Instance Status This property is required. string - The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
. - Last
Update Time This property is required. string - The last Updated time stamp of Gateway instance.
- Local
Ip This property is required. string - The Local IP ADDRESS of Gateway instance.
- Message
This property is required. string - The prompt information of Gateway instance.
- Output
Ip This property is required. string - The host of Gateway instance.
- connect
Endpoint Type This property is required. String - The connection type of Gateway instance.
- current
Daemon Version This property is required. String - The process of version number of Gateway instance.
- current
Version This property is required. String - The version of Gateway instance.
- end
Point This property is required. String - The endpoint address of Gateway instance.
- gateway
Instance Id This property is required. String - The id of Gateway instance.
- gateway
Instance Status This property is required. String - The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
. - last
Update Time This property is required. String - The last Updated time stamp of Gateway instance.
- local
Ip This property is required. String - The Local IP ADDRESS of Gateway instance.
- message
This property is required. String - The prompt information of Gateway instance.
- output
Ip This property is required. String - The host of Gateway instance.
- connect
Endpoint Type This property is required. string - The connection type of Gateway instance.
- current
Daemon Version This property is required. string - The process of version number of Gateway instance.
- current
Version This property is required. string - The version of Gateway instance.
- end
Point This property is required. string - The endpoint address of Gateway instance.
- gateway
Instance Id This property is required. string - The id of Gateway instance.
- gateway
Instance Status This property is required. string - The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
. - last
Update Time This property is required. string - The last Updated time stamp of Gateway instance.
- local
Ip This property is required. string - The Local IP ADDRESS of Gateway instance.
- message
This property is required. string - The prompt information of Gateway instance.
- output
Ip 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.
- connect
Endpoint Type This property is required. String - The connection type of Gateway instance.
- current
Daemon Version This property is required. String - The process of version number of Gateway instance.
- current
Version This property is required. String - The version of Gateway instance.
- end
Point This property is required. String - The endpoint address of Gateway instance.
- gateway
Instance Id This property is required. String - The id of Gateway instance.
- gateway
Instance Status This property is required. String - The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
. - last
Update Time This property is required. String - The last Updated time stamp of Gateway instance.
- local
Ip This property is required. String - The Local IP ADDRESS of Gateway instance.
- message
This property is required. String - The prompt information of Gateway instance.
- output
Ip 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.