Skip to content

Commit 03656c9

Browse files
committed
Terraform: Implement suggestions by CodeRabbit
1 parent b91aa2d commit 03656c9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/integrate/terraform/tutorial.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ Terraform eliminates manual console steps to create resources.
1212
Instead, Terraform uses a configuration language that describes resources
1313
with parameters.
1414

15+
## Prerequisites
16+
17+
- Terraform CLI >= 1.5
18+
- An AWS account with credentials configured (AWS SSO/profile or env vars)
19+
and a default region or the provider block shown below
20+
- Existing VPC and subnet IDs in the chosen region (and their AZ mapping)
21+
- An EC2 key pair name to use for SSH
22+
- jq installed (used to pretty‑print JSON output)
23+
1524
## Example
1625

1726
This example deploys a 3‑node cluster across multiple Availability Zones on AWS.
@@ -28,6 +37,9 @@ Then, specify variables for the target environment.
2837
terraform {
2938
required_version = ">= 1.5.0"
3039
}
40+
provider "aws" {
41+
region = "eu-central-1"
42+
}
3143
module "cratedb_cluster" {
3244
source = "https://github.com/crate/cratedb-terraform.git//aws"
3345
@@ -70,6 +82,7 @@ module "cratedb_cluster" {
7082
ssh_keypair = "cratedb_cluster"
7183
7284
# Enable SSH access to EC2 instances
85+
# Tip: restrict SSH to your IP/CIDRs if supported by the module.
7386
ssh_access = true
7487
}
7588
@@ -86,7 +99,7 @@ Once you adjust all variables, initialize Terraform by installing the needed plu
8699
```bash
87100
$ terraform init
88101
Initializing modules...
89-
Downloading https://github.com/crate/cratedb-terraform.git for cratedb_cluster...
102+
Downloading git::https://github.com/crate/cratedb-terraform.git for cratedb_cluster...
90103
- cratedb_cluster in .terraform/modules/cratedb_cluster/aws
91104

92105
Initializing the backend...
@@ -263,7 +276,8 @@ cratedb = <sensitive>
263276
The `cratedb` output element contains the connection details (URL and
264277
credentials). Because it’s marked sensitive, human‑readable output is
265278
redacted. Use the `terraform output` command to display it, adding
266-
`-json` to print the full value and pipe it to `jq`:
279+
`-json` to print the full value and pipe it to `jq` (ensure `jq` is
280+
installed).
267281
```bash
268282
terraform output -json cratedb | jq
269283
```

0 commit comments

Comments
 (0)