### Automated Installer Script Interaction Source: https://steampipe.io/docs/steampipe_postgres/install Example output of the automated installer script, showing prompts for plugin name, version, environment detection, and confirmation before installation. ```bash $ /bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" Enter the plugin name: aws Enter the version (latest): Discovered: - PostgreSQL version: 15 - PostgreSQL location: /Applications/Postgres.app/Contents/Versions/15 - Operating system: Darwin - System architecture: arm64 Based on the above, steampipe_postgres_aws.pg15.darwin_arm64.tar.gz will be downloaded, extracted and installed at: /Applications/Postgres.app/Contents/Versions/15 Proceed with installing Steampipe PostgreSQL FDW for version 15 at /Applications/Postgres.app/Contents/Versions/15? - Press 'y' to continue with the current version. - Press 'n' to customize your PostgreSQL installation directory and select a different version. (Y/n): Downloading https://api.github.com/repos/turbot/steampipe-plugin-aws/releases/latest/releases/assets/139269139... ###################################################################################################################################################################### 100.0% x steampipe_postgres_aws.pg15.darwin_arm64/ x steampipe_postgres_aws.pg15.darwin_arm64/steampipe_postgres_aws.so x steampipe_postgres_aws.pg15.darwin_arm64/create_extension_aws.sql x steampipe_postgres_aws.pg15.darwin_arm64/install.sh x steampipe_postgres_aws.pg15.darwin_arm64/steampipe_postgres_aws--1.0.sql x steampipe_postgres_aws.pg15.darwin_arm64/steampipe_postgres_aws.control Download and extraction completed. Installing steampipe_postgres_aws in /Applications/Postgres.app/Contents/Versions/15... Successfully installed steampipe_postgres_aws extension! Files have been copied to: - Library directory: /Applications/Postgres.app/Contents/Versions/15/lib/postgresql - Extension directory: /Applications/Postgres.app/Contents/Versions/15/share/postgresql/extension/ ``` -------------------------------- ### Install Steampipe and Query Resources Source: https://steampipe.io/docs/integrations/github_actions/installing_steampipe This example demonstrates installing Steampipe, configuring a plugin, and then executing a Steampipe query directly within the GitHub Actions workflow to retrieve data. ```yaml - uses: turbot/steampipe-action-setup@v1 with: steampipe-version: 'latest' plugin-connections: | connection "hackernews" { plugin = "hackernews" } - name: Query HN run: steampipe query "select id, title from hackernews_item where type = 'story' and title is not null order by id desc limit 5" ``` -------------------------------- ### Example Steampipe SQLite Extension Installation Prompt Source: https://steampipe.io/docs/steampipe_sqlite/install This is an example of the interactive prompts the Steampipe SQLite installer will present. It shows user input for plugin name, version, and installation location. ```bash Enter the plugin name: githubEnter version (latest): Enter location (current directory): ``` -------------------------------- ### Example Steampipe Export CLI Installation Prompts Source: https://steampipe.io/docs/steampipe_export/install This is an example of the interactive prompts and output when installing a Steampipe Export CLI using the install script. ```shell Enter the plugin name: aws Enter the version (latest): Enter location (/usr/local/bin): Created temporary directory at /var/folders/t4/1lm46wt12sv7yq1gp1swn3jr0000gn/T/tmp.RpZLlzs2. Downloading steampipe_export_aws.darwin_arm64.tar.gz... ###################################################################################################################################################################### 100.0% Deflating downloaded archive x steampipe_export_aws Installing Applying necessary permissions Removing downloaded archive steampipe_export_aws was installed successfully to /usr/local/bin ``` -------------------------------- ### Switching to Workspace with Custom Install Directory Source: https://steampipe.io/docs/managing/workspaces Example of querying using a workspace that points to a different Steampipe installation directory. ```bash steampipe query --workspace steampipe_2 "select * from aws_account" ``` -------------------------------- ### Install Steampipe, Plugins, and Run Query in Gitpod Source: https://steampipe.io/docs/integrations/gitpod This snippet installs Steampipe and the RSS plugin, then executes a query to list items from an RSS feed. It also starts the Steampipe service and exposes port 9193. ```yaml tasks: - name: Install Steampipe with RSS Plugin init: | sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/turbot/steampipe/main/install.sh)" steampipe -v steampipe plugin install steampipe steampipe plugin install rss steampipe query "select title, published, link from rss_item where feed_link = 'https://www.hardcorehumanism.com/feed/' order by published desc;" command: | steampipe service status ports: # Steampipe/ PostgreSQL - port: 9193 ``` -------------------------------- ### AWS S3 Bucket Table Documentation Example Source: https://steampipe.io/docs/develop/table-docs-standards Example of a Markdown document for the aws_s3_bucket table, including a header, description, and various example queries. ```markdown # Table: aws_s3_bucket An Amazon S3 bucket is a public cloud storage resource available in Amazon Web Services' (AWS) Simple Storage Service (S3), an object storage offering. ## Examples ### Basic info ```sql select name, region, account_id, bucket_policy_is_public from aws_s3_bucket; ``` ### List buckets with versioning disabled ```sql select name, region, account_id, versioning_enabled from aws_s3_bucket where not versioning_enabled; ``` ### List buckets with default encryption disabled ```sql select name, server_side_encryption_configuration from aws_s3_bucket where server_side_encryption_configuration is null; ``` ``` -------------------------------- ### Execute Steampipe Query in GitLab Runner Source: https://steampipe.io/docs/integrations/gitlab_ci_cd Completes the Steampipe setup by copying the SQL query file, installing the plugin, and executing the query. This demonstrates a full workflow from setup to data retrieval. ```yaml install: stage: build script: - echo "Hello, $GITLAB_USER_LOGIN, let's install Steampipe!" - adduser --disabled-password --shell /bin/bash jon - cp hn.sql /home/jon - cd /home/jon - ls -l - /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/turbot/steampipe/main/install.sh)" - su jon -c "steampipe plugin install hackernews" - su jon -c "steampipe query hn.sql" ``` -------------------------------- ### Install Steampipe in GitHub Actions Source: https://steampipe.io/docs/integrations/github_actions/installing_steampipe This workflow installs the latest version of Steampipe. It checks out the code and then uses the turbot/steampipe-action-setup action to install Steampipe. ```yaml name: Run Steampipe on: push: jobs: steampipe: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: turbot/steampipe-action-setup@v1 ``` -------------------------------- ### Display Help for a Nested Sub-command Source: https://steampipe.io/docs/reference/cli/help You can display help for nested sub-commands by providing the full path to the sub-command. For example, to get help for 'plugin install'. ```bash steampipe help plugin install ``` -------------------------------- ### Snapshot Upload URL Example Source: https://steampipe.io/docs/query/snapshots This example shows the typical output when a snapshot is uploaded, including the URL to view it. ```bash Snapshot uploaded to https://pipes.turbot.com/user/costanza/workspace/vandelay/snapshot/snap_abcdefghij0123456789_asdfghjklqwertyuiopzxcvbn ``` -------------------------------- ### Example of Uninstalling Azure Plugin and Connection Cleanup Source: https://steampipe.io/docs/managing/plugins This example demonstrates uninstalling the 'turbot/azure' plugin and shows the output indicating which connections should be removed for cleanup. ```bash $ steampipe plugin uninstall azure Uninstalled plugin: * turbot/azure Please remove this connection to continue using steampipe: * /Users/cbruno/.steampipe/config/azure.spc 'dev' (line 1) 'staging' (line 6) 'prod' (line 11) ``` -------------------------------- ### List Installed Plugins Source: https://steampipe.io/docs/reference/cli/plugin Displays a list of all plugins currently installed on the system. ```bash steampipe plugin list ``` -------------------------------- ### Install a Specific Plugin Version Source: https://steampipe.io/docs/reference/cli/plugin Installs a particular version of a plugin. ```bash steampipe plugin install aws@0.107.0 ``` -------------------------------- ### Switching Between Workspaces Source: https://steampipe.io/docs/managing/workspaces Examples of how to query using different workspaces via the --workspace argument. ```bash steampipe query --workspace local "select * from aws_account" steampipe query --workspace acme_prod "select * from aws_account" ``` -------------------------------- ### Basic Info Example Query Source: https://steampipe.io/docs/develop/table-docs-standards A basic info query example for an AWS EC2 instance table, selecting commonly used columns. ```sql select instance_id, instance_type, region from aws_ec2_instance; ``` -------------------------------- ### List Installed Tables Source: https://steampipe.io/docs/query/query-shell In the query shell, type `.tables` and press Enter to list all installed and available tables for querying. Autocomplete can assist in typing commands. ```shell .tables ``` -------------------------------- ### Install Azure Plugin for Steampipe Source: https://steampipe.io/docs/integrations/azure_cloudshell Installs the Steampipe Azure plugin to enable querying Azure resources. This command should be run after Steampipe has been installed. ```bash ./steampipe plugin install azure ``` -------------------------------- ### Install Plugin from Another Registry Source: https://steampipe.io/docs/managing/plugins Installs a plugin from a specified OCI-compliant registry, including the project, repository, plugin name, and tag. ```bash $ steampipe plugin install us-docker.pkg.dev/myproject/myrepo/myplugin@mytag ``` -------------------------------- ### Install Steampipe Export CLI Script Source: https://steampipe.io/docs/steampipe_export/install Use this command to download and execute the Steampipe Export CLI installation script. The script will prompt for plugin details and handle the installation. ```shell /bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" ``` -------------------------------- ### Install bash-completion with Homebrew Source: https://steampipe.io/docs/reference/cli/completion If bash-completion is not installed on macOS, use Homebrew to install it. This is a prerequisite for bash autocompletion on macOS. ```bash brew install bash-completion ``` -------------------------------- ### Install All Missing Plugins Source: https://steampipe.io/docs/managing/plugins Command to automatically install all plugins referenced in Steampipe configuration files. This command reads all .spc files and installs any missing plugins. ```bash $ steampipe plugin install ``` -------------------------------- ### Install Missing Plugins Without Default Config Source: https://steampipe.io/docs/reference/cli/plugin Installs all plugins specified in configuration files that are not currently installed, skipping the creation of their default configuration files. ```bash steampipe plugin install --skip-config ``` -------------------------------- ### Install Steampipe in Gitpod Source: https://steampipe.io/docs/integrations/gitpod This snippet installs Steampipe using a script and verifies the installation. It's used in the .gitpod.yml file to set up the development environment. ```yaml tasks: - name: Install Steampipe with RSS Plugin init: | sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/turbot/steampipe/main/install.sh)" steampipe -v ``` -------------------------------- ### Configure Get Function with KeyColumns Source: https://steampipe.io/docs/develop/writing_plugins/hydrate-functions Configuration snippet showing how to define a Get function for a table, specifying 'id' as the KeyColumn. This allows Steampipe to efficiently use the Get function when the 'id' is provided. ```go Get: &plugin.GetConfig{ KeyColumns: plugin.SingleColumn("id"), Hydrate: getGroup, }, ``` -------------------------------- ### Install Plugin with Semver Constraint Source: https://steampipe.io/docs/reference/cli/plugin Installs the latest version of a plugin that satisfies a given semantic versioning constraint. ```bash steampipe plugin install aws@^0.107 ``` -------------------------------- ### Install Steampipe Postgres FDW with Script Source: https://steampipe.io/docs/steampipe_postgres/install Use this command to run the automated installer script. The script will prompt for plugin name and version, detect your system configuration, and install the FDW. ```bash /bin/sh -c "$(curl -fsSL https://steampipe.io/install/postgres.sh)" ``` -------------------------------- ### Example SQL Query for Zendesk Groups Source: https://steampipe.io/docs/develop/writing_plugins/hydrate-functions This SQL query demonstrates how to select all data from the zendesk_group table. ```sql select * from zendesk_group ``` -------------------------------- ### Example Plugin Definition Source: https://steampipe.io/docs/develop/writing_plugins/the-basics Defines the Steampipe plugin for Zendesk, including its name, default transformations, and a map of available tables. ```go package zendesk import ( "context" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" ) func Plugin(ctx context.Context) *plugin.Plugin { p := &plugin.Plugin{ Name: "steampipe-plugin-zendesk", DefaultTransform: transform.FromGo().NullIfZero(), TableMap: map[string]*plugin.Table{ "zendesk_brand": tableZendeskBrand(), "zendesk_group": tableZendeskGroup(), "zendesk_organization": tableZendeskOrganization(), "zendesk_search": tableZendeskSearch(), "zendesk_ticket": tableZendeskTicket(), "zendesk_ticket_audit": tableZendeskTicketAudit(), "zendesk_trigger": tableZendeskTrigger(), "zendesk_user": tableZendeskUser(), }, } return p } ``` -------------------------------- ### Start Steampipe Query Session Source: https://steampipe.io/docs Run this command to open an interactive Steampipe query session. Ensure your AWS credentials are configured before starting. ```bash $ steampipe query Welcome to Steampipe v0.5.0 For more information, type .help > ``` -------------------------------- ### Start Steampipe Service Listening on Localhost Only Source: https://steampipe.io/docs/reference/cli/service Starts the Steampipe service, configuring it to only accept database connections from localhost. ```bash steampipe service start --database-listen local ``` -------------------------------- ### Install Steampipe SQLite Extensions with Script Source: https://steampipe.io/docs/steampipe_sqlite/install Use this command to download and run the Steampipe SQLite install script. The script will prompt for plugin details and handle OS/architecture detection. ```bash /bin/sh -c "$(curl -fsSL https://steampipe.io/install/sqlite.sh)" ``` -------------------------------- ### Install Steampipe and Hacker News Plugin in GitLab Runner Source: https://steampipe.io/docs/integrations/gitlab_ci_cd Installs Steampipe, creates a non-privileged user, and installs the Hacker News plugin. This prepares the environment for running Steampipe queries as a non-root user. ```yaml install: stage: build script: - echo "Hello, $GITLAB_USER_LOGIN, let's install Steampipe!" - adduser --disabled-password --shell /bin/bash jon - /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/turbot/steampipe/main/install.sh)" - su jon -c "steampipe plugin install hackernews" ``` -------------------------------- ### Install Steampipe CLI and AWS Plugin Source: https://steampipe.io/docs/integrations/github_actions/aws_oidc Installs the Steampipe CLI and configures the AWS plugin, preparing the environment for running queries against AWS resources. ```yaml - name: "Install Steampipe CLI and AWS plugin" id: steampipe-installation uses: turbot/steampipe-action-setup@v1 with: steampipe-version: 'latest' plugin-connections: | connection "aws" { plugin = "aws" } ``` -------------------------------- ### Install AWS Plugin for Steampipe Source: https://steampipe.io/docs/integrations/cloud9 Install the AWS plugin to enable querying of AWS resources. ```bash steampipe plugin install aws ``` -------------------------------- ### Plugin Configuration with Default Error Handling Source: https://steampipe.io/docs/develop/writing_plugins/hydrate-functions Example of a plugin definition setting default error ignore and retry configurations. ```go func Plugin(ctx context.Context) *plugin.Plugin { p := &plugin.Plugin{ Name: "steampipe-plugin-fastly", ConnectionConfigSchema: &plugin.ConnectionConfigSchema{ NewInstance: ConfigInstance, }, DefaultTransform: transform.FromGo().NullIfZero(), DefaultIgnoreConfig: &plugin.IgnoreConfig{ ShouldIgnoreErrorFunc: shouldIgnoreErrors([]string{"404"}), }, DefaultRetryConfig: &plugin.RetryConfig{ ShouldRetryErrorFunc: shouldRetryError([]string{"429"}), }, TableMap: map[string]*plugin.Table{ "fastly_acl": tableFastlyACL(ctx), ... "fastly_token": tableFastlyToken(ctx), }, } return p } ``` -------------------------------- ### Start Steampipe Service with Custom Password Source: https://steampipe.io/docs/reference/cli/service Starts the Steampipe service and sets a custom password for the database connection. ```bash steampipe service start --database-password MyCustomPassword ``` -------------------------------- ### Launch Steampipe Query Shell Source: https://steampipe.io/docs/develop/writing-your-first-table Start the Steampipe query shell to interact with your locally built plugin. ```bash steampipe query ``` -------------------------------- ### Prompt: Validate Column Data and Documentation Examples Source: https://steampipe.io/docs/develop/using-ai-for-plugin-development This prompt helps validate the Steampipe table implementation by querying data and executing documentation examples. It suggests using the MCP server or `steampipe` CLI for testing and sharing results in Markdown format. ```markdown Your goal is to thoroughly test your table implementation by validating column data and executing documentation examples. Use the Steampipe MCP server for running test queries if available, otherwise use the `steampipe` CLI commands directly. 1. Execute `select * from ` to validate that all columns return expected data based on the actual resource properties and have correct data types. 2. Test each example query from the table documentation to verify the SQL syntax is correct, queries execute without errors, and results match the example descriptions. 3. Share all test results in raw Markdown format to make them easy to export and review. ``` -------------------------------- ### Install Latest AWS Plugin Source: https://steampipe.io/docs/managing/plugins Installs the latest version of the AWS plugin from the Steampipe Hub. This also sets up a default connection named 'aws'. ```bash $ steampipe plugin install aws ``` -------------------------------- ### Plugin Front Matter Example Source: https://steampipe.io/docs/develop/plugin-release-checklist The index document for a plugin must contain a front matter block with essential metadata. ```yaml --- organization: Turbot category: ["security"] icon_url: "/images/plugins/turbot/duo.svg" brand_color: "#6BBF4E" display_name: Duo Security name: duo description: Steampipe plugin for querying Duo Security users, logs and more. og_description: Query Duo Security with SQL! Open source CLI. No DB required. og_image: "/images/plugins/turbot/duo-social-graphic.png" --- ``` -------------------------------- ### Example SQL Query Source: https://steampipe.io/docs/develop/writing_plugins/sql-to-api-call A sample SQL query demonstrating the use of the '>' operator. ```sql SELECT * FROM aws_ec2_instance_types WHERE instance_type > 't3.medium'; ``` -------------------------------- ### List Installed Steampipe Connections Source: https://steampipe.io/docs/query/query-shell Use the `.connections` command to view all currently installed Steampipe connections and their associated plugins. This helps in understanding the available data sources. ```shell > .connections +------------+--------------------------------------------------+ | Connection | Plugin | +------------+--------------------------------------------------+ | aws | hub.steampipe.io/plugins/turbot/aws@latest | | github | hub.steampipe.io/plugins/turbot/github@latest | | steampipe | hub.steampipe.io/plugins/turbot/steampipe@latest | +------------+--------------------------------------------------+ ``` -------------------------------- ### Query Using Get Function Source: https://steampipe.io/docs/develop/writing_plugins/hydrate-functions Example of a query that utilizes the Get function, identified by 'getGroup' in the diagnostic output. This query specifies an 'id' to retrieve a specific record. ```sql > select jsonb_pretty(_ctx) as _ctx from zendesk_group where id = '24885656597005' +--------------------------------------------------+ | _ctx | +--------------------------------------------------+ | { | "steampipe": { | "sdk_version": "5.8.0" | }, | "diagnostics": { | "calls": [ | { | "type": "list", | "scope_values": { | "table": "zendesk_group", | "connection": "zendesk", | "function_name": "getGroup" | }, | "function_name": "getGroup", | "rate_limiters": [ | ], | "rate_limiter_delay_ms": 0 | } | ] | }, | "connection_name": "zendesk" | } +--------------------------------------------------+ ``` -------------------------------- ### Query with JOIN Source: https://steampipe.io/docs/reference/cli/query Combine data from multiple tables using a JOIN clause. This example joins instances with their VPCs. ```bash steampipe query "select i.name, i.instance_id, v.cidr_block from aws_instance as i join aws_vpc as v on i.vpc_id = v.vpc_id where i.state = 'running';" ``` -------------------------------- ### Install Steampipe in GitLab Runner Source: https://steampipe.io/docs/integrations/gitlab_ci_cd Installs Steampipe into the GitLab Runner's environment using a shell script. This is the initial setup step for using Steampipe in CI/CD. ```yaml install: stage: build script: - echo "Hello, $GITLAB_USER_LOGIN, let's install Steampipe!" - /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/turbot/steampipe/main/install.sh)" ``` -------------------------------- ### Running Controls and Benchmarks with Snapshot Source: https://steampipe.io/docs/snapshots/batch-snapshots Demonstrates running controls and benchmarks with the --snapshot flag, including filtering benchmarks by severity. ```bash powerpipe control run aws_compliance.control.cis_v140_1_1 --snapshot powerpipe benchmark run aws_compliance.benchmark.cis_v140_ --snapshot --where "severity in ('critical', 'high')" all ``` -------------------------------- ### Implement a Get Function in Go Source: https://steampipe.io/docs/develop/writing_plugins/hydrate-functions This Go function demonstrates how to implement a Get function to fetch a single group by its ID from a service. It includes error handling for connection and retrieval operations. ```go func getGroup(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { conn, err := connect(ctx, d) if err != nil { return nil, err } quals := d.EqualsQuals id := quals["id"].GetInt64Value() result, err := conn.GetGroup(ctx, id) if err != nil { return nil, err } return result, nil } ``` -------------------------------- ### Plugin Entry Point (main.go) Source: https://steampipe.io/docs/develop/writing-plugins The main function serves as the entry point for your plugin. It must call plugin.Serve to instantiate the gRPC server, passing the plugin function defined in plugin.go. ```go package main import ( "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-zendesk/zendesk" ) func main() { plugin.Serve(&plugin.ServeOpts{PluginFunc: zendesk.Plugin}) } ``` -------------------------------- ### Basic Table Definition Structure Source: https://steampipe.io/docs/develop/writing-plugins An example of a basic table definition in Go for a Steampipe plugin, including necessary imports. ```go package zendesk import ( "context" "github.com/nukosuke/go-zendesk/zendesk" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" ) func tableZendeskUser() *plugin.Table { return &plugin.Table{ Name: "zendesk_user", ``` -------------------------------- ### Prompt: Create Steampipe Table and Documentation Source: https://steampipe.io/docs/develop/using-ai-for-plugin-development Use this prompt to guide AI in creating a new Steampipe table and its associated documentation. It emphasizes reviewing existing patterns, understanding SDKs, implementing functions, registering the table, and documenting it correctly. ```markdown Your goal is to create a new Steampipe table and documentation for . 1. Review existing tables and their documentation in the plugin to understand the established patterns, naming conventions, and column structures. 2. Use `go doc` commands to understand the SDK's API structure for the resource type. 3. Create the table implementation with appropriate List/Get functions and any additional hydrate functions needed for extra API calls. Avoid hydrate functions that require paging as these belong in separate tables. 4. Register the new table in plugin.go in alphabetical order. 5. Create documentation at `docs/tables/.md`. - For Postgres queries, use `->` and `->>` operators with spaces before and after instead of `json_extract` functions. - Include resource identifiers in non-aggregate queries. ``` -------------------------------- ### Initialize Steampipe Plugin Server Source: https://steampipe.io/docs/develop/writing_plugins/the-basics The `main` function is the entry point for your plugin. It must call `plugin.Serve` to instantiate the plugin's gRPC server, passing the plugin function defined elsewhere. ```go package main import ( "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-zendesk/zendesk" ) func main() { plugin.Serve(&plugin.ServeOpts{PluginFunc: zendesk.Plugin}) } ``` -------------------------------- ### Public Function Comment Example Source: https://steampipe.io/docs/develop/coding-standards Document all public functions, structs, and other exported entities with a comment that starts with a one-sentence summary. ```go // Install installs a plugin in the local file system func Install(image string) (string, error) { ... } ``` -------------------------------- ### Get Compliance Insights with Natural Language Source: https://steampipe.io/docs/query/mcp Example prompt to find EC2 instances that do not adhere to tagging standards. This helps in obtaining compliance insights. ```text Show me all EC2 instances that don't comply with our tagging standards ``` -------------------------------- ### Run Query and Share Snapshot Source: https://steampipe.io/docs/reference/cli/query Execute a query and create a snapshot in Turbot Pipes with 'anyone_with_link' visibility. ```bash steampipe query --share "select * from aws_s3_bucket" ``` -------------------------------- ### Configure Local Steampipe MCP Server Source: https://steampipe.io/docs/query/mcp Add this configuration to your AI assistant's config file to connect to a local Steampipe installation. Ensure 'steampipe service start' is running. ```json { "mcpServers": { "steampipe": { "command": "npx", "args": [ "-y", "@turbot/steampipe-mcp" ] } } } ``` -------------------------------- ### Display General Help Source: https://steampipe.io/docs/reference/cli/help Use this command to show general help and usage information for the Steampipe CLI application. ```bash steampipe help ``` -------------------------------- ### Execute a Simple Query Source: https://steampipe.io/docs/reference/cli/query Run a basic SQL query to retrieve all instances from the AWS provider. ```bash steampipe query "select name, instance_id, state from aws_instance;" ``` -------------------------------- ### Install Steampipe Plugin in Jenkins Pipeline Source: https://steampipe.io/docs/integrations/jenkins This Jenkinsfile stage installs Steampipe and then installs the Hacker News plugin. The plugin is required to query Hacker News data. ```groovy pipeline { agent any stages { stage("Install") { steps { sh "curl -s -L https://github.com/turbot/steampipe/releases/latest/download/steampipe_linux_amd64.tar.gz | tar -xzf -" echo "installed steampipe" sh './steampipe plugin install hackernews' } } } } ``` -------------------------------- ### Initialize and Apply Terraform Configuration Source: https://steampipe.io/docs/integrations/github_actions/aws_oidc Initialize Terraform to download providers and then apply the configuration using a variables file. Ensure you have local AWS credentials configured. ```bash terraform init ``` ```bash terraform apply -var-file=default.tfvars ``` -------------------------------- ### Install Steampipe and RSS Plugin in Gitpod Source: https://steampipe.io/docs/integrations/gitpod This configuration installs Steampipe, verifies its version, and then installs the Steampipe and RSS plugins. It also exposes port 9193 for Steampipe/PostgreSQL. ```yaml tasks: - name: Install Steampipe with RSS Plugin init: | sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/turbot/steampipe/main/install.sh)" steampipe -v steampipe plugin install steampipe steampipe plugin install rss ports: # Steampipe/ PostgreSQL - port: 9193 ``` -------------------------------- ### Install GCP Plugin in Google Cloud Shell Source: https://steampipe.io/docs/integrations/gcp_cloudshell After installing Steampipe, use this command to install the GCP plugin, which allows Steampipe to interact with your Google Cloud resources. ```bash ./steampipe plugin install gcp ``` -------------------------------- ### SQLite Initialization Script for Steampipe Extensions Source: https://steampipe.io/docs/steampipe_sqlite/configure A sample .sqliterc file demonstrating how to load and configure both GitHub and AWS Steampipe extensions upon SQLite startup. This script includes commands to enable headers and set output to table format. ```sql -- Turn on column headers .headers ON -- Set output to table .mod table -- Load and Configure Github extension .load ./steampipe_sqlite_extension_github.so select steampipe_configure_github('token="ghp_Bt2iThisIsAFakeToken1234567"'); -- Load and Configure AWS extension .load ./steampipe_sqlite_extension_aws.so select steampipe_configure_aws( access_key="AKIA4YFAKEKEYT99999" secret_key="A32As+zuuBFThisIsAFakeSecretNb77HSLmcB" '); ``` -------------------------------- ### Prompt: Build and Verify Steampipe Plugin Source: https://steampipe.io/docs/develop/using-ai-for-plugin-development This prompt assists in building the Steampipe plugin and verifying the registration and functionality of a new table. It includes steps for building, checking service status, and testing table availability via MCP server or direct queries. ```markdown Your goal is to build the plugin using the exact commands below and verify that your new table is properly registered and functional. 1. Build the plugin using `make dev` if available, otherwise use `make`. 2. Check the Steampipe service status with `steampipe service status`. Start it with `steampipe service start` if not running, or restart it with `steampipe service restart` if already running. 3. Test if the Steampipe MCP server is available by running the `steampipe_table_list` tool. 4. If the MCP server is available, use it to verify the table exists in the schema and can be queried successfully. 5. If the MCP server is not available, verify table registration manually with `steampipe query "select column_name, data_type from information_schema.columns where table_schema = '' and table_name = '' order by ordinal_position"`, then test basic querying with `steampipe query "select * from "`. ``` -------------------------------- ### Manual Installation of Steampipe Postgres FDW Source: https://steampipe.io/docs/steampipe_postgres/install Manually install Steampipe Postgres FDW files by copying them to the appropriate PostgreSQL directories using pg_config to determine paths. This method is an alternative to the automated installer. ```bash export LIBDIR=$(pg_config --pkglibdir) export EXTDIR=$(pg_config --sharedir)/extension/ sudo cp steampipe*.so $LIBDIR sudo cp steampipe*.sql $EXTDIR sudo cp steampipe*.control $EXTDIR ``` -------------------------------- ### Prepend a Single Connection to the Search Path Source: https://steampipe.io/docs/reference/dot-commands/search_path_prefix Use this command to place a specific connection at the beginning of the search path. This is useful for prioritizing a particular connection. ```bash .search_path_prefix aws_123456789012 ``` -------------------------------- ### Install Hacker News Plugin in CircleCI Source: https://steampipe.io/docs/integrations/circleci This snippet extends the CircleCI configuration to install the Hacker News plugin after Steampipe is installed. This allows you to query Hacker News data within your CI jobs. ```yaml version: 2.1 jobs: install: machine: true steps: - checkout - run: echo "Hello, let's install Steampipe!" - run: sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/turbot/steampipe/main/install.sh)" - run: 'steampipe plugin install hackernews' workflows: my-workflow: jobs: - install ``` -------------------------------- ### Joining Users with Organizations using Key Columns Source: https://steampipe.io/docs/guides/key-columns Demonstrates joining user data with organization data by matching the user's login with a member login from the organization's members list. This uses the 'login' key column for efficient matching. ```sql select u.login, o.login as organization, u.name, u.company, u.location from github_user as u, github_my_organization as o, jsonb_array_elements_text(o.member_logins) as member_login where u.login = member_login; ``` ```sql select u.login, o.login as organization, u.name, u.company, u.location from github_my_organization as o, jsonb_array_elements_text(o.member_logins) as member_login join github_user as u on u.login = member_login; ``` -------------------------------- ### Define GitHub Gitignore Table with Get Function Source: https://steampipe.io/docs/develop/writing-plugins Defines a Steampipe table for GitHub gitignore templates, including configurations for List and Get functions. The Get function is used to fetch specific template details. ```go func tableGitHubGitignore() *plugin.Table { return &plugin.Table{ Name: "github_gitignore", Description: "GitHub defined .gitignore templates that you can associate with your repository.", List: &plugin.ListConfig{ Hydrate: tableGitHubGitignoreList, }, Get: &plugin.GetConfig{ KeyColumns: plugin.SingleColumn("name"), ShouldIgnoreError: isNotFoundError([]string{"404"}), Hydrate: tableGitHubGitignoreGetData, }, Columns: []*plugin.Column{ // Top columns {Name: "name", Type: proto.ColumnType_STRING, Description: "Name of the gitignore template."}, {Name: "source", Type: proto.ColumnType_STRING, Hydrate: tableGitHubGitignoreGetData, Description: "Source code of the gitignore template."}, }, } } ``` -------------------------------- ### Interactive steampipe login and verification Source: https://steampipe.io/docs/reference/cli/login This example shows the interactive CLI process after initiating login. You will be prompted to verify the login in your browser and then enter a verification code into the CLI. ```bash $ steampipe login Verify login at https://pipes.turbot.com/login/token?r=tpttr_cdckfake6ap10t9dak0g_3u2k9hfake46g4o4wym7h8hw Enter verification code: 745278 Login successful for user johnsmyth ``` -------------------------------- ### Query Recent S3 Buckets with Natural Language Source: https://steampipe.io/docs/query/mcp Example prompt for finding S3 buckets created within the last week. This demonstrates asking specific questions about cloud resources. ```text Show me all S3 buckets that were created in the last week ``` -------------------------------- ### Install Steampipe in AWS Cloud9 Source: https://steampipe.io/docs/integrations/cloud9 Paste this command in your AWS Cloud9 terminal to install Steampipe. ```bash sudo /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/turbot/steampipe/main/scripts/install.sh)" ``` -------------------------------- ### Example Steampipe Plugin Repository Structure Source: https://steampipe.io/docs/develop/coding-standards Illustrates the standard directory and file layout for a Steampipe plugin repository, including source code, documentation, and configuration files. ```tree . ├── LICENSE ├── Makefile ├── README.md ├── aws │   ├── plugin.go │   ├── service.go │   ├── table_aws_acm_certificate.go │   ├── table_aws_api_gateway_api_authorizer.go │   ├── table_aws_api_gateway_api_key.go │ ... │   └── utils.go ├── config │   └── aws.spc ├── docs │   ├── index.md │   └── tables │   ├── aws_acm_certificate.md │   ├── aws_api_gateway_api_authorizer.md │   ├── aws_api_gateway_api_key.md │ ... ├── go.mod ├── go.sum └── main.go ``` -------------------------------- ### SQL Query Example Source: https://steampipe.io/docs/develop/writing-plugins An example SQL query demonstrating filtering issues with timestamp columns. ```sql SELECT * FROM github_issue WHERE updated_at > '2022-01-01' ``` -------------------------------- ### Start Steampipe Service in Background Source: https://steampipe.io/docs/reference/cli/service Starts the Steampipe service in the background, making it available as a database endpoint. ```bash steampipe service start ``` -------------------------------- ### Package Comment Example Source: https://steampipe.io/docs/develop/coding-standards Include a package comment in the plugin.go file to introduce the package and provide overall information. This comment appears first on the godoc page. ```go // Package aws implements Steampipe plugin for AWS resources. package aws // AWS is a Steampipe plugin that provides AWS resources. type aws struct { // connection is the Steampipe connection. connection *plugin.Connection } ``` -------------------------------- ### Update All Installed Plugins Source: https://steampipe.io/docs/reference/cli/plugin Updates all currently installed plugins to their latest available versions within their respective streams. ```bash steampipe plugin update --all ``` -------------------------------- ### Join GitHub User and Organization with JOIN Clause Source: https://steampipe.io/docs/sql/tips This alternative example shows joining github_user and github_my_organization tables using an explicit JOIN ON clause, filtering by user login. ```sql select u.login, o.login as organization, u.name, u.company, u.location from github_my_organization as o, jsonb_array_elements_text(o.member_logins) as member_login join github_user as u on u.login = member_login; ``` -------------------------------- ### HydrateConfig with Dependencies and Tags Source: https://steampipe.io/docs/develop/writing_plugins/hydrate-functions Setting up hydrate functions with dependencies on other functions and assigning rate-limiter tags. ```go HydrateConfig: []plugin.HydrateConfig{ { Func: getBucketLocation, Tags: map[string]string{"service": "s3", "action": "GetBucketLocation"}, }, { Func: getBucketIsPublic, Depends: []plugin.HydrateFunc{getBucketLocation}, Tags: map[string]string{"service": "s3", "action": "GetBucketPolicyStatus"}, }, { Func: getBucketVersioning, Depends: []plugin.HydrateFunc{getBucketLocation}, Tags: map[string]string{"service": "s3", "action": "GetBucketVersioning"}, }, ``` -------------------------------- ### Define Plugin Connection Source: https://steampipe.io/docs/managing/plugins Example of a connection configuration file specifying a local plugin. Ensure the plugin argument matches the relative path to your plugin. ```hcl connection "myplugin" { plugin = "local/myplugin" } ``` -------------------------------- ### Basic steampipe login Source: https://steampipe.io/docs/reference/cli/login Run this command to initiate the login process. It will open your web browser to complete the authentication. ```bash steampipe login ``` -------------------------------- ### Query Azure Subscriptions Source: https://steampipe.io/docs/integrations/azure_cloudshell Example SQL query to retrieve subscription details from the Azure plugin. This demonstrates querying the 'azure_subscription' table. ```sql select subscription_id, display_name, state, authorization_source, subscription_policies from azure_subscription; ``` -------------------------------- ### Start Steampipe Service on Custom Port Source: https://steampipe.io/docs/reference/cli/service Starts the Steampipe service and specifies a custom port for the database endpoint. ```bash steampipe service start --database-port 9194 ``` -------------------------------- ### Define Workspace with Custom Install Directory Source: https://steampipe.io/docs/managing/workspaces Defines a workspace that uses the data layer from a different Steampipe installation directory. ```hcl workspace "steampipe_2" { install_dir = "~/steampipe2" } ``` -------------------------------- ### Run Query and Save Snapshot Source: https://steampipe.io/docs/reference/cli/query Execute a query and save its results as a snapshot in Turbot Pipes with default visibility. ```bash steampipe query --snapshot "select * from aws_s3_bucket" ``` -------------------------------- ### Install Plugin with Quoted Semver Constraint Source: https://steampipe.io/docs/reference/cli/plugin Installs a plugin using a semver constraint that requires quoting due to special characters. ```bash steampipe plugin install "aws@>=0.100" ``` -------------------------------- ### List All Tables Across Steampipe Connections Source: https://steampipe.io/docs/query/query-shell Use the `.tables` command to display all available tables across all active Steampipe connections. The output is grouped by connection, showing the table name and a brief description. ```shell > .tables ==> aws +----------------------------------------+--------------------------------+ | Table | Description | +----------------------------------------+--------------------------------+ | aws_acm_certificate | AWS ACM Certificate | | aws_api_gateway_api_key | AWS API Gateway API Key | | aws_api_gateway_authorizer | AWS API Gateway Authorizer | ... +----------------------------------------+--------------------------------+ ==> github +---------------------+-------------+ | Table | Description | +---------------------+-------------+ | github_gist | | | github_license | | | github_organization | | | github_repository | | | github_team | | | github_user | | +---------------------+-------------+ ``` -------------------------------- ### Join GitHub User and Organization with WHERE Clause Source: https://steampipe.io/docs/sql/tips This example demonstrates joining github_user and github_my_organization tables, filtering by user login which is a member of the organization's logins. ```sql select u.login, o.login as organization, u.name, u.company, u.location from github_user as u, github_my_organization as o, jsonb_array_elements_text(o.member_logins) as member_login where u.login = member_login; ``` -------------------------------- ### Install Specific AWS Plugin Version Source: https://steampipe.io/docs/managing/plugins Installs a specific version of the AWS plugin (e.g., 0.118.0) from the Steampipe Hub using the '@' or ':' separator. ```bash $ steampipe plugin install aws@0.118.0 ``` -------------------------------- ### Steampipe Connection Configuration Example Source: https://steampipe.io/docs/steampipe_export/run Example of a Steampipe connection configuration block in an .spc file, defining a named connection for the AWS plugin. ```hcl connection "aws_prod" { plugin = "aws" profile = "dundermifflin" regions = ["us-east-1", "us-west-2"] } ``` -------------------------------- ### Display .autocomplete Usage Source: https://steampipe.io/docs/reference/dot-commands/autocomplete Shows the available options for the .autocomplete command. ```bash .autocomplete [on | off] ``` -------------------------------- ### Install AWS Plugin in AWS Cloud Shell Source: https://steampipe.io/docs/integrations/aws_cloudshell Install the AWS plugin for Steampipe using the Steampipe CLI within AWS Cloud Shell. ```bash ./steampipe plugin install aws ``` -------------------------------- ### Run Query and Output as CSV Source: https://steampipe.io/docs/reference/cli/query Execute a query and format the output as CSV. ```bash steampipe query "select * from aws_s3_bucket" --output csv ``` -------------------------------- ### Get Single User by ID Source: https://steampipe.io/docs/develop/writing-plugins Retrieves a specific user by their ID from the Zendesk API. Uses KeyColumnQuals to get the ID. Logs the ID for debugging. ```go func getUser(ctx context.Context, d *plugin.QueryData, h *plugin.HydrateData) (interface{}, error) { conn, err := connect(ctx) if err != nil { return nil, err } quals := d.KeyColumnQuals plugin.Logger(ctx).Warn("getUser", "quals",quals) id := quals["id"].GetInt64Value() plugin.Logger(ctx).Warn("getUser", "id", id) result, err := conn.GetUser(ctx, id) if err != nil { return nil, err } return result, nil } ``` -------------------------------- ### Install AWS Plugin with Tilde Constraint Source: https://steampipe.io/docs/managing/plugins Installs the latest AWS plugin version that is greater than or equal to 2.1.0 but less than 2.2.0, using a tilde constraint. ```bash $ steampipe plugin install aws@~2.1 ```