This repository provides a convenience script to bootstrap and deploy three Pulumi projects (Basic, Standard, and Advanced Cockroach Cloud clusters) in AWS. So, no need to do these following steps as the deployment script will:
- Create project directories if they don’t exist.
- Scaffold a minimal TypeScript Pulumi project (
Pulumi.yaml,index.ts). - Install required npm packages (
@pulumi/pulumiand@pulumiverse/cockroach). - Source your Cockroach Cloud API key.
- Select or initialize a Pulumi stack.
- Configure the
cockroach:apikeysecret. - Run
pulumi up --yesto deploy without prompts.
-
Pulumi CLI: installed and logged in (
pulumi login). -
Node.js & npm: to install dependencies and run TypeScript.
- on Mac, this can be done with homebrew
-
Cockroach Cloud API key: stored and exported by your
~/.cockroachCloud/setEnv.shscript, for example:export COCKROACH_API_KEY="<YOUR_KEY>"
-
AWS credentials: configured in your environment (
aws configureor environment variables).
Each of the three projects will be created/used under these directories:
pulumiAWSBasic– a BASIC (free-tier, serverless) clusterpulumiAWSStandard– a STANDARD (paid, serverless) clusterpulumiAWSAdvanced– an ADVANCED (pre-provisioned) cluster
Customize each folder’s index.ts as needed.
NOTE: This will deploy all three projects which is probably not what you want to do. Look at the bottom of the script to see it has a for loop through all three subdirectories. Make alterations here to do only a single folder.
-
Run the script to deploy all three projects under the
devstack:./deployStack.sh
-
The script will:
- Create or reuse the
devstack - Install dependencies
- Configure secrets
- Preview and apply updates
-
Stack name: by default the script uses
dev. Change theSTACK_NAMEvariable indeploy.shto override. -
Cockroach Cloud folder: change the folder path in each
index.ts(passed tocockroach.getFolderOutput) or set via config:pulumi config set parentFolderId "<YOUR_FOLDER_ID>"
-
Adding projects: add directory names to the final loop in
deploy.sh.
After deployment, any updates to your index.ts files can be applied with:
cd <project-directory>
pulumi upScript in pulumiAWSAdvanced can change the number of nodes in Advanced pulumiAWSAdvanced/resize.sh
cd pulumiAWSAdvanced
# this will resize to 4 nodes
./resize.sh 4To tear down a project:
cd <project-directory>
pulumi destroy --yes
pulumi stack rm dev --yesFeel free to open issues or PRs for improvements!