AWS v6.73.0 published on Wednesday, Mar 19, 2025 by Pulumi
aws.opensearch.getServerlessLifecyclePolicy
Explore with Pulumi AI
Data source for managing an AWS OpenSearch Serverless Lifecycle Policy.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = aws.opensearch.getServerlessLifecyclePolicy({
    name: "example-lifecycle-policy",
    type: "retention",
});
import pulumi
import pulumi_aws as aws
example = aws.opensearch.get_serverless_lifecycle_policy(name="example-lifecycle-policy",
    type="retention")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := opensearch.LookupServerlessLifecyclePolicy(ctx, &opensearch.LookupServerlessLifecyclePolicyArgs{
			Name: "example-lifecycle-policy",
			Type: "retention",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = Aws.OpenSearch.GetServerlessLifecyclePolicy.Invoke(new()
    {
        Name = "example-lifecycle-policy",
        Type = "retention",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.opensearch.OpensearchFunctions;
import com.pulumi.aws.opensearch.inputs.GetServerlessLifecyclePolicyArgs;
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 = OpensearchFunctions.getServerlessLifecyclePolicy(GetServerlessLifecyclePolicyArgs.builder()
            .name("example-lifecycle-policy")
            .type("retention")
            .build());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:opensearch:getServerlessLifecyclePolicy
      arguments:
        name: example-lifecycle-policy
        type: retention
Using getServerlessLifecyclePolicy
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 getServerlessLifecyclePolicy(args: GetServerlessLifecyclePolicyArgs, opts?: InvokeOptions): Promise<GetServerlessLifecyclePolicyResult>
function getServerlessLifecyclePolicyOutput(args: GetServerlessLifecyclePolicyOutputArgs, opts?: InvokeOptions): Output<GetServerlessLifecyclePolicyResult>def get_serverless_lifecycle_policy(name: Optional[str] = None,
                                    type: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetServerlessLifecyclePolicyResult
def get_serverless_lifecycle_policy_output(name: Optional[pulumi.Input[str]] = None,
                                    type: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetServerlessLifecyclePolicyResult]func LookupServerlessLifecyclePolicy(ctx *Context, args *LookupServerlessLifecyclePolicyArgs, opts ...InvokeOption) (*LookupServerlessLifecyclePolicyResult, error)
func LookupServerlessLifecyclePolicyOutput(ctx *Context, args *LookupServerlessLifecyclePolicyOutputArgs, opts ...InvokeOption) LookupServerlessLifecyclePolicyResultOutput> Note: This function is named LookupServerlessLifecyclePolicy in the Go SDK.
public static class GetServerlessLifecyclePolicy 
{
    public static Task<GetServerlessLifecyclePolicyResult> InvokeAsync(GetServerlessLifecyclePolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetServerlessLifecyclePolicyResult> Invoke(GetServerlessLifecyclePolicyInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetServerlessLifecyclePolicyResult> getServerlessLifecyclePolicy(GetServerlessLifecyclePolicyArgs args, InvokeOptions options)
public static Output<GetServerlessLifecyclePolicyResult> getServerlessLifecyclePolicy(GetServerlessLifecyclePolicyArgs args, InvokeOptions options)
fn::invoke:
  function: aws:opensearch/getServerlessLifecyclePolicy:getServerlessLifecyclePolicy
  arguments:
    # arguments dictionaryThe following arguments are supported:
getServerlessLifecyclePolicy Result
The following output properties are available:
- CreatedDate string
- The date the lifecycle policy was created.
- Description string
- Description of the policy. Typically used to store information about the permissions defined in the policy.
- Id string
- LastModified stringDate 
- The date the lifecycle policy was last modified.
- Name string
- Policy string
- JSON policy document to use as the content for the new policy.
- PolicyVersion string
- Version of the policy.
- Type string
- CreatedDate string
- The date the lifecycle policy was created.
- Description string
- Description of the policy. Typically used to store information about the permissions defined in the policy.
- Id string
- LastModified stringDate 
- The date the lifecycle policy was last modified.
- Name string
- Policy string
- JSON policy document to use as the content for the new policy.
- PolicyVersion string
- Version of the policy.
- Type string
- createdDate String
- The date the lifecycle policy was created.
- description String
- Description of the policy. Typically used to store information about the permissions defined in the policy.
- id String
- lastModified StringDate 
- The date the lifecycle policy was last modified.
- name String
- policy String
- JSON policy document to use as the content for the new policy.
- policyVersion String
- Version of the policy.
- type String
- createdDate string
- The date the lifecycle policy was created.
- description string
- Description of the policy. Typically used to store information about the permissions defined in the policy.
- id string
- lastModified stringDate 
- The date the lifecycle policy was last modified.
- name string
- policy string
- JSON policy document to use as the content for the new policy.
- policyVersion string
- Version of the policy.
- type string
- created_date str
- The date the lifecycle policy was created.
- description str
- Description of the policy. Typically used to store information about the permissions defined in the policy.
- id str
- last_modified_ strdate 
- The date the lifecycle policy was last modified.
- name str
- policy str
- JSON policy document to use as the content for the new policy.
- policy_version str
- Version of the policy.
- type str
- createdDate String
- The date the lifecycle policy was created.
- description String
- Description of the policy. Typically used to store information about the permissions defined in the policy.
- id String
- lastModified StringDate 
- The date the lifecycle policy was last modified.
- name String
- policy String
- JSON policy document to use as the content for the new policy.
- policyVersion String
- Version of the policy.
- type String
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.