1. Packages
  2. Nexus Provider
  3. API Docs
  4. SecurityUser
nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers

nexus.SecurityUser

Explore with Pulumi AI

nexus logo
nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers

    Use this resource to manage users.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nexus from "@pulumi/nexus";
    
    const admin = new nexus.SecurityUser("admin", {
        email: "nexus@example.com",
        firstname: "Administrator",
        lastname: "User",
        password: "admin123",
        roles: ["nx-admin"],
        status: "active",
        userid: "admin",
    });
    
    import pulumi
    import pulumi_nexus as nexus
    
    admin = nexus.SecurityUser("admin",
        email="nexus@example.com",
        firstname="Administrator",
        lastname="User",
        password="admin123",
        roles=["nx-admin"],
        status="active",
        userid="admin")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nexus/v2/nexus"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nexus.NewSecurityUser(ctx, "admin", &nexus.SecurityUserArgs{
    			Email:     pulumi.String("nexus@example.com"),
    			Firstname: pulumi.String("Administrator"),
    			Lastname:  pulumi.String("User"),
    			Password:  pulumi.String("admin123"),
    			Roles: pulumi.StringArray{
    				pulumi.String("nx-admin"),
    			},
    			Status: pulumi.String("active"),
    			Userid: pulumi.String("admin"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nexus = Pulumi.Nexus;
    
    return await Deployment.RunAsync(() => 
    {
        var admin = new Nexus.SecurityUser("admin", new()
        {
            Email = "nexus@example.com",
            Firstname = "Administrator",
            Lastname = "User",
            Password = "admin123",
            Roles = new[]
            {
                "nx-admin",
            },
            Status = "active",
            Userid = "admin",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nexus.SecurityUser;
    import com.pulumi.nexus.SecurityUserArgs;
    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 admin = new SecurityUser("admin", SecurityUserArgs.builder()
                .email("nexus@example.com")
                .firstname("Administrator")
                .lastname("User")
                .password("admin123")
                .roles("nx-admin")
                .status("active")
                .userid("admin")
                .build());
    
        }
    }
    
    resources:
      admin:
        type: nexus:SecurityUser
        properties:
          email: nexus@example.com
          firstname: Administrator
          lastname: User
          password: admin123
          roles:
            - nx-admin
          status: active
          userid: admin
    

    Create SecurityUser Resource

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

    Constructor syntax

    new SecurityUser(name: string, args: SecurityUserArgs, opts?: CustomResourceOptions);
    @overload
    def SecurityUser(resource_name: str,
                     args: SecurityUserArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecurityUser(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     email: Optional[str] = None,
                     firstname: Optional[str] = None,
                     lastname: Optional[str] = None,
                     password: Optional[str] = None,
                     userid: Optional[str] = None,
                     roles: Optional[Sequence[str]] = None,
                     status: Optional[str] = None)
    func NewSecurityUser(ctx *Context, name string, args SecurityUserArgs, opts ...ResourceOption) (*SecurityUser, error)
    public SecurityUser(string name, SecurityUserArgs args, CustomResourceOptions? opts = null)
    public SecurityUser(String name, SecurityUserArgs args)
    public SecurityUser(String name, SecurityUserArgs args, CustomResourceOptions options)
    
    type: nexus:SecurityUser
    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 SecurityUserArgs
    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 SecurityUserArgs
    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 SecurityUserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecurityUserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecurityUserArgs
    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 securityUserResource = new Nexus.SecurityUser("securityUserResource", new()
    {
        Email = "string",
        Firstname = "string",
        Lastname = "string",
        Password = "string",
        Userid = "string",
        Roles = new[]
        {
            "string",
        },
        Status = "string",
    });
    
    example, err := nexus.NewSecurityUser(ctx, "securityUserResource", &nexus.SecurityUserArgs{
    	Email:     pulumi.String("string"),
    	Firstname: pulumi.String("string"),
    	Lastname:  pulumi.String("string"),
    	Password:  pulumi.String("string"),
    	Userid:    pulumi.String("string"),
    	Roles: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Status: pulumi.String("string"),
    })
    
    var securityUserResource = new SecurityUser("securityUserResource", SecurityUserArgs.builder()
        .email("string")
        .firstname("string")
        .lastname("string")
        .password("string")
        .userid("string")
        .roles("string")
        .status("string")
        .build());
    
    security_user_resource = nexus.SecurityUser("securityUserResource",
        email="string",
        firstname="string",
        lastname="string",
        password="string",
        userid="string",
        roles=["string"],
        status="string")
    
    const securityUserResource = new nexus.SecurityUser("securityUserResource", {
        email: "string",
        firstname: "string",
        lastname: "string",
        password: "string",
        userid: "string",
        roles: ["string"],
        status: "string",
    });
    
    type: nexus:SecurityUser
    properties:
        email: string
        firstname: string
        lastname: string
        password: string
        roles:
            - string
        status: string
        userid: string
    

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

    Email string
    The email address associated with the user.
    Firstname string
    The first name of the user.
    Lastname string
    The last name of the user.
    Password string
    The password for the user.
    Userid string
    The userid which is required for login. This value cannot be changed.
    Roles List<string>
    The roles which the user has been assigned within Nexus.
    Status string
    The user's status, e.g. active or disabled.
    Email string
    The email address associated with the user.
    Firstname string
    The first name of the user.
    Lastname string
    The last name of the user.
    Password string
    The password for the user.
    Userid string
    The userid which is required for login. This value cannot be changed.
    Roles []string
    The roles which the user has been assigned within Nexus.
    Status string
    The user's status, e.g. active or disabled.
    email String
    The email address associated with the user.
    firstname String
    The first name of the user.
    lastname String
    The last name of the user.
    password String
    The password for the user.
    userid String
    The userid which is required for login. This value cannot be changed.
    roles List<String>
    The roles which the user has been assigned within Nexus.
    status String
    The user's status, e.g. active or disabled.
    email string
    The email address associated with the user.
    firstname string
    The first name of the user.
    lastname string
    The last name of the user.
    password string
    The password for the user.
    userid string
    The userid which is required for login. This value cannot be changed.
    roles string[]
    The roles which the user has been assigned within Nexus.
    status string
    The user's status, e.g. active or disabled.
    email str
    The email address associated with the user.
    firstname str
    The first name of the user.
    lastname str
    The last name of the user.
    password str
    The password for the user.
    userid str
    The userid which is required for login. This value cannot be changed.
    roles Sequence[str]
    The roles which the user has been assigned within Nexus.
    status str
    The user's status, e.g. active or disabled.
    email String
    The email address associated with the user.
    firstname String
    The first name of the user.
    lastname String
    The last name of the user.
    password String
    The password for the user.
    userid String
    The userid which is required for login. This value cannot be changed.
    roles List<String>
    The roles which the user has been assigned within Nexus.
    status String
    The user's status, e.g. active or disabled.

    Outputs

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

    Get an existing SecurityUser 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?: SecurityUserState, opts?: CustomResourceOptions): SecurityUser
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            email: Optional[str] = None,
            firstname: Optional[str] = None,
            lastname: Optional[str] = None,
            password: Optional[str] = None,
            roles: Optional[Sequence[str]] = None,
            status: Optional[str] = None,
            userid: Optional[str] = None) -> SecurityUser
    func GetSecurityUser(ctx *Context, name string, id IDInput, state *SecurityUserState, opts ...ResourceOption) (*SecurityUser, error)
    public static SecurityUser Get(string name, Input<string> id, SecurityUserState? state, CustomResourceOptions? opts = null)
    public static SecurityUser get(String name, Output<String> id, SecurityUserState state, CustomResourceOptions options)
    resources:  _:    type: nexus:SecurityUser    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.
    The following state arguments are supported:
    Email string
    The email address associated with the user.
    Firstname string
    The first name of the user.
    Lastname string
    The last name of the user.
    Password string
    The password for the user.
    Roles List<string>
    The roles which the user has been assigned within Nexus.
    Status string
    The user's status, e.g. active or disabled.
    Userid string
    The userid which is required for login. This value cannot be changed.
    Email string
    The email address associated with the user.
    Firstname string
    The first name of the user.
    Lastname string
    The last name of the user.
    Password string
    The password for the user.
    Roles []string
    The roles which the user has been assigned within Nexus.
    Status string
    The user's status, e.g. active or disabled.
    Userid string
    The userid which is required for login. This value cannot be changed.
    email String
    The email address associated with the user.
    firstname String
    The first name of the user.
    lastname String
    The last name of the user.
    password String
    The password for the user.
    roles List<String>
    The roles which the user has been assigned within Nexus.
    status String
    The user's status, e.g. active or disabled.
    userid String
    The userid which is required for login. This value cannot be changed.
    email string
    The email address associated with the user.
    firstname string
    The first name of the user.
    lastname string
    The last name of the user.
    password string
    The password for the user.
    roles string[]
    The roles which the user has been assigned within Nexus.
    status string
    The user's status, e.g. active or disabled.
    userid string
    The userid which is required for login. This value cannot be changed.
    email str
    The email address associated with the user.
    firstname str
    The first name of the user.
    lastname str
    The last name of the user.
    password str
    The password for the user.
    roles Sequence[str]
    The roles which the user has been assigned within Nexus.
    status str
    The user's status, e.g. active or disabled.
    userid str
    The userid which is required for login. This value cannot be changed.
    email String
    The email address associated with the user.
    firstname String
    The first name of the user.
    lastname String
    The last name of the user.
    password String
    The password for the user.
    roles List<String>
    The roles which the user has been assigned within Nexus.
    status String
    The user's status, e.g. active or disabled.
    userid String
    The userid which is required for login. This value cannot be changed.

    Import

    import using the userid of the user

    $ pulumi import nexus:index/securityUser:SecurityUser admin admin
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    nexus datadrivers/terraform-provider-nexus
    License
    Notes
    This Pulumi package is based on the nexus Terraform Provider.
    nexus logo
    nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers