Practice Free Terraform Associate 004 Exam Online Questions
Question #91
Which of these are features of HCP Terraform/Terraform Cloud? (Pick the 2 correct responses)
- A . Automatic backups of configuration and state.
- B . Remote state storage.
- C . Automated infrastructure deployment visualization.
- D . A web-based user interface (UI).
Correct Answer: B,D
B,D
Explanation:
Terraform Cloud provides features like remote state storage and a web-based user interface for managing your Terraform runs. While it offers robust infrastructure as code capabilities, automatic backups of configuration and state are not directly provided by Terraform Cloud; instead, the state is stored remotely and secured.
Reference: Terraform Cloud Features
B,D
Explanation:
Terraform Cloud provides features like remote state storage and a web-based user interface for managing your Terraform runs. While it offers robust infrastructure as code capabilities, automatic backups of configuration and state are not directly provided by Terraform Cloud; instead, the state is stored remotely and secured.
Reference: Terraform Cloud Features
Question #92
You are creating a reusable Terraform configuration and want to include an optional billing_dept tag so your Finance team can track team-specific spending on resources.
Which of the following billing_dept variable declarations will achieve this?
- A . variable "billing_dept" { type = default}
- B . variable "billing_dept" { default =}
- C . variable "billing_dept" { type = optional(string)}
- D . variable "billing_dept" { optional = true}
Correct Answer: C
C
Explanation:
Rationale for Correct Answer
To make a variable optional, you define a type that allows omission. Using optional(string) indicates the input may be unset (commonly used when the variable is part of an object type, or when you want to explicitly model optionality). This supports reusable configs where the tag is included only when provided.
Analysis of Incorrect Options (Distractors):
A: Invalid syntax―type = default is not a valid type declaration.
B: Invalid syntax―default must have a value.
D: Invalid―there is no optional = true argument for variable blocks. Key Concept: Input variable type constraints and optional inputs.
Reference: Terraform Objectives ― Read, Generate, and Modify Configurations (variables, types, and reusable configuration patterns).
C
Explanation:
Rationale for Correct Answer
To make a variable optional, you define a type that allows omission. Using optional(string) indicates the input may be unset (commonly used when the variable is part of an object type, or when you want to explicitly model optionality). This supports reusable configs where the tag is included only when provided.
Analysis of Incorrect Options (Distractors):
A: Invalid syntax―type = default is not a valid type declaration.
B: Invalid syntax―default must have a value.
D: Invalid―there is no optional = true argument for variable blocks. Key Concept: Input variable type constraints and optional inputs.
Reference: Terraform Objectives ― Read, Generate, and Modify Configurations (variables, types, and reusable configuration patterns).
