1. Packages
  2. OpenStack
  3. API Docs
  4. identity
  5. User
OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi

openstack.identity.User

Explore with Pulumi AI

openstack logo
OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi

    Manages a V3 User resource within OpenStack Keystone.

    Note: All arguments including the user password will be stored in the raw state as plain-text. Read more about sensitive data in state.

    Note: You must have admin privileges in your OpenStack cloud to use this resource.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var project1 = new OpenStack.Identity.Project("project1");
    
        var user1 = new OpenStack.Identity.User("user1", new()
        {
            DefaultProjectId = project1.Id,
            Description = "A user",
            Password = "password123",
            IgnoreChangePasswordUponFirstUse = true,
            MultiFactorAuthEnabled = true,
            MultiFactorAuthRules = new[]
            {
                new OpenStack.Identity.Inputs.UserMultiFactorAuthRuleArgs
                {
                    Rules = new[]
                    {
                        "password",
                        "totp",
                    },
                },
                new OpenStack.Identity.Inputs.UserMultiFactorAuthRuleArgs
                {
                    Rules = new[]
                    {
                        "password",
                    },
                },
            },
            Extra = 
            {
                { "email", "user_1@foobar.com" },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/identity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		project1, err := identity.NewProject(ctx, "project1", nil)
    		if err != nil {
    			return err
    		}
    		_, err = identity.NewUser(ctx, "user1", &identity.UserArgs{
    			DefaultProjectId:                 project1.ID(),
    			Description:                      pulumi.String("A user"),
    			Password:                         pulumi.String("password123"),
    			IgnoreChangePasswordUponFirstUse: pulumi.Bool(true),
    			MultiFactorAuthEnabled:           pulumi.Bool(true),
    			MultiFactorAuthRules: identity.UserMultiFactorAuthRuleArray{
    				&identity.UserMultiFactorAuthRuleArgs{
    					Rules: pulumi.StringArray{
    						pulumi.String("password"),
    						pulumi.String("totp"),
    					},
    				},
    				&identity.UserMultiFactorAuthRuleArgs{
    					Rules: pulumi.StringArray{
    						pulumi.String("password"),
    					},
    				},
    			},
    			Extra: pulumi.Map{
    				"email": pulumi.Any("user_1@foobar.com"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.identity.Project;
    import com.pulumi.openstack.identity.User;
    import com.pulumi.openstack.identity.UserArgs;
    import com.pulumi.openstack.identity.inputs.UserMultiFactorAuthRuleArgs;
    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 project1 = new Project("project1");
    
            var user1 = new User("user1", UserArgs.builder()        
                .defaultProjectId(project1.id())
                .description("A user")
                .password("password123")
                .ignoreChangePasswordUponFirstUse(true)
                .multiFactorAuthEnabled(true)
                .multiFactorAuthRules(            
                    UserMultiFactorAuthRuleArgs.builder()
                        .rules(                    
                            "password",
                            "totp")
                        .build(),
                    UserMultiFactorAuthRuleArgs.builder()
                        .rules("password")
                        .build())
                .extra(Map.of("email", "user_1@foobar.com"))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_openstack as openstack
    
    project1 = openstack.identity.Project("project1")
    user1 = openstack.identity.User("user1",
        default_project_id=project1.id,
        description="A user",
        password="password123",
        ignore_change_password_upon_first_use=True,
        multi_factor_auth_enabled=True,
        multi_factor_auth_rules=[
            openstack.identity.UserMultiFactorAuthRuleArgs(
                rules=[
                    "password",
                    "totp",
                ],
            ),
            openstack.identity.UserMultiFactorAuthRuleArgs(
                rules=["password"],
            ),
        ],
        extra={
            "email": "user_1@foobar.com",
        })
    
    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const project1 = new openstack.identity.Project("project1", {});
    const user1 = new openstack.identity.User("user1", {
        defaultProjectId: project1.id,
        description: "A user",
        password: "password123",
        ignoreChangePasswordUponFirstUse: true,
        multiFactorAuthEnabled: true,
        multiFactorAuthRules: [
            {
                rules: [
                    "password",
                    "totp",
                ],
            },
            {
                rules: ["password"],
            },
        ],
        extra: {
            email: "user_1@foobar.com",
        },
    });
    
    resources:
      project1:
        type: openstack:identity:Project
      user1:
        type: openstack:identity:User
        properties:
          defaultProjectId: ${project1.id}
          description: A user
          password: password123
          ignoreChangePasswordUponFirstUse: true
          multiFactorAuthEnabled: true
          multiFactorAuthRules:
            - rules:
                - password
                - totp
            - rules:
                - password
          extra:
            email: user_1@foobar.com
    

    Create User Resource

    new User(name: string, args?: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             default_project_id: Optional[str] = None,
             description: Optional[str] = None,
             domain_id: Optional[str] = None,
             enabled: Optional[bool] = None,
             extra: Optional[Mapping[str, Any]] = None,
             ignore_change_password_upon_first_use: Optional[bool] = None,
             ignore_lockout_failure_attempts: Optional[bool] = None,
             ignore_password_expiry: Optional[bool] = None,
             multi_factor_auth_enabled: Optional[bool] = None,
             multi_factor_auth_rules: Optional[Sequence[UserMultiFactorAuthRuleArgs]] = None,
             name: Optional[str] = None,
             password: Optional[str] = None,
             region: Optional[str] = None)
    @overload
    def User(resource_name: str,
             args: Optional[UserArgs] = None,
             opts: Optional[ResourceOptions] = None)
    func NewUser(ctx *Context, name string, args *UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs? args = null, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: openstack:identity:User
    properties: # The arguments to resource properties.
    options: # 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.
    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.

    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:

    DefaultProjectId string
    The default project this user belongs to.
    Description string
    A description of the user.
    DomainId string
    The domain this user belongs to.
    Enabled bool
    Whether the user is enabled or disabled. Valid values are true and false.
    Extra Dictionary<string, object>
    Free-form key/value pairs of extra information.
    IgnoreChangePasswordUponFirstUse bool
    User will not have to change their password upon first use. Valid values are true and false.
    IgnoreLockoutFailureAttempts bool
    User will not have a failure lockout placed on their account. Valid values are true and false.
    IgnorePasswordExpiry bool
    User's password will not expire. Valid values are true and false.
    MultiFactorAuthEnabled bool
    Whether to enable multi-factor authentication. Valid values are true and false.
    MultiFactorAuthRules List<Pulumi.OpenStack.Identity.Inputs.UserMultiFactorAuthRule>
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    Name string
    The name of the user.
    Password string
    The password for the user.
    Region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    DefaultProjectId string
    The default project this user belongs to.
    Description string
    A description of the user.
    DomainId string
    The domain this user belongs to.
    Enabled bool
    Whether the user is enabled or disabled. Valid values are true and false.
    Extra map[string]interface{}
    Free-form key/value pairs of extra information.
    IgnoreChangePasswordUponFirstUse bool
    User will not have to change their password upon first use. Valid values are true and false.
    IgnoreLockoutFailureAttempts bool
    User will not have a failure lockout placed on their account. Valid values are true and false.
    IgnorePasswordExpiry bool
    User's password will not expire. Valid values are true and false.
    MultiFactorAuthEnabled bool
    Whether to enable multi-factor authentication. Valid values are true and false.
    MultiFactorAuthRules []UserMultiFactorAuthRuleArgs
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    Name string
    The name of the user.
    Password string
    The password for the user.
    Region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    defaultProjectId String
    The default project this user belongs to.
    description String
    A description of the user.
    domainId String
    The domain this user belongs to.
    enabled Boolean
    Whether the user is enabled or disabled. Valid values are true and false.
    extra Map<String,Object>
    Free-form key/value pairs of extra information.
    ignoreChangePasswordUponFirstUse Boolean
    User will not have to change their password upon first use. Valid values are true and false.
    ignoreLockoutFailureAttempts Boolean
    User will not have a failure lockout placed on their account. Valid values are true and false.
    ignorePasswordExpiry Boolean
    User's password will not expire. Valid values are true and false.
    multiFactorAuthEnabled Boolean
    Whether to enable multi-factor authentication. Valid values are true and false.
    multiFactorAuthRules List<UserMultiFactorAuthRule>
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    name String
    The name of the user.
    password String
    The password for the user.
    region String
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    defaultProjectId string
    The default project this user belongs to.
    description string
    A description of the user.
    domainId string
    The domain this user belongs to.
    enabled boolean
    Whether the user is enabled or disabled. Valid values are true and false.
    extra {[key: string]: any}
    Free-form key/value pairs of extra information.
    ignoreChangePasswordUponFirstUse boolean
    User will not have to change their password upon first use. Valid values are true and false.
    ignoreLockoutFailureAttempts boolean
    User will not have a failure lockout placed on their account. Valid values are true and false.
    ignorePasswordExpiry boolean
    User's password will not expire. Valid values are true and false.
    multiFactorAuthEnabled boolean
    Whether to enable multi-factor authentication. Valid values are true and false.
    multiFactorAuthRules UserMultiFactorAuthRule[]
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    name string
    The name of the user.
    password string
    The password for the user.
    region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    default_project_id str
    The default project this user belongs to.
    description str
    A description of the user.
    domain_id str
    The domain this user belongs to.
    enabled bool
    Whether the user is enabled or disabled. Valid values are true and false.
    extra Mapping[str, Any]
    Free-form key/value pairs of extra information.
    ignore_change_password_upon_first_use bool
    User will not have to change their password upon first use. Valid values are true and false.
    ignore_lockout_failure_attempts bool
    User will not have a failure lockout placed on their account. Valid values are true and false.
    ignore_password_expiry bool
    User's password will not expire. Valid values are true and false.
    multi_factor_auth_enabled bool
    Whether to enable multi-factor authentication. Valid values are true and false.
    multi_factor_auth_rules Sequence[UserMultiFactorAuthRuleArgs]
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    name str
    The name of the user.
    password str
    The password for the user.
    region str
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    defaultProjectId String
    The default project this user belongs to.
    description String
    A description of the user.
    domainId String
    The domain this user belongs to.
    enabled Boolean
    Whether the user is enabled or disabled. Valid values are true and false.
    extra Map<Any>
    Free-form key/value pairs of extra information.
    ignoreChangePasswordUponFirstUse Boolean
    User will not have to change their password upon first use. Valid values are true and false.
    ignoreLockoutFailureAttempts Boolean
    User will not have a failure lockout placed on their account. Valid values are true and false.
    ignorePasswordExpiry Boolean
    User's password will not expire. Valid values are true and false.
    multiFactorAuthEnabled Boolean
    Whether to enable multi-factor authentication. Valid values are true and false.
    multiFactorAuthRules List<Property Map>
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    name String
    The name of the user.
    password String
    The password for the user.
    region String
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.

    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,
            default_project_id: Optional[str] = None,
            description: Optional[str] = None,
            domain_id: Optional[str] = None,
            enabled: Optional[bool] = None,
            extra: Optional[Mapping[str, Any]] = None,
            ignore_change_password_upon_first_use: Optional[bool] = None,
            ignore_lockout_failure_attempts: Optional[bool] = None,
            ignore_password_expiry: Optional[bool] = None,
            multi_factor_auth_enabled: Optional[bool] = None,
            multi_factor_auth_rules: Optional[Sequence[UserMultiFactorAuthRuleArgs]] = None,
            name: Optional[str] = None,
            password: Optional[str] = None,
            region: 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.
    The following state arguments are supported:
    DefaultProjectId string
    The default project this user belongs to.
    Description string
    A description of the user.
    DomainId string
    The domain this user belongs to.
    Enabled bool
    Whether the user is enabled or disabled. Valid values are true and false.
    Extra Dictionary<string, object>
    Free-form key/value pairs of extra information.
    IgnoreChangePasswordUponFirstUse bool
    User will not have to change their password upon first use. Valid values are true and false.
    IgnoreLockoutFailureAttempts bool
    User will not have a failure lockout placed on their account. Valid values are true and false.
    IgnorePasswordExpiry bool
    User's password will not expire. Valid values are true and false.
    MultiFactorAuthEnabled bool
    Whether to enable multi-factor authentication. Valid values are true and false.
    MultiFactorAuthRules List<Pulumi.OpenStack.Identity.Inputs.UserMultiFactorAuthRule>
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    Name string
    The name of the user.
    Password string
    The password for the user.
    Region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    DefaultProjectId string
    The default project this user belongs to.
    Description string
    A description of the user.
    DomainId string
    The domain this user belongs to.
    Enabled bool
    Whether the user is enabled or disabled. Valid values are true and false.
    Extra map[string]interface{}
    Free-form key/value pairs of extra information.
    IgnoreChangePasswordUponFirstUse bool
    User will not have to change their password upon first use. Valid values are true and false.
    IgnoreLockoutFailureAttempts bool
    User will not have a failure lockout placed on their account. Valid values are true and false.
    IgnorePasswordExpiry bool
    User's password will not expire. Valid values are true and false.
    MultiFactorAuthEnabled bool
    Whether to enable multi-factor authentication. Valid values are true and false.
    MultiFactorAuthRules []UserMultiFactorAuthRuleArgs
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    Name string
    The name of the user.
    Password string
    The password for the user.
    Region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    defaultProjectId String
    The default project this user belongs to.
    description String
    A description of the user.
    domainId String
    The domain this user belongs to.
    enabled Boolean
    Whether the user is enabled or disabled. Valid values are true and false.
    extra Map<String,Object>
    Free-form key/value pairs of extra information.
    ignoreChangePasswordUponFirstUse Boolean
    User will not have to change their password upon first use. Valid values are true and false.
    ignoreLockoutFailureAttempts Boolean
    User will not have a failure lockout placed on their account. Valid values are true and false.
    ignorePasswordExpiry Boolean
    User's password will not expire. Valid values are true and false.
    multiFactorAuthEnabled Boolean
    Whether to enable multi-factor authentication. Valid values are true and false.
    multiFactorAuthRules List<UserMultiFactorAuthRule>
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    name String
    The name of the user.
    password String
    The password for the user.
    region String
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    defaultProjectId string
    The default project this user belongs to.
    description string
    A description of the user.
    domainId string
    The domain this user belongs to.
    enabled boolean
    Whether the user is enabled or disabled. Valid values are true and false.
    extra {[key: string]: any}
    Free-form key/value pairs of extra information.
    ignoreChangePasswordUponFirstUse boolean
    User will not have to change their password upon first use. Valid values are true and false.
    ignoreLockoutFailureAttempts boolean
    User will not have a failure lockout placed on their account. Valid values are true and false.
    ignorePasswordExpiry boolean
    User's password will not expire. Valid values are true and false.
    multiFactorAuthEnabled boolean
    Whether to enable multi-factor authentication. Valid values are true and false.
    multiFactorAuthRules UserMultiFactorAuthRule[]
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    name string
    The name of the user.
    password string
    The password for the user.
    region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    default_project_id str
    The default project this user belongs to.
    description str
    A description of the user.
    domain_id str
    The domain this user belongs to.
    enabled bool
    Whether the user is enabled or disabled. Valid values are true and false.
    extra Mapping[str, Any]
    Free-form key/value pairs of extra information.
    ignore_change_password_upon_first_use bool
    User will not have to change their password upon first use. Valid values are true and false.
    ignore_lockout_failure_attempts bool
    User will not have a failure lockout placed on their account. Valid values are true and false.
    ignore_password_expiry bool
    User's password will not expire. Valid values are true and false.
    multi_factor_auth_enabled bool
    Whether to enable multi-factor authentication. Valid values are true and false.
    multi_factor_auth_rules Sequence[UserMultiFactorAuthRuleArgs]
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    name str
    The name of the user.
    password str
    The password for the user.
    region str
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.
    defaultProjectId String
    The default project this user belongs to.
    description String
    A description of the user.
    domainId String
    The domain this user belongs to.
    enabled Boolean
    Whether the user is enabled or disabled. Valid values are true and false.
    extra Map<Any>
    Free-form key/value pairs of extra information.
    ignoreChangePasswordUponFirstUse Boolean
    User will not have to change their password upon first use. Valid values are true and false.
    ignoreLockoutFailureAttempts Boolean
    User will not have a failure lockout placed on their account. Valid values are true and false.
    ignorePasswordExpiry Boolean
    User's password will not expire. Valid values are true and false.
    multiFactorAuthEnabled Boolean
    Whether to enable multi-factor authentication. Valid values are true and false.
    multiFactorAuthRules List<Property Map>
    A multi-factor authentication rule. The structure is documented below. Please see the Ocata release notes for more information on how to use mulit-factor rules.
    name String
    The name of the user.
    password String
    The password for the user.
    region String
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used. Changing this creates a new User.

    Supporting Types

    UserMultiFactorAuthRule, UserMultiFactorAuthRuleArgs

    Rules List<string>
    A list of authentication plugins that the user must authenticate with.
    Rules []string
    A list of authentication plugins that the user must authenticate with.
    rules List<String>
    A list of authentication plugins that the user must authenticate with.
    rules string[]
    A list of authentication plugins that the user must authenticate with.
    rules Sequence[str]
    A list of authentication plugins that the user must authenticate with.
    rules List<String>
    A list of authentication plugins that the user must authenticate with.

    Import

    Users can be imported using the id, e.g.

     $ pulumi import openstack:identity/user:User user_1 89c60255-9bd6-460c-822a-e2b959ede9d2
    

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v3.15.1 published on Thursday, Feb 1, 2024 by Pulumi