Skip to content

Commit

Permalink
Updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Ga13Ou authored and coolaj86 committed Dec 18, 2024
1 parent b804334 commit 4be4cb3
Showing 1 changed file with 74 additions and 13 deletions.
87 changes: 74 additions & 13 deletions terramate/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,83 @@ common command-line arguments from Terramate
> framework for managing multiple stacks, generating code, and executing
> targeted workflows.
### Preflight check

Ensure that your environment meets the following requirements to use Terramate
effectively:
### **1. Create a New Project**
```bash
git init -b main terramate-quickstart
cd terramate-quickstart
git commit --allow-empty -m "Initial empty commit"
```

---

### **2. Create a Stack**
```bash
terramate create \
--name "StackName" \
--description "Description of the stack" \
stacks/stackname

git add stacks/stackname/stack.tm.hcl
git commit -m "Create a stack"
```

- **Terraform installed**: Terramate integrates with Terraform; ensure you have
the required version installed.
- **Go (optional)**: Needed if you are building Terramate from source.
- **Set up your PATH**: Add Terramate to your PATH for easy access.
---

To install and verify Terramate:
### **3. List Stacks**
```bash
terramate list
```

```sh
# Install Terramate using your preferred method
webi terramate@stable
---

# Verify installation
terramate version
### **4. Detect Changes**
```bash
terramate list --changed
```

---

### **5. Generate Code**
1. Create a `.tm.hcl` file for code generation:
```bash
cat <<EOF >stacks/backend.tm.hcl
generate_hcl "backend.tf" {
content {
terraform {
backend "local" {}
}
}
}
EOF
```
2. Run the generation command:
```bash
terramate generate
```
---
### **6. Run Terraform Commands**
- **Initialize stacks:**
```bash
terramate run terraform init
```
- **Plan changes:**
```bash
terramate run terraform plan
```
- **Apply changes:**
```bash
terramate run terraform apply -auto-approve
```
- **Run commands only on changed stacks:**
```bash
terramate run --changed terraform init
terramate run --changed terraform plan
terramate run --changed terraform apply -auto-approve
```

0 comments on commit 4be4cb3

Please sign in to comment.