1. Packages
  2. Newrelic Provider
  3. API Docs
  4. User
New Relic v5.44.1 published on Tuesday, Apr 15, 2025 by Pulumi

newrelic.User

Explore with Pulumi AI

The newrelic.User resource may be used to create, update and delete users in New Relic.

Example Usage

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

const foo = newrelic.getAuthenticationDomain({
    name: "Test Authentication Domain",
});
const fooUser = new newrelic.User("foo", {
    name: "Test New User",
    emailId: "test_user@test.com",
    authenticationDomainId: foo.then(foo => foo.id),
    userType: "CORE_USER_TIER",
});
Copy
import pulumi
import pulumi_newrelic as newrelic

foo = newrelic.get_authentication_domain(name="Test Authentication Domain")
foo_user = newrelic.User("foo",
    name="Test New User",
    email_id="test_user@test.com",
    authentication_domain_id=foo.id,
    user_type="CORE_USER_TIER")
Copy
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 {
		foo, err := newrelic.GetAuthenticationDomain(ctx, &newrelic.GetAuthenticationDomainArgs{
			Name: "Test Authentication Domain",
		}, nil)
		if err != nil {
			return err
		}
		_, err = newrelic.NewUser(ctx, "foo", &newrelic.UserArgs{
			Name:                   pulumi.String("Test New User"),
			EmailId:                pulumi.String("test_user@test.com"),
			AuthenticationDomainId: pulumi.String(foo.Id),
			UserType:               pulumi.String("CORE_USER_TIER"),
		})
		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 = NewRelic.GetAuthenticationDomain.Invoke(new()
    {
        Name = "Test Authentication Domain",
    });

    var fooUser = new NewRelic.User("foo", new()
    {
        Name = "Test New User",
        EmailId = "test_user@test.com",
        AuthenticationDomainId = foo.Apply(getAuthenticationDomainResult => getAuthenticationDomainResult.Id),
        UserType = "CORE_USER_TIER",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.newrelic.NewrelicFunctions;
import com.pulumi.newrelic.inputs.GetAuthenticationDomainArgs;
import com.pulumi.newrelic.User;
import com.pulumi.newrelic.UserArgs;
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) {
        final var foo = NewrelicFunctions.getAuthenticationDomain(GetAuthenticationDomainArgs.builder()
            .name("Test Authentication Domain")
            .build());

        var fooUser = new User("fooUser", UserArgs.builder()
            .name("Test New User")
            .emailId("test_user@test.com")
            .authenticationDomainId(foo.id())
            .userType("CORE_USER_TIER")
            .build());

    }
}
Copy
resources:
  fooUser:
    type: newrelic:User
    name: foo
    properties:
      name: Test New User
      emailId: test_user@test.com
      authenticationDomainId: ${foo.id}
      userType: CORE_USER_TIER
variables:
  foo:
    fn::invoke:
      function: newrelic:getAuthenticationDomain
      arguments:
        name: Test Authentication Domain
Copy

Create User Resource

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

Constructor syntax

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

@overload
def User(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         authentication_domain_id: Optional[str] = None,
         email_id: Optional[str] = None,
         name: Optional[str] = None,
         user_type: Optional[str] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
public User(String name, UserArgs args)
public User(String name, UserArgs args, CustomResourceOptions options)
type: newrelic:User
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. UserArgs
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. UserArgs
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. UserArgs
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. UserArgs
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. UserArgs
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 userResource = new NewRelic.User("userResource", new()
{
    AuthenticationDomainId = "string",
    EmailId = "string",
    Name = "string",
    UserType = "string",
});
Copy
example, err := newrelic.NewUser(ctx, "userResource", &newrelic.UserArgs{
	AuthenticationDomainId: pulumi.String("string"),
	EmailId:                pulumi.String("string"),
	Name:                   pulumi.String("string"),
	UserType:               pulumi.String("string"),
})
Copy
var userResource = new User("userResource", UserArgs.builder()
    .authenticationDomainId("string")
    .emailId("string")
    .name("string")
    .userType("string")
    .build());
Copy
user_resource = newrelic.User("userResource",
    authentication_domain_id="string",
    email_id="string",
    name="string",
    user_type="string")
Copy
const userResource = new newrelic.User("userResource", {
    authenticationDomainId: "string",
    emailId: "string",
    name: "string",
    userType: "string",
});
Copy
type: newrelic:User
properties:
    authenticationDomainId: string
    emailId: string
    name: string
    userType: string
Copy

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

AuthenticationDomainId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the authentication domain to which the user to be created would belong.
EmailId This property is required. string
The email ID of the user to be created.
Name string
The name of the user to be created.
UserType string

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

AuthenticationDomainId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the authentication domain to which the user to be created would belong.
EmailId This property is required. string
The email ID of the user to be created.
Name string
The name of the user to be created.
UserType string

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

authenticationDomainId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the authentication domain to which the user to be created would belong.
emailId This property is required. String
The email ID of the user to be created.
name String
The name of the user to be created.
userType String

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

authenticationDomainId
This property is required.
Changes to this property will trigger replacement.
string
The ID of the authentication domain to which the user to be created would belong.
emailId This property is required. string
The email ID of the user to be created.
name string
The name of the user to be created.
userType string

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

authentication_domain_id
This property is required.
Changes to this property will trigger replacement.
str
The ID of the authentication domain to which the user to be created would belong.
email_id This property is required. str
The email ID of the user to be created.
name str
The name of the user to be created.
user_type str

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

authenticationDomainId
This property is required.
Changes to this property will trigger replacement.
String
The ID of the authentication domain to which the user to be created would belong.
emailId This property is required. String
The email ID of the user to be created.
name String
The name of the user to be created.
userType String

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

Outputs

All input properties are implicitly available as output properties. Additionally, the User 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 User Resource

Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        authentication_domain_id: Optional[str] = None,
        email_id: Optional[str] = None,
        name: Optional[str] = None,
        user_type: Optional[str] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
resources:  _:    type: newrelic:User    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:
AuthenticationDomainId Changes to this property will trigger replacement. string
The ID of the authentication domain to which the user to be created would belong.
EmailId string
The email ID of the user to be created.
Name string
The name of the user to be created.
UserType string

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

AuthenticationDomainId Changes to this property will trigger replacement. string
The ID of the authentication domain to which the user to be created would belong.
EmailId string
The email ID of the user to be created.
Name string
The name of the user to be created.
UserType string

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

authenticationDomainId Changes to this property will trigger replacement. String
The ID of the authentication domain to which the user to be created would belong.
emailId String
The email ID of the user to be created.
name String
The name of the user to be created.
userType String

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

authenticationDomainId Changes to this property will trigger replacement. string
The ID of the authentication domain to which the user to be created would belong.
emailId string
The email ID of the user to be created.
name string
The name of the user to be created.
userType string

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

authentication_domain_id Changes to this property will trigger replacement. str
The ID of the authentication domain to which the user to be created would belong.
email_id str
The email ID of the user to be created.
name str
The name of the user to be created.
user_type str

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

authenticationDomainId Changes to this property will trigger replacement. String
The ID of the authentication domain to which the user to be created would belong.
emailId String
The email ID of the user to be created.
name String
The name of the user to be created.
userType String

The tier to which the user to be created would belong. Accepted values for this argument are BASIC_USER_TIER, CORE_USER_TIER, or FULL_USER_TIER. If not specified in the configuration, the argument would default to BASIC_USER_TIER.

NOTE The ID of an authentication domain can be retrieved using its name, via the data source newrelic.getAuthenticationDomain, as shown in the example above. Head over to the documentation of this data source for more details and examples.

WARNING: Changing the authentication_domain_id of a newrelic.User resource that has already been applied would result in a replacement of the resource – destruction of the existing resource, followed by the addition of a new resource with the specified configuration. This is due to the fact that updating the authentication_domain_id of an existing user is not supported.

Import

A user can be imported using its ID. Example:

$ pulumi import newrelic:index/user:User foo 1999999999
Copy

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.