Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 197 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 197
Topic #: 1
[All Terraform Associate Questions]

You have some Terraform code and a variable definitions file named dev.auto.tfvars that you tested successfully in the dev environment. You want to deploy the same code in the staging environment with a separate variable definition file and a separate state file.

Which two actions should you perform? (Choose two.)

  • A. Copy the existing terraform.tfstate file and save it as staging.terraform.tfstate
  • B. Write a new staging.auto.tfvars variable definition file and run Terraform with the var-file=”staging.auto.tfvars” flag
  • C. Create a new Terraform workspace for staging
  • D. Create a new Terraform provider for staging
  • E. Add new Terraform code (*.tf files) for staging in the same directory
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
7b5b962
5 months, 1 week ago
B. Terraform core Terraform core is responsible for reading the configuration, generating the execution plan, and applying the changes by interacting with the providers.
upvoted 1 times
...
starksolutions
11 months, 4 weeks ago
merci .
upvoted 1 times
...
akm_1010
1 year, 3 months ago
Selected Answer: BC
with a separate variable definition file :- Write a new staging.auto.tfvars variable definition file and run Terraform with the var-file=”staging.auto.tfvars” flag Want to deploy the same code in the staging environment with a separate state file :- Create a new Terraform workspace for staging. Workspaces isolate Terraform state.
upvoted 2 times
...
Ni33
1 year, 6 months ago
Selected Answer: BC
B and C are correct answers. same tfstate file can be used in multiple workspaces to provision infrastructure and each workspace has its own tfvar file matching workspace prefix.
upvoted 4 times
...
camps
1 year, 7 months ago
Selected Answer: BC
B. Write a new staging.auto.tfvars variable definition file and run Terraform with the var-file="staging.auto.tfvars" flag C. Create a new Terraform workspace for staging
upvoted 1 times
...
ozbeyucel
1 year, 9 months ago
Selected Answer: BC
......
upvoted 2 times
...
nakikoo
1 year, 10 months ago
Correct, workspace to use same .tf configuration with a different environment such as dev, prod, test, write new stage then refer the existing .tf config
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...