@pulumiverse/scaleway
Version:
A Pulumi package for creating and managing Scaleway cloud resources.
215 lines • 9.04 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* The `scaleway.databases.User` resource creates and manages database users.
* For more information, see the [API documentation](https://www.scaleway.com/en/developers/api/managed-database-postgre-mysql/).
*
* > **Security Best Practice:**
* For enhanced security, we recommend using the `passwordWo` write-only argument instead of the regular `password` argument. This ensures your sensitive credentials are never stored in Terraform state files, providing superior protection against accidental exposure. Write-Only arguments are supported in Terraform 1.11.0 and later.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as random from "@pulumi/random";
* import * as scaleway from "@pulumiverse/scaleway";
*
* //## Basic user creation
* 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.index.Password("db_password", {
* length: 20,
* special: true,
* upper: true,
* lower: true,
* numeric: true,
* minUpper: 1,
* minLower: 1,
* minNumeric: 1,
* minSpecial: 1,
* overrideSpecial: "!@#$%^&*()_+-=[]{}|;:,.<>?",
* });
* 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.
*
* ```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. The password must meet the following requirements based on ISO27001 standards:
* - **Length**: 8-128 characters
* - **Character types required**:
* - At least 1 lowercase letter (a-z)
* - At least 1 uppercase letter (A-Z)
* - At least 1 digit (0-9)
* - At least 1 special character (!@#$%^&*()_+-=[]{}|;:,.<>?)
*
* For secure password generation, consider using the `randomPassword` resource with appropriate parameters.
*/
readonly password: pulumi.Output<string | undefined>;
/**
* **NOTE:** This field is write-only and its value will not be updated in state as part of read operations.
* Database user password in write-only mode. Only one of `password` or `passwordWo` should be specified. `passwordWo` will not be set in the Terraform state. To update the `passwordWo`, you must also update the `passwordWoVersion`.
*/
readonly passwordWo: pulumi.Output<string | undefined>;
/**
* The version of the write-only password. To update the `passwordWo`, you must also update the `passwordWoVersion`.
*/
readonly passwordWoVersion: pulumi.Output<number | undefined>;
/**
* The Scaleway region this resource resides in.
*/
readonly region: pulumi.Output<string | undefined>;
/**
* 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 | undefined>;
/**
* Grant admin permissions to the database user.
*/
isAdmin?: pulumi.Input<boolean | undefined>;
/**
* database user name.
*
* > **Important:** Updates to `name` will recreate the database user.
*/
name?: pulumi.Input<string | undefined>;
/**
* database user password. The password must meet the following requirements based on ISO27001 standards:
* - **Length**: 8-128 characters
* - **Character types required**:
* - At least 1 lowercase letter (a-z)
* - At least 1 uppercase letter (A-Z)
* - At least 1 digit (0-9)
* - At least 1 special character (!@#$%^&*()_+-=[]{}|;:,.<>?)
*
* For secure password generation, consider using the `randomPassword` resource with appropriate parameters.
*/
password?: pulumi.Input<string | undefined>;
/**
* **NOTE:** This field is write-only and its value will not be updated in state as part of read operations.
* Database user password in write-only mode. Only one of `password` or `passwordWo` should be specified. `passwordWo` will not be set in the Terraform state. To update the `passwordWo`, you must also update the `passwordWoVersion`.
*/
passwordWo?: pulumi.Input<string | undefined>;
/**
* The version of the write-only password. To update the `passwordWo`, you must also update the `passwordWoVersion`.
*/
passwordWoVersion?: pulumi.Input<number | undefined>;
/**
* The Scaleway region this resource resides in.
*/
region?: pulumi.Input<string | undefined>;
}
/**
* 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 | undefined>;
/**
* database user name.
*
* > **Important:** Updates to `name` will recreate the database user.
*/
name?: pulumi.Input<string | undefined>;
/**
* database user password. The password must meet the following requirements based on ISO27001 standards:
* - **Length**: 8-128 characters
* - **Character types required**:
* - At least 1 lowercase letter (a-z)
* - At least 1 uppercase letter (A-Z)
* - At least 1 digit (0-9)
* - At least 1 special character (!@#$%^&*()_+-=[]{}|;:,.<>?)
*
* For secure password generation, consider using the `randomPassword` resource with appropriate parameters.
*/
password?: pulumi.Input<string | undefined>;
/**
* **NOTE:** This field is write-only and its value will not be updated in state as part of read operations.
* Database user password in write-only mode. Only one of `password` or `passwordWo` should be specified. `passwordWo` will not be set in the Terraform state. To update the `passwordWo`, you must also update the `passwordWoVersion`.
*/
passwordWo?: pulumi.Input<string | undefined>;
/**
* The version of the write-only password. To update the `passwordWo`, you must also update the `passwordWoVersion`.
*/
passwordWoVersion?: pulumi.Input<number | undefined>;
/**
* The Scaleway region this resource resides in.
*/
region?: pulumi.Input<string | undefined>;
}
//# sourceMappingURL=databaseUser.d.ts.map