1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. SqlserverRestoreInstance
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.SqlserverRestoreInstance

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a sqlserver restore_instance

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const restoreInstance = new tencentcloud.SqlserverRestoreInstance("restoreInstance", {
        backupId: 3482091273,
        instanceId: "mssql-qelbzgwf",
        renameRestores: [{
            newName: "restore_keep_pubsub_db2",
            oldName: "keep_pubsub_db2",
        }],
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    restore_instance = tencentcloud.SqlserverRestoreInstance("restoreInstance",
        backup_id=3482091273,
        instance_id="mssql-qelbzgwf",
        rename_restores=[{
            "new_name": "restore_keep_pubsub_db2",
            "old_name": "keep_pubsub_db2",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewSqlserverRestoreInstance(ctx, "restoreInstance", &tencentcloud.SqlserverRestoreInstanceArgs{
    			BackupId:   pulumi.Float64(3482091273),
    			InstanceId: pulumi.String("mssql-qelbzgwf"),
    			RenameRestores: tencentcloud.SqlserverRestoreInstanceRenameRestoreArray{
    				&tencentcloud.SqlserverRestoreInstanceRenameRestoreArgs{
    					NewName: pulumi.String("restore_keep_pubsub_db2"),
    					OldName: pulumi.String("keep_pubsub_db2"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var restoreInstance = new Tencentcloud.SqlserverRestoreInstance("restoreInstance", new()
        {
            BackupId = 3482091273,
            InstanceId = "mssql-qelbzgwf",
            RenameRestores = new[]
            {
                new Tencentcloud.Inputs.SqlserverRestoreInstanceRenameRestoreArgs
                {
                    NewName = "restore_keep_pubsub_db2",
                    OldName = "keep_pubsub_db2",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.SqlserverRestoreInstance;
    import com.pulumi.tencentcloud.SqlserverRestoreInstanceArgs;
    import com.pulumi.tencentcloud.inputs.SqlserverRestoreInstanceRenameRestoreArgs;
    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) {
            var restoreInstance = new SqlserverRestoreInstance("restoreInstance", SqlserverRestoreInstanceArgs.builder()
                .backupId(3482091273)
                .instanceId("mssql-qelbzgwf")
                .renameRestores(SqlserverRestoreInstanceRenameRestoreArgs.builder()
                    .newName("restore_keep_pubsub_db2")
                    .oldName("keep_pubsub_db2")
                    .build())
                .build());
    
        }
    }
    
    resources:
      restoreInstance:
        type: tencentcloud:SqlserverRestoreInstance
        properties:
          backupId: 3.482091273e+09
          instanceId: mssql-qelbzgwf
          renameRestores:
            - newName: restore_keep_pubsub_db2
              oldName: keep_pubsub_db2
    

    Create SqlserverRestoreInstance Resource

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

    Constructor syntax

    new SqlserverRestoreInstance(name: string, args: SqlserverRestoreInstanceArgs, opts?: CustomResourceOptions);
    @overload
    def SqlserverRestoreInstance(resource_name: str,
                                 args: SqlserverRestoreInstanceArgs,
                                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def SqlserverRestoreInstance(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 backup_id: Optional[float] = None,
                                 instance_id: Optional[str] = None,
                                 rename_restores: Optional[Sequence[SqlserverRestoreInstanceRenameRestoreArgs]] = None,
                                 sqlserver_restore_instance_id: Optional[str] = None)
    func NewSqlserverRestoreInstance(ctx *Context, name string, args SqlserverRestoreInstanceArgs, opts ...ResourceOption) (*SqlserverRestoreInstance, error)
    public SqlserverRestoreInstance(string name, SqlserverRestoreInstanceArgs args, CustomResourceOptions? opts = null)
    public SqlserverRestoreInstance(String name, SqlserverRestoreInstanceArgs args)
    public SqlserverRestoreInstance(String name, SqlserverRestoreInstanceArgs args, CustomResourceOptions options)
    
    type: tencentcloud:SqlserverRestoreInstance
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SqlserverRestoreInstanceArgs
    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 SqlserverRestoreInstanceArgs
    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 SqlserverRestoreInstanceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SqlserverRestoreInstanceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SqlserverRestoreInstanceArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    SqlserverRestoreInstance 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 SqlserverRestoreInstance resource accepts the following input properties:

    BackupId double
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    InstanceId string
    Instance ID.
    RenameRestores List<SqlserverRestoreInstanceRenameRestore>
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    SqlserverRestoreInstanceId string
    ID of the resource.
    BackupId float64
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    InstanceId string
    Instance ID.
    RenameRestores []SqlserverRestoreInstanceRenameRestoreArgs
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    SqlserverRestoreInstanceId string
    ID of the resource.
    backupId Double
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    instanceId String
    Instance ID.
    renameRestores List<SqlserverRestoreInstanceRenameRestore>
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    sqlserverRestoreInstanceId String
    ID of the resource.
    backupId number
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    instanceId string
    Instance ID.
    renameRestores SqlserverRestoreInstanceRenameRestore[]
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    sqlserverRestoreInstanceId string
    ID of the resource.
    backup_id float
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    instance_id str
    Instance ID.
    rename_restores Sequence[SqlserverRestoreInstanceRenameRestoreArgs]
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    sqlserver_restore_instance_id str
    ID of the resource.
    backupId Number
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    instanceId String
    Instance ID.
    renameRestores List<Property Map>
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    sqlserverRestoreInstanceId String
    ID of the resource.

    Outputs

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

    Encryptions List<SqlserverRestoreInstanceEncryption>
    TDE encryption, enable encrypted, disable unencrypted.
    Id string
    The provider-assigned unique ID for this managed resource.
    Encryptions []SqlserverRestoreInstanceEncryption
    TDE encryption, enable encrypted, disable unencrypted.
    Id string
    The provider-assigned unique ID for this managed resource.
    encryptions List<SqlserverRestoreInstanceEncryption>
    TDE encryption, enable encrypted, disable unencrypted.
    id String
    The provider-assigned unique ID for this managed resource.
    encryptions SqlserverRestoreInstanceEncryption[]
    TDE encryption, enable encrypted, disable unencrypted.
    id string
    The provider-assigned unique ID for this managed resource.
    encryptions Sequence[SqlserverRestoreInstanceEncryption]
    TDE encryption, enable encrypted, disable unencrypted.
    id str
    The provider-assigned unique ID for this managed resource.
    encryptions List<Property Map>
    TDE encryption, enable encrypted, disable unencrypted.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing SqlserverRestoreInstance Resource

    Get an existing SqlserverRestoreInstance 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?: SqlserverRestoreInstanceState, opts?: CustomResourceOptions): SqlserverRestoreInstance
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            backup_id: Optional[float] = None,
            encryptions: Optional[Sequence[SqlserverRestoreInstanceEncryptionArgs]] = None,
            instance_id: Optional[str] = None,
            rename_restores: Optional[Sequence[SqlserverRestoreInstanceRenameRestoreArgs]] = None,
            sqlserver_restore_instance_id: Optional[str] = None) -> SqlserverRestoreInstance
    func GetSqlserverRestoreInstance(ctx *Context, name string, id IDInput, state *SqlserverRestoreInstanceState, opts ...ResourceOption) (*SqlserverRestoreInstance, error)
    public static SqlserverRestoreInstance Get(string name, Input<string> id, SqlserverRestoreInstanceState? state, CustomResourceOptions? opts = null)
    public static SqlserverRestoreInstance get(String name, Output<String> id, SqlserverRestoreInstanceState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:SqlserverRestoreInstance    get:      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:
    BackupId double
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    Encryptions List<SqlserverRestoreInstanceEncryption>
    TDE encryption, enable encrypted, disable unencrypted.
    InstanceId string
    Instance ID.
    RenameRestores List<SqlserverRestoreInstanceRenameRestore>
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    SqlserverRestoreInstanceId string
    ID of the resource.
    BackupId float64
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    Encryptions []SqlserverRestoreInstanceEncryptionArgs
    TDE encryption, enable encrypted, disable unencrypted.
    InstanceId string
    Instance ID.
    RenameRestores []SqlserverRestoreInstanceRenameRestoreArgs
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    SqlserverRestoreInstanceId string
    ID of the resource.
    backupId Double
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    encryptions List<SqlserverRestoreInstanceEncryption>
    TDE encryption, enable encrypted, disable unencrypted.
    instanceId String
    Instance ID.
    renameRestores List<SqlserverRestoreInstanceRenameRestore>
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    sqlserverRestoreInstanceId String
    ID of the resource.
    backupId number
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    encryptions SqlserverRestoreInstanceEncryption[]
    TDE encryption, enable encrypted, disable unencrypted.
    instanceId string
    Instance ID.
    renameRestores SqlserverRestoreInstanceRenameRestore[]
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    sqlserverRestoreInstanceId string
    ID of the resource.
    backup_id float
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    encryptions Sequence[SqlserverRestoreInstanceEncryptionArgs]
    TDE encryption, enable encrypted, disable unencrypted.
    instance_id str
    Instance ID.
    rename_restores Sequence[SqlserverRestoreInstanceRenameRestoreArgs]
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    sqlserver_restore_instance_id str
    ID of the resource.
    backupId Number
    Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
    encryptions List<Property Map>
    TDE encryption, enable encrypted, disable unencrypted.
    instanceId String
    Instance ID.
    renameRestores List<Property Map>
    Restore the databases listed in ReNameRestoreDatabase and rename them after restoration. If this parameter is left empty, all databases will be restored and renamed in the default format.
    sqlserverRestoreInstanceId String
    ID of the resource.

    Supporting Types

    SqlserverRestoreInstanceEncryption, SqlserverRestoreInstanceEncryptionArgs

    DbName string
    Database name.
    Status string
    encryption, enable encrypted, disable unencrypted.
    DbName string
    Database name.
    Status string
    encryption, enable encrypted, disable unencrypted.
    dbName String
    Database name.
    status String
    encryption, enable encrypted, disable unencrypted.
    dbName string
    Database name.
    status string
    encryption, enable encrypted, disable unencrypted.
    db_name str
    Database name.
    status str
    encryption, enable encrypted, disable unencrypted.
    dbName String
    Database name.
    status String
    encryption, enable encrypted, disable unencrypted.

    SqlserverRestoreInstanceRenameRestore, SqlserverRestoreInstanceRenameRestoreArgs

    NewName string
    New database name. In offline migration, OldName will be used if NewName is left empty (OldName and NewName cannot be both empty). In database cloning, OldName and NewName must be both specified and cannot have the same value.
    OldName string
    Database name. If the OldName database does not exist, a failure will be returned.It can be left empty in offline migration tasks.
    NewName string
    New database name. In offline migration, OldName will be used if NewName is left empty (OldName and NewName cannot be both empty). In database cloning, OldName and NewName must be both specified and cannot have the same value.
    OldName string
    Database name. If the OldName database does not exist, a failure will be returned.It can be left empty in offline migration tasks.
    newName String
    New database name. In offline migration, OldName will be used if NewName is left empty (OldName and NewName cannot be both empty). In database cloning, OldName and NewName must be both specified and cannot have the same value.
    oldName String
    Database name. If the OldName database does not exist, a failure will be returned.It can be left empty in offline migration tasks.
    newName string
    New database name. In offline migration, OldName will be used if NewName is left empty (OldName and NewName cannot be both empty). In database cloning, OldName and NewName must be both specified and cannot have the same value.
    oldName string
    Database name. If the OldName database does not exist, a failure will be returned.It can be left empty in offline migration tasks.
    new_name str
    New database name. In offline migration, OldName will be used if NewName is left empty (OldName and NewName cannot be both empty). In database cloning, OldName and NewName must be both specified and cannot have the same value.
    old_name str
    Database name. If the OldName database does not exist, a failure will be returned.It can be left empty in offline migration tasks.
    newName String
    New database name. In offline migration, OldName will be used if NewName is left empty (OldName and NewName cannot be both empty). In database cloning, OldName and NewName must be both specified and cannot have the same value.
    oldName String
    Database name. If the OldName database does not exist, a failure will be returned.It can be left empty in offline migration tasks.

    Import

    sqlserver restore_instance can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/sqlserverRestoreInstance:SqlserverRestoreInstance restore_instance mssql-qelbzgwf#3482091273#keep_pubsub_db2#restore_keep_pubsub_db2
    

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

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack