1. Packages
  2. Newrelic Provider
  3. API Docs
  4. insights
  5. Event
New Relic v5.44.0 published on Saturday, Mar 29, 2025 by Pulumi

newrelic.insights.Event

Explore with Pulumi AI

Use this resource to create one or more Insights events.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const foo = new newrelic.insights.Event("foo", {events: [{
    type: "MyEvent",
    timestamp: 1232471100,
    attributes: [
        {
            key: "a_string_attribute",
            value: "a string",
        },
        {
            key: "an_integer_attribute",
            value: "42",
            type: "int",
        },
        {
            key: "a_float_attribute",
            value: "101.1",
            type: "float",
        },
    ],
}]});
Copy
import pulumi
import pulumi_newrelic as newrelic

foo = newrelic.insights.Event("foo", events=[{
    "type": "MyEvent",
    "timestamp": 1232471100,
    "attributes": [
        {
            "key": "a_string_attribute",
            "value": "a string",
        },
        {
            "key": "an_integer_attribute",
            "value": "42",
            "type": "int",
        },
        {
            "key": "a_float_attribute",
            "value": "101.1",
            "type": "float",
        },
    ],
}])
Copy
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic/insights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewEvent(ctx, "foo", &insights.EventArgs{
			Events: insights.EventEventArray{
				&insights.EventEventArgs{
					Type:      pulumi.String("MyEvent"),
					Timestamp: pulumi.Int(1232471100),
					Attributes: insights.EventEventAttributeArray{
						&insights.EventEventAttributeArgs{
							Key:   pulumi.String("a_string_attribute"),
							Value: pulumi.String("a string"),
						},
						&insights.EventEventAttributeArgs{
							Key:   pulumi.String("an_integer_attribute"),
							Value: pulumi.String("42"),
							Type:  pulumi.String("int"),
						},
						&insights.EventEventAttributeArgs{
							Key:   pulumi.String("a_float_attribute"),
							Value: pulumi.String("101.1"),
							Type:  pulumi.String("float"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;

return await Deployment.RunAsync(() => 
{
    var foo = new NewRelic.Insights.Event("foo", new()
    {
        Events = new[]
        {
            new NewRelic.Insights.Inputs.EventEventArgs
            {
                Type = "MyEvent",
                Timestamp = 1232471100,
                Attributes = new[]
                {
                    new NewRelic.Insights.Inputs.EventEventAttributeArgs
                    {
                        Key = "a_string_attribute",
                        Value = "a string",
                    },
                    new NewRelic.Insights.Inputs.EventEventAttributeArgs
                    {
                        Key = "an_integer_attribute",
                        Value = "42",
                        Type = "int",
                    },
                    new NewRelic.Insights.Inputs.EventEventAttributeArgs
                    {
                        Key = "a_float_attribute",
                        Value = "101.1",
                        Type = "float",
                    },
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.insights.Event;
import com.pulumi.newrelic.insights.EventArgs;
import com.pulumi.newrelic.insights.inputs.EventEventArgs;
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 Event("foo", EventArgs.builder()
            .events(EventEventArgs.builder()
                .type("MyEvent")
                .timestamp(1232471100)
                .attributes(                
                    EventEventAttributeArgs.builder()
                        .key("a_string_attribute")
                        .value("a string")
                        .build(),
                    EventEventAttributeArgs.builder()
                        .key("an_integer_attribute")
                        .value(42)
                        .type("int")
                        .build(),
                    EventEventAttributeArgs.builder()
                        .key("a_float_attribute")
                        .value(101.1)
                        .type("float")
                        .build())
                .build())
            .build());

    }
}
Copy
resources:
  foo:
    type: newrelic:insights:Event
    properties:
      events:
        - type: MyEvent
          timestamp: 1.2324711e+09
          attributes:
            - key: a_string_attribute
              value: a string
            - key: an_integer_attribute
              value: 42
              type: int
            - key: a_float_attribute
              value: 101.1
              type: float
Copy

Events

The event mapping supports the following arguments:

  • type - (Required) The event’s name. Can be a combination of alphanumeric characters, underscores, and colons.
  • timestamp - (Optional) Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds.
  • attribute - (Required) An attribute to include in your event payload. Multiple attribute blocks can be defined for an event. See Attributes below for details.

Attributes

The attribute mapping supports the following arguments:

  • key - (Required) The name of the attribute.
  • value - (Required) The value of the attribute.
  • type - (Optional) Specify the type for the attribute value. This is useful when passing integer or float values to Insights. Allowed values are string, int, or float. Defaults to string.

Create Event Resource

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

Constructor syntax

new Event(name: string, args: EventArgs, opts?: CustomResourceOptions);
@overload
def Event(resource_name: str,
          args: EventArgs,
          opts: Optional[ResourceOptions] = None)

@overload
def Event(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          events: Optional[Sequence[EventEventArgs]] = None)
func NewEvent(ctx *Context, name string, args EventArgs, opts ...ResourceOption) (*Event, error)
public Event(string name, EventArgs args, CustomResourceOptions? opts = null)
public Event(String name, EventArgs args)
public Event(String name, EventArgs args, CustomResourceOptions options)
type: newrelic:insights:Event
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. EventArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. EventArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. EventArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. EventArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. EventArgs
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 eventResource = new NewRelic.Insights.Event("eventResource", new()
{
    Events = new[]
    {
        new NewRelic.Insights.Inputs.EventEventArgs
        {
            Attributes = new[]
            {
                new NewRelic.Insights.Inputs.EventEventAttributeArgs
                {
                    Key = "string",
                    Value = "string",
                    Type = "string",
                },
            },
            Type = "string",
            Timestamp = 0,
        },
    },
});
Copy
example, err := insights.NewEvent(ctx, "eventResource", &insights.EventArgs{
	Events: insights.EventEventArray{
		&insights.EventEventArgs{
			Attributes: insights.EventEventAttributeArray{
				&insights.EventEventAttributeArgs{
					Key:   pulumi.String("string"),
					Value: pulumi.String("string"),
					Type:  pulumi.String("string"),
				},
			},
			Type:      pulumi.String("string"),
			Timestamp: pulumi.Int(0),
		},
	},
})
Copy
var eventResource = new Event("eventResource", EventArgs.builder()
    .events(EventEventArgs.builder()
        .attributes(EventEventAttributeArgs.builder()
            .key("string")
            .value("string")
            .type("string")
            .build())
        .type("string")
        .timestamp(0)
        .build())
    .build());
Copy
event_resource = newrelic.insights.Event("eventResource", events=[{
    "attributes": [{
        "key": "string",
        "value": "string",
        "type": "string",
    }],
    "type": "string",
    "timestamp": 0,
}])
Copy
const eventResource = new newrelic.insights.Event("eventResource", {events: [{
    attributes: [{
        key: "string",
        value: "string",
        type: "string",
    }],
    type: "string",
    timestamp: 0,
}]});
Copy
type: newrelic:insights:Event
properties:
    events:
        - attributes:
            - key: string
              type: string
              value: string
          timestamp: 0
          type: string
Copy

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

Events
This property is required.
Changes to this property will trigger replacement.
List<Pulumi.NewRelic.Insights.Inputs.EventEvent>
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
Events
This property is required.
Changes to this property will trigger replacement.
[]EventEventArgs
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
events
This property is required.
Changes to this property will trigger replacement.
List<EventEvent>
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
events
This property is required.
Changes to this property will trigger replacement.
EventEvent[]
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
events
This property is required.
Changes to this property will trigger replacement.
Sequence[EventEventArgs]
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
events
This property is required.
Changes to this property will trigger replacement.
List<Property Map>
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Event Resource

Get an existing Event 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?: EventState, opts?: CustomResourceOptions): Event
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        events: Optional[Sequence[EventEventArgs]] = None) -> Event
func GetEvent(ctx *Context, name string, id IDInput, state *EventState, opts ...ResourceOption) (*Event, error)
public static Event Get(string name, Input<string> id, EventState? state, CustomResourceOptions? opts = null)
public static Event get(String name, Output<String> id, EventState state, CustomResourceOptions options)
resources:  _:    type: newrelic:insights:Event    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Events Changes to this property will trigger replacement. List<Pulumi.NewRelic.Insights.Inputs.EventEvent>
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
Events Changes to this property will trigger replacement. []EventEventArgs
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
events Changes to this property will trigger replacement. List<EventEvent>
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
events Changes to this property will trigger replacement. EventEvent[]
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
events Changes to this property will trigger replacement. Sequence[EventEventArgs]
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.
events Changes to this property will trigger replacement. List<Property Map>
An event to insert into Insights. Multiple event blocks can be defined. See Events below for details.

Supporting Types

EventEvent
, EventEventArgs

Attributes
This property is required.
Changes to this property will trigger replacement.
List<Pulumi.NewRelic.Insights.Inputs.EventEventAttribute>
An attribute to include in your event payload. Multiple attribute blocks can be defined for an event.
Type
This property is required.
Changes to this property will trigger replacement.
string
The event's name. Can be a combination of alphanumeric characters, underscores, and colons.
Timestamp Changes to this property will trigger replacement. int
Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds.
Attributes
This property is required.
Changes to this property will trigger replacement.
[]EventEventAttribute
An attribute to include in your event payload. Multiple attribute blocks can be defined for an event.
Type
This property is required.
Changes to this property will trigger replacement.
string
The event's name. Can be a combination of alphanumeric characters, underscores, and colons.
Timestamp Changes to this property will trigger replacement. int
Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds.
attributes
This property is required.
Changes to this property will trigger replacement.
List<EventEventAttribute>
An attribute to include in your event payload. Multiple attribute blocks can be defined for an event.
type
This property is required.
Changes to this property will trigger replacement.
String
The event's name. Can be a combination of alphanumeric characters, underscores, and colons.
timestamp Changes to this property will trigger replacement. Integer
Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds.
attributes
This property is required.
Changes to this property will trigger replacement.
EventEventAttribute[]
An attribute to include in your event payload. Multiple attribute blocks can be defined for an event.
type
This property is required.
Changes to this property will trigger replacement.
string
The event's name. Can be a combination of alphanumeric characters, underscores, and colons.
timestamp Changes to this property will trigger replacement. number
Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds.
attributes
This property is required.
Changes to this property will trigger replacement.
Sequence[EventEventAttribute]
An attribute to include in your event payload. Multiple attribute blocks can be defined for an event.
type
This property is required.
Changes to this property will trigger replacement.
str
The event's name. Can be a combination of alphanumeric characters, underscores, and colons.
timestamp Changes to this property will trigger replacement. int
Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds.
attributes
This property is required.
Changes to this property will trigger replacement.
List<Property Map>
An attribute to include in your event payload. Multiple attribute blocks can be defined for an event.
type
This property is required.
Changes to this property will trigger replacement.
String
The event's name. Can be a combination of alphanumeric characters, underscores, and colons.
timestamp Changes to this property will trigger replacement. Number
Must be a Unix epoch timestamp. You can define timestamps either in seconds or in milliseconds.

EventEventAttribute
, EventEventAttributeArgs

Key
This property is required.
Changes to this property will trigger replacement.
string
The name of the attribute.
Value
This property is required.
Changes to this property will trigger replacement.
string
The value of the attribute.
Type Changes to this property will trigger replacement. string
Specify the type for the attribute value. This is useful when passing integer or float values to Insights. Allowed values are string, int, or float. Defaults to string.
Key
This property is required.
Changes to this property will trigger replacement.
string
The name of the attribute.
Value
This property is required.
Changes to this property will trigger replacement.
string
The value of the attribute.
Type Changes to this property will trigger replacement. string
Specify the type for the attribute value. This is useful when passing integer or float values to Insights. Allowed values are string, int, or float. Defaults to string.
key
This property is required.
Changes to this property will trigger replacement.
String
The name of the attribute.
value
This property is required.
Changes to this property will trigger replacement.
String
The value of the attribute.
type Changes to this property will trigger replacement. String
Specify the type for the attribute value. This is useful when passing integer or float values to Insights. Allowed values are string, int, or float. Defaults to string.
key
This property is required.
Changes to this property will trigger replacement.
string
The name of the attribute.
value
This property is required.
Changes to this property will trigger replacement.
string
The value of the attribute.
type Changes to this property will trigger replacement. string
Specify the type for the attribute value. This is useful when passing integer or float values to Insights. Allowed values are string, int, or float. Defaults to string.
key
This property is required.
Changes to this property will trigger replacement.
str
The name of the attribute.
value
This property is required.
Changes to this property will trigger replacement.
str
The value of the attribute.
type Changes to this property will trigger replacement. str
Specify the type for the attribute value. This is useful when passing integer or float values to Insights. Allowed values are string, int, or float. Defaults to string.
key
This property is required.
Changes to this property will trigger replacement.
String
The name of the attribute.
value
This property is required.
Changes to this property will trigger replacement.
String
The value of the attribute.
type Changes to this property will trigger replacement. String
Specify the type for the attribute value. This is useful when passing integer or float values to Insights. Allowed values are string, int, or float. Defaults to string.

Package Details

Repository
New Relic pulumi/pulumi-newrelic
License
Apache-2.0
Notes
This Pulumi package is based on the newrelic Terraform Provider.