Why should you replace `null_resource` with `terraform_data`?
BeginnerScenarioSecrets Provisioners and Policy as Code
Answer
Situation read → Old modules use the null provider for hooks.
What I'd do →
- Switch to the built-in
terraform_dataresource (Terraform 1.4+). - Use
triggers_replaceinstead oftriggers. - Migrate with a
movedblock where supported, or recreate since it has no real infrastructure.
Why → It needs no extra provider download and can store input and output values.
Interview tip → It's a small thing that shows you keep up with the language.
More on Secrets Provisioners and Policy as Code
A developer hardcodes a DB password in `terraform.tfvars` and commits it. What do you do right now, and what's the long-term fix?BeginnerHow do you avoid Terraform persisting a secret in state when creating a secret in AWS Secrets Manager?AdvancedSomeone wants a `remote-exec` provisioner to configure servers after creation. What's your advice?BeginnerYou must run a one-off command after a resource is created, such as registering with an external system.IntermediateHow do you generate and manage the master password for a new RDS instance?IntermediateCompare Sentinel, OPA/Conftest and Checkov for policy as code.Intermediate