Day 61- Terraform commands.

Day 61- Terraform commands.

Task 1: Commonly used Terraform commands

Find the purpose of basic Terraform commands which you'll use often

  1. terraform init - Initializes a new or existing Terraform configuration in the current directory.

     terraform init
    

    This command downloads and installs any necessary plugins or modules needed to execute the configuration

  2. terraform init -upgrade - Upgrades the installed Terraform plugins to the latest version, if available.

     terraform init -upgrade
    

    This command is useful when upgrading Terraform versions or when there are new versions of the plugins that need to be used.

  3. terraform plan - Shows an execution plan of the changes that Terraform will make to infrastructure, without actually making those changes.

     terraform plan
    

    This command helps to identify potential issues before applying infrastructure changes.

  4. terraform apply - Applies the changes to the infrastructure defined in the Terraform configuration.

     terraform apply
    

    This command creates, modifies, or deletes resources as necessary to bring the infrastructure into the desired state.

  5. terraform validate - Checks the Terraform configuration files for syntax errors and other potential issues.

     terraform validate
    

    This command helps to identify any problems in the configuration before attempting to apply changes to the infrastructure.

  6. terraform fmt - Formats the Terraform configuration files to follow the standard formatting conventions.

     terraform fmt
    

    This command ensures consistency in the codebase and makes it easier to read and maintain.

  7. terraform destroy - Destroys all the infrastructure resources that were created by the Terraform configuration.

     terraform destroy
    

    This command is useful when tearing down an entire environment or cleaning up resources that are no longer needed.

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.