Using Commandeer as a Front-End Console for AWS Local Resources
If you’ve worked with Localstack for mock AWS testing, then chances are most of the interactions with the stack have been via the AWS CLI or an SDK. Localstack’s Community Edition does not currently offer an official web-based UI, however, this feature is offered in Pro and Enterprise versions.
At a basic level, Commandeer provides a neat UI for interaction with AWS cloud and Localstack services.
The context of this article is limited to providing a basic overview of setting up Commandeer (release version 1.6.0) with Localstack.
Installing Commandeer
Ensure you have Snap and Docker installed on your Linux distro.
Install Commandeer by running:
$ sudo snap install commandeer
Localstack Set Up
You have the option to configure and launch Localstack from the Commandeer console, or alternatively, using Docker Compose to instantiate a Localstack instance, ready for hooking into Commandeer.
My preference was to use Docker Compose.
The following outlines the Localstack setup running on my localhost.
- Create directory structure for files and docker mounts.
$ mkdir -p $HOME/localstack/host_tmp_dir
- Create a docker-compose file at
$HOME/localstack/docker-compose.yml
with the following contents.
version: '3.7'
services:
localstack:
container_name: localstack-main
image: localstack/localstack:0.12.5
ports:
- "4566:4566"
- "4571:4571"
environment:
- SERVICES=${SERVICES-acm,apigateway
,cloudformation,cloudwatch,dynamodb
,dynamodbstreams,ec2,es,events
,firehose,iam,kinesis,kms,lambda,rds
,route53,s3,s3api,secretsmanager,ses,sns
,sqs,ssm,stepfunctions,sts}
- DEBUG=${DEBUG- }
- LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR-docker}
- KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY-0.0}
- DOCKER_HOST=unix:///var/run/docker.sock
- DATA_DIR=/tmp/localstack/data
- HOST_TMP_FOLDER=${TMPDIR}
- LAMBDA_REMOTE_DOCKER=false
volumes:
- "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
- Bring up the stack using:
$ cd $HOME/localstack
$ TMPDIR=$HOME/localstack/host_tmp_dir docker-compose up -d
The combination of compose environment variables, LAMBDA_REMOTE_DOCKER=false
and HOST_TMP_FOLDER=${TMPDIR}
imply that our docker host and docker client are on the same machine. Refer to Localstack configuration documentation for further details.
Check Commandeer to Localstack Connectivity
- Start Commandeer from a terminal by running:
$ commandeer &
- This should get you to the
Welcome to Commandeer
start up window
- To continue using Commandeer with Localstack on a limited plan, hit the
escape
key - You can choose to
Login in App
to signup for a premium paid plan, which provides access to an extensively richer feature set - You should now be at the main console
- You’ll also notice a reference to account
local
, which has has been created by default
- From the left hand services pane, scroll to
Localstack
and select theDashboard
sub item
- Commandeer’s console should refresh to reflect the running Localstack services
- The above shows a total of 24 active services (“Services on”)
- Towards the top right hand of the console, you should also see Docker and Localstack status indicators highlighted in green
Examples of Using the Commandeer Console
Below are some simple examples used to test the set up.
S3 Bucket Creation
- The below example shows the creation of an
S3
bucket with namesample
, using the console
Execute an Existing Lambda Function
- The following demonstrates Commandeer console being used to trigger an existing Lambda, hosted on Localstack
Closing Remarks
The setup accomplished in this article serves as a foundation for further discovery of Commandeer’s capabilities.
The Commandeer app code base is closed source, however, a demo application for help in creating Commandeer service is publicly available via an open source repo.