Terraform CLI

The Terraform Command-Line Interface (CLI) is a tool used for managing infrastructure as code.
--- shuffleAnswers: true shuffleQuestions: true nQuestions: 25 introduction: >
The test contains a set of questions and there is no time limit. The test is not official, it's just one of the most efficient ways to see how much you know, or don't know, about the subject.

Count your score

You will get 1 point for each correct answer. At the end of the Quiz, your total score will be displayed.

Reflect on you answers

Please conduct a self review of your answers once you complete the quiz test. Being an active participant in your own evaluation, honestly assess your strengths and also areas you need to improve. Good luck!
--- # terraform fmt command is to be used whenever you want to destroy and create a new instance. 1. [ ] True 1. [x] False > The terraform fmt command is used to improve the look of the code in terraform files. When terraform taint is used to delete and recreate resources, it is the correct command to use. > Reference:
https://www.terraform.io/docs/cli/commands/fmt.html
https://www.terraform.io/docs/cli/commands/taint.html # logs John wants to enable comprehensive logging because he is new to Terraform and wants to know everything. He must specify which environment variable. 1. [ ] TF_help 1. [x] TF_LOG > By default, Terraform does not provide comprehensive logging. To enable thorough recording, the environment variable TF LOG must be set. By turning on TF LOG, you can configure the TRACE, INFO, WARN, or ERROR, DEBUG settings. 1. [ ] TF_Debug 1. [ ] TF_var_log > https://www.terraform.io/docs/cli/config/environment-variables.html # Your configuration file has been locked by mistake. Which of the following commands would you use to unlock it? 1. [ ] terraform filename-unlock 1. [ ] delete the file and create a new state file 1. [ ] state.tf -unlock 1. [x] terraform force-unlock > The terraform force-unlock command can be used to unlock the state configuration manually. It has no effect on the infrastructure. Refer to the following link for Syntax https://www.terraform.io/docs/cli/commands/force-unlock.html # If you want to replace a particular object even though there are no configuration changes in the code, which command from below would be best suited? 1. [ ] terraform destroy 1. [ ] terraform taint 1. [x] terraform replace 1. [ ] terraform state rm # The data directory in terraform is used to retain data that must persist from one command to the next, so it’s important to have this variable set consistently throughout all the Terraform workflow commands (starting with terraform init) or else Terraform may be unable to find providers, modules, and other artifacts. Which ENVIRONMENT VARIABLE is used from below to ‘set’ per-working-directory data? 1. [x] TF_DATA_DIR 1. [ ] TF_WORKSPACE 1. [ ] TF_DATA 1. [ ] TF_DATA_WORKSPACE # You want to test the `split` function of Terraform locally to verify the output that the split function will be returned. [ ] What is the best approach to test this function locally? 1. [x] echo `split(",”, "foo,bar,baz”)` | terraform console 1. [ ] echo `split(",”, "foo,bar,baz”)` | terraform plan 1. [ ] echo `split(",”, "foo,bar,baz”)` | terraform apply 1. [ ] None of options # When running the terraform plan command, Terraform examines the code and adds any missing arguments before applying the changes. 1. [ ] True 1. [x] False > Terraform scans the code for syntactical errors and missing arguments before executing the plan. Before the code can be successfully executed, users must fix these warnings. > Reference : https://www.terraform.io/docs/cli/commands/plan.html # Is it necessary to execute terraform init every time you add a new provider before running the terraform plan and terraform apply commands? 1. [ ] False 1. [x] True > Every time you introduce a new provider, it is essential to execute terraform init.
This ensures that the most recent provider or a specified version and initialization files are downloaded to the .terraform folder. # If the terraform init command is executed twice on the same machine by different team members, will the plugins be downloaded and initialized twice in the backend? 1. [ ] True 1. [x] False > Terraform will check for the provider and download the contents and save them in the [DOT].terraform folder when you use 'terraform init' for the first time.
Following that, it looks at the local file and only downloads from the provider if there is a version check mentioned. # Does the terraform apply command perform validation of the Terraform configuration syntax? 1. [ ] True 1. [x] False > The terraform apply command executes the actions specified in a Terraform plan and does not perform syntax error checking. On the other hand, the terraform validate command checks the configuration files in a directory for syntax errors, focusing only on the configuration and excluding any remote services such as provider APIs or remote state. This command verifies that a configuration is internally consistent and syntactically correct, regardless of the variables or current state. It can also be used to check the correctness of attribute names and value types in reusable modules. For further details, please refer to the following links: > Reference: https://www.terraform.io/docs/cli/commands/apply.html
> https://www.terraform.io/docs/cli/commands/validate.html # Your team has observed that when terraform fmt is executed, the command execution fails as a result of a state lock. Is this correct? 1. [ ] True 1. [x] False > You can still use Terraform fmt when a state file is locked because no modifications can be made to it. The Terraform fmt command1 does not alter the state file. Any program that could change the terraform state file cannot be run when terraform state is locked. # Whenever you issue terraform destroy command, it removes the state files and moves the infrastructure to cold state. 1. [ ] True 1. [x] False > The terraform destroy command will empty the resources from state files and destroy the corresponding infrastructure whenever it is used. > Reference Link: https://www.terraform.io/docs/cli/commands/destroy.html # Terraform graphviz is used to create terraform dot files ? 1. [ ] True 1. [x] False > Terraform graph is used to create the dot files and graphviz is used to create graphical representation of it. # Terraform state file is locked and you issue terraform destroy command. Does the command delete all the resources? 1. [ ] True 1. [x] False > If the state file is locked, terraform commands that make changes to the terraform state file cannot be executed. > Reference: https://www.terraform.io/docs/language/state/locking.html # You used terraform plan -out='test.file' to save the contents of terraform to a test.file as requested. [ ] Is the grammar correct? 1. [ ] False 1. [x] True > Using terraform plan and the -out='test' flag, you can save the contents of the file. It saves the generated plan in an opaque file format to the given filename, which you can then pass to terraform apply to execute the planned changes, as well as to some other Terraform commands that can work with saved plan files. > Reference: https://www.terraform.io/docs/cli/commands/plan.html # How do you check whether the terraform code he wrote is in canonical format and style without modifying terraform configuration files now that a new intern has joined your team? 1. [ ] `terraform fmt` > Because `terraform fmt` modifies the configuration files by writing them in a canonical format and style. 1. [x] `terraform fmt -check` > Because this command checks if the input is formatted. If all input is properly formatted, the exit status will be `0`, otherwise it will be`non-zero`. 1. [ ] `terraform fmt -diff` > Because the `–diff` option modifies source configuration and displays diffs of formatting changes. 1. [ ] `terraform fmt –list=false` > because it does not display files with formatting inconsistencies. If we only want to check if the configuration files are in canonical format and style without changing them, we can use the `–check` option in conjunction with `terraform fmt`. > For more information: https://www.terraform.io/docs/commands/fmt.html # The cloud team manager has asked team members to create all resources using Terraform and also asked to maintain existing resources using Terraform. How can this be implemented? 1. [ ] Resources that are created manually cannot be handled by terraform as terraform didn’t create those resources > because the terraform import command can import existing resources. 1. [x] Using terraform import command resources can be imported and can be handled going forward. > because terraform import can be used to import existing resource states as well as handle future changes. Existing resources can be imported into Terraform using the ´terraform import` command. The terraform import command can be used to import any resources that were created manually using the cloud provider console or by any other means. Currently till terraform version 0.13 , it only imports the state of the resource. It will not import and write configuration. 1. [ ] Take a down time and delete the existing resources and create a new resources with same configuration. > because the import command allows you to import an existing infra state without having to delete and recreate it. 1. [ ] Use the cloud provider native IaC tool to obtain that state and add that state in terraform state file. > Because many cloud native IaC tools do not use state files > For more information: https://www.terraform.io/docs/commands/import.html # Which among the following log command should be set to get Maximum verbosity of terraform logs? 1. [ ] set the `TF_LOG=DEBUG` in environment variable > because, unlike trace, this command does not provide detailed verbose information. 1. [ ] set the `TF_LOG=INFO` in environment variable > because this command will not only give you information, but it will also give you a lot of it. 1. [x] set the `TF_LOG=TRACE` in environment variable > because it provides more detailed information than the other options. 1. [ ] set the `TF_LOG=WARN` in environment variable > because it only prints warning messages. The `TF LOG` environment variable can be set to any value to enable detailed logs in Terraform. Detailed logs will appear on `stderr` as a result of this. To persist logged output you can set TF_LOG_PATH in order to force the log to always be appended to a specific file when logging is enabled. Note that even when TF_LOG_PATH is set, TF_LOG must be set in order for any logging to be enabled. > https://www.terraform.io/docs/internals/debugging.html # Which of the following command can be used to syntactically check terraform configuration before using apply or plan command? 1. [ ] terraform fmt > because fmt is used to rewrite Terraform configuration files to a canonical format and style. 1. [x] terraform validate > because it is used to validate the terraform configuration. 1. [ ] terraform show > because show is used to provide human readable output from a state or plan file. 1. [ ] terraform check > because there is no command in terraform called check. > https://www.terraform.io/docs/commands/validate.html # When terraform fmt is applied, how many space indentation are applied for each nesting level? 1. [ ] 3 1. [x] 2 > because terraform fmt applies a twospace indentation to each level by default. These conventions will be applied automatically by Terraform formatting. Rest of the options are INCORRECT because by default terraform fmt applies 2 space indentation at each level. 1. [ ] 1 1. [ ] 4 > https://www.terraform.io/docs/configuration/style.html https://www.terraform.io/docs/commands/fmt.html # By default, how many parallel/concurrent operations are executed by terraform? 1. [ ] 2 1. [x] 10 > because when you run the plan or apply command, you get 10 parallel execution by default. By default, terraform performs 10 parallel executions. The rest of the options are incorrect 1. [ ] 5 1. [ ] 1 > https://www.terraform.io/docs/commands/apply.html#parallelism-n > https://www.terraform.io/docs/internals/graph.html#walking-the-graph # How can we skip interactive approval for terraform apply command? (SELECT TWO) - [x] `terraform apply –auto-approve` > it uses the auto-approve option to bypass interactive approval. - [ ] `terraform apply -yes` > Because yes is not a valid terraform option. - [x] `terraform plan –out="test.tfplan"` and `terraform apply test.tfplan` > if a plan is supplied as an argument, the application will not ask for approval. - [ ] `terraform apply –auto-approve=true` > auto-approve does not inquire about the value. There are two ways to avoid interactive approval. > https://www.terraform.io/docs/commands/apply.html # A user doesn’t want to store secrets for configuring remote backend. How can he pass the remaining configuration so that terraform can initialize and talk to backend? (SELECT THREE) - [x] Command line key-value pairs. (right) > because the init command allows us to specify a key value pair. - [x] Interactively on command line. (right) > because terraform interactively asks for required values when values are not defined. - [x] use the –backend-config=PATH to specify a separate config file > Because the configuration file can be specified via the init command line, When running terraform init, use the -backend-config=PATH option to specify a file. - [ ] Query for secrets directly from vault > Because we must first download secrets from vault to local disc before running terraform init. In addition, the downloaded secrets must be passed to the init command. In the backend configuration, you don't have to specify every required argument. It may be preferable to omit certain arguments in order to avoid storing secrets, such as access keys, in the main configuration. A partial configuration is when some or all of the arguments are omitted. > For more information: https://www.terraform.io/docs/backends/config.html#partialconfiguration # Which command is used to print detailed schemas for the providers used in the current configuration. 1. [ ] Terraform providers > because the terraform providers command displays details about the configuration's provider requirements in the current working directory. 1. [x] Terraform providers Schema > The terraform providers schema command prints detailed schemas for the providers that are currently being used in the configuration. Because it is a direct command, all other responses are incorrect. 1. [ ] Terraform providers mirror > because the terraform providers mirror command downloads and copies the providers required for the current configuration into a local filesystem directory. 1. [ ] Terraform providers describe > because such a command does not exist. > https://www.terraform.io/docs/cli/commands/providers/schema.html # Which command from the list below would be best suited to replace a specific object even if no configuration changes are made in the code? 1. [ ] `terraform destroy` > because it would destroy the current resource and require the creation of new resources 1. [ ] `terraform taint` > because it used to happen in previous versions of Terraform, but the best command for the current version of Terraform is terraform replace. 1. [ ] `terraform state rm` > because this command is used to manipulate the state file. 1. [x] `terraform replace` > If your intent is to force replacement of a particular object even though there are no configuration changes that would require it, we recommend instead to use the -replace option with terraform apply. > https://www.terraform.io/docs/cli/commands/taint.html # Terraform's data directory is used to store data that must be preserved from one command to the next, so it's critical to have this variable set consistently across all Terraform workflow commands (beginning with terraform init), or Terraform may be unable to locate providers, modules, and other artefacts. Which ENVIRONMENT VARIABLE is used to 'set' per-working-directory data from the list below? > https://www.terraform.io/docs/cli/config/environmentvariables.html#tf_data_dir 1. [x] `TF_DATA_DIR` > Per-working-directory data is written by default into the current directory's.terraform subdirectory. Terraform's per-working-directory data, such as the current remote backend configuration, is saved in the TF DATA DIR variable. 1. [ ] `TF_WORKSPACE` > For multi-environment deployment, instead of using the 'terraform workspace select your workspace' command, the TF WORKSPACE environment variable can be used to select a workspace. It can't be used to'set' data for each working directory. 1. [ ] `TF_DATA` > There is no such ENVIRONMENT VARIABLE 1. [ ] `TF_DATA_WORKSPACE` > There is no such ENVIRONMENT VARIABLE # What does the terraform apply command do? 1. [ ] It will check for canonical format and config errors in the configuration 1. [ ] It will create a map of infrastructure to be deployed 1. [ ] It will create a workspace and store all the configurations in the `.terrafrom` directory 1. [x] It will propose the plan and prompt the user to approve to actually implement the configurations. > The terraform apply command puts a Terraform plan's actions into action. Without a saved plan file, terraform apply creates its own plan of action, just like terraform plan. Unless you use the -auto-approve option, Terraform will present you with the plan and prompt you to approve it before proceeding with the described actions. > https://www.terraform.io/docs/cli/commands/apply.html # Which of the following flags can be used with terraform apply command? 1. [x] auto-approve > The behavior of terraform apply differs significantly depending on whether you pass it the filename of a previously-saved plan file. The terraform apply command executes the actions proposed in a Terraform plan. -auto-approve: Skips interactive approval of the plan before applying. 1. [ ] init 1. [ ] get 1. [ ] console > https://www.terraform.io/docs/cli/commands/apply.html # The Terraform Configuration File is used to set per-user CLI behaviour settings across all Terraform working directories. Is it true or false? 1. [x] True > The Terraform configuration file specifies per-user CLI behaviour settings that are shared across all Terraform working directories. 1. [ ] False > https://www.terraform.io/docs/cli/config/config-file.html # What does the terraform apply command do? 1. [ ] It will check for canonical format and config errors in the configuration 1. [ ] It will create a map of infrastructure to be deployed 1. [ ] It will create a workspace and store all the configurations in the `.terrafrom` directory 1. [x] It will propose the plan and prompt the user to approve to actually implement the configurations. > The terraform apply command puts a Terraform plan's actions into action. Without a saved plan file, terraform apply creates its own plan of action, just like terraform plan. Unless you use the -auto-approve option, Terraform will present you with the plan and prompt you to approve it before proceeding with the described actions. > https://www.terraform.io/docs/cli/commands/apply.html # Terraform's data directory is used to store data that must be preserved from one command to the next, so it's critical to have this variable set consistently across all Terraform workflow commands (beginning with terraform init), or Terraform may be unable to locate providers, modules, and other artefacts. Which ENVIRONMENT VARIABLE is used to'set' per-working-directory data from the list below? > https://www.terraform.io/docs/cli/config/environmentvariables.html#tf_data_dir 1. [x] `TF_DATA_DIR` > Per-working-directory data is written by default into the current directory's.terraform subdirectory. Terraform's per-working-directory data, such as the current remote backend configuration, is saved in the TF DATA DIR variable. 1. [ ] `TF_WORKSPACE` > For multi-environment deployment, instead of using the 'terraform workspace select your workspace' command, the TF WORKSPACE environment variable can be used to select a workspace. It can't be used to'set' data for each working directory. 1. [ ] `TF_DATA` > There is no such ENVIRONMENT VARIABLE 1. [ ] `TF_DATA_WORKSPACE` > There is no such ENVIRONMENT VARIABLE # Which terraform command can be used to find the provider name being used in your code? 1. [ ] `terraform state` 1. [ ] `terraform apply` 1. [x] `terraform providers` > The terraform providers command is used to determine the name of the provider you're deploying. 1. [ ] `terraform plan` > https://www.terraform.io/docs/cli/commands/providers.html # Which command is used to launch terraform console? 1. [ ] `terraform apply -config` 1. [x] `terraform console` > terraform console [options] [dir]. This command allows you to evaluate and experiment with expressions using an interactive command-line console. 1. [ ] `terrafrom plan` 1. [ ] `terrafrom consul` > https://www.terraform.io/docs/cli/commands/console.html # What is the output of the below terraform function? ```terraform > index(["test", "dev", "prod"], "prod") ``` 1. [ ] -1 1. [x] 2 > Index outputs the values of the element index, for a given value in the list starting with 0. So here it is `test =0,dev =1, prod =2`. The syntax for the Index function in Terraform is as follows: index(list, value) 1. [ ] 1 1. [ ] 3 > https://www.terraform.io/docs/language/functions/index_function.html # Which command is used to print detailed schemas for the providers used in the current configuration. 1. [ ] Terraform providers > because the terraform providers command displays details about the configuration's provider requirements in the current working directory. 1. [x] Terraform providers Schema > The terraform providers schema command prints detailed schemas for the providers that are currently being used in the configuration. Because it is a direct command, all other responses are incorrect. 1. [ ] Terraform providers mirror > because the terraform providers mirror command downloads and copies the providers required for the current configuration into a local filesystem directory. 1. [ ] Terraform providers describe > because such a command does not exist. > https://www.terraform.io/docs/cli/commands/providers/schema.html # Which command from the list below would be best suited to replace a specific object even if no configuration changes are made in the code? 1. [ ] `terraform destroy` > because it would destroy the current resource and require the creation of new resources 1. [ ] `terraform taint` > because it used to happen in previous versions of Terraform, but the best command for the current version of Terraform is terraform replace. 1. [ ] `terraform state rm` > because this command is used to manipulate the state file. 1. [x] `terraform replace` > If your intent is to force replacement of a particular object even though there are no configuration changes that would require it, we recommend instead to use the -replace option with terraform apply. > https://www.terraform.io/docs/cli/commands/taint.html # You're a new DevOps engineer at your company, and you notice that terraform has been in use for a while. On the other hand, some resources on the AWS console were created manually. How do you add them to the terraform state where you're working right now? 1. [x] First, write the block resources to the Terraform configuration files, then do a terraform import of the resource written. Once the resource is imported, do a terraform plan, and then a terraform apply to keep the state updated > Writing the code for the resources you want to import on the Terraform configuration files is the correct way to go. After you've finished writing, you can import the resource. ``` Example: You want to import the AWS EC2 instance: i-0123456790 resource "aws_instance" "my_instances_imported" { add all configuration erraform import aws_instance.my_instances_imported i-01234567890 terraform plan terraform apply ``` 1. [ ] First, do a terraform import using the arn of the AWS resource. Then do a terraform plan and a terraform apply to keep the state updated. The terraform configuration files will be updated automatically after the terraform import > Incorrect as the terraform code is not added automatically into the terraform configuration files. Also, you don’t need to specify the AWS arn. 1. [ ] First, do a terraform import of the resource written. Once the resource is imported, do a terraform plan, and then a terraform apply to keep the state updated > C is incorrect because you have to write the terraform configuration files before to import from AWS 1. [ ] Write the resources into the Terraform configuration files. Do a terraform plan and a terraform apply to have the state updated > Incorrect because you are not importing, you are creating new resources if you write into the configuration files and don’t import the resources > Reference: https://www.terraform.io/cli/import/usage#import-usage # You want to evaluate a terraform expression before using it. How will you carry out this assessment? Choose from the options below. 1. [ ] Execute terraform Graph command or see the graph of the resources. 1. [ ] Execute terraform validate. 1. [x] On terraform console, validate the expression. > Use terraform console to execute & validate the expression. 1. [ ] Push the code to the repository. # The resource aws security group.allow vpn needs to be recreated. What is the most effective method for executing, destroying, and re-creating the resource? - [x] terraform taint aws_security_group.allow_vpn - [x] terraform -replace="aws_security_group.allow_vpn" - [ ] None of these answers are correct > Reference: https://www.terraform.io/cli/commands/taint # You're testing your infrastructure on your computer and saving the new configuration to a local state called local state.json. How can you use the new state version of your local machine to update the state that you already have in the S3 bucket defined in your backend configuration? 1. [ ] terraform pull state.json > because this flag doesn’t exist. Is a syntax error and we are pulling instead of pushing 1. [ ] terraform push state local_state.json >because syntax is incorrect. Should be terraform state push and not terraform push state 1. [x] terraform state push local_state.json > The command to push states files from local states to the backend configuration is terraform state push "local_state" 1. [ ] terraform state aws_s3 push local_state.json > the option aws_s3_push doesn’t exist > Reference: https://www.terraform.io/cli/commands/state/push#usage # terraform fmt is the way to rewrite terraform files to a canonical style for the current directory where it is executed. Which flag will process all the subdirectories as well? 1. [ ] terraform fmt * > Because of a syntax error 1. [ ] terraform fmt -directory=* > The flag -directory does not exist as part of the terraform fmt 1. [ ] terraform fmt -directory=all > The flag -directory does not exist as part of the terraform fmt 1. [x] terraform fmt -recursive > This also processes files in subdirectories if the -recursive flag is used. > Reference: ttps://www.terraform.io/cli/commands/fmt#usage # Which of the following command can be used to move debug logs to a folder name /tmp/mylab/test.logs? 1. [ ] export TF_LOG_FILE=/tmp/mylab/test.logs 1. [ ] export TF_debug_logfile = /tmp/mylab/test.logs 1. [ ] export TF_LOG_trace = /tmp/mylab/test.logs 1. [x] export TF_LOG_PATH = /tmp/mylab/test.logs # Debug is the most verbose log level in Terraform. 1. [ ] True 1. [x] False > Terraform's Trace log level is the most detailed. To change the verbosity of the logs, set TF LOG to one of the log levels TRACE, DEBUG, INFO, WARN, or ERROR. > Reference: https://www.terraform.io/docs/internals/debugging.html # Does `terrafrom validate` checks for the errors and upon terraform apply shows the debug output 1. [ ] True 1. [x] False # Community providers are downloaded automatically using terraform init command. True or False? 1. [ ] False 1. [x] True > The terraform init command can be used to automatically download any community provider from a Terraform registry. Community providers are set up similarly to other providers. Check Terraform 0.13 for guidelines. > https://www.terraform.io/docs/configuration/blocks/providers/index.html # Which of the following flags can be used with terraform apply command? 1. [x] auto-approve > The behavior of terraform apply differs significantly depending on whether you pass it the filename of a previously-saved plan file. The terraform apply command executes the actions proposed in a Terraform plan. -auto-approve: Skips interactive approval of the plan before applying. 1. [ ] init 1. [ ] get 1. [ ] console > https://www.terraform.io/docs/cli/commands/apply.html # The Terraform Configuration File is used to set per-user CLI behaviour settings across all Terraform working directories. Is it true or false? 1. [x] True > The Terraform configuration file specifies per-user CLI behaviour settings that are shared across all Terraform working directories. 1. [ ] False > https://www.terraform.io/docs/cli/config/config-file.html # What is the default number of concurrent operations supported by terraform apply command? 1. [ ] 100 1. [x] 10 > Terraform apply supports a maximum of 10 concurrent operations by default. -parallelism=n - Limits the number of concurrent operations. Terraform performs as it walks the graph; the default is 10. 1. [ ] 5 1. [ ] 1 > https://www.terraform.io/docs/commands/apply.html # Your colleague has created a resource group in azure manually. What will happen once you execute the terraform plan command? Select the correct answer. 1. [ ] Terrafrom plan will throw errors in the resources 1. [ ] Terraform plan shows ~ and updates everything 1. [ ] Terraform plan will show output to remove the manually created one 1. [x] Terrafrom plan will only show what is going to be configured but not anything manually configured > Terraform plan just creates a plan about the resource to be configured. In case, we execute terraform apply command, then terraform throws an error.

Some of the key features and functionality of the Terraform CLI include:

  1. Terraform commands: The Terraform CLI includes a range of commands for managing infrastructure resources, including init, plan, apply, destroy, and more.
  2. Plugins and providers: The Terraform CLI relies on plugins and providers to interact with different infrastructure services, such as AWS or Microsoft Azure. Plugins and providers are installed and managed using the terraform init command.
  3. Terraform modules: Modules are used to encapsulate infrastructure resources and make them reusable across different projects. Modules can be downloaded from public or private repositories and are managed using the terraform init command.
  4. Remote state management: Terraform supports remote state management, which enables teams to store state files in a remote location, such as a cloud storage bucket or a version control system.
  5. Variables and outputs: Terraform enables users to define variables and outputs, which can be used to parameterize infrastructure configurations and enable more flexible and scalable infrastructure management.
  6. Plugins and third-party integrations: The Terraform CLI supports a range of third-party integrations and plugins, including tools for testing, security, and compliance.

Overall, the Terraform CLI is a powerful tool for managing infrastructure as code, enabling teams to automate infrastructure management, reduce errors and downtime, and increase scalability and flexibility.