1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. realtimecompute
  6. getSqlFiles
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.108.0
published on Thursday, Sep 17, 2026 by Pulumi

    This data source provides Realtime Compute Sql File available to the user.What is Sql File

    NOTE: Available since v1.292.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tfexample-sql-file";
    const _default = alicloud.realtimecompute.getSqlFiles({
        workspace: "a14bda1c4a****",
        namespace: "default-namespace",
        ids: ["a14bda1c4a****:default-namespace:123456"],
    });
    export const firstSqlFileId = _default.then(_default => _default.files?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tfexample-sql-file"
    default = alicloud.realtimecompute.get_sql_files(workspace="a14bda1c4a****",
        namespace="default-namespace",
        ids=["a14bda1c4a****:default-namespace:123456"])
    pulumi.export("firstSqlFileId", default.files[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/realtimecompute"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "tfexample-sql-file"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := realtimecompute.GetSqlFiles(ctx, &realtimecompute.GetSqlFilesArgs{
    			Workspace: "a14bda1c4a****",
    			Namespace: "default-namespace",
    			Ids: []string{
    				"a14bda1c4a****:default-namespace:123456",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstSqlFileId", _default.Files[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "tfexample-sql-file";
        var @default = AliCloud.RealtimeCompute.GetSqlFiles.Invoke(new()
        {
            Workspace = "a14bda1c4a****",
            Namespace = "default-namespace",
            Ids = new[]
            {
                "a14bda1c4a****:default-namespace:123456",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["firstSqlFileId"] = @default.Apply(@default => @default.Apply(getSqlFilesResult => getSqlFilesResult.Files[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.realtimecompute.RealtimecomputeFunctions;
    import com.pulumi.alicloud.realtimecompute.inputs.GetSqlFilesArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 config = ctx.config();
            final var name = config.get("name").orElse("tfexample-sql-file");
            final var default = RealtimecomputeFunctions.getSqlFiles(GetSqlFilesArgs.builder()
                .workspace("a14bda1c4a****")
                .namespace("default-namespace")
                .ids("a14bda1c4a****:default-namespace:123456")
                .build());
    
            ctx.export("firstSqlFileId", default_.files()[0].id());
        }
    }
    
    configuration:
      name:
        type: string
        default: tfexample-sql-file
    variables:
      default:
        fn::invoke:
          function: alicloud:realtimecompute:getSqlFiles
          arguments:
            workspace: a14bda1c4a****
            namespace: default-namespace
            ids:
              - a14bda1c4a****:default-namespace:123456
    outputs:
      firstSqlFileId: ${default.files[0].id}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_realtimecompute_getsqlfiles" "default" {
      workspace = "a14bda1c4a****"
      namespace = "default-namespace"
      ids       = ["a14bda1c4a****:default-namespace:123456"]
    }
    
    variable "name" {
      type    = string
      default = "tfexample-sql-file"
    }
    output "firstSqlFileId" {
      value = data.alicloud_realtimecompute_getsqlfiles.default.files[0].id
    }
    

    Using getSqlFiles

    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 getSqlFiles(args: GetSqlFilesArgs, opts?: InvokeOptions): Promise<GetSqlFilesResult>
    function getSqlFilesOutput(args: GetSqlFilesOutputArgs, opts?: InvokeOutputOptions): Output<GetSqlFilesResult>
    def get_sql_files(ids: Optional[Sequence[str]] = None,
                      namespace: Optional[str] = None,
                      output_file: Optional[str] = None,
                      workspace: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetSqlFilesResult
    def get_sql_files_output(ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                      namespace: pulumi.Input[Optional[str]] = None,
                      output_file: pulumi.Input[Optional[str]] = None,
                      workspace: pulumi.Input[Optional[str]] = None,
                      opts: Optional[InvokeOutputOptions] = None) -> Output[GetSqlFilesResult]
    func GetSqlFiles(ctx *Context, args *GetSqlFilesArgs, opts ...InvokeOption) (*GetSqlFilesResult, error)
    func GetSqlFilesOutput(ctx *Context, args *GetSqlFilesOutputArgs, opts ...InvokeOption) GetSqlFilesResultOutput

    > Note: This function is named GetSqlFiles in the Go SDK.

    public static class GetSqlFiles 
    {
        public static Task<GetSqlFilesResult> InvokeAsync(GetSqlFilesArgs args, InvokeOptions? opts = null)
        public static Output<GetSqlFilesResult> Invoke(GetSqlFilesInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetSqlFilesResult> Invoke(GetSqlFilesInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetSqlFilesResult> getSqlFiles(GetSqlFilesArgs args, InvokeOptions options)
    public static Output<GetSqlFilesResult> getSqlFiles(GetSqlFilesArgs args, InvokeOptions options)
    public static Output<GetSqlFilesResult> getSqlFiles(GetSqlFilesArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: alicloud:realtimecompute/getSqlFiles:getSqlFiles
      arguments:
        # arguments dictionary
    data "alicloud_realtimecompute_get_sql_files" "name" {
        # arguments
    }

    The following arguments are supported:

    Namespace string
    The name of the namespace.
    Workspace string
    The ID of the workspace.
    Ids List<string>
    A list of Sql File IDs. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Namespace string
    The name of the namespace.
    Workspace string
    The ID of the workspace.
    Ids []string
    A list of Sql File IDs. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    namespace string
    The name of the namespace.
    workspace string
    The ID of the workspace.
    ids list(string)
    A list of Sql File IDs. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    output_file string
    File name where to save data source results (after running pulumi preview).
    namespace String
    The name of the namespace.
    workspace String
    The ID of the workspace.
    ids List<String>
    A list of Sql File IDs. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    namespace string
    The name of the namespace.
    workspace string
    The ID of the workspace.
    ids string[]
    A list of Sql File IDs. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    namespace str
    The name of the namespace.
    workspace str
    The ID of the workspace.
    ids Sequence[str]
    A list of Sql File IDs. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    output_file str
    File name where to save data source results (after running pulumi preview).
    namespace String
    The name of the namespace.
    workspace String
    The ID of the workspace.
    ids List<String>
    A list of Sql File IDs. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getSqlFiles Result

    The following output properties are available:

    Files List<Pulumi.AliCloud.RealtimeCompute.Outputs.GetSqlFilesFile>
    A list of Sql File Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Sql File IDs.
    Namespace string
    The name of the namespace.
    Workspace string
    The ID of the workspace.
    OutputFile string
    Files []GetSqlFilesFile
    A list of Sql File Entries. Each element contains the following attributes:
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Sql File IDs.
    Namespace string
    The name of the namespace.
    Workspace string
    The ID of the workspace.
    OutputFile string
    files list(object)
    A list of Sql File Entries. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids list(string)
    A list of Sql File IDs.
    namespace string
    The name of the namespace.
    workspace string
    The ID of the workspace.
    output_file string
    files List<GetSqlFilesFile>
    A list of Sql File Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Sql File IDs.
    namespace String
    The name of the namespace.
    workspace String
    The ID of the workspace.
    outputFile String
    files GetSqlFilesFile[]
    A list of Sql File Entries. Each element contains the following attributes:
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Sql File IDs.
    namespace string
    The name of the namespace.
    workspace string
    The ID of the workspace.
    outputFile string
    files Sequence[GetSqlFilesFile]
    A list of Sql File Entries. Each element contains the following attributes:
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Sql File IDs.
    namespace str
    The name of the namespace.
    workspace str
    The ID of the workspace.
    output_file str
    files List<Property Map>
    A list of Sql File Entries. Each element contains the following attributes:
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Sql File IDs.
    namespace String
    The name of the namespace.
    workspace String
    The ID of the workspace.
    outputFile String

    Supporting Types

    GetSqlFilesFile

    BatchMode string
    Whether the SQL query script runs in batch mode.
    Description string
    The description of the SQL file.
    Id string
    The ID of the SQL file. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    Name string
    The name of the SQL file.
    Namespace string
    The name of the namespace.
    ParentId string
    The ID of the parent folder of the SQL file.
    SessionClusterName string
    The name of the session cluster that runs the SQL query script.
    SqlFileId string
    The ID of the SQL file.
    SqlScript string
    The SQL script content.
    Workspace string
    The ID of the workspace.
    BatchMode string
    Whether the SQL query script runs in batch mode.
    Description string
    The description of the SQL file.
    Id string
    The ID of the SQL file. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    Name string
    The name of the SQL file.
    Namespace string
    The name of the namespace.
    ParentId string
    The ID of the parent folder of the SQL file.
    SessionClusterName string
    The name of the session cluster that runs the SQL query script.
    SqlFileId string
    The ID of the SQL file.
    SqlScript string
    The SQL script content.
    Workspace string
    The ID of the workspace.
    batch_mode string
    Whether the SQL query script runs in batch mode.
    description string
    The description of the SQL file.
    id string
    The ID of the SQL file. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    name string
    The name of the SQL file.
    namespace string
    The name of the namespace.
    parent_id string
    The ID of the parent folder of the SQL file.
    session_cluster_name string
    The name of the session cluster that runs the SQL query script.
    sql_file_id string
    The ID of the SQL file.
    sql_script string
    The SQL script content.
    workspace string
    The ID of the workspace.
    batchMode String
    Whether the SQL query script runs in batch mode.
    description String
    The description of the SQL file.
    id String
    The ID of the SQL file. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    name String
    The name of the SQL file.
    namespace String
    The name of the namespace.
    parentId String
    The ID of the parent folder of the SQL file.
    sessionClusterName String
    The name of the session cluster that runs the SQL query script.
    sqlFileId String
    The ID of the SQL file.
    sqlScript String
    The SQL script content.
    workspace String
    The ID of the workspace.
    batchMode string
    Whether the SQL query script runs in batch mode.
    description string
    The description of the SQL file.
    id string
    The ID of the SQL file. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    name string
    The name of the SQL file.
    namespace string
    The name of the namespace.
    parentId string
    The ID of the parent folder of the SQL file.
    sessionClusterName string
    The name of the session cluster that runs the SQL query script.
    sqlFileId string
    The ID of the SQL file.
    sqlScript string
    The SQL script content.
    workspace string
    The ID of the workspace.
    batch_mode str
    Whether the SQL query script runs in batch mode.
    description str
    The description of the SQL file.
    id str
    The ID of the SQL file. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    name str
    The name of the SQL file.
    namespace str
    The name of the namespace.
    parent_id str
    The ID of the parent folder of the SQL file.
    session_cluster_name str
    The name of the session cluster that runs the SQL query script.
    sql_file_id str
    The ID of the SQL file.
    sql_script str
    The SQL script content.
    workspace str
    The ID of the workspace.
    batchMode String
    Whether the SQL query script runs in batch mode.
    description String
    The description of the SQL file.
    id String
    The ID of the SQL file. The value is formulated as <workspace>:<namespace>:<sql_file_id>.
    name String
    The name of the SQL file.
    namespace String
    The name of the namespace.
    parentId String
    The ID of the parent folder of the SQL file.
    sessionClusterName String
    The name of the session cluster that runs the SQL query script.
    sqlFileId String
    The ID of the SQL file.
    sqlScript String
    The SQL script content.
    workspace String
    The ID of the workspace.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo alicloud logo
    Viewing docs for Alibaba Cloud v3.108.0
    published on Thursday, Sep 17, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial