published on Friday, Nov 13, 2026 by cloudfoundry
published on Friday, Nov 13, 2026 by cloudfoundry
Provides a Cloud Foundry resource for assigning org roles.(Updating a role is not supported according to the docs). Note : If a role is assigned to a non existent user, user will be created automatically in the Cloud Controller’s database for an Admin as well as Org Manager provided the cc.allow_user_creation_by_org_manager field is enabled. Refer here for further details.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudfoundry from "@pulumi/cloudfoundry";
const myRole = new cloudfoundry.OrgRole("my_role", {
username: "test123@example.com",
type: "organization_user",
org: "784b4cd0-4771-4e4d-9052-a07e178bae56",
});
import pulumi
import pulumi_cloudfoundry as cloudfoundry
my_role = cloudfoundry.OrgRole("my_role",
username="test123@example.com",
type="organization_user",
org="784b4cd0-4771-4e4d-9052-a07e178bae56")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/cloudfoundry/cloudfoundry"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloudfoundry.NewOrgRole(ctx, "my_role", &cloudfoundry.OrgRoleArgs{
Username: pulumi.String("test123@example.com"),
Type: pulumi.String("organization_user"),
Org: pulumi.String("784b4cd0-4771-4e4d-9052-a07e178bae56"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudfoundry = Pulumi.Cloudfoundry;
return await Deployment.RunAsync(() =>
{
var myRole = new Cloudfoundry.OrgRole("my_role", new()
{
Username = "test123@example.com",
Type = "organization_user",
Org = "784b4cd0-4771-4e4d-9052-a07e178bae56",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudfoundry.OrgRole;
import com.pulumi.cloudfoundry.OrgRoleArgs;
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 myRole = new OrgRole("myRole", OrgRoleArgs.builder()
.username("test123@example.com")
.type("organization_user")
.org("784b4cd0-4771-4e4d-9052-a07e178bae56")
.build());
}
}
resources:
myRole:
type: cloudfoundry:OrgRole
name: my_role
properties:
username: test123@example.com
type: organization_user
org: 784b4cd0-4771-4e4d-9052-a07e178bae56
Example coming soon!
Create OrgRole Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OrgRole(name: string, args: OrgRoleArgs, opts?: CustomResourceOptions);@overload
def OrgRole(resource_name: str,
args: OrgRoleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def OrgRole(resource_name: str,
opts: Optional[ResourceOptions] = None,
org: Optional[str] = None,
type: Optional[str] = None,
origin: Optional[str] = None,
user: Optional[str] = None,
username: Optional[str] = None)func NewOrgRole(ctx *Context, name string, args OrgRoleArgs, opts ...ResourceOption) (*OrgRole, error)public OrgRole(string name, OrgRoleArgs args, CustomResourceOptions? opts = null)
public OrgRole(String name, OrgRoleArgs args)
public OrgRole(String name, OrgRoleArgs args, CustomResourceOptions options)
type: cloudfoundry:OrgRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "cloudfoundry_org_role" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args OrgRoleArgs
- 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 OrgRoleArgs
- 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 OrgRoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OrgRoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args OrgRoleArgs
- 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 orgRoleResource = new Cloudfoundry.OrgRole("orgRoleResource", new()
{
Org = "string",
Type = "string",
Origin = "string",
User = "string",
Username = "string",
});
example, err := cloudfoundry.NewOrgRole(ctx, "orgRoleResource", &cloudfoundry.OrgRoleArgs{
Org: pulumi.String("string"),
Type: pulumi.String("string"),
Origin: pulumi.String("string"),
User: pulumi.String("string"),
Username: pulumi.String("string"),
})
resource "cloudfoundry_org_role" "orgRoleResource" {
lifecycle {
create_before_destroy = true
}
org = "string"
type = "string"
origin = "string"
user = "string"
username = "string"
}
var orgRoleResource = new OrgRole("orgRoleResource", OrgRoleArgs.builder()
.org("string")
.type("string")
.origin("string")
.user("string")
.username("string")
.build());
org_role_resource = cloudfoundry.OrgRole("orgRoleResource",
org="string",
type="string",
origin="string",
user="string",
username="string")
const orgRoleResource = new cloudfoundry.OrgRole("orgRoleResource", {
org: "string",
type: "string",
origin: "string",
user: "string",
username: "string",
});
type: cloudfoundry:OrgRole
properties:
org: string
origin: string
type: string
user: string
username: string
OrgRole 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 OrgRole resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the OrgRole resource produces the following output properties:
- created_
at string - The date and time when the resource was created in RFC3339 format.
- id string
- The provider-assigned unique ID for this managed resource.
- updated_
at string - The date and time when the resource was updated in RFC3339 format.
- created_
at str - The date and time when the resource was created in RFC3339 format.
- id str
- The provider-assigned unique ID for this managed resource.
- updated_
at str - The date and time when the resource was updated in RFC3339 format.
Look up Existing OrgRole Resource
Get an existing OrgRole 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?: OrgRoleState, opts?: CustomResourceOptions): OrgRole@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
org: Optional[str] = None,
origin: Optional[str] = None,
type: Optional[str] = None,
updated_at: Optional[str] = None,
user: Optional[str] = None,
username: Optional[str] = None) -> OrgRolefunc GetOrgRole(ctx *Context, name string, id IDInput, state *OrgRoleState, opts ...ResourceOption) (*OrgRole, error)public static OrgRole Get(string name, Input<string> id, OrgRoleState? state, CustomResourceOptions? opts = null)public static OrgRole get(String name, Output<String> id, OrgRoleState state, CustomResourceOptions options)resources: existingOrgRole: type: cloudfoundry:OrgRole get: id: ${id}import {
to = cloudfoundry_org_role.example
id = "${id}"
}
- name string
- The unique name of the resulting resource.
- id Input<ID>
- The unique provider ID of the resource to look up.
- state OrgRoleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resulting resource.
- id str
- The unique provider ID of the resource to look up.
- 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 resulting resource.
- id IDInput
- The unique provider ID of the resource to look up.
- state OrgRoleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resulting resource.
- id Input<string>
- The unique provider ID of the resource to look up.
- state OrgRoleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resulting resource.
- id Output<String>
- The unique provider ID of the resource to look up.
- state OrgRoleState
- Known property values the provider needs, along with the ID, to find the resource. Usually not required.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
- Created
At string - The date and time when the resource was created in RFC3339 format.
- Org string
- The guid of the organization to assign the role to
- Origin string
- The identity provider for the UAA user
- Type string
- Role type; see Valid role types
- Updated
At string - The date and time when the resource was updated in RFC3339 format.
- User string
- The guid of the cloudfoundry user to assign the role with
- Username string
- The username of the cloudfoundry user to assign the role with
- Created
At string - The date and time when the resource was created in RFC3339 format.
- Org string
- The guid of the organization to assign the role to
- Origin string
- The identity provider for the UAA user
- Type string
- Role type; see Valid role types
- Updated
At string - The date and time when the resource was updated in RFC3339 format.
- User string
- The guid of the cloudfoundry user to assign the role with
- Username string
- The username of the cloudfoundry user to assign the role with
- created_
at string - The date and time when the resource was created in RFC3339 format.
- org string
- The guid of the organization to assign the role to
- origin string
- The identity provider for the UAA user
- type string
- Role type; see Valid role types
- updated_
at string - The date and time when the resource was updated in RFC3339 format.
- user string
- The guid of the cloudfoundry user to assign the role with
- username string
- The username of the cloudfoundry user to assign the role with
- created
At String - The date and time when the resource was created in RFC3339 format.
- org String
- The guid of the organization to assign the role to
- origin String
- The identity provider for the UAA user
- type String
- Role type; see Valid role types
- updated
At String - The date and time when the resource was updated in RFC3339 format.
- user String
- The guid of the cloudfoundry user to assign the role with
- username String
- The username of the cloudfoundry user to assign the role with
- created
At string - The date and time when the resource was created in RFC3339 format.
- org string
- The guid of the organization to assign the role to
- origin string
- The identity provider for the UAA user
- type string
- Role type; see Valid role types
- updated
At string - The date and time when the resource was updated in RFC3339 format.
- user string
- The guid of the cloudfoundry user to assign the role with
- username string
- The username of the cloudfoundry user to assign the role with
- created_
at str - The date and time when the resource was created in RFC3339 format.
- org str
- The guid of the organization to assign the role to
- origin str
- The identity provider for the UAA user
- type str
- Role type; see Valid role types
- updated_
at str - The date and time when the resource was updated in RFC3339 format.
- user str
- The guid of the cloudfoundry user to assign the role with
- username str
- The username of the cloudfoundry user to assign the role with
- created
At String - The date and time when the resource was created in RFC3339 format.
- org String
- The guid of the organization to assign the role to
- origin String
- The identity provider for the UAA user
- type String
- Role type; see Valid role types
- updated
At String - The date and time when the resource was updated in RFC3339 format.
- user String
- The guid of the cloudfoundry user to assign the role with
- username String
- The username of the cloudfoundry user to assign the role with
Import
terraform
$ pulumi import cloudfoundry:index/orgRole:OrgRole <resource_name> <role_guid>
$ pulumi import cloudfoundry:index/orgRole:OrgRole my_role e17839d9-cd4f-4e4b-baf0-18786f12fede
$ pulumi import cloudfoundry:index/orgRole:OrgRole #using id attribute in import block
import {
to = cloudfoundry_org_role.<resource_name>
id = “<role_guid>”
}
this resource supports import using identity attribute from Terraform version 1.12 or higher
import {
to = cloudfoundry_org_role.<resource_name>
identity = {
role_guid = “<role_guid>”
}
}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- cloudfoundry cloudfoundry/terraform-provider-cloudfoundry
- License
- Notes
- This Pulumi package is based on the
cloudfoundryTerraform Provider.
published on Friday, Nov 13, 2026 by cloudfoundry