1. Packages
  2. Gitlab Provider
  3. API Docs
  4. GroupShareGroup
GitLab v8.10.0 published on Friday, Mar 21, 2025 by Pulumi

gitlab.GroupShareGroup

Explore with Pulumi AI

The gitlab.GroupShareGroup resource allows managing the lifecycle of a group shared with another group.

Upstream API: GitLab REST API docs

Example Usage

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

const test = new gitlab.GroupShareGroup("test", {
    groupId: foo.id,
    shareGroupId: bar.id,
    groupAccess: "guest",
    expiresAt: "2099-01-01",
});
Copy
import pulumi
import pulumi_gitlab as gitlab

test = gitlab.GroupShareGroup("test",
    group_id=foo["id"],
    share_group_id=bar["id"],
    group_access="guest",
    expires_at="2099-01-01")
Copy
package main

import (
	"github.com/pulumi/pulumi-gitlab/sdk/v8/go/gitlab"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gitlab.NewGroupShareGroup(ctx, "test", &gitlab.GroupShareGroupArgs{
			GroupId:      pulumi.Any(foo.Id),
			ShareGroupId: pulumi.Any(bar.Id),
			GroupAccess:  pulumi.String("guest"),
			ExpiresAt:    pulumi.String("2099-01-01"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;

return await Deployment.RunAsync(() => 
{
    var test = new GitLab.GroupShareGroup("test", new()
    {
        GroupId = foo.Id,
        ShareGroupId = bar.Id,
        GroupAccess = "guest",
        ExpiresAt = "2099-01-01",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.GroupShareGroup;
import com.pulumi.gitlab.GroupShareGroupArgs;
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 = new GroupShareGroup("test", GroupShareGroupArgs.builder()
            .groupId(foo.id())
            .shareGroupId(bar.id())
            .groupAccess("guest")
            .expiresAt("2099-01-01")
            .build());

    }
}
Copy
resources:
  test:
    type: gitlab:GroupShareGroup
    properties:
      groupId: ${foo.id}
      shareGroupId: ${bar.id}
      groupAccess: guest
      expiresAt: 2099-01-01
Copy

Create GroupShareGroup Resource

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

Constructor syntax

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

@overload
def GroupShareGroup(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    group_access: Optional[str] = None,
                    group_id: Optional[str] = None,
                    share_group_id: Optional[int] = None,
                    expires_at: Optional[str] = None,
                    member_role_id: Optional[int] = None)
func NewGroupShareGroup(ctx *Context, name string, args GroupShareGroupArgs, opts ...ResourceOption) (*GroupShareGroup, error)
public GroupShareGroup(string name, GroupShareGroupArgs args, CustomResourceOptions? opts = null)
public GroupShareGroup(String name, GroupShareGroupArgs args)
public GroupShareGroup(String name, GroupShareGroupArgs args, CustomResourceOptions options)
type: gitlab:GroupShareGroup
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. GroupShareGroupArgs
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. GroupShareGroupArgs
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. GroupShareGroupArgs
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. GroupShareGroupArgs
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. GroupShareGroupArgs
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 groupShareGroupResource = new GitLab.GroupShareGroup("groupShareGroupResource", new()
{
    GroupAccess = "string",
    GroupId = "string",
    ShareGroupId = 0,
    ExpiresAt = "string",
    MemberRoleId = 0,
});
Copy
example, err := gitlab.NewGroupShareGroup(ctx, "groupShareGroupResource", &gitlab.GroupShareGroupArgs{
	GroupAccess:  pulumi.String("string"),
	GroupId:      pulumi.String("string"),
	ShareGroupId: pulumi.Int(0),
	ExpiresAt:    pulumi.String("string"),
	MemberRoleId: pulumi.Int(0),
})
Copy
var groupShareGroupResource = new GroupShareGroup("groupShareGroupResource", GroupShareGroupArgs.builder()
    .groupAccess("string")
    .groupId("string")
    .shareGroupId(0)
    .expiresAt("string")
    .memberRoleId(0)
    .build());
Copy
group_share_group_resource = gitlab.GroupShareGroup("groupShareGroupResource",
    group_access="string",
    group_id="string",
    share_group_id=0,
    expires_at="string",
    member_role_id=0)
Copy
const groupShareGroupResource = new gitlab.GroupShareGroup("groupShareGroupResource", {
    groupAccess: "string",
    groupId: "string",
    shareGroupId: 0,
    expiresAt: "string",
    memberRoleId: 0,
});
Copy
type: gitlab:GroupShareGroup
properties:
    expiresAt: string
    groupAccess: string
    groupId: string
    memberRoleId: 0
    shareGroupId: 0
Copy

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

GroupAccess This property is required. string
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
GroupId This property is required. string
The id of the main group to be shared.
ShareGroupId This property is required. int
The id of the additional group with which the main group will be shared.
ExpiresAt string
Share expiration date. Format: YYYY-MM-DD
MemberRoleId int
The ID of a custom member role. Only available for Ultimate instances.
GroupAccess This property is required. string
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
GroupId This property is required. string
The id of the main group to be shared.
ShareGroupId This property is required. int
The id of the additional group with which the main group will be shared.
ExpiresAt string
Share expiration date. Format: YYYY-MM-DD
MemberRoleId int
The ID of a custom member role. Only available for Ultimate instances.
groupAccess This property is required. String
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
groupId This property is required. String
The id of the main group to be shared.
shareGroupId This property is required. Integer
The id of the additional group with which the main group will be shared.
expiresAt String
Share expiration date. Format: YYYY-MM-DD
memberRoleId Integer
The ID of a custom member role. Only available for Ultimate instances.
groupAccess This property is required. string
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
groupId This property is required. string
The id of the main group to be shared.
shareGroupId This property is required. number
The id of the additional group with which the main group will be shared.
expiresAt string
Share expiration date. Format: YYYY-MM-DD
memberRoleId number
The ID of a custom member role. Only available for Ultimate instances.
group_access This property is required. str
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
group_id This property is required. str
The id of the main group to be shared.
share_group_id This property is required. int
The id of the additional group with which the main group will be shared.
expires_at str
Share expiration date. Format: YYYY-MM-DD
member_role_id int
The ID of a custom member role. Only available for Ultimate instances.
groupAccess This property is required. String
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
groupId This property is required. String
The id of the main group to be shared.
shareGroupId This property is required. Number
The id of the additional group with which the main group will be shared.
expiresAt String
Share expiration date. Format: YYYY-MM-DD
memberRoleId Number
The ID of a custom member role. Only available for Ultimate instances.

Outputs

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

Get an existing GroupShareGroup 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?: GroupShareGroupState, opts?: CustomResourceOptions): GroupShareGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        expires_at: Optional[str] = None,
        group_access: Optional[str] = None,
        group_id: Optional[str] = None,
        member_role_id: Optional[int] = None,
        share_group_id: Optional[int] = None) -> GroupShareGroup
func GetGroupShareGroup(ctx *Context, name string, id IDInput, state *GroupShareGroupState, opts ...ResourceOption) (*GroupShareGroup, error)
public static GroupShareGroup Get(string name, Input<string> id, GroupShareGroupState? state, CustomResourceOptions? opts = null)
public static GroupShareGroup get(String name, Output<String> id, GroupShareGroupState state, CustomResourceOptions options)
resources:  _:    type: gitlab:GroupShareGroup    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:
ExpiresAt string
Share expiration date. Format: YYYY-MM-DD
GroupAccess string
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
GroupId string
The id of the main group to be shared.
MemberRoleId int
The ID of a custom member role. Only available for Ultimate instances.
ShareGroupId int
The id of the additional group with which the main group will be shared.
ExpiresAt string
Share expiration date. Format: YYYY-MM-DD
GroupAccess string
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
GroupId string
The id of the main group to be shared.
MemberRoleId int
The ID of a custom member role. Only available for Ultimate instances.
ShareGroupId int
The id of the additional group with which the main group will be shared.
expiresAt String
Share expiration date. Format: YYYY-MM-DD
groupAccess String
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
groupId String
The id of the main group to be shared.
memberRoleId Integer
The ID of a custom member role. Only available for Ultimate instances.
shareGroupId Integer
The id of the additional group with which the main group will be shared.
expiresAt string
Share expiration date. Format: YYYY-MM-DD
groupAccess string
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
groupId string
The id of the main group to be shared.
memberRoleId number
The ID of a custom member role. Only available for Ultimate instances.
shareGroupId number
The id of the additional group with which the main group will be shared.
expires_at str
Share expiration date. Format: YYYY-MM-DD
group_access str
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
group_id str
The id of the main group to be shared.
member_role_id int
The ID of a custom member role. Only available for Ultimate instances.
share_group_id int
The id of the additional group with which the main group will be shared.
expiresAt String
Share expiration date. Format: YYYY-MM-DD
groupAccess String
The access level to grant the group. Valid values are: no one, minimal, guest, reporter, developer, maintainer, owner
groupId String
The id of the main group to be shared.
memberRoleId Number
The ID of a custom member role. Only available for Ultimate instances.
shareGroupId Number
The id of the additional group with which the main group will be shared.

Import

Starting in Terraform v1.5.0 you can use an import block to import gitlab_group_share_group. For example:

terraform

import {

to = gitlab_group_share_group.example

id = “see CLI command below for ID”

}

Import using the CLI is supported using the following syntax:

GitLab group shares can be imported using an id made up of mainGroupId:shareGroupId, e.g.

$ pulumi import gitlab:index/groupShareGroup:GroupShareGroup test 12345:1337
Copy

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

Package Details

Repository
GitLab pulumi/pulumi-gitlab
License
Apache-2.0
Notes
This Pulumi package is based on the gitlab Terraform Provider.