Welcome to the Backplane Quick Start guide to get you up and running with Backplane API and CLI.
The Quick Start provides 2 paths, the Demo Server allows you to try out the UI and CLI quickly and easily. Or, the full guide to setup the Server locally.
Method | Description | Instructions |
---|---|---|
Demo | Quickly try it out on a hosted version of Backplane API | Demo API Server |
Full Setup | Host Backplane API locally | Setup API Server |
Download the Backplane CLI either from NPM or a pre-compiled binary for your OS.
The easiest way to get started is to download the Backplane CLI executable, available as a ZIP archive containing bp executable and bp.sha256
OS | Download Link |
---|---|
Mac OSX | ARM64 |
Windows | x64 |
Linux | x64 |
Open Terminal and from the directory bp has been extracted to, run the following command to move the file to your executable path:
sudo mv bp /usr/local/bin/
To verify that bp is successfully installed, run:
bp --version
1.0.0
Download bp.zip
Extract contents to folder
expand-archive bp.zip c:\backplane
Add bp.exe file system environment path
$newPath = "C:\backplane"
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", "Machine")
[System.Environment]::SetEnvironmentVariable("Path", "$currentPath;$newPath", "Machine")
Verify installation - To check if bp.exe is successfully installed, run:
bp --version
1.0.0
Download bp.zip
Extract executable from ZIP file.
sudo apt install unzip
unzip bp.zip
Move the file to your executable path
sudo mv ./bp /usr/local/bin/bp
Verify installation to check that bp is successfully installed, run:
bp --version
1.0.0
shasum -a 256 -c bp.sha256
bp: OK
Install Node.JS on your system and then from a terminal window, initialise an NPM project.
mkdir backplane-cli
cd backplane-api
npm init -y
npm i @backplane-software/backplane-cli -g
Once the CLI has been installed, within the directory containing the package.json
, run the npm link
command to make the file executable.
npm link
Use the below command to verify installation has been successful:
$ bp -V
v0.11.0
The below instructions can be used on Windows, Linux or Mac.
The fastest way to get started with Backplane API is to use the Demo API Server. This is a hosted instance of the API which you can use the CLI client to interact with.
A demo server is hosted at https://demo.backplane.dev/api
To configure the CLI client to target the demo server, simply run the following CLI command:
bp auth setserver --server https://demo.backplane.dev/api
Now you are ready to Start Using Backplane
git clone https://github.com/backplane-cloud/backplane-api.git
cd backplane-api
.env
file.
Windows: new-item .env
Linux/Mac: touch .env
and copy the below template into it.NODE_ENV=development
PORT=8000
JWT_SECRET=<provide-key>
// Make up your own secret, this is used as the salt to CryptB for password Hashing. e.g. MyS3cureP&!00word\*
MONGO_URI=<connection-string>
MAILSENDER_USERNAME=<your-username>
MAILSENDER_PASSWORD=<provide-key>
LOGTAIL_KEY=<provide-key>
LOG_LEVEL=debug
/utils/logger.js
is used as Middleware for logging purposes. It leverages LogTail, now known as Better Stack is used as a Log Repository. It’s free up to 1GB a month with 3-day retention. Create an account here: LogTail.npm i
command to install all dependenciesnpm run server
to launch server.The Backplane API Server is now up and running and you are ready to Start Using Backplane
Install Node.JS on your system and then from a terminal window, initialise an NPM project.
mkdir backplane-api
cd backplane-api
npm init -y
npm i express dotenv @backplane-software/backplane-api
.env
file.
Windows: new-item .env
Linux/Mac: touch .env
and copy the below template into it.NODE_ENV=development
PORT=8000
JWT_SECRET=<provide-key>
// Make up your own secret, this is used as the salt to CryptB for password Hashing. e.g. MyS3cureP&!00word\*
MONGO_URI=<connection-string>
MAILSENDER_USERNAME=<your-username>
MAILSENDER_PASSWORD=<provide-key>
LOGTAIL_KEY=<provide-key>
LOG_LEVEL=debug
/utils/logger.js
is used as Middleware for logging purposes. It leverages LogTail, now known as Better Stack is used as a Log Repository. It’s free up to 1GB a month with 3-day retention. Create an account here: LogTail.index.js
file and copy the below into it.import express from "express";
import dotenv from "dotenv";
import backplane from "@backplane-software/backplane-api";
// Load Environment Configuration
dotenv.config();
// Create Express Instance
const app = express();
// Initialise Backplane Server with Instance
backplane(app);
// Start REST API Server
const port = process.env.PORT || 5001;
app.listen(port, () =>
console.log(`Backplane REST API Server started on port ${port}`)
);
"type": "module"
so the script can load ES modules."server": "node index.js"
to the scripts section.npm run server
to launch server.Use curl http://localhost:8000
to confirm server is running.
The Backplane API Server is now up and running and you are ready to Start Using Backplane
Open a Terminal window and run:
git clone https://github.com/backplane-cloud/backplane-api.git
cd backplane-api
npm i
Ensure Docker is installed and run:
docker build -t backplanesoftware/backplaneapi:0.26.1 .
docker network create my-network
docker run --network my-network --name api -p 8000:8000 backplanesoftware/backplaneapi:0.26.1
docker run —network my-network —name cli -p 3000:3000 backplanesoftware/backplanecli:0.0.1
Set CLI server to docker URL http://api:8000/api
bp auth setserver —server http://api:8000/api
The Backplane API Server is now up and running and you are ready to Start Using Backplane
With the CLI and API Server configured, create your Organisation and first User.
bp user register --displayname "<Display Name>" --email "<your e-mail address>" --password "<Password>" --orgname "<Your Organisation Name>"
bp auth login -e "<your e-mail address>" -p "<Password>"
Backplane needs to connect to your Cloud Platforms by adding Cloud Service Provider credentials. A Service Principal will be required for Authentication and Authorisation, instructions are provided below:
To create credentials you’ll need to create an App registration in Entra ID.
Go to Microsoft Entra ID, and under Manage in the left side menu, select App registrations.
Click on New Registration and provide a name (e.g. backplane-api
) a name and click Register.
Take note of the Tenant ID and Client ID.
Create a new Client Secret, click on Add a certificate or secret, New client secret, type a description, set expiry and click Add. Make a note of the Secret Value.
Assign the Service Principal you created with Contributor permission at the Subscription scope.
bp cloud azure add --id "<orgID>"
--tenantid "<tenant ID>"
--clientid "<client ID>"
--clientsecret "<Your Client Secret>"
--subscriptionid "<default subscription GUID>"
The Subscription ID is required in the MVP since App environments are provisioned as Resource Groups as opposed to Subscriptions. Subscription environments will be in a future release.
IAM and admin > Service accounts
backplane-api
and a description e.g. For Backplane API environment provisioning
backplane-demo@backplane-core.iam.gserfviceaccount.com
Project Creator
, click Save.The downloaded JSON is now ready to be used in your Org.
bp cloud gcp add --id "<OrgID>" --tenantid "<Enter Google Org ID>" --gcpsecret "<path-to-JSON-file>"
backplane-api
, click next{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"organizations:CreateAccount",
"organizations:DescribeOrganization",
"iam:ListUsers",
"organizations:ListPolicies"
],
"Resource": "*"
}
]
}
bp cloud aws add --id "<OrgId>" --clientid "<accessKey>" --clientsecret "<accessKeySecret>"
Here’s how you can set up and use a service principal for authenticating Backplane with OCI
Click on “Create Dynamic Group”.
Enter a Name and Description for the dynamic group
Field | Value |
---|---|
Name | Backplane API |
Description | Service Credentials for Backplane API to create compartments |
Define the Matching Rules to include the instances or resources that you want this dynamic group to manage. For example, to include all instances in your tenancy:
ALL {instance.compartment.id = '<your_compartment_ocid>'}
Navigate to Identity & Security > Policies
Click Create Policy
Allow dynamic-group '<Domain>'/'<Dynamic Group Name>' to manage all-resources in tenancy
Field | How |
---|---|
User OCID | Go to Identity & Security -> Domain -> Users |
Tenancy OCID | Go to Governance & Administrator -> Tenancy Details |
Region | Same as above |
API Signing Key / private key | Go to Identity & Security -> Domains -> Users -> Resources -> API Key -> Add API Key -> Generate API key pair -> Download Private Key -> Add |
Fingerprint | Copy Fingerprint from Resources -> API Keys |
oci.json
file as per template below with the information collected{
"tenancyId": "ocid1.tenancy.oc1..aaaaaaaane...",
"userId": "ocid1.user.oc1..aaaaaaaayuatcpsk...",
"fingerprint": "xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx",
"privateKey": "-----BEGIN PRIVATE KEY-----\nMIIEv...n-----END PRIVATE KEY-----\n",
"region": "uk-london-1",
"passphrase": null
}
bp cloud oci add -i 66681fa21440f6afb76522e6 --ocisecret ../oci.json
An Organisation will have a number of Platforms that provide a business capability, and within those platforms will exist Products. The Platform acts as a container for Products, but also a governance boundary for Cost, Access and Policies. Let’s create our first platform:
bp platform create --displayname 'Platform A'
As the creator of the Platform, you will be assigned as the Owner.
A Product can contain one or many Apps, and an App can belong to a single Cloud Platform. For example, Product A can contain App X (Azure), App Y (AWS) and App Z (GCP). The Apps represent the Cloud Workload and set of environments.
bp product create --displayname 'Product X' --platformid '<Platform ID>'
bp app create --displayname "My first App" --cloud "azure | gcp | aws | oci"
The CLI commands have a with the --stringify
or -s
switch to return raw JSON, this can then be piped into Powershell with ConvertFromJSON
.
bp product list --stringify | Convert-FromJSON
Congraulations, this completes the Quick Start.
If you encounter any issues or errors in the documentation, please report on the Support Slack Channel