Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 2


One remote backend configuration always maps to a single remote workspace.

Show Answer
Correct Answer: A

A

Reference:

https://www.terraform.io/docs/language/settings/backends/remote.html

Discussion

17 comments
Sign in to comment
Zam88Option: B
Jun 19, 2022

correct B

SpandropOption: B
Dec 16, 2023

1 workspace -> 1 backend 1 backend -> multiple workspaces

TigerInTheCloudOption: B
Dec 19, 2023

https://developer.hashicorp.com/terraform/language/settings/backends/remote "To use multiple remote workspaces, set workspaces.prefix to a prefix used in all of the desired remote workspace names. For example, set prefix = "networking-" to use Terraform cloud workspaces with names like networking-dev and networking-prod. This is helpful when mapping multiple Terraform CLI workspaces used in a single Terraform configuration to multiple Terraform Cloud workspaces."

luxdolorosaOption: B
Nov 15, 2023

I am working with GitLab, and I can create multiple instances within a single backend space

6957dbdOption: B
Mar 10, 2024

The prefix switch is key here: prefix - (Optional) A prefix used in the names of one or more remote workspaces, all of which can be used with this configuration. The full workspace names are used in Terraform Cloud, and the short names (minus the prefix) are used on the command line for Terraform CLI workspaces. If omitted, only the default workspace can be used. This option conflicts with name. To use multiple remote workspaces, set workspaces.prefix to a prefix used in all of the desired remote workspace names. For example, set prefix = "networking-" to use Terraform cloud workspaces with names like networking-dev and networking-prod. This is helpful when mapping multiple Terraform CLI workspaces used in a single Terraform configuration to multiple Terraform Cloud workspaces. The backend configuration requires either name or prefix. Omitting both or setting both results in a configuration error.

BereOption: B
Jul 27, 2023

1) Example using workspaces.name This example demonstrates the use of a single remote Terraform Cloud workspace by specifying the workspace name. terraform { ... workspaces { name = "networking-prod" } } } In this configuration, all the Terraform commands will be applied to the networking-prod workspace in Terraform Cloud. 2) Example using workspaces.prefix This example demonstrates the use of multiple remote Terraform Cloud workspaces that share a common prefix. terraform { ... workspaces { prefix = "networking-" } } } In this configuration, Terraform commands will apply to any workspace that starts with networking-, such as networking-dev, networking-prod, networking-test, etc. The specific workspace that the commands apply to is determined by the currently selected Terraform CLI workspace. You can switch between workspaces using the terraform workspace select command.

ledjoOption: B
Aug 29, 2023

B. A remote backend configuration is used to define where the Terraform state is stored, and it can be shared by multiple workspaces, each of which maintains its own separate state.

esuarveOption: B
Sep 29, 2023

Your explanation actually states that a remote backend can work with multiple similarly-named remote workspaces (like networking-dev and networking-prod) The answer A would not allow this

090200fOption: B
Jul 8, 2024

The remote backend can work with either a single remote HCP Terraform workspace, or with multiple similarly-named remote workspaces, so B is correct answer

Busi57Option: B
Jul 23, 2023

the correct answer B

JayanthOption: B
Jul 28, 2023

B. False

paromanu007Option: B
Aug 17, 2023

The remote backend can work with either a single remote Terraform Cloud workspace, or with multiple similarly-named remote workspaces (like networking-dev and networking-prod). The workspaces block of the backend configuration determines which mode it uses: Correct B

arnabsinha4uOption: B
Sep 18, 2023

correct B https://developer.hashicorp.com/terraform/language/settings/backends/remote#workspaces

NKSINGHOption: B
Nov 9, 2023

Correct B

liuyomzOption: B
Apr 23, 2024

B. prefix switching

hrajkumaOption: B
Jul 12, 2024

vote for B. False

purvakdevops91Option: B
Jul 22, 2024

Answer should be B False. Workspaces (offical documentation --> https://developer.hashicorp.com/terraform/language/settings/backends/remote#workspaces) The remote backend can work with either a single remote HCP Terraform workspace, or with multiple similarly-named remote workspaces (like networking-dev and networking-prod). The workspaces block of the backend configuration determines which mode it uses: To use a single remote HCP Terraform workspace, set workspaces.name to the remote workspace's full name (like networking-prod). To use multiple remote workspaces, set workspaces.prefix to a prefix used in all of the desired remote workspace names. For example, set prefix = "networking-" to use HCP Terraform workspaces with names like networking-dev and networking-prod. This is helpful when mapping multiple Terraform CLI workspaces used in a single Terraform configuration to multiple HCP Terraform workspaces.