import * as pulumi from "@pulumi/pulumi"; /** * The ``mysql.Grant`` resource creates and manages privileges given to * a user on a MySQL server. * * ## Granting Privileges to a User * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as mysql from "@pulumi/mysql"; * * const jdoe = new mysql.User("jdoe", { * user: "jdoe", * host: "example.com", * plaintextPassword: "password", * }); * const jdoeGrant = new mysql.Grant("jdoe", { * user: jdoe.user, * host: jdoe.host, * database: "app", * privileges: [ * "SELECT", * "UPDATE", * ], * }); * ``` * * ## Granting Privileges to a Role * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as mysql from "@pulumi/mysql"; * * const developer = new mysql.Role("developer", {name: "developer"}); * const developerGrant = new mysql.Grant("developer", { * role: developer.name, * database: "app", * privileges: [ * "SELECT", * "UPDATE", * ], * }); * ``` * * ## Adding a Role to a User * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as mysql from "@pulumi/mysql"; * * const jdoe = new mysql.User("jdoe", { * user: "jdoe", * host: "example.com", * plaintextPassword: "password", * }); * const developer = new mysql.Role("developer", {name: "developer"}); * const developerGrant = new mysql.Grant("developer", { * user: jdoe.user, * host: jdoe.host, * database: "app", * roles: [developer.name], * }); * ``` */ export declare class Grant extends pulumi.CustomResource { /** * Get an existing Grant 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, state?: GrantState, opts?: pulumi.CustomResourceOptions): Grant; /** * Returns true if the given object is an instance of Grant. 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 Grant; /** * The database to grant privileges on. */ readonly database: pulumi.Output; /** * Whether to also give the user privileges to grant the same privileges to other users. */ readonly grant: pulumi.Output; /** * The source host of the user. Defaults to "localhost". Conflicts with `role`. */ readonly host: pulumi.Output; /** * A list of privileges to grant to the user. Refer to a list of privileges (such as [here](https://dev.mysql.com/doc/refman/5.5/en/grant.html)) for applicable privileges. Conflicts with `roles`. */ readonly privileges: pulumi.Output; /** * The role to grant `privileges` to. Conflicts with `user` and `host`. */ readonly role: pulumi.Output; /** * A list of rols to grant to the user. Conflicts with `privileges`. */ readonly roles: pulumi.Output; /** * Which table to grant `privileges` on. Defaults to `*`, which is all tables. */ readonly table: pulumi.Output; /** * An TLS-Option for the `GRANT` statement. The value is suffixed to `REQUIRE`. A value of 'SSL' will generate a `GRANT ... REQUIRE SSL` statement. See the [MYSQL `GRANT` documentation](https://dev.mysql.com/doc/refman/5.7/en/grant.html) for more. Ignored if MySQL version is under 5.7.0. */ readonly tlsOption: pulumi.Output; /** * The name of the user. Conflicts with `role`. */ readonly user: pulumi.Output; /** * Create a Grant 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: GrantArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Grant resources. */ export interface GrantState { /** * The database to grant privileges on. */ database?: pulumi.Input; /** * Whether to also give the user privileges to grant the same privileges to other users. */ grant?: pulumi.Input; /** * The source host of the user. Defaults to "localhost". Conflicts with `role`. */ host?: pulumi.Input; /** * A list of privileges to grant to the user. Refer to a list of privileges (such as [here](https://dev.mysql.com/doc/refman/5.5/en/grant.html)) for applicable privileges. Conflicts with `roles`. */ privileges?: pulumi.Input[] | undefined>; /** * The role to grant `privileges` to. Conflicts with `user` and `host`. */ role?: pulumi.Input; /** * A list of rols to grant to the user. Conflicts with `privileges`. */ roles?: pulumi.Input[] | undefined>; /** * Which table to grant `privileges` on. Defaults to `*`, which is all tables. */ table?: pulumi.Input; /** * An TLS-Option for the `GRANT` statement. The value is suffixed to `REQUIRE`. A value of 'SSL' will generate a `GRANT ... REQUIRE SSL` statement. See the [MYSQL `GRANT` documentation](https://dev.mysql.com/doc/refman/5.7/en/grant.html) for more. Ignored if MySQL version is under 5.7.0. */ tlsOption?: pulumi.Input; /** * The name of the user. Conflicts with `role`. */ user?: pulumi.Input; } /** * The set of arguments for constructing a Grant resource. */ export interface GrantArgs { /** * The database to grant privileges on. */ database: pulumi.Input; /** * Whether to also give the user privileges to grant the same privileges to other users. */ grant?: pulumi.Input; /** * The source host of the user. Defaults to "localhost". Conflicts with `role`. */ host?: pulumi.Input; /** * A list of privileges to grant to the user. Refer to a list of privileges (such as [here](https://dev.mysql.com/doc/refman/5.5/en/grant.html)) for applicable privileges. Conflicts with `roles`. */ privileges?: pulumi.Input[] | undefined>; /** * The role to grant `privileges` to. Conflicts with `user` and `host`. */ role?: pulumi.Input; /** * A list of rols to grant to the user. Conflicts with `privileges`. */ roles?: pulumi.Input[] | undefined>; /** * Which table to grant `privileges` on. Defaults to `*`, which is all tables. */ table?: pulumi.Input; /** * An TLS-Option for the `GRANT` statement. The value is suffixed to `REQUIRE`. A value of 'SSL' will generate a `GRANT ... REQUIRE SSL` statement. See the [MYSQL `GRANT` documentation](https://dev.mysql.com/doc/refman/5.7/en/grant.html) for more. Ignored if MySQL version is under 5.7.0. */ tlsOption?: pulumi.Input; /** * The name of the user. Conflicts with `role`. */ user?: pulumi.Input; } //# sourceMappingURL=grant.d.ts.map