Practice Questions For Terraform Associate Certification Part - 2

Questions For Terraform Associate Certification

All the questions and answers are taken straight from their documentation. These are only practice questions.

We are not going to discuss any concepts here, rather, I just want to create a bunch of practice questions for this exam based on the curriculum provided here.

1). Expressions in provisioner blocks cannot refer to their parent resource by name. Is this true?

True

2). What does this symbol version = “~> 1.0” mean when defining versions?

Any version more than 1.0 and less than 2.0

3). Terraform supports both cloud and on-premises infrastructure platforms. Is this true?

True

4). Terraform assumes an empty default configuration for any provider that is not explicitly configured. A provider block can be empty. Is this true?

True

5). How do you configure the required version of Terraform CLI can be used with your configuration?

The required_version setting can be used to constrain which versions of the Terraform CLI can be used with your configuration. If the running version of Terraform doesn't match the constraints specified, Terraform will produce an error and exit without taking any further actions.

6). Terraform CLI versions and provider versions are independent of each other. Is this true?

True

7). You are provisioning the infrastructure with the command terraform apply and you noticed one of the resources failed. How do you remove that resource without affecting the whole infrastructure?

You can taint the resource ans the next apply will destroy the resource terraform taint

Use the Terraform CLI (outside of core workflow)

Practice questions based on these concepts

Given a scenario: choose when to use terraform fmt to format code

Given a scenario: choose when to use terraform taint to taint Terraform resources

Given a scenario: choose when to use terraform import to import existing

infrastructure into your Terraform state

Given a scenario: choose when to enable verbose logging and what the outcome/value is

8). What is command fmt?

The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style. This command applies a subset of the Terraform language style conventions, along with other minor adjustments for readability.

9). What is the recommended approach after upgrading terraform?

The canonical format may change in minor ways between Terraform versions, so after upgrading Terraform we recommend to proactively run terraform fmt on your modules along with any other changes you are making to adopt the new version.

10). What is the command usage?

terraform fmt [options] [DIR]

11). By default, fmt scans the current directory for configuration files. Is this true?

True By default, fmt scans the current directory for configuration files. If the dir argument is provided then it will scan that given directory instead. If dir is a single dash (-) then fmt will read from standard input (STDIN).

We have seen Practice Questions For Terraform Associate Certification Part - 2 . in the next post we will see more questions