In order to see the Terraform Blueprint type option and create Terraform App Blueprints in Provisioning > Blueprints, the Morpheus user must have Role permissions for Provisioning: Blueprints - Terraform set to Full.
In order to provision Terraform Apps in
Provisioning > Apps, the Morpheus user must have Role permissions for Provisioning: Blueprints > Terraform set to Provision or Full.
Existing Terraform Blueprints must be added before they can be provisioned from Provisioning > Apps.
To use .tf files from a Git repo a Git or Github integration needs to be configured in
`Administration > Integrations. If one is not configured .tf or .tf.json files can be manually added to Terraform App Blueprints.
Supported App Provisioning Targets¶
Additional clouds will be available in later releases.
Morpheus will automatically install Terraform locally upon the first Terraform App provision. It is possible on some operating system configurations for the automated terraform installation to fail, in which case it can be manually installed (run
terraform --version to verify).
To manually install and configure terraform on the Morpheus Appliance:
Run the following cURL on the Morpheus Appliance to install Terraform:
curl -k -s "https://applianceServerUrl/api/server-script/terraform-install?local=true" | bash
Replace applianceServerUrl with your Morpheus appliance URL or IP address.
Copy the Terraform directory at
cp /usr/local/bin/terraform /usr/sbin/terraform
Terraform is now installed and configured, and Terraform apps can be provisioned from Morpheus.
Creating Terraform App Blueprints¶
In order to provision Terraform apps, Terraform App Blueprints must be created first.
In Morpheus version 4.2.0, VMware and AWS Cloud types are supported for Terraform App provisioning targets. Additional clouds will be available in later releases.
Navigate to Provisioning -> Blueprints
Select + ADD
Name the Blueprint and select Terraform type.
In order to see the Terraform Blueprint type option, the Morpheus user must have Role permissions for Provisioning: Blueprints - Terraform set to Full.
Configure the following:
Name of the
Description for you App Blueprints shown in the Apps list (optional)
App Category (optional)
Add reference image/picture for your App Blueprint (optional)
- CONFIG TYPE (select Terraform, Terraform.json, or Git Repository)
- Terraform (.tf)
Paste in the .tf contents in the config section. Variables will be presented as input fields during App provisioning, or auto-populated with matching values if contained in a selected TFVAR Secret file added to the Cypher service.
- Terraform JSON (.tf.json)
Paste in .tf.json contents in the config section. Variables will be presented as input fields during App provisioning, or auto-populated with matching values if contained in a selected TFVAR Secret file added to the Cypher service.
- Git Repository
- SCM Integration
Select a Github SCM integration that has been added in Administration - Integrations. If using a Git Repository integration from Administration - Integrations this filed can be skipped.
Select repository from selected SCM integration, or Git Repository integration from Administration - Integrations if no SCM/Github Integration is selected.
- BRANCH OR TAG
i.e. master (default)
- WORKING PATH
Enter the repo path for the .tf files (s).
.tf files found in the working path will populate in the CONFIG section.
If no files are found please ensure your Github or Git integration is configured properly (Private repos need to have a key pair added to Morpheus, the keypair selected on the integration in Morpheus, and the keypair’s public key added to the GitHub users SSH keys in github or to the git repo).
- TFVAR SECRET
Select a tfvars secret for .tf variables. Tfvars secrets can be added in Services -> Cypher using the tfvars/name mountpoint. This allows sensitive data and passwords to be encrypted and securely used with Terraform Blueprints.
Your Terraform App is ready to be provisioned from Provisioning -> Apps.
Provisioning Terraform Apps¶
An existing Terraform App Blueprints must be added to Provisioning -> Blueprints before it can be provisioned.
In order to provision Terraform Apps in Provisioning -> Apps, the Morpheus user must have Role permissions for Provisioning: Blueprints - Terraform set to Provision or Full.
Navigate to Provisioning -> Apps
Select + ADD
Choose and existing Terraform App Blueprint
Enter a NAME for the App and select the Group, Default Cloud and Environment (optional)
Populate any required variables in the Terraform Variables section. ..TIP:: If the tf CONFIG data needs to be edited, select the RAW section, edit, and then select the BUILDER section again. The CONFIG changes from the RAW edit will be updated in the CONFIG section.
The Terraform App will begin to provision.
Once provisioning is completed, note the TERRAFORM tab in the App details page (Provisioning -> Apps -> select the App). This section contains State and Plan output: