published on Thursday, May 21, 2026 by Pulumi
published on Thursday, May 21, 2026 by Pulumi
Resource for creating role assignments in Harness.
Create RoleAssignments Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RoleAssignments(name: string, args?: RoleAssignmentsArgs, opts?: CustomResourceOptions);@overload
def RoleAssignments(resource_name: str,
args: Optional[RoleAssignmentsArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def RoleAssignments(resource_name: str,
opts: Optional[ResourceOptions] = None,
disabled: Optional[bool] = None,
identifier: Optional[str] = None,
managed: Optional[bool] = None,
org_id: Optional[str] = None,
principals: Optional[Sequence[RoleAssignmentsPrincipalArgs]] = None,
project_id: Optional[str] = None,
resource_group_identifier: Optional[str] = None,
role_identifier: Optional[str] = None,
role_reference: Optional[RoleAssignmentsRoleReferenceArgs] = None)func NewRoleAssignments(ctx *Context, name string, args *RoleAssignmentsArgs, opts ...ResourceOption) (*RoleAssignments, error)public RoleAssignments(string name, RoleAssignmentsArgs? args = null, CustomResourceOptions? opts = null)
public RoleAssignments(String name, RoleAssignmentsArgs args)
public RoleAssignments(String name, RoleAssignmentsArgs args, CustomResourceOptions options)
type: harness:platform:RoleAssignments
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "harness_platform_roleassignments" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args RoleAssignmentsArgs
- 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 RoleAssignmentsArgs
- 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 RoleAssignmentsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RoleAssignmentsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RoleAssignmentsArgs
- 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 roleAssignmentsResource = new Harness.Platform.RoleAssignments("roleAssignmentsResource", new()
{
Disabled = false,
Identifier = "string",
Managed = false,
OrgId = "string",
Principals = new[]
{
new Harness.Platform.Inputs.RoleAssignmentsPrincipalArgs
{
Type = "string",
Identifier = "string",
ScopeLevel = "string",
},
},
ProjectId = "string",
ResourceGroupIdentifier = "string",
RoleIdentifier = "string",
RoleReference = new Harness.Platform.Inputs.RoleAssignmentsRoleReferenceArgs
{
Identifier = "string",
ScopeLevel = "string",
},
});
example, err := platform.NewRoleAssignments(ctx, "roleAssignmentsResource", &platform.RoleAssignmentsArgs{
Disabled: pulumi.Bool(false),
Identifier: pulumi.String("string"),
Managed: pulumi.Bool(false),
OrgId: pulumi.String("string"),
Principals: platform.RoleAssignmentsPrincipalArray{
&platform.RoleAssignmentsPrincipalArgs{
Type: pulumi.String("string"),
Identifier: pulumi.String("string"),
ScopeLevel: pulumi.String("string"),
},
},
ProjectId: pulumi.String("string"),
ResourceGroupIdentifier: pulumi.String("string"),
RoleIdentifier: pulumi.String("string"),
RoleReference: &platform.RoleAssignmentsRoleReferenceArgs{
Identifier: pulumi.String("string"),
ScopeLevel: pulumi.String("string"),
},
})
resource "harness_platform_roleassignments" "roleAssignmentsResource" {
disabled = false
identifier = "string"
managed = false
org_id = "string"
principals {
type = "string"
identifier = "string"
scope_level = "string"
}
project_id = "string"
resource_group_identifier = "string"
role_identifier = "string"
role_reference = {
identifier = "string"
scope_level = "string"
}
}
var roleAssignmentsResource = new RoleAssignments("roleAssignmentsResource", RoleAssignmentsArgs.builder()
.disabled(false)
.identifier("string")
.managed(false)
.orgId("string")
.principals(RoleAssignmentsPrincipalArgs.builder()
.type("string")
.identifier("string")
.scopeLevel("string")
.build())
.projectId("string")
.resourceGroupIdentifier("string")
.roleIdentifier("string")
.roleReference(RoleAssignmentsRoleReferenceArgs.builder()
.identifier("string")
.scopeLevel("string")
.build())
.build());
role_assignments_resource = harness.platform.RoleAssignments("roleAssignmentsResource",
disabled=False,
identifier="string",
managed=False,
org_id="string",
principals=[{
"type": "string",
"identifier": "string",
"scope_level": "string",
}],
project_id="string",
resource_group_identifier="string",
role_identifier="string",
role_reference={
"identifier": "string",
"scope_level": "string",
})
const roleAssignmentsResource = new harness.platform.RoleAssignments("roleAssignmentsResource", {
disabled: false,
identifier: "string",
managed: false,
orgId: "string",
principals: [{
type: "string",
identifier: "string",
scopeLevel: "string",
}],
projectId: "string",
resourceGroupIdentifier: "string",
roleIdentifier: "string",
roleReference: {
identifier: "string",
scopeLevel: "string",
},
});
type: harness:platform:RoleAssignments
properties:
disabled: false
identifier: string
managed: false
orgId: string
principals:
- identifier: string
scopeLevel: string
type: string
projectId: string
resourceGroupIdentifier: string
roleIdentifier: string
roleReference:
identifier: string
scopeLevel: string
RoleAssignments 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 RoleAssignments resource accepts the following input properties:
- Disabled bool
- Disabled or not.
- Identifier string
- Identifier for role assignment.
- Managed bool
- Managed or not.
- Org
Id string - Org identifier.
- Principals
List<Role
Assignments Principal> - Principal.
- Project
Id string - Project Identifier
- Resource
Group stringIdentifier - Resource group identifier.
- Role
Identifier string - Role identifier.
- Role
Reference RoleAssignments Role Reference - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- Disabled bool
- Disabled or not.
- Identifier string
- Identifier for role assignment.
- Managed bool
- Managed or not.
- Org
Id string - Org identifier.
- Principals
[]Role
Assignments Principal Args - Principal.
- Project
Id string - Project Identifier
- Resource
Group stringIdentifier - Resource group identifier.
- Role
Identifier string - Role identifier.
- Role
Reference RoleAssignments Role Reference Args - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled bool
- Disabled or not.
- identifier string
- Identifier for role assignment.
- managed bool
- Managed or not.
- org_
id string - Org identifier.
- principals list(object)
- Principal.
- project_
id string - Project Identifier
- resource_
group_ stringidentifier - Resource group identifier.
- role_
identifier string - Role identifier.
- role_
reference object - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled Boolean
- Disabled or not.
- identifier String
- Identifier for role assignment.
- managed Boolean
- Managed or not.
- org
Id String - Org identifier.
- principals
List<Role
Assignments Principal> - Principal.
- project
Id String - Project Identifier
- resource
Group StringIdentifier - Resource group identifier.
- role
Identifier String - Role identifier.
- role
Reference RoleAssignments Role Reference - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled boolean
- Disabled or not.
- identifier string
- Identifier for role assignment.
- managed boolean
- Managed or not.
- org
Id string - Org identifier.
- principals
Role
Assignments Principal[] - Principal.
- project
Id string - Project Identifier
- resource
Group stringIdentifier - Resource group identifier.
- role
Identifier string - Role identifier.
- role
Reference RoleAssignments Role Reference - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled bool
- Disabled or not.
- identifier str
- Identifier for role assignment.
- managed bool
- Managed or not.
- org_
id str - Org identifier.
- principals
Sequence[Role
Assignments Principal Args] - Principal.
- project_
id str - Project Identifier
- resource_
group_ stridentifier - Resource group identifier.
- role_
identifier str - Role identifier.
- role_
reference RoleAssignments Role Reference Args - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled Boolean
- Disabled or not.
- identifier String
- Identifier for role assignment.
- managed Boolean
- Managed or not.
- org
Id String - Org identifier.
- principals List<Property Map>
- Principal.
- project
Id String - Project Identifier
- resource
Group StringIdentifier - Resource group identifier.
- role
Identifier String - Role identifier.
- role
Reference Property Map - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
Outputs
All input properties are implicitly available as output properties. Additionally, the RoleAssignments 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 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 RoleAssignments Resource
Get an existing RoleAssignments 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?: RoleAssignmentsState, opts?: CustomResourceOptions): RoleAssignments@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
disabled: Optional[bool] = None,
identifier: Optional[str] = None,
managed: Optional[bool] = None,
org_id: Optional[str] = None,
principals: Optional[Sequence[RoleAssignmentsPrincipalArgs]] = None,
project_id: Optional[str] = None,
resource_group_identifier: Optional[str] = None,
role_identifier: Optional[str] = None,
role_reference: Optional[RoleAssignmentsRoleReferenceArgs] = None) -> RoleAssignmentsfunc GetRoleAssignments(ctx *Context, name string, id IDInput, state *RoleAssignmentsState, opts ...ResourceOption) (*RoleAssignments, error)public static RoleAssignments Get(string name, Input<string> id, RoleAssignmentsState? state, CustomResourceOptions? opts = null)public static RoleAssignments get(String name, Output<String> id, RoleAssignmentsState state, CustomResourceOptions options)resources: _: type: harness:platform:RoleAssignments get: id: ${id}import {
to = harness_platform_roleassignments.example
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.
- Disabled bool
- Disabled or not.
- Identifier string
- Identifier for role assignment.
- Managed bool
- Managed or not.
- Org
Id string - Org identifier.
- Principals
List<Role
Assignments Principal> - Principal.
- Project
Id string - Project Identifier
- Resource
Group stringIdentifier - Resource group identifier.
- Role
Identifier string - Role identifier.
- Role
Reference RoleAssignments Role Reference - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- Disabled bool
- Disabled or not.
- Identifier string
- Identifier for role assignment.
- Managed bool
- Managed or not.
- Org
Id string - Org identifier.
- Principals
[]Role
Assignments Principal Args - Principal.
- Project
Id string - Project Identifier
- Resource
Group stringIdentifier - Resource group identifier.
- Role
Identifier string - Role identifier.
- Role
Reference RoleAssignments Role Reference Args - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled bool
- Disabled or not.
- identifier string
- Identifier for role assignment.
- managed bool
- Managed or not.
- org_
id string - Org identifier.
- principals list(object)
- Principal.
- project_
id string - Project Identifier
- resource_
group_ stringidentifier - Resource group identifier.
- role_
identifier string - Role identifier.
- role_
reference object - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled Boolean
- Disabled or not.
- identifier String
- Identifier for role assignment.
- managed Boolean
- Managed or not.
- org
Id String - Org identifier.
- principals
List<Role
Assignments Principal> - Principal.
- project
Id String - Project Identifier
- resource
Group StringIdentifier - Resource group identifier.
- role
Identifier String - Role identifier.
- role
Reference RoleAssignments Role Reference - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled boolean
- Disabled or not.
- identifier string
- Identifier for role assignment.
- managed boolean
- Managed or not.
- org
Id string - Org identifier.
- principals
Role
Assignments Principal[] - Principal.
- project
Id string - Project Identifier
- resource
Group stringIdentifier - Resource group identifier.
- role
Identifier string - Role identifier.
- role
Reference RoleAssignments Role Reference - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled bool
- Disabled or not.
- identifier str
- Identifier for role assignment.
- managed bool
- Managed or not.
- org_
id str - Org identifier.
- principals
Sequence[Role
Assignments Principal Args] - Principal.
- project_
id str - Project Identifier
- resource_
group_ stridentifier - Resource group identifier.
- role_
identifier str - Role identifier.
- role_
reference RoleAssignments Role Reference Args - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
- disabled Boolean
- Disabled or not.
- identifier String
- Identifier for role assignment.
- managed Boolean
- Managed or not.
- org
Id String - Org identifier.
- principals List<Property Map>
- Principal.
- project
Id String - Project Identifier
- resource
Group StringIdentifier - Resource group identifier.
- role
Identifier String - Role identifier.
- role
Reference Property Map - Role reference. Used to reference roles from a higher scope (e.g., an org-level role in a project-level assignment). When both roleidentifier and rolereference are set, they must point to the same role.
Supporting Types
RoleAssignmentsPrincipal, RoleAssignmentsPrincipalArgs
- Type string
- Type.
- Identifier string
- Identifier.
- Scope
Level string - Scope level. Valid values are 'account', 'organization', or 'project'.
- Type string
- Type.
- Identifier string
- Identifier.
- Scope
Level string - Scope level. Valid values are 'account', 'organization', or 'project'.
- type string
- Type.
- identifier string
- Identifier.
- scope_
level string - Scope level. Valid values are 'account', 'organization', or 'project'.
- type String
- Type.
- identifier String
- Identifier.
- scope
Level String - Scope level. Valid values are 'account', 'organization', or 'project'.
- type string
- Type.
- identifier string
- Identifier.
- scope
Level string - Scope level. Valid values are 'account', 'organization', or 'project'.
- type str
- Type.
- identifier str
- Identifier.
- scope_
level str - Scope level. Valid values are 'account', 'organization', or 'project'.
- type String
- Type.
- identifier String
- Identifier.
- scope
Level String - Scope level. Valid values are 'account', 'organization', or 'project'.
RoleAssignmentsRoleReference, RoleAssignmentsRoleReferenceArgs
- Identifier string
- Identifier.
- Scope
Level string - Scope level. Valid values are 'account', 'organization', or 'project'.
- Identifier string
- Identifier.
- Scope
Level string - Scope level. Valid values are 'account', 'organization', or 'project'.
- identifier string
- Identifier.
- scope_
level string - Scope level. Valid values are 'account', 'organization', or 'project'.
- identifier String
- Identifier.
- scope
Level String - Scope level. Valid values are 'account', 'organization', or 'project'.
- identifier string
- Identifier.
- scope
Level string - Scope level. Valid values are 'account', 'organization', or 'project'.
- identifier str
- Identifier.
- scope_
level str - Scope level. Valid values are 'account', 'organization', or 'project'.
- identifier String
- Identifier.
- scope
Level String - Scope level. Valid values are 'account', 'organization', or 'project'.
Import
The pulumi import command can be used, for example:
Import account level role assignments
$ pulumi import harness:platform/roleAssignments:RoleAssignments example <role_assignments_id>
Import org level role assignments
$ pulumi import harness:platform/roleAssignments:RoleAssignments example <ord_id>/<role_assignments_id>
Import project level role assignments
$ pulumi import harness:platform/roleAssignments:RoleAssignments example <org_id>/<project_id>/<role_assignments_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harnessTerraform Provider.
published on Thursday, May 21, 2026 by Pulumi