0.1.5 • Published 12 months ago

@architect-io/cldctl v0.1.5

Weekly downloads
-
License
-
Repository
github
Last release
12 months ago

cldctl standardizes the interfaces for common cloud resources like VPCs, managed kubernetes clusters, and more, making it easier for developers to create and manage on-demand cloud infrastructure. With this CLI, you'll be able to list, get, create, or delete supported resources from your favorite cloud providers and tools without learning the API calls or language used by each individual provider.

Preqes

Please make sure to install

(https://nodejs.org/en/)

Usage

# Install the CLI
$ npm install -g @architect-io/cldctl

# Register your first provider
$ cldctl add credentials --name my-credentials

# List some resources
$ cldctl list vpc --credentials my-credentials

# Create a resource
$ cldctl create vpc

Cloud Providers

Before you'll be able to interact with any cloud resources, you'll need to register your cloud credentials with cldctl:

# The CLI will prompt you for available provider types and required credentials
$ cldctl add credentials

Scroll down to see more information about how to register each provider. We highly recommend taking the time to read through our Readme for your desired cloud provider. While cldctl can help to simplify the managment of resources, each cloud provider has it's own quirks that can still add some complexity to getting started. Our step by step guide can help make sure everything wroks smoothly the first time.

Supported providers

GCP

To get started with GCP we need to first add a new service account. That should have access to the following credentials:

  • Compute Admin
  • Kubernetes Engine Admin
  • Service Account User

After creation click on the service account from the provided list. To use the service account we need to create a key. So on the top of the page select Keys. Now we can click on Add Key and select JSON for the type. The key should automatically start downloading to your computer. When you run the create provider command, you will just need to provide the location of this file.

The final step is to enable the ability to manage GCP using their APIs. To do this go to the following links and make sure the APIs are enabled.

AWS

To setup AWS we need to generate an acces key. To start go to the IAM page on the AWS console. Next, click on Add User. From here just make sure to give the user a descriptive name and make sure to select Access key - Programmatic access from the Access Type selection.

For permissions we need to generate a new policy. So open up https://us-east-1.console.aws.amazon.com/iam/home#/policies$new in a new tab. We are going to paste in the following JSON.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "eks:*",
                "iam:*",
                "ec2:*",
                "logs:*"
            ],
            "Resource": "*"
        }
    ]
}

From there just finish creating the policy and give it an easy to remember policy name like cldctl.

Going back to the IAM webpage, for permissions we are going to Attach existing policies directly. Make sure to add the policy you generated in the earlier step.

From here just go through the rest of the flow, but do not click close. This final page will provide you with an Access key ID and a Secret Access Key. These are the required values that must be passed in during the provider creation.

Digitial Ocean

Navigate to the Api Page on the Digitial Ocean dashboard and click Generate New Token. Fill out the form provided. To make sure your token never expires you can set Expiration to never.

Once the token is generated it will appear in the list of keys. Copy the token as once you leave this page the token will not be visible again. This token is used during the provider creation process.

Resource types

The first reponsibility of this CLI is to define a set of standard schemas for common cloud resources, like VPCs, Regions, managed kubernetes clusters, and more. Below is the current list of supported schemas as well as some insights into future plans for support:

Supported resources

Interacting with resources

$ cldctl list <resource>
$ cldctl list all
$ cldctl get <resource> <id>
$ cldctl create <resource>
$ cldctl delete <resource> <id>