tencentcloud.RedisBackupOperation
Explore with Pulumi AI
Provides a resource to create a redis backup operation
Example Usage
Manually back up the Redis instance, and the backup data is kept for 7 days
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const exampleMysqlInstance = tencentcloud.getMysqlInstance({});
const exampleRedisBackupOperation = new tencentcloud.RedisBackupOperation("exampleRedisBackupOperation", {
instanceId: exampleMysqlInstance.then(exampleMysqlInstance => exampleMysqlInstance.instanceLists?.[0]?.mysqlId),
remark: "manually back",
storageDays: 7,
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example_mysql_instance = tencentcloud.get_mysql_instance()
example_redis_backup_operation = tencentcloud.RedisBackupOperation("exampleRedisBackupOperation",
instance_id=example_mysql_instance.instance_lists[0].mysql_id,
remark="manually back",
storage_days=7)
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 {
exampleMysqlInstance, err := tencentcloud.LookupMysqlInstance(ctx, &tencentcloud.LookupMysqlInstanceArgs{}, nil)
if err != nil {
return err
}
_, err = tencentcloud.NewRedisBackupOperation(ctx, "exampleRedisBackupOperation", &tencentcloud.RedisBackupOperationArgs{
InstanceId: pulumi.String(exampleMysqlInstance.InstanceLists[0].MysqlId),
Remark: pulumi.String("manually back"),
StorageDays: pulumi.Float64(7),
})
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 exampleMysqlInstance = Tencentcloud.GetMysqlInstance.Invoke();
var exampleRedisBackupOperation = new Tencentcloud.RedisBackupOperation("exampleRedisBackupOperation", new()
{
InstanceId = exampleMysqlInstance.Apply(getMysqlInstanceResult => getMysqlInstanceResult.InstanceLists[0]?.MysqlId),
Remark = "manually back",
StorageDays = 7,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetMysqlInstanceArgs;
import com.pulumi.tencentcloud.RedisBackupOperation;
import com.pulumi.tencentcloud.RedisBackupOperationArgs;
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 exampleMysqlInstance = TencentcloudFunctions.getMysqlInstance();
var exampleRedisBackupOperation = new RedisBackupOperation("exampleRedisBackupOperation", RedisBackupOperationArgs.builder()
.instanceId(exampleMysqlInstance.applyValue(getMysqlInstanceResult -> getMysqlInstanceResult.instanceLists()[0].mysqlId()))
.remark("manually back")
.storageDays(7)
.build());
}
}
resources:
exampleRedisBackupOperation:
type: tencentcloud:RedisBackupOperation
properties:
instanceId: ${exampleMysqlInstance.instanceLists[0].mysqlId}
remark: manually back
storageDays: 7
variables:
exampleMysqlInstance:
fn::invoke:
function: tencentcloud:getMysqlInstance
arguments: {}
Create RedisBackupOperation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RedisBackupOperation(name: string, args: RedisBackupOperationArgs, opts?: CustomResourceOptions);
@overload
def RedisBackupOperation(resource_name: str,
args: RedisBackupOperationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RedisBackupOperation(resource_name: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
redis_backup_operation_id: Optional[str] = None,
remark: Optional[str] = None,
storage_days: Optional[float] = None)
func NewRedisBackupOperation(ctx *Context, name string, args RedisBackupOperationArgs, opts ...ResourceOption) (*RedisBackupOperation, error)
public RedisBackupOperation(string name, RedisBackupOperationArgs args, CustomResourceOptions? opts = null)
public RedisBackupOperation(String name, RedisBackupOperationArgs args)
public RedisBackupOperation(String name, RedisBackupOperationArgs args, CustomResourceOptions options)
type: tencentcloud:RedisBackupOperation
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 RedisBackupOperationArgs
- 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 RedisBackupOperationArgs
- 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 RedisBackupOperationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RedisBackupOperationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RedisBackupOperationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
RedisBackupOperation 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 RedisBackupOperation resource accepts the following input properties:
- Instance
Id string - The ID of instance.
- Redis
Backup stringOperation Id - ID of the resource.
- Remark string
- Notes information for the backup.
- Storage
Days double - Number of days to store.0 specifies the default retention time.
- Instance
Id string - The ID of instance.
- Redis
Backup stringOperation Id - ID of the resource.
- Remark string
- Notes information for the backup.
- Storage
Days float64 - Number of days to store.0 specifies the default retention time.
- instance
Id String - The ID of instance.
- redis
Backup StringOperation Id - ID of the resource.
- remark String
- Notes information for the backup.
- storage
Days Double - Number of days to store.0 specifies the default retention time.
- instance
Id string - The ID of instance.
- redis
Backup stringOperation Id - ID of the resource.
- remark string
- Notes information for the backup.
- storage
Days number - Number of days to store.0 specifies the default retention time.
- instance_
id str - The ID of instance.
- redis_
backup_ stroperation_ id - ID of the resource.
- remark str
- Notes information for the backup.
- storage_
days float - Number of days to store.0 specifies the default retention time.
- instance
Id String - The ID of instance.
- redis
Backup StringOperation Id - ID of the resource.
- remark String
- Notes information for the backup.
- storage
Days Number - Number of days to store.0 specifies the default retention time.
Outputs
All input properties are implicitly available as output properties. Additionally, the RedisBackupOperation resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing RedisBackupOperation Resource
Get an existing RedisBackupOperation 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?: RedisBackupOperationState, opts?: CustomResourceOptions): RedisBackupOperation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
instance_id: Optional[str] = None,
redis_backup_operation_id: Optional[str] = None,
remark: Optional[str] = None,
storage_days: Optional[float] = None) -> RedisBackupOperation
func GetRedisBackupOperation(ctx *Context, name string, id IDInput, state *RedisBackupOperationState, opts ...ResourceOption) (*RedisBackupOperation, error)
public static RedisBackupOperation Get(string name, Input<string> id, RedisBackupOperationState? state, CustomResourceOptions? opts = null)
public static RedisBackupOperation get(String name, Output<String> id, RedisBackupOperationState state, CustomResourceOptions options)
resources: _: type: tencentcloud:RedisBackupOperation 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.
- Instance
Id string - The ID of instance.
- Redis
Backup stringOperation Id - ID of the resource.
- Remark string
- Notes information for the backup.
- Storage
Days double - Number of days to store.0 specifies the default retention time.
- Instance
Id string - The ID of instance.
- Redis
Backup stringOperation Id - ID of the resource.
- Remark string
- Notes information for the backup.
- Storage
Days float64 - Number of days to store.0 specifies the default retention time.
- instance
Id String - The ID of instance.
- redis
Backup StringOperation Id - ID of the resource.
- remark String
- Notes information for the backup.
- storage
Days Double - Number of days to store.0 specifies the default retention time.
- instance
Id string - The ID of instance.
- redis
Backup stringOperation Id - ID of the resource.
- remark string
- Notes information for the backup.
- storage
Days number - Number of days to store.0 specifies the default retention time.
- instance_
id str - The ID of instance.
- redis_
backup_ stroperation_ id - ID of the resource.
- remark str
- Notes information for the backup.
- storage_
days float - Number of days to store.0 specifies the default retention time.
- instance
Id String - The ID of instance.
- redis
Backup StringOperation Id - ID of the resource.
- remark String
- Notes information for the backup.
- storage
Days Number - Number of days to store.0 specifies the default retention time.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.