Releases

Announcing Elastic Cloud Control (ecctl) 1.0.0 beta

Today we are thrilled to announce the release of version 1.0.0-beta1 of Elastic Cloud Control (ecctl), a command-line tool to interact with the Elastic Cloud Enterprise (ECE) REST API.

ecctl was created to provide you with a powerful way to leverage ECE’s REST API layer. For those who prefer to work from a terminal, ecctl offers a user-friendly interface to create and manage deployments. The command-line interface also offers features such as autocomplete and a help menu for each command. Furthermore, ecctl can be used to manage your ECE installation by automating various tasks in the platform, making administration easier.

And there’s more: We provide you with a Golang SDK that can programmatically interact with our REST API as part of your Go application. The SDK can be found in our cloud-sdk-go Github repository and is the same project we use to build ecctl. Both options allow you to automate procedures as part of your CI/CD pipeline, onboarding of new teams or projects, and many other scenarios.

Installing ecctl

You can install ecctl using brew (for macOS), or you can download the latest binary from the ecctl releases page. In this example, we will use brew.

$ brew tap elastic/tap
$ brew install elastic/tap/ecctl

Additionally, you would want to add the source command to your shell interpreter configuration file to avoid having to repeat running this command every time you open a new session in your terminal. 

$ source <(ecctl generate completions)
echo "source <(ecctl generate completions)" >> ~/.bash_profile # or `echo "source <(ecctl generate completions)" >> ~/.zshrc` in case you are using ZSH

If you choose to download the ecctl binary from the releases page, make sure to add it to the $PATH variable in your shell interpreter configuration file as well for easy execution.

Configuring ecctl

Now that you have ecctl installed, to get you set up, there is a dedicated “ecctl init” command that will ask you to provide the ECE API server URL along with your username and password or API key. When entering your ECE API server URL, notice you should use the API server’s specific port (default is 12343) instead of port 12443, which is used to serve the UI application.

$ ecctl init
Welcome to the Elastic Cloud CLI! This command will guide you through authenticating and setting some default values.
Missing configuration file, would you like to initialize it? [y/n]: y
Enter the URL of your ECE installation: https://<your ece install dns address>:12343
What default output format would you like?
  [1] text - Human-readable output format, commands with no output templates defined will fall back to JSON.
  [2] json - JSON formatted output API responses.
Please enter a choice: 2
Which authentication mechanism would you like to use?
  [1] API Keys (Recommended).
  [2] Username and Password login.
Please enter your choice: 2
Type in your username: admin
Type in your password: 
Your credentials seem to be valid, and show you're authenticated as "admin".
You're all set! Here are some commands to try:
  $ ecctl auth user key list
  $ ecctl deployment elasticsearch list
Config written to /Users/ <username>/.ecctl/config.json

Creating your first deployment

To create your first deployment, you can use the ecctl deployment create command, which accepts a deployment description in the form of a JSON file and a stack version and name as inputs.

$ ecctl deployment create --file ./deployment.json --name=my-new-deployment --version=7.4.1 
{ 
  "created": true, 
  "id": "c44ad3fa558a237d0c17d0f4273801df", 
  "name": "my example cluster", 
  "resources": [ 
    { 
      "cloud_id": "my_elasticsearch_cluster:<em>REDACTED</em>", 
      "credentials": { 
        "password": "<em>REDACTED</em>", 
        "username": "elastic" 
      }, 
      "id": "edd8b0bf7ece46dab47acc7074a7f191", 
      "kind": "elasticsearch", 
      "ref_id": "my-es-cluster", 
      "region": "ece-region" 
    }, 
    { 
      "elasticsearch_cluster_ref_id": "my-es-cluster", 
      "id": "44dd3575894b4fc89bd600f56d1c130d", 
      "kind": "kibana", 
      "ref_id": "my-kibana-instance", 
      "region": "ece-region" 
    }, 
    { 
      "elasticsearch_cluster_ref_id": "my-es-cluster", 
      "id": "9868cd370bdc469a8364ece4fe0db16d", 
      "kind": "apm", 
      "ref_id": "my-apm-instance", 
      "region": "ece-region", 
      "secret_token": "<em>REDACTED</em>" 
    } 
  ] 
}

There’s much more you can use ecctl for, and you can continue exploring ecctl and its various commands by issuing ecctl <command> <help> to see the different options we support. 

Both ecctl and cloud-sdk-go are open source under an Apache 2 license, and we would love to get your feedback once you’ve had a chance to take it for a spin. Feel free to open issues and submit pull requests in either ecctl or cloud-sdk-go Github repositories and let us know what you think.