import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Creates and manages ClickHouse grants to give users and roles privileges to a ClickHouse service. * * There are some limitations and considerations to be aware of when using this resource: * * Users cannot have the same name as roles. * * Global privileges cannot be granted on the database level. To grant global privileges, use `database="*"`. * * To grant a privilege on all tables of a database, omit the table and only keep the database. Don't use `table="*"`. * * Privileges granted on ClickHouse Named Collections are not currently managed by this resource and will be ignored. If you have grants on Named Collections managed outside of Terraform, this resource will not attempt to alter them. For an example showing how to set up Named Collection access with S3 integration, see the ClickHouse S3 Integration example. * * Changes first revoke all grants and then reissue the remaining grants for convergence. * * Some grants overlap, which can cause the Aiven Terraform Provider to detect a change even if you haven't made modifications. For example, using both `DELETE` and `ALTER DELETE` together might cause this issue. * The [ClickHouse grant privileges documentation](https://clickhouse.com/docs/sql-reference/statements/grant) has a list of ClickHouse privileges. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aiven from "@pulumi/aiven"; * * const exampleRole = new aiven.ClickhouseRole("example_role", { * project: exampleProject.project, * serviceName: exampleClickhouse.serviceName, * role: "example-role", * }); * // Grant privileges to the example role. * const rolePrivileges = new aiven.ClickhouseGrant("role_privileges", { * privilegeGrants: [ * { * privilege: "INSERT", * database: exampleDb.name, * table: "example-table", * }, * { * privilege: "SELECT", * database: exampleDb.name, * }, * { * privilege: "CREATE TEMPORARY TABLE", * database: "*", * }, * { * privilege: "SYSTEM DROP CACHE", * database: "*", * }, * ], * project: exampleProject.project, * serviceName: exampleClickhouse.serviceName, * role: exampleRole.role, * }); * // Grant the role to the user. * const exampleUser = new aiven.ClickhouseUser("example_user", { * project: exampleProject.project, * serviceName: exampleClickhouse.serviceName, * username: "example-user", * }); * const userRoleAssignment = new aiven.ClickhouseGrant("user_role_assignment", { * roleGrants: [{ * role: exampleRole.role, * }], * project: exampleProject.project, * serviceName: exampleClickhouse.serviceName, * user: exampleUser.username, * }); * ``` * * ## Import * * ```sh * $ pulumi import aiven:index/clickhouseGrant:ClickhouseGrant example_grant PROJECT/SERVICE_NAME/ID * ``` */ export declare class ClickhouseGrant extends pulumi.CustomResource { /** * Get an existing ClickhouseGrant 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?: ClickhouseGrantState, opts?: pulumi.CustomResourceOptions): ClickhouseGrant; /** * Returns true if the given object is an instance of ClickhouseGrant. 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 ClickhouseGrant; /** * Grant privileges. Changing this property forces recreation of the resource. */ readonly privilegeGrants: pulumi.Output; /** * The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ readonly project: pulumi.Output; /** * The role to grant privileges or roles to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ readonly role: pulumi.Output; /** * Grant roles. Changing this property forces recreation of the resource. */ readonly roleGrants: pulumi.Output; /** * The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ readonly serviceName: pulumi.Output; /** * The user to grant privileges or roles to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ readonly user: pulumi.Output; /** * Create a ClickhouseGrant 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: ClickhouseGrantArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ClickhouseGrant resources. */ export interface ClickhouseGrantState { /** * Grant privileges. Changing this property forces recreation of the resource. */ privilegeGrants?: pulumi.Input[] | undefined>; /** * The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ project?: pulumi.Input; /** * The role to grant privileges or roles to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ role?: pulumi.Input; /** * Grant roles. Changing this property forces recreation of the resource. */ roleGrants?: pulumi.Input[] | undefined>; /** * The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ serviceName?: pulumi.Input; /** * The user to grant privileges or roles to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ user?: pulumi.Input; } /** * The set of arguments for constructing a ClickhouseGrant resource. */ export interface ClickhouseGrantArgs { /** * Grant privileges. Changing this property forces recreation of the resource. */ privilegeGrants?: pulumi.Input[] | undefined>; /** * The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ project: pulumi.Input; /** * The role to grant privileges or roles to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ role?: pulumi.Input; /** * Grant roles. Changing this property forces recreation of the resource. */ roleGrants?: pulumi.Input[] | undefined>; /** * The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ serviceName: pulumi.Input; /** * The user to grant privileges or roles to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource. */ user?: pulumi.Input; } //# sourceMappingURL=clickhouseGrant.d.ts.map