Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.nas.getLifecyclePolicies
Explore with Pulumi AI
This data source provides the Nas Lifecycle Policies of the current Alibaba Cloud user.
NOTE: Available in v1.153.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.nas.getLifecyclePolicies({
fileSystemId: "example_value",
ids: [
"my-LifecyclePolicy-1",
"my-LifecyclePolicy-2",
],
});
export const nasLifecyclePolicyId1 = ids.then(ids => ids.policies?.[0]?.id);
const nameRegex = alicloud.nas.getLifecyclePolicies({
fileSystemId: "example_value",
nameRegex: "^my-LifecyclePolicy",
});
export const nasLifecyclePolicyId2 = nameRegex.then(nameRegex => nameRegex.policies?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.nas.get_lifecycle_policies(file_system_id="example_value",
ids=[
"my-LifecyclePolicy-1",
"my-LifecyclePolicy-2",
])
pulumi.export("nasLifecyclePolicyId1", ids.policies[0].id)
name_regex = alicloud.nas.get_lifecycle_policies(file_system_id="example_value",
name_regex="^my-LifecyclePolicy")
pulumi.export("nasLifecyclePolicyId2", name_regex.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.GetLifecyclePolicies(ctx, &nas.GetLifecyclePoliciesArgs{
FileSystemId: "example_value",
Ids: []string{
"my-LifecyclePolicy-1",
"my-LifecyclePolicy-2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("nasLifecyclePolicyId1", ids.Policies[0].Id)
nameRegex, err := nas.GetLifecyclePolicies(ctx, &nas.GetLifecyclePoliciesArgs{
FileSystemId: "example_value",
NameRegex: pulumi.StringRef("^my-LifecyclePolicy"),
}, nil)
if err != nil {
return err
}
ctx.Export("nasLifecyclePolicyId2", nameRegex.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.GetLifecyclePolicies.Invoke(new()
{
FileSystemId = "example_value",
Ids = new[]
{
"my-LifecyclePolicy-1",
"my-LifecyclePolicy-2",
},
});
var nameRegex = AliCloud.Nas.GetLifecyclePolicies.Invoke(new()
{
FileSystemId = "example_value",
NameRegex = "^my-LifecyclePolicy",
});
return new Dictionary<string, object?>
{
["nasLifecyclePolicyId1"] = ids.Apply(getLifecyclePoliciesResult => getLifecyclePoliciesResult.Policies[0]?.Id),
["nasLifecyclePolicyId2"] = nameRegex.Apply(getLifecyclePoliciesResult => getLifecyclePoliciesResult.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.GetLifecyclePoliciesArgs;
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.getLifecyclePolicies(GetLifecyclePoliciesArgs.builder()
.fileSystemId("example_value")
.ids(
"my-LifecyclePolicy-1",
"my-LifecyclePolicy-2")
.build());
ctx.export("nasLifecyclePolicyId1", ids.applyValue(getLifecyclePoliciesResult -> getLifecyclePoliciesResult.policies()[0].id()));
final var nameRegex = NasFunctions.getLifecyclePolicies(GetLifecyclePoliciesArgs.builder()
.fileSystemId("example_value")
.nameRegex("^my-LifecyclePolicy")
.build());
ctx.export("nasLifecyclePolicyId2", nameRegex.applyValue(getLifecyclePoliciesResult -> getLifecyclePoliciesResult.policies()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:nas:getLifecyclePolicies
Arguments:
fileSystemId: example_value
ids:
- my-LifecyclePolicy-1
- my-LifecyclePolicy-2
nameRegex:
fn::invoke:
Function: alicloud:nas:getLifecyclePolicies
Arguments:
fileSystemId: example_value
nameRegex: ^my-LifecyclePolicy
outputs:
nasLifecyclePolicyId1: ${ids.policies[0].id}
nasLifecyclePolicyId2: ${nameRegex.policies[0].id}
Using getLifecyclePolicies
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 getLifecyclePolicies(args: GetLifecyclePoliciesArgs, opts?: InvokeOptions): Promise<GetLifecyclePoliciesResult>
function getLifecyclePoliciesOutput(args: GetLifecyclePoliciesOutputArgs, opts?: InvokeOptions): Output<GetLifecyclePoliciesResult>
def get_lifecycle_policies(file_system_id: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetLifecyclePoliciesResult
def get_lifecycle_policies_output(file_system_id: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetLifecyclePoliciesResult]
func GetLifecyclePolicies(ctx *Context, args *GetLifecyclePoliciesArgs, opts ...InvokeOption) (*GetLifecyclePoliciesResult, error)
func GetLifecyclePoliciesOutput(ctx *Context, args *GetLifecyclePoliciesOutputArgs, opts ...InvokeOption) GetLifecyclePoliciesResultOutput
> Note: This function is named GetLifecyclePolicies
in the Go SDK.
public static class GetLifecyclePolicies
{
public static Task<GetLifecyclePoliciesResult> InvokeAsync(GetLifecyclePoliciesArgs args, InvokeOptions? opts = null)
public static Output<GetLifecyclePoliciesResult> Invoke(GetLifecyclePoliciesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLifecyclePoliciesResult> getLifecyclePolicies(GetLifecyclePoliciesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:nas/getLifecyclePolicies:getLifecyclePolicies
arguments:
# arguments dictionary
The following arguments are supported:
- File
System stringId - The ID of the file system.
- Ids List<string>
- A list of Lifecycle Policy IDs.
- Name
Regex string - A regex string to filter results by Lifecycle Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- File
System stringId - The ID of the file system.
- Ids []string
- A list of Lifecycle Policy IDs.
- Name
Regex string - A regex string to filter results by Lifecycle Policy name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- file
System StringId - The ID of the file system.
- ids List<String>
- A list of Lifecycle Policy IDs.
- name
Regex String - A regex string to filter results by Lifecycle Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- file
System stringId - The ID of the file system.
- ids string[]
- A list of Lifecycle Policy IDs.
- name
Regex string - A regex string to filter results by Lifecycle Policy name.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- file_
system_ strid - The ID of the file system.
- ids Sequence[str]
- A list of Lifecycle Policy IDs.
- name_
regex str - A regex string to filter results by Lifecycle Policy name.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- file
System StringId - The ID of the file system.
- ids List<String>
- A list of Lifecycle Policy IDs.
- name
Regex String - A regex string to filter results by Lifecycle Policy name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getLifecyclePolicies Result
The following output properties are available:
- File
System stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Policies
List<Pulumi.
Ali Cloud. Nas. Outputs. Get Lifecycle Policies Policy> - Name
Regex string - Output
File string
- File
System stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Policies
[]Get
Lifecycle Policies Policy - Name
Regex string - Output
File string
- file
System StringId - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- policies
List<Get
Lifecycle Policies Policy> - name
Regex String - output
File String
- file
System stringId - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- policies
Get
Lifecycle Policies Policy[] - name
Regex string - output
File string
- file_
system_ strid - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- policies
Sequence[Get
Lifecycle Policies Policy] - name_
regex str - output_
file str
- file
System StringId - 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
Supporting Types
GetLifecyclePoliciesPolicy
- Create
Time string - The time when the lifecycle management policy was created.
- File
System stringId - The ID of the file system.
- Id string
- The ID of the Lifecycle Policy. Its value is same as Queue Name.
- Lifecycle
Policy stringName - The name of the lifecycle management policy.
- Lifecycle
Rule stringName - The rules in the lifecycle management policy.
- Paths List<string>
- The list of absolute paths for multiple directories. In this case, you can associate a lifecycle management policy with each directory.
- Storage
Type string - The storage type of the data that is dumped to the IA storage medium.
- Create
Time string - The time when the lifecycle management policy was created.
- File
System stringId - The ID of the file system.
- Id string
- The ID of the Lifecycle Policy. Its value is same as Queue Name.
- Lifecycle
Policy stringName - The name of the lifecycle management policy.
- Lifecycle
Rule stringName - The rules in the lifecycle management policy.
- Paths []string
- The list of absolute paths for multiple directories. In this case, you can associate a lifecycle management policy with each directory.
- Storage
Type string - The storage type of the data that is dumped to the IA storage medium.
- create
Time String - The time when the lifecycle management policy was created.
- file
System StringId - The ID of the file system.
- id String
- The ID of the Lifecycle Policy. Its value is same as Queue Name.
- lifecycle
Policy StringName - The name of the lifecycle management policy.
- lifecycle
Rule StringName - The rules in the lifecycle management policy.
- paths List<String>
- The list of absolute paths for multiple directories. In this case, you can associate a lifecycle management policy with each directory.
- storage
Type String - The storage type of the data that is dumped to the IA storage medium.
- create
Time string - The time when the lifecycle management policy was created.
- file
System stringId - The ID of the file system.
- id string
- The ID of the Lifecycle Policy. Its value is same as Queue Name.
- lifecycle
Policy stringName - The name of the lifecycle management policy.
- lifecycle
Rule stringName - The rules in the lifecycle management policy.
- paths string[]
- The list of absolute paths for multiple directories. In this case, you can associate a lifecycle management policy with each directory.
- storage
Type string - The storage type of the data that is dumped to the IA storage medium.
- create_
time str - The time when the lifecycle management policy was created.
- file_
system_ strid - The ID of the file system.
- id str
- The ID of the Lifecycle Policy. Its value is same as Queue Name.
- lifecycle_
policy_ strname - The name of the lifecycle management policy.
- lifecycle_
rule_ strname - The rules in the lifecycle management policy.
- paths Sequence[str]
- The list of absolute paths for multiple directories. In this case, you can associate a lifecycle management policy with each directory.
- storage_
type str - The storage type of the data that is dumped to the IA storage medium.
- create
Time String - The time when the lifecycle management policy was created.
- file
System StringId - The ID of the file system.
- id String
- The ID of the Lifecycle Policy. Its value is same as Queue Name.
- lifecycle
Policy StringName - The name of the lifecycle management policy.
- lifecycle
Rule StringName - The rules in the lifecycle management policy.
- paths List<String>
- The list of absolute paths for multiple directories. In this case, you can associate a lifecycle management policy with each directory.
- storage
Type String - The storage type of the data that is dumped to the IA storage medium.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.