1. Packages
  2. Openstack Provider
  3. API Docs
  4. database
  5. User
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

openstack.database.User

Explore with Pulumi AI

Manages a V1 DB user resource within OpenStack.

Note: All arguments including the database password will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage

User

import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const basic = new openstack.database.User("basic", {
    name: "basic",
    instanceId: basicOpenstackDbInstanceV1.id,
    password: "password",
    databases: ["testdb"],
});
Copy
import pulumi
import pulumi_openstack as openstack

basic = openstack.database.User("basic",
    name="basic",
    instance_id=basic_openstack_db_instance_v1["id"],
    password="password",
    databases=["testdb"])
Copy
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/database"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := database.NewUser(ctx, "basic", &database.UserArgs{
			Name:       pulumi.String("basic"),
			InstanceId: pulumi.Any(basicOpenstackDbInstanceV1.Id),
			Password:   pulumi.String("password"),
			Databases: pulumi.StringArray{
				pulumi.String("testdb"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var basic = new OpenStack.Database.User("basic", new()
    {
        Name = "basic",
        InstanceId = basicOpenstackDbInstanceV1.Id,
        Password = "password",
        Databases = new[]
        {
            "testdb",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.database.User;
import com.pulumi.openstack.database.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 basic = new User("basic", UserArgs.builder()
            .name("basic")
            .instanceId(basicOpenstackDbInstanceV1.id())
            .password("password")
            .databases("testdb")
            .build());

    }
}
Copy
resources:
  basic:
    type: openstack:database:User
    properties:
      name: basic
      instanceId: ${basicOpenstackDbInstanceV1.id}
      password: password
      databases:
        - testdb
Copy

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: UserArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def User(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         instance_id: Optional[str] = None,
         password: Optional[str] = None,
         databases: Optional[Sequence[str]] = None,
         host: Optional[str] = None,
         name: Optional[str] = None,
         region: Optional[str] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
public User(String name, UserArgs args)
public User(String name, UserArgs args, CustomResourceOptions options)
type: openstack:database:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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 OpenStack.Database.User("userResource", new()
{
    InstanceId = "string",
    Password = "string",
    Databases = new[]
    {
        "string",
    },
    Host = "string",
    Name = "string",
    Region = "string",
});
Copy
example, err := database.NewUser(ctx, "userResource", &database.UserArgs{
	InstanceId: pulumi.String("string"),
	Password:   pulumi.String("string"),
	Databases: pulumi.StringArray{
		pulumi.String("string"),
	},
	Host:   pulumi.String("string"),
	Name:   pulumi.String("string"),
	Region: pulumi.String("string"),
})
Copy
var userResource = new User("userResource", UserArgs.builder()
    .instanceId("string")
    .password("string")
    .databases("string")
    .host("string")
    .name("string")
    .region("string")
    .build());
Copy
user_resource = openstack.database.User("userResource",
    instance_id="string",
    password="string",
    databases=["string"],
    host="string",
    name="string",
    region="string")
Copy
const userResource = new openstack.database.User("userResource", {
    instanceId: "string",
    password: "string",
    databases: ["string"],
    host: "string",
    name: "string",
    region: "string",
});
Copy
type: openstack:database:User
properties:
    databases:
        - string
    host: string
    instanceId: string
    name: string
    password: string
    region: string
Copy

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:

InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID for the database instance.
Password
This property is required.
Changes to this property will trigger replacement.
string
User's password.
Databases List<string>
A list of database user should have access to.
Host Changes to this property will trigger replacement. string
Name Changes to this property will trigger replacement. string
A unique name for the resource.
Region Changes to this property will trigger replacement. string
Openstack region resource is created in.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID for the database instance.
Password
This property is required.
Changes to this property will trigger replacement.
string
User's password.
Databases []string
A list of database user should have access to.
Host Changes to this property will trigger replacement. string
Name Changes to this property will trigger replacement. string
A unique name for the resource.
Region Changes to this property will trigger replacement. string
Openstack region resource is created in.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID for the database instance.
password
This property is required.
Changes to this property will trigger replacement.
String
User's password.
databases List<String>
A list of database user should have access to.
host Changes to this property will trigger replacement. String
name Changes to this property will trigger replacement. String
A unique name for the resource.
region Changes to this property will trigger replacement. String
Openstack region resource is created in.
instanceId
This property is required.
Changes to this property will trigger replacement.
string
The ID for the database instance.
password
This property is required.
Changes to this property will trigger replacement.
string
User's password.
databases string[]
A list of database user should have access to.
host Changes to this property will trigger replacement. string
name Changes to this property will trigger replacement. string
A unique name for the resource.
region Changes to this property will trigger replacement. string
Openstack region resource is created in.
instance_id
This property is required.
Changes to this property will trigger replacement.
str
The ID for the database instance.
password
This property is required.
Changes to this property will trigger replacement.
str
User's password.
databases Sequence[str]
A list of database user should have access to.
host Changes to this property will trigger replacement. str
name Changes to this property will trigger replacement. str
A unique name for the resource.
region Changes to this property will trigger replacement. str
Openstack region resource is created in.
instanceId
This property is required.
Changes to this property will trigger replacement.
String
The ID for the database instance.
password
This property is required.
Changes to this property will trigger replacement.
String
User's password.
databases List<String>
A list of database user should have access to.
host Changes to this property will trigger replacement. String
name Changes to this property will trigger replacement. String
A unique name for the resource.
region Changes to this property will trigger replacement. String
Openstack region resource is created in.

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,
        databases: Optional[Sequence[str]] = None,
        host: Optional[str] = None,
        instance_id: Optional[str] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        region: 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: openstack:database:User    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Databases List<string>
A list of database user should have access to.
Host Changes to this property will trigger replacement. string
InstanceId Changes to this property will trigger replacement. string
The ID for the database instance.
Name Changes to this property will trigger replacement. string
A unique name for the resource.
Password Changes to this property will trigger replacement. string
User's password.
Region Changes to this property will trigger replacement. string
Openstack region resource is created in.
Databases []string
A list of database user should have access to.
Host Changes to this property will trigger replacement. string
InstanceId Changes to this property will trigger replacement. string
The ID for the database instance.
Name Changes to this property will trigger replacement. string
A unique name for the resource.
Password Changes to this property will trigger replacement. string
User's password.
Region Changes to this property will trigger replacement. string
Openstack region resource is created in.
databases List<String>
A list of database user should have access to.
host Changes to this property will trigger replacement. String
instanceId Changes to this property will trigger replacement. String
The ID for the database instance.
name Changes to this property will trigger replacement. String
A unique name for the resource.
password Changes to this property will trigger replacement. String
User's password.
region Changes to this property will trigger replacement. String
Openstack region resource is created in.
databases string[]
A list of database user should have access to.
host Changes to this property will trigger replacement. string
instanceId Changes to this property will trigger replacement. string
The ID for the database instance.
name Changes to this property will trigger replacement. string
A unique name for the resource.
password Changes to this property will trigger replacement. string
User's password.
region Changes to this property will trigger replacement. string
Openstack region resource is created in.
databases Sequence[str]
A list of database user should have access to.
host Changes to this property will trigger replacement. str
instance_id Changes to this property will trigger replacement. str
The ID for the database instance.
name Changes to this property will trigger replacement. str
A unique name for the resource.
password Changes to this property will trigger replacement. str
User's password.
region Changes to this property will trigger replacement. str
Openstack region resource is created in.
databases List<String>
A list of database user should have access to.
host Changes to this property will trigger replacement. String
instanceId Changes to this property will trigger replacement. String
The ID for the database instance.
name Changes to this property will trigger replacement. String
A unique name for the resource.
password Changes to this property will trigger replacement. String
User's password.
region Changes to this property will trigger replacement. String
Openstack region resource is created in.

Package Details

Repository
OpenStack pulumi/pulumi-openstack
License
Apache-2.0
Notes
This Pulumi package is based on the openstack Terraform Provider.