Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miltlima/terramagic
🐍 - Wizard tool for create folders and terraform files automated, written in Python !
https://github.com/miltlima/terramagic
cli patterns python terraform
Last synced: about 1 month ago
JSON representation
🐍 - Wizard tool for create folders and terraform files automated, written in Python !
- Host: GitHub
- URL: https://github.com/miltlima/terramagic
- Owner: miltlima
- License: mit
- Created: 2020-09-04T14:39:31.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-06T00:35:58.000Z (over 1 year ago)
- Last Synced: 2024-04-23T13:18:02.772Z (8 months ago)
- Topics: cli, patterns, python, terraform
- Language: Python
- Homepage:
- Size: 102 KB
- Stars: 44
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tf - terramagic - Wizard tool for create folders and terraform files automated, written in Python ! (Tools / Community providers)
- jimsghstars - miltlima/terramagic - 🐍 - Wizard tool for create folders and terraform files automated, written in Python ! (Python)
README
[!["Buy Me A Coffee"](https://img.shields.io/badge/Buy_Me_A_Coffee-FFDD00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/miltlima)
# Terramagic CLI
Terramagic is a command-line interface tool that makes it easy to create and manage Terraform projects.
## Motivation
Creating a new Terraform project from scratch can be time-consuming and error-prone. With Terramagic, you can quickly generate a template for your project and customize it to your needs.
### Requirements
Python 3.9 or higher
### Installation
You can easily install Terramagic using pip:
```shell
pip3 install terramagic
```### Usage
#### Creating a new project
To create a new Terraform project, use the create command:
```shell
terramagic create --name
```For example, to create a project called "infra" automatically 3 environments are created ("development", "staging" and "production") and respective tfvars, run:
```shell
terramagic create --name infra
```This will generate a new directory called "infra" with the following structure:
```code
infra
├── backend.tf
├── environments
│ ├── development
│ │ └── development.tfvars
│ ├── production
│ │ └── production.tfvars
│ └── staging
│ └── staging.tfvars
├── main.tf
├── main.tfvars
├── modules
│ ├── cluster
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ ├── instance
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ └── variables.tf
│ └── vpc
│ ├── main.tf
│ ├── outputs.tf
│ └── variables.tf
├── outputs.tf
├── providers
│ └── provider.tf
└── variables.tf
```You can then edit these files to define your infrastructure resources and variables.
#### Deleting a project
To delete an existing project, use the delete command and specify the project name:
```shell
terramagic delete --name
```For example, to delete the "myapp" project, run:
```shell
terramagic delete --name infra
```Help
For detailed information about available commands and options, run:```shell
terramagic --help
```This will display the following message:
```shell
Usage: terramagic [OPTIONS] COMMAND [ARGS]...ClI tool to create Terraform project
Options:
-v, --version Show version
--help Show this message and exit.Commands:
create Create a new Terraform project with specified name and environment
remove Delete the project
```Enjoy using Terramagic to simplify your Terraform workflow!