turbot / flowpipe

Flowpipe is a cloud scripting engine. Automation and workflow to connect your clouds to the people, systems and data that matters.
https://flowpipe.io
GNU Affero General Public License v3.0
357 stars 13 forks source link

[hcl] Add support for `flowpipe` (version) and `tags` argument in mod.sp #374

Closed vkumbha closed 9 months ago

vkumbha commented 9 months ago
  1. Add minimum required version of flowpipe cli in mod.sp

As per the documentation, we should be able to define the minimum cli version in mod.fp as follows

require {
  flowpipe = "0.10.0"
}

Here is my mod,

mod "local" {
  title = "clitest"

  require {
    flowpipe  = "0.0.1"
  }
}

Here is the error that I get

Error: mod load failed:
Unsupported argument: An argument named "flowpipe" is not expected here.
(/tmp/clitest/mod.fp:5,5-13)
  1. Add support for tags argument to mod.sp As per documentation, the tags argument is supported but it does not work as of now.
Name Type Required? Description
categories List(String) Optional A list of labels, used to categorize mods (such as on the Flowpipe Hub).
color String Optional A hexadecimal RGB value to use as the color scheme for the mod on hub.flowpipe.io.
description String Optional A string containing a short description.
documentation String (Markdown) Optional A markdown string containing a long form description, used as documentation for the mod on hub.flowpipe.io.
icon String Optional The url of an icon to use for the mod on hub.flowpipe.io.
opengraph Block Optional Block of metadata for use in social media applications that support Opengraph metadata.
require Block Optional A block that specifies one or more mod dependencies.
tags Map Optional A map of key:value metadata for the mod, used to categorize, search, and filter.
title String Optional The display title of the mod.

Here is my mod,

mod "local" {
  title = "clitest"

   tags  {
    foo = bar
  }
}

Below is the error

$ flowpipe pipeline list
Error: mod load failed:
Unsupported block type: Blocks of type 'tags' are not expected here.
(/tmp/clitest/mod.fp:4,4-8)
vhadianto commented 9 months ago

The spec for Flowpipe mod version is different than Steampipe. Checking with @johnsmyth

vhadianto commented 9 months ago

@vkumbha tags are not block, it is an argument that has a type of map.

You need to define it as follow:

  tags = {
    foo = "bar"
    bar = "baz"
  }
vkumbha commented 9 months ago

@vhadianto my bad. Can confirm that map works. Thanks for the correction!

vkumbha commented 9 months ago

Fixed in aff9791