image

Powerpipe is now the recommended way to run dashboards and benchmarks! Mods still work as normal in Steampipe for now, but they are deprecated and will be removed in a future release:

Display images in a dashboard, either from a known publicly-accessible src URL, or from a src returned in a SQL query.

Image blocks can be declared as named resources at the top level of a mod, or be declared as anonymous blocks inside a dashboard or container, or be re-used inside a dashboard or container by using an image with base = <mod>.image.<image_resource_name>.

Example Usage

image {
src = "https://steampipe.io/images/steampipe_logo_wordmark_color.svg"
alt = "Steampipe Logo"
width = 2
}

Argument Reference

ArgumentTypeOptional?Description
altStringOptionalAlternative text for the image.
argsMapOptionalA map of arguments to pass to the query.
baseText ReferenceOptionalA reference to a named text resource that this text should source its definition from. title and width can be overridden after sourcing via base.
paramBlockOptionalA param block that defines the parameters that can be passed in to the query. param blocks may only be specified for images that specify the sql argument.
queryQuery ReferenceOptionalA reference to a query resource that defines the query to run. An image may either specify the query argument or the sql argument, but not both.
sqlStringOptionalAn SQL string to provide data for the image. An image may either specify the query argument or the sql argument, but not both.
srcStringOptionalPublicly-accessible URL for the image.
titleStringOptionalA plain text title to display for this image.
widthNumberOptionalThe width as a number of grid units that this item should consume from its parent.

Data Structure

If an image provides a sql query, it supports 2 data structures.

  1. A simple structure where column 1's name is the alt and column 1's value is the image src.
  2. A formal data structure where the column names map to properties of the image.

Simple data structure:

<alt>
<src>

Formal data structure:

More Examples

Via query

image {
sql = <<-EOQ
select
avatar_url as "Avatar"
from
github_user
where
login = 'torvalds'
EOQ
width = 2
}

Dynamic Styling via formal query data structure

image {
sql = <<-EOQ
select
avatar_url as src,
'Avatar' as alt
from
github_user
where
login = 'ken'
EOQ
width = 2
}