Alibaba Cloud v3.77.0 published on Friday, May 2, 2025 by Pulumi
alicloud.ots.getTables
Explore with Pulumi AI
This data source provides the ots tables of the current Alibaba Cloud user.
NOTE: Available in v1.40.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const tablesDs = alicloud.ots.getTables({
instanceName: "sample-instance",
nameRegex: "sample-table",
outputFile: "tables.txt",
});
export const firstTableId = tablesDs.then(tablesDs => tablesDs.tables?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
tables_ds = alicloud.ots.get_tables(instance_name="sample-instance",
name_regex="sample-table",
output_file="tables.txt")
pulumi.export("firstTableId", tables_ds.tables[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 {
tablesDs, err := ots.GetTables(ctx, &ots.GetTablesArgs{
InstanceName: "sample-instance",
NameRegex: pulumi.StringRef("sample-table"),
OutputFile: pulumi.StringRef("tables.txt"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstTableId", tablesDs.Tables[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var tablesDs = AliCloud.Ots.GetTables.Invoke(new()
{
InstanceName = "sample-instance",
NameRegex = "sample-table",
OutputFile = "tables.txt",
});
return new Dictionary<string, object?>
{
["firstTableId"] = tablesDs.Apply(getTablesResult => getTablesResult.Tables[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.GetTablesArgs;
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 tablesDs = OtsFunctions.getTables(GetTablesArgs.builder()
.instanceName("sample-instance")
.nameRegex("sample-table")
.outputFile("tables.txt")
.build());
ctx.export("firstTableId", tablesDs.tables()[0].id());
}
}
variables:
tablesDs:
fn::invoke:
function: alicloud:ots:getTables
arguments:
instanceName: sample-instance
nameRegex: sample-table
outputFile: tables.txt
outputs:
firstTableId: ${tablesDs.tables[0].id}
Using getTables
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 getTables(args: GetTablesArgs, opts?: InvokeOptions): Promise<GetTablesResult>
function getTablesOutput(args: GetTablesOutputArgs, opts?: InvokeOptions): Output<GetTablesResult>
def get_tables(ids: Optional[Sequence[str]] = None,
instance_name: Optional[str] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTablesResult
def get_tables_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,
opts: Optional[InvokeOptions] = None) -> Output[GetTablesResult]
func GetTables(ctx *Context, args *GetTablesArgs, opts ...InvokeOption) (*GetTablesResult, error)
func GetTablesOutput(ctx *Context, args *GetTablesOutputArgs, opts ...InvokeOption) GetTablesResultOutput
> Note: This function is named GetTables
in the Go SDK.
public static class GetTables
{
public static Task<GetTablesResult> InvokeAsync(GetTablesArgs args, InvokeOptions? opts = null)
public static Output<GetTablesResult> Invoke(GetTablesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetTablesResult> getTables(GetTablesArgs args, InvokeOptions options)
public static Output<GetTablesResult> getTables(GetTablesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:ots/getTables:getTables
arguments:
# arguments dictionary
The following arguments are supported:
- Instance
Name string - The name of OTS instance.
- Ids List<string>
- A list of table IDs.
- Name
Regex string - A regex string to filter results by table name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Instance
Name string - The name of OTS instance.
- Ids []string
- A list of table IDs.
- Name
Regex string - A regex string to filter results by table name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- instance
Name String - The name of OTS instance.
- ids List<String>
- A list of table IDs.
- name
Regex String - A regex string to filter results by table name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- instance
Name string - The name of OTS instance.
- ids string[]
- A list of table IDs.
- name
Regex string - A regex string to filter results by table name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- instance_
name str - The name of OTS instance.
- ids Sequence[str]
- A list of table IDs.
- name_
regex str - A regex string to filter results by table name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- instance
Name String - The name of OTS instance.
- ids List<String>
- A list of table IDs.
- name
Regex String - A regex string to filter results by table name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getTables Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of table IDs.
- Instance
Name string - The OTS instance name.
- Names List<string>
- A list of table names.
- Tables
List<Pulumi.
Ali Cloud. Ots. Outputs. Get Tables Table> - A list of tables. 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 table IDs.
- Instance
Name string - The OTS instance name.
- Names []string
- A list of table names.
- Tables
[]Get
Tables Table - A list of tables. 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 table IDs.
- instance
Name String - The OTS instance name.
- names List<String>
- A list of table names.
- tables
List<Get
Tables Table> - A list of tables. 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 table IDs.
- instance
Name string - The OTS instance name.
- names string[]
- A list of table names.
- tables
Get
Tables Table[] - A list of tables. 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 table IDs.
- instance_
name str - The OTS instance name.
- names Sequence[str]
- A list of table names.
- tables
Sequence[Get
Tables Table] - A list of tables. 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 table IDs.
- instance
Name String - The OTS instance name.
- names List<String>
- A list of table names.
- tables List<Property Map>
- A list of tables. Each element contains the following attributes:
- name
Regex String - output
File String
Supporting Types
GetTablesTable
- Defined
Columns List<Pulumi.Ali Cloud. Ots. Inputs. Get Tables Table Defined Column> - Id string
- ID of the table. The value is
<instance_name>:<table_name>
. - Instance
Name string - The name of OTS instance.
- Max
Version int - The maximum number of versions stored in this table.
- Primary
Keys List<Pulumi.Ali Cloud. Ots. Inputs. Get Tables Table Primary Key> - The property of
TableMeta
which indicates the structure information of a table. - Table
Name string - The table name of the OTS which could not be changed.
- Time
To intLive - The retention time of data stored in this table.
- Defined
Columns []GetTables Table Defined Column - Id string
- ID of the table. The value is
<instance_name>:<table_name>
. - Instance
Name string - The name of OTS instance.
- Max
Version int - The maximum number of versions stored in this table.
- Primary
Keys []GetTables Table Primary Key - The property of
TableMeta
which indicates the structure information of a table. - Table
Name string - The table name of the OTS which could not be changed.
- Time
To intLive - The retention time of data stored in this table.
- defined
Columns List<GetTables Table Defined Column> - id String
- ID of the table. The value is
<instance_name>:<table_name>
. - instance
Name String - The name of OTS instance.
- max
Version Integer - The maximum number of versions stored in this table.
- primary
Keys List<GetTables Table Primary Key> - The property of
TableMeta
which indicates the structure information of a table. - table
Name String - The table name of the OTS which could not be changed.
- time
To IntegerLive - The retention time of data stored in this table.
- defined
Columns GetTables Table Defined Column[] - id string
- ID of the table. The value is
<instance_name>:<table_name>
. - instance
Name string - The name of OTS instance.
- max
Version number - The maximum number of versions stored in this table.
- primary
Keys GetTables Table Primary Key[] - The property of
TableMeta
which indicates the structure information of a table. - table
Name string - The table name of the OTS which could not be changed.
- time
To numberLive - The retention time of data stored in this table.
- defined_
columns Sequence[GetTables Table Defined Column] - id str
- ID of the table. The value is
<instance_name>:<table_name>
. - instance_
name str - The name of OTS instance.
- max_
version int - The maximum number of versions stored in this table.
- primary_
keys Sequence[GetTables Table Primary Key] - The property of
TableMeta
which indicates the structure information of a table. - table_
name str - The table name of the OTS which could not be changed.
- time_
to_ intlive - The retention time of data stored in this table.
- defined
Columns List<Property Map> - id String
- ID of the table. The value is
<instance_name>:<table_name>
. - instance
Name String - The name of OTS instance.
- max
Version Number - The maximum number of versions stored in this table.
- primary
Keys List<Property Map> - The property of
TableMeta
which indicates the structure information of a table. - table
Name String - The table name of the OTS which could not be changed.
- time
To NumberLive - The retention time of data stored in this table.
GetTablesTableDefinedColumn
GetTablesTablePrimaryKey
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.