Ovh

v0.0.4 published on Saturday, Sep 17, 2022 by lbrlabs

CloudProjectDatabaseUser

Creates an user for a database cluster associated with a public cloud project.

With this resource you can create a user for the following database engine:

  • cassandra
  • kafka
  • kafkaConnect
  • mysql

Example Usage

using System.Collections.Generic;
using Pulumi;
using Ovh = Lbrlabs.PulumiPackage.Ovh;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var db = Ovh.GetCloudProjectDatabase.Invoke(new()
    {
        ServiceName = "XXXX",
        Engine = "YYYY",
        ClusterId = "ZZZZ",
    });

    var user = new Ovh.CloudProjectDatabaseUser("user", new()
    {
        ServiceName = ovh_cloud_project_database.Db.Service_name,
        Engine = ovh_cloud_project_database.Db.Engine,
        ClusterId = ovh_cloud_project_database.Db.Id,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ovh.LookupCloudProjectDatabase(ctx, &GetCloudProjectDatabaseArgs{
			ServiceName: "XXXX",
			Engine:      "YYYY",
			ClusterId:   "ZZZZ",
		}, nil)
		if err != nil {
			return err
		}
		_, err = ovh.NewCloudProjectDatabaseUser(ctx, "user", &ovh.CloudProjectDatabaseUserArgs{
			ServiceName: pulumi.Any(ovh_cloud_project_database.Db.Service_name),
			Engine:      pulumi.Any(ovh_cloud_project_database.Db.Engine),
			ClusterId:   pulumi.Any(ovh_cloud_project_database.Db.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.OvhFunctions;
import com.pulumi.ovh.inputs.GetCloudProjectDatabaseArgs;
import com.pulumi.ovh.CloudProjectDatabaseUser;
import com.pulumi.ovh.CloudProjectDatabaseUserArgs;
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) {
        final var db = OvhFunctions.getCloudProjectDatabase(GetCloudProjectDatabaseArgs.builder()
            .serviceName("XXXX")
            .engine("YYYY")
            .clusterId("ZZZZ")
            .build());

        var user = new CloudProjectDatabaseUser("user", CloudProjectDatabaseUserArgs.builder()        
            .serviceName(ovh_cloud_project_database.db().service_name())
            .engine(ovh_cloud_project_database.db().engine())
            .clusterId(ovh_cloud_project_database.db().id())
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_ovh as ovh
import pulumi_ovh as ovh

db = ovh.get_cloud_project_database(service_name="XXXX",
    engine="YYYY",
    cluster_id="ZZZZ")
user = ovh.CloudProjectDatabaseUser("user",
    service_name=ovh_cloud_project_database["db"]["service_name"],
    engine=ovh_cloud_project_database["db"]["engine"],
    cluster_id=ovh_cloud_project_database["db"]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@lbrlabs/pulumi-ovh";
import * as ovh from "@pulumi/ovh";

const db = ovh.getCloudProjectDatabase({
    serviceName: "XXXX",
    engine: "YYYY",
    clusterId: "ZZZZ",
});
const user = new ovh.CloudProjectDatabaseUser("user", {
    serviceName: ovh_cloud_project_database.db.service_name,
    engine: ovh_cloud_project_database.db.engine,
    clusterId: ovh_cloud_project_database.db.id,
});
resources:
  user:
    type: ovh:CloudProjectDatabaseUser
    properties:
      serviceName: ${ovh_cloud_project_database.db.service_name}
      engine: ${ovh_cloud_project_database.db.engine}
      clusterId: ${ovh_cloud_project_database.db.id}
variables:
  db:
    Fn::Invoke:
      Function: ovh:getCloudProjectDatabase
      Arguments:
        serviceName: XXXX
        engine: YYYY
        clusterId: ZZZZ

Create a CloudProjectDatabaseUser Resource

new CloudProjectDatabaseUser(name: string, args: CloudProjectDatabaseUserArgs, opts?: CustomResourceOptions);
@overload
def CloudProjectDatabaseUser(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             cluster_id: Optional[str] = None,
                             engine: Optional[str] = None,
                             name: Optional[str] = None,
                             service_name: Optional[str] = None)
@overload
def CloudProjectDatabaseUser(resource_name: str,
                             args: CloudProjectDatabaseUserArgs,
                             opts: Optional[ResourceOptions] = None)
func NewCloudProjectDatabaseUser(ctx *Context, name string, args CloudProjectDatabaseUserArgs, opts ...ResourceOption) (*CloudProjectDatabaseUser, error)
public CloudProjectDatabaseUser(string name, CloudProjectDatabaseUserArgs args, CustomResourceOptions? opts = null)
public CloudProjectDatabaseUser(String name, CloudProjectDatabaseUserArgs args)
public CloudProjectDatabaseUser(String name, CloudProjectDatabaseUserArgs args, CustomResourceOptions options)
type: ovh:CloudProjectDatabaseUser
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CloudProjectDatabaseUserArgs
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 CloudProjectDatabaseUserArgs
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 CloudProjectDatabaseUserArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CloudProjectDatabaseUserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CloudProjectDatabaseUserArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CloudProjectDatabaseUser Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The CloudProjectDatabaseUser resource accepts the following input properties:

ClusterId string

Cluster ID.

Engine string

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Name string

Name of the user.

ClusterId string

Cluster ID.

Engine string

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Name string

Name of the user.

clusterId String

Cluster ID.

engine String

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

name String

Name of the user.

clusterId string

Cluster ID.

engine string

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
serviceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

name string

Name of the user.

cluster_id str

Cluster ID.

engine str

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
service_name str

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

name str

Name of the user.

clusterId String

Cluster ID.

engine String

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

name String

Name of the user.

Outputs

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

CreatedAt string

Date of the creation of the user.

Id string

The provider-assigned unique ID for this managed resource.

Password string

Password of the user.

Status string

Current status of the user.

CreatedAt string

Date of the creation of the user.

Id string

The provider-assigned unique ID for this managed resource.

Password string

Password of the user.

Status string

Current status of the user.

createdAt String

Date of the creation of the user.

id String

The provider-assigned unique ID for this managed resource.

password String

Password of the user.

status String

Current status of the user.

createdAt string

Date of the creation of the user.

id string

The provider-assigned unique ID for this managed resource.

password string

Password of the user.

status string

Current status of the user.

created_at str

Date of the creation of the user.

id str

The provider-assigned unique ID for this managed resource.

password str

Password of the user.

status str

Current status of the user.

createdAt String

Date of the creation of the user.

id String

The provider-assigned unique ID for this managed resource.

password String

Password of the user.

status String

Current status of the user.

Look up an Existing CloudProjectDatabaseUser Resource

Get an existing CloudProjectDatabaseUser 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?: CloudProjectDatabaseUserState, opts?: CustomResourceOptions): CloudProjectDatabaseUser
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cluster_id: Optional[str] = None,
        created_at: Optional[str] = None,
        engine: Optional[str] = None,
        name: Optional[str] = None,
        password: Optional[str] = None,
        service_name: Optional[str] = None,
        status: Optional[str] = None) -> CloudProjectDatabaseUser
func GetCloudProjectDatabaseUser(ctx *Context, name string, id IDInput, state *CloudProjectDatabaseUserState, opts ...ResourceOption) (*CloudProjectDatabaseUser, error)
public static CloudProjectDatabaseUser Get(string name, Input<string> id, CloudProjectDatabaseUserState? state, CustomResourceOptions? opts = null)
public static CloudProjectDatabaseUser get(String name, Output<String> id, CloudProjectDatabaseUserState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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:
ClusterId string

Cluster ID.

CreatedAt string

Date of the creation of the user.

Engine string

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
Name string

Name of the user.

Password string

Password of the user.

ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Status string

Current status of the user.

ClusterId string

Cluster ID.

CreatedAt string

Date of the creation of the user.

Engine string

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
Name string

Name of the user.

Password string

Password of the user.

ServiceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

Status string

Current status of the user.

clusterId String

Cluster ID.

createdAt String

Date of the creation of the user.

engine String

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
name String

Name of the user.

password String

Password of the user.

serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

status String

Current status of the user.

clusterId string

Cluster ID.

createdAt string

Date of the creation of the user.

engine string

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
name string

Name of the user.

password string

Password of the user.

serviceName string

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

status string

Current status of the user.

cluster_id str

Cluster ID.

created_at str

Date of the creation of the user.

engine str

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
name str

Name of the user.

password str

Password of the user.

service_name str

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

status str

Current status of the user.

clusterId String

Cluster ID.

createdAt String

Date of the creation of the user.

engine String

The engine of the database cluster you want to add. To get a full list of available engine visit : public documentation.
Available engines for this resource (other have specific resource):

  • cassandra
  • kafka
  • kafkaConnect
  • mysql
name String

Name of the user.

password String

Password of the user.

serviceName String

The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.

status String

Current status of the user.

Import

OVHcloud Managed database clusters users can be imported using the service_name, engine, cluster_id and id of the user, separated by “/” E.g.,

 $ pulumi import ovh:index/cloudProjectDatabaseUser:CloudProjectDatabaseUser my_user <service_name>/<engine>/<cluster_id>/<id>

Package Details

Repository
https://github.com/lbrlabs/pulumi-ovh
License
Apache-2.0
Notes

This Pulumi package is based on the ovh Terraform Provider.