What do you need to know about Terraform state in relation to security?
Experience Level: Junior
Tags: Terraform
Answer
Terraform writes the backend configuration in plain text to terraform.tfstate file.
It can contain sensitive information and credentials.
For that reason it is important to keep the state protected.
You shouldn't store credentials and other sensitive data hardcoded in configuration.
Related Terraform job interview questions
What is stored in .terraform folder?
Terraform JuniorWhat is a default backend in Terraform?
Terraform JuniorWhat is a name of file that Terraform CLI uses for storing local state?
Terraform JuniorYou modified your Terraform configuration and removed the remote backend from main.tf file. Whan happens with Terraform state?
Terraform JuniorYou modified your Terraform configuration and switched from local backend to remote backend by modifying main.tf file. What do you need to migrate the local state to the remote backend?
Terraform Junior