1. Packages
  2. Octopusdeploy Provider
  3. API Docs
  4. UserRole
octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs

octopusdeploy.UserRole

Explore with Pulumi AI

octopusdeploy logo
octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs

    This resource manages user roles in Octopus Deploy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as octopusdeploy from "@pulumi/octopusdeploy";
    
    const example = new octopusdeploy.UserRole("example", {
        canBeDeleted: true,
        description: "Responsible for all development-related operations.",
        grantedSpacePermissions: [
            "DeploymentCreate",
            "DeploymentDelete",
            "DeploymentView",
        ],
        grantedSystemPermissions: ["SpaceCreate"],
        spacePermissionDescriptions: [
            "Delete deployments (restrictable to Environments, Projects, Tenants)",
            "Deploy releases to target environments (restrictable to Environments, Projects, Tenants)",
            "View deployments (restrictable to Environments, Projects, Tenants)",
        ],
    });
    
    import pulumi
    import pulumi_octopusdeploy as octopusdeploy
    
    example = octopusdeploy.UserRole("example",
        can_be_deleted=True,
        description="Responsible for all development-related operations.",
        granted_space_permissions=[
            "DeploymentCreate",
            "DeploymentDelete",
            "DeploymentView",
        ],
        granted_system_permissions=["SpaceCreate"],
        space_permission_descriptions=[
            "Delete deployments (restrictable to Environments, Projects, Tenants)",
            "Deploy releases to target environments (restrictable to Environments, Projects, Tenants)",
            "View deployments (restrictable to Environments, Projects, Tenants)",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/octopusdeploy/octopusdeploy"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := octopusdeploy.NewUserRole(ctx, "example", &octopusdeploy.UserRoleArgs{
    			CanBeDeleted: pulumi.Bool(true),
    			Description:  pulumi.String("Responsible for all development-related operations."),
    			GrantedSpacePermissions: pulumi.StringArray{
    				pulumi.String("DeploymentCreate"),
    				pulumi.String("DeploymentDelete"),
    				pulumi.String("DeploymentView"),
    			},
    			GrantedSystemPermissions: pulumi.StringArray{
    				pulumi.String("SpaceCreate"),
    			},
    			SpacePermissionDescriptions: pulumi.StringArray{
    				pulumi.String("Delete deployments (restrictable to Environments, Projects, Tenants)"),
    				pulumi.String("Deploy releases to target environments (restrictable to Environments, Projects, Tenants)"),
    				pulumi.String("View deployments (restrictable to Environments, Projects, Tenants)"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Octopusdeploy = Pulumi.Octopusdeploy;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Octopusdeploy.UserRole("example", new()
        {
            CanBeDeleted = true,
            Description = "Responsible for all development-related operations.",
            GrantedSpacePermissions = new[]
            {
                "DeploymentCreate",
                "DeploymentDelete",
                "DeploymentView",
            },
            GrantedSystemPermissions = new[]
            {
                "SpaceCreate",
            },
            SpacePermissionDescriptions = new[]
            {
                "Delete deployments (restrictable to Environments, Projects, Tenants)",
                "Deploy releases to target environments (restrictable to Environments, Projects, Tenants)",
                "View deployments (restrictable to Environments, Projects, Tenants)",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.octopusdeploy.UserRole;
    import com.pulumi.octopusdeploy.UserRoleArgs;
    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 UserRole("example", UserRoleArgs.builder()
                .canBeDeleted(true)
                .description("Responsible for all development-related operations.")
                .grantedSpacePermissions(            
                    "DeploymentCreate",
                    "DeploymentDelete",
                    "DeploymentView")
                .grantedSystemPermissions("SpaceCreate")
                .spacePermissionDescriptions(            
                    "Delete deployments (restrictable to Environments, Projects, Tenants)",
                    "Deploy releases to target environments (restrictable to Environments, Projects, Tenants)",
                    "View deployments (restrictable to Environments, Projects, Tenants)")
                .build());
    
        }
    }
    
    resources:
      example:
        type: octopusdeploy:UserRole
        properties:
          canBeDeleted: true
          description: Responsible for all development-related operations.
          grantedSpacePermissions:
            - DeploymentCreate
            - DeploymentDelete
            - DeploymentView
          grantedSystemPermissions:
            - SpaceCreate
          spacePermissionDescriptions:
            - Delete deployments (restrictable to Environments, Projects, Tenants)
            - Deploy releases to target environments (restrictable to Environments, Projects, Tenants)
            - View deployments (restrictable to Environments, Projects, Tenants)
    

    Create UserRole Resource

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

    Constructor syntax

    new UserRole(name: string, args?: UserRoleArgs, opts?: CustomResourceOptions);
    @overload
    def UserRole(resource_name: str,
                 args: Optional[UserRoleArgs] = None,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserRole(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 can_be_deleted: Optional[bool] = None,
                 description: Optional[str] = None,
                 granted_space_permissions: Optional[Sequence[str]] = None,
                 granted_system_permissions: Optional[Sequence[str]] = None,
                 name: Optional[str] = None,
                 space_permission_descriptions: Optional[Sequence[str]] = None,
                 supported_restrictions: Optional[Sequence[str]] = None,
                 system_permission_descriptions: Optional[Sequence[str]] = None,
                 user_role_id: Optional[str] = None)
    func NewUserRole(ctx *Context, name string, args *UserRoleArgs, opts ...ResourceOption) (*UserRole, error)
    public UserRole(string name, UserRoleArgs? args = null, CustomResourceOptions? opts = null)
    public UserRole(String name, UserRoleArgs args)
    public UserRole(String name, UserRoleArgs args, CustomResourceOptions options)
    
    type: octopusdeploy:UserRole
    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 UserRoleArgs
    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 UserRoleArgs
    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 UserRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserRoleArgs
    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 userRoleResource = new Octopusdeploy.UserRole("userRoleResource", new()
    {
        CanBeDeleted = false,
        Description = "string",
        GrantedSpacePermissions = new[]
        {
            "string",
        },
        GrantedSystemPermissions = new[]
        {
            "string",
        },
        Name = "string",
        SpacePermissionDescriptions = new[]
        {
            "string",
        },
        SupportedRestrictions = new[]
        {
            "string",
        },
        SystemPermissionDescriptions = new[]
        {
            "string",
        },
        UserRoleId = "string",
    });
    
    example, err := octopusdeploy.NewUserRole(ctx, "userRoleResource", &octopusdeploy.UserRoleArgs{
    	CanBeDeleted: pulumi.Bool(false),
    	Description:  pulumi.String("string"),
    	GrantedSpacePermissions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	GrantedSystemPermissions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    	SpacePermissionDescriptions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SupportedRestrictions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SystemPermissionDescriptions: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	UserRoleId: pulumi.String("string"),
    })
    
    var userRoleResource = new UserRole("userRoleResource", UserRoleArgs.builder()
        .canBeDeleted(false)
        .description("string")
        .grantedSpacePermissions("string")
        .grantedSystemPermissions("string")
        .name("string")
        .spacePermissionDescriptions("string")
        .supportedRestrictions("string")
        .systemPermissionDescriptions("string")
        .userRoleId("string")
        .build());
    
    user_role_resource = octopusdeploy.UserRole("userRoleResource",
        can_be_deleted=False,
        description="string",
        granted_space_permissions=["string"],
        granted_system_permissions=["string"],
        name="string",
        space_permission_descriptions=["string"],
        supported_restrictions=["string"],
        system_permission_descriptions=["string"],
        user_role_id="string")
    
    const userRoleResource = new octopusdeploy.UserRole("userRoleResource", {
        canBeDeleted: false,
        description: "string",
        grantedSpacePermissions: ["string"],
        grantedSystemPermissions: ["string"],
        name: "string",
        spacePermissionDescriptions: ["string"],
        supportedRestrictions: ["string"],
        systemPermissionDescriptions: ["string"],
        userRoleId: "string",
    });
    
    type: octopusdeploy:UserRole
    properties:
        canBeDeleted: false
        description: string
        grantedSpacePermissions:
            - string
        grantedSystemPermissions:
            - string
        name: string
        spacePermissionDescriptions:
            - string
        supportedRestrictions:
            - string
        systemPermissionDescriptions:
            - string
        userRoleId: string
    

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

    CanBeDeleted bool
    Description string
    The description of this user role.
    GrantedSpacePermissions List<string>
    GrantedSystemPermissions List<string>
    Name string
    The name of this resource.
    SpacePermissionDescriptions List<string>
    SupportedRestrictions List<string>
    SystemPermissionDescriptions List<string>
    UserRoleId string
    The unique ID for this resource.
    CanBeDeleted bool
    Description string
    The description of this user role.
    GrantedSpacePermissions []string
    GrantedSystemPermissions []string
    Name string
    The name of this resource.
    SpacePermissionDescriptions []string
    SupportedRestrictions []string
    SystemPermissionDescriptions []string
    UserRoleId string
    The unique ID for this resource.
    canBeDeleted Boolean
    description String
    The description of this user role.
    grantedSpacePermissions List<String>
    grantedSystemPermissions List<String>
    name String
    The name of this resource.
    spacePermissionDescriptions List<String>
    supportedRestrictions List<String>
    systemPermissionDescriptions List<String>
    userRoleId String
    The unique ID for this resource.
    canBeDeleted boolean
    description string
    The description of this user role.
    grantedSpacePermissions string[]
    grantedSystemPermissions string[]
    name string
    The name of this resource.
    spacePermissionDescriptions string[]
    supportedRestrictions string[]
    systemPermissionDescriptions string[]
    userRoleId string
    The unique ID for this resource.
    can_be_deleted bool
    description str
    The description of this user role.
    granted_space_permissions Sequence[str]
    granted_system_permissions Sequence[str]
    name str
    The name of this resource.
    space_permission_descriptions Sequence[str]
    supported_restrictions Sequence[str]
    system_permission_descriptions Sequence[str]
    user_role_id str
    The unique ID for this resource.
    canBeDeleted Boolean
    description String
    The description of this user role.
    grantedSpacePermissions List<String>
    grantedSystemPermissions List<String>
    name String
    The name of this resource.
    spacePermissionDescriptions List<String>
    supportedRestrictions List<String>
    systemPermissionDescriptions List<String>
    userRoleId String
    The unique ID for this resource.

    Outputs

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

    Get an existing UserRole 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?: UserRoleState, opts?: CustomResourceOptions): UserRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            can_be_deleted: Optional[bool] = None,
            description: Optional[str] = None,
            granted_space_permissions: Optional[Sequence[str]] = None,
            granted_system_permissions: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            space_permission_descriptions: Optional[Sequence[str]] = None,
            supported_restrictions: Optional[Sequence[str]] = None,
            system_permission_descriptions: Optional[Sequence[str]] = None,
            user_role_id: Optional[str] = None) -> UserRole
    func GetUserRole(ctx *Context, name string, id IDInput, state *UserRoleState, opts ...ResourceOption) (*UserRole, error)
    public static UserRole Get(string name, Input<string> id, UserRoleState? state, CustomResourceOptions? opts = null)
    public static UserRole get(String name, Output<String> id, UserRoleState state, CustomResourceOptions options)
    resources:  _:    type: octopusdeploy:UserRole    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:
    CanBeDeleted bool
    Description string
    The description of this user role.
    GrantedSpacePermissions List<string>
    GrantedSystemPermissions List<string>
    Name string
    The name of this resource.
    SpacePermissionDescriptions List<string>
    SupportedRestrictions List<string>
    SystemPermissionDescriptions List<string>
    UserRoleId string
    The unique ID for this resource.
    CanBeDeleted bool
    Description string
    The description of this user role.
    GrantedSpacePermissions []string
    GrantedSystemPermissions []string
    Name string
    The name of this resource.
    SpacePermissionDescriptions []string
    SupportedRestrictions []string
    SystemPermissionDescriptions []string
    UserRoleId string
    The unique ID for this resource.
    canBeDeleted Boolean
    description String
    The description of this user role.
    grantedSpacePermissions List<String>
    grantedSystemPermissions List<String>
    name String
    The name of this resource.
    spacePermissionDescriptions List<String>
    supportedRestrictions List<String>
    systemPermissionDescriptions List<String>
    userRoleId String
    The unique ID for this resource.
    canBeDeleted boolean
    description string
    The description of this user role.
    grantedSpacePermissions string[]
    grantedSystemPermissions string[]
    name string
    The name of this resource.
    spacePermissionDescriptions string[]
    supportedRestrictions string[]
    systemPermissionDescriptions string[]
    userRoleId string
    The unique ID for this resource.
    can_be_deleted bool
    description str
    The description of this user role.
    granted_space_permissions Sequence[str]
    granted_system_permissions Sequence[str]
    name str
    The name of this resource.
    space_permission_descriptions Sequence[str]
    supported_restrictions Sequence[str]
    system_permission_descriptions Sequence[str]
    user_role_id str
    The unique ID for this resource.
    canBeDeleted Boolean
    description String
    The description of this user role.
    grantedSpacePermissions List<String>
    grantedSystemPermissions List<String>
    name String
    The name of this resource.
    spacePermissionDescriptions List<String>
    supportedRestrictions List<String>
    systemPermissionDescriptions List<String>
    userRoleId String
    The unique ID for this resource.

    Import

    $ pulumi import octopusdeploy:index/userRole:UserRole [options] octopusdeploy_user_role.<name> <user-role-id>
    

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

    Package Details

    Repository
    octopusdeploy octopusdeploylabs/terraform-provider-octopusdeploy
    License
    Notes
    This Pulumi package is based on the octopusdeploy Terraform Provider.
    octopusdeploy logo
    octopusdeploy 0.43.1 published on Wednesday, Apr 30, 2025 by octopusdeploylabs