Skip to main content
Tensor9 is designed to integrate with your preferred automation tools (Atlantis, Spacelift, etc.) for deployment.

1. Deployment configuration:

  • Tensor9 preserves any backend configuration you include in your origin stack. You are responsible for managing Terraform state according to your deployment requirements.
  • You should use the instance_id variable in your backend configuration to ensure each appliance has a unique state file location. Your deployment tool uses this ID to maintain a consistent state file location across deployment runs.

2. Execution (example: Atlantis):

  • Your CI/CD tool (e.g., Atlantis) fetches the Compiled Stack from Tensor9.
  • It executes the standard Terraform commands:
    • tofu init
    • tofu plan (for review)
    • tofu apply (upon approval)
  • Best Practice: Maintain a separate Git repository for the compiled stacks to keep your source code history clean.

Integration with Atlantis

Atlantis is an open-source tool that automates Terraform via pull requests (PRs).
Workflow StepAction with Tensor9
1. Create PRA vendor (or an automated script) makes a change in the Origin Stack repository and runs the Tensor9 stack build step. This generates a new version of the compiled stacks.
2. Push Compiled StacksPush the new compiled stack files to the separate repository and open a new Pull Request (PR).
3. Automated PlanAtlantis detects the PR in the compiled stacks Repository and automatically runs tofu plan. The output is posted as a comment on the PR.
4. Configure Workspace IDThe Origin Stack should contain the configuration for Atlantis. The vendor must pass a consistent Appliance ID as a workspace ID environment variable to Atlantis. This ensures that the Terraform state is managed correctly for each customer appliance.
5. ApplyOnce the plan is reviewed and approved, a user comments atlantis apply on the PR.
6. Update/RollbackUpdate is the same as a new deploy. For a Rollback, you must check out the desired old version of the Origin Stack, re-compile it with Tensor9, and then open a new PR.

Integration with Spacelift

Spacelift is a complete CI/CD platform for Infrastructure as Code, using Stacks for deployment.
Workflow StepAction with Tensor9
1. Connect RepositoryCreate a Spacelift Stack connected to your compiled stacks repository.
2. Trigger RunSimilar to Atlantis, pushing a new version of the compiled stacks to the repository branch, or opening a PR, triggers a run in Spacelift.
3. Plan & ApplySpacelift executes the tofu plan and tofu apply workflow. Spacelift’s Stacks combine the configuration (compiled code), variables, and state data for each customer appliance.
4. CustomizationSpacelift allows for extensive customization of the workflow, which can be used to set up environment variables for the required Appliance ID (analogous to the workspace ID in Atlantis).
Note: Regardless of the tool, you are responsible for managing backend configuration. You can include backend configuration in your origin stack (which Tensor9 preserves), or provide it through your automation tool’s configuration. Ensure your backend configuration uses the instance_id variable to maintain unique state files for each appliance. See Backend Configuration for details.

Updating applications

To update an appliance, create a new build (compile) using the latest source code and then trigger a new deployment run via your CI/CD tool. Here is an example update scenario: A vendor is using Tensor to deploy a VM into customer environment. They realize the instance type is too small; they need more memory and CPU. Using Tensor9, they can change to an instance type with more memory and CPU. They simplify run tofu apply with the new instance type, resulting in an update wherein the instance type changes, e.g., from t2.micro to t5g.large. Rollback: To roll back, you must check out the desired previous version of your Origin Stack code, create a new compiled stack from that old code, and then deploy the resulting compiled stack.