Manage DoubleCloud resources with Terraform

You can add, update, and delete ClickHouse® clusters, Apache Kafka® clusters, and transfers on DoubleCloud with the same Terraform configuration that you used to create these resources.

Add resources

  1. Add configuration of the resources you want to create to the project Terraform files.

  2. Apply the configuration and create new resources:

    terraform apply
    
  3. When prompted, type yes and press Enter. Terraform will provision your resources, which may take some time.

Update resources

Warning

Some resource parameters can't be updated. For example, you can't change an endpoint source type or make a cluster storage smaller. If you need to do that, recreate the resources.

  1. Update the resource configuration in the project Terraform files.

  2. Apply the configuration:

    terraform apply
    
  3. When prompted, type yes and press Enter. Terraform will update your resources, which may take some time.

Delete resources

  1. In the project's configuration file, comment out or remove the resources you want to delete.

  2. Apply the configuration:

    terraform apply
    
  3. When prompted, type yes and press Enter. Terraform will delete the resources you commented out or removed. This may take some time.

Alert

To remove all the resources described in the project's configuration file, you can also use the terraform destroy command. However, it's not common to use it in production environments.