Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi
alicloud.ecs.getAutoSnapshotPolicies
Explore with Pulumi AI
This data source provides the Ecs Auto Snapshot Policies of the current Alibaba Cloud user.
NOTE: Available in v1.117.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const example = alicloud.ecs.getAutoSnapshotPolicies({
ids: ["sp-bp14e66xxxxxxxx"],
nameRegex: "tf-testAcc",
});
export const firstEcsAutoSnapshotPolicyId = example.then(example => example.policies?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
example = alicloud.ecs.get_auto_snapshot_policies(ids=["sp-bp14e66xxxxxxxx"],
name_regex="tf-testAcc")
pulumi.export("firstEcsAutoSnapshotPolicyId", example.policies[0].id)
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 {
example, err := ecs.GetAutoSnapshotPolicies(ctx, &ecs.GetAutoSnapshotPoliciesArgs{
Ids: []string{
"sp-bp14e66xxxxxxxx",
},
NameRegex: pulumi.StringRef("tf-testAcc"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstEcsAutoSnapshotPolicyId", example.Policies[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var example = AliCloud.Ecs.GetAutoSnapshotPolicies.Invoke(new()
{
Ids = new[]
{
"sp-bp14e66xxxxxxxx",
},
NameRegex = "tf-testAcc",
});
return new Dictionary<string, object?>
{
["firstEcsAutoSnapshotPolicyId"] = example.Apply(getAutoSnapshotPoliciesResult => getAutoSnapshotPoliciesResult.Policies[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetAutoSnapshotPoliciesArgs;
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) {
final var example = EcsFunctions.getAutoSnapshotPolicies(GetAutoSnapshotPoliciesArgs.builder()
.ids("sp-bp14e66xxxxxxxx")
.nameRegex("tf-testAcc")
.build());
ctx.export("firstEcsAutoSnapshotPolicyId", example.applyValue(getAutoSnapshotPoliciesResult -> getAutoSnapshotPoliciesResult.policies()[0].id()));
}
}
variables:
example:
fn::invoke:
function: alicloud:ecs:getAutoSnapshotPolicies
arguments:
ids:
- sp-bp14e66xxxxxxxx
nameRegex: tf-testAcc
outputs:
firstEcsAutoSnapshotPolicyId: ${example.policies[0].id}
Using getAutoSnapshotPolicies
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getAutoSnapshotPolicies(args: GetAutoSnapshotPoliciesArgs, opts?: InvokeOptions): Promise<GetAutoSnapshotPoliciesResult>
function getAutoSnapshotPoliciesOutput(args: GetAutoSnapshotPoliciesOutputArgs, opts?: InvokeOptions): Output<GetAutoSnapshotPoliciesResult>
def get_auto_snapshot_policies(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
status: Optional[str] = None,
tags: Optional[Mapping[str, str]] = None,
opts: Optional[InvokeOptions] = None) -> GetAutoSnapshotPoliciesResult
def get_auto_snapshot_policies_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
status: Optional[pulumi.Input[str]] = None,
tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAutoSnapshotPoliciesResult]
func GetAutoSnapshotPolicies(ctx *Context, args *GetAutoSnapshotPoliciesArgs, opts ...InvokeOption) (*GetAutoSnapshotPoliciesResult, error)
func GetAutoSnapshotPoliciesOutput(ctx *Context, args *GetAutoSnapshotPoliciesOutputArgs, opts ...InvokeOption) GetAutoSnapshotPoliciesResultOutput
> Note: This function is named GetAutoSnapshotPolicies
in the Go SDK.
public static class GetAutoSnapshotPolicies
{
public static Task<GetAutoSnapshotPoliciesResult> InvokeAsync(GetAutoSnapshotPoliciesArgs args, InvokeOptions? opts = null)
public static Output<GetAutoSnapshotPoliciesResult> Invoke(GetAutoSnapshotPoliciesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAutoSnapshotPoliciesResult> getAutoSnapshotPolicies(GetAutoSnapshotPoliciesArgs args, InvokeOptions options)
public static Output<GetAutoSnapshotPoliciesResult> getAutoSnapshotPolicies(GetAutoSnapshotPoliciesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:ecs/getAutoSnapshotPolicies:getAutoSnapshotPolicies
arguments:
# arguments dictionary
The following arguments are supported:
- Ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policy IDs.
- Name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Auto Snapshot Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status
Changes to this property will trigger replacement.
- The status of Auto Snapshot Policy. Valid Values:
Expire
,Normal
. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policy IDs.
- Name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Auto Snapshot Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Status
Changes to this property will trigger replacement.
- The status of Auto Snapshot Policy. Valid Values:
Expire
,Normal
. - map[string]string
- A mapping of tags to assign to the resource.
- ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policy IDs.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Auto Snapshot Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status
Changes to this property will trigger replacement.
- The status of Auto Snapshot Policy. Valid Values:
Expire
,Normal
. - Map<String,String>
- A mapping of tags to assign to the resource.
- ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policy IDs.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Auto Snapshot Policy name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - status
Changes to this property will trigger replacement.
- The status of Auto Snapshot Policy. Valid Values:
Expire
,Normal
. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policy IDs.
- name_
regex Changes to this property will trigger replacement.
- A regex string to filter results by Auto Snapshot Policy name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - status
Changes to this property will trigger replacement.
- The status of Auto Snapshot Policy. Valid Values:
Expire
,Normal
. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policy IDs.
- name
Regex Changes to this property will trigger replacement.
- A regex string to filter results by Auto Snapshot Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - status
Changes to this property will trigger replacement.
- The status of Auto Snapshot Policy. Valid Values:
Expire
,Normal
. - Map<String>
- A mapping of tags to assign to the resource.
getAutoSnapshotPolicies Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Policies
List<Pulumi.
Ali Cloud. Ecs. Outputs. Get Auto Snapshot Policies Policy> - Name
Regex string - Output
File string - Status string
- Dictionary<string, string>
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Policies
[]Get
Auto Snapshot Policies Policy - Name
Regex string - Output
File string - Status string
- map[string]string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies
List<Get
Auto Snapshot Policies Policy> - name
Regex String - output
File String - status String
- Map<String,String>
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- policies
Get
Auto Snapshot Policies Policy[] - name
Regex string - output
File string - status string
- {[key: string]: string}
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- policies
Sequence[Get
Auto Snapshot Policies Policy] - name_
regex str - output_
file str - status str
- Mapping[str, str]
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies List<Property Map>
- name
Regex String - output
File String - status String
- Map<String>
Supporting Types
GetAutoSnapshotPoliciesPolicy
- Auto
Snapshot Policy Id This property is required. string - The ID of the Auto Snapshot Policy.
- Copied
Snapshots Retention Days This property is required. int - The retention period of the snapshot copied across regions.
- Disk
Nums This property is required. int - The number of disks to which the automatic snapshot policy is applied.
- Enable
Cross Region Copy This property is required. bool - Specifies whether to enable the system to automatically copy snapshots across regions.
- Id
This property is required. string - The ID of the Auto Snapshot Policy.
- Name
This property is required. string - The snapshot policy name..
- Repeat
Weekdays This property is required. List<string> - The automatic snapshot repetition dates.
- Retention
Days This property is required. int - The snapshot retention time, and the unit of measurement is day.
- Status
This property is required. string - The status of Auto Snapshot Policy.
This property is required. Dictionary<string, string>- A mapping of tags to assign to the resource.
- Target
Copy Regions This property is required. List<string> - The destination region to which the snapshot is copied.
- Time
Points This property is required. List<string> - The automatic snapshot creation schedule, and the unit of measurement is hour.
This property is required. int- The number of extended volumes on which this policy is enabled.
- Auto
Snapshot Policy Id This property is required. string - The ID of the Auto Snapshot Policy.
- Copied
Snapshots Retention Days This property is required. int - The retention period of the snapshot copied across regions.
- Disk
Nums This property is required. int - The number of disks to which the automatic snapshot policy is applied.
- Enable
Cross Region Copy This property is required. bool - Specifies whether to enable the system to automatically copy snapshots across regions.
- Id
This property is required. string - The ID of the Auto Snapshot Policy.
- Name
This property is required. string - The snapshot policy name..
- Repeat
Weekdays This property is required. []string - The automatic snapshot repetition dates.
- Retention
Days This property is required. int - The snapshot retention time, and the unit of measurement is day.
- Status
This property is required. string - The status of Auto Snapshot Policy.
This property is required. map[string]string- A mapping of tags to assign to the resource.
- Target
Copy Regions This property is required. []string - The destination region to which the snapshot is copied.
- Time
Points This property is required. []string - The automatic snapshot creation schedule, and the unit of measurement is hour.
This property is required. int- The number of extended volumes on which this policy is enabled.
- auto
Snapshot Policy Id This property is required. String - The ID of the Auto Snapshot Policy.
- copied
Snapshots Retention Days This property is required. Integer - The retention period of the snapshot copied across regions.
- disk
Nums This property is required. Integer - The number of disks to which the automatic snapshot policy is applied.
- enable
Cross Region Copy This property is required. Boolean - Specifies whether to enable the system to automatically copy snapshots across regions.
- id
This property is required. String - The ID of the Auto Snapshot Policy.
- name
This property is required. String - The snapshot policy name..
- repeat
Weekdays This property is required. List<String> - The automatic snapshot repetition dates.
- retention
Days This property is required. Integer - The snapshot retention time, and the unit of measurement is day.
- status
This property is required. String - The status of Auto Snapshot Policy.
This property is required. Map<String,String>- A mapping of tags to assign to the resource.
- target
Copy Regions This property is required. List<String> - The destination region to which the snapshot is copied.
- time
Points This property is required. List<String> - The automatic snapshot creation schedule, and the unit of measurement is hour.
This property is required. Integer- The number of extended volumes on which this policy is enabled.
- auto
Snapshot Policy Id This property is required. string - The ID of the Auto Snapshot Policy.
- copied
Snapshots Retention Days This property is required. number - The retention period of the snapshot copied across regions.
- disk
Nums This property is required. number - The number of disks to which the automatic snapshot policy is applied.
- enable
Cross Region Copy This property is required. boolean - Specifies whether to enable the system to automatically copy snapshots across regions.
- id
This property is required. string - The ID of the Auto Snapshot Policy.
- name
This property is required. string - The snapshot policy name..
- repeat
Weekdays This property is required. string[] - The automatic snapshot repetition dates.
- retention
Days This property is required. number - The snapshot retention time, and the unit of measurement is day.
- status
This property is required. string - The status of Auto Snapshot Policy.
This property is required. {[key: string]: string}- A mapping of tags to assign to the resource.
- target
Copy Regions This property is required. string[] - The destination region to which the snapshot is copied.
- time
Points This property is required. string[] - The automatic snapshot creation schedule, and the unit of measurement is hour.
This property is required. number- The number of extended volumes on which this policy is enabled.
- auto_
snapshot_ policy_ id This property is required. str - The ID of the Auto Snapshot Policy.
- copied_
snapshots_ retention_ days This property is required. int - The retention period of the snapshot copied across regions.
- disk_
nums This property is required. int - The number of disks to which the automatic snapshot policy is applied.
- enable_
cross_ region_ copy This property is required. bool - Specifies whether to enable the system to automatically copy snapshots across regions.
- id
This property is required. str - The ID of the Auto Snapshot Policy.
- name
This property is required. str - The snapshot policy name..
- repeat_
weekdays This property is required. Sequence[str] - The automatic snapshot repetition dates.
- retention_
days This property is required. int - The snapshot retention time, and the unit of measurement is day.
- status
This property is required. str - The status of Auto Snapshot Policy.
This property is required. Mapping[str, str]- A mapping of tags to assign to the resource.
- target_
copy_ regions This property is required. Sequence[str] - The destination region to which the snapshot is copied.
- time_
points This property is required. Sequence[str] - The automatic snapshot creation schedule, and the unit of measurement is hour.
- volume_
nums This property is required. int - The number of extended volumes on which this policy is enabled.
- auto
Snapshot Policy Id This property is required. String - The ID of the Auto Snapshot Policy.
- copied
Snapshots Retention Days This property is required. Number - The retention period of the snapshot copied across regions.
- disk
Nums This property is required. Number - The number of disks to which the automatic snapshot policy is applied.
- enable
Cross Region Copy This property is required. Boolean - Specifies whether to enable the system to automatically copy snapshots across regions.
- id
This property is required. String - The ID of the Auto Snapshot Policy.
- name
This property is required. String - The snapshot policy name..
- repeat
Weekdays This property is required. List<String> - The automatic snapshot repetition dates.
- retention
Days This property is required. Number - The snapshot retention time, and the unit of measurement is day.
- status
This property is required. String - The status of Auto Snapshot Policy.
This property is required. Map<String>- A mapping of tags to assign to the resource.
- target
Copy Regions This property is required. List<String> - The destination region to which the snapshot is copied.
- time
Points This property is required. List<String> - The automatic snapshot creation schedule, and the unit of measurement is hour.
This property is required. Number- The number of extended volumes on which this policy is enabled.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.