Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add terraform cmds #19

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ This repository is a collection of the most commonly used command-line commands
- [Kubernetes Commands](#kubernetes-commands)
- [Helm Commands](#helm-commands)
- [Ansible Commands](#ansible-commands)
- [Terraform Commands](#terraform-commands)

---

Expand Down Expand Up @@ -281,3 +282,45 @@ ansible-playbook playbook.yml -vvv
```

[Back to top 🔝](#cli-commands-reference)

## Terraform Commands

```bash
# Initialize a Terraform configuration directory
terraform init

# Plan the changes required by the Terraform configuration
terraform plan

# Apply the changes required by the Terraform configuration
terraform apply

# Create a Terraform execution plan and save it to a file (recommended)
terraform plan -out="tfplan.out"

# Apply the changes from saved plan
terraform apply "tfplan.out"

# Apply the changes automatically (use with your own risk, suitable for automation tasks)
terraform apply --auto-aprove

# Destroy all the resources managed by Terraform
terraform destroy

# Validate the Terraform configuration files
terraform validate

# Format Terraform configuration files
terraform fmt

# Show the current state of Terraform-managed infrastructure
terraform show

# Refresh the state file with the real infrastructure
terraform refresh

# List the available Terraform providers
terraform providers
```

[Back to top 🔝](#cli-commands-reference)