readyforhires

Intermediate Terraform test (Intermediate)

30 questions · 35 minutes · Free

Modules, remote state, workspaces and data sources.

Take the Intermediate Terraform test

What it covers

Interview format

Earn a certificate

The Intermediate Terraform test is one of the 8 tests of the DevOps Engineer: Intermediate learning path. Pass it and the other 7 tests at 70% or more and readyforhires issues you a verifiable certificate in your name, with its own code and verify link to share or add to LinkedIn.

Sample learning path certificate for DevOps Engineer: Intermediate, made out to “Your name” and marked SAMPLE
Pass with 70% or more to earn a verifiable certificate. This is a sample: yours carries your name, the date you earned it and its own verify code.

Sample questions

5 sample questions from the Intermediate Terraform test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.

  1. Which of the following is the correct way to reference a data source for tags in Terraform?

    1. data.aws_tag.example.tags
    2. data.aws_tagging.example.tags
    3. data.aws_tags.example.tags
    4. data.aws_resource_tag.example.tags

    Answer: A. data.aws_tag.example.tags

    The correct way to reference a data source for tags in Terraform is using `data.aws_tag.example.tags`, where `aws_tag` is the provider, `example` is the name of the data source, and `tags` is the attribute being accessed. Other options are either incorrect syntax or not valid data source attributes for tags.

  2. Which of the following statements correctly describes the difference between 'count' and 'for_each' in Terraform?

    1. 'for_each' is not supported in Terraform versions prior to 0.13, while 'count' has been available since the early versions.
    2. Both 'count' and 'for_each' can be used with any data type, including maps and lists.
    3. 'count' is more flexible than 'for_each' when handling dynamic data structures.
    4. The 'for_each' argument allows iteration over complex data structures such as maps and lists, while 'count' only supports integer values.

    Answer: D. The 'for_each' argument allows iteration over complex data structures such as maps and lists, while 'count' only supports integer values.

    'for_each' supports iteration over maps and lists, making it more flexible for handling dynamic and complex data structures. 'count' only allows integer values and is used for simple repetition of resources.

  3. Which of the following statements correctly describes the behavior of AzureRM data sources in Terraform?

    1. AzureRM data sources are used to update Azure resources.
    2. AzureRM data sources return read-only information and cannot be used to create or modify resources.
    3. AzureRM data sources can be used to create new Azure resources.
    4. AzureRM data sources are used to delete Azure resources.

    Answer: B. AzureRM data sources return read-only information and cannot be used to create or modify resources.

    AzureRM data sources are used to retrieve information about existing Azure resources, but they are not used to create or modify resources. This is a common misconception, as data sources are often confused with resource blocks. The other options incorrectly describe the behavior of AzureRM data sources.

  4. Which of the following is the correct choice when iterating over a list of objects with unique identifiers in Terraform?

    1. Neither Count nor for_each can be used for iterating over a list of objects with unique identifiers.
    2. for_each is the correct choice when iterating over a list of objects with unique identifiers.
    3. Both Count and for_each are equally suitable for iterating over a list of objects with unique identifiers.
    4. Count is the correct choice when iterating over a list of objects with unique identifiers.

    Answer: B. for_each is the correct choice when iterating over a list of objects with unique identifiers.

    for_each is designed for iterating over collections of objects where each item has a unique identifier, making it more suitable for dynamic values. Count is used for simple numeric iteration and does not support complex data structures as effectively.

  5. What is the behavior of Terraform Cloud regarding remote state locking during a run?

    1. Terraform Cloud does not support state locking and relies on manual intervention.
    2. Terraform Cloud automatically locks the state file when a run is in progress, preventing concurrent modifications.
    3. Terraform Cloud locks the state file only after the run completes successfully.
    4. State locking in Terraform Cloud is optional and only enabled by default in specific environments.

    Answer: B. Terraform Cloud automatically locks the state file when a run is in progress, preventing concurrent modifications.

    Terraform Cloud manages state locking automatically during runs to prevent conflicts. This ensures that only one Terraform process can modify the state at a time. Other options may describe incorrect behaviors, such as manual locking or lack of automatic locking.

Frequently asked questions

How many questions are in the Intermediate Terraform test?
30 questions (18 multiple choice, 12 multi-answer), with 35 minutes to answer them.
What does the Intermediate Terraform test cover?
Modules, Remote state and locking, Workspaces, Data sources, count and for_each.
Is the Intermediate Terraform test free?
Yes. It is free to take with a readyforhires account.
What level is the Intermediate Terraform test?
Intermediate, in DevOps & cloud.

More DevOps & cloud tests

Roles that test these skills

Companies that test these skills

All practice tests · All DevOps & cloud tests

Last updated