newrelic.EventsToMetricsRule

Use this resource to create, update, and delete New Relic Events to Metrics rules.

Example Usage

using System.Collections.Generic;
using Pulumi;
using NewRelic = Pulumi.NewRelic;

return await Deployment.RunAsync(() => 
{
    var foo = new NewRelic.EventsToMetricsRule("foo", new()
    {
        AccountId = 12345,
        Description = "Example description",
        Nrql = "SELECT uniqueCount(account_id) AS ``Transaction.account_id`` FROM Transaction FACET appName, 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.NewEventsToMetricsRule(ctx, "foo", &newrelic.EventsToMetricsRuleArgs{
			AccountId:   pulumi.Int(12345),
			Description: pulumi.String("Example description"),
			Nrql:        pulumi.String("SELECT uniqueCount(account_id) AS ``Transaction.account_id`` FROM Transaction FACET appName, name"),
		})
		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.EventsToMetricsRule;
import com.pulumi.newrelic.EventsToMetricsRuleArgs;
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 EventsToMetricsRule("foo", EventsToMetricsRuleArgs.builder()        
            .accountId(12345)
            .description("Example description")
            .nrql("SELECT uniqueCount(account_id) AS ``Transaction.account_id`` FROM Transaction FACET appName, name")
            .build());

    }
}
import pulumi
import pulumi_newrelic as newrelic

foo = newrelic.EventsToMetricsRule("foo",
    account_id=12345,
    description="Example description",
    nrql="SELECT uniqueCount(account_id) AS ``Transaction.account_id`` FROM Transaction FACET appName, name")
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const foo = new newrelic.EventsToMetricsRule("foo", {
    accountId: 12345,
    description: "Example description",
    nrql: "SELECT uniqueCount(account_id) AS ``Transaction.account_id`` FROM Transaction FACET appName, name",
});
resources:
  foo:
    type: newrelic:EventsToMetricsRule
    properties:
      accountId: 12345
      description: Example description
      nrql: SELECT uniqueCount(account_id) AS ``Transaction.account_id`` FROM Transaction FACET appName, name

Create EventsToMetricsRule Resource

new EventsToMetricsRule(name: string, args: EventsToMetricsRuleArgs, opts?: CustomResourceOptions);
@overload
def EventsToMetricsRule(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        account_id: Optional[int] = None,
                        description: Optional[str] = None,
                        enabled: Optional[bool] = None,
                        name: Optional[str] = None,
                        nrql: Optional[str] = None)
@overload
def EventsToMetricsRule(resource_name: str,
                        args: EventsToMetricsRuleArgs,
                        opts: Optional[ResourceOptions] = None)
func NewEventsToMetricsRule(ctx *Context, name string, args EventsToMetricsRuleArgs, opts ...ResourceOption) (*EventsToMetricsRule, error)
public EventsToMetricsRule(string name, EventsToMetricsRuleArgs args, CustomResourceOptions? opts = null)
public EventsToMetricsRule(String name, EventsToMetricsRuleArgs args)
public EventsToMetricsRule(String name, EventsToMetricsRuleArgs args, CustomResourceOptions options)
type: newrelic:EventsToMetricsRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args EventsToMetricsRuleArgs
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 EventsToMetricsRuleArgs
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 EventsToMetricsRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EventsToMetricsRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args EventsToMetricsRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

Nrql string

Explains how to create metrics from events.

AccountId int

Account with the event and where the metrics will be put.

Description string

Provides additional information about the rule.

Enabled bool

True means this rule is enabled. False means the rule is currently not creating metrics.

Name string

The name of the rule. This must be unique within an account.

Nrql string

Explains how to create metrics from events.

AccountId int

Account with the event and where the metrics will be put.

Description string

Provides additional information about the rule.

Enabled bool

True means this rule is enabled. False means the rule is currently not creating metrics.

Name string

The name of the rule. This must be unique within an account.

nrql String

Explains how to create metrics from events.

accountId Integer

Account with the event and where the metrics will be put.

description String

Provides additional information about the rule.

enabled Boolean

True means this rule is enabled. False means the rule is currently not creating metrics.

name String

The name of the rule. This must be unique within an account.

nrql string

Explains how to create metrics from events.

accountId number

Account with the event and where the metrics will be put.

description string

Provides additional information about the rule.

enabled boolean

