1. Packages
  2. Bitbucket Provider
  3. API Docs
  4. GroupMembership
bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92

bitbucket.GroupMembership

Explore with Pulumi AI

bitbucket logo
bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92

    Provides a Bitbucket group membership resource.

    This allows you to manage your group membership.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as bitbucket from "@pulumi/bitbucket";
    
    const testWorkspace = bitbucket.getWorkspace({
        workspace: "example",
    });
    const testGroup = new bitbucket.Group("testGroup", {workspace: testWorkspace.then(testWorkspace => testWorkspace.id)});
    const testCurrentUser = bitbucket.getCurrentUser({});
    const testGroupMembership = new bitbucket.GroupMembership("testGroupMembership", {
        workspace: testGroup.workspace,
        groupSlug: testGroup.slug,
        uuid: testCurrentUser.then(testCurrentUser => testCurrentUser.id),
    });
    
    import pulumi
    import pulumi_bitbucket as bitbucket
    
    test_workspace = bitbucket.get_workspace(workspace="example")
    test_group = bitbucket.Group("testGroup", workspace=test_workspace.id)
    test_current_user = bitbucket.get_current_user()
    test_group_membership = bitbucket.GroupMembership("testGroupMembership",
        workspace=test_group.workspace,
        group_slug=test_group.slug,
        uuid=test_current_user.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/bitbucket/v2/bitbucket"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		testWorkspace, err := bitbucket.GetWorkspace(ctx, &bitbucket.GetWorkspaceArgs{
    			Workspace: "example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		testGroup, err := bitbucket.NewGroup(ctx, "testGroup", &bitbucket.GroupArgs{
    			Workspace: pulumi.String(testWorkspace.Id),
    		})
    		if err != nil {
    			return err
    		}
    		testCurrentUser, err := bitbucket.GetCurrentUser(ctx, &bitbucket.GetCurrentUserArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = bitbucket.NewGroupMembership(ctx, "testGroupMembership", &bitbucket.GroupMembershipArgs{
    			Workspace: testGroup.Workspace,
    			GroupSlug: testGroup.Slug,
    			Uuid:      pulumi.String(testCurrentUser.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Bitbucket = Pulumi.Bitbucket;
    
    return await Deployment.RunAsync(() => 
    {
        var testWorkspace = Bitbucket.GetWorkspace.Invoke(new()
        {
            Workspace = "example",
        });
    
        var testGroup = new Bitbucket.Group("testGroup", new()
        {
            Workspace = testWorkspace.Apply(getWorkspaceResult => getWorkspaceResult.Id),
        });
    
        var testCurrentUser = Bitbucket.GetCurrentUser.Invoke();
    
        var testGroupMembership = new Bitbucket.GroupMembership("testGroupMembership", new()
        {
            Workspace = testGroup.Workspace,
            GroupSlug = testGroup.Slug,
            Uuid = testCurrentUser.Apply(getCurrentUserResult => getCurrentUserResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.bitbucket.BitbucketFunctions;
    import com.pulumi.bitbucket.inputs.GetWorkspaceArgs;
    import com.pulumi.bitbucket.Group;
    import com.pulumi.bitbucket.GroupArgs;
    import com.pulumi.bitbucket.inputs.GetCurrentUserArgs;
    import com.pulumi.bitbucket.GroupMembership;
    import com.pulumi.bitbucket.GroupMembershipArgs;
    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) {
            final var testWorkspace = BitbucketFunctions.getWorkspace(GetWorkspaceArgs.builder()
                .workspace("example")
                .build());
    
            var testGroup = new Group("testGroup", GroupArgs.builder()
                .workspace(testWorkspace.applyValue(getWorkspaceResult -> getWorkspaceResult.id()))
                .build());
    
            final var testCurrentUser = BitbucketFunctions.getCurrentUser();
    
            var testGroupMembership = new GroupMembership("testGroupMembership", GroupMembershipArgs.builder()
                .workspace(testGroup.workspace())
                .groupSlug(testGroup.slug())
                .uuid(testCurrentUser.applyValue(getCurrentUserResult -> getCurrentUserResult.id()))
                .build());
    
        }
    }
    
    resources:
      testGroup:
        type: bitbucket:Group
        properties:
          workspace: ${testWorkspace.id}
      testGroupMembership:
        type: bitbucket:GroupMembership
        properties:
          workspace: ${testGroup.workspace}
          groupSlug: ${testGroup.slug}
          uuid: ${testCurrentUser.id}
    variables:
      testWorkspace:
        fn::invoke:
          function: bitbucket:getWorkspace
          arguments:
            workspace: example
      testCurrentUser:
        fn::invoke:
          function: bitbucket:getCurrentUser
          arguments: {}
    

    Create GroupMembership Resource

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

    Constructor syntax

    new GroupMembership(name: string, args: GroupMembershipArgs, opts?: CustomResourceOptions);
    @overload
    def GroupMembership(resource_name: str,
                        args: GroupMembershipArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def GroupMembership(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        group_slug: Optional[str] = None,
                        uuid: Optional[str] = None,
                        workspace: Optional[str] = None,
                        group_membership_id: Optional[str] = None)
    func NewGroupMembership(ctx *Context, name string, args GroupMembershipArgs, opts ...ResourceOption) (*GroupMembership, error)
    public GroupMembership(string name, GroupMembershipArgs args, CustomResourceOptions? opts = null)
    public GroupMembership(String name, GroupMembershipArgs args)
    public GroupMembership(String name, GroupMembershipArgs args, CustomResourceOptions options)
    
    type: bitbucket:GroupMembership
    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 GroupMembershipArgs
    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 GroupMembershipArgs
    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 GroupMembershipArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GroupMembershipArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GroupMembershipArgs
    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 groupMembershipResource = new Bitbucket.GroupMembership("groupMembershipResource", new()
    {
        GroupSlug = "string",
        Uuid = "string",
        Workspace = "string",
        GroupMembershipId = "string",
    });
    
    example, err := bitbucket.NewGroupMembership(ctx, "groupMembershipResource", &bitbucket.GroupMembershipArgs{
    	GroupSlug:         pulumi.String("string"),
    	Uuid:              pulumi.String("string"),
    	Workspace:         pulumi.String("string"),
    	GroupMembershipId: pulumi.String("string"),
    })
    
    var groupMembershipResource = new GroupMembership("groupMembershipResource", GroupMembershipArgs.builder()
        .groupSlug("string")
        .uuid("string")
        .workspace("string")
        .groupMembershipId("string")
        .build());
    
    group_membership_resource = bitbucket.GroupMembership("groupMembershipResource",
        group_slug="string",
        uuid="string",
        workspace="string",
        group_membership_id="string")
    
    const groupMembershipResource = new bitbucket.GroupMembership("groupMembershipResource", {
        groupSlug: "string",
        uuid: "string",
        workspace: "string",
        groupMembershipId: "string",
    });
    
    type: bitbucket:GroupMembership
    properties:
        groupMembershipId: string
        groupSlug: string
        uuid: string
        workspace: string
    

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

    GroupSlug string
    The slug of the group.
    Uuid string
    The member UUID to add to the group.
    Workspace string
    The workspace of this repository.
    GroupMembershipId string
    GroupSlug string
    The slug of the group.
    Uuid string
    The member UUID to add to the group.
    Workspace string
    The workspace of this repository.
    GroupMembershipId string
    groupSlug String
    The slug of the group.
    uuid String
    The member UUID to add to the group.
    workspace String
    The workspace of this repository.
    groupMembershipId String
    groupSlug string
    The slug of the group.
    uuid string
    The member UUID to add to the group.
    workspace string
    The workspace of this repository.
    groupMembershipId string
    group_slug str
    The slug of the group.
    uuid str
    The member UUID to add to the group.
    workspace str
    The workspace of this repository.
    group_membership_id str
    groupSlug String
    The slug of the group.
    uuid String
    The member UUID to add to the group.
    workspace String
    The workspace of this repository.
    groupMembershipId String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GroupMembership resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Slug string
    Id string
    The provider-assigned unique ID for this managed resource.
    Slug string
    id String
    The provider-assigned unique ID for this managed resource.
    slug String
    id string
    The provider-assigned unique ID for this managed resource.
    slug string
    id str
    The provider-assigned unique ID for this managed resource.
    slug str
    id String
    The provider-assigned unique ID for this managed resource.
    slug String

    Look up Existing GroupMembership Resource

    Get an existing GroupMembership 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?: GroupMembershipState, opts?: CustomResourceOptions): GroupMembership
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_membership_id: Optional[str] = None,
            group_slug: Optional[str] = None,
            slug: Optional[str] = None,
            uuid: Optional[str] = None,
            workspace: Optional[str] = None) -> GroupMembership
    func GetGroupMembership(ctx *Context, name string, id IDInput, state *GroupMembershipState, opts ...ResourceOption) (*GroupMembership, error)
    public static GroupMembership Get(string name, Input<string> id, GroupMembershipState? state, CustomResourceOptions? opts = null)
    public static GroupMembership get(String name, Output<String> id, GroupMembershipState state, CustomResourceOptions options)
    resources:  _:    type: bitbucket:GroupMembership    get:      id: ${id}
    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:
    GroupMembershipId string
    GroupSlug string
    The slug of the group.
    Slug string
    Uuid string
    The member UUID to add to the group.
    Workspace string
    The workspace of this repository.
    GroupMembershipId string
    GroupSlug string
    The slug of the group.
    Slug string
    Uuid string
    The member UUID to add to the group.
    Workspace string
    The workspace of this repository.
    groupMembershipId String
    groupSlug String
    The slug of the group.
    slug String
    uuid String
    The member UUID to add to the group.
    workspace String
    The workspace of this repository.
    groupMembershipId string
    groupSlug string
    The slug of the group.
    slug string
    uuid string
    The member UUID to add to the group.
    workspace string
    The workspace of this repository.
    group_membership_id str
    group_slug str
    The slug of the group.
    slug str
    uuid str
    The member UUID to add to the group.
    workspace str
    The workspace of this repository.
    groupMembershipId String
    groupSlug String
    The slug of the group.
    slug String
    uuid String
    The member UUID to add to the group.
    workspace String
    The workspace of this repository.

    Import

    Group Members can be imported using their workspace/group-slug/member-uuid ID, e.g.

    $ pulumi import bitbucket:index/groupMembership:GroupMembership group my-workspace/group-slug/member-uuid
    

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

    Package Details

    Repository
    bitbucket drfaust92/terraform-provider-bitbucket
    License
    Notes
    This Pulumi package is based on the bitbucket Terraform Provider.
    bitbucket logo
    bitbucket 2.46.0 published on Monday, Apr 14, 2025 by drfaust92