1. Packages
  2. AWS Classic
  3. API Docs
  4. opensearch
  5. getServerlessLifecyclePolicy

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi

aws.opensearch.getServerlessLifecyclePolicy

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:opensearch/getServerlessLifecyclePolicy:getServerlessLifecyclePolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Name of the policy
    Type string
    Type of lifecycle policy. Must be retention.
    Name string
    Name of the policy
    Type string
    Type of lifecycle policy. Must be retention.
    name String
    Name of the policy
    type String
    Type of lifecycle policy. Must be retention.
    name string
    Name of the policy
    type string
    Type of lifecycle policy. Must be retention.
    name str
    Name of the policy
    type str
    Type of lifecycle policy. Must be retention.
    name String
    Name of the policy
    type String
    Type of lifecycle policy. Must be retention.

    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
    LastModifiedDate string
    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
    LastModifiedDate string
    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
    lastModifiedDate String
    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
    lastModifiedDate string
    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_date str
    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
    lastModifiedDate String
    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 aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi