Writing Your First Table
- Overview
- Prerequisites
- Clone the Repository
- Build and Run Locally
- Make Your First Change
- Create a New 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
- Clone the Steampipe Plugin AWS repository:
Build and Run Locally
- 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.
- Run make to build the plugin locally and install the new version to your ~/.steampipe/plugins directory:
- Launch the Steampipe query shell:
- Test basic functionality:
Make Your First Change
- Edit the aws/table_aws_s3_bucket.go table file.
- Locate the definition for the name column:
- Copy the code above and create a duplicate column name_test:
- Save your changes in aws/table_aws_s3_bucket.go.
- Run make to re-build the plugin:
- Launch the Steampipe query shell:
- Test your changes by inspecting and querying the new column:
- The name and name_test columns should have the same data in them for each bucket.
- Undo your changes in aws/table_aws_s3_bucket.go once done testing:
Create a New Table
- Create a new file in aws/, copying an existing table and following the table naming standards in Steampipe Table & Column Standards:
- 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.
- 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.
- Update the code in your new table so the table returns the correct information for its AWS resource.
- Add a document for the table in docs/tables/ following the Table Documentation Standards.