🙏 Introduction:
In this blog, we will learn some basic Terraform commands.
🎯Task: 1
Terraform is an infrastructure-as-code (IAC) tool used for building, changing, and versioning infrastructure efficiently. It has several commands to manage your infrastructure code and the resources it provisions.
Here are some commonly used Terraform commands
terraform init
- Initializes a new or existing Terraform configuration in the current directory. This command downloads the necessary provider plugins and sets up the working directory.
terraform init -upgrade
- Upgrades the installed Terraform plugins to the latest version, if available. This command is useful when upgrading Terraform versions or when there are new versions of the plugins that need to be used.
terraform plan
- Generates a execution plan description of what Terraform will do to reach the desired state define your configuration. It shows which resources will be created, updated, or destroyed.
terraform apply
- Applies the changes the defined in your Terraform configuration to create or update resources based on the execution plan. It prompts for confirmation before making changes.
terraform validate
- Checks the syntax and configuration of your Terraform files for errors without actually creating or modifying resources.
terraform fmt
- Rewrites Terraform configuration files to a canonical format and style. This applies standard formatting conventions to the code to make it easier to read and understand.
terraform destroy
- Destroys are all resources defined in your configuration, effectively tearing down your infrastructure. It also prompts for confirmation before proceeding.
Who are Terraform's main competitors?
AWS CloudFormation: AWS CloudFormation is a service provided by Amazon Web Services (AWS) for defining and deploying infrastructure as code on the AWS platform. It's a direct competitor for those who are heavily invested in AWS.
Ansible: Ansible is an open-source software provisioning, configuration management, and application-deployment tool. It's a direct competitor for those who are heavily invested in Red Hat.
Chef and Puppet: Chef and Puppet are traditional configuration management tools but can also be used for infrastructure automation. While they differ in their approach from Terraform, they can be considered competitors in the broader infrastructure automation landscape.
Packer: Packer is an open-source tool for creating identical machine images for multiple platforms from a single source configuration. It's a direct competitor for those who are heavily invested in HashiCorp.
Kubernetes: While not a direct competitor, Kubernetes, the container orchestration platform, plays a significant role in managing application deployments and infrastructure at scale. It complements tools like Terraform, and there's some overlap in use cases.
Cloud Foundry: Cloud Foundry is an open-source, multi-cloud application platform as a service (PaaS) governed by the Cloud Foundry Foundation, a 501(c)(6) organization. It's a direct competitor for those who are heavily invested in Cloud Foundry.
👋 Conclusion :
In this blog, we have covered some basic Terraform commands. We will cover advanced topics in a future post.
Thank you for reading!
Contact me on Linkedin
Check out my GitHub for more resources 📚