1. Packages
  2. Ibm Provider
  3. API Docs
  4. LogsPolicy
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.LogsPolicy

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Create, update, and delete logs_policys with this resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const logsPolicyInstance = new ibm.LogsPolicy("logsPolicyInstance", {
        instanceId: ibm_resource_instance.logs_instance.guid,
        region: ibm_resource_instance.logs_instance.location,
        description: "example policy decription",
        priority: "type_medium",
        applicationRule: {
            name: "otel-links-test",
            ruleTypeId: "start_with",
        },
        logRules: {
            severities: ["info"],
        },
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    logs_policy_instance = ibm.LogsPolicy("logsPolicyInstance",
        instance_id=ibm_resource_instance["logs_instance"]["guid"],
        region=ibm_resource_instance["logs_instance"]["location"],
        description="example policy decription",
        priority="type_medium",
        application_rule={
            "name": "otel-links-test",
            "rule_type_id": "start_with",
        },
        log_rules={
            "severities": ["info"],
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewLogsPolicy(ctx, "logsPolicyInstance", &ibm.LogsPolicyArgs{
    			InstanceId:  pulumi.Any(ibm_resource_instance.Logs_instance.Guid),
    			Region:      pulumi.Any(ibm_resource_instance.Logs_instance.Location),
    			Description: pulumi.String("example policy decription"),
    			Priority:    pulumi.String("type_medium"),
    			ApplicationRule: &ibm.LogsPolicyApplicationRuleArgs{
    				Name:       pulumi.String("otel-links-test"),
    				RuleTypeId: pulumi.String("start_with"),
    			},
    			LogRules: &ibm.LogsPolicyLogRulesArgs{
    				Severities: pulumi.StringArray{
    					pulumi.String("info"),
    				},
    			},
    		})
    		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 logsPolicyInstance = new Ibm.LogsPolicy("logsPolicyInstance", new()
        {
            InstanceId = ibm_resource_instance.Logs_instance.Guid,
            Region = ibm_resource_instance.Logs_instance.Location,
            Description = "example policy decription",
            Priority = "type_medium",
            ApplicationRule = new Ibm.Inputs.LogsPolicyApplicationRuleArgs
            {
                Name = "otel-links-test",
                RuleTypeId = "start_with",
            },
            LogRules = new Ibm.Inputs.LogsPolicyLogRulesArgs
            {
                Severities = new[]
                {
                    "info",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.LogsPolicy;
    import com.pulumi.ibm.LogsPolicyArgs;
    import com.pulumi.ibm.inputs.LogsPolicyApplicationRuleArgs;
    import com.pulumi.ibm.inputs.LogsPolicyLogRulesArgs;
    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) {
            var logsPolicyInstance = new LogsPolicy("logsPolicyInstance", LogsPolicyArgs.builder()
                .instanceId(ibm_resource_instance.logs_instance().guid())
                .region(ibm_resource_instance.logs_instance().location())
                .description("example policy decription")
                .priority("type_medium")
                .applicationRule(LogsPolicyApplicationRuleArgs.builder()
                    .name("otel-links-test")
                    .ruleTypeId("start_with")
                    .build())
                .logRules(LogsPolicyLogRulesArgs.builder()
                    .severities("info")
                    .build())
                .build());
    
        }
    }
    
    resources:
      logsPolicyInstance:
        type: ibm:LogsPolicy
        properties:
          instanceId: ${ibm_resource_instance.logs_instance.guid}
          region: ${ibm_resource_instance.logs_instance.location}
          description: example policy decription
          priority: type_medium
          applicationRule:
            name: otel-links-test
            ruleTypeId: start_with
          logRules:
            severities:
              - info
    

    Create LogsPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new LogsPolicy(name: string, args: LogsPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def LogsPolicy(resource_name: str,
                   args: LogsPolicyArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def LogsPolicy(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   instance_id: Optional[str] = None,
                   priority: Optional[str] = None,
                   application_rule: Optional[LogsPolicyApplicationRuleArgs] = None,
                   archive_retention: Optional[LogsPolicyArchiveRetentionArgs] = None,
                   description: Optional[str] = None,
                   endpoint_type: Optional[str] = None,
                   log_rules: Optional[LogsPolicyLogRulesArgs] = None,
                   logs_policy_id: Optional[str] = None,
                   name: Optional[str] = None,
                   region: Optional[str] = None,
                   subsystem_rule: Optional[LogsPolicySubsystemRuleArgs] = None)
    func NewLogsPolicy(ctx *Context, name string, args LogsPolicyArgs, opts ...ResourceOption) (*LogsPolicy, error)
    public LogsPolicy(string name, LogsPolicyArgs args, CustomResourceOptions? opts = null)
    public LogsPolicy(String name, LogsPolicyArgs args)
    public LogsPolicy(String name, LogsPolicyArgs args, CustomResourceOptions options)
    
    type: ibm:LogsPolicy
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args LogsPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args LogsPolicyArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args LogsPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogsPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogsPolicyArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var logsPolicyResource = new Ibm.LogsPolicy("logsPolicyResource", new()
    {
        InstanceId = "string",
        Priority = "string",
        ApplicationRule = new Ibm.Inputs.LogsPolicyApplicationRuleArgs
        {
            Name = "string",
            RuleTypeId = "string",
        },
        ArchiveRetention = new Ibm.Inputs.LogsPolicyArchiveRetentionArgs
        {
            Id = "string",
        },
        Description = "string",
        EndpointType = "string",
        LogRules = new Ibm.Inputs.LogsPolicyLogRulesArgs
        {
            Severities = new[]
            {
                "string",
            },
        },
        LogsPolicyId = "string",
        Name = "string",
        Region = "string",
        SubsystemRule = new Ibm.Inputs.LogsPolicySubsystemRuleArgs
        {
            Name = "string",
            RuleTypeId = "string",
        },
    });
    
    example, err := ibm.NewLogsPolicy(ctx, "logsPolicyResource", &ibm.LogsPolicyArgs{
    	InstanceId: pulumi.String("string"),
    	Priority:   pulumi.String("string"),
    	ApplicationRule: &ibm.LogsPolicyApplicationRuleArgs{
    		Name:       pulumi.String("string"),
    		RuleTypeId: pulumi.String("string"),
    	},
    	ArchiveRetention: &ibm.LogsPolicyArchiveRetentionArgs{
    		Id: pulumi.String("string"),
    	},
    	Description:  pulumi.String("string"),
    	EndpointType: pulumi.String("string"),
    	LogRules: &ibm.LogsPolicyLogRulesArgs{
    		Severities: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	LogsPolicyId: pulumi.String("string"),
    	Name:         pulumi.String("string"),
    	Region:       pulumi.String("string"),
    	SubsystemRule: &ibm.LogsPolicySubsystemRuleArgs{
    		Name:       pulumi.String("string"),
    		RuleTypeId: pulumi.String("string"),
    	},
    })
    
    var logsPolicyResource = new LogsPolicy("logsPolicyResource", LogsPolicyArgs.builder()
        .instanceId("string")
        .priority("string")
        .applicationRule(LogsPolicyApplicationRuleArgs.builder()
            .name("string")
            .ruleTypeId("string")
            .build())
        .archiveRetention(LogsPolicyArchiveRetentionArgs.builder()
            .id("string")
            .build())
        .description("string")
        .endpointType("string")
        .logRules(LogsPolicyLogRulesArgs.builder()
            .severities("string")
            .build())
        .logsPolicyId("string")
        .name("string")
        .region("string")
        .subsystemRule(LogsPolicySubsystemRuleArgs.builder()
            .name("string")
            .ruleTypeId("string")
            .build())
        .build());
    
    logs_policy_resource = ibm.LogsPolicy("logsPolicyResource",
        instance_id="string",
        priority="string",
        application_rule={
            "name": "string",
            "rule_type_id": "string",
        },
        archive_retention={
            "id": "string",
        },
        description="string",
        endpoint_type="string",
        log_rules={
            "severities": ["string"],
        },
        logs_policy_id="string",
        name="string",
        region="string",
        subsystem_rule={
            "name": "string",
            "rule_type_id": "string",
        })
    
    const logsPolicyResource = new ibm.LogsPolicy("logsPolicyResource", {
        instanceId: "string",
        priority: "string",
        applicationRule: {
            name: "string",
            ruleTypeId: "string",
        },
        archiveRetention: {
            id: "string",
        },
        description: "string",
        endpointType: "string",
        logRules: {
            severities: ["string"],
        },
        logsPolicyId: "string",
        name: "string",
        region: "string",
        subsystemRule: {
            name: "string",
            ruleTypeId: "string",
        },
    });
    
    type: ibm:LogsPolicy
    properties:
        applicationRule:
            name: string
            ruleTypeId: string
        archiveRetention:
            id: string
        description: string
        endpointType: string
        instanceId: string
        logRules:
            severities:
                - string
        logsPolicyId: string
        name: string
        priority: string
        region: string
        subsystemRule:
            name: string
            ruleTypeId: string
    

    LogsPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The LogsPolicy resource accepts the following input properties:

    InstanceId string
    Cloud Logs Instance GUID.
    Priority string
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    ApplicationRule LogsPolicyApplicationRule
    Rule for matching with application. Nested schema for application_rule:
    ArchiveRetention LogsPolicyArchiveRetention
    Archive retention definition. Nested schema for archive_retention:
    Description string
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    EndpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    LogRules LogsPolicyLogRules
    Log rules. Nested schema for log_rules:
    LogsPolicyId string
    The unique identifier of the logs_policy resource.
    Name string
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    Region string
    Cloud Logs Instance Region.
    SubsystemRule LogsPolicySubsystemRule
    Rule for matching with application. Nested schema for subsystem_rule:
    InstanceId string
    Cloud Logs Instance GUID.
    Priority string
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    ApplicationRule LogsPolicyApplicationRuleArgs
    Rule for matching with application. Nested schema for application_rule:
    ArchiveRetention LogsPolicyArchiveRetentionArgs
    Archive retention definition. Nested schema for archive_retention:
    Description string
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    EndpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    LogRules LogsPolicyLogRulesArgs
    Log rules. Nested schema for log_rules:
    LogsPolicyId string
    The unique identifier of the logs_policy resource.
    Name string
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    Region string
    Cloud Logs Instance Region.
    SubsystemRule LogsPolicySubsystemRuleArgs
    Rule for matching with application. Nested schema for subsystem_rule:
    instanceId String
    Cloud Logs Instance GUID.
    priority String
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    applicationRule LogsPolicyApplicationRule
    Rule for matching with application. Nested schema for application_rule:
    archiveRetention LogsPolicyArchiveRetention
    Archive retention definition. Nested schema for archive_retention:
    description String
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    endpointType String
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    logRules LogsPolicyLogRules
    Log rules. Nested schema for log_rules:
    logsPolicyId String
    The unique identifier of the logs_policy resource.
    name String
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    region String
    Cloud Logs Instance Region.
    subsystemRule LogsPolicySubsystemRule
    Rule for matching with application. Nested schema for subsystem_rule:
    instanceId string
    Cloud Logs Instance GUID.
    priority string
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    applicationRule LogsPolicyApplicationRule
    Rule for matching with application. Nested schema for application_rule:
    archiveRetention LogsPolicyArchiveRetention
    Archive retention definition. Nested schema for archive_retention:
    description string
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    endpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    logRules LogsPolicyLogRules
    Log rules. Nested schema for log_rules:
    logsPolicyId string
    The unique identifier of the logs_policy resource.
    name string
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    region string
    Cloud Logs Instance Region.
    subsystemRule LogsPolicySubsystemRule
    Rule for matching with application. Nested schema for subsystem_rule:
    instance_id str
    Cloud Logs Instance GUID.
    priority str
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    application_rule LogsPolicyApplicationRuleArgs
    Rule for matching with application. Nested schema for application_rule:
    archive_retention LogsPolicyArchiveRetentionArgs
    Archive retention definition. Nested schema for archive_retention:
    description str
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    endpoint_type str
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    log_rules LogsPolicyLogRulesArgs
    Log rules. Nested schema for log_rules:
    logs_policy_id str
    The unique identifier of the logs_policy resource.
    name str
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    region str
    Cloud Logs Instance Region.
    subsystem_rule LogsPolicySubsystemRuleArgs
    Rule for matching with application. Nested schema for subsystem_rule:
    instanceId String
    Cloud Logs Instance GUID.
    priority String
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    applicationRule Property Map
    Rule for matching with application. Nested schema for application_rule:
    archiveRetention Property Map
    Archive retention definition. Nested schema for archive_retention:
    description String
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    endpointType String
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    logRules Property Map
    Log rules. Nested schema for log_rules:
    logsPolicyId String
    The unique identifier of the logs_policy resource.
    name String
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    region String
    Cloud Logs Instance Region.
    subsystemRule Property Map
    Rule for matching with application. Nested schema for subsystem_rule:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the LogsPolicy resource produces the following output properties:

    CompanyId double
    (Integer) Company ID.
    CreatedAt string
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    Deleted bool
    (Boolean) Soft deletion flag.
    Enabled bool
    (Boolean) Enabled flag.
    Id string
    The provider-assigned unique ID for this managed resource.
    Order double
    (Integer) Order of policy in relation to other policies.
    PolicyId string
    The unique identifier of the logs_policy.
    UpdatedAt string
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    CompanyId float64
    (Integer) Company ID.
    CreatedAt string
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    Deleted bool
    (Boolean) Soft deletion flag.
    Enabled bool
    (Boolean) Enabled flag.
    Id string
    The provider-assigned unique ID for this managed resource.
    Order float64
    (Integer) Order of policy in relation to other policies.
    PolicyId string
    The unique identifier of the logs_policy.
    UpdatedAt string
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    companyId Double
    (Integer) Company ID.
    createdAt String
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    deleted Boolean
    (Boolean) Soft deletion flag.
    enabled Boolean
    (Boolean) Enabled flag.
    id String
    The provider-assigned unique ID for this managed resource.
    order Double
    (Integer) Order of policy in relation to other policies.
    policyId String
    The unique identifier of the logs_policy.
    updatedAt String
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    companyId number
    (Integer) Company ID.
    createdAt string
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    deleted boolean
    (Boolean) Soft deletion flag.
    enabled boolean
    (Boolean) Enabled flag.
    id string
    The provider-assigned unique ID for this managed resource.
    order number
    (Integer) Order of policy in relation to other policies.
    policyId string
    The unique identifier of the logs_policy.
    updatedAt string
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    company_id float
    (Integer) Company ID.
    created_at str
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    deleted bool
    (Boolean) Soft deletion flag.
    enabled bool
    (Boolean) Enabled flag.
    id str
    The provider-assigned unique ID for this managed resource.
    order float
    (Integer) Order of policy in relation to other policies.
    policy_id str
    The unique identifier of the logs_policy.
    updated_at str
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    companyId Number
    (Integer) Company ID.
    createdAt String
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    deleted Boolean
    (Boolean) Soft deletion flag.
    enabled Boolean
    (Boolean) Enabled flag.
    id String
    The provider-assigned unique ID for this managed resource.
    order Number
    (Integer) Order of policy in relation to other policies.
    policyId String
    The unique identifier of the logs_policy.
    updatedAt String
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.

    Look up Existing LogsPolicy Resource

    Get an existing LogsPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: LogsPolicyState, opts?: CustomResourceOptions): LogsPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_rule: Optional[LogsPolicyApplicationRuleArgs] = None,
            archive_retention: Optional[LogsPolicyArchiveRetentionArgs] = None,
            company_id: Optional[float] = None,
            created_at: Optional[str] = None,
            deleted: Optional[bool] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            endpoint_type: Optional[str] = None,
            instance_id: Optional[str] = None,
            log_rules: Optional[LogsPolicyLogRulesArgs] = None,
            logs_policy_id: Optional[str] = None,
            name: Optional[str] = None,
            order: Optional[float] = None,
            policy_id: Optional[str] = None,
            priority: Optional[str] = None,
            region: Optional[str] = None,
            subsystem_rule: Optional[LogsPolicySubsystemRuleArgs] = None,
            updated_at: Optional[str] = None) -> LogsPolicy
    func GetLogsPolicy(ctx *Context, name string, id IDInput, state *LogsPolicyState, opts ...ResourceOption) (*LogsPolicy, error)
    public static LogsPolicy Get(string name, Input<string> id, LogsPolicyState? state, CustomResourceOptions? opts = null)
    public static LogsPolicy get(String name, Output<String> id, LogsPolicyState state, CustomResourceOptions options)
    resources:  _:    type: ibm:LogsPolicy    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ApplicationRule LogsPolicyApplicationRule
    Rule for matching with application. Nested schema for application_rule:
    ArchiveRetention LogsPolicyArchiveRetention
    Archive retention definition. Nested schema for archive_retention:
    CompanyId double
    (Integer) Company ID.
    CreatedAt string
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    Deleted bool
    (Boolean) Soft deletion flag.
    Description string
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    Enabled bool
    (Boolean) Enabled flag.
    EndpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    InstanceId string
    Cloud Logs Instance GUID.
    LogRules LogsPolicyLogRules
    Log rules. Nested schema for log_rules:
    LogsPolicyId string
    The unique identifier of the logs_policy resource.
    Name string
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    Order double
    (Integer) Order of policy in relation to other policies.
    PolicyId string
    The unique identifier of the logs_policy.
    Priority string
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    Region string
    Cloud Logs Instance Region.
    SubsystemRule LogsPolicySubsystemRule
    Rule for matching with application. Nested schema for subsystem_rule:
    UpdatedAt string
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    ApplicationRule LogsPolicyApplicationRuleArgs
    Rule for matching with application. Nested schema for application_rule:
    ArchiveRetention LogsPolicyArchiveRetentionArgs
    Archive retention definition. Nested schema for archive_retention:
    CompanyId float64
    (Integer) Company ID.
    CreatedAt string
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    Deleted bool
    (Boolean) Soft deletion flag.
    Description string
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    Enabled bool
    (Boolean) Enabled flag.
    EndpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    InstanceId string
    Cloud Logs Instance GUID.
    LogRules LogsPolicyLogRulesArgs
    Log rules. Nested schema for log_rules:
    LogsPolicyId string
    The unique identifier of the logs_policy resource.
    Name string
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    Order float64
    (Integer) Order of policy in relation to other policies.
    PolicyId string
    The unique identifier of the logs_policy.
    Priority string
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    Region string
    Cloud Logs Instance Region.
    SubsystemRule LogsPolicySubsystemRuleArgs
    Rule for matching with application. Nested schema for subsystem_rule:
    UpdatedAt string
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    applicationRule LogsPolicyApplicationRule
    Rule for matching with application. Nested schema for application_rule:
    archiveRetention LogsPolicyArchiveRetention
    Archive retention definition. Nested schema for archive_retention:
    companyId Double
    (Integer) Company ID.
    createdAt String
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    deleted Boolean
    (Boolean) Soft deletion flag.
    description String
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    enabled Boolean
    (Boolean) Enabled flag.
    endpointType String
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    instanceId String
    Cloud Logs Instance GUID.
    logRules LogsPolicyLogRules
    Log rules. Nested schema for log_rules:
    logsPolicyId String
    The unique identifier of the logs_policy resource.
    name String
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    order Double
    (Integer) Order of policy in relation to other policies.
    policyId String
    The unique identifier of the logs_policy.
    priority String
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    region String
    Cloud Logs Instance Region.
    subsystemRule LogsPolicySubsystemRule
    Rule for matching with application. Nested schema for subsystem_rule:
    updatedAt String
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    applicationRule LogsPolicyApplicationRule
    Rule for matching with application. Nested schema for application_rule:
    archiveRetention LogsPolicyArchiveRetention
    Archive retention definition. Nested schema for archive_retention:
    companyId number
    (Integer) Company ID.
    createdAt string
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    deleted boolean
    (Boolean) Soft deletion flag.
    description string
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    enabled boolean
    (Boolean) Enabled flag.
    endpointType string
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    instanceId string
    Cloud Logs Instance GUID.
    logRules LogsPolicyLogRules
    Log rules. Nested schema for log_rules:
    logsPolicyId string
    The unique identifier of the logs_policy resource.
    name string
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    order number
    (Integer) Order of policy in relation to other policies.
    policyId string
    The unique identifier of the logs_policy.
    priority string
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    region string
    Cloud Logs Instance Region.
    subsystemRule LogsPolicySubsystemRule
    Rule for matching with application. Nested schema for subsystem_rule:
    updatedAt string
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    application_rule LogsPolicyApplicationRuleArgs
    Rule for matching with application. Nested schema for application_rule:
    archive_retention LogsPolicyArchiveRetentionArgs
    Archive retention definition. Nested schema for archive_retention:
    company_id float
    (Integer) Company ID.
    created_at str
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    deleted bool
    (Boolean) Soft deletion flag.
    description str
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    enabled bool
    (Boolean) Enabled flag.
    endpoint_type str
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    instance_id str
    Cloud Logs Instance GUID.
    log_rules LogsPolicyLogRulesArgs
    Log rules. Nested schema for log_rules:
    logs_policy_id str
    The unique identifier of the logs_policy resource.
    name str
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    order float
    (Integer) Order of policy in relation to other policies.
    policy_id str
    The unique identifier of the logs_policy.
    priority str
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    region str
    Cloud Logs Instance Region.
    subsystem_rule LogsPolicySubsystemRuleArgs
    Rule for matching with application. Nested schema for subsystem_rule:
    updated_at str
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    applicationRule Property Map
    Rule for matching with application. Nested schema for application_rule:
    archiveRetention Property Map
    Archive retention definition. Nested schema for archive_retention:
    companyId Number
    (Integer) Company ID.
    createdAt String
    (String) Created at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.
    deleted Boolean
    (Boolean) Soft deletion flag.
    description String
    Description of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^[A-Za-z0-9_\\-\\s]+$/.
    enabled Boolean
    (Boolean) Enabled flag.
    endpointType String
    Cloud Logs Instance Endpoint type. Allowed values public and private.
    instanceId String
    Cloud Logs Instance GUID.
    logRules Property Map
    Log rules. Nested schema for log_rules:
    logsPolicyId String
    The unique identifier of the logs_policy resource.
    name String
    Name of policy.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    order Number
    (Integer) Order of policy in relation to other policies.
    policyId String
    The unique identifier of the logs_policy.
    priority String
    The data pipeline sources that match the policy rules will go through.

    • Constraints: Allowable values are: type_unspecified, type_block, type_low, type_medium, type_high.
    region String
    Cloud Logs Instance Region.
    subsystemRule Property Map
    Rule for matching with application. Nested schema for subsystem_rule:
    updatedAt String
    (String) Updated at date at utc+0.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression /^"\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}"$/.

    Supporting Types

    LogsPolicyApplicationRule, LogsPolicyApplicationRuleArgs

    Name string
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    RuleTypeId string
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    Name string
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    RuleTypeId string
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    name String
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    ruleTypeId String
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    name string
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    ruleTypeId string
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    name str
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    rule_type_id str
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    name String
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    ruleTypeId String
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.

    LogsPolicyArchiveRetention, LogsPolicyArchiveRetentionArgs

    Id string
    References archive retention definition.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.
    Id string
    References archive retention definition.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.
    id String
    References archive retention definition.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.
    id string
    References archive retention definition.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.
    id str
    References archive retention definition.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.
    id String
    References archive retention definition.

    • Constraints: The maximum length is 36 characters. The minimum length is 36 characters. The value must match regular expression /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.

    LogsPolicyLogRules, LogsPolicyLogRulesArgs

    Severities List<string>
    Source severities to match with.

    • Constraints: Allowable list items are: unspecified, debug, verbose, info, warning, error, critical. The maximum length is 4096 items. The minimum length is 0 items.
    Severities []string
    Source severities to match with.

    • Constraints: Allowable list items are: unspecified, debug, verbose, info, warning, error, critical. The maximum length is 4096 items. The minimum length is 0 items.
    severities List<String>
    Source severities to match with.

    • Constraints: Allowable list items are: unspecified, debug, verbose, info, warning, error, critical. The maximum length is 4096 items. The minimum length is 0 items.
    severities string[]
    Source severities to match with.

    • Constraints: Allowable list items are: unspecified, debug, verbose, info, warning, error, critical. The maximum length is 4096 items. The minimum length is 0 items.
    severities Sequence[str]
    Source severities to match with.

    • Constraints: Allowable list items are: unspecified, debug, verbose, info, warning, error, critical. The maximum length is 4096 items. The minimum length is 0 items.
    severities List<String>
    Source severities to match with.

    • Constraints: Allowable list items are: unspecified, debug, verbose, info, warning, error, critical. The maximum length is 4096 items. The minimum length is 0 items.

    LogsPolicySubsystemRule, LogsPolicySubsystemRuleArgs

    Name string
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    RuleTypeId string
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    Name string
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    RuleTypeId string
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    name String
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    ruleTypeId String
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    name string
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    ruleTypeId string
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    name str
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    rule_type_id str
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.
    name String
    Value of the rule.

    • Constraints: The maximum length is 4096 characters. The minimum length is 1 character. The value must match regular expression ^[\\p{L}\\p{N}\\p{P}\\p{Z}\\p{S}\\p{M}]+$.
    ruleTypeId String
    Identifier of the rule.

    • Constraints: Allowable values are: unspecified, is, is_not, start_with, includes.

    Import

    You can import the ibm_logs_policy resource by using id. id combination of region, instance_id and policy_id.

    Syntax

    
    ```sh
    $ pulumi import ibm:index/logsPolicy:LogsPolicy logs_policy < region >/< instance_id >/< policy_id >;
    ```
    
    

    Example

    $ pulumi import ibm:index/logsPolicy:LogsPolicy logs_policy eu-gb/3dc02998-0b50-4ea8-b68a-4779d716fa1f/3dc02998-0b50-4ea8-b68a-4779d716fa1f
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud