Azure DevOps v2.7.0, Mar 27 23
Azure DevOps v2.7.0, Mar 27 23
azuredevops.IterativePermissions
Explore with Pulumi AI
Manages permissions for an Iteration (Sprint)
Note Permissions can be assigned to group principals and not to single user principals.
Permission levels
Permission for Iterations within Azure DevOps can be applied on two different levels.
Those levels are reflected by specifying (or omitting) values for the arguments project_id
and path
.
Relevant Links
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 example = new AzureDevOps.Project("example", new()
{
WorkItemTemplate = "Agile",
VersionControl = "Git",
Visibility = "private",
Description = "Managed by Terraform",
});
var example_readers = AzureDevOps.GetGroup.Invoke(new()
{
ProjectId = example.Id,
Name = "Readers",
});
var example_root_permissions = new AzureDevOps.IterativePermissions("example-root-permissions", new()
{
ProjectId = example.Id,
Principal = example_readers.Apply(example_readers => example_readers.Apply(getGroupResult => getGroupResult.Id)),
Permissions =
{
{ "CREATE_CHILDREN", "Deny" },
{ "GENERIC_READ", "NotSet" },
{ "DELETE", "Deny" },
},
});
var example_iteration_permissions = new AzureDevOps.IterativePermissions("example-iteration-permissions", new()
{
ProjectId = example.Id,
Principal = example_readers.Apply(example_readers => example_readers.Apply(getGroupResult => getGroupResult.Id)),
Path = "Iteration 1",
Permissions =
{
{ "CREATE_CHILDREN", "Allow" },
{ "GENERIC_READ", "NotSet" },
{ "DELETE", "Allow" },
},
});
});
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 {
example, err := azuredevops.NewProject(ctx, "example", &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: example.ID(),
Name: pulumi.String("Readers"),
}, nil)
_, err = azuredevops.NewIterativePermissions(ctx, "example-root-permissions", &azuredevops.IterativePermissionsArgs{
ProjectId: example.ID(),
Principal: example_readers.ApplyT(func(example_readers azuredevops.GetGroupResult) (*string, error) {
return &example_readers.Id, nil
}).(pulumi.StringPtrOutput),
Permissions: pulumi.StringMap{
"CREATE_CHILDREN": pulumi.String("Deny"),
"GENERIC_READ": pulumi.String("NotSet"),
"DELETE": pulumi.String("Deny"),
},
})
if err != nil {
return err
}
_, err = azuredevops.NewIterativePermissions(ctx, "example-iteration-permissions", &azuredevops.IterativePermissionsArgs{
ProjectId: example.ID(),
Principal: example_readers.ApplyT(func(example_readers azuredevops.GetGroupResult) (*string, error) {
return &example_readers.Id, nil
}).(pulumi.StringPtrOutput),
Path: pulumi.String("Iteration 1"),
Permissions: pulumi.StringMap{
"CREATE_CHILDREN": pulumi.String("Allow"),
"GENERIC_READ": pulumi.String("NotSet"),
"DELETE": pulumi.String("Allow"),
},
})
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.IterativePermissions;
import com.pulumi.azuredevops.IterativePermissionsArgs;
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 Project("example", ProjectArgs.builder()
.workItemTemplate("Agile")
.versionControl("Git")
.visibility("private")
.description("Managed by Terraform")
.build());
final var example-readers = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
.projectId(example.id())
.name("Readers")
.build());
var example_root_permissions = new IterativePermissions("example-root-permissions", IterativePermissionsArgs.builder()
.projectId(example.id())
.principal(example_readers.applyValue(example_readers -> example_readers.id()))
.permissions(Map.ofEntries(
Map.entry("CREATE_CHILDREN", "Deny"),
Map.entry("GENERIC_READ", "NotSet"),
Map.entry("DELETE", "Deny")
))
.build());
var example_iteration_permissions = new IterativePermissions("example-iteration-permissions", IterativePermissionsArgs.builder()
.projectId(example.id())
.principal(example_readers.applyValue(example_readers -> example_readers.id()))
.path("Iteration 1")
.permissions(Map.ofEntries(
Map.entry("CREATE_CHILDREN", "Allow"),
Map.entry("GENERIC_READ", "NotSet"),
Map.entry("DELETE", "Allow")
))
.build());
}
}
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.Project("example",
work_item_template="Agile",
version_control="Git",
visibility="private",
description="Managed by Terraform")
example_readers = azuredevops.get_group_output(project_id=example.id,
name="Readers")
example_root_permissions = azuredevops.IterativePermissions("example-root-permissions",
project_id=example.id,
principal=example_readers.id,
permissions={
"CREATE_CHILDREN": "Deny",
"GENERIC_READ": "NotSet",
"DELETE": "Deny",
})
example_iteration_permissions = azuredevops.IterativePermissions("example-iteration-permissions",
project_id=example.id,
principal=example_readers.id,
path="Iteration 1",
permissions={
"CREATE_CHILDREN": "Allow",
"GENERIC_READ": "NotSet",
"DELETE": "Allow",
})
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const example = new azuredevops.Project("example", {
workItemTemplate: "Agile",
versionControl: "Git",
visibility: "private",
description: "Managed by Terraform",
});
const example-readers = azuredevops.getGroupOutput({
projectId: example.id,
name: "Readers",
});
const example_root_permissions = new azuredevops.IterativePermissions("example-root-permissions", {
projectId: example.id,
principal: example_readers.apply(example_readers => example_readers.id),
permissions: {
CREATE_CHILDREN: "Deny",
GENERIC_READ: "NotSet",
DELETE: "Deny",
},
});
const example_iteration_permissions = new azuredevops.IterativePermissions("example-iteration-permissions", {
projectId: example.id,
principal: example_readers.apply(example_readers => example_readers.id),
path: "Iteration 1",
permissions: {
CREATE_CHILDREN: "Allow",
GENERIC_READ: "NotSet",
DELETE: "Allow",
},
});
resources:
example:
type: azuredevops:Project
properties:
workItemTemplate: Agile
versionControl: Git
visibility: private
description: Managed by Terraform
example-root-permissions:
type: azuredevops:IterativePermissions
properties:
projectId: ${example.id}
principal: ${["example-readers"].id}
permissions:
CREATE_CHILDREN: Deny
GENERIC_READ: NotSet
DELETE: Deny
example-iteration-permissions:
type: azuredevops:IterativePermissions
properties:
projectId: ${example.id}
principal: ${["example-readers"].id}
path: Iteration 1
permissions:
CREATE_CHILDREN: Allow
GENERIC_READ: NotSet
DELETE: Allow
variables:
example-readers:
fn::invoke:
Function: azuredevops:getGroup
Arguments:
projectId: ${example.id}
name: Readers
Create IterativePermissions Resource
new IterativePermissions(name: string, args: IterativePermissionsArgs, opts?: CustomResourceOptions);
@overload
def IterativePermissions(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 IterativePermissions(resource_name: str,
args: IterativePermissionsArgs,
opts: Optional[ResourceOptions] = None)
func NewIterativePermissions(ctx *Context, name string, args IterativePermissionsArgs, opts ...ResourceOption) (*IterativePermissions, error)
public IterativePermissions(string name, IterativePermissionsArgs args, CustomResourceOptions? opts = null)
public IterativePermissions(String name, IterativePermissionsArgs args)
public IterativePermissions(String name, IterativePermissionsArgs args, CustomResourceOptions options)
type: azuredevops:IterativePermissions
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IterativePermissionsArgs
- 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 IterativePermissionsArgs
- 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 IterativePermissionsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IterativePermissionsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IterativePermissionsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
IterativePermissions 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 IterativePermissions resource accepts the following input properties:
- Permissions Dictionary<string, string>
the permissions to assign. The following permissions are available.
- Principal string
The group principal to assign the permissions.
- Project
Id string The ID of the project to assign the permissions.
- Path string
The name of the branch to assign the permissions.
- Replace bool
Replace (
true
) or merge (false
) the permissions. Default:true
- Permissions map[string]string
the permissions to assign. The following permissions are available.
- Principal string
The group principal to assign the permissions.
- Project
Id string The ID of the project to assign the permissions.
- Path string
The name of the branch to assign the permissions.
- Replace bool
Replace (
true
) or merge (false
) the permissions. Default:true
- permissions Map<String,String>
the permissions to assign. The following permissions are available.
- principal String
The group principal to assign the permissions.
- project
Id String The ID of the project to assign the permissions.
- path String
The name of the branch to assign the permissions.
- replace Boolean
Replace (
true
) or merge (false
) the permissions. Default:true
- permissions {[key: string]: string}
the permissions to assign. The following permissions are available.
- principal string
The group principal to assign the permissions.
- project
Id string The ID of the project to assign the permissions.
- path string
The name of the branch to assign the permissions.
- replace boolean
Replace (
true
) or merge (false
) the permissions. Default:true
- 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.
- path str
The name of the branch to assign the permissions.
- replace bool
Replace (
true
) or merge (false
) the permissions. Default:true
- permissions Map<String>
the permissions to assign. The following permissions are available.
- principal String
The group principal to assign the permissions.
- project
Id String The ID of the project to assign the permissions.
- path String
The name of the branch 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 IterativePermissions 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 IterativePermissions Resource
Get an existing IterativePermissions 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?: IterativePermissionsState, opts?: CustomResourceOptions): IterativePermissions
@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) -> IterativePermissions
func GetIterativePermissions(ctx *Context, name string, id IDInput, state *IterativePermissionsState, opts ...ResourceOption) (*IterativePermissions, error)
public static IterativePermissions Get(string name, Input<string> id, IterativePermissionsState? state, CustomResourceOptions? opts = null)
public static IterativePermissions get(String name, Output<String> id, IterativePermissionsState 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.
- Path string
The name of the branch 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.
- Project
Id string The ID of the project to assign the permissions.
- Replace bool
Replace (
true
) or merge (false
) the permissions. Default:true
- Path string
The name of the branch 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.
- Project
Id string The ID of the project to assign the permissions.
- Replace bool
Replace (
true
) or merge (false
) the permissions. Default:true
- path String
The name of the branch 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.
- project
Id String The ID of the project to assign the permissions.
- replace Boolean
Replace (
true
) or merge (false
) the permissions. Default:true
- path string
The name of the branch 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.
- project
Id string The ID of the project to assign the permissions.
- replace boolean
Replace (
true
) or merge (false
) the permissions. Default:true
- path str
The name of the branch 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 name of the branch 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.
- project
Id 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.