True means this rule is enabled. False means the rule is currently not creating metrics.

name string

The name of the rule. This must be unique within an account.

nrql str

Explains how to create metrics from events.

account_id int

Account with the event and where the metrics will be put.

description str

Provides additional information about the rule.

enabled bool

True means this rule is enabled. False means the rule is currently not creating metrics.

name str

The name of the rule. This must be unique within an account.

nrql String

Explains how to create metrics from events.

accountId Number

Account with the event and where the metrics will be put.

description String

Provides additional information about the rule.

enabled Boolean

True means this rule is enabled. False means the rule is currently not creating metrics.

name String

The name of the rule. This must be unique within an account.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

RuleId string

The id, uniquely identifying the rule.

Id string

The provider-assigned unique ID for this managed resource.

RuleId string

The id, uniquely identifying the rule.

id String

The provider-assigned unique ID for this managed resource.

ruleId String

The id, uniquely identifying the rule.

id string

The provider-assigned unique ID for this managed resource.

ruleId string

The id, uniquely identifying the rule.

id str

The provider-assigned unique ID for this managed resource.

rule_id str

The id, uniquely identifying the rule.

id String

The provider-assigned unique ID for this managed resource.

ruleId String

The id, uniquely identifying the rule.

Look up Existing EventsToMetricsRule Resource

Get an existing EventsToMetricsRule 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?: EventsToMetricsRuleState, opts?: CustomResourceOptions): EventsToMetricsRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[int] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        name: Optional[str] = None,
        nrql: Optional[str] = None,
        rule_id: Optional[str] = None) -> EventsToMetricsRule
func GetEventsToMetricsRule(ctx *Context, name string, id IDInput, state *EventsToMetricsRuleState, opts ...ResourceOption) (*EventsToMetricsRule, error)
public static EventsToMetricsRule Get(string name, Input<string> id, EventsToMetricsRuleState? state, CustomResourceOptions? opts = null)
public static EventsToMetricsRule get(String name, Output<String> id, EventsToMetricsRuleState 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 int

Account with the event and where the metrics will be put.

Description string

Provides additional information about the rule.

Enabled bool

True means this rule is enabled. False means the rule is currently not creating metrics.

Name string

The name of the rule. This must be unique within an account.

Nrql string

Explains how to create metrics from events.

RuleId string

The id, uniquely identifying the rule.

AccountId int

Account with the event and where the metrics will be put.

Description string

Provides additional information about the rule.

Enabled bool

True means this rule is enabled. False means the rule is currently not creating metrics.

Name string

The name of the rule. This must be unique within an account.

Nrql string

Explains how to create metrics from events.

RuleId string

The id, uniquely identifying the rule.

accountId Integer

Account with the event and where the metrics will be put.

description String

Provides additional information about the rule.

enabled Boolean

True means this rule is enabled. False means the rule is currently not creating metrics.

name String

The name of the rule. This must be unique within an account.

nrql String

Explains how to create metrics from events.

ruleId String

The id, uniquely identifying the rule.

accountId number

Account with the event and where the metrics will be put.

description string

Provides additional information about the rule.

enabled boolean

True means this rule is enabled. False means the rule is currently not creating metrics.

name string

The name of the rule. This must be unique within an account.

nrql string

Explains how to create metrics from events.

ruleId string

The id, uniquely identifying the rule.

account_id int

Account with the event and where the metrics will be put.

description str

Provides additional information about the rule.

enabled bool

True means this rule is enabled. False means the rule is currently not creating metrics.

name str

The name of the rule. This must be unique within an account.

nrql str

Explains how to create metrics from events.

rule_id str

The id, uniquely identifying the rule.

accountId Number

Account with the event and where the metrics will be put.

description String

Provides additional information about the rule.

enabled Boolean

True means this rule is enabled. False means the rule is currently not creating metrics.

name String

The name of the rule. This must be unique within an account.

nrql String

Explains how to create metrics from events.

ruleId String

The id, uniquely identifying the rule.

Import

New Relic Events to Metrics rules can be imported using a concatenated string of the format

<account_id>:<rule_id>, e.g. bash

 $ pulumi import newrelic:index/eventsToMetricsRule:EventsToMetricsRule foo 12345:34567

Package Details

Repository
New Relic pulumi/pulumi-newrelic
License
Apache-2.0
Notes

This Pulumi package is based on the newrelic Terraform Provider.