What is the workflow for deploying new infrastructure with Terraform?
Correct Answer:
A
This is the workflow for deploying new infrastructure with Terraform, as it will create a plan and apply it to the target environment. The other options are either incorrect or incomplete.
HashiCorp Configuration Language (HCL) supports user-denned functions.
Correct Answer:
B
HashiCorp Configuration Language (HCL) does not support user-defined functions. You can only use the built-in functions that are provided by the language. The built-in functions allow you to perform various operations and transformations on values within expressions. The general syntax for function calls is a function name followed by comma-separated arguments in parentheses, such as max(5, 12, 9). You can find the documentation for all of the available built-in functions in the Terraform Registry or the
Packer Documentation, depending on which tool you are using. References = : Functions - Configuration Language | Terraform : Functions - Configuration Language | Packer
You cannot install third party plugins using terraform init.
Correct Answer:
B
You can install third party plugins using terraform init, as long as you specify the plugin directory in your configuration or as a command-line argument. You can also use the terraform providers mirror command to create a local mirror of providers from any source.
You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.
Which of these is the correct way to define the output value?
A)
B)
C)
D)
Correct Answer:
D
Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?
Correct Answer:
A
This command will initialize the new backend and prompt you to migrate the existing state file to the new location4. The other commands are not relevant for this task.