1. Packages
  2. OVH
  3. API Docs
  4. Dbaas
  5. getLogsClustersRetention
OVHCloud v2.8.0 published on Wednesday, Sep 24, 2025 by OVHcloud

ovh.Dbaas.getLogsClustersRetention

Start a Neo task
Explain and create an ovh.Dbaas.getLogsClustersRetention resource
ovh logo
OVHCloud v2.8.0 published on Wednesday, Sep 24, 2025 by OVHcloud

    Use this data source to retrieve information about a DBaas logs cluster retention.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const retention = ovh.Dbaas.getLogsClustersRetention({
        serviceName: "ldp-xx-xxxxx",
        clusterId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        retentionId: "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    retention = ovh.Dbaas.get_logs_clusters_retention(service_name="ldp-xx-xxxxx",
        cluster_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        retention_id="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy")
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/dbaas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbaas.GetLogsClustersRetention(ctx, &dbaas.GetLogsClustersRetentionArgs{
    			ServiceName: "ldp-xx-xxxxx",
    			ClusterId:   "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    			RetentionId: pulumi.StringRef("yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var retention = Ovh.Dbaas.GetLogsClustersRetention.Invoke(new()
        {
            ServiceName = "ldp-xx-xxxxx",
            ClusterId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            RetentionId = "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.Dbaas.DbaasFunctions;
    import com.pulumi.ovh.Dbaas.inputs.GetLogsClustersRetentionArgs;
    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 retention = DbaasFunctions.getLogsClustersRetention(GetLogsClustersRetentionArgs.builder()
                .serviceName("ldp-xx-xxxxx")
                .clusterId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
                .retentionId("yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy")
                .build());
    
        }
    }
    
    variables:
      retention:
        fn::invoke:
          function: ovh:Dbaas:getLogsClustersRetention
          arguments:
            serviceName: ldp-xx-xxxxx
            clusterId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
            retentionId: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
    

    It is also possible to retrieve a retention using its duration:

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const retention = ovh.Dbaas.getLogsClustersRetention({
        serviceName: "ldp-xx-xxxxx",
        clusterId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        duration: "P14D",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    retention = ovh.Dbaas.get_logs_clusters_retention(service_name="ldp-xx-xxxxx",
        cluster_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        duration="P14D")
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/dbaas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbaas.GetLogsClustersRetention(ctx, &dbaas.GetLogsClustersRetentionArgs{
    			ServiceName: "ldp-xx-xxxxx",
    			ClusterId:   "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    			Duration:    pulumi.StringRef("P14D"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var retention = Ovh.Dbaas.GetLogsClustersRetention.Invoke(new()
        {
            ServiceName = "ldp-xx-xxxxx",
            ClusterId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            Duration = "P14D",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.Dbaas.DbaasFunctions;
    import com.pulumi.ovh.Dbaas.inputs.GetLogsClustersRetentionArgs;
    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 retention = DbaasFunctions.getLogsClustersRetention(GetLogsClustersRetentionArgs.builder()
                .serviceName("ldp-xx-xxxxx")
                .clusterId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
                .duration("P14D")
                .build());
    
        }
    }
    
    variables:
      retention:
        fn::invoke:
          function: ovh:Dbaas:getLogsClustersRetention
          arguments:
            serviceName: ldp-xx-xxxxx
            clusterId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
            duration: P14D
    

    Additionnaly, you can filter retentions on their type:

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const retention = ovh.Dbaas.getLogsClustersRetention({
        serviceName: "ldp-xx-xxxxx",
        clusterId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        duration: "P14D",
        retentionType: "LOGS_INDEXING",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    retention = ovh.Dbaas.get_logs_clusters_retention(service_name="ldp-xx-xxxxx",
        cluster_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        duration="P14D",
        retention_type="LOGS_INDEXING")
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/dbaas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbaas.GetLogsClustersRetention(ctx, &dbaas.GetLogsClustersRetentionArgs{
    			ServiceName:   "ldp-xx-xxxxx",
    			ClusterId:     "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    			Duration:      pulumi.StringRef("P14D"),
    			RetentionType: pulumi.StringRef("LOGS_INDEXING"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var retention = Ovh.Dbaas.GetLogsClustersRetention.Invoke(new()
        {
            ServiceName = "ldp-xx-xxxxx",
            ClusterId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            Duration = "P14D",
            RetentionType = "LOGS_INDEXING",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.Dbaas.DbaasFunctions;
    import com.pulumi.ovh.Dbaas.inputs.GetLogsClustersRetentionArgs;
    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 retention = DbaasFunctions.getLogsClustersRetention(GetLogsClustersRetentionArgs.builder()
                .serviceName("ldp-xx-xxxxx")
                .clusterId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
                .duration("P14D")
                .retentionType("LOGS_INDEXING")
                .build());
    
        }
    }
    
    variables:
      retention:
        fn::invoke:
          function: ovh:Dbaas:getLogsClustersRetention
          arguments:
            serviceName: ldp-xx-xxxxx
            clusterId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
            duration: P14D
            retentionType: LOGS_INDEXING
    

    Using getLogsClustersRetention

    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 getLogsClustersRetention(args: GetLogsClustersRetentionArgs, opts?: InvokeOptions): Promise<GetLogsClustersRetentionResult>
    function getLogsClustersRetentionOutput(args: GetLogsClustersRetentionOutputArgs, opts?: InvokeOptions): Output<GetLogsClustersRetentionResult>
    def get_logs_clusters_retention(cluster_id: Optional[str] = None,
                                    duration: Optional[str] = None,
                                    retention_id: Optional[str] = None,
                                    retention_type: Optional[str] = None,
                                    service_name: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetLogsClustersRetentionResult
    def get_logs_clusters_retention_output(cluster_id: Optional[pulumi.Input[str]] = None,
                                    duration: Optional[pulumi.Input[str]] = None,
                                    retention_id: Optional[pulumi.Input[str]] = None,
                                    retention_type: Optional[pulumi.Input[str]] = None,
                                    service_name: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetLogsClustersRetentionResult]
    func GetLogsClustersRetention(ctx *Context, args *GetLogsClustersRetentionArgs, opts ...InvokeOption) (*GetLogsClustersRetentionResult, error)
    func GetLogsClustersRetentionOutput(ctx *Context, args *GetLogsClustersRetentionOutputArgs, opts ...InvokeOption) GetLogsClustersRetentionResultOutput

    > Note: This function is named GetLogsClustersRetention in the Go SDK.

    public static class GetLogsClustersRetention 
    {
        public static Task<GetLogsClustersRetentionResult> InvokeAsync(GetLogsClustersRetentionArgs args, InvokeOptions? opts = null)
        public static Output<GetLogsClustersRetentionResult> Invoke(GetLogsClustersRetentionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLogsClustersRetentionResult> getLogsClustersRetention(GetLogsClustersRetentionArgs args, InvokeOptions options)
    public static Output<GetLogsClustersRetentionResult> getLogsClustersRetention(GetLogsClustersRetentionArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ovh:Dbaas/getLogsClustersRetention:getLogsClustersRetention
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ClusterId string
    Cluster ID
    ServiceName string
    The service name. It's the ID of your Logs Data Platform instance.
    Duration string
    Indexed duration expressed in ISO-8601 format. Cannot be used if retention_id is defined.
    RetentionId string
    ID of the retention object. Cannot be used if duration or retention_type is defined.
    RetentionType string
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT). Cannot be used if retention_id is defined. Defaults to LOGS_INDEXING if not defined.
    ClusterId string
    Cluster ID
    ServiceName string
    The service name. It's the ID of your Logs Data Platform instance.
    Duration string
    Indexed duration expressed in ISO-8601 format. Cannot be used if retention_id is defined.
    RetentionId string
    ID of the retention object. Cannot be used if duration or retention_type is defined.
    RetentionType string
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT). Cannot be used if retention_id is defined. Defaults to LOGS_INDEXING if not defined.
    clusterId String
    Cluster ID
    serviceName String
    The service name. It's the ID of your Logs Data Platform instance.
    duration String
    Indexed duration expressed in ISO-8601 format. Cannot be used if retention_id is defined.
    retentionId String
    ID of the retention object. Cannot be used if duration or retention_type is defined.
    retentionType String
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT). Cannot be used if retention_id is defined. Defaults to LOGS_INDEXING if not defined.
    clusterId string
    Cluster ID
    serviceName string
    The service name. It's the ID of your Logs Data Platform instance.
    duration string
    Indexed duration expressed in ISO-8601 format. Cannot be used if retention_id is defined.
    retentionId string
    ID of the retention object. Cannot be used if duration or retention_type is defined.
    retentionType string
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT). Cannot be used if retention_id is defined. Defaults to LOGS_INDEXING if not defined.
    cluster_id str
    Cluster ID
    service_name str
    The service name. It's the ID of your Logs Data Platform instance.
    duration str
    Indexed duration expressed in ISO-8601 format. Cannot be used if retention_id is defined.
    retention_id str
    ID of the retention object. Cannot be used if duration or retention_type is defined.
    retention_type str
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT). Cannot be used if retention_id is defined. Defaults to LOGS_INDEXING if not defined.
    clusterId String
    Cluster ID
    serviceName String
    The service name. It's the ID of your Logs Data Platform instance.
    duration String
    Indexed duration expressed in ISO-8601 format. Cannot be used if retention_id is defined.
    retentionId String
    ID of the retention object. Cannot be used if duration or retention_type is defined.
    retentionType String
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT). Cannot be used if retention_id is defined. Defaults to LOGS_INDEXING if not defined.

    getLogsClustersRetention Result

    The following output properties are available:

    ClusterId string
    Duration string
    Indexed duration expressed in ISO-8601 format
    Id string
    The provider-assigned unique ID for this managed resource.
    IsSupported bool
    Indicates if a new stream can use it
    RetentionId string
    ID of the retention that can be used when creating a stream
    RetentionType string
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT)
    ServiceName string
    ClusterId string
    Duration string
    Indexed duration expressed in ISO-8601 format
    Id string
    The provider-assigned unique ID for this managed resource.
    IsSupported bool
    Indicates if a new stream can use it
    RetentionId string
    ID of the retention that can be used when creating a stream
    RetentionType string
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT)
    ServiceName string
    clusterId String
    duration String
    Indexed duration expressed in ISO-8601 format
    id String
    The provider-assigned unique ID for this managed resource.
    isSupported Boolean
    Indicates if a new stream can use it
    retentionId String
    ID of the retention that can be used when creating a stream
    retentionType String
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT)
    serviceName String
    clusterId string
    duration string
    Indexed duration expressed in ISO-8601 format
    id string
    The provider-assigned unique ID for this managed resource.
    isSupported boolean
    Indicates if a new stream can use it
    retentionId string
    ID of the retention that can be used when creating a stream
    retentionType string
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT)
    serviceName string
    cluster_id str
    duration str
    Indexed duration expressed in ISO-8601 format
    id str
    The provider-assigned unique ID for this managed resource.
    is_supported bool
    Indicates if a new stream can use it
    retention_id str
    ID of the retention that can be used when creating a stream
    retention_type str
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT)
    service_name str
    clusterId String
    duration String
    Indexed duration expressed in ISO-8601 format
    id String
    The provider-assigned unique ID for this managed resource.
    isSupported Boolean
    Indicates if a new stream can use it
    retentionId String
    ID of the retention that can be used when creating a stream
    retentionType String
    Type of the retention (LOGS_INDEXING | LOGS_COLD_STORAGE | METRICS_TENANT)
    serviceName String

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v2.8.0 published on Wednesday, Sep 24, 2025 by OVHcloud
      Meet Neo: Your AI Platform Teammate