Writing Your First Table

Overview

The Steampipe Plugin SDK makes writing tables fast, easy, and fun! This guide will walk you through building the AWS plugin locally, testing a minor change, and then how to start creating a new table.

Prerequisites

Clone the Repository

  1. Clone the Steampipe Plugin AWS repository:

Build and Run Locally

  1. Copy the default config/aws.spc into ~/.steampipe/config. If not using the default AWS profile, please see AWS plugin for more information on connection configuration.
  1. Run make to build the plugin locally and install the new version to your ~/.steampipe/plugins directory:
  1. Launch the Steampipe query shell:
  1. Test basic functionality:

Make Your First Change

  1. Edit the aws/table_aws_s3_bucket.go table file.
  2. Locate the definition for the name column:
  1. Copy the code above and create a duplicate column name_test:
  1. Save your changes in aws/table_aws_s3_bucket.go.
  2. Run make to re-build the plugin:
  1. Launch the Steampipe query shell:
  1. Test your changes by inspecting and querying the new column:
  1. The name and name_test columns should have the same data in them for each bucket.
  2. Undo your changes in aws/table_aws_s3_bucket.go once done testing:

Create a New Table

  1. Create a new file in aws/, copying an existing table and following the table naming standards in Steampipe Table & Column Standards:
  1. Check if the AWS service has a service connection function in aws/service.go already; if not, add a new function in aws/service.go.
  2. Add an entry for the new table into the TableMap in aws/plugin.go. For more information on this file, please see Writing Plugins - plugin.go.
  3. Update the code in your new table so the table returns the correct information for its AWS resource.
  4. Add a document for the table in docs/tables/ following the Table Documentation Standards.

References