This extension enables you to use the Terraform outputs as variables in your Azure Pipelines.
This task will execute 'terraform output -json' command within the provided "Path to Terraform scripts" and map all these values to pipeline variables.
It is possible to indicate if you want to map the sensitive outputs as secrets (thanks to @joseph-passineau 😊).
You can also provide a common prefix that will be applied to each of the variable names.
Optionally a path to Terraform assembly can be provided. If it's available in PATH this value can be leave empty.
CI build pipeline that packages the vsix extension and publishes two artifacts:
- terraform-outputs-extension: includes the packaged extension.
- terraform-test: contains .tf files and a powershell script used to validate the extension.
CD release pipeline is composed of three different stages:
Publishes a private version of the extension tagged as "development".
Before running next stage there is a deployment gate to check that the extension has been successfully validated by the marketplace.
Executes the same task group on three different hosted agents:
- Windows Validation: Hosted VS2017 agent pool.
- Linux Validation: Hosted Ubuntu 1604 agent pool.
- MacOS Validation: Hosted macOS agent pool.
The task group:
- Installs the extension that has been published on Development stage.
- Installs Terraform and executes init and apply using 'terraform-test' published artifact.
- Run Terraform Outputs without prefix.
- Executes a powershell to check that the variable has been published and contains the appropriate value.
- Run Terraform Outputs with prefix.
- Executes a powershell to check that the variable has been published using the provided prefix and contains the appropriate value.
Once it has been approved this stage publishes the extension to the marketplace.