Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi
alicloud.nas.getAutoSnapshotPolicies
Explore with Pulumi AI
This data source provides Auto Snapshot Policies available to the user.
NOTE: Available in v1.153.0+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.nas.getAutoSnapshotPolicies({
ids: ["example_value"],
});
export const nasAutoSnapshotPoliciesId1 = ids.then(ids => ids.policies?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.nas.get_auto_snapshot_policies(ids=["example_value"])
pulumi.export("nasAutoSnapshotPoliciesId1", ids.policies[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/nas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := nas.GetAutoSnapshotPolicies(ctx, &nas.GetAutoSnapshotPoliciesArgs{
Ids: []string{
"example_value",
},
}, nil)
if err != nil {
return err
}
ctx.Export("nasAutoSnapshotPoliciesId1", ids.Policies[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Nas.GetAutoSnapshotPolicies.Invoke(new()
{
Ids = new[]
{
"example_value",
},
});
return new Dictionary<string, object?>
{
["nasAutoSnapshotPoliciesId1"] = ids.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.nas.NasFunctions;
import com.pulumi.alicloud.nas.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 ids = NasFunctions.getAutoSnapshotPolicies(GetAutoSnapshotPoliciesArgs.builder()
.ids("example_value")
.build());
ctx.export("nasAutoSnapshotPoliciesId1", ids.applyValue(getAutoSnapshotPoliciesResult -> getAutoSnapshotPoliciesResult.policies()[0].id()));
}
}
variables:
ids:
fn::invoke:
function: alicloud:nas:getAutoSnapshotPolicies
arguments:
ids:
- example_value
outputs:
nasAutoSnapshotPoliciesId1: ${ids.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,
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,
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:nas/getAutoSnapshotPolicies:getAutoSnapshotPolicies
arguments:
# arguments dictionary
The following arguments are supported:
- Ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policies 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 the automatic snapshot policy. Valid values:
Creating
,Available
.
- Ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policies 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 the automatic snapshot policy. Valid values:
Creating
,Available
.
- ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policies 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 the automatic snapshot policy. Valid values:
Creating
,Available
.
- ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policies 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 the automatic snapshot policy. Valid values:
Creating
,Available
.
- ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policies 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 the automatic snapshot policy. Valid values:
Creating
,Available
.
- ids
Changes to this property will trigger replacement.
- A list of Auto Snapshot Policies 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 the automatic snapshot policy. Valid values:
Creating
,Available
.
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>
- A list of Auto Snapshot Policy names.
- Policies
List<Pulumi.
Ali Cloud. Nas. Outputs. Get Auto Snapshot Policies Policy> - A list of Auto Snapshot Policies. Each element contains the following attributes:
- Name
Regex string - Output
File string - Status string
- The status of the automatic snapshot policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- A list of Auto Snapshot Policy names.
- Policies
[]Get
Auto Snapshot Policies Policy - A list of Auto Snapshot Policies. Each element contains the following attributes:
- Name
Regex string - Output
File string - Status string
- The status of the automatic snapshot policy.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Auto Snapshot Policy names.
- policies
List<Get
Auto Snapshot Policies Policy> - A list of Auto Snapshot Policies. Each element contains the following attributes:
- name
Regex String - output
File String - status String
- The status of the automatic snapshot policy.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- A list of Auto Snapshot Policy names.
- policies
Get
Auto Snapshot Policies Policy[] - A list of Auto Snapshot Policies. Each element contains the following attributes:
- name
Regex string - output
File string - status string
- The status of the automatic snapshot policy.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- A list of Auto Snapshot Policy names.
- policies
Sequence[Get
Auto Snapshot Policies Policy] - A list of Auto Snapshot Policies. Each element contains the following attributes:
- name_
regex str - output_
file str - status str
- The status of the automatic snapshot policy.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Auto Snapshot Policy names.
- policies List<Property Map>
- A list of Auto Snapshot Policies. Each element contains the following attributes:
- name
Regex String - output
File String - status String
- The status of the automatic snapshot policy.
Supporting Types
GetAutoSnapshotPoliciesPolicy
- Auto
Snapshot Policy Id This property is required. string - The ID of the automatic snapshot policy.
- Auto
Snapshot Policy Name This property is required. string - The name of the automatic snapshot policy.
- Create
Time This property is required. string - The time when the automatic snapshot policy was created.
- File
System Nums This property is required. int - The number of file systems to which the automatic snapshot policy applies.
- Id
This property is required. string - ID of the Auto Snapshot Policy.
- Repeat
Weekdays This property is required. List<string> - The day on which an auto snapshot was created.
- Retention
Days This property is required. int - The number of days for which you want to retain auto snapshots.
- Status
This property is required. string - The status of the automatic snapshot policy. Valid values:
Creating
,Available
. - Time
Points This property is required. List<string> - The point in time at which an auto snapshot was created. Unit: hours.
- Auto
Snapshot Policy Id This property is required. string - The ID of the automatic snapshot policy.
- Auto
Snapshot Policy Name This property is required. string - The name of the automatic snapshot policy.
- Create
Time This property is required. string - The time when the automatic snapshot policy was created.
- File
System Nums This property is required. int - The number of file systems to which the automatic snapshot policy applies.
- Id
This property is required. string - ID of the Auto Snapshot Policy.
- Repeat
Weekdays This property is required. []string - The day on which an auto snapshot was created.
- Retention
Days This property is required. int - The number of days for which you want to retain auto snapshots.
- Status
This property is required. string - The status of the automatic snapshot policy. Valid values:
Creating
,Available
. - Time
Points This property is required. []string - The point in time at which an auto snapshot was created. Unit: hours.
- auto
Snapshot Policy Id This property is required. String - The ID of the automatic snapshot policy.
- auto
Snapshot Policy Name This property is required. String - The name of the automatic snapshot policy.
- create
Time This property is required. String - The time when the automatic snapshot policy was created.
- file
System Nums This property is required. Integer - The number of file systems to which the automatic snapshot policy applies.
- id
This property is required. String - ID of the Auto Snapshot Policy.
- repeat
Weekdays This property is required. List<String> - The day on which an auto snapshot was created.
- retention
Days This property is required. Integer - The number of days for which you want to retain auto snapshots.
- status
This property is required. String - The status of the automatic snapshot policy. Valid values:
Creating
,Available
. - time
Points This property is required. List<String> - The point in time at which an auto snapshot was created. Unit: hours.
- auto
Snapshot Policy Id This property is required. string - The ID of the automatic snapshot policy.
- auto
Snapshot Policy Name This property is required. string - The name of the automatic snapshot policy.
- create
Time This property is required. string - The time when the automatic snapshot policy was created.
- file
System Nums This property is required. number - The number of file systems to which the automatic snapshot policy applies.
- id
This property is required. string - ID of the Auto Snapshot Policy.
- repeat
Weekdays This property is required. string[] - The day on which an auto snapshot was created.
- retention
Days This property is required. number - The number of days for which you want to retain auto snapshots.
- status
This property is required. string - The status of the automatic snapshot policy. Valid values:
Creating
,Available
. - time
Points This property is required. string[] - The point in time at which an auto snapshot was created. Unit: hours.
- auto_
snapshot_ policy_ id This property is required. str - The ID of the automatic snapshot policy.
- auto_
snapshot_ policy_ name This property is required. str - The name of the automatic snapshot policy.
- create_
time This property is required. str - The time when the automatic snapshot policy was created.
- file_
system_ nums This property is required. int - The number of file systems to which the automatic snapshot policy applies.
- id
This property is required. str - ID of the Auto Snapshot Policy.
- repeat_
weekdays This property is required. Sequence[str] - The day on which an auto snapshot was created.
- retention_
days This property is required. int - The number of days for which you want to retain auto snapshots.
- status
This property is required. str - The status of the automatic snapshot policy. Valid values:
Creating
,Available
. - time_
points This property is required. Sequence[str] - The point in time at which an auto snapshot was created. Unit: hours.
- auto
Snapshot Policy Id This property is required. String - The ID of the automatic snapshot policy.
- auto
Snapshot Policy Name This property is required. String - The name of the automatic snapshot policy.
- create
Time This property is required. String - The time when the automatic snapshot policy was created.
- file
System Nums This property is required. Number - The number of file systems to which the automatic snapshot policy applies.
- id
This property is required. String - ID of the Auto Snapshot Policy.
- repeat
Weekdays This property is required. List<String> - The day on which an auto snapshot was created.
- retention
Days This property is required. Number - The number of days for which you want to retain auto snapshots.
- status
This property is required. String - The status of the automatic snapshot policy. Valid values:
Creating
,Available
. - time
Points This property is required. List<String> - The point in time at which an auto snapshot was created. Unit: hours.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.