tencentcloud.VpcSnapshotPolicy
Explore with Pulumi AI
Provides a resource to create a vpc snapshot_policy
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const exampleCosBucket = new tencentcloud.CosBucket("exampleCosBucket", {
bucket: "tf-example-1308919341",
acl: "private",
});
const exampleVpcSnapshotPolicy = new tencentcloud.VpcSnapshotPolicy("exampleVpcSnapshotPolicy", {
snapshotPolicyName: "tf-example",
backupType: "time",
cosBucket: exampleCosBucket.bucket,
cosRegion: "ap-guangzhou",
createNewCos: false,
keepTime: 2,
backupPolicies: [
{
backupDay: "monday",
backupTime: "00:00:00",
},
{
backupDay: "tuesday",
backupTime: "01:00:00",
},
{
backupDay: "wednesday",
backupTime: "02:00:00",
},
],
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example_cos_bucket = tencentcloud.CosBucket("exampleCosBucket",
bucket="tf-example-1308919341",
acl="private")
example_vpc_snapshot_policy = tencentcloud.VpcSnapshotPolicy("exampleVpcSnapshotPolicy",
snapshot_policy_name="tf-example",
backup_type="time",
cos_bucket=example_cos_bucket.bucket,
cos_region="ap-guangzhou",
create_new_cos=False,
keep_time=2,
backup_policies=[
{
"backup_day": "monday",
"backup_time": "00:00:00",
},
{
"backup_day": "tuesday",
"backup_time": "01:00:00",
},
{
"backup_day": "wednesday",
"backup_time": "02:00:00",
},
])
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 {
exampleCosBucket, err := tencentcloud.NewCosBucket(ctx, "exampleCosBucket", &tencentcloud.CosBucketArgs{
Bucket: pulumi.String("tf-example-1308919341"),
Acl: pulumi.String("private"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewVpcSnapshotPolicy(ctx, "exampleVpcSnapshotPolicy", &tencentcloud.VpcSnapshotPolicyArgs{
SnapshotPolicyName: pulumi.String("tf-example"),
BackupType: pulumi.String("time"),
CosBucket: exampleCosBucket.Bucket,
CosRegion: pulumi.String("ap-guangzhou"),
CreateNewCos: pulumi.Bool(false),
KeepTime: pulumi.Float64(2),
BackupPolicies: tencentcloud.VpcSnapshotPolicyBackupPolicyArray{
&tencentcloud.VpcSnapshotPolicyBackupPolicyArgs{
BackupDay: pulumi.String("monday"),
BackupTime: pulumi.String("00:00:00"),
},
&tencentcloud.VpcSnapshotPolicyBackupPolicyArgs{
BackupDay: pulumi.String("tuesday"),
BackupTime: pulumi.String("01:00:00"),
},
&tencentcloud.VpcSnapshotPolicyBackupPolicyArgs{
BackupDay: pulumi.String("wednesday"),
BackupTime: pulumi.String("02:00:00"),
},
},
})
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 exampleCosBucket = new Tencentcloud.CosBucket("exampleCosBucket", new()
{
Bucket = "tf-example-1308919341",
Acl = "private",
});
var exampleVpcSnapshotPolicy = new Tencentcloud.VpcSnapshotPolicy("exampleVpcSnapshotPolicy", new()
{
SnapshotPolicyName = "tf-example",
BackupType = "time",
CosBucket = exampleCosBucket.Bucket,
CosRegion = "ap-guangzhou",
CreateNewCos = false,
KeepTime = 2,
BackupPolicies = new[]
{
new Tencentcloud.Inputs.VpcSnapshotPolicyBackupPolicyArgs
{
BackupDay = "monday",
BackupTime = "00:00:00",
},
new Tencentcloud.Inputs.VpcSnapshotPolicyBackupPolicyArgs
{
BackupDay = "tuesday",
BackupTime = "01:00:00",
},
new Tencentcloud.Inputs.VpcSnapshotPolicyBackupPolicyArgs
{
BackupDay = "wednesday",
BackupTime = "02:00:00",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.CosBucket;
import com.pulumi.tencentcloud.CosBucketArgs;
import com.pulumi.tencentcloud.VpcSnapshotPolicy;
import com.pulumi.tencentcloud.VpcSnapshotPolicyArgs;
import com.pulumi.tencentcloud.inputs.VpcSnapshotPolicyBackupPolicyArgs;
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 exampleCosBucket = new CosBucket("exampleCosBucket", CosBucketArgs.builder()
.bucket("tf-example-1308919341")
.acl("private")
.build());
var exampleVpcSnapshotPolicy = new VpcSnapshotPolicy("exampleVpcSnapshotPolicy", VpcSnapshotPolicyArgs.builder()
.snapshotPolicyName("tf-example")
.backupType("time")
.cosBucket(exampleCosBucket.bucket())
.cosRegion("ap-guangzhou")
.createNewCos(false)
.keepTime(2)
.backupPolicies(
VpcSnapshotPolicyBackupPolicyArgs.builder()
.backupDay("monday")
.backupTime("00:00:00")
.build(),
VpcSnapshotPolicyBackupPolicyArgs.builder()
.backupDay("tuesday")
.backupTime("01:00:00")
.build(),
VpcSnapshotPolicyBackupPolicyArgs.builder()
.backupDay("wednesday")
.backupTime("02:00:00")
.build())
.build());
}
}
resources:
exampleCosBucket:
type: tencentcloud:CosBucket
properties:
bucket: tf-example-1308919341
acl: private
exampleVpcSnapshotPolicy:
type: tencentcloud:VpcSnapshotPolicy
properties:
snapshotPolicyName: tf-example
backupType: time
cosBucket: ${exampleCosBucket.bucket}
cosRegion: ap-guangzhou
createNewCos: false
keepTime: 2
backupPolicies:
- backupDay: monday
backupTime: 00:00:00
- backupDay: tuesday
backupTime: 01:00:00
- backupDay: wednesday
backupTime: 02:00:00
Create VpcSnapshotPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpcSnapshotPolicy(name: string, args: VpcSnapshotPolicyArgs, opts?: CustomResourceOptions);
@overload
def VpcSnapshotPolicy(resource_name: str,
args: VpcSnapshotPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VpcSnapshotPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
backup_type: Optional[str] = None,
cos_bucket: Optional[str] = None,
cos_region: Optional[str] = None,
create_new_cos: Optional[bool] = None,
keep_time: Optional[float] = None,
snapshot_policy_name: Optional[str] = None,
backup_policies: Optional[Sequence[VpcSnapshotPolicyBackupPolicyArgs]] = None,
vpc_snapshot_policy_id: Optional[str] = None)
func NewVpcSnapshotPolicy(ctx *Context, name string, args VpcSnapshotPolicyArgs, opts ...ResourceOption) (*VpcSnapshotPolicy, error)
public VpcSnapshotPolicy(string name, VpcSnapshotPolicyArgs args, CustomResourceOptions? opts = null)
public VpcSnapshotPolicy(String name, VpcSnapshotPolicyArgs args)
public VpcSnapshotPolicy(String name, VpcSnapshotPolicyArgs args, CustomResourceOptions options)
type: tencentcloud:VpcSnapshotPolicy
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 VpcSnapshotPolicyArgs
- 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 VpcSnapshotPolicyArgs
- 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 VpcSnapshotPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcSnapshotPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcSnapshotPolicyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
VpcSnapshotPolicy 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 VpcSnapshotPolicy resource accepts the following input properties:
- Backup
Type string - Backup strategy type,
operate
: operate backup,time
: schedule backup. - Cos
Bucket string - cos bucket.
- Cos
Region string - The region where the cos bucket is located.
- Create
New boolCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- Keep
Time double - The retention time supports 1 to 365 days.
- Snapshot
Policy stringName - Snapshot policy name.
- Backup
Policies List<VpcSnapshot Policy Backup Policy> - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- Vpc
Snapshot stringPolicy Id - ID of the resource.
- Backup
Type string - Backup strategy type,
operate
: operate backup,time
: schedule backup. - Cos
Bucket string - cos bucket.
- Cos
Region string - The region where the cos bucket is located.
- Create
New boolCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- Keep
Time float64 - The retention time supports 1 to 365 days.
- Snapshot
Policy stringName - Snapshot policy name.
- Backup
Policies []VpcSnapshot Policy Backup Policy Args - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- Vpc
Snapshot stringPolicy Id - ID of the resource.
- backup
Type String - Backup strategy type,
operate
: operate backup,time
: schedule backup. - cos
Bucket String - cos bucket.
- cos
Region String - The region where the cos bucket is located.
- create
New BooleanCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- keep
Time Double - The retention time supports 1 to 365 days.
- snapshot
Policy StringName - Snapshot policy name.
- backup
Policies List<VpcSnapshot Policy Backup Policy> - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- vpc
Snapshot StringPolicy Id - ID of the resource.
- backup
Type string - Backup strategy type,
operate
: operate backup,time
: schedule backup. - cos
Bucket string - cos bucket.
- cos
Region string - The region where the cos bucket is located.
- create
New booleanCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- keep
Time number - The retention time supports 1 to 365 days.
- snapshot
Policy stringName - Snapshot policy name.
- backup
Policies VpcSnapshot Policy Backup Policy[] - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- vpc
Snapshot stringPolicy Id - ID of the resource.
- backup_
type str - Backup strategy type,
operate
: operate backup,time
: schedule backup. - cos_
bucket str - cos bucket.
- cos_
region str - The region where the cos bucket is located.
- create_
new_ boolcos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- keep_
time float - The retention time supports 1 to 365 days.
- snapshot_
policy_ strname - Snapshot policy name.
- backup_
policies Sequence[VpcSnapshot Policy Backup Policy Args] - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- vpc_
snapshot_ strpolicy_ id - ID of the resource.
- backup
Type String - Backup strategy type,
operate
: operate backup,time
: schedule backup. - cos
Bucket String - cos bucket.
- cos
Region String - The region where the cos bucket is located.
- create
New BooleanCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- keep
Time Number - The retention time supports 1 to 365 days.
- snapshot
Policy StringName - Snapshot policy name.
- backup
Policies List<Property Map> - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- vpc
Snapshot StringPolicy Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcSnapshotPolicy resource produces the following output properties:
- Create
Time string - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- Enable bool
- Enabled state, True-enabled, False-disabled, the default is True.
- Id string
- The provider-assigned unique ID for this managed resource.
- Snapshot
Policy stringId - Snapshot policy Id.
- Create
Time string - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- Enable bool
- Enabled state, True-enabled, False-disabled, the default is True.
- Id string
- The provider-assigned unique ID for this managed resource.
- Snapshot
Policy stringId - Snapshot policy Id.
- create
Time String - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- enable Boolean
- Enabled state, True-enabled, False-disabled, the default is True.
- id String
- The provider-assigned unique ID for this managed resource.
- snapshot
Policy StringId - Snapshot policy Id.
- create
Time string - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- enable boolean
- Enabled state, True-enabled, False-disabled, the default is True.
- id string
- The provider-assigned unique ID for this managed resource.
- snapshot
Policy stringId - Snapshot policy Id.
- create_
time str - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- enable bool
- Enabled state, True-enabled, False-disabled, the default is True.
- id str
- The provider-assigned unique ID for this managed resource.
- snapshot_
policy_ strid - Snapshot policy Id.
- create
Time String - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- enable Boolean
- Enabled state, True-enabled, False-disabled, the default is True.
- id String
- The provider-assigned unique ID for this managed resource.
- snapshot
Policy StringId - Snapshot policy Id.
Look up Existing VpcSnapshotPolicy Resource
Get an existing VpcSnapshotPolicy 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?: VpcSnapshotPolicyState, opts?: CustomResourceOptions): VpcSnapshotPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backup_policies: Optional[Sequence[VpcSnapshotPolicyBackupPolicyArgs]] = None,
backup_type: Optional[str] = None,
cos_bucket: Optional[str] = None,
cos_region: Optional[str] = None,
create_new_cos: Optional[bool] = None,
create_time: Optional[str] = None,
enable: Optional[bool] = None,
keep_time: Optional[float] = None,
snapshot_policy_id: Optional[str] = None,
snapshot_policy_name: Optional[str] = None,
vpc_snapshot_policy_id: Optional[str] = None) -> VpcSnapshotPolicy
func GetVpcSnapshotPolicy(ctx *Context, name string, id IDInput, state *VpcSnapshotPolicyState, opts ...ResourceOption) (*VpcSnapshotPolicy, error)
public static VpcSnapshotPolicy Get(string name, Input<string> id, VpcSnapshotPolicyState? state, CustomResourceOptions? opts = null)
public static VpcSnapshotPolicy get(String name, Output<String> id, VpcSnapshotPolicyState state, CustomResourceOptions options)
resources: _: type: tencentcloud:VpcSnapshotPolicy 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
Policies List<VpcSnapshot Policy Backup Policy> - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- Backup
Type string - Backup strategy type,
operate
: operate backup,time
: schedule backup. - Cos
Bucket string - cos bucket.
- Cos
Region string - The region where the cos bucket is located.
- Create
New boolCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- Create
Time string - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- Enable bool
- Enabled state, True-enabled, False-disabled, the default is True.
- Keep
Time double - The retention time supports 1 to 365 days.
- Snapshot
Policy stringId - Snapshot policy Id.
- Snapshot
Policy stringName - Snapshot policy name.
- Vpc
Snapshot stringPolicy Id - ID of the resource.
- Backup
Policies []VpcSnapshot Policy Backup Policy Args - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- Backup
Type string - Backup strategy type,
operate
: operate backup,time
: schedule backup. - Cos
Bucket string - cos bucket.
- Cos
Region string - The region where the cos bucket is located.
- Create
New boolCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- Create
Time string - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- Enable bool
- Enabled state, True-enabled, False-disabled, the default is True.
- Keep
Time float64 - The retention time supports 1 to 365 days.
- Snapshot
Policy stringId - Snapshot policy Id.
- Snapshot
Policy stringName - Snapshot policy name.
- Vpc
Snapshot stringPolicy Id - ID of the resource.
- backup
Policies List<VpcSnapshot Policy Backup Policy> - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- backup
Type String - Backup strategy type,
operate
: operate backup,time
: schedule backup. - cos
Bucket String - cos bucket.
- cos
Region String - The region where the cos bucket is located.
- create
New BooleanCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- create
Time String - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- enable Boolean
- Enabled state, True-enabled, False-disabled, the default is True.
- keep
Time Double - The retention time supports 1 to 365 days.
- snapshot
Policy StringId - Snapshot policy Id.
- snapshot
Policy StringName - Snapshot policy name.
- vpc
Snapshot StringPolicy Id - ID of the resource.
- backup
Policies VpcSnapshot Policy Backup Policy[] - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- backup
Type string - Backup strategy type,
operate
: operate backup,time
: schedule backup. - cos
Bucket string - cos bucket.
- cos
Region string - The region where the cos bucket is located.
- create
New booleanCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- create
Time string - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- enable boolean
- Enabled state, True-enabled, False-disabled, the default is True.
- keep
Time number - The retention time supports 1 to 365 days.
- snapshot
Policy stringId - Snapshot policy Id.
- snapshot
Policy stringName - Snapshot policy name.
- vpc
Snapshot stringPolicy Id - ID of the resource.
- backup_
policies Sequence[VpcSnapshot Policy Backup Policy Args] - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- backup_
type str - Backup strategy type,
operate
: operate backup,time
: schedule backup. - cos_
bucket str - cos bucket.
- cos_
region str - The region where the cos bucket is located.
- create_
new_ boolcos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- create_
time str - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- enable bool
- Enabled state, True-enabled, False-disabled, the default is True.
- keep_
time float - The retention time supports 1 to 365 days.
- snapshot_
policy_ strid - Snapshot policy Id.
- snapshot_
policy_ strname - Snapshot policy name.
- vpc_
snapshot_ strpolicy_ id - ID of the resource.
- backup
Policies List<Property Map> - Time backup strategy. Note: This field may return null, indicating that no valid value can be obtained.
- backup
Type String - Backup strategy type,
operate
: operate backup,time
: schedule backup. - cos
Bucket String - cos bucket.
- cos
Region String - The region where the cos bucket is located.
- create
New BooleanCos - Whether to create a new cos bucket, the default is False.Note: This field may return null, indicating that no valid value can be obtained.
- create
Time String - Creation time.Note: This field may return null, indicating that no valid value can be obtained.
- enable Boolean
- Enabled state, True-enabled, False-disabled, the default is True.
- keep
Time Number - The retention time supports 1 to 365 days.
- snapshot
Policy StringId - Snapshot policy Id.
- snapshot
Policy StringName - Snapshot policy name.
- vpc
Snapshot StringPolicy Id - ID of the resource.
Supporting Types
VpcSnapshotPolicyBackupPolicy, VpcSnapshotPolicyBackupPolicyArgs
- Backup
Day string - Backup cycle time, the value can be monday, tuesday, wednesday, thursday, friday, saturday, sunday.
- Backup
Time string - Backup time point, format:HH:mm:ss.
- Backup
Day string - Backup cycle time, the value can be monday, tuesday, wednesday, thursday, friday, saturday, sunday.
- Backup
Time string - Backup time point, format:HH:mm:ss.
- backup
Day String - Backup cycle time, the value can be monday, tuesday, wednesday, thursday, friday, saturday, sunday.
- backup
Time String - Backup time point, format:HH:mm:ss.
- backup
Day string - Backup cycle time, the value can be monday, tuesday, wednesday, thursday, friday, saturday, sunday.
- backup
Time string - Backup time point, format:HH:mm:ss.
- backup_
day str - Backup cycle time, the value can be monday, tuesday, wednesday, thursday, friday, saturday, sunday.
- backup_
time str - Backup time point, format:HH:mm:ss.
- backup
Day String - Backup cycle time, the value can be monday, tuesday, wednesday, thursday, friday, saturday, sunday.
- backup
Time String - Backup time point, format:HH:mm:ss.
Import
vpc snapshot_policy can be imported using the id, e.g.
$ pulumi import tencentcloud:index/vpcSnapshotPolicy:VpcSnapshotPolicy snapshot_policy snapshot_policy_id
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.