Creating Artifacts via CLI

Create reusable Infrastructure as Code artifacts in Bluebricks to standardize infrastructure and enable consistent deployments across environments.

Overview

This guide covers publishing artifacts using the bricks CLI. Use this approach when Bluebricks cannot access your repository directly, for example with private repos without the GitHub integration, or non-GitHub version control systems.

box-open-full

Supported IaC types

Bluebricks supports multiple IaC technologies:

  • Terraform

  • OpenTofu

  • Helm

  • CloudFormation

  • Bicep

  • Generic (container-based execution)

circle-info

Don't have code that defines your resources yet? Let the Cloud Import Agent codify them for you.

How to publish artifacts via CLI

An artifact is automatically generated through a single CLI command from the code's directory.

Prerequisites

1

For example:

circle-info

Your code must be self-contained and executable with its native tool, such as terraform init/plan/apply or helm install. For Terraform or OpenTofu, this means the root module you would normally navigate into and run directly.

2

Publish with the CLI

Publish it from the artifact directory:

This command generates a slim metadata file (bricks.json) and publishes it into the Bluebricks catalog.

3

View your artifacts

Go to the Artifacts pagearrow-up-right in Bluebricks to see your new artifact.

How to update your artifacts with CLI

Following any change to the underlying IaC you should update your artifact and re-publish it.

1
2

Change the artifacts version

Run the following command to update the semantic version

You can also manually open the bricks.json file of the artifact, change the version and save it.

3

Publish the new version

Publish the new version using

Artifact example

Every artifact is defined by a bricks.json file at its root.

This file describes:

  • The artifact name

  • Semantic version

  • Inputs (props)

  • Outputs (outs)

  • The native IaC implementation (native)

Example:

A standard artifact repository:

Publishing options

The bricks bprint publish command accepts publish-specific flags:

Flag
Description

--src <path>

Publish from a specific directory instead of the current working directory

--state

Include a .tfstate file in the published artifact for migration purposes

--resolve-modules

Resolve and include external Terraform module references (default: true)

Examples:

circle-info

Global CLI flags such as --api-key and --non-interactive are also available on this command. See the CLI Reference for the full list, and CLI Authentication for details on API key usage.

Publishing flow

When you run bricks bprint publish, the CLI performs these steps:

1

Validation

The CLI validates your bricks.json configuration and checks that all required fields are present.

2

Source preparation

The artifact source code is packaged into a zip archive. External Terraform module references are resolved unless --resolve-modules=false is set.

3

Upload

The packaged artifact and bricks.json are uploaded to the Bluebricks platform as a single multipart request.

4

Registration

The artifact is registered in your organization's catalog with the version specified in bricks.json.

5

Confirmation

The CLI returns a success confirmation with the published artifact details.

Authentication for CI/CD

For automated pipelines, authenticate with an API key instead of interactive login:

For full details on API key creation and authentication methods, see CLI Authentication.

circle-info

For GitHub Actions workflows, use the Bricks Action instead of running CLI commands directly.

Last updated

Was this helpful?