1. Packages
  2. Cloudfoundry Provider
  3. API Docs
  4. User
cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community

cloudfoundry.User

Explore with Pulumi AI

cloudfoundry logo
cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community

    Provides a Cloud Foundry resource for registering users. This resource provides extended functionality to attach additional UAA roles to the user.

    NOTE: This resource requires the provider to be authenticated with an account granted admin permissions and UAA admin client. See related uaa documentation NOTE: Create an existing user will not trigger any errors and will lead to retrieve id of existing user and update it.

    Example Usage

    The following example creates a user and attaches additional UAA roles to grant administrator rights to that user.

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudfoundry from "@pulumi/cloudfoundry";
    
    const admin_service_user = new cloudfoundry.User("admin-service-user", {
        familyName: "Doe",
        givenName: "John",
        groups: [
            "cloud_controller.admin",
            "scim.read",
            "scim.write",
        ],
        password: "Passw0rd",
    });
    
    import pulumi
    import pulumi_cloudfoundry as cloudfoundry
    
    admin_service_user = cloudfoundry.User("admin-service-user",
        family_name="Doe",
        given_name="John",
        groups=[
            "cloud_controller.admin",
            "scim.read",
            "scim.write",
        ],
        password="Passw0rd")
    
    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.NewUser(ctx, "admin-service-user", &cloudfoundry.UserArgs{
    			FamilyName: pulumi.String("Doe"),
    			GivenName:  pulumi.String("John"),
    			Groups: pulumi.StringArray{
    				pulumi.String("cloud_controller.admin"),
    				pulumi.String("scim.read"),
    				pulumi.String("scim.write"),
    			},
    			Password: pulumi.String("Passw0rd"),
    		})
    		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 admin_service_user = new Cloudfoundry.User("admin-service-user", new()
        {
            FamilyName = "Doe",
            GivenName = "John",
            Groups = new[]
            {
                "cloud_controller.admin",
                "scim.read",
                "scim.write",
            },
            Password = "Passw0rd",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudfoundry.User;
    import com.pulumi.cloudfoundry.UserArgs;
    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 admin_service_user = new User("admin-service-user", UserArgs.builder()
                .familyName("Doe")
                .givenName("John")
                .groups(            
                    "cloud_controller.admin",
                    "scim.read",
                    "scim.write")
                .password("Passw0rd")
                .build());
    
        }
    }
    
    resources:
      admin-service-user:
        type: cloudfoundry:User
        properties:
          familyName: Doe
          givenName: John
          groups:
            - cloud_controller.admin
            - scim.read
            - scim.write
          password: Passw0rd
    

    Create User Resource

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

    Constructor syntax

    new User(name: string, args?: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             args: Optional[UserArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             email: Optional[str] = None,
             family_name: Optional[str] = None,
             given_name: Optional[str] = None,
             groups: Optional[Sequence[str]] = None,
             name: Optional[str] = None,
             origin: Optional[str] = None,
             password: Optional[str] = None,
             user_id: Optional[str] = None)
    func NewUser(ctx *Context, name string, args *UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs? args = null, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: cloudfoundry:User
    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 UserArgs
    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 UserArgs
    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 UserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserArgs
    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 userResource = new Cloudfoundry.User("userResource", new()
    {
        Email = "string",
        FamilyName = "string",
        GivenName = "string",
        Groups = new[]
        {
            "string",
        },
        Name = "string",
        Origin = "string",
        Password = "string",
        UserId = "string",
    });
    
    example, err := cloudfoundry.NewUser(ctx, "userResource", &cloudfoundry.UserArgs{
    	Email:      pulumi.String("string"),
    	FamilyName: pulumi.String("string"),
    	GivenName:  pulumi.String("string"),
    	Groups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name:     pulumi.String("string"),
    	Origin:   pulumi.String("string"),
    	Password: pulumi.String("string"),
    	UserId:   pulumi.String("string"),
    })
    
    var userResource = new User("userResource", UserArgs.builder()
        .email("string")
        .familyName("string")
        .givenName("string")
        .groups("string")
        .name("string")
        .origin("string")
        .password("string")
        .userId("string")
        .build());
    
    user_resource = cloudfoundry.User("userResource",
        email="string",
        family_name="string",
        given_name="string",
        groups=["string"],
        name="string",
        origin="string",
        password="string",
        user_id="string")
    
    const userResource = new cloudfoundry.User("userResource", {
        email: "string",
        familyName: "string",
        givenName: "string",
        groups: ["string"],
        name: "string",
        origin: "string",
        password: "string",
        userId: "string",
    });
    
    type: cloudfoundry:User
    properties:
        email: string
        familyName: string
        givenName: string
        groups:
            - string
        name: string
        origin: string
        password: string
        userId: string
    

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

    Email string
    The email address of the user. When not provided, name is used as email.
    FamilyName string
    The family name of the user
    GivenName string
    The given name of the user
    Groups List<string>
    Any UAA groups / roles to associated the user with
    Name string
    The name of the user. This will also be the users login name
    Origin string
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    Password string
    The user's password
    UserId string
    The GUID of the User
    Email string
    The email address of the user. When not provided, name is used as email.
    FamilyName string
    The family name of the user
    GivenName string
    The given name of the user
    Groups []string
    Any UAA groups / roles to associated the user with
    Name string
    The name of the user. This will also be the users login name
    Origin string
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    Password string
    The user's password
    UserId string
    The GUID of the User
    email String
    The email address of the user. When not provided, name is used as email.
    familyName String
    The family name of the user
    givenName String
    The given name of the user
    groups List<String>
    Any UAA groups / roles to associated the user with
    name String
    The name of the user. This will also be the users login name
    origin String
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    password String
    The user's password
    userId String
    The GUID of the User
    email string
    The email address of the user. When not provided, name is used as email.
    familyName string
    The family name of the user
    givenName string
    The given name of the user
    groups string[]
    Any UAA groups / roles to associated the user with
    name string
    The name of the user. This will also be the users login name
    origin string
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    password string
    The user's password
    userId string
    The GUID of the User
    email str
    The email address of the user. When not provided, name is used as email.
    family_name str
    The family name of the user
    given_name str
    The given name of the user
    groups Sequence[str]
    Any UAA groups / roles to associated the user with
    name str
    The name of the user. This will also be the users login name
    origin str
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    password str
    The user's password
    user_id str
    The GUID of the User
    email String
    The email address of the user. When not provided, name is used as email.
    familyName String
    The family name of the user
    givenName String
    The given name of the user
    groups List<String>
    Any UAA groups / roles to associated the user with
    name String
    The name of the user. This will also be the users login name
    origin String
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    password String
    The user's password
    userId String
    The GUID of the User

    Outputs

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

    Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            email: Optional[str] = None,
            family_name: Optional[str] = None,
            given_name: Optional[str] = None,
            groups: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            origin: Optional[str] = None,
            password: Optional[str] = None,
            user_id: Optional[str] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
    resources:  _:    type: cloudfoundry:User    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:
    Email string
    The email address of the user. When not provided, name is used as email.
    FamilyName string
    The family name of the user
    GivenName string
    The given name of the user
    Groups List<string>
    Any UAA groups / roles to associated the user with
    Name string
    The name of the user. This will also be the users login name
    Origin string
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    Password string
    The user's password
    UserId string
    The GUID of the User
    Email string
    The email address of the user. When not provided, name is used as email.
    FamilyName string
    The family name of the user
    GivenName string
    The given name of the user
    Groups []string
    Any UAA groups / roles to associated the user with
    Name string
    The name of the user. This will also be the users login name
    Origin string
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    Password string
    The user's password
    UserId string
    The GUID of the User
    email String
    The email address of the user. When not provided, name is used as email.
    familyName String
    The family name of the user
    givenName String
    The given name of the user
    groups List<String>
    Any UAA groups / roles to associated the user with
    name String
    The name of the user. This will also be the users login name
    origin String
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    password String
    The user's password
    userId String
    The GUID of the User
    email string
    The email address of the user. When not provided, name is used as email.
    familyName string
    The family name of the user
    givenName string
    The given name of the user
    groups string[]
    Any UAA groups / roles to associated the user with
    name string
    The name of the user. This will also be the users login name
    origin string
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    password string
    The user's password
    userId string
    The GUID of the User
    email str
    The email address of the user. When not provided, name is used as email.
    family_name str
    The family name of the user
    given_name str
    The given name of the user
    groups Sequence[str]
    Any UAA groups / roles to associated the user with
    name str
    The name of the user. This will also be the users login name
    origin str
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    password str
    The user's password
    user_id str
    The GUID of the User
    email String
    The email address of the user. When not provided, name is used as email.
    familyName String
    The family name of the user
    givenName String
    The given name of the user
    groups List<String>
    Any UAA groups / roles to associated the user with
    name String
    The name of the user. This will also be the users login name
    origin String
    The user authentcation origin. By default this will be UAA. For users authenticated by LDAP this should be ldap
    password String
    The user's password
    userId String
    The GUID of the User

    Import

    An existing User can be imported using its guid, e.g.

    bash

    $ pulumi import cloudfoundry:index/user:User admin-service-user a-guid
    

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

    Package Details

    Repository
    cloudfoundry cloudfoundry-community/terraform-provider-cloudfoundry
    License
    Notes
    This Pulumi package is based on the cloudfoundry Terraform Provider.
    cloudfoundry logo
    cloudfoundry 0.54.0 published on Monday, Apr 14, 2025 by cloudfoundry-community