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",
});
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")
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
})
}
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",
});
});
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.applyValue(getAuthenticationDomainResult -> getAuthenticationDomainResult.id()))
.userType("CORE_USER_TIER")
.build());
}
}
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
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)
type: newrelic:User
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 UserArgs
- 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 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 string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
example, err := newrelic.NewUser(ctx, "userResource", &newrelic.UserArgs{
AuthenticationDomainId: pulumi.String("string"),
EmailId: pulumi.String("string"),
Name: pulumi.String("string"),
UserType: pulumi.String("string"),
})
var userResource = new User("userResource", UserArgs.builder()
.authenticationDomainId("string")
.emailId("string")
.name("string")
.userType("string")
.build());
user_resource = newrelic.User("userResource",
authentication_domain_id="string",
email_id="string",
name="string",
user_type="string")
const userResource = new newrelic.User("userResource", {
authenticationDomainId: "string",
emailId: "string",
name: "string",
userType: "string",
});
type: newrelic:User
properties:
authenticationDomainId: string
emailId: string
name: string
userType: string
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
The User resource accepts the following input properties:
- Authentication
Domain stringId - The ID of the authentication domain to which the user to be created would belong.
- Email
Id string - The email ID of the user to be created.
- Name string
- The name of the user to be created.
- User
Type string The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- Authentication
Domain stringId - The ID of the authentication domain to which the user to be created would belong.
- Email
Id string - The email ID of the user to be created.
- Name string
- The name of the user to be created.
- User
Type string The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- authentication
Domain StringId - The ID of the authentication domain to which the user to be created would belong.
- email
Id String - The email ID of the user to be created.
- name String
- The name of the user to be created.
- user
Type String The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- authentication
Domain stringId - The ID of the authentication domain to which the user to be created would belong.
- email
Id string - The email ID of the user to be created.
- name string
- The name of the user to be created.
- user
Type string The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- authentication_
domain_ strid - 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
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- authentication
Domain StringId - The ID of the authentication domain to which the user to be created would belong.
- email
Id String - The email ID of the user to be created.
- name String
- The name of the user to be created.
- user
Type String The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_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)
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.
- Authentication
Domain stringId - The ID of the authentication domain to which the user to be created would belong.
- Email
Id string - The email ID of the user to be created.
- Name string
- The name of the user to be created.
- User
Type string The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- Authentication
Domain stringId - The ID of the authentication domain to which the user to be created would belong.
- Email
Id string - The email ID of the user to be created.
- Name string
- The name of the user to be created.
- User
Type string The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- authentication
Domain StringId - The ID of the authentication domain to which the user to be created would belong.
- email
Id String - The email ID of the user to be created.
- name String
- The name of the user to be created.
- user
Type String The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- authentication
Domain stringId - The ID of the authentication domain to which the user to be created would belong.
- email
Id string - The email ID of the user to be created.
- name string
- The name of the user to be created.
- user
Type string The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- authentication_
domain_ strid - 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
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_domain_id
of an existing user is not supported.
- authentication
Domain StringId - The ID of the authentication domain to which the user to be created would belong.
- email
Id String - The email ID of the user to be created.
- name String
- The name of the user to be created.
- user
Type String The tier to which the user to be created would belong. Accepted values for this argument are
BASIC_USER_TIER
,CORE_USER_TIER
, orFULL_USER_TIER
. If not specified in the configuration, the argument would default toBASIC_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 anewrelic.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 theauthentication_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
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.