Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi
alicloud.ots.getTunnels
Explore with Pulumi AI
This data source provides the ots tunnels of the current Alibaba Cloud user.
For information about OTS tunnel and how to use it, see Tunnel overview.
NOTE: Available in v1.172.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const tunnelsDs = alicloud.ots.getTunnels({
instanceName: "sample-instance",
tableName: "sample-table",
nameRegex: "sample-tunnel",
outputFile: "tunnels.txt",
});
export const firstTunnelId = tunnelsDs.then(tunnelsDs => tunnelsDs.tunnels?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
tunnels_ds = alicloud.ots.get_tunnels(instance_name="sample-instance",
table_name="sample-table",
name_regex="sample-tunnel",
output_file="tunnels.txt")
pulumi.export("firstTunnelId", tunnels_ds.tunnels[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ots"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tunnelsDs, err := ots.GetTunnels(ctx, &ots.GetTunnelsArgs{
InstanceName: "sample-instance",
TableName: "sample-table",
NameRegex: pulumi.StringRef("sample-tunnel"),
OutputFile: pulumi.StringRef("tunnels.txt"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstTunnelId", tunnelsDs.Tunnels[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var tunnelsDs = AliCloud.Ots.GetTunnels.Invoke(new()
{
InstanceName = "sample-instance",
TableName = "sample-table",
NameRegex = "sample-tunnel",
OutputFile = "tunnels.txt",
});
return new Dictionary<string, object?>
{
["firstTunnelId"] = tunnelsDs.Apply(getTunnelsResult => getTunnelsResult.Tunnels[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ots.OtsFunctions;
import com.pulumi.alicloud.ots.inputs.GetTunnelsArgs;
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 tunnelsDs = OtsFunctions.getTunnels(GetTunnelsArgs.builder()
.instanceName("sample-instance")
.tableName("sample-table")
.nameRegex("sample-tunnel")
.outputFile("tunnels.txt")
.build());
ctx.export("firstTunnelId", tunnelsDs.applyValue(getTunnelsResult -> getTunnelsResult.tunnels()[0].id()));
}
}
variables:
tunnelsDs:
fn::invoke:
Function: alicloud:ots:getTunnels
Arguments:
instanceName: sample-instance
tableName: sample-table
nameRegex: sample-tunnel
outputFile: tunnels.txt
outputs:
firstTunnelId: ${tunnelsDs.tunnels[0].id}
Using getTunnels
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 getTunnels(args: GetTunnelsArgs, opts?: InvokeOptions): Promise<GetTunnelsResult>
function getTunnelsOutput(args: GetTunnelsOutputArgs, opts?: InvokeOptions): Output<GetTunnelsResult>
def get_tunnels(ids: Optional[Sequence[str]] = None,
instance_name: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
table_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTunnelsResult
def get_tunnels_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
instance_name: Optional[pulumi.Input[str]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
table_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetTunnelsResult]
func GetTunnels(ctx *Context, args *GetTunnelsArgs, opts ...InvokeOption) (*GetTunnelsResult, error)
func GetTunnelsOutput(ctx *Context, args *GetTunnelsOutputArgs, opts ...InvokeOption) GetTunnelsResultOutput
> Note: This function is named GetTunnels
in the Go SDK.
public static class GetTunnels
{
public static Task<GetTunnelsResult> InvokeAsync(GetTunnelsArgs args, InvokeOptions? opts = null)
public static Output<GetTunnelsResult> Invoke(GetTunnelsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTunnelsResult> getTunnels(GetTunnelsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:ots/getTunnels:getTunnels
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Name string - The name of OTS instance.
- Table
Name string - The name of OTS table.
- Ids List<string>
- A list of tunnel IDs.
- Name
Regex string - A regex string to filter results by tunnel name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Instance
Name string - The name of OTS instance.
- Table
Name string - The name of OTS table.
- Ids []string
- A list of tunnel IDs.
- Name
Regex string - A regex string to filter results by tunnel name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- instance
Name String - The name of OTS instance.
- table
Name String - The name of OTS table.
- ids List<String>
- A list of tunnel IDs.
- name
Regex String - A regex string to filter results by tunnel name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- instance
Name string - The name of OTS instance.
- table
Name string - The name of OTS table.
- ids string[]
- A list of tunnel IDs.
- name
Regex string - A regex string to filter results by tunnel name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- instance_
name str - The name of OTS instance.
- table_
name str - The name of OTS table.
- ids Sequence[str]
- A list of tunnel IDs.
- name_
regex str - A regex string to filter results by tunnel name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- instance
Name String - The name of OTS instance.
- table
Name String - The name of OTS table.
- ids List<String>
- A list of tunnel IDs.
- name
Regex String - A regex string to filter results by tunnel name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getTunnels Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of tunnel IDs.
- Instance
Name string - The OTS instance name.
- Names List<string>
- A list of tunnel names.
- Table
Name string - The table name of the OTS which could not be changed.
- Tunnels
List<Pulumi.
Ali Cloud. Ots. Outputs. Get Tunnels Tunnel> - A list of tunnels. Each element contains the following attributes:
- Name
Regex string - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of tunnel IDs.
- Instance
Name string - The OTS instance name.
- Names []string
- A list of tunnel names.
- Table
Name string - The table name of the OTS which could not be changed.
- Tunnels
[]Get
Tunnels Tunnel - A list of tunnels. Each element contains the following attributes:
- Name
Regex string - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of tunnel IDs.
- instance
Name String - The OTS instance name.
- names List<String>
- A list of tunnel names.
- table
Name String - The table name of the OTS which could not be changed.
- tunnels
List<Get
Tunnels Tunnel> - A list of tunnels. Each element contains the following attributes:
- name
Regex String - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of tunnel IDs.
- instance
Name string - The OTS instance name.
- names string[]
- A list of tunnel names.
- table
Name string - The table name of the OTS which could not be changed.
- tunnels
Get
Tunnels Tunnel[] - A list of tunnels. Each element contains the following attributes:
- name
Regex string - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of tunnel IDs.
- instance_
name str - The OTS instance name.
- names Sequence[str]
- A list of tunnel names.
- table_
name str - The table name of the OTS which could not be changed.
- tunnels
Sequence[Get
Tunnels Tunnel] - A list of tunnels. Each element contains the following attributes:
- name_
regex str - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of tunnel IDs.
- instance
Name String - The OTS instance name.
- names List<String>
- A list of tunnel names.
- table
Name String - The table name of the OTS which could not be changed.
- tunnels List<Property Map>
- A list of tunnels. Each element contains the following attributes:
- name
Regex String - output
File String
Supporting Types
GetTunnelsTunnel
- Channels
List<Pulumi.
Ali Cloud. Ots. Inputs. Get Tunnels Tunnel Channel> - The channels of OTS tunnel. Each element contains the following attributes:
- Create
Time int - The creation time of the Tunnel.
- Expired bool
- Whether the tunnel has expired.
- Id string
- The resource ID. The value is
<instance_name>:<table_name>:<tunnel_name>
. - Instance
Name string - The name of OTS instance.
- Table
Name string - The name of OTS table.
- Tunnel
Id string - The tunnel id of the OTS which could not be changed.
- Tunnel
Name string - The tunnel name of the OTS which could not be changed.
- Tunnel
Rpo int - The latest consumption time of the tunnel, unix time in nanosecond.
- Tunnel
Stage string - The stage of OTS tunnel, valid values:
InitBaseDataAndStreamShard
,ProcessBaseData
,ProcessStream
. - Tunnel
Type string - The type of the OTS tunnel, valid values:
BaseAndStream
,BaseData
,Stream
.
- Channels
[]Get
Tunnels Tunnel Channel - The channels of OTS tunnel. Each element contains the following attributes:
- Create
Time int - The creation time of the Tunnel.
- Expired bool
- Whether the tunnel has expired.
- Id string
- The resource ID. The value is
<instance_name>:<table_name>:<tunnel_name>
. - Instance
Name string - The name of OTS instance.
- Table
Name string - The name of OTS table.
- Tunnel
Id string - The tunnel id of the OTS which could not be changed.
- Tunnel
Name string - The tunnel name of the OTS which could not be changed.
- Tunnel
Rpo int - The latest consumption time of the tunnel, unix time in nanosecond.
- Tunnel
Stage string - The stage of OTS tunnel, valid values:
InitBaseDataAndStreamShard
,ProcessBaseData
,ProcessStream
. - Tunnel
Type string - The type of the OTS tunnel, valid values:
BaseAndStream
,BaseData
,Stream
.
- channels
List<Get
Tunnels Tunnel Channel> - The channels of OTS tunnel. Each element contains the following attributes:
- create
Time Integer - The creation time of the Tunnel.
- expired Boolean
- Whether the tunnel has expired.
- id String
- The resource ID. The value is
<instance_name>:<table_name>:<tunnel_name>
. - instance
Name String - The name of OTS instance.
- table
Name String - The name of OTS table.
- tunnel
Id String - The tunnel id of the OTS which could not be changed.
- tunnel
Name String - The tunnel name of the OTS which could not be changed.
- tunnel
Rpo Integer - The latest consumption time of the tunnel, unix time in nanosecond.
- tunnel
Stage String - The stage of OTS tunnel, valid values:
InitBaseDataAndStreamShard
,ProcessBaseData
,ProcessStream
. - tunnel
Type String - The type of the OTS tunnel, valid values:
BaseAndStream
,BaseData
,Stream
.
- channels
Get
Tunnels Tunnel Channel[] - The channels of OTS tunnel. Each element contains the following attributes:
- create
Time number - The creation time of the Tunnel.
- expired boolean
- Whether the tunnel has expired.
- id string
- The resource ID. The value is
<instance_name>:<table_name>:<tunnel_name>
. - instance
Name string - The name of OTS instance.
- table
Name string - The name of OTS table.
- tunnel
Id string - The tunnel id of the OTS which could not be changed.
- tunnel
Name string - The tunnel name of the OTS which could not be changed.
- tunnel
Rpo number - The latest consumption time of the tunnel, unix time in nanosecond.
- tunnel
Stage string - The stage of OTS tunnel, valid values:
InitBaseDataAndStreamShard
,ProcessBaseData
,ProcessStream
. - tunnel
Type string - The type of the OTS tunnel, valid values:
BaseAndStream
,BaseData
,Stream
.
- channels
Sequence[Get
Tunnels Tunnel Channel] - The channels of OTS tunnel. Each element contains the following attributes:
- create_
time int - The creation time of the Tunnel.
- expired bool
- Whether the tunnel has expired.
- id str
- The resource ID. The value is
<instance_name>:<table_name>:<tunnel_name>
. - instance_
name str - The name of OTS instance.
- table_
name str - The name of OTS table.
- tunnel_
id str - The tunnel id of the OTS which could not be changed.
- tunnel_
name str - The tunnel name of the OTS which could not be changed.
- tunnel_
rpo int - The latest consumption time of the tunnel, unix time in nanosecond.
- tunnel_
stage str - The stage of OTS tunnel, valid values:
InitBaseDataAndStreamShard
,ProcessBaseData
,ProcessStream
. - tunnel_
type str - The type of the OTS tunnel, valid values:
BaseAndStream
,BaseData
,Stream
.
- channels List<Property Map>
- The channels of OTS tunnel. Each element contains the following attributes:
- create
Time Number - The creation time of the Tunnel.
- expired Boolean
- Whether the tunnel has expired.
- id String
- The resource ID. The value is
<instance_name>:<table_name>:<tunnel_name>
. - instance
Name String - The name of OTS instance.
- table
Name String - The name of OTS table.
- tunnel
Id String - The tunnel id of the OTS which could not be changed.
- tunnel
Name String - The tunnel name of the OTS which could not be changed.
- tunnel
Rpo Number - The latest consumption time of the tunnel, unix time in nanosecond.
- tunnel
Stage String - The stage of OTS tunnel, valid values:
InitBaseDataAndStreamShard
,ProcessBaseData
,ProcessStream
. - tunnel
Type String - The type of the OTS tunnel, valid values:
BaseAndStream
,BaseData
,Stream
.
GetTunnelsTunnelChannel
- Channel
Id string - The id of the channel.
- Channel
Rpo int - The latest consumption time of the channel, unix time in nanosecond
- Channel
Status string - The status of the channel, valid values:
WAIT
,OPEN
,CLOSING
,CLOSE
,TERMINATED
. - Channel
Type string - The type of the channel, valid values:
BaseData
,Stream
. - Client
Id string - The client id of the channel.
- Channel
Id string - The id of the channel.
- Channel
Rpo int - The latest consumption time of the channel, unix time in nanosecond
- Channel
Status string - The status of the channel, valid values:
WAIT
,OPEN
,CLOSING
,CLOSE
,TERMINATED
. - Channel
Type string - The type of the channel, valid values:
BaseData
,Stream
. - Client
Id string - The client id of the channel.
- channel
Id String - The id of the channel.
- channel
Rpo Integer - The latest consumption time of the channel, unix time in nanosecond
- channel
Status String - The status of the channel, valid values:
WAIT
,OPEN
,CLOSING
,CLOSE
,TERMINATED
. - channel
Type String - The type of the channel, valid values:
BaseData
,Stream
. - client
Id String - The client id of the channel.
- channel
Id string - The id of the channel.
- channel
Rpo number - The latest consumption time of the channel, unix time in nanosecond
- channel
Status string - The status of the channel, valid values:
WAIT
,OPEN
,CLOSING
,CLOSE
,TERMINATED
. - channel
Type string - The type of the channel, valid values:
BaseData
,Stream
. - client
Id string - The client id of the channel.
- channel_
id str - The id of the channel.
- channel_
rpo int - The latest consumption time of the channel, unix time in nanosecond
- channel_
status str - The status of the channel, valid values:
WAIT
,OPEN
,CLOSING
,CLOSE
,TERMINATED
. - channel_
type str - The type of the channel, valid values:
BaseData
,Stream
. - client_
id str - The client id of the channel.
- channel
Id String - The id of the channel.
- channel
Rpo Number - The latest consumption time of the channel, unix time in nanosecond
- channel
Status String - The status of the channel, valid values:
WAIT
,OPEN
,CLOSING
,CLOSE
,TERMINATED
. - channel
Type String - The type of the channel, valid values:
BaseData
,Stream
. - client
Id String - The client id of the channel.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.