UNPKG

@pulumiverse/scaleway

Version:

A Pulumi package for creating and managing Scaleway cloud resources.

213 lines 8.2 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages MongoDB users. For more information, see the [API documentation](https://developers.scaleway.com/products/mongodb/api/). * * > **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 scaleway from "@pulumiverse/scaleway"; * * //## Basic user creation * const main = new scaleway.mongodb.Instance("main", { * name: "test-mongodb-user", * version: "7.0.12", * nodeType: "MGDB-PLAY2-NANO", * nodeNumber: 1, * userName: "initial_user", * password: "initial_password123", * volumeSizeInGb: 5, * }); * const mainUser = new scaleway.mongodb.User("main", { * instanceId: main.id, * name: "my_user", * password: "my_password123", * roles: [{ * role: "read_write", * databaseName: "my_database", * }], * }); * ``` * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as scaleway from "@pulumiverse/scaleway"; * * //## Multiple user creation * const main = new scaleway.mongodb.Instance("main", { * name: "test-mongodb-multi-user", * version: "7.0.12", * nodeType: "MGDB-PLAY2-NANO", * nodeNumber: 1, * userName: "admin_user", * password: "admin_password123", * volumeSizeInGb: 5, * }); * const appUser = new scaleway.mongodb.User("app_user", { * instanceId: main.id, * name: "app_user", * password: "app_password123", * roles: [ * { * role: "read_write", * databaseName: "app_database", * }, * { * role: "read", * databaseName: "logs_database", * }, * ], * }); * const adminUser = new scaleway.mongodb.User("admin_user", { * instanceId: main.id, * name: "admin_user", * password: "admin_password123", * roles: [ * { * role: "db_admin", * databaseName: "admin", * }, * { * role: "read", * anyDatabase: true, * }, * ], * }); * ``` * * ## Import * * MongoDB® users can be imported using the `{region}/{instance_id}/{name}`, e.g. * * ```sh * $ pulumi import scaleway:mongodb/user:User main fr-par/11111111-1111-1111-1111-111111111111/my_user * ``` */ export declare class User extends pulumi.CustomResource { /** * Get an existing User 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?: UserState, opts?: pulumi.CustomResourceOptions): User; /** * Returns true if the given object is an instance of User. 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 User; /** * The ID of the MongoDB® instance. */ readonly instanceId: pulumi.Output<string>; /** * The name of the MongoDB® user. */ readonly name: pulumi.Output<string>; /** * The password of the MongoDB® user. Only one of `password` or `passwordWo` should be specified. */ 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. * The password of the MongoDB® user 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>; /** * `region`) The region in which the MongoDB® user should be created. */ readonly region: pulumi.Output<string | undefined>; /** * List of roles assigned to the user. Each role block supports: */ readonly roles: pulumi.Output<outputs.mongodb.UserRole[] | undefined>; /** * Create a User 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. */ constructor(name: string, args: UserArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering User resources. */ export interface UserState { /** * The ID of the MongoDB® instance. */ instanceId?: pulumi.Input<string | undefined>; /** * The name of the MongoDB® user. */ name?: pulumi.Input<string | undefined>; /** * The password of the MongoDB® user. Only one of `password` or `passwordWo` should be specified. */ 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. * The password of the MongoDB® user 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>; /** * `region`) The region in which the MongoDB® user should be created. */ region?: pulumi.Input<string | undefined>; /** * List of roles assigned to the user. Each role block supports: */ roles?: pulumi.Input<pulumi.Input<inputs.mongodb.UserRole>[] | undefined>; } /** * The set of arguments for constructing a User resource. */ export interface UserArgs { /** * The ID of the MongoDB® instance. */ instanceId: pulumi.Input<string>; /** * The name of the MongoDB® user. */ name?: pulumi.Input<string | undefined>; /** * The password of the MongoDB® user. Only one of `password` or `passwordWo` should be specified. */ 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. * The password of the MongoDB® user 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>; /** * `region`) The region in which the MongoDB® user should be created. */ region?: pulumi.Input<string | undefined>; /** * List of roles assigned to the user. Each role block supports: */ roles?: pulumi.Input<pulumi.Input<inputs.mongodb.UserRole>[] | undefined>; } //# sourceMappingURL=user.d.ts.map