Skip to main content
ubx suggest reads existing .iac files for context, generates new blocks using Claude, and appends them to a target file after confirmation.
Requires UBX_AI_API_KEY or ai.api_key in ubx.yaml.

Usage

ubx suggest "<description>" [flags]

Examples

ubx suggest "add a PostgreSQL RDS instance with 20GB storage"
ubx suggest "add an S3 bucket for logs" --append main.iac
ubx suggest "add EKS cluster with 3 nodes" --dry-run
ubx suggest "add Redis ElastiCache" --yes

Flags

FlagDescription
--append stringFile to append generated blocks to (default: main.iac)
--dry-runShow generated blocks without writing to disk
--yesAppend blocks without confirmation prompt

Output

→ Generated an S3 bucket for logs with versioning enabled.
  Resources: aws_s3_bucket_v2, aws_s3_bucket_versioning, aws_s3_bucket_public_access_block

  ⚠  No lifecycle policies configured — consider adding expiration rules
  ⚠  No encryption specified — consider adding server-side encryption

--- a/main.iac
+++ b/main.iac
@@ -2,1 +2,15 @@

+# S3 bucket for storing logs
+unit "aws_s3_bucket_v2" "logs" {
+  bucket = "logs-${input.env}"
+}
+
+unit "aws_s3_bucket_versioning" "logs" {
+  bucket = ~unit.aws_s3_bucket_v2.logs.id
+  versioning_configuration { status = "Enabled" }
+}

Append to main.iac? [y/N]

Context Awareness

ubx suggest reads all existing .iac files before generating, so it can reference existing resources with ~unit.type.name.attr.