Skip to main content

Cerebellum CLI

Usage

$ npm install -g @cerebellum/cli

$ cerebellum COMMAND
running command...

$ cerebellum (--version)
@cerebellum/cli/1.0.2 darwin-arm64 node-v20.11.0

$ cerebellum --help [COMMAND]
USAGE
$ cerebellum COMMAND
...

Getting Started

Prerequisites

  • an AWS account has been created
  • an AWS IAM role has been created with given AdministratorAccess permissions
    • the Access Key and Secret Access Key are required to connect to AWS
  • npm is installed
  • AWS CLI is installed and configured
  • AWS CDK is installed
  • SSL/TLS certificate has been validated and issued using AWS Certificate Manager

Installation

  • run npm install -g @cerebellum/cli
  • type cerebellum --help to see the available commands

First Time Usage

Once installed, the cerebellum commands can be run by executing cerebellum <command> in your terminal.

For further detail on each command, type cerebellum <command> --help in the terminal.

Upon executing cerebellum init or cerebellum create, you will be prompted to provide some configurations for deployment:

  • Your AWS Access Key
  • Your AWS Secret Access Key
  • Your preferred AWS region
  • AWS description (can leave blank)
  • Your dockerized image (if you intend to use your own server)
  • Your validated SSL/TLS certificate ARN from AWS Certificate Manager
  • Maximum and minimum number of concurrent remote servers for scaling up and down
    • Your infrastructure will automatically scale down to the minimum number of servers on low load
    • Your infrastructure will automatically scale up as the load increases until it reaches the approved maximum

Commands

cerebellum create

Create a new directory, initialize the CDK project, and deploy infrastructure to AWS

USAGE
$ cerebellum create

DESCRIPTION
Create a new directory, initialize the CDK project, and deploy infrastructure to AWS

cerebellum init

Initialize the CDK project in current directory and deploy infrastructure to AWS

USAGE
$ cerebellum init

DESCRIPTION
Initialize the CDK project in current directory and deploy infrastructure to AWS

cerebellum destroy

Destroy the infrastructure (delete stack from AWS)

USAGE
$ cerebellum destroy

DESCRIPTION
Destroy the infrastructure (delete stack from AWS)

FAQ

I canceled the cerebellum create (or cerebellum init) command while the infrastructure was still deploying, and now it won't let me redeploy. How can I fix this?

  • The infrastructure will continue to deploy, even if you cancel the command during deployment. You may check in your CloudFormation in the AWS console to see the logs.

I have been waiting for a really long time and it is still deploying. Is something wrong?

  • Deployments to AWS can take up to 30 minutes. There is a lot of work AWS has to do behind the scenes to provision new resources or to drain existing resources.
  • To troubleshoot, log in to your AWS console and check the logs in your CloudFormation. You will be able to discern which resource is holding up the deployment. Then, you may navigate to that resource and check its logs to further investigate.

I want to cancel my deployment, but it is still updating or deploying. How can I do this?

  • If there are any errors, or if you wish to cancel the deployment, you can force delete the stack from CloudFormation in the AWS console.

Does Cerebellum apply identifiers to the infrastructure that gets spun up by the CLI?

  • Everything deployed using cerebellum create or cerebellum init has Cerebellum as a prefix on its identifier. You can change these manually in the CDK if you wish, but make sure they are uniquely named.