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

tencentcloud.VpcSnapshotPolicyConfig

Explore with Pulumi AI

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

    Provides a resource to create a vpc snapshot_policy_config

    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",
            },
        ],
    });
    const config = new tencentcloud.VpcSnapshotPolicyConfig("config", {
        snapshotPolicyId: exampleVpcSnapshotPolicy.vpcSnapshotPolicyId,
        enable: false,
    });
    
    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",
            },
        ])
    config = tencentcloud.VpcSnapshotPolicyConfig("config",
        snapshot_policy_id=example_vpc_snapshot_policy.vpc_snapshot_policy_id,
        enable=False)
    
    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
    		}
    		exampleVpcSnapshotPolicy, 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
    		}
    		_, err = tencentcloud.NewVpcSnapshotPolicyConfig(ctx, "config", &tencentcloud.VpcSnapshotPolicyConfigArgs{
    			SnapshotPolicyId: exampleVpcSnapshotPolicy.VpcSnapshotPolicyId,
    			Enable:           pulumi.Bool(false),
    		})
    		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",
                },
            },
        });
    
        var config = new Tencentcloud.VpcSnapshotPolicyConfig("config", new()
        {
            SnapshotPolicyId = exampleVpcSnapshotPolicy.VpcSnapshotPolicyId,
            Enable = false,
        });
    
    });
    
    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 com.pulumi.tencentcloud.VpcSnapshotPolicyConfig;
    import com.pulumi.tencentcloud.VpcSnapshotPolicyConfigArgs;
    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());
    
            var config = new VpcSnapshotPolicyConfig("config", VpcSnapshotPolicyConfigArgs.builder()
                .snapshotPolicyId(exampleVpcSnapshotPolicy.vpcSnapshotPolicyId())
                .enable(false)
                .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
      config:
        type: tencentcloud:VpcSnapshotPolicyConfig
        properties:
          snapshotPolicyId: ${exampleVpcSnapshotPolicy.vpcSnapshotPolicyId}
          enable: false
    

    Create VpcSnapshotPolicyConfig Resource

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

    Constructor syntax

    new VpcSnapshotPolicyConfig(name: string, args: VpcSnapshotPolicyConfigArgs, opts?: CustomResourceOptions);
    @overload
    def VpcSnapshotPolicyConfig(resource_name: str,
                                args: VpcSnapshotPolicyConfigArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcSnapshotPolicyConfig(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                enable: Optional[bool] = None,
                                snapshot_policy_id: Optional[str] = None,
                                vpc_snapshot_policy_config_id: Optional[str] = None)
    func NewVpcSnapshotPolicyConfig(ctx *Context, name string, args VpcSnapshotPolicyConfigArgs, opts ...ResourceOption) (*VpcSnapshotPolicyConfig, error)
    public VpcSnapshotPolicyConfig(string name, VpcSnapshotPolicyConfigArgs args, CustomResourceOptions? opts = null)
    public VpcSnapshotPolicyConfig(String name, VpcSnapshotPolicyConfigArgs args)
    public VpcSnapshotPolicyConfig(String name, VpcSnapshotPolicyConfigArgs args, CustomResourceOptions options)
    
    type: tencentcloud:VpcSnapshotPolicyConfig
    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 VpcSnapshotPolicyConfigArgs
    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 VpcSnapshotPolicyConfigArgs
    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 VpcSnapshotPolicyConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcSnapshotPolicyConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcSnapshotPolicyConfigArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Enable bool
    If enable snapshot policy.
    SnapshotPolicyId string
    Snapshot policy Id.
    VpcSnapshotPolicyConfigId string
    ID of the resource.
    Enable bool
    If enable snapshot policy.
    SnapshotPolicyId string
    Snapshot policy Id.
    VpcSnapshotPolicyConfigId string
    ID of the resource.
    enable Boolean
    If enable snapshot policy.
    snapshotPolicyId String
    Snapshot policy Id.
    vpcSnapshotPolicyConfigId String
    ID of the resource.
    enable boolean
    If enable snapshot policy.
    snapshotPolicyId string
    Snapshot policy Id.
    vpcSnapshotPolicyConfigId string
    ID of the resource.
    enable bool
    If enable snapshot policy.
    snapshot_policy_id str
    Snapshot policy Id.
    vpc_snapshot_policy_config_id str
    ID of the resource.
    enable Boolean
    If enable snapshot policy.
    snapshotPolicyId String
    Snapshot policy Id.
    vpcSnapshotPolicyConfigId String
    ID of the resource.

    Outputs

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

    Get an existing VpcSnapshotPolicyConfig 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?: VpcSnapshotPolicyConfigState, opts?: CustomResourceOptions): VpcSnapshotPolicyConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enable: Optional[bool] = None,
            snapshot_policy_id: Optional[str] = None,
            vpc_snapshot_policy_config_id: Optional[str] = None) -> VpcSnapshotPolicyConfig
    func GetVpcSnapshotPolicyConfig(ctx *Context, name string, id IDInput, state *VpcSnapshotPolicyConfigState, opts ...ResourceOption) (*VpcSnapshotPolicyConfig, error)
    public static VpcSnapshotPolicyConfig Get(string name, Input<string> id, VpcSnapshotPolicyConfigState? state, CustomResourceOptions? opts = null)
    public static VpcSnapshotPolicyConfig get(String name, Output<String> id, VpcSnapshotPolicyConfigState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:VpcSnapshotPolicyConfig    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:
    Enable bool
    If enable snapshot policy.
    SnapshotPolicyId string
    Snapshot policy Id.
    VpcSnapshotPolicyConfigId string
    ID of the resource.
    Enable bool
    If enable snapshot policy.
    SnapshotPolicyId string
    Snapshot policy Id.
    VpcSnapshotPolicyConfigId string
    ID of the resource.
    enable Boolean
    If enable snapshot policy.
    snapshotPolicyId String
    Snapshot policy Id.
    vpcSnapshotPolicyConfigId String
    ID of the resource.
    enable boolean
    If enable snapshot policy.
    snapshotPolicyId string
    Snapshot policy Id.
    vpcSnapshotPolicyConfigId string
    ID of the resource.
    enable bool
    If enable snapshot policy.
    snapshot_policy_id str
    Snapshot policy Id.
    vpc_snapshot_policy_config_id str
    ID of the resource.
    enable Boolean
    If enable snapshot policy.
    snapshotPolicyId String
    Snapshot policy Id.
    vpcSnapshotPolicyConfigId String
    ID of the resource.

    Import

    vpc snapshot_policy_config can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/vpcSnapshotPolicyConfig:VpcSnapshotPolicyConfig snapshot_policy_config 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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack