1. Registry
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. realtimecompute
  6. SqlFile
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

    Provides a Realtime Compute Sql File resource.

    SQL query script file of Realtime Compute for Apache Flink.

    For information about Realtime Compute Sql File and how to use it, see What is Sql File.

    NOTE: Available since v1.292.0.

    Example Usage

    Basic 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 = new alicloud.vpc.Network("default", {
        isDefault: false,
        cidrBlock: "172.16.0.0/16",
        vpcName: name,
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        isDefault: false,
        vpcId: _default.id,
        zoneId: "cn-beijing-g",
        cidrBlock: "172.16.0.0/24",
        vswitchName: name,
    });
    const defaultBucket = new alicloud.oss.Bucket("default", {});
    const defaultVvpInstance = new alicloud.realtimecompute.VvpInstance("default", {
        vvpInstanceName: name,
        storage: {
            oss: {
                bucket: defaultBucket.id,
            },
        },
        vpcId: _default.id,
        vswitchIds: [defaultSwitch.id],
        resourceSpec: {
            cpu: 4,
            memoryGb: 16,
        },
        paymentType: "PayAsYouGo",
        zoneId: defaultSwitch.zoneId,
    });
    const defaultSqlFile = new alicloud.realtimecompute.SqlFile("default", {
        workspace: defaultVvpInstance.resourceId,
        namespace: pulumi.interpolate`${defaultVvpInstance.vvpInstanceName}-default`,
        name: name,
        sqlScript: "SELECT * FROM `vvp`.`default`.example_table;",
        sessionClusterName: "example-session-cluster",
        description: "example sql file",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tfexample-sql-file"
    default = alicloud.vpc.Network("default",
        is_default=False,
        cidr_block="172.16.0.0/16",
        vpc_name=name)
    default_switch = alicloud.vpc.Switch("default",
        is_default=False,
        vpc_id=default.id,
        zone_id="cn-beijing-g",
        cidr_block="172.16.0.0/24",
        vswitch_name=name)
    default_bucket = alicloud.oss.Bucket("default")
    default_vvp_instance = alicloud.realtimecompute.VvpInstance("default",
        vvp_instance_name=name,
        storage={
            "oss": {
                "bucket": default_bucket.id,
            },
        },
        vpc_id=default.id,
        vswitch_ids=[default_switch.id],
        resource_spec={
            "cpu": 4,
            "memory_gb": 16,
        },
        payment_type="PayAsYouGo",
        zone_id=default_switch.zone_id)
    default_sql_file = alicloud.realtimecompute.SqlFile("default",
        workspace=default_vvp_instance.resource_id,
        namespace=default_vvp_instance.vvp_instance_name.apply(lambda vvp_instance_name: f"{vvp_instance_name}-default"),
        name=name,
        sql_script="SELECT * FROM `vvp`.`default`.example_table;",
        session_cluster_name="example-session-cluster",
        description="example sql file")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oss"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/realtimecompute"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"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 := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			IsDefault: pulumi.Bool(false),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    			VpcName:   pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			IsDefault:   pulumi.Bool(false),
    			VpcId:       _default.ID().ToIDOutput().ToStringOutput(),
    			ZoneId:      pulumi.String("cn-beijing-g"),
    			CidrBlock:   pulumi.String("172.16.0.0/24"),
    			VswitchName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultBucket, err := oss.NewBucket(ctx, "default", nil)
    		if err != nil {
    			return err
    		}
    		defaultVvpInstance, err := realtimecompute.NewVvpInstance(ctx, "default", &realtimecompute.VvpInstanceArgs{
    			VvpInstanceName: pulumi.String(name),
    			Storage: &realtimecompute.VvpInstanceStorageArgs{
    				Oss: &realtimecompute.VvpInstanceStorageOssArgs{
    					Bucket: defaultBucket.ID().ToIDOutput().ToStringOutput(),
    				},
    			},
    			VpcId: _default.ID().ToIDOutput().ToStringOutput(),
    			VswitchIds: pulumi.StringArray{
    				defaultSwitch.ID().ToIDOutput().ToStringOutput(),
    			},
    			ResourceSpec: &realtimecompute.VvpInstanceResourceSpecArgs{
    				Cpu:      pulumi.Int(4),
    				MemoryGb: pulumi.Int(16),
    			},
    			PaymentType: pulumi.String("PayAsYouGo"),
    			ZoneId:      defaultSwitch.ZoneId,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = realtimecompute.NewSqlFile(ctx, "default", &realtimecompute.SqlFileArgs{
    			Workspace: defaultVvpInstance.ResourceId,
    			Namespace: defaultVvpInstance.VvpInstanceName.ApplyT(func(vvpInstanceName string) (string, error) {
    				return fmt.Sprintf("%v-default", vvpInstanceName), nil
    			}).(pulumi.StringOutput),
    			Name:               pulumi.String(name),
    			SqlScript:          pulumi.String("SELECT * FROM `vvp`.`default`.example_table;"),
    			SessionClusterName: pulumi.String("example-session-cluster"),
    			Description:        pulumi.String("example sql file"),
    		})
    		if err != nil {
    			return err
    		}
    		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 = new AliCloud.Vpc.Network("default", new()
        {
            IsDefault = false,
            CidrBlock = "172.16.0.0/16",
            VpcName = name,
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            IsDefault = false,
            VpcId = @default.Id,
            ZoneId = "cn-beijing-g",
            CidrBlock = "172.16.0.0/24",
            VswitchName = name,
        });
    
        var defaultBucket = new AliCloud.Oss.Bucket("default");
    
        var defaultVvpInstance = new AliCloud.RealtimeCompute.VvpInstance("default", new()
        {
            VvpInstanceName = name,
            Storage = new AliCloud.RealtimeCompute.Inputs.VvpInstanceStorageArgs
            {
                Oss = new AliCloud.RealtimeCompute.Inputs.VvpInstanceStorageOssArgs
                {
                    Bucket = defaultBucket.Id,
                },
            },
            VpcId = @default.Id,
            VswitchIds = new[]
            {
                defaultSwitch.Id,
            },
            ResourceSpec = new AliCloud.RealtimeCompute.Inputs.VvpInstanceResourceSpecArgs
            {
                Cpu = 4,
                MemoryGb = 16,
            },
            PaymentType = "PayAsYouGo",
            ZoneId = defaultSwitch.ZoneId,
        });
    
        var defaultSqlFile = new AliCloud.RealtimeCompute.SqlFile("default", new()
        {
            Workspace = defaultVvpInstance.ResourceId,
            Namespace = defaultVvpInstance.VvpInstanceName.Apply(vvpInstanceName => $"{vvpInstanceName}-default"),
            Name = name,
            SqlScript = "SELECT * FROM `vvp`.`default`.example_table;",
            SessionClusterName = "example-session-cluster",
            Description = "example sql file",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.oss.Bucket;
    import com.pulumi.alicloud.realtimecompute.VvpInstance;
    import com.pulumi.alicloud.realtimecompute.VvpInstanceArgs;
    import com.pulumi.alicloud.realtimecompute.inputs.VvpInstanceStorageArgs;
    import com.pulumi.alicloud.realtimecompute.inputs.VvpInstanceStorageOssArgs;
    import com.pulumi.alicloud.realtimecompute.inputs.VvpInstanceResourceSpecArgs;
    import com.pulumi.alicloud.realtimecompute.SqlFile;
    import com.pulumi.alicloud.realtimecompute.SqlFileArgs;
    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");
            var default_ = new Network("default", NetworkArgs.builder()
                .isDefault(false)
                .cidrBlock("172.16.0.0/16")
                .vpcName(name)
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .isDefault(false)
                .vpcId(default_.id())
                .zoneId("cn-beijing-g")
                .cidrBlock("172.16.0.0/24")
                .vswitchName(name)
                .build());
    
            var defaultBucket = new Bucket("defaultBucket");
    
            var defaultVvpInstance = new VvpInstance("defaultVvpInstance", VvpInstanceArgs.builder()
                .vvpInstanceName(name)
                .storage(VvpInstanceStorageArgs.builder()
                    .oss(VvpInstanceStorageOssArgs.builder()
                        .bucket(defaultBucket.id())
                        .build())
                    .build())
                .vpcId(default_.id())
                .vswitchIds(defaultSwitch.id())
                .resourceSpec(VvpInstanceResourceSpecArgs.builder()
                    .cpu(4)
                    .memoryGb(16)
                    .build())
                .paymentType("PayAsYouGo")
                .zoneId(defaultSwitch.zoneId())
                .build());
    
            var defaultSqlFile = new SqlFile("defaultSqlFile", SqlFileArgs.builder()
                .workspace(defaultVvpInstance.resourceId())
                .namespace(defaultVvpInstance.vvpInstanceName().applyValue(_vvpInstanceName -> String.format("%s-default", _vvpInstanceName)))
                .name(name)
                .sqlScript("SELECT * FROM `vvp`.`default`.example_table;")
                .sessionClusterName("example-session-cluster")
                .description("example sql file")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tfexample-sql-file
    resources:
      default:
        type: alicloud:vpc:Network
        properties:
          isDefault: false
          cidrBlock: 172.16.0.0/16
          vpcName: ${name}
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          isDefault: false
          vpcId: ${default.id}
          zoneId: cn-beijing-g
          cidrBlock: 172.16.0.0/24
          vswitchName: ${name}
      defaultBucket:
        type: alicloud:oss:Bucket
        name: default
      defaultVvpInstance:
        type: alicloud:realtimecompute:VvpInstance
        name: default
        properties:
          vvpInstanceName: ${name}
          storage:
            oss:
              bucket: ${defaultBucket.id}
          vpcId: ${default.id}
          vswitchIds:
            - ${defaultSwitch.id}
          resourceSpec:
            cpu: '4'
            memoryGb: '16'
          paymentType: PayAsYouGo
          zoneId: ${defaultSwitch.zoneId}
      defaultSqlFile:
        type: alicloud:realtimecompute:SqlFile
        name: default
        properties:
          workspace: ${defaultVvpInstance.resourceId}
          namespace: ${defaultVvpInstance.vvpInstanceName}-default
          name: ${name}
          sqlScript: SELECT * FROM `vvp`.`default`.example_table;
          sessionClusterName: example-session-cluster
          description: example sql file
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    resource "alicloud_vpc_network" "default" {
      is_default = false
      cidr_block = "172.16.0.0/16"
      vpc_name   = var.name
    }
    resource "alicloud_vpc_switch" "default" {
      is_default   = false
      vpc_id       = alicloud_vpc_network.default.id
      zone_id      = "cn-beijing-g"
      cidr_block   = "172.16.0.0/24"
      vswitch_name = var.name
    }
    resource "alicloud_oss_bucket" "default" {
    }
    resource "alicloud_realtimecompute_vvpinstance" "default" {
      vvp_instance_name = var.name
      storage = {
        oss = {
          bucket = alicloud_oss_bucket.default.id
        }
      }
      vpc_id      = alicloud_vpc_network.default.id
      vswitch_ids = [alicloud_vpc_switch.default.id]
      resource_spec = {
        cpu       = "4"
        memory_gb = "16"
      }
      payment_type = "PayAsYouGo"
      zone_id      = alicloud_vpc_switch.default.zone_id
    }
    resource "alicloud_realtimecompute_sqlfile" "default" {
      workspace            = alicloud_realtimecompute_vvpinstance.default.resource_id
      namespace            ="${alicloud_realtimecompute_vvpinstance.default.vvp_instance_name}-default"
      name                 = var.name
      sql_script           = "SELECT * FROM `vvp`.`default`.example_table;"
      session_cluster_name = "example-session-cluster"
      description          = "example sql file"
    }
    variable "name" {
      type    = string
      default = "tfexample-sql-file"
    }
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create SqlFile Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SqlFile(name: string, args: SqlFileArgs, opts?: CustomResourceOptions);
    @overload
    def SqlFile(resource_name: str,
                args: SqlFileArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def SqlFile(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                namespace: Optional[str] = None,
                session_cluster_name: Optional[str] = None,
                sql_script: Optional[str] = None,
                batch_mode: Optional[str] = None,
                description: Optional[str] = None,
                name: Optional[str] = None,
                parent_id: Optional[str] = None,
                workspace: Optional[str] = None)
    func NewSqlFile(ctx *Context, name string, args SqlFileArgs, opts ...ResourceOption) (*SqlFile, error)
    public SqlFile(string name, SqlFileArgs args, CustomResourceOptions? opts = null)
    public SqlFile(String name, SqlFileArgs args)
    public SqlFile(String name, SqlFileArgs args, CustomResourceOptions options)
    
    type: alicloud:realtimecompute:SqlFile
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "alicloud_realtimecompute_sql_file" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args SqlFileArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args SqlFileArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args SqlFileArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SqlFileArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SqlFileArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var sqlFileResource = new AliCloud.RealtimeCompute.SqlFile("sqlFileResource", new()
    {
        Namespace = "string",
        SessionClusterName = "string",
        SqlScript = "string",
        BatchMode = "string",
        Description = "string",
        Name = "string",
        ParentId = "string",
        Workspace = "string",
    });
    
    example, err := realtimecompute.NewSqlFile(ctx, "sqlFileResource", &realtimecompute.SqlFileArgs{
    	Namespace:          pulumi.String("string"),
    	SessionClusterName: pulumi.String("string"),
    	SqlScript:          pulumi.String("string"),
    	BatchMode:          pulumi.String("string"),
    	Description:        pulumi.String("string"),
    	Name:               pulumi.String("string"),
    	ParentId:           pulumi.String("string"),
    	Workspace:          pulumi.String("string"),
    })
    
    resource "alicloud_realtimecompute_sql_file" "sqlFileResource" {
      lifecycle {
        create_before_destroy = true
      }
      namespace            = "string"
      session_cluster_name = "string"
      sql_script           = "string"
      batch_mode           = "string"
      description          = "string"
      name                 = "string"
      parent_id            = "string"
      workspace            = "string"
    }
    
    var sqlFileResource = new SqlFile("sqlFileResource", SqlFileArgs.builder()
        .namespace("string")
        .sessionClusterName("string")
        .sqlScript("string")
        .batchMode("string")
        .description("string")
        .name("string")
        .parentId("string")
        .workspace("string")
        .build());
    
    sql_file_resource = alicloud.realtimecompute.SqlFile("sqlFileResource",
        namespace="string",
        session_cluster_name="string",
        sql_script="string",
        batch_mode="string",
        description="string",
        name="string",
        parent_id="string",
        workspace="string")
    
    const sqlFileResource = new alicloud.realtimecompute.SqlFile("sqlFileResource", {
        namespace: "string",
        sessionClusterName: "string",
        sqlScript: "string",
        batchMode: "string",
        description: "string",
        name: "string",
        parentId: "string",
        workspace: "string",
    });
    
    type: alicloud:realtimecompute:SqlFile
    properties:
        batchMode: string
        description: string
        name: string
        namespace: string
        parentId: string
        sessionClusterName: string
        sqlScript: string
        workspace: string
    

    SqlFile Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The SqlFile resource accepts the following input properties:

    Namespace string
    The name of the namespace.
    SessionClusterName string
    The name of the session cluster that runs the SQL query script.
    SqlScript string
    The SQL script content.
    BatchMode string
    Whether the SQL query script runs in batch mode.
    Description string
    The description of the SQL file.
    Name string
    The name of the SQL file.
    ParentId string
    The ID of the parent folder of the SQL file. If not specified, the SQL file is created under the root folder of SQL scripts.
    Workspace string
    The ID of the workspace.
    Namespace string
    The name of the namespace.
    SessionClusterName string
    The name of the session cluster that runs the SQL query script.
    SqlScript string
    The SQL script content.
    BatchMode string
    Whether the SQL query script runs in batch mode.
    Description string
    The description of the SQL file.
    Name string
    The name of the SQL file.
    ParentId string
    The ID of the parent folder of the SQL file. If not specified, the SQL file is created under the root folder of SQL scripts.
    Workspace string
    The ID of the workspace.
    namespace string
    The name of the namespace.
    session_cluster_name string
    The name of the session cluster that runs the SQL query script.
    sql_script string
    The SQL script content.
    batch_mode string
    Whether the SQL query script runs in batch mode.
    description string
    The description of the SQL file.
    name string
    The name of the SQL file.
    parent_id string
    The ID of the parent folder of the SQL file. If not specified, the SQL file is created under the root folder of SQL scripts.
    workspace string
    The ID of the workspace.
    namespace String
    The name of the namespace.
    sessionClusterName String
    The name of the session cluster that runs the SQL query script.
    sqlScript String
    The SQL script content.
    batchMode String
    Whether the SQL query script runs in batch mode.
    description String
    The description of the SQL file.
    name String
    The name of the SQL file.
    parentId String
    The ID of the parent folder of the SQL file. If not specified, the SQL file is created under the root folder of SQL scripts.
    workspace String
    The ID of the workspace.
    namespace string
    The name of the namespace.
    sessionClusterName string
    The name of the session cluster that runs the SQL query script.
    sqlScript string
    The SQL script content.
    batchMode string
    Whether the SQL query script runs in batch mode.
    description string
    The description of the SQL file.
    name string
    The name of the SQL file.
    parentId string
    The ID of the parent folder of the SQL file. If not specified, the SQL file is created under the root folder of SQL scripts.
    workspace string
    The ID of the workspace.
    namespace str
    The name of the namespace.
    session_cluster_name str
    The name of the session cluster that runs the SQL query script.
    sql_script str
    The SQL script content.
    batch_mode str
    Whether the SQL query script runs in batch mode.
    description str
    The description of the SQL file.
    name str
    The name of the SQL file.
    parent_id str
    The ID of the parent folder of the SQL file. If not specified, the SQL file is created under the root folder of SQL scripts.
    workspace str
    The ID of the workspace.
    namespace String
    The name of the namespace.
    sessionClusterName String
    The name of the session cluster that runs the SQL query script.
    sqlScript String
    The SQL script content.
    batchMode String
    Whether the SQL query script runs in batch mode.
    description String
    The description of the SQL file.
    name String
    The name of the SQL file.
    parentId String
    The ID of the parent folder of the SQL file. If not specified, the SQL file is created under the root folder of SQL scripts.
    workspace String
    The ID of the workspace.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SqlFile resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    SqlFileId string
    The ID of the SQL file.
    Id string
    The provider-assigned unique ID for this managed resource.
    SqlFileId string
    The ID of the SQL file.
    id string
    The provider-assigned unique ID for this managed resource.
    sql_file_id string
    The ID of the SQL file.
    id String
    The provider-assigned unique ID for this managed resource.
    sqlFileId String
    The ID of the SQL file.
    id string
    The provider-assigned unique ID for this managed resource.
    sqlFileId string
    The ID of the SQL file.
    id str
    The provider-assigned unique ID for this managed resource.
    sql_file_id str
    The ID of the SQL file.
    id String
    The provider-assigned unique ID for this managed resource.
    sqlFileId String
    The ID of the SQL file.

    Look up Existing SqlFile Resource

    Get an existing SqlFile resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: SqlFileState, opts?: CustomResourceOptions): SqlFile
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            batch_mode: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            parent_id: Optional[str] = None,
            session_cluster_name: Optional[str] = None,
            sql_file_id: Optional[str] = None,
            sql_script: Optional[str] = None,
            workspace: Optional[str] = None) -> SqlFile
    func GetSqlFile(ctx *Context, name string, id IDInput, state *SqlFileState, opts ...ResourceOption) (*SqlFile, error)
    public static SqlFile Get(string name, Input<string> id, SqlFileState? state, CustomResourceOptions? opts = null)
    public static SqlFile get(String name, Output<String> id, SqlFileState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:realtimecompute:SqlFile    get:      id: ${id}
    import {
      to = alicloud_realtimecompute_sql_file.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BatchMode string
    Whether the SQL query script runs in batch mode.
    Description string
    The description of the SQL file.
    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. If not specified, the SQL file is created under the root folder of SQL scripts.
    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.
    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. If not specified, the SQL file is created under the root folder of SQL scripts.
    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.
    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. If not specified, the SQL file is created under the root folder of SQL scripts.
    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.
    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. If not specified, the SQL file is created under the root folder of SQL scripts.
    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.
    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. If not specified, the SQL file is created under the root folder of SQL scripts.
    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.
    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. If not specified, the SQL file is created under the root folder of SQL scripts.
    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.
    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. If not specified, the SQL file is created under the root folder of SQL scripts.
    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.

    Import

    Realtime Compute Sql File can be imported using the id, e.g.

    $ pulumi import alicloud:realtimecompute/sqlFile:SqlFile example <workspace>:<namespace>:<sql_file_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    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