nerdexam
Fortinet

NSE7_PBC-7.2 · Question #47

Refer to Exhibit. After the initial Terraform configuration in Microsoft Azure, the terraform plan command is run. Which two statements about running the plan command are true? (Choose two.)

The correct answer is C. You must run the terraform init command once, before the terraform plan command D. The terraform plan command makes terraform do a dry run. A is incorrect because the terraform plan command will not deploy any resources at all. It will only show the changes that would be made if the terraform apply command was run. The error message in the exhibit indicates that the service principal details are invalid, which…

FortiGate-VM in Public Cloud

Question

Refer to Exhibit. After the initial Terraform configuration in Microsoft Azure, the terraform plan command is run. Which two statements about running the plan command are true? (Choose two.)

Exhibit

NSE7_PBC-7.2 question #47 exhibit

Options

  • AThe terraform plan command will deploy the rest of the resources except the service principle
  • BYou cannot run the terraform apply command before the terraform plan command.
  • CYou must run the terraform init command once, before the terraform plan command
  • DThe terraform plan command makes terraform do a dry run.

How the community answered

(27 responses)
  • A
    19% (5)
  • B
    7% (2)
  • C
    74% (20)

Explanation

A is incorrect because the terraform plan command will not deploy any resources at all. It will only show the changes that would be made if the terraform apply command was run. The error message in the exhibit indicates that the service principal details are invalid, which means that Terraform cannot authenticate to Azure and cannot create any resources. B is incorrect because you can run the terraform apply command without running the terraform plan command first. The terraform apply command will automatically generate a new plan and prompt you to approve it before applying it. However, running the terraform plan command first can help you preview the changes and avoid any unwanted or unexpected actions. C is correct because you must run the terraform init command once before the terraform plan command. The terraform init command initializes a working directory containing Terraform configuration files. It downloads and installs the provider plugins required for your configuration, such as the Azure provider. It also creates a hidden directory called .terraform to store the plugin binaries and other metadata. Without running the terraform init command, the terraform plan command will fail because it cannot find the required plugins or modules. D is correct because the terraform plan command makes Terraform do a dry run. A dry run is a simulation of what would happen if you executed a certain action, without actually performing it. The terraform plan command creates an execution plan, which is a description of the actions that Terraform would take to make your infrastructure match your configuration. The execution plan shows you what resources will be created, modified, or destroyed, and what attributes will be changed. The execution plan does not affect your infrastructure or state file until you apply it with the terraform apply command.

Topics

#Terraform#terraform plan#terraform init#dry run

Community Discussion

No community discussion yet for this question.

Full NSE7_PBC-7.2 Practice