1. Packages
  2. Azuredevops Provider
  3. API Docs
  4. IterativePermissions
Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi

azuredevops.IterativePermissions

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi

    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.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = new azuredevops.Project("example", {
        name: "Example Project",
        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",
        },
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.Project("example",
        name="Example Project",
        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",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/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{
    			Name:             pulumi.String("Example Project"),
    			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: pulumi.String(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: pulumi.String(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
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureDevOps.Project("example", new()
        {
            Name = "Example Project",
            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 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()
                .name("Example Project")
                .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());
    
        }
    }
    
    resources:
      example:
        type: azuredevops:Project
        properties:
          name: Example Project
          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
    

    PAT Permissions Required

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

    Create IterativePermissions Resource

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

    Constructor syntax

    new IterativePermissions(name: string, args: IterativePermissionsArgs, opts?: CustomResourceOptions);
    @overload
    def IterativePermissions(resource_name: str,
                             args: IterativePermissionsArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def IterativePermissions(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             permissions: Optional[Mapping[str, str]] = None,
                             principal: Optional[str] = None,
                             project_id: Optional[str] = None,
                             path: Optional[str] = None,
                             replace: Optional[bool] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var iterativePermissionsResource = new AzureDevOps.IterativePermissions("iterativePermissionsResource", new()
    {
        Permissions = 
        {
            { "string", "string" },
        },
        Principal = "string",
        ProjectId = "string",
        Path = "string",
        Replace = false,
    });
    
    example, err := azuredevops.NewIterativePermissions(ctx, "iterativePermissionsResource", &azuredevops.IterativePermissionsArgs{
    	Permissions: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Principal: pulumi.String("string"),
    	ProjectId: pulumi.String("string"),
    	Path:      pulumi.String("string"),
    	Replace:   pulumi.Bool(false),
    })
    
    var iterativePermissionsResource = new IterativePermissions("iterativePermissionsResource", IterativePermissionsArgs.builder()
        .permissions(Map.of("string", "string"))
        .principal("string")
        .projectId("string")
        .path("string")
        .replace(false)
        .build());
    
    iterative_permissions_resource = azuredevops.IterativePermissions("iterativePermissionsResource",
        permissions={
            "string": "string",
        },
        principal="string",
        project_id="string",
        path="string",
        replace=False)
    
    const iterativePermissionsResource = new azuredevops.IterativePermissions("iterativePermissionsResource", {
        permissions: {
            string: "string",
        },
        principal: "string",
        projectId: "string",
        path: "string",
        replace: false,
    });
    
    type: azuredevops:IterativePermissions
    properties:
        path: string
        permissions:
            string: string
        principal: string
        projectId: string
        replace: false
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    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.
    ProjectId 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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    Path string
    The name of the branch to assign the permissions.
    Replace bool

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    path String
    The name of the branch to assign the permissions.
    replace Boolean

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    path string
    The name of the branch to assign the permissions.
    replace boolean

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    path String
    The name of the branch to assign the permissions.
    replace Boolean

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    The following state arguments are supported:
    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.
    ProjectId string
    The ID of the project to assign the permissions.
    Replace bool

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    ProjectId string
    The ID of the project to assign the permissions.
    Replace bool

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    projectId String
    The ID of the project to assign the permissions.
    replace Boolean

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    projectId string
    The ID of the project to assign the permissions.
    replace boolean

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    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.
    projectId String
    The ID of the project to assign the permissions.
    replace Boolean

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

    | Permission | Description | |-----------------|--------------------------------| | GENERIC_READ | View permissions for this node | | GENERIC_WRITE | Edit this node | | CREATE_CHILDREN | Create child nodes | | DELETE | Delete this node |

    Import

    The resource does not support import.

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

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi