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

bitbucket.ProjectGroupPermission

Explore with Pulumi AI

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

    Provides a Bitbucket Repository Group Permission Resource.

    This allows you set explicit group permission for a project.

    OAuth2 Scopes: project:admin

    Note: can only be used when authenticating with Bitbucket Cloud using an app password. Authenticating via an OAuth flow gives a 403 error due to a restriction in the Bitbucket Cloud API.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as bitbucket from "@pulumi/bitbucket";
    
    const example = new bitbucket.ProjectGroupPermission("example", {
        workspace: "example",
        projectKey: bitbucket_project.example.key,
        groupSlug: bitbucket_group.example.slug,
        permission: "read",
    });
    
    import pulumi
    import pulumi_bitbucket as bitbucket
    
    example = bitbucket.ProjectGroupPermission("example",
        workspace="example",
        project_key=bitbucket_project["example"]["key"],
        group_slug=bitbucket_group["example"]["slug"],
        permission="read")
    
    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 {
    		_, err := bitbucket.NewProjectGroupPermission(ctx, "example", &bitbucket.ProjectGroupPermissionArgs{
    			Workspace:  pulumi.String("example"),
    			ProjectKey: pulumi.Any(bitbucket_project.Example.Key),
    			GroupSlug:  pulumi.Any(bitbucket_group.Example.Slug),
    			Permission: pulumi.String("read"),
    		})
    		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 example = new Bitbucket.ProjectGroupPermission("example", new()
        {
            Workspace = "example",
            ProjectKey = bitbucket_project.Example.Key,
            GroupSlug = bitbucket_group.Example.Slug,
            Permission = "read",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.bitbucket.ProjectGroupPermission;
    import com.pulumi.bitbucket.ProjectGroupPermissionArgs;
    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 example = new ProjectGroupPermission("example", ProjectGroupPermissionArgs.builder()
                .workspace("example")
                .projectKey(bitbucket_project.example().key())
                .groupSlug(bitbucket_group.example().slug())
                .permission("read")
                .build());
    
        }
    }
    
    resources:
      example:
        type: bitbucket:ProjectGroupPermission
        properties:
          workspace: example
          projectKey: ${bitbucket_project.example.key}
          groupSlug: ${bitbucket_group.example.slug}
          permission: read
    

    Create ProjectGroupPermission Resource

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

    Constructor syntax

    new ProjectGroupPermission(name: string, args: ProjectGroupPermissionArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectGroupPermission(resource_name: str,
                               args: ProjectGroupPermissionArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def ProjectGroupPermission(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               group_slug: Optional[str] = None,
                               permission: Optional[str] = None,
                               project_key: Optional[str] = None,
                               workspace: Optional[str] = None,
                               project_group_permission_id: Optional[str] = None)
    func NewProjectGroupPermission(ctx *Context, name string, args ProjectGroupPermissionArgs, opts ...ResourceOption) (*ProjectGroupPermission, error)
    public ProjectGroupPermission(string name, ProjectGroupPermissionArgs args, CustomResourceOptions? opts = null)
    public ProjectGroupPermission(String name, ProjectGroupPermissionArgs args)
    public ProjectGroupPermission(String name, ProjectGroupPermissionArgs args, CustomResourceOptions options)
    
    type: bitbucket:ProjectGroupPermission
    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 ProjectGroupPermissionArgs
    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 ProjectGroupPermissionArgs
    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 ProjectGroupPermissionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectGroupPermissionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectGroupPermissionArgs
    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 projectGroupPermissionResource = new Bitbucket.ProjectGroupPermission("projectGroupPermissionResource", new()
    {
        GroupSlug = "string",
        Permission = "string",
        ProjectKey = "string",
        Workspace = "string",
        ProjectGroupPermissionId = "string",
    });
    
    example, err := bitbucket.NewProjectGroupPermission(ctx, "projectGroupPermissionResource", &bitbucket.ProjectGroupPermissionArgs{
    	GroupSlug:                pulumi.String("string"),
    	Permission:               pulumi.String("string"),
    	ProjectKey:               pulumi.String("string"),
    	Workspace:                pulumi.String("string"),
    	ProjectGroupPermissionId: pulumi.String("string"),
    })
    
    var projectGroupPermissionResource = new ProjectGroupPermission("projectGroupPermissionResource", ProjectGroupPermissionArgs.builder()
        .groupSlug("string")
        .permission("string")
        .projectKey("string")
        .workspace("string")
        .projectGroupPermissionId("string")
        .build());
    
    project_group_permission_resource = bitbucket.ProjectGroupPermission("projectGroupPermissionResource",
        group_slug="string",
        permission="string",
        project_key="string",
        workspace="string",
        project_group_permission_id="string")
    
    const projectGroupPermissionResource = new bitbucket.ProjectGroupPermission("projectGroupPermissionResource", {
        groupSlug: "string",
        permission: "string",
        projectKey: "string",
        workspace: "string",
        projectGroupPermissionId: "string",
    });
    
    type: bitbucket:ProjectGroupPermission
    properties:
        groupSlug: string
        permission: string
        projectGroupPermissionId: string
        projectKey: string
        workspace: string
    

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

    GroupSlug string
    Slug of the requested group.
    Permission string
    Permissions can be one of read, write, create-repo, and admin.
    ProjectKey string
    The project key.
    Workspace string
    The workspace id.
    ProjectGroupPermissionId string
    GroupSlug string
    Slug of the requested group.
    Permission string
    Permissions can be one of read, write, create-repo, and admin.
    ProjectKey string
    The project key.
    Workspace string
    The workspace id.
    ProjectGroupPermissionId string
    groupSlug String
    Slug of the requested group.
    permission String
    Permissions can be one of read, write, create-repo, and admin.
    projectKey String
    The project key.
    workspace String
    The workspace id.
    projectGroupPermissionId String
    groupSlug string
    Slug of the requested group.
    permission string
    Permissions can be one of read, write, create-repo, and admin.
    projectKey string
    The project key.
    workspace string
    The workspace id.
    projectGroupPermissionId string
    group_slug str
    Slug of the requested group.
    permission str
    Permissions can be one of read, write, create-repo, and admin.
    project_key str
    The project key.
    workspace str
    The workspace id.
    project_group_permission_id str
    groupSlug String
    Slug of the requested group.
    permission String
    Permissions can be one of read, write, create-repo, and admin.
    projectKey String
    The project key.
    workspace String
    The workspace id.
    projectGroupPermissionId String

    Outputs

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

    Get an existing ProjectGroupPermission 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?: ProjectGroupPermissionState, opts?: CustomResourceOptions): ProjectGroupPermission
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            group_slug: Optional[str] = None,
            permission: Optional[str] = None,
            project_group_permission_id: Optional[str] = None,
            project_key: Optional[str] = None,
            workspace: Optional[str] = None) -> ProjectGroupPermission
    func GetProjectGroupPermission(ctx *Context, name string, id IDInput, state *ProjectGroupPermissionState, opts ...ResourceOption) (*ProjectGroupPermission, error)
    public static ProjectGroupPermission Get(string name, Input<string> id, ProjectGroupPermissionState? state, CustomResourceOptions? opts = null)
    public static ProjectGroupPermission get(String name, Output<String> id, ProjectGroupPermissionState state, CustomResourceOptions options)
    resources:  _:    type: bitbucket:ProjectGroupPermission    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:
    GroupSlug string
    Slug of the requested group.
    Permission string
    Permissions can be one of read, write, create-repo, and admin.
    ProjectGroupPermissionId string
    ProjectKey string
    The project key.
    Workspace string
    The workspace id.
    GroupSlug string
    Slug of the requested group.
    Permission string
    Permissions can be one of read, write, create-repo, and admin.
    ProjectGroupPermissionId string
    ProjectKey string
    The project key.
    Workspace string
    The workspace id.
    groupSlug String
    Slug of the requested group.
    permission String
    Permissions can be one of read, write, create-repo, and admin.
    projectGroupPermissionId String
    projectKey String
    The project key.
    workspace String
    The workspace id.
    groupSlug string
    Slug of the requested group.
    permission string
    Permissions can be one of read, write, create-repo, and admin.
    projectGroupPermissionId string
    projectKey string
    The project key.
    workspace string
    The workspace id.
    group_slug str
    Slug of the requested group.
    permission str
    Permissions can be one of read, write, create-repo, and admin.
    project_group_permission_id str
    project_key str
    The project key.
    workspace str
    The workspace id.
    groupSlug String
    Slug of the requested group.
    permission String
    Permissions can be one of read, write, create-repo, and admin.
    projectGroupPermissionId String
    projectKey String
    The project key.
    workspace String
    The workspace id.

    Import

    Repository Group Permissions can be imported using their workspace:project-key:group-slug ID, e.g.

    $ pulumi import bitbucket:index/projectGroupPermission:ProjectGroupPermission example workspace:project-key:group-slug
    

    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