Steampipe : Powerful SQL Queries for Cloud

Steampipe is a powerful SQL query engine that is perfect at pulling data from your cloud platform. If it has an API, it can be queried by Steampipe.

Install Steampipe: macOS with Brew

We recommend installing Homebrew which provides pre-built binaries for Mac.

STEP 1: Tap Turbot’s Cask

~$ brew tap turbot/tap

STEP 2: Install Steampipe

~$ brew install steampipe

STEP 3: Version Check

~$ steampipe -v steampipe version 0.10.0

STEP 4: Install the AWS plugin

~$ steampipe plugin install aws

Installed plugin: AWS

STEP 5: Configure your profile and SSO access

Important – You will need to re-configure after for SSO token expires – usually 24hrs

From the terminal type:

aws configure sso

SSO start URL [None]: https://<your-url>.awsapps.com/start#/

SSO Region [None]: eu-west-1

This will open your browser, click Allow Access

STEP 6: Select the account you want to use

There are 9 AWS accounts available to you.

< YOUR AWS ACCOUNT DETAILS>

STEP 7: Select the permissions you want>

AdminUser

PowerUser

ReadOnly

STEP 8: Give your profile a name – make it simple

CLI default client Region [eu-west-1]:

CLI default output format [text]:

CLI profile name [AdminUser-xxxxxx]: richard

STEP 9: Edit the steampipes config file

nano ~/.steampipe/config/aws.spc

It should look similar to this:

connection "aws" { plugin = "aws" regions = ["eu-west-1"] profile = "richard"

STEP 10: Start Steampipe

steampipe query

Explore

Steampipe provides commands that allow you to discover and explore the tables and data without leaving the query shell. (Of course this information is all available in the hub if online docs are more your speed…)

Let’s fire up Steampipe! Run 

steampipe query 

to open an interactive query session:

$ steampipe query

Welcome to Steampipe v0.5.0

For more information, type .help>

Now run the .tables meta-command to list the available tables:

As you can see, there are quite a few tables available in the aws plugin!

It looks like there’s an aws_iam_role table – let’s run .inspect to see what’s in that table:

.inspect aws_iam_role

History

The query shell supports command history, allowing you to retrieve, run, and edit previous commands. The command history works like typical unix shell command history, and persists across query sessions. When on a new line, you can cycle back through the history with the Up Arrow or Ctrl+p and forward with Down Arrow or Ctrl+n.

Key bindings

The query shell supports standard emacs-style key bindings:

KeysDescription
KeysDescription
Ctrl+aMove the cursor to the beginning of the line
Ctrl+eMove the cursor to the end of the line
Ctrl+fMove the cursor forward 1 character
Ctrl+bMove the cursor backward 1 character
Ctrl+wDelete a word backwards
Ctrl-dDelete a character forwards. On a blank line, Ctrl-d will exit the console
BackspaceDelete a character backwards
Ctrl+pUp ArrowGo to the previous command in your history
Ctrl+nDown ArrowGo to the next command in your history

How do you update Steampipe?

UPDATE STEP 1: Update Homebrew

~$ brew update

UPDATE STEP 2: Update Steampipe

~$ brew upgrade steampipe

Elsewhere On TurboGeek:  How to Install Jira from Atlassian on Ubuntu

Richard.Bailey

Richard Bailey, a seasoned tech enthusiast, combines a passion for innovation with a knack for simplifying complex concepts. With over a decade in the industry, he's pioneered transformative solutions, blending creativity with technical prowess. An avid writer, Richard's articles resonate with readers, offering insightful perspectives that bridge the gap between technology and everyday life. His commitment to excellence and tireless pursuit of knowledge continues to inspire and shape the tech landscape.

You may also like...

2 Responses

  1. 29/08/2022

    […] Need to know how to install Steampipe – see my blog post here. […]

  2. 29/09/2023

    […] Here is a super quick guide on how to upgrade steampipe. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate ยป