Terraform Build

Package Terraform templates in a deployable Microtica Component.

To use this step, you would need to have an existing Terraform templates hosted on your Git account.

Input/output parameters

The parameters you define in variables.tf will automatically become an input parameters of the component and parameters defined in the outputs.tf will become the output parameters of the component. The actual values should be specified in the Microtica Portal.

Folder structure

You should always have your variables.tf and outputs.tf files in the root directory.

#Syntax

YAML

steps:
  step-name:
    type: terraform-build
ParameterDescriptionRequired
titleThe display name of the step.No
typeThe type of the Microtica built-in step.
Should always be terraform-build for this type of step.
Yes

#Package templates into Component

In the following example we define a pipeline that pulls the code from a Git repository then packages the Terraform templates into a Component.

We just need to specify the step and everything else will be handled by the terraform-build built-in step.

microtica.yaml

steps:
  Clone:
    title: Clone my source code from Git
    type: git-clone

  Package:
    title: Package my CFN template into Microtica Component
    type: terraform-build

Create a pipeline with the above spec and trigger the initial pipeline run.

Now we need to create a component in Microtica Portal and connect it with the pipeline you just created.

To create a component click on Components under Infrastructure from the side bar.

Enter a name, type and description for the component. Then select the pipeline from the dropdown and select the step of type terraform-build, in our case that’s the Package step.

Create Component form

Click on Create Component button at the bottom.

Now the component is ready to be added in an environment and deployed in the cloud.