published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Use this resource to create, update, and delete a New Relic One workload.
A New Relic User API key is required to provision this resource. Set the api_key
attribute in the provider block or the NEW_RELIC_API_KEY environment
variable with your User API key.
Example Usage
Include entities with a certain string on the name.
using System.Collections.Generic;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.Plugins.Workload("foo", new()
{
AccountId = 12345678,
EntityGuids = new[]
{
"MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1",
},
EntitySearchQueries = new[]
{
new NewRelic.Plugins.Inputs.WorkloadEntitySearchQueryArgs
{
Query = "name like '%Example application%'",
},
},
ScopeAccountIds = new[]
{
12345678,
},
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-newrelic/sdk/v4/go/newrelic/plugins"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := plugins.NewWorkload(ctx, "foo", &plugins.WorkloadArgs{
AccountId: pulumi.Int(12345678),
EntityGuids: pulumi.StringArray{
pulumi.String("MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"),
},
EntitySearchQueries: plugins.WorkloadEntitySearchQueryArray{
&plugins.WorkloadEntitySearchQueryArgs{
Query: pulumi.String(fmt.Sprintf("name like '%vExample application%v'", "%", "%")),
},
},
ScopeAccountIds: pulumi.IntArray{
pulumi.Int(12345678),
},
})
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.plugins.Workload;
import com.pulumi.newrelic.plugins.WorkloadArgs;
import com.pulumi.newrelic.plugins.inputs.WorkloadEntitySearchQueryArgs;
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 Workload("foo", WorkloadArgs.builder()
.accountId(12345678)
.entityGuids("MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1")
.entitySearchQueries(WorkloadEntitySearchQueryArgs.builder()
.query("name like '%Example application%'")
.build())
.scopeAccountIds(12345678)
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.plugins.Workload("foo", {
accountId: 12345678,
entityGuids: ["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
entitySearchQueries: [{
query: "name like '%Example application%'",
}],
scopeAccountIds: [12345678],
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.plugins.Workload("foo",
account_id=12345678,
entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
entity_search_queries=[newrelic.plugins.WorkloadEntitySearchQueryArgs(
query="name like '%Example application%'",
)],
scope_account_ids=[12345678])
resources:
foo:
type: newrelic:plugins:Workload
properties:
accountId: 1.2345678e+07
entityGuids:
- MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1
entitySearchQueries:
- query: name like '%Example application%'
scopeAccountIds:
- 1.2345678e+07
Include entities with a set of tags.
using System.Collections.Generic;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.Plugins.Workload("foo", new()
{
AccountId = 12345678,
EntityGuids = new[]
{
"MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1",
},
EntitySearchQueries = new[]
{
new NewRelic.Plugins.Inputs.WorkloadEntitySearchQueryArgs
{
Query = "tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'",
},
},
ScopeAccountIds = new[]
{
12345678,
},
});
});
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v4/go/newrelic/plugins"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := plugins.NewWorkload(ctx, "foo", &plugins.WorkloadArgs{
AccountId: pulumi.Int(12345678),
EntityGuids: pulumi.StringArray{
pulumi.String("MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"),
},
EntitySearchQueries: plugins.WorkloadEntitySearchQueryArray{
&plugins.WorkloadEntitySearchQueryArgs{
Query: pulumi.String("tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'"),
},
},
ScopeAccountIds: pulumi.IntArray{
pulumi.Int(12345678),
},
})
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.plugins.Workload;
import com.pulumi.newrelic.plugins.WorkloadArgs;
import com.pulumi.newrelic.plugins.inputs.WorkloadEntitySearchQueryArgs;
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 Workload("foo", WorkloadArgs.builder()
.accountId(12345678)
.entityGuids("MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1")
.entitySearchQueries(WorkloadEntitySearchQueryArgs.builder()
.query("tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'")
.build())
.scopeAccountIds(12345678)
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.plugins.Workload("foo", {
accountId: 12345678,
entityGuids: ["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
entitySearchQueries: [{
query: "tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'",
}],
scopeAccountIds: [12345678],
});
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.plugins.Workload("foo",
account_id=12345678,
entity_guids=["MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1"],
entity_search_queries=[newrelic.plugins.WorkloadEntitySearchQueryArgs(
query="tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'",
)],
scope_account_ids=[12345678])
resources:
foo:
type: newrelic:plugins:Workload
properties:
accountId: 1.2345678e+07
entityGuids:
- MjUyMDUyOHxBUE18QVBQTElDQVRJT058MjE1MDM3Nzk1
entitySearchQueries:
- query: tags.accountId = '12345678' AND tags.environment='production' AND tags.language='java'
scopeAccountIds:
- 1.2345678e+07
Create Workload Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Workload(name: string, args?: WorkloadArgs, opts?: CustomResourceOptions);@overload
def Workload(resource_name: str,
args: Optional[WorkloadArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Workload(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[int] = None,
entity_guids: Optional[Sequence[str]] = None,
entity_search_queries: Optional[Sequence[WorkloadEntitySearchQueryArgs]] = None,
name: Optional[str] = None,
scope_account_ids: Optional[Sequence[int]] = None)func NewWorkload(ctx *Context, name string, args *WorkloadArgs, opts ...ResourceOption) (*Workload, error)public Workload(string name, WorkloadArgs? args = null, CustomResourceOptions? opts = null)
public Workload(String name, WorkloadArgs args)
public Workload(String name, WorkloadArgs args, CustomResourceOptions options)
type: newrelic:plugins:Workload
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 WorkloadArgs
- 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 WorkloadArgs
- 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 WorkloadArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkloadArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkloadArgs
- 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 workloadResource = new NewRelic.Plugins.Workload("workloadResource", new()
{
AccountId = 0,
EntityGuids = new[]
{
"string",
},
EntitySearchQueries = new[]
{
new NewRelic.Plugins.Inputs.WorkloadEntitySearchQueryArgs
{
Query = "string",
},
},
Name = "string",
ScopeAccountIds = new[]
{
0,
},
});
example, err := plugins.NewWorkload(ctx, "workloadResource", &plugins.WorkloadArgs{
AccountId: pulumi.Int(0),
EntityGuids: pulumi.StringArray{
pulumi.String("string"),
},
EntitySearchQueries: plugins.WorkloadEntitySearchQueryArray{
&plugins.WorkloadEntitySearchQueryArgs{
Query: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
ScopeAccountIds: pulumi.IntArray{
pulumi.Int(0),
},
})
var workloadResource = new Workload("workloadResource", WorkloadArgs.builder()
.accountId(0)
.entityGuids("string")
.entitySearchQueries(WorkloadEntitySearchQueryArgs.builder()
.query("string")
.build())
.name("string")
.scopeAccountIds(0)
.build());
workload_resource = newrelic.plugins.Workload("workloadResource",
account_id=0,
entity_guids=["string"],
entity_search_queries=[{
"query": "string",
}],
name="string",
scope_account_ids=[0])
const workloadResource = new newrelic.plugins.Workload("workloadResource", {
accountId: 0,
entityGuids: ["string"],
entitySearchQueries: [{
query: "string",
}],
name: "string",
scopeAccountIds: [0],
});
type: newrelic:plugins:Workload
properties:
accountId: 0
entityGuids:
- string
entitySearchQueries:
- query: string
name: string
scopeAccountIds:
- 0
Workload 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 Workload resource accepts the following input properties:
- Account
Id int - The New Relic account ID where you want to create the workload.
- Entity
Guids List<string> - A list of entity GUIDs manually assigned to this workload.
- Entity
Search List<Pulumi.Queries New Relic. Plugins. Inputs. Workload Entity Search Query> - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- Name string
- The workload's name.
- Scope
Account List<int>Ids - A list of account IDs that will be used to get entities from.
- Account
Id int - The New Relic account ID where you want to create the workload.
- Entity
Guids []string - A list of entity GUIDs manually assigned to this workload.
- Entity
Search []WorkloadQueries Entity Search Query Args - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- Name string
- The workload's name.
- Scope
Account []intIds - A list of account IDs that will be used to get entities from.
- account
Id Integer - The New Relic account ID where you want to create the workload.
- entity
Guids List<String> - A list of entity GUIDs manually assigned to this workload.
- entity
Search List<WorkloadQueries Entity Search Query> - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- name String
- The workload's name.
- scope
Account List<Integer>Ids - A list of account IDs that will be used to get entities from.
- account
Id number - The New Relic account ID where you want to create the workload.
- entity
Guids string[] - A list of entity GUIDs manually assigned to this workload.
- entity
Search WorkloadQueries Entity Search Query[] - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- name string
- The workload's name.
- scope
Account number[]Ids - A list of account IDs that will be used to get entities from.
- account_
id int - The New Relic account ID where you want to create the workload.
- entity_
guids Sequence[str] - A list of entity GUIDs manually assigned to this workload.
- entity_
search_ Sequence[Workloadqueries Entity Search Query Args] - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- name str
- The workload's name.
- scope_
account_ Sequence[int]ids - A list of account IDs that will be used to get entities from.
- account
Id Number - The New Relic account ID where you want to create the workload.
- entity
Guids List<String> - A list of entity GUIDs manually assigned to this workload.
- entity
Search List<Property Map>Queries - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- name String
- The workload's name.
- scope
Account List<Number>Ids - A list of account IDs that will be used to get entities from.
Outputs
All input properties are implicitly available as output properties. Additionally, the Workload resource produces the following output properties:
- Composite
Entity stringSearch Query - The composite query used to compose a dynamic workload.
- Guid string
- The unique entity identifier of the workload in New Relic.
- Id string
- The provider-assigned unique ID for this managed resource.
- Permalink string
- The URL of the workload.
- Workload
Id int - The unique entity identifier of the workload.
- Composite
Entity stringSearch Query - The composite query used to compose a dynamic workload.
- Guid string
- The unique entity identifier of the workload in New Relic.
- Id string
- The provider-assigned unique ID for this managed resource.
- Permalink string
- The URL of the workload.
- Workload
Id int - The unique entity identifier of the workload.
- composite
Entity StringSearch Query - The composite query used to compose a dynamic workload.
- guid String
- The unique entity identifier of the workload in New Relic.
- id String
- The provider-assigned unique ID for this managed resource.
- permalink String
- The URL of the workload.
- workload
Id Integer - The unique entity identifier of the workload.
- composite
Entity stringSearch Query - The composite query used to compose a dynamic workload.
- guid string
- The unique entity identifier of the workload in New Relic.
- id string
- The provider-assigned unique ID for this managed resource.
- permalink string
- The URL of the workload.
- workload
Id number - The unique entity identifier of the workload.
- composite_
entity_ strsearch_ query - The composite query used to compose a dynamic workload.
- guid str
- The unique entity identifier of the workload in New Relic.
- id str
- The provider-assigned unique ID for this managed resource.
- permalink str
- The URL of the workload.
- workload_
id int - The unique entity identifier of the workload.
- composite
Entity StringSearch Query - The composite query used to compose a dynamic workload.
- guid String
- The unique entity identifier of the workload in New Relic.
- id String
- The provider-assigned unique ID for this managed resource.
- permalink String
- The URL of the workload.
- workload
Id Number - The unique entity identifier of the workload.
Look up Existing Workload Resource
Get an existing Workload 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?: WorkloadState, opts?: CustomResourceOptions): Workload@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[int] = None,
composite_entity_search_query: Optional[str] = None,
entity_guids: Optional[Sequence[str]] = None,
entity_search_queries: Optional[Sequence[WorkloadEntitySearchQueryArgs]] = None,
guid: Optional[str] = None,
name: Optional[str] = None,
permalink: Optional[str] = None,
scope_account_ids: Optional[Sequence[int]] = None,
workload_id: Optional[int] = None) -> Workloadfunc GetWorkload(ctx *Context, name string, id IDInput, state *WorkloadState, opts ...ResourceOption) (*Workload, error)public static Workload Get(string name, Input<string> id, WorkloadState? state, CustomResourceOptions? opts = null)public static Workload get(String name, Output<String> id, WorkloadState state, CustomResourceOptions options)resources: _: type: newrelic:plugins:Workload 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.
- Account
Id int - The New Relic account ID where you want to create the workload.
- Composite
Entity stringSearch Query - The composite query used to compose a dynamic workload.
- Entity
Guids List<string> - A list of entity GUIDs manually assigned to this workload.
- Entity
Search List<Pulumi.Queries New Relic. Plugins. Inputs. Workload Entity Search Query> - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- Guid string
- The unique entity identifier of the workload in New Relic.
- Name string
- The workload's name.
- Permalink string
- The URL of the workload.
- Scope
Account List<int>Ids - A list of account IDs that will be used to get entities from.
- Workload
Id int - The unique entity identifier of the workload.
- Account
Id int - The New Relic account ID where you want to create the workload.
- Composite
Entity stringSearch Query - The composite query used to compose a dynamic workload.
- Entity
Guids []string - A list of entity GUIDs manually assigned to this workload.
- Entity
Search []WorkloadQueries Entity Search Query Args - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- Guid string
- The unique entity identifier of the workload in New Relic.
- Name string
- The workload's name.
- Permalink string
- The URL of the workload.
- Scope
Account []intIds - A list of account IDs that will be used to get entities from.
- Workload
Id int - The unique entity identifier of the workload.
- account
Id Integer - The New Relic account ID where you want to create the workload.
- composite
Entity StringSearch Query - The composite query used to compose a dynamic workload.
- entity
Guids List<String> - A list of entity GUIDs manually assigned to this workload.
- entity
Search List<WorkloadQueries Entity Search Query> - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- guid String
- The unique entity identifier of the workload in New Relic.
- name String
- The workload's name.
- permalink String
- The URL of the workload.
- scope
Account List<Integer>Ids - A list of account IDs that will be used to get entities from.
- workload
Id Integer - The unique entity identifier of the workload.
- account
Id number - The New Relic account ID where you want to create the workload.
- composite
Entity stringSearch Query - The composite query used to compose a dynamic workload.
- entity
Guids string[] - A list of entity GUIDs manually assigned to this workload.
- entity
Search WorkloadQueries Entity Search Query[] - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- guid string
- The unique entity identifier of the workload in New Relic.
- name string
- The workload's name.
- permalink string
- The URL of the workload.
- scope
Account number[]Ids - A list of account IDs that will be used to get entities from.
- workload
Id number - The unique entity identifier of the workload.
- account_
id int - The New Relic account ID where you want to create the workload.
- composite_
entity_ strsearch_ query - The composite query used to compose a dynamic workload.
- entity_
guids Sequence[str] - A list of entity GUIDs manually assigned to this workload.
- entity_
search_ Sequence[Workloadqueries Entity Search Query Args] - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- guid str
- The unique entity identifier of the workload in New Relic.
- name str
- The workload's name.
- permalink str
- The URL of the workload.
- scope_
account_ Sequence[int]ids - A list of account IDs that will be used to get entities from.
- workload_
id int - The unique entity identifier of the workload.
- account
Id Number - The New Relic account ID where you want to create the workload.
- composite
Entity StringSearch Query - The composite query used to compose a dynamic workload.
- entity
Guids List<String> - A list of entity GUIDs manually assigned to this workload.
- entity
Search List<Property Map>Queries - A list of search queries that define a dynamic workload. See Nested entity_search_query blocks below for details.
- guid String
- The unique entity identifier of the workload in New Relic.
- name String
- The workload's name.
- permalink String
- The URL of the workload.
- scope
Account List<Number>Ids - A list of account IDs that will be used to get entities from.
- workload
Id Number - The unique entity identifier of the workload.
Supporting Types
WorkloadEntitySearchQuery, WorkloadEntitySearchQueryArgs
- Query string
- The query.
- Query string
- The query.
- query String
- The query.
- query string
- The query.
- query str
- The query.
- query String
- The query.
Import
New Relic One workloads can be imported using a concatenated string of the format
<account_id>:<workload_id>:<guid>, e.g. bash
$ pulumi import newrelic:plugins/workload:Workload foo 12345678:1456:MjUyMDUyOHxBUE18QVBRTElDQVRJT058MjE1MDM3Nzk1
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
newrelicTerraform Provider.
published on Monday, Mar 9, 2026 by Pulumi
