@@ -12,6 +12,15 @@ Terraform eliminates manual console steps to create resources.
1212Instead, Terraform uses a configuration language that describes resources
1313with 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
1726This example deploys a 3‑node cluster across multiple Availability Zones on AWS.
@@ -28,6 +37,9 @@ Then, specify variables for the target environment.
2837terraform {
2938 required_version = ">= 1.5.0"
3039}
40+ provider "aws" {
41+ region = "eu-central-1"
42+ }
3143module "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
88101Initializing 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
92105Initializing the backend...
@@ -263,7 +276,8 @@ cratedb = <sensitive>
263276The ` cratedb ` output element contains the connection details (URL and
264277credentials). Because it’s marked sensitive, human‑readable output is
265278redacted. 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
268282terraform output -json cratedb | jq
269283```
0 commit comments