Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.27.0 published on Monday, Aug 8, 2022 by Pulumi

getLifecyclePolicies

This data source provides the Nas Lifecycle Policies of the current Alibaba Cloud user.

NOTE: Available in v1.153.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.Nas.GetLifecyclePolicies.InvokeAsync(new AliCloud.Nas.GetLifecyclePoliciesArgs
        {
            FileSystemId = "example_value",
            Ids = 
            {
                "my-LifecyclePolicy-1",
                "my-LifecyclePolicy-2",
            },
        }));
        this.NasLifecyclePolicyId1 = ids.Apply(ids => ids.Policies?[0]?.Id);
        var nameRegex = Output.Create(AliCloud.Nas.GetLifecyclePolicies.InvokeAsync(new AliCloud.Nas.GetLifecyclePoliciesArgs
        {
            FileSystemId = "example_value",
            NameRegex = "^my-LifecyclePolicy",
        }));
        this.NasLifecyclePolicyId2 = nameRegex.Apply(nameRegex => nameRegex.Policies?[0]?.Id);
    }

    [Output("nasLifecyclePolicyId1")]
    public Output<string> NasLifecyclePolicyId1 { get; set; }
    [Output("nasLifecyclePolicyId2")]
    public Output<string> NasLifecyclePolicyId2 { get; set; }
}
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
	})
}
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()));
    }
}
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)
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);
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:

FileSystemId string

The ID of the file system.

Ids List<string>

A list of Lifecycle Policy IDs.

NameRegex string

A regex string to filter results by Lifecycle Policy name.

OutputFile string
FileSystemId string

The ID of the file system.

Ids []string

A list of Lifecycle Policy IDs.

NameRegex string

A regex string to filter results by Lifecycle Policy name.

OutputFile string
fileSystemId String

The ID of the file system.

ids List<String>

A list of Lifecycle Policy IDs.

nameRegex String

A regex string to filter results by Lifecycle Policy name.

outputFile String
fileSystemId string

The ID of the file system.

ids string[]

A list of Lifecycle Policy IDs.

nameRegex string

A regex string to filter results by Lifecycle Policy name.

outputFile string
file_system_id str

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
fileSystemId String

The ID of the file system.

ids List<String>

A list of Lifecycle Policy IDs.

nameRegex String

A regex string to filter results by Lifecycle Policy name.

outputFile String

getLifecyclePolicies Result

The following output properties are available:

FileSystemId string
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Names List<string>
Policies List<Pulumi.AliCloud.Nas.Outputs.GetLifecyclePoliciesPolicy>
NameRegex string
OutputFile string
FileSystemId string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
Policies []GetLifecyclePoliciesPolicy
NameRegex string
OutputFile string
fileSystemId String
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
policies List<GetLifecyclePoliciesPolicy>
nameRegex String
outputFile String
fileSystemId string
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
policies GetLifecyclePoliciesPolicy[]
nameRegex string
outputFile string
file_system_id str
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
names Sequence[str]
policies Sequence[GetLifecyclePoliciesPolicy]
name_regex str
output_file str
fileSystemId String
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
names List<String>
policies List<Property Map>
nameRegex String
outputFile String

Supporting Types

GetLifecyclePoliciesPolicy

CreateTime string

The time when the lifecycle management policy was created.

FileSystemId string

The ID of the file system.

Id string

The ID of the Lifecycle Policy. Its value is same as Queue Name.

LifecyclePolicyName string

The name of the lifecycle management policy.

LifecycleRuleName string

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.

StorageType string

The storage type of the data that is dumped to the IA storage medium.

CreateTime string

The time when the lifecycle management policy was created.

FileSystemId string

The ID of the file system.

Id string

The ID of the Lifecycle Policy. Its value is same as Queue Name.

LifecyclePolicyName string

The name of the lifecycle management policy.

LifecycleRuleName string

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.

StorageType string

The storage type of the data that is dumped to the IA storage medium.

createTime String

The time when the lifecycle management policy was created.

fileSystemId String

The ID of the file system.

id String

The ID of the Lifecycle Policy. Its value is same as Queue Name.

lifecyclePolicyName String

The name of the lifecycle management policy.

lifecycleRuleName String

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.

storageType String

The storage type of the data that is dumped to the IA storage medium.

createTime string

The time when the lifecycle management policy was created.

fileSystemId string

The ID of the file system.

id string

The ID of the Lifecycle Policy. Its value is same as Queue Name.

lifecyclePolicyName string

The name of the lifecycle management policy.

lifecycleRuleName string

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.

storageType 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_id str

The ID of the file system.

id str

The ID of the Lifecycle Policy. Its value is same as Queue Name.

lifecycle_policy_name str

The name of the lifecycle management policy.

lifecycle_rule_name str

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.

createTime String

The time when the lifecycle management policy was created.

fileSystemId String

The ID of the file system.

id String

The ID of the Lifecycle Policy. Its value is same as Queue Name.

lifecyclePolicyName String

The name of the lifecycle management policy.

lifecycleRuleName String

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.

storageType String

The storage type of the data that is dumped to the IA storage medium.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.