1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ecs
  5. AutoSnapshotPolicy
Alibaba Cloud v3.74.0 published on Monday, Jan 27, 2025 by Pulumi

alicloud.ecs.AutoSnapshotPolicy

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.74.0 published on Monday, Jan 27, 2025 by Pulumi

    Provides a ECS Auto Snapshot Policy resource.

    For information about ECS Auto Snapshot Policy and how to use it, see What is Auto Snapshot Policy.

    NOTE: Available since v1.117.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.ecs.AutoSnapshotPolicy("example", {
        name: "terraform-example",
        repeatWeekdays: [
            "1",
            "2",
            "3",
        ],
        retentionDays: -1,
        timePoints: [
            "1",
            "22",
            "23",
        ],
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.ecs.AutoSnapshotPolicy("example",
        name="terraform-example",
        repeat_weekdays=[
            "1",
            "2",
            "3",
        ],
        retention_days=-1,
        time_points=[
            "1",
            "22",
            "23",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ecs.NewAutoSnapshotPolicy(ctx, "example", &ecs.AutoSnapshotPolicyArgs{
    			Name: pulumi.String("terraform-example"),
    			RepeatWeekdays: pulumi.StringArray{
    				pulumi.String("1"),
    				pulumi.String("2"),
    				pulumi.String("3"),
    			},
    			RetentionDays: pulumi.Int(-1),
    			TimePoints: pulumi.StringArray{
    				pulumi.String("1"),
    				pulumi.String("22"),
    				pulumi.String("23"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AliCloud.Ecs.AutoSnapshotPolicy("example", new()
        {
            Name = "terraform-example",
            RepeatWeekdays = new[]
            {
                "1",
                "2",
                "3",
            },
            RetentionDays = -1,
            TimePoints = new[]
            {
                "1",
                "22",
                "23",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.AutoSnapshotPolicy;
    import com.pulumi.alicloud.ecs.AutoSnapshotPolicyArgs;
    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 example = new AutoSnapshotPolicy("example", AutoSnapshotPolicyArgs.builder()
                .name("terraform-example")
                .repeatWeekdays(            
                    "1",
                    "2",
                    "3")
                .retentionDays(-1)
                .timePoints(            
                    "1",
                    "22",
                    "23")
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:ecs:AutoSnapshotPolicy
        properties:
          name: terraform-example
          repeatWeekdays:
            - '1'
            - '2'
            - '3'
          retentionDays: -1
          timePoints:
            - '1'
            - '22'
            - '23'
    

    Create AutoSnapshotPolicy Resource

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

    Constructor syntax

    new AutoSnapshotPolicy(name: string, args: AutoSnapshotPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def AutoSnapshotPolicy(resource_name: str,
                           args: AutoSnapshotPolicyArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def AutoSnapshotPolicy(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           repeat_weekdays: Optional[Sequence[str]] = None,
                           retention_days: Optional[int] = None,
                           time_points: Optional[Sequence[str]] = None,
                           auto_snapshot_policy_name: Optional[str] = None,
                           copied_snapshots_retention_days: Optional[int] = None,
                           copy_encryption_configuration: Optional[AutoSnapshotPolicyCopyEncryptionConfigurationArgs] = None,
                           enable_cross_region_copy: Optional[bool] = None,
                           name: Optional[str] = None,
                           resource_group_id: Optional[str] = None,
                           tags: Optional[Mapping[str, str]] = None,
                           target_copy_regions: Optional[Sequence[str]] = None)
    func NewAutoSnapshotPolicy(ctx *Context, name string, args AutoSnapshotPolicyArgs, opts ...ResourceOption) (*AutoSnapshotPolicy, error)
    public AutoSnapshotPolicy(string name, AutoSnapshotPolicyArgs args, CustomResourceOptions? opts = null)
    public AutoSnapshotPolicy(String name, AutoSnapshotPolicyArgs args)
    public AutoSnapshotPolicy(String name, AutoSnapshotPolicyArgs args, CustomResourceOptions options)
    
    type: alicloud:ecs:AutoSnapshotPolicy
    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 AutoSnapshotPolicyArgs
    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 AutoSnapshotPolicyArgs
    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 AutoSnapshotPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AutoSnapshotPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AutoSnapshotPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var autoSnapshotPolicyResource = new AliCloud.Ecs.AutoSnapshotPolicy("autoSnapshotPolicyResource", new()
    {
        RepeatWeekdays = new[]
        {
            "string",
        },
        RetentionDays = 0,
        TimePoints = new[]
        {
            "string",
        },
        AutoSnapshotPolicyName = "string",
        CopiedSnapshotsRetentionDays = 0,
        CopyEncryptionConfiguration = new AliCloud.Ecs.Inputs.AutoSnapshotPolicyCopyEncryptionConfigurationArgs
        {
            Encrypted = false,
            KmsKeyId = "string",
        },
        EnableCrossRegionCopy = false,
        ResourceGroupId = "string",
        Tags = 
        {
            { "string", "string" },
        },
        TargetCopyRegions = new[]
        {
            "string",
        },
    });
    
    example, err := ecs.NewAutoSnapshotPolicy(ctx, "autoSnapshotPolicyResource", &ecs.AutoSnapshotPolicyArgs{
    	RepeatWeekdays: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	RetentionDays: pulumi.Int(0),
    	TimePoints: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	AutoSnapshotPolicyName:       pulumi.String("string"),
    	CopiedSnapshotsRetentionDays: pulumi.Int(0),
    	CopyEncryptionConfiguration: &ecs.AutoSnapshotPolicyCopyEncryptionConfigurationArgs{
    		Encrypted: pulumi.Bool(false),
    		KmsKeyId:  pulumi.String("string"),
    	},
    	EnableCrossRegionCopy: pulumi.Bool(false),
    	ResourceGroupId:       pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	TargetCopyRegions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var autoSnapshotPolicyResource = new AutoSnapshotPolicy("autoSnapshotPolicyResource", AutoSnapshotPolicyArgs.builder()
        .repeatWeekdays("string")
        .retentionDays(0)
        .timePoints("string")
        .autoSnapshotPolicyName("string")
        .copiedSnapshotsRetentionDays(0)
        .copyEncryptionConfiguration(AutoSnapshotPolicyCopyEncryptionConfigurationArgs.builder()
            .encrypted(false)
            .kmsKeyId("string")
            .build())
        .enableCrossRegionCopy(false)
        .resourceGroupId("string")
        .tags(Map.of("string", "string"))
        .targetCopyRegions("string")
        .build());
    
    auto_snapshot_policy_resource = alicloud.ecs.AutoSnapshotPolicy("autoSnapshotPolicyResource",
        repeat_weekdays=["string"],
        retention_days=0,
        time_points=["string"],
        auto_snapshot_policy_name="string",
        copied_snapshots_retention_days=0,
        copy_encryption_configuration={
            "encrypted": False,
            "kms_key_id": "string",
        },
        enable_cross_region_copy=False,
        resource_group_id="string",
        tags={
            "string": "string",
        },
        target_copy_regions=["string"])
    
    const autoSnapshotPolicyResource = new alicloud.ecs.AutoSnapshotPolicy("autoSnapshotPolicyResource", {
        repeatWeekdays: ["string"],
        retentionDays: 0,
        timePoints: ["string"],
        autoSnapshotPolicyName: "string",
        copiedSnapshotsRetentionDays: 0,
        copyEncryptionConfiguration: {
            encrypted: false,
            kmsKeyId: "string",
        },
        enableCrossRegionCopy: false,
        resourceGroupId: "string",
        tags: {
            string: "string",
        },
        targetCopyRegions: ["string"],
    });
    
    type: alicloud:ecs:AutoSnapshotPolicy
    properties:
        autoSnapshotPolicyName: string
        copiedSnapshotsRetentionDays: 0
        copyEncryptionConfiguration:
            encrypted: false
            kmsKeyId: string
        enableCrossRegionCopy: false
        repeatWeekdays:
            - string
        resourceGroupId: string
        retentionDays: 0
        tags:
            string: string
        targetCopyRegions:
            - string
        timePoints:
            - string
    

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

    RepeatWeekdays List<string>
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    RetentionDays int
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    TimePoints List<string>

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    AutoSnapshotPolicyName string
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    CopiedSnapshotsRetentionDays int
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    CopyEncryptionConfiguration Pulumi.AliCloud.Ecs.Inputs.AutoSnapshotPolicyCopyEncryptionConfiguration
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    EnableCrossRegionCopy bool
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    Name string
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    ResourceGroupId string
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    TargetCopyRegions List<string>
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    RepeatWeekdays []string
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    RetentionDays int
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    TimePoints []string

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    AutoSnapshotPolicyName string
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    CopiedSnapshotsRetentionDays int
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    CopyEncryptionConfiguration AutoSnapshotPolicyCopyEncryptionConfigurationArgs
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    EnableCrossRegionCopy bool
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    Name string
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    ResourceGroupId string
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    TargetCopyRegions []string
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    repeatWeekdays List<String>
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    retentionDays Integer
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    timePoints List<String>

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoSnapshotPolicyName String
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    copiedSnapshotsRetentionDays Integer
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    copyEncryptionConfiguration AutoSnapshotPolicyCopyEncryptionConfiguration
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    enableCrossRegionCopy Boolean
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    name String
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    resourceGroupId String
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    targetCopyRegions List<String>
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    repeatWeekdays string[]
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    retentionDays number
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    timePoints string[]

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoSnapshotPolicyName string
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    copiedSnapshotsRetentionDays number
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    copyEncryptionConfiguration AutoSnapshotPolicyCopyEncryptionConfiguration
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    enableCrossRegionCopy boolean
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    name string
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    resourceGroupId string
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    targetCopyRegions string[]
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    repeat_weekdays Sequence[str]
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    retention_days int
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    time_points Sequence[str]

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    auto_snapshot_policy_name str
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    copied_snapshots_retention_days int
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    copy_encryption_configuration AutoSnapshotPolicyCopyEncryptionConfigurationArgs
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    enable_cross_region_copy bool
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    name str
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    resource_group_id str
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    target_copy_regions Sequence[str]
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    repeatWeekdays List<String>
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    retentionDays Number
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    timePoints List<String>

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoSnapshotPolicyName String
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    copiedSnapshotsRetentionDays Number
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    copyEncryptionConfiguration Property Map
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    enableCrossRegionCopy Boolean
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    name String
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    resourceGroupId String
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    tags Map<String>
    A mapping of tags to assign to the resource.
    targetCopyRegions List<String>
    The destination region to which to copy the snapshot. You can specify only a single destination region.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AutoSnapshotPolicy resource produces the following output properties:

    CreateTime string
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    Status string
    The status of the automatic snapshot policy.
    CreateTime string
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    RegionId string
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    Status string
    The status of the automatic snapshot policy.
    createTime String
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    status String
    The status of the automatic snapshot policy.
    createTime string
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    id string
    The provider-assigned unique ID for this managed resource.
    regionId string
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    status string
    The status of the automatic snapshot policy.
    create_time str
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    id str
    The provider-assigned unique ID for this managed resource.
    region_id str
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    status str
    The status of the automatic snapshot policy.
    createTime String
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    regionId String
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    status String
    The status of the automatic snapshot policy.

    Look up Existing AutoSnapshotPolicy Resource

    Get an existing AutoSnapshotPolicy 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?: AutoSnapshotPolicyState, opts?: CustomResourceOptions): AutoSnapshotPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auto_snapshot_policy_name: Optional[str] = None,
            copied_snapshots_retention_days: Optional[int] = None,
            copy_encryption_configuration: Optional[AutoSnapshotPolicyCopyEncryptionConfigurationArgs] = None,
            create_time: Optional[str] = None,
            enable_cross_region_copy: Optional[bool] = None,
            name: Optional[str] = None,
            region_id: Optional[str] = None,
            repeat_weekdays: Optional[Sequence[str]] = None,
            resource_group_id: Optional[str] = None,
            retention_days: Optional[int] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            target_copy_regions: Optional[Sequence[str]] = None,
            time_points: Optional[Sequence[str]] = None) -> AutoSnapshotPolicy
    func GetAutoSnapshotPolicy(ctx *Context, name string, id IDInput, state *AutoSnapshotPolicyState, opts ...ResourceOption) (*AutoSnapshotPolicy, error)
    public static AutoSnapshotPolicy Get(string name, Input<string> id, AutoSnapshotPolicyState? state, CustomResourceOptions? opts = null)
    public static AutoSnapshotPolicy get(String name, Output<String> id, AutoSnapshotPolicyState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:ecs:AutoSnapshotPolicy    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:
    AutoSnapshotPolicyName string
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    CopiedSnapshotsRetentionDays int
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    CopyEncryptionConfiguration Pulumi.AliCloud.Ecs.Inputs.AutoSnapshotPolicyCopyEncryptionConfiguration
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    CreateTime string
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    EnableCrossRegionCopy bool
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    Name string
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    RegionId string
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    RepeatWeekdays List<string>
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    ResourceGroupId string
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    RetentionDays int
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    Status string
    The status of the automatic snapshot policy.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    TargetCopyRegions List<string>
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    TimePoints List<string>

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    AutoSnapshotPolicyName string
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    CopiedSnapshotsRetentionDays int
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    CopyEncryptionConfiguration AutoSnapshotPolicyCopyEncryptionConfigurationArgs
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    CreateTime string
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    EnableCrossRegionCopy bool
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    Name string
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    RegionId string
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    RepeatWeekdays []string
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    ResourceGroupId string
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    RetentionDays int
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    Status string
    The status of the automatic snapshot policy.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    TargetCopyRegions []string
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    TimePoints []string

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoSnapshotPolicyName String
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    copiedSnapshotsRetentionDays Integer
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    copyEncryptionConfiguration AutoSnapshotPolicyCopyEncryptionConfiguration
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    createTime String
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    enableCrossRegionCopy Boolean
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    name String
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    regionId String
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    repeatWeekdays List<String>
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    resourceGroupId String
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    retentionDays Integer
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    status String
    The status of the automatic snapshot policy.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    targetCopyRegions List<String>
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    timePoints List<String>

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoSnapshotPolicyName string
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    copiedSnapshotsRetentionDays number
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    copyEncryptionConfiguration AutoSnapshotPolicyCopyEncryptionConfiguration
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    createTime string
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    enableCrossRegionCopy boolean
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    name string
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    regionId string
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    repeatWeekdays string[]
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    resourceGroupId string
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    retentionDays number
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    status string
    The status of the automatic snapshot policy.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    targetCopyRegions string[]
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    timePoints string[]

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    auto_snapshot_policy_name str
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    copied_snapshots_retention_days int
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    copy_encryption_configuration AutoSnapshotPolicyCopyEncryptionConfigurationArgs
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    create_time str
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    enable_cross_region_copy bool
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    name str
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    region_id str
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    repeat_weekdays Sequence[str]
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    resource_group_id str
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    retention_days int
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    status str
    The status of the automatic snapshot policy.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    target_copy_regions Sequence[str]
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    time_points Sequence[str]

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    autoSnapshotPolicyName String
    The name of the automatic snapshot policy. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    copiedSnapshotsRetentionDays Number
    The retention period of the snapshot copy in the destination region. Unit: days. Valid values:

    • -1: The snapshot copy is retained until it is deleted.
    copyEncryptionConfiguration Property Map
    The encryption parameters for cross-region snapshot replication. See copy_encryption_configuration below.
    createTime String
    (Available since v1.236.0) The time when the automatic snapshot policy was created. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format. The time is displayed in UTC.
    enableCrossRegionCopy Boolean
    Specifies whether to enable cross-region replication for snapshots. Valid values: true, false.
    name String
    . Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    Deprecated: Field name has been deprecated from provider version 1.236.0. New field auto_snapshot_policy_name instead.

    regionId String
    (Available since v1.236.0) The region ID of the automatic snapshot policy.
    repeatWeekdays List<String>
    The days of the week on which to create automatic snapshots. Valid values: 1 to 7, which correspond to the days of the week. For example, 1 indicates Monday. One or more days can be specified.
    resourceGroupId String
    The ID of the resource group. If this parameter is specified to query resources, up to 1,000 resources that belong to the specified resource group can be displayed in the response.
    retentionDays Number
    The retention period of the automatic snapshots. Unit: days. Valid values:

    • -1: Automatic snapshots are retained until they are deleted.
    status String
    The status of the automatic snapshot policy.
    tags Map<String>
    A mapping of tags to assign to the resource.
    targetCopyRegions List<String>
    The destination region to which to copy the snapshot. You can specify only a single destination region.
    timePoints List<String>

    The points in time of the day at which to create automatic snapshots.

    The time is displayed in UTC+8. Unit: hours. Valid values: 0 to 23, which correspond to the 24 points in time on the hour from 00:00:00 to 23:00:00. For example, 1 indicates 01:00:00. Multiple points in time can be specified.

    The parameter value is a JSON array that contains up to 24 points in time separated by commas (,). Example: ["0", "1", ... "23"].

    The following arguments will be discarded. Please use new fields as soon as possible:

    Supporting Types

    AutoSnapshotPolicyCopyEncryptionConfiguration, AutoSnapshotPolicyCopyEncryptionConfigurationArgs

    Encrypted bool
    Whether to enable encryption for cross-region snapshot replication. Default value: false. Valid values: true, false.
    KmsKeyId string
    The ID of the Key Management Service (KMS) key used to encrypt snapshots in cross-region snapshot replication.
    Encrypted bool
    Whether to enable encryption for cross-region snapshot replication. Default value: false. Valid values: true, false.
    KmsKeyId string
    The ID of the Key Management Service (KMS) key used to encrypt snapshots in cross-region snapshot replication.
    encrypted Boolean
    Whether to enable encryption for cross-region snapshot replication. Default value: false. Valid values: true, false.
    kmsKeyId String
    The ID of the Key Management Service (KMS) key used to encrypt snapshots in cross-region snapshot replication.
    encrypted boolean
    Whether to enable encryption for cross-region snapshot replication. Default value: false. Valid values: true, false.
    kmsKeyId string
    The ID of the Key Management Service (KMS) key used to encrypt snapshots in cross-region snapshot replication.
    encrypted bool
    Whether to enable encryption for cross-region snapshot replication. Default value: false. Valid values: true, false.
    kms_key_id str
    The ID of the Key Management Service (KMS) key used to encrypt snapshots in cross-region snapshot replication.
    encrypted Boolean
    Whether to enable encryption for cross-region snapshot replication. Default value: false. Valid values: true, false.
    kmsKeyId String
    The ID of the Key Management Service (KMS) key used to encrypt snapshots in cross-region snapshot replication.

    Import

    ECS Auto Snapshot Policy can be imported using the id, e.g.

    $ pulumi import alicloud:ecs/autoSnapshotPolicy:AutoSnapshotPolicy example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.74.0 published on Monday, Jan 27, 2025 by Pulumi