1. Packages
  2. Artifactory
  3. API Docs
  4. User
artifactory v6.7.0 published on Friday, Apr 19, 2024 by Pulumi

artifactory.User

Explore with Pulumi AI

artifactory logo
artifactory v6.7.0 published on Friday, Apr 19, 2024 by Pulumi

    Provides an Artifactory user resource. This can be used to create and manage Artifactory users. The password is a required field by the Artifactory API, but we made it optional in this resource to accommodate the scenario where the password is not needed and will be reset by the actual user later. When the optional attribute password is omitted, a random password is generated according to current Artifactory password policy.

    The generated password won’t be stored in the TF state and can not be recovered. The user must reset the password to be able to log in. An admin can always generate the access key for the user as well. The password change won’t trigger state drift. We don’t recommend to use this resource unless there is a specific use case for it. Recommended resource is artifactory.ManagedUser.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as artifactory from "@pulumi/artifactory";
    
    const test_user = new artifactory.User("test-user", {
        admin: false,
        disableUiAccess: false,
        email: "test-user@artifactory-terraform.com",
        groups: ["logged-in-users"],
        internalPasswordDisabled: false,
        password: "my super secret password",
        profileUpdatable: true,
    });
    
    import pulumi
    import pulumi_artifactory as artifactory
    
    test_user = artifactory.User("test-user",
        admin=False,
        disable_ui_access=False,
        email="test-user@artifactory-terraform.com",
        groups=["logged-in-users"],
        internal_password_disabled=False,
        password="my super secret password",
        profile_updatable=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-artifactory/sdk/v6/go/artifactory"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := artifactory.NewUser(ctx, "test-user", &artifactory.UserArgs{
    			Admin:           pulumi.Bool(false),
    			DisableUiAccess: pulumi.Bool(false),
    			Email:           pulumi.String("test-user@artifactory-terraform.com"),
    			Groups: pulumi.StringArray{
    				pulumi.String("logged-in-users"),
    			},
    			InternalPasswordDisabled: pulumi.Bool(false),
    			Password:                 pulumi.String("my super secret password"),
    			ProfileUpdatable:         pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Artifactory = Pulumi.Artifactory;
    
    return await Deployment.RunAsync(() => 
    {
        var test_user = new Artifactory.User("test-user", new()
        {
            Admin = false,
            DisableUiAccess = false,
            Email = "test-user@artifactory-terraform.com",
            Groups = new[]
            {
                "logged-in-users",
            },
            InternalPasswordDisabled = false,
            Password = "my super secret password",
            ProfileUpdatable = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.artifactory.User;
    import com.pulumi.artifactory.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) {
            var test_user = new User("test-user", UserArgs.builder()        
                .admin(false)
                .disableUiAccess(false)
                .email("test-user@artifactory-terraform.com")
                .groups("logged-in-users")
                .internalPasswordDisabled(false)
                .password("my super secret password")
                .profileUpdatable(true)
                .build());
    
        }
    }
    
    resources:
      test-user:
        type: artifactory:User
        properties:
          admin: false
          disableUiAccess: false
          email: test-user@artifactory-terraform.com
          groups:
            - logged-in-users
          internalPasswordDisabled: false
          password: my super secret password
          profileUpdatable: true
    

    Managing groups relationship

    See our recommendation on how to manage user-group relationship.

    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,
             email: Optional[str] = None,
             admin: Optional[bool] = None,
             disable_ui_access: Optional[bool] = None,
             groups: Optional[Sequence[str]] = None,
             internal_password_disabled: Optional[bool] = None,
             name: Optional[str] = None,
             password: Optional[str] = None,
             profile_updatable: Optional[bool] = 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: artifactory: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.

    Example

    The following reference example uses placeholder values for all input properties.

    var userResource = new Artifactory.User("userResource", new()
    {
        Email = "string",
        Admin = false,
        DisableUiAccess = false,
        Groups = new[]
        {
            "string",
        },
        InternalPasswordDisabled = false,
        Name = "string",
        Password = "string",
        ProfileUpdatable = false,
    });
    
    example, err := artifactory.NewUser(ctx, "userResource", &artifactory.UserArgs{
    	Email:           pulumi.String("string"),
    	Admin:           pulumi.Bool(false),
    	DisableUiAccess: pulumi.Bool(false),
    	Groups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	InternalPasswordDisabled: pulumi.Bool(false),
    	Name:                     pulumi.String("string"),
    	Password:                 pulumi.String("string"),
    	ProfileUpdatable:         pulumi.Bool(false),
    })
    
    var userResource = new User("userResource", UserArgs.builder()        
        .email("string")
        .admin(false)
        .disableUiAccess(false)
        .groups("string")
        .internalPasswordDisabled(false)
        .name("string")
        .password("string")
        .profileUpdatable(false)
        .build());
    
    user_resource = artifactory.User("userResource",
        email="string",
        admin=False,
        disable_ui_access=False,
        groups=["string"],
        internal_password_disabled=False,
        name="string",
        password="string",
        profile_updatable=False)
    
    const userResource = new artifactory.User("userResource", {
        email: "string",
        admin: false,
        disableUiAccess: false,
        groups: ["string"],
        internalPasswordDisabled: false,
        name: "string",
        password: "string",
        profileUpdatable: false,
    });
    
    type: artifactory:User
    properties:
        admin: false
        disableUiAccess: false
        email: string
        groups:
            - string
        internalPasswordDisabled: false
        name: string
        password: string
        profileUpdatable: false
    

    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:

    Email string
    Email for user.
    Admin bool
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    DisableUiAccess bool
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    Groups List<string>
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    InternalPasswordDisabled bool
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    Name string
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    Password string
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    ProfileUpdatable bool
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    Email string
    Email for user.
    Admin bool
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    DisableUiAccess bool
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    Groups []string
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    InternalPasswordDisabled bool
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    Name string
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    Password string
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    ProfileUpdatable bool
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    email String
    Email for user.
    admin Boolean
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    disableUiAccess Boolean
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    groups List<String>
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    internalPasswordDisabled Boolean
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    name String
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    password String
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    profileUpdatable Boolean
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    email string
    Email for user.
    admin boolean
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    disableUiAccess boolean
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    groups string[]
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    internalPasswordDisabled boolean
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    name string
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    password string
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    profileUpdatable boolean
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    email str
    Email for user.
    admin bool
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    disable_ui_access bool
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    groups Sequence[str]
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    internal_password_disabled bool
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    name str
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    password str
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    profile_updatable bool
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    email String
    Email for user.
    admin Boolean
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    disableUiAccess Boolean
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    groups List<String>
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    internalPasswordDisabled Boolean
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    name String
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    password String
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    profileUpdatable Boolean
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.

    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,
            admin: Optional[bool] = None,
            disable_ui_access: Optional[bool] = None,
            email: Optional[str] = None,
            groups: Optional[Sequence[str]] = None,
            internal_password_disabled: Optional[bool] = None,
            name: Optional[str] = None,
            password: Optional[str] = None,
            profile_updatable: Optional[bool] = 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.
    The following state arguments are supported:
    Admin bool
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    DisableUiAccess bool
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    Email string
    Email for user.
    Groups List<string>
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    InternalPasswordDisabled bool
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    Name string
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    Password string
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    ProfileUpdatable bool
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    Admin bool
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    DisableUiAccess bool
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    Email string
    Email for user.
    Groups []string
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    InternalPasswordDisabled bool
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    Name string
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    Password string
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    ProfileUpdatable bool
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    admin Boolean
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    disableUiAccess Boolean
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    email String
    Email for user.
    groups List<String>
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    internalPasswordDisabled Boolean
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    name String
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    password String
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    profileUpdatable Boolean
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    admin boolean
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    disableUiAccess boolean
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    email string
    Email for user.
    groups string[]
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    internalPasswordDisabled boolean
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    name string
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    password string
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    profileUpdatable boolean
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    admin bool
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    disable_ui_access bool
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    email str
    Email for user.
    groups Sequence[str]
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    internal_password_disabled bool
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    name str
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    password str
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    profile_updatable bool
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.
    admin Boolean
    (Optional, Default: false) When enabled, this user is an administrator with all the ensuing privileges.
    disableUiAccess Boolean
    (Optional, Default: true) When enabled, this user can only access the system through the REST API. This option cannot be set if the user has Admin privileges.
    email String
    Email for user.
    groups List<String>
    List of groups this user is a part of. Notes: If this attribute is not specified then user's group membership is set to empty. User will not be part of default "readers" group automatically.
    internalPasswordDisabled Boolean
    (Optional, Default: false) When enabled, disables the fallback mechanism for using an internal password when external authentication (such as LDAP) is enabled.
    name String
    Username for user. May contain lowercase letters, numbers and symbols: '.-_@'
    password String
    (Optional, Sensitive) Password for the user. When omitted, a random password is generated using the following password policy: 12 characters with 1 digit, 1 symbol, with upper and lower case letters
    profileUpdatable Boolean
    (Optional, Default: true) When enabled, this user can update their profile details (except for the password. Only an administrator can update the password). There may be cases in which you want to leave this unset to prevent users from updating their profile. For example, a departmental user with a single password shared between all department members.

    Import

    $ pulumi import artifactory:index/user:User test-user myusername
    

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

    Package Details

    Repository
    artifactory pulumi/pulumi-artifactory
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the artifactory Terraform Provider.
    artifactory logo
    artifactory v6.7.0 published on Friday, Apr 19, 2024 by Pulumi