1. Packages
  2. Aiven Provider
  3. API Docs
  4. ClickhouseDatabase
Aiven v6.28.0 published on Friday, Nov 15, 2024 by Pulumi

aiven.ClickhouseDatabase

Explore with Pulumi AI

aiven logo
Aiven v6.28.0 published on Friday, Nov 15, 2024 by Pulumi

    Creates and manages an Aiven for ClickHouse® database.

    Tables cannot be created using Aiven Operator. To create a table, use the Aiven Console or CLI.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aiven from "@pulumi/aiven";
    
    const exampleClickhouse = new aiven.Clickhouse("example_clickhouse", {
        project: exampleProject.project,
        cloudName: "google-europe-west1",
        plan: "business-4",
        serviceName: "example-clickhouse-service",
        maintenanceWindowDow: "monday",
        maintenanceWindowTime: "10:00:00",
    });
    const exampleDb = new aiven.ClickhouseDatabase("example_db", {
        project: exampleProject.project,
        serviceName: exampleClickhouse.serviceName,
        name: "example-database",
    });
    
    import pulumi
    import pulumi_aiven as aiven
    
    example_clickhouse = aiven.Clickhouse("example_clickhouse",
        project=example_project["project"],
        cloud_name="google-europe-west1",
        plan="business-4",
        service_name="example-clickhouse-service",
        maintenance_window_dow="monday",
        maintenance_window_time="10:00:00")
    example_db = aiven.ClickhouseDatabase("example_db",
        project=example_project["project"],
        service_name=example_clickhouse.service_name,
        name="example-database")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aiven/sdk/v6/go/aiven"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleClickhouse, err := aiven.NewClickhouse(ctx, "example_clickhouse", &aiven.ClickhouseArgs{
    			Project:               pulumi.Any(exampleProject.Project),
    			CloudName:             pulumi.String("google-europe-west1"),
    			Plan:                  pulumi.String("business-4"),
    			ServiceName:           pulumi.String("example-clickhouse-service"),
    			MaintenanceWindowDow:  pulumi.String("monday"),
    			MaintenanceWindowTime: pulumi.String("10:00:00"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = aiven.NewClickhouseDatabase(ctx, "example_db", &aiven.ClickhouseDatabaseArgs{
    			Project:     pulumi.Any(exampleProject.Project),
    			ServiceName: exampleClickhouse.ServiceName,
    			Name:        pulumi.String("example-database"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aiven = Pulumi.Aiven;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleClickhouse = new Aiven.Clickhouse("example_clickhouse", new()
        {
            Project = exampleProject.Project,
            CloudName = "google-europe-west1",
            Plan = "business-4",
            ServiceName = "example-clickhouse-service",
            MaintenanceWindowDow = "monday",
            MaintenanceWindowTime = "10:00:00",
        });
    
        var exampleDb = new Aiven.ClickhouseDatabase("example_db", new()
        {
            Project = exampleProject.Project,
            ServiceName = exampleClickhouse.ServiceName,
            Name = "example-database",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aiven.Clickhouse;
    import com.pulumi.aiven.ClickhouseArgs;
    import com.pulumi.aiven.ClickhouseDatabase;
    import com.pulumi.aiven.ClickhouseDatabaseArgs;
    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 exampleClickhouse = new Clickhouse("exampleClickhouse", ClickhouseArgs.builder()
                .project(exampleProject.project())
                .cloudName("google-europe-west1")
                .plan("business-4")
                .serviceName("example-clickhouse-service")
                .maintenanceWindowDow("monday")
                .maintenanceWindowTime("10:00:00")
                .build());
    
            var exampleDb = new ClickhouseDatabase("exampleDb", ClickhouseDatabaseArgs.builder()
                .project(exampleProject.project())
                .serviceName(exampleClickhouse.serviceName())
                .name("example-database")
                .build());
    
        }
    }
    
    resources:
      exampleClickhouse:
        type: aiven:Clickhouse
        name: example_clickhouse
        properties:
          project: ${exampleProject.project}
          cloudName: google-europe-west1
          plan: business-4
          serviceName: example-clickhouse-service
          maintenanceWindowDow: monday
          maintenanceWindowTime: 10:00:00
      exampleDb:
        type: aiven:ClickhouseDatabase
        name: example_db
        properties:
          project: ${exampleProject.project}
          serviceName: ${exampleClickhouse.serviceName}
          name: example-database
    

    Create ClickhouseDatabase Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClickhouseDatabase(name: string, args: ClickhouseDatabaseArgs, opts?: CustomResourceOptions);
    @overload
    def ClickhouseDatabase(resource_name: str,
                           args: ClickhouseDatabaseArgs,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClickhouseDatabase(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           project: Optional[str] = None,
                           service_name: Optional[str] = None,
                           name: Optional[str] = None,
                           termination_protection: Optional[bool] = None)
    func NewClickhouseDatabase(ctx *Context, name string, args ClickhouseDatabaseArgs, opts ...ResourceOption) (*ClickhouseDatabase, error)
    public ClickhouseDatabase(string name, ClickhouseDatabaseArgs args, CustomResourceOptions? opts = null)
    public ClickhouseDatabase(String name, ClickhouseDatabaseArgs args)
    public ClickhouseDatabase(String name, ClickhouseDatabaseArgs args, CustomResourceOptions options)
    
    type: aiven:ClickhouseDatabase
    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 ClickhouseDatabaseArgs
    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 ClickhouseDatabaseArgs
    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 ClickhouseDatabaseArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClickhouseDatabaseArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClickhouseDatabaseArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var clickhouseDatabaseResource = new Aiven.ClickhouseDatabase("clickhouseDatabaseResource", new()
    {
        Project = "string",
        ServiceName = "string",
        Name = "string",
        TerminationProtection = false,
    });
    
    example, err := aiven.NewClickhouseDatabase(ctx, "clickhouseDatabaseResource", &aiven.ClickhouseDatabaseArgs{
    	Project:               pulumi.String("string"),
    	ServiceName:           pulumi.String("string"),
    	Name:                  pulumi.String("string"),
    	TerminationProtection: pulumi.Bool(false),
    })
    
    var clickhouseDatabaseResource = new ClickhouseDatabase("clickhouseDatabaseResource", ClickhouseDatabaseArgs.builder()
        .project("string")
        .serviceName("string")
        .name("string")
        .terminationProtection(false)
        .build());
    
    clickhouse_database_resource = aiven.ClickhouseDatabase("clickhouseDatabaseResource",
        project="string",
        service_name="string",
        name="string",
        termination_protection=False)
    
    const clickhouseDatabaseResource = new aiven.ClickhouseDatabase("clickhouseDatabaseResource", {
        project: "string",
        serviceName: "string",
        name: "string",
        terminationProtection: false,
    });
    
    type: aiven:ClickhouseDatabase
    properties:
        name: string
        project: string
        serviceName: string
        terminationProtection: false
    

    ClickhouseDatabase 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 ClickhouseDatabase resource accepts the following input properties:

    Project string
    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.
    ServiceName string
    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.
    Name string
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    TerminationProtection bool
    Project string
    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.
    ServiceName string
    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.
    Name string
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    TerminationProtection bool
    project String
    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.
    serviceName String
    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.
    name String
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    terminationProtection Boolean
    project string
    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.
    serviceName string
    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.
    name string
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    terminationProtection boolean
    project str
    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.
    service_name str
    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.
    name str
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    termination_protection bool
    project String
    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.
    serviceName String
    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.
    name String
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    terminationProtection Boolean

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClickhouseDatabase 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 ClickhouseDatabase Resource

    Get an existing ClickhouseDatabase 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?: ClickhouseDatabaseState, opts?: CustomResourceOptions): ClickhouseDatabase
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            service_name: Optional[str] = None,
            termination_protection: Optional[bool] = None) -> ClickhouseDatabase
    func GetClickhouseDatabase(ctx *Context, name string, id IDInput, state *ClickhouseDatabaseState, opts ...ResourceOption) (*ClickhouseDatabase, error)
    public static ClickhouseDatabase Get(string name, Input<string> id, ClickhouseDatabaseState? state, CustomResourceOptions? opts = null)
    public static ClickhouseDatabase get(String name, Output<String> id, ClickhouseDatabaseState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    Name string
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    Project string
    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.
    ServiceName string
    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.
    TerminationProtection bool
    Name string
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    Project string
    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.
    ServiceName string
    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.
    TerminationProtection bool
    name String
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    project String
    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.
    serviceName String
    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.
    terminationProtection Boolean
    name string
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    project string
    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.
    serviceName string
    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.
    terminationProtection boolean
    name str
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    project str
    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.
    service_name str
    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.
    termination_protection bool
    name String
    The name of the ClickHouse database. Changing this property forces recreation of the resource.
    project String
    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.
    serviceName String
    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.
    terminationProtection Boolean

    Import

    $ pulumi import aiven:index/clickhouseDatabase:ClickhouseDatabase example_db PROJECT/SERVICE_NAME/DATABASE_NAME
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Aiven pulumi/pulumi-aiven
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aiven Terraform Provider.
    aiven logo
    Aiven v6.28.0 published on Friday, Nov 15, 2024 by Pulumi