UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

156 lines (155 loc) 5.02 kB
import * as pulumi from "@pulumi/pulumi"; /** * Creates and manages database users. * For more information refer to the [API documentation](https://www.scaleway.com/en/developers/api/managed-database-postgre-mysql/). * * ## Example Usage * * ### Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as random from "@pulumi/random"; * import * as scaleway from "@pulumiverse/scaleway"; * * const main = new scaleway.databases.Instance("main", { * name: "test-rdb", * nodeType: "DB-DEV-S", * engine: "PostgreSQL-15", * isHaCluster: true, * disableBackup: true, * userName: "my_initial_user", * password: "thiZ_is_v&ry_s3cret", * }); * const dbPassword = new random.RandomPassword("db_password", { * length: 16, * special: true, * }); * const dbAdmin = new scaleway.databases.User("db_admin", { * instanceId: main.id, * name: "devtools", * password: dbPassword.result, * isAdmin: true, * }); * ``` * * ## Import * * Database users can be imported using `{region}/{instance_id}/{user_name}`, e.g. * * bash * * ```sh * $ pulumi import scaleway:index/databaseUser:DatabaseUser admin fr-par/11111111-1111-1111-1111-111111111111/admin * ``` * * @deprecated scaleway.index/databaseuser.DatabaseUser has been deprecated in favor of scaleway.databases/user.User */ export declare class DatabaseUser extends pulumi.CustomResource { /** * Get an existing DatabaseUser resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatabaseUserState, opts?: pulumi.CustomResourceOptions): DatabaseUser; /** * Returns true if the given object is an instance of DatabaseUser. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is DatabaseUser; /** * UUID of the Database Instance. * * > **Important:** Updates to `instanceId` will recreate the database user. */ readonly instanceId: pulumi.Output<string>; /** * Grant admin permissions to the database user. */ readonly isAdmin: pulumi.Output<boolean | undefined>; /** * database user name. * * > **Important:** Updates to `name` will recreate the database user. */ readonly name: pulumi.Output<string>; /** * database user password. */ readonly password: pulumi.Output<string>; /** * The Scaleway region this resource resides in. */ readonly region: pulumi.Output<string>; /** * Create a DatabaseUser resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ /** @deprecated scaleway.index/databaseuser.DatabaseUser has been deprecated in favor of scaleway.databases/user.User */ constructor(name: string, args: DatabaseUserArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DatabaseUser resources. */ export interface DatabaseUserState { /** * UUID of the Database Instance. * * > **Important:** Updates to `instanceId` will recreate the database user. */ instanceId?: pulumi.Input<string>; /** * Grant admin permissions to the database user. */ isAdmin?: pulumi.Input<boolean>; /** * database user name. * * > **Important:** Updates to `name` will recreate the database user. */ name?: pulumi.Input<string>; /** * database user password. */ password?: pulumi.Input<string>; /** * The Scaleway region this resource resides in. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a DatabaseUser resource. */ export interface DatabaseUserArgs { /** * UUID of the Database Instance. * * > **Important:** Updates to `instanceId` will recreate the database user. */ instanceId: pulumi.Input<string>; /** * Grant admin permissions to the database user. */ isAdmin?: pulumi.Input<boolean>; /** * database user name. * * > **Important:** Updates to `name` will recreate the database user. */ name?: pulumi.Input<string>; /** * database user password. */ password: pulumi.Input<string>; /** * The Scaleway region this resource resides in. */ region?: pulumi.Input<string>; }