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

tencentcloud.CbsSnapshotPolicy

Explore with Pulumi AI

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

    Provides a snapshot policy resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const snapshotPolicy = new tencentcloud.CbsSnapshotPolicy("snapshotPolicy", {
        repeatHours: [1],
        repeatWeekdays: [
            1,
            4,
        ],
        retentionDays: 7,
        snapshotPolicyName: "mysnapshotpolicyname",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    snapshot_policy = tencentcloud.CbsSnapshotPolicy("snapshotPolicy",
        repeat_hours=[1],
        repeat_weekdays=[
            1,
            4,
        ],
        retention_days=7,
        snapshot_policy_name="mysnapshotpolicyname")
    
    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.NewCbsSnapshotPolicy(ctx, "snapshotPolicy", &tencentcloud.CbsSnapshotPolicyArgs{
    			RepeatHours: pulumi.Float64Array{
    				pulumi.Float64(1),
    			},
    			RepeatWeekdays: pulumi.Float64Array{
    				pulumi.Float64(1),
    				pulumi.Float64(4),
    			},
    			RetentionDays:      pulumi.Float64(7),
    			SnapshotPolicyName: pulumi.String("mysnapshotpolicyname"),
    		})
    		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 snapshotPolicy = new Tencentcloud.CbsSnapshotPolicy("snapshotPolicy", new()
        {
            RepeatHours = new[]
            {
                1,
            },
            RepeatWeekdays = new[]
            {
                1,
                4,
            },
            RetentionDays = 7,
            SnapshotPolicyName = "mysnapshotpolicyname",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.CbsSnapshotPolicy;
    import com.pulumi.tencentcloud.CbsSnapshotPolicyArgs;
    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 snapshotPolicy = new CbsSnapshotPolicy("snapshotPolicy", CbsSnapshotPolicyArgs.builder()
                .repeatHours(1)
                .repeatWeekdays(            
                    1,
                    4)
                .retentionDays(7)
                .snapshotPolicyName("mysnapshotpolicyname")
                .build());
    
        }
    }
    
    resources:
      snapshotPolicy:
        type: tencentcloud:CbsSnapshotPolicy
        properties:
          repeatHours:
            - 1
          repeatWeekdays:
            - 1
            - 4
          retentionDays: 7
          snapshotPolicyName: mysnapshotpolicyname
    

    Create CbsSnapshotPolicy Resource

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

    Constructor syntax

    new CbsSnapshotPolicy(name: string, args: CbsSnapshotPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def CbsSnapshotPolicy(resource_name: str,
                          args: CbsSnapshotPolicyArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def CbsSnapshotPolicy(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          repeat_hours: Optional[Sequence[float]] = None,
                          repeat_weekdays: Optional[Sequence[float]] = None,
                          snapshot_policy_name: Optional[str] = None,
                          cbs_snapshot_policy_id: Optional[str] = None,
                          retention_days: Optional[float] = None)
    func NewCbsSnapshotPolicy(ctx *Context, name string, args CbsSnapshotPolicyArgs, opts ...ResourceOption) (*CbsSnapshotPolicy, error)
    public CbsSnapshotPolicy(string name, CbsSnapshotPolicyArgs args, CustomResourceOptions? opts = null)
    public CbsSnapshotPolicy(String name, CbsSnapshotPolicyArgs args)
    public CbsSnapshotPolicy(String name, CbsSnapshotPolicyArgs args, CustomResourceOptions options)
    
    type: tencentcloud:CbsSnapshotPolicy
    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 CbsSnapshotPolicyArgs
    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 CbsSnapshotPolicyArgs
    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 CbsSnapshotPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CbsSnapshotPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CbsSnapshotPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    RepeatHours List<double>
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    RepeatWeekdays List<double>
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    SnapshotPolicyName string
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    CbsSnapshotPolicyId string
    ID of the resource.
    RetentionDays double
    Retention days of the snapshot, and the default value is 7.
    RepeatHours []float64
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    RepeatWeekdays []float64
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    SnapshotPolicyName string
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    CbsSnapshotPolicyId string
    ID of the resource.
    RetentionDays float64
    Retention days of the snapshot, and the default value is 7.
    repeatHours List<Double>
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    repeatWeekdays List<Double>
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    snapshotPolicyName String
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    cbsSnapshotPolicyId String
    ID of the resource.
    retentionDays Double
    Retention days of the snapshot, and the default value is 7.
    repeatHours number[]
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    repeatWeekdays number[]
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    snapshotPolicyName string
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    cbsSnapshotPolicyId string
    ID of the resource.
    retentionDays number
    Retention days of the snapshot, and the default value is 7.
    repeat_hours Sequence[float]
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    repeat_weekdays Sequence[float]
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    snapshot_policy_name str
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    cbs_snapshot_policy_id str
    ID of the resource.
    retention_days float
    Retention days of the snapshot, and the default value is 7.
    repeatHours List<Number>
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    repeatWeekdays List<Number>
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    snapshotPolicyName String
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    cbsSnapshotPolicyId String
    ID of the resource.
    retentionDays Number
    Retention days of the snapshot, and the default value is 7.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CbsSnapshotPolicy 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 CbsSnapshotPolicy Resource

    Get an existing CbsSnapshotPolicy 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?: CbsSnapshotPolicyState, opts?: CustomResourceOptions): CbsSnapshotPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cbs_snapshot_policy_id: Optional[str] = None,
            repeat_hours: Optional[Sequence[float]] = None,
            repeat_weekdays: Optional[Sequence[float]] = None,
            retention_days: Optional[float] = None,
            snapshot_policy_name: Optional[str] = None) -> CbsSnapshotPolicy
    func GetCbsSnapshotPolicy(ctx *Context, name string, id IDInput, state *CbsSnapshotPolicyState, opts ...ResourceOption) (*CbsSnapshotPolicy, error)
    public static CbsSnapshotPolicy Get(string name, Input<string> id, CbsSnapshotPolicyState? state, CustomResourceOptions? opts = null)
    public static CbsSnapshotPolicy get(String name, Output<String> id, CbsSnapshotPolicyState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:CbsSnapshotPolicy    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:
    CbsSnapshotPolicyId string
    ID of the resource.
    RepeatHours List<double>
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    RepeatWeekdays List<double>
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    RetentionDays double
    Retention days of the snapshot, and the default value is 7.
    SnapshotPolicyName string
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    CbsSnapshotPolicyId string
    ID of the resource.
    RepeatHours []float64
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    RepeatWeekdays []float64
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    RetentionDays float64
    Retention days of the snapshot, and the default value is 7.
    SnapshotPolicyName string
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    cbsSnapshotPolicyId String
    ID of the resource.
    repeatHours List<Double>
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    repeatWeekdays List<Double>
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    retentionDays Double
    Retention days of the snapshot, and the default value is 7.
    snapshotPolicyName String
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    cbsSnapshotPolicyId string
    ID of the resource.
    repeatHours number[]
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    repeatWeekdays number[]
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    retentionDays number
    Retention days of the snapshot, and the default value is 7.
    snapshotPolicyName string
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    cbs_snapshot_policy_id str
    ID of the resource.
    repeat_hours Sequence[float]
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    repeat_weekdays Sequence[float]
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    retention_days float
    Retention days of the snapshot, and the default value is 7.
    snapshot_policy_name str
    Name of snapshot policy. The maximum length can not exceed 60 bytes.
    cbsSnapshotPolicyId String
    ID of the resource.
    repeatHours List<Number>
    Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
    repeatWeekdays List<Number>
    Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
    retentionDays Number
    Retention days of the snapshot, and the default value is 7.
    snapshotPolicyName String
    Name of snapshot policy. The maximum length can not exceed 60 bytes.

    Import

    CBS snapshot policy can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/cbsSnapshotPolicy:CbsSnapshotPolicy snapshot_policy asp-jliex1tn
    

    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