tencentcloud.ClickhouseAccountPermission
Explore with Pulumi AI
Provides a resource to create a clickhouse account_permission
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const accountPermissionAllDatabase = new tencentcloud.ClickhouseAccountPermission("accountPermissionAllDatabase", {
allDatabase: true,
cluster: "default_cluster",
globalPrivileges: [
"SELECT",
"ALTER",
],
instanceId: "cdwch-xxxxxx",
userName: "user1",
});
const accountPermissionNotAllDatabase = new tencentcloud.ClickhouseAccountPermission("accountPermissionNotAllDatabase", {
allDatabase: false,
cluster: "default_cluster",
databasePrivilegeLists: [{
databaseName: "xxxxxx",
databasePrivileges: [
"SELECT",
"ALTER",
],
}],
instanceId: "cdwch-xxxxxx",
userName: "user2",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
account_permission_all_database = tencentcloud.ClickhouseAccountPermission("accountPermissionAllDatabase",
all_database=True,
cluster="default_cluster",
global_privileges=[
"SELECT",
"ALTER",
],
instance_id="cdwch-xxxxxx",
user_name="user1")
account_permission_not_all_database = tencentcloud.ClickhouseAccountPermission("accountPermissionNotAllDatabase",
all_database=False,
cluster="default_cluster",
database_privilege_lists=[{
"database_name": "xxxxxx",
"database_privileges": [
"SELECT",
"ALTER",
],
}],
instance_id="cdwch-xxxxxx",
user_name="user2")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewClickhouseAccountPermission(ctx, "accountPermissionAllDatabase", &tencentcloud.ClickhouseAccountPermissionArgs{
AllDatabase: pulumi.Bool(true),
Cluster: pulumi.String("default_cluster"),
GlobalPrivileges: pulumi.StringArray{
pulumi.String("SELECT"),
pulumi.String("ALTER"),
},
InstanceId: pulumi.String("cdwch-xxxxxx"),
UserName: pulumi.String("user1"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewClickhouseAccountPermission(ctx, "accountPermissionNotAllDatabase", &tencentcloud.ClickhouseAccountPermissionArgs{
AllDatabase: pulumi.Bool(false),
Cluster: pulumi.String("default_cluster"),
DatabasePrivilegeLists: tencentcloud.ClickhouseAccountPermissionDatabasePrivilegeListArray{
&tencentcloud.ClickhouseAccountPermissionDatabasePrivilegeListArgs{
DatabaseName: pulumi.String("xxxxxx"),
DatabasePrivileges: pulumi.StringArray{
pulumi.String("SELECT"),
pulumi.String("ALTER"),
},
},
},
InstanceId: pulumi.String("cdwch-xxxxxx"),
UserName: pulumi.String("user2"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var accountPermissionAllDatabase = new Tencentcloud.ClickhouseAccountPermission("accountPermissionAllDatabase", new()
{
AllDatabase = true,
Cluster = "default_cluster",
GlobalPrivileges = new[]
{
"SELECT",
"ALTER",
},
InstanceId = "cdwch-xxxxxx",
UserName = "user1",
});
var accountPermissionNotAllDatabase = new Tencentcloud.ClickhouseAccountPermission("accountPermissionNotAllDatabase", new()
{
AllDatabase = false,
Cluster = "default_cluster",
DatabasePrivilegeLists = new[]
{
new Tencentcloud.Inputs.ClickhouseAccountPermissionDatabasePrivilegeListArgs
{
DatabaseName = "xxxxxx",
DatabasePrivileges = new[]
{
"SELECT",
"ALTER",
},
},
},
InstanceId = "cdwch-xxxxxx",
UserName = "user2",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ClickhouseAccountPermission;
import com.pulumi.tencentcloud.ClickhouseAccountPermissionArgs;
import com.pulumi.tencentcloud.inputs.ClickhouseAccountPermissionDatabasePrivilegeListArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var accountPermissionAllDatabase = new ClickhouseAccountPermission("accountPermissionAllDatabase", ClickhouseAccountPermissionArgs.builder()
.allDatabase(true)
.cluster("default_cluster")
.globalPrivileges(
"SELECT",
"ALTER")
.instanceId("cdwch-xxxxxx")
.userName("user1")
.build());
var accountPermissionNotAllDatabase = new ClickhouseAccountPermission("accountPermissionNotAllDatabase", ClickhouseAccountPermissionArgs.builder()
.allDatabase(false)
.cluster("default_cluster")
.databasePrivilegeLists(ClickhouseAccountPermissionDatabasePrivilegeListArgs.builder()
.databaseName("xxxxxx")
.databasePrivileges(
"SELECT",
"ALTER")
.build())
.instanceId("cdwch-xxxxxx")
.userName("user2")
.build());
}
}
resources:
accountPermissionAllDatabase:
type: tencentcloud:ClickhouseAccountPermission
properties:
allDatabase: true
cluster: default_cluster
globalPrivileges:
- SELECT
- ALTER
instanceId: cdwch-xxxxxx
userName: user1
accountPermissionNotAllDatabase:
type: tencentcloud:ClickhouseAccountPermission
properties:
allDatabase: false
cluster: default_cluster
databasePrivilegeLists:
- databaseName: xxxxxx
databasePrivileges:
- SELECT
- ALTER
instanceId: cdwch-xxxxxx
userName: user2
Create ClickhouseAccountPermission Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ClickhouseAccountPermission(name: string, args: ClickhouseAccountPermissionArgs, opts?: CustomResourceOptions);
@overload
def ClickhouseAccountPermission(resource_name: str,
args: ClickhouseAccountPermissionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ClickhouseAccountPermission(resource_name: str,
opts: Optional[ResourceOptions] = None,
all_database: Optional[bool] = None,
cluster: Optional[str] = None,
instance_id: Optional[str] = None,
user_name: Optional[str] = None,
clickhouse_account_permission_id: Optional[str] = None,
database_privilege_lists: Optional[Sequence[ClickhouseAccountPermissionDatabasePrivilegeListArgs]] = None,
global_privileges: Optional[Sequence[str]] = None)
func NewClickhouseAccountPermission(ctx *Context, name string, args ClickhouseAccountPermissionArgs, opts ...ResourceOption) (*ClickhouseAccountPermission, error)
public ClickhouseAccountPermission(string name, ClickhouseAccountPermissionArgs args, CustomResourceOptions? opts = null)
public ClickhouseAccountPermission(String name, ClickhouseAccountPermissionArgs args)
public ClickhouseAccountPermission(String name, ClickhouseAccountPermissionArgs args, CustomResourceOptions options)
type: tencentcloud:ClickhouseAccountPermission
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ClickhouseAccountPermissionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ClickhouseAccountPermissionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ClickhouseAccountPermissionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ClickhouseAccountPermissionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ClickhouseAccountPermissionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ClickhouseAccountPermission Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ClickhouseAccountPermission resource accepts the following input properties:
- All
Database bool - Whether all database tables.
- Cluster string
- Cluster name.
- Instance
Id string - Instance id.
- User
Name string - User name.
- Clickhouse
Account stringPermission Id - ID of the resource.
- Database
Privilege List<ClickhouseLists Account Permission Database Privilege List> - Database privilege list.
- Global
Privileges List<string> - Global privileges.
- All
Database bool - Whether all database tables.
- Cluster string
- Cluster name.
- Instance
Id string - Instance id.
- User
Name string - User name.
- Clickhouse
Account stringPermission Id - ID of the resource.
- Database
Privilege []ClickhouseLists Account Permission Database Privilege List Args - Database privilege list.
- Global
Privileges []string - Global privileges.
- all
Database Boolean - Whether all database tables.
- cluster String
- Cluster name.
- instance
Id String - Instance id.
- user
Name String - User name.
- clickhouse
Account StringPermission Id - ID of the resource.
- database
Privilege List<ClickhouseLists Account Permission Database Privilege List> - Database privilege list.
- global
Privileges List<String> - Global privileges.
- all
Database boolean - Whether all database tables.
- cluster string
- Cluster name.
- instance
Id string - Instance id.
- user
Name string - User name.
- clickhouse
Account stringPermission Id - ID of the resource.
- database
Privilege ClickhouseLists Account Permission Database Privilege List[] - Database privilege list.
- global
Privileges string[] - Global privileges.
- all_
database bool - Whether all database tables.
- cluster str
- Cluster name.
- instance_
id str - Instance id.
- user_
name str - User name.
- clickhouse_
account_ strpermission_ id - ID of the resource.
- database_
privilege_ Sequence[Clickhouselists Account Permission Database Privilege List Args] - Database privilege list.
- global_
privileges Sequence[str] - Global privileges.
- all
Database Boolean - Whether all database tables.
- cluster String
- Cluster name.
- instance
Id String - Instance id.
- user
Name String - User name.
- clickhouse
Account StringPermission Id - ID of the resource.
- database
Privilege List<Property Map>Lists - Database privilege list.
- global
Privileges List<String> - Global privileges.
Outputs
All input properties are implicitly available as output properties. Additionally, the ClickhouseAccountPermission resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ClickhouseAccountPermission Resource
Get an existing ClickhouseAccountPermission resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ClickhouseAccountPermissionState, opts?: CustomResourceOptions): ClickhouseAccountPermission
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
all_database: Optional[bool] = None,
clickhouse_account_permission_id: Optional[str] = None,
cluster: Optional[str] = None,
database_privilege_lists: Optional[Sequence[ClickhouseAccountPermissionDatabasePrivilegeListArgs]] = None,
global_privileges: Optional[Sequence[str]] = None,
instance_id: Optional[str] = None,
user_name: Optional[str] = None) -> ClickhouseAccountPermission
func GetClickhouseAccountPermission(ctx *Context, name string, id IDInput, state *ClickhouseAccountPermissionState, opts ...ResourceOption) (*ClickhouseAccountPermission, error)
public static ClickhouseAccountPermission Get(string name, Input<string> id, ClickhouseAccountPermissionState? state, CustomResourceOptions? opts = null)
public static ClickhouseAccountPermission get(String name, Output<String> id, ClickhouseAccountPermissionState state, CustomResourceOptions options)
resources: _: type: tencentcloud:ClickhouseAccountPermission get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- All
Database bool - Whether all database tables.
- Clickhouse
Account stringPermission Id - ID of the resource.
- Cluster string
- Cluster name.
- Database
Privilege List<ClickhouseLists Account Permission Database Privilege List> - Database privilege list.
- Global
Privileges List<string> - Global privileges.
- Instance
Id string - Instance id.
- User
Name string - User name.
- All
Database bool - Whether all database tables.
- Clickhouse
Account stringPermission Id - ID of the resource.
- Cluster string
- Cluster name.
- Database
Privilege []ClickhouseLists Account Permission Database Privilege List Args - Database privilege list.
- Global
Privileges []string - Global privileges.
- Instance
Id string - Instance id.
- User
Name string - User name.
- all
Database Boolean - Whether all database tables.
- clickhouse
Account StringPermission Id - ID of the resource.
- cluster String
- Cluster name.
- database
Privilege List<ClickhouseLists Account Permission Database Privilege List> - Database privilege list.
- global
Privileges List<String> - Global privileges.
- instance
Id String - Instance id.
- user
Name String - User name.
- all
Database boolean - Whether all database tables.
- clickhouse
Account stringPermission Id - ID of the resource.
- cluster string
- Cluster name.
- database
Privilege ClickhouseLists Account Permission Database Privilege List[] - Database privilege list.
- global
Privileges string[] - Global privileges.
- instance
Id string - Instance id.
- user
Name string - User name.
- all_
database bool - Whether all database tables.
- clickhouse_
account_ strpermission_ id - ID of the resource.
- cluster str
- Cluster name.
- database_
privilege_ Sequence[Clickhouselists Account Permission Database Privilege List Args] - Database privilege list.
- global_
privileges Sequence[str] - Global privileges.
- instance_
id str - Instance id.
- user_
name str - User name.
- all
Database Boolean - Whether all database tables.
- clickhouse
Account StringPermission Id - ID of the resource.
- cluster String
- Cluster name.
- database
Privilege List<Property Map>Lists - Database privilege list.
- global
Privileges List<String> - Global privileges.
- instance
Id String - Instance id.
- user
Name String - User name.
Supporting Types
ClickhouseAccountPermissionDatabasePrivilegeList, ClickhouseAccountPermissionDatabasePrivilegeListArgs
- Database
Name string - Database name.
- Database
Privileges List<string> - Database privileges. Valid valuse: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE, CREATE_TABLE, DROP_DATABASE.
- Table
Privilege List<ClickhouseLists Account Permission Database Privilege List Table Privilege List> - Table privilege list.
- Database
Name string - Database name.
- Database
Privileges []string - Database privileges. Valid valuse: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE, CREATE_TABLE, DROP_DATABASE.
- Table
Privilege []ClickhouseLists Account Permission Database Privilege List Table Privilege List - Table privilege list.
- database
Name String - Database name.
- database
Privileges List<String> - Database privileges. Valid valuse: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE, CREATE_TABLE, DROP_DATABASE.
- table
Privilege List<ClickhouseLists Account Permission Database Privilege List Table Privilege List> - Table privilege list.
- database
Name string - Database name.
- database
Privileges string[] - Database privileges. Valid valuse: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE, CREATE_TABLE, DROP_DATABASE.
- table
Privilege ClickhouseLists Account Permission Database Privilege List Table Privilege List[] - Table privilege list.
- database_
name str - Database name.
- database_
privileges Sequence[str] - Database privileges. Valid valuse: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE, CREATE_TABLE, DROP_DATABASE.
- table_
privilege_ Sequence[Clickhouselists Account Permission Database Privilege List Table Privilege List] - Table privilege list.
- database
Name String - Database name.
- database
Privileges List<String> - Database privileges. Valid valuse: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE, CREATE_TABLE, DROP_DATABASE.
- table
Privilege List<Property Map>Lists - Table privilege list.
ClickhouseAccountPermissionDatabasePrivilegeListTablePrivilegeList, ClickhouseAccountPermissionDatabasePrivilegeListTablePrivilegeListArgs
- Table
Name string - Table name.
- Table
Privileges List<string> - Table privileges. Valid values: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE.
- Table
Name string - Table name.
- Table
Privileges []string - Table privileges. Valid values: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE.
- table
Name String - Table name.
- table
Privileges List<String> - Table privileges. Valid values: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE.
- table
Name string - Table name.
- table
Privileges string[] - Table privileges. Valid values: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE.
- table_
name str - Table name.
- table_
privileges Sequence[str] - Table privileges. Valid values: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE.
- table
Name String - Table name.
- table
Privileges List<String> - Table privileges. Valid values: SELECT, INSERT_ALL, ALTER, TRUNCATE, DROP_TABLE.
Import
clickhouse account_permission can be imported using the id, e.g.
$ pulumi import tencentcloud:index/clickhouseAccountPermission:ClickhouseAccountPermission account_permission ${instanceId}#${cluster}#${userName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.