1. Packages
  2. Datadog Provider
  3. API Docs
  4. LogsRestrictionQuery
Datadog v4.61.0 published on Monday, Dec 22, 2025 by Pulumi
datadog logo
Datadog v4.61.0 published on Monday, Dec 22, 2025 by Pulumi

    Provides a Datadog Log Restriction Query resource. This can be used to create and manage Datadog Log Restriction Queries.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    // Manage a Datadog log restriction query
    const testLrq = new datadog.LogsRestrictionQuery("test_lrq", {
        restrictionQuery: "service:foo",
        roleIds: [
            "00000000-0000-1111-0000-000000000000",
            "11111111-1111-0000-1111-111111111111",
        ],
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    # Manage a Datadog log restriction query
    test_lrq = datadog.LogsRestrictionQuery("test_lrq",
        restriction_query="service:foo",
        role_ids=[
            "00000000-0000-1111-0000-000000000000",
            "11111111-1111-0000-1111-111111111111",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Manage a Datadog log restriction query
    		_, err := datadog.NewLogsRestrictionQuery(ctx, "test_lrq", &datadog.LogsRestrictionQueryArgs{
    			RestrictionQuery: pulumi.String("service:foo"),
    			RoleIds: pulumi.StringArray{
    				pulumi.String("00000000-0000-1111-0000-000000000000"),
    				pulumi.String("11111111-1111-0000-1111-111111111111"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        // Manage a Datadog log restriction query
        var testLrq = new Datadog.LogsRestrictionQuery("test_lrq", new()
        {
            RestrictionQuery = "service:foo",
            RoleIds = new[]
            {
                "00000000-0000-1111-0000-000000000000",
                "11111111-1111-0000-1111-111111111111",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.LogsRestrictionQuery;
    import com.pulumi.datadog.LogsRestrictionQueryArgs;
    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) {
            // Manage a Datadog log restriction query
            var testLrq = new LogsRestrictionQuery("testLrq", LogsRestrictionQueryArgs.builder()
                .restrictionQuery("service:foo")
                .roleIds(            
                    "00000000-0000-1111-0000-000000000000",
                    "11111111-1111-0000-1111-111111111111")
                .build());
    
        }
    }
    
    resources:
      # Manage a Datadog log restriction query
      testLrq:
        type: datadog:LogsRestrictionQuery
        name: test_lrq
        properties:
          restrictionQuery: service:foo
          roleIds:
            - 00000000-0000-1111-0000-000000000000
            - 11111111-1111-0000-1111-111111111111
    

    Create LogsRestrictionQuery Resource

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

    Constructor syntax

    new LogsRestrictionQuery(name: string, args: LogsRestrictionQueryArgs, opts?: CustomResourceOptions);
    @overload
    def LogsRestrictionQuery(resource_name: str,
                             args: LogsRestrictionQueryArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def LogsRestrictionQuery(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             restriction_query: Optional[str] = None,
                             role_ids: Optional[Sequence[str]] = None)
    func NewLogsRestrictionQuery(ctx *Context, name string, args LogsRestrictionQueryArgs, opts ...ResourceOption) (*LogsRestrictionQuery, error)
    public LogsRestrictionQuery(string name, LogsRestrictionQueryArgs args, CustomResourceOptions? opts = null)
    public LogsRestrictionQuery(String name, LogsRestrictionQueryArgs args)
    public LogsRestrictionQuery(String name, LogsRestrictionQueryArgs args, CustomResourceOptions options)
    
    type: datadog:LogsRestrictionQuery
    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 LogsRestrictionQueryArgs
    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 LogsRestrictionQueryArgs
    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 LogsRestrictionQueryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args LogsRestrictionQueryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args LogsRestrictionQueryArgs
    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 logsRestrictionQueryResource = new Datadog.LogsRestrictionQuery("logsRestrictionQueryResource", new()
    {
        RestrictionQuery = "string",
        RoleIds = new[]
        {
            "string",
        },
    });
    
    example, err := datadog.NewLogsRestrictionQuery(ctx, "logsRestrictionQueryResource", &datadog.LogsRestrictionQueryArgs{
    	RestrictionQuery: pulumi.String("string"),
    	RoleIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var logsRestrictionQueryResource = new LogsRestrictionQuery("logsRestrictionQueryResource", LogsRestrictionQueryArgs.builder()
        .restrictionQuery("string")
        .roleIds("string")
        .build());
    
    logs_restriction_query_resource = datadog.LogsRestrictionQuery("logsRestrictionQueryResource",
        restriction_query="string",
        role_ids=["string"])
    
    const logsRestrictionQueryResource = new datadog.LogsRestrictionQuery("logsRestrictionQueryResource", {
        restrictionQuery: "string",
        roleIds: ["string"],
    });
    
    type: datadog:LogsRestrictionQuery
    properties:
        restrictionQuery: string
        roleIds:
            - string
    

    LogsRestrictionQuery 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 LogsRestrictionQuery resource accepts the following input properties:

    RestrictionQuery string
    The query that defines the restriction. Only the content matching the query can be returned.
    RoleIds List<string>
    An array of role IDs that have access to this restriction query.
    RestrictionQuery string
    The query that defines the restriction. Only the content matching the query can be returned.
    RoleIds []string
    An array of role IDs that have access to this restriction query.
    restrictionQuery String
    The query that defines the restriction. Only the content matching the query can be returned.
    roleIds List<String>
    An array of role IDs that have access to this restriction query.
    restrictionQuery string
    The query that defines the restriction. Only the content matching the query can be returned.
    roleIds string[]
    An array of role IDs that have access to this restriction query.
    restriction_query str
    The query that defines the restriction. Only the content matching the query can be returned.
    role_ids Sequence[str]
    An array of role IDs that have access to this restriction query.
    restrictionQuery String
    The query that defines the restriction. Only the content matching the query can be returned.
    roleIds List<String>
    An array of role IDs that have access to this restriction query.

    Outputs

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

    CreatedAt string
    Creation time of the restriction query (in ISO 8601).
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedAt string
    Time of last restriction query modification (in ISO 8601).
    CreatedAt string
    Creation time of the restriction query (in ISO 8601).
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedAt string
    Time of last restriction query modification (in ISO 8601).
    createdAt String
    Creation time of the restriction query (in ISO 8601).
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedAt String
    Time of last restriction query modification (in ISO 8601).
    createdAt string
    Creation time of the restriction query (in ISO 8601).
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedAt string
    Time of last restriction query modification (in ISO 8601).
    created_at str
    Creation time of the restriction query (in ISO 8601).
    id str
    The provider-assigned unique ID for this managed resource.
    modified_at str
    Time of last restriction query modification (in ISO 8601).
    createdAt String
    Creation time of the restriction query (in ISO 8601).
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedAt String
    Time of last restriction query modification (in ISO 8601).

    Look up Existing LogsRestrictionQuery Resource

    Get an existing LogsRestrictionQuery 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?: LogsRestrictionQueryState, opts?: CustomResourceOptions): LogsRestrictionQuery
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[str] = None,
            modified_at: Optional[str] = None,
            restriction_query: Optional[str] = None,
            role_ids: Optional[Sequence[str]] = None) -> LogsRestrictionQuery
    func GetLogsRestrictionQuery(ctx *Context, name string, id IDInput, state *LogsRestrictionQueryState, opts ...ResourceOption) (*LogsRestrictionQuery, error)
    public static LogsRestrictionQuery Get(string name, Input<string> id, LogsRestrictionQueryState? state, CustomResourceOptions? opts = null)
    public static LogsRestrictionQuery get(String name, Output<String> id, LogsRestrictionQueryState state, CustomResourceOptions options)
    resources:  _:    type: datadog:LogsRestrictionQuery    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:
    CreatedAt string
    Creation time of the restriction query (in ISO 8601).
    ModifiedAt string
    Time of last restriction query modification (in ISO 8601).
    RestrictionQuery string
    The query that defines the restriction. Only the content matching the query can be returned.
    RoleIds List<string>
    An array of role IDs that have access to this restriction query.
    CreatedAt string
    Creation time of the restriction query (in ISO 8601).
    ModifiedAt string
    Time of last restriction query modification (in ISO 8601).
    RestrictionQuery string
    The query that defines the restriction. Only the content matching the query can be returned.
    RoleIds []string
    An array of role IDs that have access to this restriction query.
    createdAt String
    Creation time of the restriction query (in ISO 8601).
    modifiedAt String
    Time of last restriction query modification (in ISO 8601).
    restrictionQuery String
    The query that defines the restriction. Only the content matching the query can be returned.
    roleIds List<String>
    An array of role IDs that have access to this restriction query.
    createdAt string
    Creation time of the restriction query (in ISO 8601).
    modifiedAt string
    Time of last restriction query modification (in ISO 8601).
    restrictionQuery string
    The query that defines the restriction. Only the content matching the query can be returned.
    roleIds string[]
    An array of role IDs that have access to this restriction query.
    created_at str
    Creation time of the restriction query (in ISO 8601).
    modified_at str
    Time of last restriction query modification (in ISO 8601).
    restriction_query str
    The query that defines the restriction. Only the content matching the query can be returned.
    role_ids Sequence[str]
    An array of role IDs that have access to this restriction query.
    createdAt String
    Creation time of the restriction query (in ISO 8601).
    modifiedAt String
    Time of last restriction query modification (in ISO 8601).
    restrictionQuery String
    The query that defines the restriction. Only the content matching the query can be returned.
    roleIds List<String>
    An array of role IDs that have access to this restriction query.

    Import

    The pulumi import command can be used, for example:

    $ pulumi import datadog:index/logsRestrictionQuery:LogsRestrictionQuery test_lrq "<restriction_query_id>"
    

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

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Datadog v4.61.0 published on Monday, Dec 22, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate