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
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 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
})
}
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()));
}
}
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)
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);
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:
- Enable
Details bool Default to
false
. Set it totrue
can output more details about resource attributes.- Ids List<string>
A list of Gateway IDs.
- Name
Regex string 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 string The search key.
- Status string
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 []string
A list of Gateway IDs.
- Name
Regex string 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 string The search key.
- Status string
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 List<String>
A list of Gateway IDs.
- name
Regex String 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 String The search key.
- status String
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 string[]
A list of Gateway IDs.
- name
Regex string 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 string The search key.
- status string
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 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
.
- enable
Details Boolean Default to
false
. Set it totrue
can output more details about resource attributes.- ids List<String>
A list of Gateway IDs.
- name
Regex String 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 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.
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 string The creation time of Gateway.
- Gateway
Desc string The description of Gateway.
- Gateway
Instances List<Pulumi.Ali Cloud. Database Gateway. Inputs. Get Gateways Gateway Gateway Instance> - Gateway
Name string The name of the Gateway.
- Hosts string
A host of information.
- Id string
The ID of Gateway.
- Modified
Time string The Modify time of Gateway.
- Parent
Id string The parent node Id of Gateway.
- Status string
The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- User
Id string The user's id.
- Create
Time string The creation time of Gateway.
- Gateway
Desc string The description of Gateway.
- Gateway
Instances []GetGateways Gateway Gateway Instance - Gateway
Name string The name of the Gateway.
- Hosts string
A host of information.
- Id string
The ID of Gateway.
- Modified
Time string The Modify time of Gateway.
- Parent
Id string The parent node Id of Gateway.
- Status string
The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- User
Id string The user's id.
- create
Time String The creation time of Gateway.
- gateway
Desc String The description of Gateway.
- gateway
Instances List<GetGateways Gateway Gateway Instance> - gateway
Name String The name of the Gateway.
- hosts String
A host of information.
- id String
The ID of Gateway.
- modified
Time String The Modify time of Gateway.
- parent
Id String The parent node Id of Gateway.
- status String
The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- user
Id String The user's id.
- create
Time string The creation time of Gateway.
- gateway
Desc string The description of Gateway.
- gateway
Instances GetGateways Gateway Gateway Instance[] - gateway
Name string The name of the Gateway.
- hosts string
A host of information.
- id string
The ID of Gateway.
- modified
Time string The Modify time of Gateway.
- parent
Id string The parent node Id of Gateway.
- status string
The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- user
Id string The user's id.
- create_
time str The creation time of Gateway.
- gateway_
desc str The description of Gateway.
- gateway_
instances Sequence[GetGateways Gateway Gateway Instance] - 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.
- create
Time String The creation time of Gateway.
- gateway
Desc String The description of Gateway.
- gateway
Instances List<Property Map> - gateway
Name String The name of the Gateway.
- hosts String
A host of information.
- id String
The ID of Gateway.
- modified
Time String The Modify time of Gateway.
- parent
Id String The parent node Id of Gateway.
- status String
The status of gateway. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- user
Id String The user's id.
GetGatewaysGatewayGatewayInstance
- Connect
Endpoint stringType The connection type of Gateway instance.
- Current
Daemon stringVersion The process of version number of Gateway instance.
- Current
Version string The version of Gateway instance.
- End
Point string The endpoint address of Gateway instance.
- Gateway
Instance stringId The id of Gateway instance.
- Gateway
Instance stringStatus The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- Last
Update stringTime The last Updated time stamp of Gateway instance.
- Local
Ip string The Local IP ADDRESS of Gateway instance.
- Message string
The prompt information of Gateway instance.
- Output
Ip string The host of Gateway instance.
- Connect
Endpoint stringType The connection type of Gateway instance.
- Current
Daemon stringVersion The process of version number of Gateway instance.
- Current
Version string The version of Gateway instance.
- End
Point string The endpoint address of Gateway instance.
- Gateway
Instance stringId The id of Gateway instance.
- Gateway
Instance stringStatus The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- Last
Update stringTime The last Updated time stamp of Gateway instance.
- Local
Ip string The Local IP ADDRESS of Gateway instance.
- Message string
The prompt information of Gateway instance.
- Output
Ip string The host of Gateway instance.
- connect
Endpoint StringType The connection type of Gateway instance.
- current
Daemon StringVersion The process of version number of Gateway instance.
- current
Version String The version of Gateway instance.
- end
Point String The endpoint address of Gateway instance.
- gateway
Instance StringId The id of Gateway instance.
- gateway
Instance StringStatus The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- last
Update StringTime The last Updated time stamp of Gateway instance.
- local
Ip String The Local IP ADDRESS of Gateway instance.
- message String
The prompt information of Gateway instance.
- output
Ip String The host of Gateway instance.
- connect
Endpoint stringType The connection type of Gateway instance.
- current
Daemon stringVersion The process of version number of Gateway instance.
- current
Version string The version of Gateway instance.
- end
Point string The endpoint address of Gateway instance.
- gateway
Instance stringId The id of Gateway instance.
- gateway
Instance stringStatus The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- last
Update stringTime The last Updated time stamp of Gateway instance.
- local
Ip string The Local IP ADDRESS of Gateway instance.
- message string
The prompt information of Gateway instance.
- output
Ip string The host of Gateway instance.
- connect_
endpoint_ strtype The connection type of Gateway instance.
- current_
daemon_ strversion 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_ strid The id of Gateway instance.
- gateway_
instance_ strstatus The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- last_
update_ strtime 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.
- connect
Endpoint StringType The connection type of Gateway instance.
- current
Daemon StringVersion The process of version number of Gateway instance.
- current
Version String The version of Gateway instance.
- end
Point String The endpoint address of Gateway instance.
- gateway
Instance StringId The id of Gateway instance.
- gateway
Instance StringStatus The status of Gateway instance. Valid values:
EXCEPTION
,NEW
,RUNNING
,STOPPED
.- last
Update StringTime The last Updated time stamp of Gateway instance.
- local
Ip String The Local IP ADDRESS of Gateway instance.
- message String
The prompt information of Gateway instance.
- output
Ip 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.