1. Packages
  2. OVH
  3. API Docs
  4. Hosting
  5. PrivateDatabaseUser
OVHCloud v2.1.1 published on Thursday, Apr 10, 2025 by OVHcloud

ovh.Hosting.PrivateDatabaseUser

Explore with Pulumi AI

Create a new user on your private cloud database instance.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";

const user = new ovh.hosting.PrivateDatabaseUser("user", {
    password: "XXXXXX",
    serviceName: "XXXXXX",
    userName: "XXXXXX",
});
Copy
import pulumi
import pulumi_ovh as ovh

user = ovh.hosting.PrivateDatabaseUser("user",
    password="XXXXXX",
    service_name="XXXXXX",
    user_name="XXXXXX")
Copy
package main

import (
	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/hosting"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := hosting.NewPrivateDatabaseUser(ctx, "user", &hosting.PrivateDatabaseUserArgs{
			Password:    pulumi.String("XXXXXX"),
			ServiceName: pulumi.String("XXXXXX"),
			UserName:    pulumi.String("XXXXXX"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var user = new Ovh.Hosting.PrivateDatabaseUser("user", new()
    {
        Password = "XXXXXX",
        ServiceName = "XXXXXX",
        UserName = "XXXXXX",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.ovhcloud.pulumi.ovh.Hosting.PrivateDatabaseUser;
import com.ovhcloud.pulumi.ovh.Hosting.PrivateDatabaseUserArgs;
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 user = new PrivateDatabaseUser("user", PrivateDatabaseUserArgs.builder()
            .password("XXXXXX")
            .serviceName("XXXXXX")
            .userName("XXXXXX")
            .build());

    }
}
Copy
resources:
  user:
    type: ovh:Hosting:PrivateDatabaseUser
    properties:
      password: XXXXXX
      serviceName: XXXXXX
      userName: XXXXXX
Copy

Create PrivateDatabaseUser Resource

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

Constructor syntax

new PrivateDatabaseUser(name: string, args: PrivateDatabaseUserArgs, opts?: CustomResourceOptions);
@overload
def PrivateDatabaseUser(resource_name: str,
                        args: PrivateDatabaseUserArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def PrivateDatabaseUser(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        password: Optional[str] = None,
                        service_name: Optional[str] = None,
                        user_name: Optional[str] = None)
func NewPrivateDatabaseUser(ctx *Context, name string, args PrivateDatabaseUserArgs, opts ...ResourceOption) (*PrivateDatabaseUser, error)
public PrivateDatabaseUser(string name, PrivateDatabaseUserArgs args, CustomResourceOptions? opts = null)
public PrivateDatabaseUser(String name, PrivateDatabaseUserArgs args)
public PrivateDatabaseUser(String name, PrivateDatabaseUserArgs args, CustomResourceOptions options)
type: ovh:Hosting:PrivateDatabaseUser
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. PrivateDatabaseUserArgs
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. PrivateDatabaseUserArgs
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. PrivateDatabaseUserArgs
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. PrivateDatabaseUserArgs
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. PrivateDatabaseUserArgs
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 privateDatabaseUserResource = new Ovh.Hosting.PrivateDatabaseUser("privateDatabaseUserResource", new()
{
    Password = "string",
    ServiceName = "string",
    UserName = "string",
});
Copy
example, err := Hosting.NewPrivateDatabaseUser(ctx, "privateDatabaseUserResource", &Hosting.PrivateDatabaseUserArgs{
	Password:    pulumi.String("string"),
	ServiceName: pulumi.String("string"),
	UserName:    pulumi.String("string"),
})
Copy
var privateDatabaseUserResource = new PrivateDatabaseUser("privateDatabaseUserResource", PrivateDatabaseUserArgs.builder()
    .password("string")
    .serviceName("string")
    .userName("string")
    .build());
Copy
private_database_user_resource = ovh.hosting.PrivateDatabaseUser("privateDatabaseUserResource",
    password="string",
    service_name="string",
    user_name="string")
Copy
const privateDatabaseUserResource = new ovh.hosting.PrivateDatabaseUser("privateDatabaseUserResource", {
    password: "string",
    serviceName: "string",
    userName: "string",
});
Copy
type: ovh:Hosting:PrivateDatabaseUser
properties:
    password: string
    serviceName: string
    userName: string
Copy

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

Password
This property is required.
Changes to this property will trigger replacement.
string
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The internal name of your private database.
UserName
This property is required.
Changes to this property will trigger replacement.
string
User name used to connect on your databases
Password
This property is required.
Changes to this property will trigger replacement.
string
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The internal name of your private database.
UserName
This property is required.
Changes to this property will trigger replacement.
string
User name used to connect on your databases
password
This property is required.
Changes to this property will trigger replacement.
String
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The internal name of your private database.
userName
This property is required.
Changes to this property will trigger replacement.
String
User name used to connect on your databases
password
This property is required.
Changes to this property will trigger replacement.
string
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The internal name of your private database.
userName
This property is required.
Changes to this property will trigger replacement.
string
User name used to connect on your databases
password
This property is required.
Changes to this property will trigger replacement.
str
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
service_name
This property is required.
Changes to this property will trigger replacement.
str
The internal name of your private database.
user_name
This property is required.
Changes to this property will trigger replacement.
str
User name used to connect on your databases
password
This property is required.
Changes to this property will trigger replacement.
String
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The internal name of your private database.
userName
This property is required.
Changes to this property will trigger replacement.
String
User name used to connect on your databases

Outputs

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

Get an existing PrivateDatabaseUser 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?: PrivateDatabaseUserState, opts?: CustomResourceOptions): PrivateDatabaseUser
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        password: Optional[str] = None,
        service_name: Optional[str] = None,
        user_name: Optional[str] = None) -> PrivateDatabaseUser
func GetPrivateDatabaseUser(ctx *Context, name string, id IDInput, state *PrivateDatabaseUserState, opts ...ResourceOption) (*PrivateDatabaseUser, error)
public static PrivateDatabaseUser Get(string name, Input<string> id, PrivateDatabaseUserState? state, CustomResourceOptions? opts = null)
public static PrivateDatabaseUser get(String name, Output<String> id, PrivateDatabaseUserState state, CustomResourceOptions options)
resources:  _:    type: ovh:Hosting:PrivateDatabaseUser    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:
Password Changes to this property will trigger replacement. string
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
ServiceName Changes to this property will trigger replacement. string
The internal name of your private database.
UserName Changes to this property will trigger replacement. string
User name used to connect on your databases
Password Changes to this property will trigger replacement. string
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
ServiceName Changes to this property will trigger replacement. string
The internal name of your private database.
UserName Changes to this property will trigger replacement. string
User name used to connect on your databases
password Changes to this property will trigger replacement. String
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
serviceName Changes to this property will trigger replacement. String
The internal name of your private database.
userName Changes to this property will trigger replacement. String
User name used to connect on your databases
password Changes to this property will trigger replacement. string
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
serviceName Changes to this property will trigger replacement. string
The internal name of your private database.
userName Changes to this property will trigger replacement. string
User name used to connect on your databases
password Changes to this property will trigger replacement. str
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
service_name Changes to this property will trigger replacement. str
The internal name of your private database.
user_name Changes to this property will trigger replacement. str
User name used to connect on your databases
password Changes to this property will trigger replacement. String
Password for the new user (alphanumeric, minimum one number and 8 characters minimum)
serviceName Changes to this property will trigger replacement. String
The internal name of your private database.
userName Changes to this property will trigger replacement. String
User name used to connect on your databases

Import

OVHcloud database user can be imported using the service_name and the user_name, separated by “/” E.g.,

$ pulumi import ovh:Hosting/privateDatabaseUser:PrivateDatabaseUser user service_name/user_name
Copy

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

Package Details

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