New Relic v5.12.0, May 30 23
New Relic v5.12.0, May 30 23
newrelic.NrqlDropRule
Explore with Pulumi AI
Import
New Relic NRQL drop rules can be imported using a concatenated string of the format
<account_id>:<rule_id>
, e.g. bash
$ pulumi import newrelic:index/nrqlDropRule:NrqlDropRule foo 12345:34567
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.NrqlDropRule("foo", new()
{
AccountId = 12345,
Action = "drop_data",
Description = "Drops all data for MyCustomEvent that comes from the LoadGeneratingApp in the dev environment, because there is too much and we don’t look at it.",
Nrql = "SELECT * FROM MyCustomEvent WHERE appName='LoadGeneratingApp' AND environment='development'",
});
var bar = new NewRelic.NrqlDropRule("bar", new()
{
AccountId = 12345,
Action = "drop_attributes",
Description = "Removes the user name and email fields from MyCustomEvent",
Nrql = "SELECT userEmail, userName FROM MyCustomEvent",
});
var baz = new NewRelic.NrqlDropRule("baz", new()
{
AccountId = 12345,
Action = "drop_attributes_from_metric_aggregates",
Description = "Removes containerId from metric aggregates to reduce metric cardinality.",
Nrql = "SELECT containerId FROM Metric",
});
});
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.NewNrqlDropRule(ctx, "foo", &newrelic.NrqlDropRuleArgs{
AccountId: pulumi.Int(12345),
Action: pulumi.String("drop_data"),
Description: pulumi.String("Drops all data for MyCustomEvent that comes from the LoadGeneratingApp in the dev environment, because there is too much and we don’t look at it."),
Nrql: pulumi.String("SELECT * FROM MyCustomEvent WHERE appName='LoadGeneratingApp' AND environment='development'"),
})
if err != nil {
return err
}
_, err = newrelic.NewNrqlDropRule(ctx, "bar", &newrelic.NrqlDropRuleArgs{
AccountId: pulumi.Int(12345),
Action: pulumi.String("drop_attributes"),
Description: pulumi.String("Removes the user name and email fields from MyCustomEvent"),
Nrql: pulumi.String("SELECT userEmail, userName FROM MyCustomEvent"),
})
if err != nil {
return err
}
_, err = newrelic.NewNrqlDropRule(ctx, "baz", &newrelic.NrqlDropRuleArgs{
AccountId: pulumi.Int(12345),
Action: pulumi.String("drop_attributes_from_metric_aggregates"),
Description: pulumi.String("Removes containerId from metric aggregates to reduce metric cardinality."),
Nrql: pulumi.String("SELECT containerId FROM Metric"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.NrqlDropRule;
import com.pulumi.newrelic.NrqlDropRuleArgs;
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 NrqlDropRule("foo", NrqlDropRuleArgs.builder()
.accountId(12345)
.action("drop_data")
.description("Drops all data for MyCustomEvent that comes from the LoadGeneratingApp in the dev environment, because there is too much and we don’t look at it.")
.nrql("SELECT * FROM MyCustomEvent WHERE appName='LoadGeneratingApp' AND environment='development'")
.build());
var bar = new NrqlDropRule("bar", NrqlDropRuleArgs.builder()
.accountId(12345)
.action("drop_attributes")
.description("Removes the user name and email fields from MyCustomEvent")
.nrql("SELECT userEmail, userName FROM MyCustomEvent")
.build());
var baz = new NrqlDropRule("baz", NrqlDropRuleArgs.builder()
.accountId(12345)
.action("drop_attributes_from_metric_aggregates")
.description("Removes containerId from metric aggregates to reduce metric cardinality.")
.nrql("SELECT containerId FROM Metric")
.build());
}
}
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.NrqlDropRule("foo",
account_id=12345,
action="drop_data",
description="Drops all data for MyCustomEvent that comes from the LoadGeneratingApp in the dev environment, because there is too much and we don’t look at it.",
nrql="SELECT * FROM MyCustomEvent WHERE appName='LoadGeneratingApp' AND environment='development'")
bar = newrelic.NrqlDropRule("bar",
account_id=12345,
action="drop_attributes",
description="Removes the user name and email fields from MyCustomEvent",
nrql="SELECT userEmail, userName FROM MyCustomEvent")
baz = newrelic.NrqlDropRule("baz",
account_id=12345,
action="drop_attributes_from_metric_aggregates",
description="Removes containerId from metric aggregates to reduce metric cardinality.",
nrql="SELECT containerId FROM Metric")
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.NrqlDropRule("foo", {
accountId: 12345,
action: "drop_data",
description: "Drops all data for MyCustomEvent that comes from the LoadGeneratingApp in the dev environment, because there is too much and we don’t look at it.",
nrql: "SELECT * FROM MyCustomEvent WHERE appName='LoadGeneratingApp' AND environment='development'",
});
const bar = new newrelic.NrqlDropRule("bar", {
accountId: 12345,
action: "drop_attributes",
description: "Removes the user name and email fields from MyCustomEvent",
nrql: "SELECT userEmail, userName FROM MyCustomEvent",
});
const baz = new newrelic.NrqlDropRule("baz", {
accountId: 12345,
action: "drop_attributes_from_metric_aggregates",
description: "Removes containerId from metric aggregates to reduce metric cardinality.",
nrql: "SELECT containerId FROM Metric",
});
resources:
foo:
type: newrelic:NrqlDropRule
properties:
accountId: 12345
action: drop_data
description: Drops all data for MyCustomEvent that comes from the LoadGeneratingApp in the dev environment, because there is too much and we don’t look at it.
nrql: SELECT * FROM MyCustomEvent WHERE appName='LoadGeneratingApp' AND environment='development'
bar:
type: newrelic:NrqlDropRule
properties:
accountId: 12345
action: drop_attributes
description: Removes the user name and email fields from MyCustomEvent
nrql: SELECT userEmail, userName FROM MyCustomEvent
baz:
type: newrelic:NrqlDropRule
properties:
accountId: 12345
action: drop_attributes_from_metric_aggregates
description: Removes containerId from metric aggregates to reduce metric cardinality.
nrql: SELECT containerId FROM Metric
Create NrqlDropRule Resource
new NrqlDropRule(name: string, args: NrqlDropRuleArgs, opts?: CustomResourceOptions);
@overload
def NrqlDropRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[int] = None,
action: Optional[str] = None,
description: Optional[str] = None,
nrql: Optional[str] = None)
@overload
def NrqlDropRule(resource_name: str,
args: NrqlDropRuleArgs,
opts: Optional[ResourceOptions] = None)
func NewNrqlDropRule(ctx *Context, name string, args NrqlDropRuleArgs, opts ...ResourceOption) (*NrqlDropRule, error)
public NrqlDropRule(string name, NrqlDropRuleArgs args, CustomResourceOptions? opts = null)
public NrqlDropRule(String name, NrqlDropRuleArgs args)
public NrqlDropRule(String name, NrqlDropRuleArgs args, CustomResourceOptions options)
type: newrelic:NrqlDropRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NrqlDropRuleArgs
- 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 NrqlDropRuleArgs
- 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 NrqlDropRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args NrqlDropRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args NrqlDropRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
NrqlDropRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The NrqlDropRule resource accepts the following input properties:
- Action string
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- Nrql string
A NRQL string that specifies what data types to drop.
- Account
Id int Account where the drop rule will be put. Defaults to the account associated with the API key used.
- Description string
The description of the drop rule.
- Action string
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- Nrql string
A NRQL string that specifies what data types to drop.
- Account
Id int Account where the drop rule will be put. Defaults to the account associated with the API key used.
- Description string
The description of the drop rule.
- action String
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- nrql String
A NRQL string that specifies what data types to drop.
- account
Id Integer Account where the drop rule will be put. Defaults to the account associated with the API key used.
- description String
The description of the drop rule.
- action string
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- nrql string
A NRQL string that specifies what data types to drop.
- account
Id number Account where the drop rule will be put. Defaults to the account associated with the API key used.
- description string
The description of the drop rule.
- action str
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- nrql str
A NRQL string that specifies what data types to drop.
- account_
id int Account where the drop rule will be put. Defaults to the account associated with the API key used.
- description str
The description of the drop rule.
- action String
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- nrql String
A NRQL string that specifies what data types to drop.
- account
Id Number Account where the drop rule will be put. Defaults to the account associated with the API key used.
- description String
The description of the drop rule.
Outputs
All input properties are implicitly available as output properties. Additionally, the NrqlDropRule resource produces the following output properties:
Look up Existing NrqlDropRule Resource
Get an existing NrqlDropRule 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?: NrqlDropRuleState, opts?: CustomResourceOptions): NrqlDropRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[int] = None,
action: Optional[str] = None,
description: Optional[str] = None,
nrql: Optional[str] = None,
rule_id: Optional[str] = None) -> NrqlDropRule
func GetNrqlDropRule(ctx *Context, name string, id IDInput, state *NrqlDropRuleState, opts ...ResourceOption) (*NrqlDropRule, error)
public static NrqlDropRule Get(string name, Input<string> id, NrqlDropRuleState? state, CustomResourceOptions? opts = null)
public static NrqlDropRule get(String name, Output<String> id, NrqlDropRuleState 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.
- Account
Id int Account where the drop rule will be put. Defaults to the account associated with the API key used.
- Action string
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- Description string
The description of the drop rule.
- Nrql string
A NRQL string that specifies what data types to drop.
- Rule
Id string The id, uniquely identifying the rule.
- Account
Id int Account where the drop rule will be put. Defaults to the account associated with the API key used.
- Action string
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- Description string
The description of the drop rule.
- Nrql string
A NRQL string that specifies what data types to drop.
- Rule
Id string The id, uniquely identifying the rule.
- account
Id Integer Account where the drop rule will be put. Defaults to the account associated with the API key used.
- action String
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- description String
The description of the drop rule.
- nrql String
A NRQL string that specifies what data types to drop.
- rule
Id String The id, uniquely identifying the rule.
- account
Id number Account where the drop rule will be put. Defaults to the account associated with the API key used.
- action string
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- description string
The description of the drop rule.
- nrql string
A NRQL string that specifies what data types to drop.
- rule
Id string The id, uniquely identifying the rule.
- account_
id int Account where the drop rule will be put. Defaults to the account associated with the API key used.
- action str
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- description str
The description of the drop rule.
- nrql str
A NRQL string that specifies what data types to drop.
- rule_
id str The id, uniquely identifying the rule.
- account
Id Number Account where the drop rule will be put. Defaults to the account associated with the API key used.
- action String
An action type specifying how to apply the NRQL string (either
drop_data
,drop_attributes
, ordrop_attributes_from_metric_aggregates
).- description String
The description of the drop rule.
- nrql String
A NRQL string that specifies what data types to drop.
- rule
Id String The id, uniquely identifying the rule.
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
newrelic
Terraform Provider.