tencentcloud.SqlserverRestoreInstance
Explore with Pulumi AI
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:
- Backup
Id double - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- Instance
Id string - Instance ID.
- Rename
Restores List<SqlserverRestore Instance Rename Restore> - 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 stringInstance Id - ID of the resource.
- Backup
Id float64 - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- Instance
Id string - Instance ID.
- Rename
Restores []SqlserverRestore Instance Rename Restore Args - 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 stringInstance Id - ID of the resource.
- backup
Id Double - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- instance
Id String - Instance ID.
- rename
Restores List<SqlserverRestore Instance Rename Restore> - 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 StringInstance Id - ID of the resource.
- backup
Id number - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- instance
Id string - Instance ID.
- rename
Restores SqlserverRestore Instance Rename Restore[] - 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 stringInstance Id - 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[SqlserverRestore Instance Rename Restore Args] - 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_ strinstance_ id - ID of the resource.
- backup
Id Number - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- instance
Id String - Instance ID.
- rename
Restores 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.
- sqlserver
Restore StringInstance Id - 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<Sqlserver
Restore Instance Encryption> - TDE encryption,
enable
encrypted,disable
unencrypted. - Id string
- The provider-assigned unique ID for this managed resource.
- Encryptions
[]Sqlserver
Restore Instance Encryption - TDE encryption,
enable
encrypted,disable
unencrypted. - Id string
- The provider-assigned unique ID for this managed resource.
- encryptions
List<Sqlserver
Restore Instance Encryption> - TDE encryption,
enable
encrypted,disable
unencrypted. - id String
- The provider-assigned unique ID for this managed resource.
- encryptions
Sqlserver
Restore Instance Encryption[] - TDE encryption,
enable
encrypted,disable
unencrypted. - id string
- The provider-assigned unique ID for this managed resource.
- encryptions
Sequence[Sqlserver
Restore Instance Encryption] - 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.
- Backup
Id double - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- Encryptions
List<Sqlserver
Restore Instance Encryption> - TDE encryption,
enable
encrypted,disable
unencrypted. - Instance
Id string - Instance ID.
- Rename
Restores List<SqlserverRestore Instance Rename Restore> - 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 stringInstance Id - ID of the resource.
- Backup
Id float64 - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- Encryptions
[]Sqlserver
Restore Instance Encryption Args - TDE encryption,
enable
encrypted,disable
unencrypted. - Instance
Id string - Instance ID.
- Rename
Restores []SqlserverRestore Instance Rename Restore Args - 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 stringInstance Id - ID of the resource.
- backup
Id Double - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- encryptions
List<Sqlserver
Restore Instance Encryption> - TDE encryption,
enable
encrypted,disable
unencrypted. - instance
Id String - Instance ID.
- rename
Restores List<SqlserverRestore Instance Rename Restore> - 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 StringInstance Id - ID of the resource.
- backup
Id number - Backup file ID, which can be obtained through the Id field in the returned value of the DescribeBackups API.
- encryptions
Sqlserver
Restore Instance Encryption[] - TDE encryption,
enable
encrypted,disable
unencrypted. - instance
Id string - Instance ID.
- rename
Restores SqlserverRestore Instance Rename Restore[] - 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 stringInstance Id - 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[Sqlserver
Restore Instance Encryption Args] - TDE encryption,
enable
encrypted,disable
unencrypted. - instance_
id str - Instance ID.
- rename_
restores Sequence[SqlserverRestore Instance Rename Restore Args] - 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_ strinstance_ id - ID of the resource.
- backup
Id 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. - instance
Id String - Instance ID.
- rename
Restores 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.
- sqlserver
Restore StringInstance Id - ID of the resource.
Supporting Types
SqlserverRestoreInstanceEncryption, SqlserverRestoreInstanceEncryptionArgs
SqlserverRestoreInstanceRenameRestore, SqlserverRestoreInstanceRenameRestoreArgs
- New
Name 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.
- Old
Name 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 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.
- Old
Name 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 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.
- old
Name 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 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.
- old
Name 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.
- new
Name 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.
- old
Name 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.