1. Packages
  2. New Relic
  3. API Docs
  4. DataPartitionRule
New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi

newrelic.DataPartitionRule

Explore with Pulumi AI

newrelic logo
New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi

    Use this resource to create, update and delete New Relic Data partition rule.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as newrelic from "@pulumi/newrelic";
    
    const foo = new newrelic.DataPartitionRule("foo", {
        description: "description",
        enabled: true,
        nrql: "logtype='node'",
        retentionPolicy: "STANDARD",
        targetDataPartition: "Log_name",
    });
    
    import pulumi
    import pulumi_newrelic as newrelic
    
    foo = newrelic.DataPartitionRule("foo",
        description="description",
        enabled=True,
        nrql="logtype='node'",
        retention_policy="STANDARD",
        target_data_partition="Log_name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := newrelic.NewDataPartitionRule(ctx, "foo", &newrelic.DataPartitionRuleArgs{
    			Description:         pulumi.String("description"),
    			Enabled:             pulumi.Bool(true),
    			Nrql:                pulumi.String("logtype='node'"),
    			RetentionPolicy:     pulumi.String("STANDARD"),
    			TargetDataPartition: pulumi.String("Log_name"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using NewRelic = Pulumi.NewRelic;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new NewRelic.DataPartitionRule("foo", new()
        {
            Description = "description",
            Enabled = true,
            Nrql = "logtype='node'",
            RetentionPolicy = "STANDARD",
            TargetDataPartition = "Log_name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.DataPartitionRule;
    import com.pulumi.newrelic.DataPartitionRuleArgs;
    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 foo = new DataPartitionRule("foo", DataPartitionRuleArgs.builder()
                .description("description")
                .enabled(true)
                .nrql("logtype='node'")
                .retentionPolicy("STANDARD")
                .targetDataPartition("Log_name")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: newrelic:DataPartitionRule
        properties:
          description: description
          enabled: true
          nrql: logtype='node'
          retentionPolicy: STANDARD
          targetDataPartition: Log_name
    

    Additional Information

    More details about the data partition can be found here

    Create DataPartitionRule Resource

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

    Constructor syntax

    new DataPartitionRule(name: string, args: DataPartitionRuleArgs, opts?: CustomResourceOptions);
    @overload
    def DataPartitionRule(resource_name: str,
                          args: DataPartitionRuleArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def DataPartitionRule(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          enabled: Optional[bool] = None,
                          nrql: Optional[str] = None,
                          retention_policy: Optional[str] = None,
                          target_data_partition: Optional[str] = None,
                          account_id: Optional[str] = None,
                          description: Optional[str] = None)
    func NewDataPartitionRule(ctx *Context, name string, args DataPartitionRuleArgs, opts ...ResourceOption) (*DataPartitionRule, error)
    public DataPartitionRule(string name, DataPartitionRuleArgs args, CustomResourceOptions? opts = null)
    public DataPartitionRule(String name, DataPartitionRuleArgs args)
    public DataPartitionRule(String name, DataPartitionRuleArgs args, CustomResourceOptions options)
    
    type: newrelic:DataPartitionRule
    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 DataPartitionRuleArgs
    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 DataPartitionRuleArgs
    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 DataPartitionRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DataPartitionRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DataPartitionRuleArgs
    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 dataPartitionRuleResource = new NewRelic.DataPartitionRule("dataPartitionRuleResource", new()
    {
        Enabled = false,
        Nrql = "string",
        RetentionPolicy = "string",
        TargetDataPartition = "string",
        AccountId = "string",
        Description = "string",
    });
    
    example, err := newrelic.NewDataPartitionRule(ctx, "dataPartitionRuleResource", &newrelic.DataPartitionRuleArgs{
    	Enabled:             pulumi.Bool(false),
    	Nrql:                pulumi.String("string"),
    	RetentionPolicy:     pulumi.String("string"),
    	TargetDataPartition: pulumi.String("string"),
    	AccountId:           pulumi.String("string"),
    	Description:         pulumi.String("string"),
    })
    
    var dataPartitionRuleResource = new DataPartitionRule("dataPartitionRuleResource", DataPartitionRuleArgs.builder()
        .enabled(false)
        .nrql("string")
        .retentionPolicy("string")
        .targetDataPartition("string")
        .accountId("string")
        .description("string")
        .build());
    
    data_partition_rule_resource = newrelic.DataPartitionRule("dataPartitionRuleResource",
        enabled=False,
        nrql="string",
        retention_policy="string",
        target_data_partition="string",
        account_id="string",
        description="string")
    
    const dataPartitionRuleResource = new newrelic.DataPartitionRule("dataPartitionRuleResource", {
        enabled: false,
        nrql: "string",
        retentionPolicy: "string",
        targetDataPartition: "string",
        accountId: "string",
        description: "string",
    });
    
    type: newrelic:DataPartitionRule
    properties:
        accountId: string
        description: string
        enabled: false
        nrql: string
        retentionPolicy: string
        targetDataPartition: string
    

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

    Enabled bool
    Whether or not this data partition rule is enabled.
    Nrql string
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    RetentionPolicy string
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    TargetDataPartition string
    The name of the data partition where logs will be allocated once the rule is enabled.
    AccountId string
    The account id associated with the data partition rule.
    Description string
    The description of the data partition rule.
    Enabled bool
    Whether or not this data partition rule is enabled.
    Nrql string
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    RetentionPolicy string
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    TargetDataPartition string
    The name of the data partition where logs will be allocated once the rule is enabled.
    AccountId string
    The account id associated with the data partition rule.
    Description string
    The description of the data partition rule.
    enabled Boolean
    Whether or not this data partition rule is enabled.
    nrql String
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    retentionPolicy String
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    targetDataPartition String
    The name of the data partition where logs will be allocated once the rule is enabled.
    accountId String
    The account id associated with the data partition rule.
    description String
    The description of the data partition rule.
    enabled boolean
    Whether or not this data partition rule is enabled.
    nrql string
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    retentionPolicy string
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    targetDataPartition string
    The name of the data partition where logs will be allocated once the rule is enabled.
    accountId string
    The account id associated with the data partition rule.
    description string
    The description of the data partition rule.
    enabled bool
    Whether or not this data partition rule is enabled.
    nrql str
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    retention_policy str
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    target_data_partition str
    The name of the data partition where logs will be allocated once the rule is enabled.
    account_id str
    The account id associated with the data partition rule.
    description str
    The description of the data partition rule.
    enabled Boolean
    Whether or not this data partition rule is enabled.
    nrql String
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    retentionPolicy String
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    targetDataPartition String
    The name of the data partition where logs will be allocated once the rule is enabled.
    accountId String
    The account id associated with the data partition rule.
    description String
    The description of the data partition rule.

    Outputs

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

    Deleted bool
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    Id string
    The provider-assigned unique ID for this managed resource.
    Deleted bool
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    Id string
    The provider-assigned unique ID for this managed resource.
    deleted Boolean
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    id String
    The provider-assigned unique ID for this managed resource.
    deleted boolean
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    id string
    The provider-assigned unique ID for this managed resource.
    deleted bool
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    id str
    The provider-assigned unique ID for this managed resource.
    deleted Boolean
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing DataPartitionRule Resource

    Get an existing DataPartitionRule 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?: DataPartitionRuleState, opts?: CustomResourceOptions): DataPartitionRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            deleted: Optional[bool] = None,
            description: Optional[str] = None,
            enabled: Optional[bool] = None,
            nrql: Optional[str] = None,
            retention_policy: Optional[str] = None,
            target_data_partition: Optional[str] = None) -> DataPartitionRule
    func GetDataPartitionRule(ctx *Context, name string, id IDInput, state *DataPartitionRuleState, opts ...ResourceOption) (*DataPartitionRule, error)
    public static DataPartitionRule Get(string name, Input<string> id, DataPartitionRuleState? state, CustomResourceOptions? opts = null)
    public static DataPartitionRule get(String name, Output<String> id, DataPartitionRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    AccountId string
    The account id associated with the data partition rule.
    Deleted bool
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    Description string
    The description of the data partition rule.
    Enabled bool
    Whether or not this data partition rule is enabled.
    Nrql string
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    RetentionPolicy string
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    TargetDataPartition string
    The name of the data partition where logs will be allocated once the rule is enabled.
    AccountId string
    The account id associated with the data partition rule.
    Deleted bool
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    Description string
    The description of the data partition rule.
    Enabled bool
    Whether or not this data partition rule is enabled.
    Nrql string
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    RetentionPolicy string
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    TargetDataPartition string
    The name of the data partition where logs will be allocated once the rule is enabled.
    accountId String
    The account id associated with the data partition rule.
    deleted Boolean
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    description String
    The description of the data partition rule.
    enabled Boolean
    Whether or not this data partition rule is enabled.
    nrql String
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    retentionPolicy String
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    targetDataPartition String
    The name of the data partition where logs will be allocated once the rule is enabled.
    accountId string
    The account id associated with the data partition rule.
    deleted boolean
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    description string
    The description of the data partition rule.
    enabled boolean
    Whether or not this data partition rule is enabled.
    nrql string
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    retentionPolicy string
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    targetDataPartition string
    The name of the data partition where logs will be allocated once the rule is enabled.
    account_id str
    The account id associated with the data partition rule.
    deleted bool
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    description str
    The description of the data partition rule.
    enabled bool
    Whether or not this data partition rule is enabled.
    nrql str
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    retention_policy str
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    target_data_partition str
    The name of the data partition where logs will be allocated once the rule is enabled.
    accountId String
    The account id associated with the data partition rule.
    deleted Boolean
    Whether or not this data partition rule is deleted. Deleting a data partition rule does not delete the already persisted data. This data will be retained for a given period of time specified in the retention policy field.
    description String
    The description of the data partition rule.
    enabled Boolean
    Whether or not this data partition rule is enabled.
    nrql String
    The NRQL to match events for this data partition rule. Logs matching this criteria will be routed to the specified data partition.
    retentionPolicy String
    The retention policy of the data partition data. Valid values are SECONDARY and STANDARD.
    targetDataPartition String
    The name of the data partition where logs will be allocated once the rule is enabled.

    Import

    New Relic data partition rule can be imported using the rule ID, e.g.

    bash

    $ pulumi import newrelic:index/dataPartitionRule:DataPartitionRule foo <id>
    

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

    Package Details

    Repository
    New Relic pulumi/pulumi-newrelic
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the newrelic Terraform Provider.
    newrelic logo
    New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi