Skip to main content

Share Infrastructure Resources

In this section, you will learn how to share infrastructure resources by using Connection Interfaces.


You can share infrastructure resources through Connection Interfaces.

The following steps explain how it works:

  • 1. When you create an Infrastructure Plugin, you must choose a Connection Interface Type. This type represents the infrastructure resources that will be provisioned during the Application or Infrastructure deployment where this plugin is applied.

  • 2. When an Application or Infrastructure deployment happens:

    • The infrastructure resources are provisioned according to the Infrastructure Plugin specification.

When an Infrastructure Plugin is provisioned successfully, the Deploy Engine generates one or more Connection Interfaces according to the Connection Interface Types you chose when creating the plugins and configured in the plugin templates.

info

Connection Interfaces are represented by outputs stored in:

  • the Application context, if an Application deployment occurs;
  • the Workspace context, if an Infrastructure deployment happens.
  • 3. You can use Connection Interface outputs stored in the selected context as inputs in App or Infra plugins. These plugins are configured to receive these values when you apply them to your projects.

Reuse Cloud Resources in the Application

You can reuse Cloud resources in your Application or in other Infrastructure resources through StackSpot Connection Interfaces, which are contracts that define the parameters a plugin exports.

Check how it works:

  1. When you create an Infrastructure Plugin, it must comply with the Connection Interface contracts.
  2. Applying an Infrastructure Plugin with the deploy flag generates Infrastructure as Code (IaC) files (for example, Terraform files) that contain output configurations. These outputs must follow the contracts defined by the Connection Interfaces.
  3. When the IaC files are provisioned, the Deploy Engine saves the Connection Interface outputs in two places:
    • Infrastructure: the outputs are saved in the Workspace context.
    • Application: the outputs are saved in the Application context.
  4. When you apply new plugins to the Application, they can use the Connection Interface outputs as plugin inputs. This way, they can reuse the provisioned Cloud resources.