tencentcloud.CbsSnapshotPolicy
Explore with Pulumi AI
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:
- Repeat
Hours List<double> - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- Repeat
Weekdays List<double> - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- Snapshot
Policy stringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- Cbs
Snapshot stringPolicy Id - ID of the resource.
- Retention
Days double - Retention days of the snapshot, and the default value is 7.
- Repeat
Hours []float64 - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- Repeat
Weekdays []float64 - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- Snapshot
Policy stringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- Cbs
Snapshot stringPolicy Id - ID of the resource.
- Retention
Days float64 - Retention days of the snapshot, and the default value is 7.
- repeat
Hours List<Double> - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- repeat
Weekdays List<Double> - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- snapshot
Policy StringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- cbs
Snapshot StringPolicy Id - ID of the resource.
- retention
Days Double - Retention days of the snapshot, and the default value is 7.
- repeat
Hours number[] - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- repeat
Weekdays number[] - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- snapshot
Policy stringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- cbs
Snapshot stringPolicy Id - ID of the resource.
- retention
Days 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_ strname - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- cbs_
snapshot_ strpolicy_ id - ID of the resource.
- retention_
days float - Retention days of the snapshot, and the default value is 7.
- repeat
Hours List<Number> - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- repeat
Weekdays List<Number> - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- snapshot
Policy StringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- cbs
Snapshot StringPolicy Id - ID of the resource.
- retention
Days 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.
- Cbs
Snapshot stringPolicy Id - ID of the resource.
- Repeat
Hours List<double> - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- Repeat
Weekdays List<double> - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- Retention
Days double - Retention days of the snapshot, and the default value is 7.
- Snapshot
Policy stringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- Cbs
Snapshot stringPolicy Id - ID of the resource.
- Repeat
Hours []float64 - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- Repeat
Weekdays []float64 - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- Retention
Days float64 - Retention days of the snapshot, and the default value is 7.
- Snapshot
Policy stringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- cbs
Snapshot StringPolicy Id - ID of the resource.
- repeat
Hours List<Double> - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- repeat
Weekdays List<Double> - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- retention
Days Double - Retention days of the snapshot, and the default value is 7.
- snapshot
Policy StringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- cbs
Snapshot stringPolicy Id - ID of the resource.
- repeat
Hours number[] - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- repeat
Weekdays number[] - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- retention
Days number - Retention days of the snapshot, and the default value is 7.
- snapshot
Policy stringName - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- cbs_
snapshot_ strpolicy_ id - 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_ strname - Name of snapshot policy. The maximum length can not exceed 60 bytes.
- cbs
Snapshot StringPolicy Id - ID of the resource.
- repeat
Hours List<Number> - Trigger times of periodic snapshot. Valid value ranges: (0~23). The 0 means 00:00, and so on.
- repeat
Weekdays List<Number> - Periodic snapshot is enabled. Valid values: [0, 1, 2, 3, 4, 5, 6]. 0 means Sunday, 1-6 means Monday to Saturday.
- retention
Days Number - Retention days of the snapshot, and the default value is 7.
- snapshot
Policy StringName - 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.