https://github.com/martezr/morpheus-terraformer
CLI tool to generate terraform files from existing Morpheus configuration (reverse Terraform)
https://github.com/martezr/morpheus-terraformer
infrastructure-as-code morpheus terraform
Last synced: 5 months ago
JSON representation
CLI tool to generate terraform files from existing Morpheus configuration (reverse Terraform)
- Host: GitHub
- URL: https://github.com/martezr/morpheus-terraformer
- Owner: martezr
- License: mit
- Created: 2022-07-20T19:58:14.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-12T19:41:13.000Z (over 3 years ago)
- Last Synced: 2025-03-13T02:36:06.506Z (over 1 year ago)
- Topics: infrastructure-as-code, morpheus, terraform
- Language: Go
- Homepage:
- Size: 150 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
# Morpheus Terraformer
[![GoReportCard][report-badge]][report]
[](https://github.com/martezr/morpheus-terraformer/releases/)
[](https://godoc.org/github.com/martezr/morpheus-terraformer)

[📖 Documentation][docs]
[docs]: https://martezr.github.io/morpheus-terraformer
[report-badge]: https://goreportcard.com/badge/github.com/martezr/morpheus-terraformer
[report]: https://goreportcard.com/report/github.com/martezr/morpheus-terraformer
A CLI tool that generates `tf` files based on existing Morpheus configuration
(reverse Terraform).
* Disclaimer: This is not an official Morpheus product
# Installation
Morpheus-Terraformer is built with Golang and compiled down to a single binary like Terraform.
## Linux
```bash
curl -LO https://github.com/martezr/morpheus-terraformer/releases/download/$(curl -s https://api.github.com/repos/martezr/morpheus-terraformer/releases/latest | grep tag_name | cut -d '"' -f 4)/morpheus-terraformer-linux-amd64.tar.gz
tar -xzf morpheus-terraformer-linux-amd64.tar.gz
cd morpheus-terraformer-linux-amd64/
chmod +x morpheus-terraformer-linux-amd64
sudo mv morpheus-terraformer-linux-amd64 /usr/local/bin/morpheus-terraformer
```
## Mac OS X
```
curl -LO https://github.com/martezr/morpheus-terraformer/releases/download/$(curl -s https://api.github.com/repos/martezr/morpheus-terraformer/releases/latest | grep tag_name | cut -d '"' -f 4)/morpheus-terraformer-darwin-amd64.tar.gz
tar -xzf morpheus-terraformer-darwin-amd64.tar.gz
cd morpheus-terraformer-darwin-amd64/
chmod +x morpheus-terraformer-darwin-amd64
sudo mv morpheus-terraformer-darwin-amd64 /usr/local/bin/morpheus-terraformer
```
## Windows
1. Download the .exe file from here - https://github.com/martezr/morpheus-terraformer/releases
2. Add the exe file path to path variable
# Getting Started
To get started with the Morpheus Terraformer the connection information for the Morpheus instance need to be set as environment variables.
**Username and Password**
```
export MORPHEUS_API_URL="https://morpheus.test.local"
export MORPHEUS_API_USERNAME="admin"
export MORPHEUS_API_PASSWORD="password123"
```
**Access Token**
```
export MORPHEUS_API_URL="https://morpheus.test.local"
export MORPHEUS_API_TOKEN="d3a4c6fa-fb54-44af"
```
Generate the Terraform code using the `generate` command following by `-r` and the name of the resources to create or specify `'*'` to generate all supported resources.
```
morpheus-terraformer generate -r "*"
```
```
morpheus-terraformer generate -r group,environment
```
# Supported Resources
The following resources are supported:
|Name|Description|
|----|-----|
|contact|Morpheus monitoring contact|
|environment|Morpheus environments|
|group|Morpheus groups|
|optionlist|Morpheus option lists (REST API, Manual, and Morpheus)|
|optiontype|Morpheus option types(select, text, number, password, typeahead)|
|policy|Morpheus policy|
|scripttemplate|Morpheus script template|
|spectemplate|Morpheus spec template|
|task|Morpheus automation task|
|tenant|Morpheus tenants|
|wiki|Morpheus wiki pages|
|workflow|Morpheus automation workflows|
# Contributing
If you have improvements or fixes, we would love to have your contributions. Please read CONTRIBUTING.md for more information on the process we would like contributors to follow.