1. Packages
  2. Packages
  3. Ibm Provider
  4. API Docs
  5. getLogsLogDataRetentionTags
Viewing docs for ibm 2.2.0-beta1
published on Monday, May 18, 2026 by ibm-cloud
Viewing docs for ibm 2.2.0-beta1
published on Monday, May 18, 2026 by ibm-cloud

    Provides a read-only data source to retrieve information about log data retention tags. You can then reference the fields of the data source in other resources within the same configuration by using interpolation syntax.

    Important: An archive bucket must be configured and attached to your Cloud Logs instance before retention tags can be retrieved. If no archive bucket is configured, the data source will fail.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const logsDataRetentionTagsInstance = ibm.getLogsLogDataRetentionTags({
        instanceId: logsInstance.guid,
        region: logsInstance.location,
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    logs_data_retention_tags_instance = ibm.get_logs_log_data_retention_tags(instance_id=logs_instance["guid"],
        region=logs_instance["location"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.LookupLogsLogDataRetentionTags(ctx, &ibm.LookupLogsLogDataRetentionTagsArgs{
    			InstanceId: logsInstance.Guid,
    			Region:     pulumi.StringRef(logsInstance.Location),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var logsDataRetentionTagsInstance = Ibm.GetLogsLogDataRetentionTags.Invoke(new()
        {
            InstanceId = logsInstance.Guid,
            Region = logsInstance.Location,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.IbmFunctions;
    import com.pulumi.ibm.inputs.GetLogsLogDataRetentionTagsArgs;
    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 logsDataRetentionTagsInstance = IbmFunctions.getLogsLogDataRetentionTags(GetLogsLogDataRetentionTagsArgs.builder()
                .instanceId(logsInstance.guid())
                .region(logsInstance.location())
                .build());
    
        }
    }
    
    variables:
      logsDataRetentionTagsInstance:
        fn::invoke:
          function: ibm:getLogsLogDataRetentionTags
          arguments:
            instanceId: ${logsInstance.guid}
            region: ${logsInstance.location}
    
    Example coming soon!
    

    Using getLogsLogDataRetentionTags

    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 getLogsLogDataRetentionTags(args: GetLogsLogDataRetentionTagsArgs, opts?: InvokeOptions): Promise<GetLogsLogDataRetentionTagsResult>
    function getLogsLogDataRetentionTagsOutput(args: GetLogsLogDataRetentionTagsOutputArgs, opts?: InvokeOptions): Output<GetLogsLogDataRetentionTagsResult>
    def get_logs_log_data_retention_tags(endpoint_type: Optional[str] = None,
                                         id: Optional[str] = None,
                                         instance_id: Optional[str] = None,
                                         region: Optional[str] = None,
                                         opts: Optional[InvokeOptions] = None) -> GetLogsLogDataRetentionTagsResult
    def get_logs_log_data_retention_tags_output(endpoint_type: pulumi.Input[Optional[str]] = None,
                                         id: pulumi.Input[Optional[str]] = None,
                                         instance_id: pulumi.Input[Optional[str]] = None,
                                         region: pulumi.Input[Optional[str]] = None,
                                         opts: Optional[InvokeOptions] = None) -> Output[GetLogsLogDataRetentionTagsResult]
    func LookupLogsLogDataRetentionTags(ctx *Context, args *LookupLogsLogDataRetentionTagsArgs, opts ...InvokeOption) (*LookupLogsLogDataRetentionTagsResult, error)
    func LookupLogsLogDataRetentionTagsOutput(ctx *Context, args *LookupLogsLogDataRetentionTagsOutputArgs, opts ...InvokeOption) LookupLogsLogDataRetentionTagsResultOutput

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

    public static class GetLogsLogDataRetentionTags 
    {
        public static Task<GetLogsLogDataRetentionTagsResult> InvokeAsync(GetLogsLogDataRetentionTagsArgs args, InvokeOptions? opts = null)
        public static Output<GetLogsLogDataRetentionTagsResult> Invoke(GetLogsLogDataRetentionTagsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetLogsLogDataRetentionTagsResult> getLogsLogDataRetentionTags(GetLogsLogDataRetentionTagsArgs args, InvokeOptions options)
    public static Output<GetLogsLogDataRetentionTagsResult> getLogsLogDataRetentionTags(GetLogsLogDataRetentionTagsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ibm:index/getLogsLogDataRetentionTags:getLogsLogDataRetentionTags
      arguments:
        # arguments dictionary
    data "ibm_getlogslogdataretentiontags" "name" {
        # arguments
    }

    The following arguments are supported:

    InstanceId string
    Cloud Logs Instance GUID.
    EndpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    Id string
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    Region string
    Cloud Logs Instance Region.
    InstanceId string
    Cloud Logs Instance GUID.
    EndpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    Id string
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    Region string
    Cloud Logs Instance Region.
    instance_id string
    Cloud Logs Instance GUID.
    endpoint_type string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    id string
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    region string
    Cloud Logs Instance Region.
    instanceId String
    Cloud Logs Instance GUID.
    endpointType String
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    id String
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    region String
    Cloud Logs Instance Region.
    instanceId string
    Cloud Logs Instance GUID.
    endpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    id string
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    region string
    Cloud Logs Instance Region.
    instance_id str
    Cloud Logs Instance GUID.
    endpoint_type str
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    id str
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    region str
    Cloud Logs Instance Region.
    instanceId String
    Cloud Logs Instance GUID.
    endpointType String
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    id String
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    region String
    Cloud Logs Instance Region.

    getLogsLogDataRetentionTags Result

    The following output properties are available:

    Id string
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    InstanceId string
    Region string
    Tags List<string>
    (List) List of editable archive retention tags, excluding non-editable tags such as Default.

    • Constraints: The list contains exactly 3 items. Each item is between 1 and 256 characters. The value must match regular expression /^[a-zA-Z0-9_-]+$/.
    EndpointType string
    Id string
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    InstanceId string
    Region string
    Tags []string
    (List) List of editable archive retention tags, excluding non-editable tags such as Default.

    • Constraints: The list contains exactly 3 items. Each item is between 1 and 256 characters. The value must match regular expression /^[a-zA-Z0-9_-]+$/.
    EndpointType string
    id string
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    instance_id string
    region string
    tags list(string)
    (List) List of editable archive retention tags, excluding non-editable tags such as Default.

    • Constraints: The list contains exactly 3 items. Each item is between 1 and 256 characters. The value must match regular expression /^[a-zA-Z0-9_-]+$/.
    endpoint_type string
    id String
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    instanceId String
    region String
    tags List<String>
    (List) List of editable archive retention tags, excluding non-editable tags such as Default.

    • Constraints: The list contains exactly 3 items. Each item is between 1 and 256 characters. The value must match regular expression /^[a-zA-Z0-9_-]+$/.
    endpointType String
    id string
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    instanceId string
    region string
    tags string[]
    (List) List of editable archive retention tags, excluding non-editable tags such as Default.

    • Constraints: The list contains exactly 3 items. Each item is between 1 and 256 characters. The value must match regular expression /^[a-zA-Z0-9_-]+$/.
    endpointType string
    id str
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    instance_id str
    region str
    tags Sequence[str]
    (List) List of editable archive retention tags, excluding non-editable tags such as Default.

    • Constraints: The list contains exactly 3 items. Each item is between 1 and 256 characters. The value must match regular expression /^[a-zA-Z0-9_-]+$/.
    endpoint_type str
    id String
    The unique identifier of the logs_data_retention_tags resource, in the format {region}/{instance_id}.
    instanceId String
    region String
    tags List<String>
    (List) List of editable archive retention tags, excluding non-editable tags such as Default.

    • Constraints: The list contains exactly 3 items. Each item is between 1 and 256 characters. The value must match regular expression /^[a-zA-Z0-9_-]+$/.
    endpointType String

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    Viewing docs for ibm 2.2.0-beta1
    published on Monday, May 18, 2026 by ibm-cloud
      Try Pulumi Cloud free. Your team will thank you.