Skip to content

feat: buildingblock create command #67

Open

Description

@JohannesRudolph

Summary

Add a meshstack buildingblock create command to create a building block from the command line.

Proposed syntax (in spirit)

meshstack buildingblock create \
  --workspace hello-stackit \
  --definition 4248846b-739c-4e85-9e7f-dd16645281da --version v1 \
  --display-name "PostgreSQL Database" \
  --input db_name="orders" \
  --input size=small \
  --input high_availability=false \
  --secret admin_password="$ADMIN_PASSWORD" \
  --payment-method my-payment-method

Goals compared to the Terraform provider

  • No jsonencode noise. A user writes --input key=value. The CLI reads the input types from the definition version and converts each value.
  • Resolve the version by its friendly name, e.g. --version v1, instead of a version UUID.

Open questions

Input types. Building block inputs have the types STRING, CODE, INTEGER, BOOLEAN, FILE, LIST, SINGLE_SELECT and MULTI_SELECT. Each type likely needs its own syntax:

  • INTEGER, BOOLEAN: parse the string, fail early on a bad value.
  • SINGLE_SELECT, MULTI_SELECT: check against the allowed options; repeat the flag or separate by comma for multi?
  • LIST, CODE: raw JSON or HCL?
  • FILE, and large CODE values: read from a file, e.g. --input name=@path (curl style)?

Secret inputs. A secret on the command line ends up in shell history and in ps. Options:

  • Read from stdin, e.g. --secret name=-. This works for one secret only.
  • Read from a file, e.g. --secret name=@path, for several secrets.
  • Read from an environment variable, e.g. --secret-env name=ENV_VAR.

Waiting. Should create wait for the first run, like run wait, or return at once?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions