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

sonarqube.GroupMember

Explore with Pulumi AI

Provides a Sonarqube Group Member resource. This can be used to add or remove user to or from Sonarqube Groups.

Example Usage

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

const user = new sonarqube.User("user", {
    loginName: "terraform-test",
    password: "secret-sauce37!",
});
const projectUsers = new sonarqube.Group("projectUsers", {description: "This is a group"});
const projectUsersMember = new sonarqube.GroupMember("projectUsersMember", {loginName: user.loginName});
Copy
import pulumi
import pulumi_sonarqube as sonarqube

user = sonarqube.User("user",
    login_name="terraform-test",
    password="secret-sauce37!")
project_users = sonarqube.Group("projectUsers", description="This is a group")
project_users_member = sonarqube.GroupMember("projectUsersMember", login_name=user.login_name)
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 {
		user, err := sonarqube.NewUser(ctx, "user", &sonarqube.UserArgs{
			LoginName: pulumi.String("terraform-test"),
			Password:  pulumi.String("secret-sauce37!"),
		})
		if err != nil {
			return err
		}
		_, err = sonarqube.NewGroup(ctx, "projectUsers", &sonarqube.GroupArgs{
			Description: pulumi.String("This is a group"),
		})
		if err != nil {
			return err
		}
		_, err = sonarqube.NewGroupMember(ctx, "projectUsersMember", &sonarqube.GroupMemberArgs{
			LoginName: user.LoginName,
		})
		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!",
    });

    var projectUsers = new Sonarqube.Group("projectUsers", new()
    {
        Description = "This is a group",
    });

    var projectUsersMember = new Sonarqube.GroupMember("projectUsersMember", new()
    {
        LoginName = user.LoginName,
    });

});
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 com.pulumi.sonarqube.Group;
import com.pulumi.sonarqube.GroupArgs;
import com.pulumi.sonarqube.GroupMember;
import com.pulumi.sonarqube.GroupMemberArgs;
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());

        var projectUsers = new Group("projectUsers", GroupArgs.builder()
            .description("This is a group")
            .build());

        var projectUsersMember = new GroupMember("projectUsersMember", GroupMemberArgs.builder()
            .loginName(user.loginName())
            .build());

    }
}
Copy
resources:
  user:
    type: sonarqube:User
    properties:
      loginName: terraform-test
      password: secret-sauce37!
  projectUsers:
    type: sonarqube:Group
    properties:
      description: This is a group
  projectUsersMember:
    type: sonarqube:GroupMember
    properties:
      loginName: ${user.loginName}
Copy

Create GroupMember Resource

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

Constructor syntax

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

@overload
def GroupMember(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                login_name: Optional[str] = None,
                group_member_id: Optional[str] = None,
                name: Optional[str] = None)
func NewGroupMember(ctx *Context, name string, args GroupMemberArgs, opts ...ResourceOption) (*GroupMember, error)
public GroupMember(string name, GroupMemberArgs args, CustomResourceOptions? opts = null)
public GroupMember(String name, GroupMemberArgs args)
public GroupMember(String name, GroupMemberArgs args, CustomResourceOptions options)
type: sonarqube:GroupMember
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. GroupMemberArgs
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. GroupMemberArgs
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. GroupMemberArgs
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. GroupMemberArgs
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. GroupMemberArgs
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 groupMemberResource = new Sonarqube.GroupMember("groupMemberResource", new()
{
    LoginName = "string",
    GroupMemberId = "string",
    Name = "string",
});
Copy
example, err := sonarqube.NewGroupMember(ctx, "groupMemberResource", &sonarqube.GroupMemberArgs{
LoginName: pulumi.String("string"),
GroupMemberId: pulumi.String("string"),
Name: pulumi.String("string"),
})
Copy
var groupMemberResource = new GroupMember("groupMemberResource", GroupMemberArgs.builder()
    .loginName("string")
    .groupMemberId("string")
    .name("string")
    .build());
Copy
group_member_resource = sonarqube.GroupMember("groupMemberResource",
    login_name="string",
    group_member_id="string",
    name="string")
Copy
const groupMemberResource = new sonarqube.GroupMember("groupMemberResource", {
    loginName: "string",
    groupMemberId: "string",
    name: "string",
});
Copy
type: sonarqube:GroupMember
properties:
    groupMemberId: string
    loginName: string
    name: string
Copy

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

LoginName This property is required. string
The login_name of the User to add as a member. Changing this forces a new resource to be created.
GroupMemberId string
The ID of this resource.
Name string
The name of the Group to add a member to. Changing this forces a new resource to be created.
LoginName This property is required. string
The login_name of the User to add as a member. Changing this forces a new resource to be created.
GroupMemberId string
The ID of this resource.
Name string
The name of the Group to add a member to. Changing this forces a new resource to be created.
loginName This property is required. String
The login_name of the User to add as a member. Changing this forces a new resource to be created.
groupMemberId String
The ID of this resource.
name String
The name of the Group to add a member to. Changing this forces a new resource to be created.
loginName This property is required. string
The login_name of the User to add as a member. Changing this forces a new resource to be created.
groupMemberId string
The ID of this resource.
name string
The name of the Group to add a member to. Changing this forces a new resource to be created.
login_name This property is required. str
The login_name of the User to add as a member. Changing this forces a new resource to be created.
group_member_id str
The ID of this resource.
name str
The name of the Group to add a member to. Changing this forces a new resource to be created.
loginName This property is required. String
The login_name of the User to add as a member. Changing this forces a new resource to be created.
groupMemberId String
The ID of this resource.
name String
The name of the Group to add a member to. Changing this forces a new resource to be created.

Outputs

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

Get an existing GroupMember 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?: GroupMemberState, opts?: CustomResourceOptions): GroupMember
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        group_member_id: Optional[str] = None,
        login_name: Optional[str] = None,
        name: Optional[str] = None) -> GroupMember
func GetGroupMember(ctx *Context, name string, id IDInput, state *GroupMemberState, opts ...ResourceOption) (*GroupMember, error)
public static GroupMember Get(string name, Input<string> id, GroupMemberState? state, CustomResourceOptions? opts = null)
public static GroupMember get(String name, Output<String> id, GroupMemberState state, CustomResourceOptions options)
resources:  _:    type: sonarqube:GroupMember    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:
GroupMemberId string
The ID of this resource.
LoginName string
The login_name of the User to add as a member. Changing this forces a new resource to be created.
Name string
The name of the Group to add a member to. Changing this forces a new resource to be created.
GroupMemberId string
The ID of this resource.
LoginName string
The login_name of the User to add as a member. Changing this forces a new resource to be created.
Name string
The name of the Group to add a member to. Changing this forces a new resource to be created.
groupMemberId String
The ID of this resource.
loginName String
The login_name of the User to add as a member. Changing this forces a new resource to be created.
name String
The name of the Group to add a member to. Changing this forces a new resource to be created.
groupMemberId string
The ID of this resource.
loginName string
The login_name of the User to add as a member. Changing this forces a new resource to be created.
name string
The name of the Group to add a member to. Changing this forces a new resource to be created.
group_member_id str
The ID of this resource.
login_name str
The login_name of the User to add as a member. Changing this forces a new resource to be created.
name str
The name of the Group to add a member to. Changing this forces a new resource to be created.
groupMemberId String
The ID of this resource.
loginName String
The login_name of the User to add as a member. Changing this forces a new resource to be created.
name String
The name of the Group to add a member to. Changing this forces a new resource to be created.

Package Details

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