in Education by
I am a little bit puzzled on the question of whether to commit .tfstate files to Git or not. The Terraform documentation states: Terraform also put some state into the terraform.tfstate file by default. This state file is extremely important; it maps various resource metadata to actual resource IDs so that Terraform knows what it is managing. This file must be saved and distributed to anyone who might run Terraform. We recommend simply putting it into version control since it generally isn't too large. Now, on the other hand, the accepted and upvoted answer on Best practices when using Terraformstates: Terraform config can be used to provision many boxes on different infrastructure, each of which could have a different state. As it can also be run by multiple people this state should be in a centralized location (like S3) but not git. (Emphasis by the original author, not by me) Who is right, and if so, why? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
In the recent updates of documentation of Terraform states that Terraform also puts some state into the terraform.tfstate file by default. This state file is extremely important; it maps various resource metadata to actual resource IDs so that Terraform knows what it is managing. This file must be saved and distributed to anyone who might run Terraform. It is generally recommended to set up a remote state when working with Terraform. This state is stored by default in a local file named "terraform.tfstate", but it can also be stored remotely, which works better in a team environment. The above quote of official docs says that remote state is still beneficial as a solo developer It allows the solo user to run terraform code for several devices and can have an easy backup and also segregates sections of their architecture. reference: https://www.terraform.io/docs/cli-index.html

Related questions

0 votes
    I am new at using Ansible. I tried to create directories and download files using Ansible. Should I use shell ... module is available? Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    Do I need to use separate Docker containers for my complex web application or I can put all required services in ... in one container? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    My git workspace is dirty, there are some local modifications. When I use the command git pull origin master it ... Ansible git module? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I have deleted a folder containing a running Vagrant box before realizing it was still running. How can I delete ... the Virtualbox VM. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I tried this: pip3 install --user --upgrade awscli pip3 --version I'm getting: pip 9.0.1 from /downloads/ ... not found. Please help. Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    I want to expose multiple ports to the machine’s interface. How to achieve this using a docker container? Please help. Select the correct answer from above options...
asked Jan 22, 2022 in Education by JackTerrance
0 votes
    Could someone tell me whether as a non-IT engineer could I shift my career to DevOps? Select the correct answer from above options...
asked Jan 6, 2022 in Education by JackTerrance
0 votes
    Could someone tell me how to start a DevOps career? Select the correct answer from above options...
asked Jan 6, 2022 in Education by JackTerrance
0 votes
    How will you find out what all files have been changed in a particular Git commit?...
asked Nov 4, 2020 in Technology by JackTerrance
0 votes
    I am setting up a common standalone-full.xml file for all server environments, and therefore need to have ... is greatly appreciated. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Let's say I have one variable, directory_list, which I define and set in a ruby_block named get_directory_list. Can ... woohoo" end end Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    Now that links are deprecated in docker-compose.yml (and were able to use the new networking feature to ... docker-compose.yml? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am successfully able to connect to a remote machine using SSH but when I am launching the agent from Jenkins ... overcome this issue? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I am successfully able to connect to a remote machine using SSH but when I am launching the agent from Jenkins ... overcome this issue? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I'm just getting my feet wet with Ansible 2.2 and Devops and I've run into the following problem. I have a ... . How to fix this? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
...