azuredevops logo
Azure DevOps v2.7.0, Mar 27 23

azuredevops.BuildFolderPermissions

Manages permissions for a Build Folder

Note Permissions can be assigned to group principals and not to single user principals.

PAT Permissions Required

  • Project & Team: vso.security_manage - Grants the ability to read, write, and manage security permissions.

Example Usage

using System.Collections.Generic;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

return await Deployment.RunAsync(() => 
{
    var exampleProject = new AzureDevOps.Project("exampleProject", new()
    {
        WorkItemTemplate = "Agile",
        VersionControl = "Git",
        Visibility = "private",
        Description = "Managed by Terraform",
    });

    var example_readers = AzureDevOps.GetGroup.Invoke(new()
    {
        ProjectId = exampleProject.Id,
        Name = "Readers",
    });

    var exampleBuildFolder = new AzureDevOps.BuildFolder("exampleBuildFolder", new()
    {
        ProjectId = exampleProject.Id,
        Path = "\\ExampleFolder",
        Description = "ExampleFolder description",
    });

    var exampleBuildFolderPermissions = new AzureDevOps.BuildFolderPermissions("exampleBuildFolderPermissions", new()
    {
        ProjectId = exampleProject.Id,
        Path = "\\ExampleFolder",
        Principal = example_readers.Apply(example_readers => example_readers.Apply(getGroupResult => getGroupResult.Id)),
        Permissions = 
        {
            { "ViewBuilds", "Allow" },
            { "EditBuildQuality", "Allow" },
            { "RetainIndefinitely", "Allow" },
            { "DeleteBuilds", "Deny" },
            { "ManageBuildQualities", "Deny" },
            { "DestroyBuilds", "Deny" },
            { "UpdateBuildInformation", "Deny" },
            { "QueueBuilds", "Allow" },
            { "ManageBuildQueue", "Deny" },
            { "StopBuilds", "Allow" },
            { "ViewBuildDefinition", "Allow" },
            { "EditBuildDefinition", "Deny" },
            { "DeleteBuildDefinition", "Deny" },
            { "AdministerBuildPermissions", "NotSet" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-azuredevops/sdk/v2/go/azuredevops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
			WorkItemTemplate: pulumi.String("Agile"),
			VersionControl:   pulumi.String("Git"),
			Visibility:       pulumi.String("private"),
			Description:      pulumi.String("Managed by Terraform"),
		})
		if err != nil {
			return err
		}
		example_readers := azuredevops.LookupGroupOutput(ctx, azuredevops.GetGroupOutputArgs{
			ProjectId: exampleProject.ID(),
			Name:      pulumi.String("Readers"),
		}, nil)
		_, err = azuredevops.NewBuildFolder(ctx, "exampleBuildFolder", &azuredevops.BuildFolderArgs{
			ProjectId:   exampleProject.ID(),
			Path:        pulumi.String("\\ExampleFolder"),
			Description: pulumi.String("ExampleFolder description"),
		})
		if err != nil {
			return err
		}
		_, err = azuredevops.NewBuildFolderPermissions(ctx, "exampleBuildFolderPermissions", &azuredevops.BuildFolderPermissionsArgs{
			ProjectId: exampleProject.ID(),
			Path:      pulumi.String("\\ExampleFolder"),
			Principal: example_readers.ApplyT(func(example_readers azuredevops.GetGroupResult) (*string, error) {
				return &example_readers.Id, nil
			}).(pulumi.StringPtrOutput),
			Permissions: pulumi.StringMap{
				"ViewBuilds":                 pulumi.String("Allow"),
				"EditBuildQuality":           pulumi.String("Allow"),
				"RetainIndefinitely":         pulumi.String("Allow"),
				"DeleteBuilds":               pulumi.String("Deny"),
				"ManageBuildQualities":       pulumi.String("Deny"),
				"DestroyBuilds":              pulumi.String("Deny"),
				"UpdateBuildInformation":     pulumi.String("Deny"),
				"QueueBuilds":                pulumi.String("Allow"),
				"ManageBuildQueue":           pulumi.String("Deny"),
				"StopBuilds":                 pulumi.String("Allow"),
				"ViewBuildDefinition":        pulumi.String("Allow"),
				"EditBuildDefinition":        pulumi.String("Deny"),
				"DeleteBuildDefinition":      pulumi.String("Deny"),
				"AdministerBuildPermissions": pulumi.String("NotSet"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.Project;
import com.pulumi.azuredevops.ProjectArgs;
import com.pulumi.azuredevops.AzuredevopsFunctions;
import com.pulumi.azuredevops.inputs.GetGroupArgs;
import com.pulumi.azuredevops.BuildFolder;
import com.pulumi.azuredevops.BuildFolderArgs;
import com.pulumi.azuredevops.BuildFolderPermissions;
import com.pulumi.azuredevops.BuildFolderPermissionsArgs;
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 exampleProject = new Project("exampleProject", ProjectArgs.builder()        
            .workItemTemplate("Agile")
            .versionControl("Git")
            .visibility("private")
            .description("Managed by Terraform")
            .build());

        final var example-readers = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
            .projectId(exampleProject.id())
            .name("Readers")
            .build());

        var exampleBuildFolder = new BuildFolder("exampleBuildFolder", BuildFolderArgs.builder()        
            .projectId(exampleProject.id())
            .path("\\ExampleFolder")
            .description("ExampleFolder description")
            .build());

        var exampleBuildFolderPermissions = new BuildFolderPermissions("exampleBuildFolderPermissions", BuildFolderPermissionsArgs.builder()        
            .projectId(exampleProject.id())
            .path("\\ExampleFolder")
            .principal(example_readers.applyValue(example_readers -> example_readers.id()))
            .permissions(Map.ofEntries(
                Map.entry("ViewBuilds", "Allow"),
                Map.entry("EditBuildQuality", "Allow"),
                Map.entry("RetainIndefinitely", "Allow"),
                Map.entry("DeleteBuilds", "Deny"),
                Map.entry("ManageBuildQualities", "Deny"),
                Map.entry("DestroyBuilds", "Deny"),
                Map.entry("UpdateBuildInformation", "Deny"),
                Map.entry("QueueBuilds", "Allow"),
                Map.entry("ManageBuildQueue", "Deny"),
                Map.entry("StopBuilds", "Allow"),
                Map.entry("ViewBuildDefinition", "Allow"),
                Map.entry("EditBuildDefinition", "Deny"),
                Map.entry("DeleteBuildDefinition", "Deny"),
                Map.entry("AdministerBuildPermissions", "NotSet")
            ))
            .build());

    }
}
import pulumi
import pulumi_azuredevops as azuredevops

example_project = azuredevops.Project("exampleProject",
    work_item_template="Agile",
    version_control="Git",
    visibility="private",
    description="Managed by Terraform")
example_readers = azuredevops.get_group_output(project_id=example_project.id,
    name="Readers")
example_build_folder = azuredevops.BuildFolder("exampleBuildFolder",
    project_id=example_project.id,
    path="\\ExampleFolder",
    description="ExampleFolder description")
example_build_folder_permissions = azuredevops.BuildFolderPermissions("exampleBuildFolderPermissions",
    project_id=example_project.id,
    path="\\ExampleFolder",
    principal=example_readers.id,
    permissions={
        "ViewBuilds": "Allow",
        "EditBuildQuality": "Allow",
        "RetainIndefinitely": "Allow",
        "DeleteBuilds": "Deny",
        "ManageBuildQualities": "Deny",
        "DestroyBuilds": "Deny",
        "UpdateBuildInformation": "Deny",
        "QueueBuilds": "Allow",
        "ManageBuildQueue": "Deny",
        "StopBuilds": "Allow",
        "ViewBuildDefinition": "Allow",
        "EditBuildDefinition": "Deny",
        "DeleteBuildDefinition": "Deny",
        "AdministerBuildPermissions": "NotSet",
    })
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const exampleProject = new azuredevops.Project("exampleProject", {
    workItemTemplate: "Agile",
    versionControl: "Git",
    visibility: "private",
    description: "Managed by Terraform",
});
const example-readers = azuredevops.getGroupOutput({
    projectId: exampleProject.id,
    name: "Readers",
});
const exampleBuildFolder = new azuredevops.BuildFolder("exampleBuildFolder", {
    projectId: exampleProject.id,
    path: "\\ExampleFolder",
    description: "ExampleFolder description",
});
const exampleBuildFolderPermissions = new azuredevops.BuildFolderPermissions("exampleBuildFolderPermissions", {
    projectId: exampleProject.id,
    path: "\\ExampleFolder",
    principal: example_readers.apply(example_readers => example_readers.id),
    permissions: {
        ViewBuilds: "Allow",
        EditBuildQuality: "Allow",
        RetainIndefinitely: "Allow",
        DeleteBuilds: "Deny",
        ManageBuildQualities: "Deny",
        DestroyBuilds: "Deny",
        UpdateBuildInformation: "Deny",
        QueueBuilds: "Allow",
        ManageBuildQueue: "Deny",
        StopBuilds: "Allow",
        ViewBuildDefinition: "Allow",
        EditBuildDefinition: "Deny",
        DeleteBuildDefinition: "Deny",
        AdministerBuildPermissions: "NotSet",
    },
});
resources:
  exampleProject:
    type: azuredevops:Project
    properties:
      workItemTemplate: Agile
      versionControl: Git
      visibility: private
      description: Managed by Terraform
  exampleBuildFolder:
    type: azuredevops:BuildFolder
    properties:
      projectId: ${exampleProject.id}
      path: \ExampleFolder
      description: ExampleFolder description
  exampleBuildFolderPermissions:
    type: azuredevops:BuildFolderPermissions
    properties:
      projectId: ${exampleProject.id}
      path: \ExampleFolder
      principal: ${["example-readers"].id}
      permissions:
        ViewBuilds: Allow
        EditBuildQuality: Allow
        RetainIndefinitely: Allow
        DeleteBuilds: Deny
        ManageBuildQualities: Deny
        DestroyBuilds: Deny
        UpdateBuildInformation: Deny
        QueueBuilds: Allow
        ManageBuildQueue: Deny
        StopBuilds: Allow
        ViewBuildDefinition: Allow
        EditBuildDefinition: Deny
        DeleteBuildDefinition: Deny
        AdministerBuildPermissions: NotSet
variables:
  example-readers:
    fn::invoke:
      Function: azuredevops:getGroup
      Arguments:
        projectId: ${exampleProject.id}
        name: Readers

Create BuildFolderPermissions Resource

new BuildFolderPermissions(name: string, args: BuildFolderPermissionsArgs, opts?: CustomResourceOptions);
@overload
def BuildFolderPermissions(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           path: Optional[str] = None,
                           permissions: Optional[Mapping[str, str]] = None,
                           principal: Optional[str] = None,
                           project_id: Optional[str] = None,
                           replace: Optional[bool] = None)
@overload
def BuildFolderPermissions(resource_name: str,
                           args: BuildFolderPermissionsArgs,
                           opts: Optional[ResourceOptions] = None)
func NewBuildFolderPermissions(ctx *Context, name string, args BuildFolderPermissionsArgs, opts ...ResourceOption) (*BuildFolderPermissions, error)
public BuildFolderPermissions(string name, BuildFolderPermissionsArgs args, CustomResourceOptions? opts = null)
public BuildFolderPermissions(String name, BuildFolderPermissionsArgs args)
public BuildFolderPermissions(String name, BuildFolderPermissionsArgs args, CustomResourceOptions options)
type: azuredevops:BuildFolderPermissions
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args BuildFolderPermissionsArgs
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 BuildFolderPermissionsArgs
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 BuildFolderPermissionsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BuildFolderPermissionsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args BuildFolderPermissionsArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

BuildFolderPermissions Resource Properties

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

Inputs

The BuildFolderPermissions resource accepts the following input properties:

Path string

The folder path to assign the permissions.

Permissions Dictionary<string, string>

the permissions to assign. The following permissions are available.

Principal string

The group principal to assign the permissions.

ProjectId string

The ID of the project to assign the permissions.

Replace bool

Replace (true) or merge (false) the permissions. Default: true.

Path string

The folder path to assign the permissions.

Permissions map[string]string

the permissions to assign. The following permissions are available.

Principal string

The group principal to assign the permissions.

ProjectId string

The ID of the project to assign the permissions.

Replace bool

Replace (true) or merge (false) the permissions. Default: true.

path String

The folder path to assign the permissions.

permissions Map<String,String>

the permissions to assign. The following permissions are available.

principal String

The group principal to assign the permissions.

projectId String

The ID of the project to assign the permissions.

replace Boolean

Replace (true) or merge (false) the permissions. Default: true.

path string

The folder path to assign the permissions.

permissions {[key: string]: string}

the permissions to assign. The following permissions are available.

principal string

The group principal to assign the permissions.

projectId string

The ID of the project to assign the permissions.

replace boolean

Replace (true) or merge (false) the permissions. Default: true.

path str

The folder path to assign the permissions.

permissions Mapping[str, str]

the permissions to assign. The following permissions are available.

principal str

The group principal to assign the permissions.

project_id str

The ID of the project to assign the permissions.

replace bool

Replace (true) or merge (false) the permissions. Default: true.

path String

The folder path to assign the permissions.

permissions Map<String>

the permissions to assign. The following permissions are available.

principal String

The group principal to assign the permissions.

projectId String

The ID of the project to assign the permissions.

replace Boolean

Replace (true) or merge (false) the permissions. Default: true.

Outputs

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

Get an existing BuildFolderPermissions 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?: BuildFolderPermissionsState, opts?: CustomResourceOptions): BuildFolderPermissions
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        path: Optional[str] = None,
        permissions: Optional[Mapping[str, str]] = None,
        principal: Optional[str] = None,
        project_id: Optional[str] = None,
        replace: Optional[bool] = None) -> BuildFolderPermissions
func GetBuildFolderPermissions(ctx *Context, name string, id IDInput, state *BuildFolderPermissionsState, opts ...ResourceOption) (*BuildFolderPermissions, error)
public static BuildFolderPermissions Get(string name, Input<string> id, BuildFolderPermissionsState? state, CustomResourceOptions? opts = null)
public static BuildFolderPermissions get(String name, Output<String> id, BuildFolderPermissionsState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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:
Path string

The folder path to assign the permissions.

Permissions Dictionary<string, string>

the permissions to assign. The following permissions are available.

Principal string

The group principal to assign the permissions.

ProjectId string

The ID of the project to assign the permissions.

Replace bool

Replace (true) or merge (false) the permissions. Default: true.

Path string

The folder path to assign the permissions.

Permissions map[string]string

the permissions to assign. The following permissions are available.

Principal string

The group principal to assign the permissions.

ProjectId string

The ID of the project to assign the permissions.

Replace bool

Replace (true) or merge (false) the permissions. Default: true.

path String

The folder path to assign the permissions.

permissions Map<String,String>

the permissions to assign. The following permissions are available.

principal String

The group principal to assign the permissions.

projectId String

The ID of the project to assign the permissions.

replace Boolean

Replace (true) or merge (false) the permissions. Default: true.

path string

The folder path to assign the permissions.

permissions {[key: string]: string}

the permissions to assign. The following permissions are available.

principal string

The group principal to assign the permissions.

projectId string

The ID of the project to assign the permissions.

replace boolean

Replace (true) or merge (false) the permissions. Default: true.

path str

The folder path to assign the permissions.

permissions Mapping[str, str]

the permissions to assign. The following permissions are available.

principal str

The group principal to assign the permissions.

project_id str

The ID of the project to assign the permissions.

replace bool

Replace (true) or merge (false) the permissions. Default: true.

path String

The folder path to assign the permissions.

permissions Map<String>

the permissions to assign. The following permissions are available.

principal String

The group principal to assign the permissions.

projectId String

The ID of the project to assign the permissions.

replace Boolean

Replace (true) or merge (false) the permissions. Default: true.

Import

The resource does not support import.

Package Details

Repository
Azure DevOps pulumi/pulumi-azuredevops
License
Apache-2.0
Notes

This Pulumi package is based on the azuredevops Terraform Provider.