You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrate/terraform/tutorial.md
+48-33Lines changed: 48 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,30 +3,31 @@
3
3
4
4
## Introduction
5
5
6
-
CrateDB already has a wide variety of deployment options, ranging from
7
-
{ref}`docker-compose` to {ref}`cloud setups <install-cloud>` on AWS and Azure.
6
+
CrateDB offers multiple deployment options, from {ref}`docker-compose` to
7
+
{ref}`cloud setups <install-cloud>` on AWS and Azure.
8
8
9
-
To make cloud setups more manageable and predictable, we today add another
10
-
option using [Terraform], an infrastructure-as-code tool.
11
-
Terraform eliminates the need to create resources manually via the cloud console.
12
-
Instead, it is based on a configuration language describing resources based
13
-
on a given parametrization.
9
+
To make cloud setups more manageable and predictable, this guide presents
10
+
another option using [Terraform], an infrastructure-as-code tool.
11
+
Terraform eliminates manual console steps to create resources.
12
+
Instead, Terraform uses a configuration language that describes resources
13
+
based on a given parametrization.
14
14
15
15
## Example
16
16
17
-
The example below shows a 3node cluster across several availability zones on AWS.
18
-
Currently, AWS and Azure are supported as target platforms.
19
-
The setup for Azure is very similar, please see the [README].
17
+
This example deploys a 3‑node cluster across multiple Availability Zones on AWS.
18
+
The module currently supports AWS and Azure.
19
+
For Azure, see the [README].
20
20
21
21
## Configuration
22
22
23
-
First, we create a new Terraform configuration file named `main.tf`.
24
-
That file references the [crate/crate-terraform](https://github.com/crate/crate-terraform) repository with the underlying logic of the deployment. Several variables need to be specified regarding the target environment.
23
+
First, create a new Terraform configuration file named `main.tf`.
24
+
That file references the [crate/cratedb-terraform](https://github.com/crate/cratedb-terraform) repository with the underlying logic of the deployment.
25
+
Specify several variables regarding the target environment.
# Connection information on the newly created cluster
73
+
# Connection information for the newly created cluster
73
74
output "cratedb" {
74
75
value = module.cratedb-cluster
75
76
sensitive = true
@@ -78,12 +79,11 @@ output "cratedb" {
78
79
79
80
## Execution
80
81
81
-
Once all variables are adjusted, we initialize Terraform by installing needed plugins:
82
-
82
+
Once you adjust all variables, initialize Terraform by installing the needed plugins.
83
83
```bash
84
84
$ terraform init
85
85
Initializing modules...
86
-
Downloading [email protected]:crate/crate-terraform.git for cratedb-cluster...
86
+
Downloading [email protected]:crate/cratedb-terraform.git for cratedb-cluster...
87
87
- cratedb-cluster in .terraform/modules/cratedb-cluster/aws
88
88
89
89
Initializing the backend...
@@ -112,7 +112,8 @@ Terraform has been successfully initialized!
112
112
[...]
113
113
```
114
114
115
-
Before deploying anything to the cloud, we can optionally print the planned resource creation that Terraform derived from the configuration (the output below is shortened):
115
+
Before deploying, optionally print the planned resource creation derived from the
116
+
configuration (shortened output below):
116
117
```bash
117
118
$ terraform plan
118
119
@@ -255,7 +256,8 @@ cratedb = <sensitive>
255
256
```
256
257
257
258
## Connecting to CrateDB
258
-
The `cratedb` output element contains information on the newly created cluster, such as URL and credentials. Since it contains the admin password, the output is marked as sensitive and not immediately shown by Terraform. It can be made visible via the `terraform output` command:
259
+
The `cratedb` output element contains information on the newly created cluster, such as URL and credentials.
260
+
Since it contains the admin password, Terraform marks the output as sensitive and does not immediately display it. Use the `terraform output` command to display it:
259
261
```bash
260
262
$ terraform output cratedb
261
263
{
@@ -267,7 +269,13 @@ $ terraform output cratedb
267
269
268
270
## Teardown
269
271
270
-
If you no longer need the deployed cluster, a simple `terraform destroy` from the same directory will suffice.
272
+
:::{caution}
273
+
This tutorial creates billable AWS resources. Destroy the stack when finished
274
+
to avoid ongoing costs.
275
+
:::
276
+
277
+
If you no longer need the deployed cluster, a simple `terraform destroy` from
278
+
the same directory will suffice.
271
279
272
280
```bash
273
281
$ terraform destroy
@@ -291,16 +299,23 @@ Changes to Outputs:
291
299
Destroy complete! Resources: 22 destroyed.
292
300
```
293
301
294
-
For optimal security, a self-signed SSL certificate was automatically generated and deployed. After adding an exception in your browser to accept the certificate, the HTTP Basic Auth dialog of CrateDB’s Admin UI will show. Authenticate with the credentials retrieved from above.
302
+
Terraform generates and deploys a self‑signed TLS certificate. After adding a
If the credentials are rejected, or no authentication prompt appears, please wait for a couple of minutes and try again. Provisioning the virtual machines might not be complete yet and can take several minutes.
306
+
If authentication fails or no prompt appears, wait a few minutes and retry;
307
+
VM provisioning and service initialization can take several minutes.
297
308
298
309
## Final Remarks
299
310
300
-
Please note that (as of now) the provided Terraform configuration is meant for development or testing purposes and doesn’t fulfill all requirements of a production-ready setup (i.e. regarding high availability, encryption, or backups). For production-ready setups, please consider [CrateDB Cloud](https://crate.io/products/cratedb-cloud/).
311
+
This Terraform configuration targets development or testing and is not
312
+
production‑ready (e.g. it does not touch high availability, encryption, backups).
313
+
For production, consider using [CrateDB Cloud].
301
314
302
-
If you have any feedback or requests to extend the configuration, please feel free to [open an issue on GitHub](https://github.com/crate/crate-terraform/issues) or let us know in this thread!
315
+
To request enhancements or share feedback, [open an issue on GitHub].
0 commit comments