1. Registry
  2. Packages
  3. Cloudfoundry Provider
  4. API Docs
  5. UserCf
Viewing docs for cloudfoundry 1.18.0
published on Monday, Nov 2, 2026 by cloudfoundry
cloudfoundry
Viewing docs for cloudfoundry 1.18.0
published on Monday, Nov 2, 2026 by cloudfoundry

    Provides a resource for creating users in the Cloud Controller database. Supports creating a user via username and origin which can be accomplished by Org Managers provided CAPI property cc.allow_user_creation_by_org_manager is enabled. No explicit calls are made to the UAA endpoints as part of the resource creation. Note : An Org manger will not be able to retrieve information of a newly created user until the user is assigned an org-role to any of the orgs that can be accessed by the Org Manager. If the end goal is role assignment, better would be to use the cloudfoundry.OrgRole or cloudfoundry.SpaceRole to accomplish the same.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudfoundry from "@pulumi/cloudfoundry";
    
    const myUser = new cloudfoundry.UserCf("my_user", {
        username: "tf-test1212123@example.com",
        origin: "hi",
    });
    const myRole = new cloudfoundry.OrgRole("my_role", {
        user: myUser.userCfId,
        type: "organization_user",
        org: "db29f4b8-d39e-4f5c-b24d-cb34cde27abf",
    });
    
    import pulumi
    import pulumi_cloudfoundry as cloudfoundry
    
    my_user = cloudfoundry.UserCf("my_user",
        username="tf-test1212123@example.com",
        origin="hi")
    my_role = cloudfoundry.OrgRole("my_role",
        user=my_user.user_cf_id,
        type="organization_user",
        org="db29f4b8-d39e-4f5c-b24d-cb34cde27abf")
    
    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 {
    		myUser, err := cloudfoundry.NewUserCf(ctx, "my_user", &cloudfoundry.UserCfArgs{
    			Username: pulumi.String("tf-test1212123@example.com"),
    			Origin:   pulumi.String("hi"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cloudfoundry.NewOrgRole(ctx, "my_role", &cloudfoundry.OrgRoleArgs{
    			User: myUser.UserCfId,
    			Type: pulumi.String("organization_user"),
    			Org:  pulumi.String("db29f4b8-d39e-4f5c-b24d-cb34cde27abf"),
    		})
    		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 myUser = new Cloudfoundry.UserCf("my_user", new()
        {
            Username = "tf-test1212123@example.com",
            Origin = "hi",
        });
    
        var myRole = new Cloudfoundry.OrgRole("my_role", new()
        {
            User = myUser.UserCfId,
            Type = "organization_user",
            Org = "db29f4b8-d39e-4f5c-b24d-cb34cde27abf",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudfoundry.UserCf;
    import com.pulumi.cloudfoundry.UserCfArgs;
    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 myUser = new UserCf("myUser", UserCfArgs.builder()
                .username("tf-test1212123@example.com")
                .origin("hi")
                .build());
    
            var myRole = new OrgRole("myRole", OrgRoleArgs.builder()
                .user(myUser.userCfId())
                .type("organization_user")
                .org("db29f4b8-d39e-4f5c-b24d-cb34cde27abf")
                .build());
    
        }
    }
    
    resources:
      myUser:
        type: cloudfoundry:UserCf
        name: my_user
        properties:
          username: tf-test1212123@example.com
          origin: hi
      myRole:
        type: cloudfoundry:OrgRole
        name: my_role
        properties:
          user: ${myUser.userCfId}
          type: organization_user
          org: db29f4b8-d39e-4f5c-b24d-cb34cde27abf
    
    Example coming soon!
    

    Create UserCf Resource

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

    Constructor syntax

    new UserCf(name: string, args?: UserCfArgs, opts?: CustomResourceOptions);
    @overload
    def UserCf(resource_name: str,
               args: Optional[UserCfArgs] = None,
               opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserCf(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               annotations: Optional[Mapping[str, str]] = None,
               labels: Optional[Mapping[str, str]] = None,
               origin: Optional[str] = None,
               user_cf_id: Optional[str] = None,
               username: Optional[str] = None)
    func NewUserCf(ctx *Context, name string, args *UserCfArgs, opts ...ResourceOption) (*UserCf, error)
    public UserCf(string name, UserCfArgs? args = null, CustomResourceOptions? opts = null)
    public UserCf(String name, UserCfArgs args)
    public UserCf(String name, UserCfArgs args, CustomResourceOptions options)
    
    type: cloudfoundry:UserCf
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "cloudfoundry_user_cf" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args UserCfArgs
    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 UserCfArgs
    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 UserCfArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserCfArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserCfArgs
    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 userCfResource = new Cloudfoundry.UserCf("userCfResource", new()
    {
        Annotations = 
        {
            { "string", "string" },
        },
        Labels = 
        {
            { "string", "string" },
        },
        Origin = "string",
        UserCfId = "string",
        Username = "string",
    });
    
    example, err := cloudfoundry.NewUserCf(ctx, "userCfResource", &cloudfoundry.UserCfArgs{
    	Annotations: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Origin:   pulumi.String("string"),
    	UserCfId: pulumi.String("string"),
    	Username: pulumi.String("string"),
    })
    
    resource "cloudfoundry_user_cf" "userCfResource" {
      lifecycle {
        create_before_destroy = true
      }
      annotations = {
        "string" = "string"
      }
      labels = {
        "string" = "string"
      }
      origin     = "string"
      user_cf_id = "string"
      username   = "string"
    }
    
    var userCfResource = new UserCf("userCfResource", UserCfArgs.builder()
        .annotations(Map.of("string", "string"))
        .labels(Map.of("string", "string"))
        .origin("string")
        .userCfId("string")
        .username("string")
        .build());
    
    user_cf_resource = cloudfoundry.UserCf("userCfResource",
        annotations={
            "string": "string",
        },
        labels={
            "string": "string",
        },
        origin="string",
        user_cf_id="string",
        username="string")
    
    const userCfResource = new cloudfoundry.UserCf("userCfResource", {
        annotations: {
            string: "string",
        },
        labels: {
            string: "string",
        },
        origin: "string",
        userCfId: "string",
        username: "string",
    });
    
    type: cloudfoundry:UserCf
    properties:
        annotations:
            string: string
        labels:
            string: string
        origin: string
        userCfId: string
        username: string
    

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

    Annotations Dictionary<string, string>
    The annotations associated with Cloud Foundry resources. Add as described here.
    Labels Dictionary<string, string>
    The labels associated with Cloud Foundry resources. Add as described here.
    Origin string
    The alias of the Identity Provider that authenticated this user.
    UserCfId string
    Unique identifier for the user.
    Username string
    User name of the user, typically an email address.
    Annotations map[string]string
    The annotations associated with Cloud Foundry resources. Add as described here.
    Labels map[string]string
    The labels associated with Cloud Foundry resources. Add as described here.
    Origin string
    The alias of the Identity Provider that authenticated this user.
    UserCfId string
    Unique identifier for the user.
    Username string
    User name of the user, typically an email address.
    annotations map(string)
    The annotations associated with Cloud Foundry resources. Add as described here.
    labels map(string)
    The labels associated with Cloud Foundry resources. Add as described here.
    origin string
    The alias of the Identity Provider that authenticated this user.
    user_cf_id string
    Unique identifier for the user.
    username string
    User name of the user, typically an email address.
    annotations Map<String,String>
    The annotations associated with Cloud Foundry resources. Add as described here.
    labels Map<String,String>
    The labels associated with Cloud Foundry resources. Add as described here.
    origin String
    The alias of the Identity Provider that authenticated this user.
    userCfId String
    Unique identifier for the user.
    username String
    User name of the user, typically an email address.
    annotations {[key: string]: string}
    The annotations associated with Cloud Foundry resources. Add as described here.
    labels {[key: string]: string}
    The labels associated with Cloud Foundry resources. Add as described here.
    origin string
    The alias of the Identity Provider that authenticated this user.
    userCfId string
    Unique identifier for the user.
    username string
    User name of the user, typically an email address.
    annotations Mapping[str, str]
    The annotations associated with Cloud Foundry resources. Add as described here.
    labels Mapping[str, str]
    The labels associated with Cloud Foundry resources. Add as described here.
    origin str
    The alias of the Identity Provider that authenticated this user.
    user_cf_id str
    Unique identifier for the user.
    username str
    User name of the user, typically an email address.
    annotations Map<String>
    The annotations associated with Cloud Foundry resources. Add as described here.
    labels Map<String>
    The labels associated with Cloud Foundry resources. Add as described here.
    origin String
    The alias of the Identity Provider that authenticated this user.
    userCfId String
    Unique identifier for the user.
    username String
    User name of the user, typically an email address.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the UserCf resource produces the following output properties:

    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Id string
    The provider-assigned unique ID for this managed resource.
    PresentationName string
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Id string
    The provider-assigned unique ID for this managed resource.
    PresentationName string
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    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.
    presentation_name string
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updated_at string
    The date and time when the resource was updated in RFC3339 format.
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    id String
    The provider-assigned unique ID for this managed resource.
    presentationName String
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.
    createdAt string
    The date and time when the resource was created in RFC3339 format.
    id string
    The provider-assigned unique ID for this managed resource.
    presentationName string
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updatedAt 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.
    presentation_name str
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updated_at str
    The date and time when the resource was updated in RFC3339 format.
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    id String
    The provider-assigned unique ID for this managed resource.
    presentationName String
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.

    Look up Existing UserCf Resource

    Get an existing UserCf 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?: UserCfState, opts?: CustomResourceOptions): UserCf
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            annotations: Optional[Mapping[str, str]] = None,
            created_at: Optional[str] = None,
            labels: Optional[Mapping[str, str]] = None,
            origin: Optional[str] = None,
            presentation_name: Optional[str] = None,
            updated_at: Optional[str] = None,
            user_cf_id: Optional[str] = None,
            username: Optional[str] = None) -> UserCf
    func GetUserCf(ctx *Context, name string, id IDInput, state *UserCfState, opts ...ResourceOption) (*UserCf, error)
    public static UserCf Get(string name, Input<string> id, UserCfState? state, CustomResourceOptions? opts = null)
    public static UserCf get(String name, Output<String> id, UserCfState state, CustomResourceOptions options)
    resources:  _:    type: cloudfoundry:UserCf    get:      id: ${id}
    import {
      to = cloudfoundry_user_cf.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.
    The following state arguments are supported:
    Annotations Dictionary<string, string>
    The annotations associated with Cloud Foundry resources. Add as described here.
    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Labels Dictionary<string, string>
    The labels associated with Cloud Foundry resources. Add as described here.
    Origin string
    The alias of the Identity Provider that authenticated this user.
    PresentationName string
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    UserCfId string
    Unique identifier for the user.
    Username string
    User name of the user, typically an email address.
    Annotations map[string]string
    The annotations associated with Cloud Foundry resources. Add as described here.
    CreatedAt string
    The date and time when the resource was created in RFC3339 format.
    Labels map[string]string
    The labels associated with Cloud Foundry resources. Add as described here.
    Origin string
    The alias of the Identity Provider that authenticated this user.
    PresentationName string
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    UpdatedAt string
    The date and time when the resource was updated in RFC3339 format.
    UserCfId string
    Unique identifier for the user.
    Username string
    User name of the user, typically an email address.
    annotations map(string)
    The annotations associated with Cloud Foundry resources. Add as described here.
    created_at string
    The date and time when the resource was created in RFC3339 format.
    labels map(string)
    The labels associated with Cloud Foundry resources. Add as described here.
    origin string
    The alias of the Identity Provider that authenticated this user.
    presentation_name string
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updated_at string
    The date and time when the resource was updated in RFC3339 format.
    user_cf_id string
    Unique identifier for the user.
    username string
    User name of the user, typically an email address.
    annotations Map<String,String>
    The annotations associated with Cloud Foundry resources. Add as described here.
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    labels Map<String,String>
    The labels associated with Cloud Foundry resources. Add as described here.
    origin String
    The alias of the Identity Provider that authenticated this user.
    presentationName String
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.
    userCfId String
    Unique identifier for the user.
    username String
    User name of the user, typically an email address.
    annotations {[key: string]: string}
    The annotations associated with Cloud Foundry resources. Add as described here.
    createdAt string
    The date and time when the resource was created in RFC3339 format.
    labels {[key: string]: string}
    The labels associated with Cloud Foundry resources. Add as described here.
    origin string
    The alias of the Identity Provider that authenticated this user.
    presentationName string
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updatedAt string
    The date and time when the resource was updated in RFC3339 format.
    userCfId string
    Unique identifier for the user.
    username string
    User name of the user, typically an email address.
    annotations Mapping[str, str]
    The annotations associated with Cloud Foundry resources. Add as described here.
    created_at str
    The date and time when the resource was created in RFC3339 format.
    labels Mapping[str, str]
    The labels associated with Cloud Foundry resources. Add as described here.
    origin str
    The alias of the Identity Provider that authenticated this user.
    presentation_name str
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updated_at str
    The date and time when the resource was updated in RFC3339 format.
    user_cf_id str
    Unique identifier for the user.
    username str
    User name of the user, typically an email address.
    annotations Map<String>
    The annotations associated with Cloud Foundry resources. Add as described here.
    createdAt String
    The date and time when the resource was created in RFC3339 format.
    labels Map<String>
    The labels associated with Cloud Foundry resources. Add as described here.
    origin String
    The alias of the Identity Provider that authenticated this user.
    presentationName String
    The name displayed for the user; for UAA users, this is the same as the username. For UAA clients, this is the UAA client ID
    updatedAt String
    The date and time when the resource was updated in RFC3339 format.
    userCfId String
    Unique identifier for the user.
    username String
    User name of the user, typically an email address.

    Import

    terraform

    $ pulumi import cloudfoundry:index/userCf:UserCf <resource_name> <user_guid>
    
    $ pulumi import cloudfoundry:index/userCf:UserCf my_user 283f59d2-d660-45fb-9d96-b3e1aa92cfc7
    
    $ pulumi import cloudfoundry:index/userCf:UserCf #using id attribute in import block
    

    import {

    to = cloudfoundry_user_cf.<resource_name>

    id = “<user_guid>”

    }

    this resource supports import using identity attribute from Terraform version 1.12 or higher

    import {

    to = cloudfoundry_user_cf.<resource_name>

    identity = {

    user_guid = “<user_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 cloudfoundry Terraform Provider.
    cloudfoundry
    Viewing docs for cloudfoundry 1.18.0
    published on Monday, Nov 2, 2026 by cloudfoundry

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial