Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 197

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.)

    Correct Answer: B, C

    To deploy the same Terraform code in the staging environment with a separate variable definition file and state file, you should write a new staging.auto.tfvars variable definition file and run Terraform with the var-file=”staging.auto.tfvars” flag. This ensures that different values are used for variables in the staging environment. Additionally, creating a new Terraform workspace for staging isolates the state, allowing separate state management for different environments while using the same code.

Discussion
Ni33Options: 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.

akm_1010Options: 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.

ozbeyucelOptions: BC

......

7b5b962

B. Terraform core Terraform core is responsible for reading the configuration, generating the execution plan, and applying the changes by interacting with the providers.

starksolutions

merci .

campsOptions: 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

nakikooOptions: BC

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