Host and container auto-detection
Learn how Cased Shell's auto-detection feature works.
To ensure that your teams can quickly access the command-line tools they need - whether they exist on a long-lived host, or on a container created 45 seconds ago - Cased Shell can be configured to provide quick and easy access to those command-line prompts using our host auto-detection feature.
Cased Shell’s prompt auto-detection feature is configured with a list of queries and associated metadata designed to describe the results and connection options necessary to connect to a prompt.
The provided queries are run against your cloud provider’s APIs, and any returned results are presented to the user along with the included metadata. This powerful combination of queries and metadata allows you to provide one-click access to the tools your team needs, like a “Rails Console” link that automatically runs the
bin/rails console
command in a container named rails-prod-f567d6c
running on i-456afc9
(after first establishing a connection to bastion-567cee7
).Your infrastructure may include a frequently-changing collection of hosts. For this use case, Cased Shell includes a 'static' provider which allows statically configured hosts, or supports the dynamic listing of hosts using API calls against another provider. Currently, Cased Shell's prompt auto-detection feature discovers prompts by running queries against the EC2 and ECS APIs (AWS). Please contact us if you’d like to use Cased Shell to detect prompts on another provider!
When using our supported Terraform-based ECS deployment, Cased Shell’s prompt auto-detection feature is enabled by providing a list of
jump_queries
to the Terraform module. Each query has three general parts: provider configuration
, filters
, and prompt metadata
:jump_queries = [
{
# Provider configuration
provider = "ec2" # ec2, ec2, or static
limit = 1 # optional, defaults to no limit
sortOrder = "desc" # optional, defaults to "asc"
sortBy = "startedAt" # optional, provider specific
# Filters
# See https://github.com/cased/jump#providers for a full list of filters for each provider.
filters = {
"tag:aws:autoscaling:groupName" = "*test*"
}
# Prompt metadata can be used to customize how this prompt is displayed,
# as well as influence how Cased Shell connects to this prompt.
prompt = {
name = "Newest test instance"
description = "The newest instance in the 'test' autoscaling group."
# Prompts can be "featured" above the fold by setting this value to true.
featured = true
# Labels can be used to filter and group related prompts together.
labels = {
environment = "test"
}
# If necessary, the SSH connection established when clicking on this prompt
# can be configured using the following fields:
# hostname = "example.com"
# ipAddress = "1.2.3.4"
# port = "2222"
# username = "root"
# If this prompt requires a key or username different from the default,
# you can set the following fields to prompt the user each time:
# promptForUsername = true
# promptForKey = true
# Additional commands can be run immedaitely after connecting to a
# prompt by setting the following fields:
# jumpCommand = "docker exec -it app-container"
# shellCommand = "./bin/rails console"