Terraform Remote State Storage - Day1
HTML-код
- Опубликовано: 18 сен 2024
- Terraform backend
- Backend are responsible for storing state and providing API for state locking.
- AWS S3 Bucket for terraform state storage.
- AWS DynamoDB for terraform state locking.
- Differences between Local state file and Remote state file.
- *Local State:* Multiple team members cannot update the infrastructure as they don't have access to state File. For which we need to store the state file in a share location.
- *Remote State:* If two teams are running Terraform at same time, you may run into *race conditions* as multiple Terraform proccess make concurrent updates to the state files, leading to conflicts, data loss, and state file corruption.
- To overcome above condition, state locking was added with the help of DynamoDB table.
- *Note:* All backends doesn't support State locking, AWS S3 supports state locking.
- State locking happends automatically on all operations that could write state.
- If state locking fails, Terraform will not continue.
- You can disable state locking for most commands with the *-lock* flag but it not receommended.
- If acquiring the lock file takes long time then expected, Terraform will output a status message.
- If terraform doesn't output a message, state locking is still occuring if your backend supports it.
- Terraform has a force-unlock command to manually unlock the state if unlocking failed.
Hi Sudheer sir,
Can we please get the rest of the videos uploaded too.
Your videos are so good in acquiring in-depth knowledge about the Devops technologies.
Please,Please continue uploading the other videos.
Yes, sure
Hi sir , I am interested
How can I help you?