Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 164


What is the purpose of a Terraform workspace in either open source or enterprise?

Show Answer
Correct Answer: A

The primary purpose of a Terraform workspace is to manage collections of infrastructure in state files. Workspaces allow users to manage multiple sets of resources within the same configuration by maintaining separate state files for each workspace. This is particularly useful for managing different environments (e.g., development, staging, production) or different regions, where each workspace represents an independent instance of the infrastructure configuration. This helps avoid conflicts and enables isolated changes.

Discussion

9 comments
Sign in to comment
campsOption: A
Sep 30, 2024

A. Workspaces allow you to manage collections of infrastructure in state files. The purpose of a Terraform workspace, both in open source and enterprise, is to allow users to manage multiple "instances" of infrastructure within the same configuration codebase. Each workspace is a separate instance of a Terraform state file that can be managed independently. This means that a single Terraform configuration can be used to manage multiple sets of resources, with each set of resources represented by a separate workspace. Workspaces are useful when there is a need to manage multiple versions of the same infrastructure in the same configuration codebase, such as different environments (dev, staging, prod) or different regions. By creating a separate workspace for each instance of infrastructure, users can manage them independently without causing conflicts or overwriting state. Option B, C, and D are not correct. While workspaces may be used in conjunction with logical separation of business units, grouping multiple infrastructure security policies, or providing limited access to a cloud environment, they are not the primary purpose of workspaces in Terraform.

yogishrb2020Option: A
Apr 9, 2024

https://www.terraform.io/cloud-docs/workspaces

princajenOption: A
Aug 16, 2024

A. Workspaces allow you to manage collections of infrastructure in state files. The purpose of Terraform workspaces is to manage multiple state files for the same Terraform configuration. Workspaces provide a way to organize and isolate state files for different environments (e.g., development, staging, production) or different configurations (e.g., different regions, different sets of resources). Each workspace has its own copy of the state file, allowing changes to be made independently and preventing conflicts. Workspaces are available in both open source and Terraform Enterprise. Option B, C, and D are not accurate descriptions of the purpose of Terraform workspaces. Workspaces do not provide logical separation of business units, grouping of infrastructure security policies, or limited access to a cloud environment. These are functions of other Terraform Enterprise features, such as organizations, policy sets, and workspaces with role-based access controls.

Hizumi
Mar 13, 2024

Answer is A Working with Terraform involves managing collections of infrastructure resources, and most organizations manage many different collections. Reference: https://www.terraform.io/cloud-docs/workspaces (Refer to workspace contents)

SanderIsTheBestCloudShaper
Mar 14, 2024

hello , is this dump valid ? i see u really active can u answer me.

kashifhussain
Mar 17, 2024

I would like to know that as well please.

kashifhussain
Mar 17, 2024

I would like to know that as well please.

secdaddy
Jun 7, 2024

There is no discussion of business units in the documentation so (A) seems to make the most sense, based on these two sources both of which mention state : Terraform CLI workspaces are associated with a specific working directory and isolate multiple state files in the same working directory, letting you manage multiple groups of resources with a single configuration. https://developer.hashicorp.com/terraform/cloud-docs/workspaces The persistent data stored in the backend belongs to a workspace. The backend initially has only one workspace containing one Terraform state associated with that configuration. Some backends support multiple named workspaces, allowing multiple states to be associated with a single configuration. The configuration still has only one backend, but you can deploy multiple distinct instances of that configuration without configuring a new backend or changing authentication credentials. https://developer.hashicorp.com/terraform/language/state/workspaces

yaza
Apr 5, 2024

Selected Answer: B

yaza
Apr 5, 2024

becaue A is the correct of cli-workspace and not cloud workspace

BleHiOption: B
May 23, 2024

https://www.hashicorp.com/resources/why-consider-terraform-enterprise-over-open-source Terraform Enterprise provides a logical unit to break down infrastructure as code into workspaces.

macross
Jun 11, 2024

Workspaces in Terraform are simply independently managed state files. A workspace contains everything that Terraform needs to manage a given collection of infrastructure, and separate Workspaces function like completely separate working directories. We can manage multiple environments with Workspaces. Answer A

InformationOverloadOption: A
Jun 29, 2024

A workspace is a logical separation of resources within the same configuration. Workspaces allow you to manage multiple environments, such as production, staging, and development, within the same configuration and state file. I will go for A here.