Skip to main content

Manage Template Revisions 🆕

StackGuardian templates are version-controlled blueprints used to define infrastructure, policies, or workflow automation. Templates can be reused across multiple workflows, and each revision serves as an immutable snapshot that ensures reliability and consistency during deployment.

This documentation provides guidance on how to effectively manage template revisions, allowing you to version, update, and govern Infrastructure as Code (IaC) resources with precision.

To view and manage templates: Navigate to Develop → Library → Select a Template.

Template Overview

Template Overview​

Each template page provides essential metadata and controls for managing the template effectively:

  • Template Name: The name assigned to the template, e.g., terraform-aws-key-pair. Can be changed after creation, but the TemplateID will remain the same.
  • Repository URL: A link to the source code repository (e.g., GitHub).
  • Template Type: The type of template, such as Terraform, Opentofu, Ansible, Helm, and more.
  • Owner Organization: The organization that owns the template. Most often, this will be your own organization, but templates can also be shared between organizations.
  • Template Status: Indicates whether the template is Activated or Deactivated. Only when Activated can the template be used to deploy infrastructure.

Template Overview

Template Options​

Access additional options for managing the template via the Template Options button at the top-right corner of the page.

  1. Activate/Deactivate the template to control its usage within your organization.
  2. Share Template with other StackGuardian organizations where you also hold admin access.
  3. Make Public/Private to control the template's visibility on the community marketplace. Note: To make a template public, its underlying repository must also be public.

Template Options Dropdown

Revisions Management​

Manage and switch between template revisions, selecting either published or draft versions for use in workflows.

Select Revision​

Choose from the available template versions:

  • Draft: The editable version, not yet published.
  • Published: Once published, the version cannot be edited anymore. Use this to lock in the settings.
  • Deprecated: New deployments cannot use this revision anymore, but there might be existing deployments that should be tracked.
info

To edit these tab options, ensure a draft template is selected. Editing is not available for a published template.

Select Revision Dropdown

The Use button allows to perform the following actions:

  1. Programmatically: Copies a full cURL snippet that can be used to create and run a workflow via StackGuardian APIs. This allows users to automate workflow creation using a specific template revision.
  2. Deploy with DevPortal: Redirects you to the DevPortal to configure a new workflow based on the selected template revision. This option simplifies the process of using the revision directly within the platform's UI.

Select Revision Dropdown

Manage Revisions​

Click Manage Revisions to view and operate on all revisions:

Use Menu​

  1. Deploy with DevPortal: Launches a new workflow using the Devportal.
  2. Programmatically: Reveals a code snippet for API-based execution.

Options Menu​

  • Publish: By publishing the revision it can not be changed anymore. Making the deployment behaviour predictable.
  • Deprecate: Retire outdated versions but still keeping track of usage.
  • Clone: Create a complete new template - starting with this revision
  • Delete: Permanently remove this revision
  • Create New Revision: Create a complete new template - starting with this revision

Revision Options

Template Tab Overview​

These provide a comprehensive set of tools for managing templates, customizing configurations, and ensuring efficient template usage across different workflows and environments.

Documentation​

Provides a section for writing detailed human-readable documentation, helping users understand the template's purpose and instructions.

Documentation Tab

Analysis​

Displays Terraform/Opentofu resources, modules and outputs of the connected repository code.

Analysis Tab

Usage​

List of workflows associated with the template version. This allows users to track which version of code is deployed where.

Usage Tab

SG noCode​

Presents a user-friendly, JSONSchema-based UI form for users without coding experience to interact with the template.

NoCode Form

Code​

Provides a direct view of the JSON input parameters for the template, allowing for manual configuration and editing.

Code Tab

Meta​

Creates the link to the code repository. Which branch/tag and directory of the repository is used to fetch the code.

Meta Tab

Deployment Settings​

Configures environment variables, platform integrations (such as AWS or Azure), and pre/post workflow steps for template deployment.

Deployment Settings