1. Packages
  2. Sonarqube Provider
  3. API Docs
  4. User
sonarqube 0.16.14 published on Monday, Apr 14, 2025 by jdamata

sonarqube.User

Explore with Pulumi AI

Provides a Sonarqube User resource. This can be used to manage Sonarqube Users.

Example Usage

Example: create a local user

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

const user = new sonarqube.User("user", {
    loginName: "terraform-test",
    password: "secret-sauce37!",
});
Copy
import pulumi
import pulumi_sonarqube as sonarqube

user = sonarqube.User("user",
    login_name="terraform-test",
    password="secret-sauce37!")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/sonarqube/sonarqube"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sonarqube.NewUser(ctx, "user", &sonarqube.UserArgs{
			LoginName: pulumi.String("terraform-test"),
			Password:  pulumi.String("secret-sauce37!"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sonarqube = Pulumi.Sonarqube;

return await Deployment.RunAsync(() => 
{
    var user = new Sonarqube.User("user", new()
    {
        LoginName = "terraform-test",
        Password = "secret-sauce37!",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sonarqube.User;
import com.pulumi.sonarqube.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 user = new User("user", UserArgs.builder()
            .loginName("terraform-test")
            .password("secret-sauce37!")
            .build());

    }
}
Copy
resources:
  user:
    type: sonarqube:User
    properties:
      loginName: terraform-test
      password: secret-sauce37!
Copy

Example: create a remote user

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

const remoteUser = new sonarqube.User("remoteUser", {
    email: "terraform-test@sonarqube.com",
    isLocal: false,
    loginName: "terraform-test",
});
Copy
import pulumi
import pulumi_sonarqube as sonarqube

remote_user = sonarqube.User("remoteUser",
    email="terraform-test@sonarqube.com",
    is_local=False,
    login_name="terraform-test")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/sonarqube/sonarqube"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sonarqube.NewUser(ctx, "remoteUser", &sonarqube.UserArgs{
			Email:     pulumi.String("terraform-test@sonarqube.com"),
			IsLocal:   pulumi.Bool(false),
			LoginName: pulumi.String("terraform-test"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sonarqube = Pulumi.Sonarqube;

return await Deployment.RunAsync(() => 
{
    var remoteUser = new Sonarqube.User("remoteUser", new()
    {
        Email = "terraform-test@sonarqube.com",
        IsLocal = false,
        LoginName = "terraform-test",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sonarqube.User;
import com.pulumi.sonarqube.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 remoteUser = new User("remoteUser", UserArgs.builder()
            .email("terraform-test@sonarqube.com")
            .isLocal(false)
            .loginName("terraform-test")
            .build());

    }
}
Copy
resources:
  remoteUser:
    type: sonarqube:User
    properties:
      email: terraform-test@sonarqube.com
      isLocal: false
      loginName: terraform-test
Copy

Create User Resource

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

Constructor syntax

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

@overload
def User(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         login_name: Optional[str] = None,
         email: Optional[str] = None,
         is_local: Optional[bool] = None,
         name: Optional[str] = None,
         password: Optional[str] = None,
         user_id: Optional[str] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
public User(String name, UserArgs args)
public User(String name, UserArgs args, CustomResourceOptions options)
type: sonarqube:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

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

var userResource = new Sonarqube.User("userResource", new()
{
    LoginName = "string",
    Email = "string",
    IsLocal = false,
    Name = "string",
    Password = "string",
    UserId = "string",
});
Copy
example, err := sonarqube.NewUser(ctx, "userResource", &sonarqube.UserArgs{
LoginName: pulumi.String("string"),
Email: pulumi.String("string"),
IsLocal: pulumi.Bool(false),
Name: pulumi.String("string"),
Password: pulumi.String("string"),
UserId: pulumi.String("string"),
})
Copy
var userResource = new User("userResource", UserArgs.builder()
    .loginName("string")
    .email("string")
    .isLocal(false)
    .name("string")
    .password("string")
    .userId("string")
    .build());
Copy
user_resource = sonarqube.User("userResource",
    login_name="string",
    email="string",
    is_local=False,
    name="string",
    password="string",
    user_id="string")
Copy
const userResource = new sonarqube.User("userResource", {
    loginName: "string",
    email: "string",
    isLocal: false,
    name: "string",
    password: "string",
    userId: "string",
});
Copy
type: sonarqube:User
properties:
    email: string
    isLocal: false
    loginName: string
    name: string
    password: string
    userId: string
Copy

User Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The User resource accepts the following input properties:

LoginName This property is required. string
The login name of the User to create. Changing this forces a new resource to be created.
Email string
The email of the User to create.
IsLocal bool
True if the User should be of type local. Defaults to true.
Name string
The name of the User to create. Changing this forces a new resource to be created.
Password string
The password of User to create. This is only used if the user is of type local.
UserId string
The ID of this resource.
LoginName This property is required. string
The login name of the User to create. Changing this forces a new resource to be created.
Email string
The email of the User to create.
IsLocal bool
True if the User should be of type local. Defaults to true.
Name string
The name of the User to create. Changing this forces a new resource to be created.
Password string
The password of User to create. This is only used if the user is of type local.
UserId string
The ID of this resource.
loginName This property is required. String
The login name of the User to create. Changing this forces a new resource to be created.
email String
The email of the User to create.
isLocal Boolean
True if the User should be of type local. Defaults to true.
name String
The name of the User to create. Changing this forces a new resource to be created.
password String
The password of User to create. This is only used if the user is of type local.
userId String
The ID of this resource.
loginName This property is required. string
The login name of the User to create. Changing this forces a new resource to be created.
email string
The email of the User to create.
isLocal boolean
True if the User should be of type local. Defaults to true.
name string
The name of the User to create. Changing this forces a new resource to be created.
password string
The password of User to create. This is only used if the user is of type local.
userId string
The ID of this resource.
login_name This property is required. str
The login name of the User to create. Changing this forces a new resource to be created.
email str
The email of the User to create.
is_local bool
True if the User should be of type local. Defaults to true.
name str
The name of the User to create. Changing this forces a new resource to be created.
password str
The password of User to create. This is only used if the user is of type local.
user_id str
The ID of this resource.
loginName This property is required. String
The login name of the User to create. Changing this forces a new resource to be created.
email String
The email of the User to create.
isLocal Boolean
True if the User should be of type local. Defaults to true.
name String
The name of the User to create. Changing this forces a new resource to be created.
password String
The password of User to create. This is only used if the user is of type local.
userId String
The ID of this resource.

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,
        email: Optional[str] = None,
        is_local: Optional[bool] = None,
        login_name: Optional[str] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        user_id: Optional[str] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
resources:  _:    type: sonarqube:User    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Email string
The email of the User to create.
IsLocal bool
True if the User should be of type local. Defaults to true.
LoginName string
The login name of the User to create. Changing this forces a new resource to be created.
Name string
The name of the User to create. Changing this forces a new resource to be created.
Password string
The password of User to create. This is only used if the user is of type local.
UserId string
The ID of this resource.
Email string
The email of the User to create.
IsLocal bool
True if the User should be of type local. Defaults to true.
LoginName string
The login name of the User to create. Changing this forces a new resource to be created.
Name string
The name of the User to create. Changing this forces a new resource to be created.
Password string
The password of User to create. This is only used if the user is of type local.
UserId string
The ID of this resource.
email String
The email of the User to create.
isLocal Boolean
True if the User should be of type local. Defaults to true.
loginName String
The login name of the User to create. Changing this forces a new resource to be created.
name String
The name of the User to create. Changing this forces a new resource to be created.
password String
The password of User to create. This is only used if the user is of type local.
userId String
The ID of this resource.
email string
The email of the User to create.
isLocal boolean
True if the User should be of type local. Defaults to true.
loginName string
The login name of the User to create. Changing this forces a new resource to be created.
name string
The name of the User to create. Changing this forces a new resource to be created.
password string
The password of User to create. This is only used if the user is of type local.
userId string
The ID of this resource.
email str
The email of the User to create.
is_local bool
True if the User should be of type local. Defaults to true.
login_name str
The login name of the User to create. Changing this forces a new resource to be created.
name str
The name of the User to create. Changing this forces a new resource to be created.
password str
The password of User to create. This is only used if the user is of type local.
user_id str
The ID of this resource.
email String
The email of the User to create.
isLocal Boolean
True if the User should be of type local. Defaults to true.
loginName String
The login name of the User to create. Changing this forces a new resource to be created.
name String
The name of the User to create. Changing this forces a new resource to be created.
password String
The password of User to create. This is only used if the user is of type local.
userId String
The ID of this resource.

Package Details

Repository
sonarqube jdamata/terraform-provider-sonarqube
License
Notes
This Pulumi package is based on the sonarqube Terraform Provider.