Hands-on task
Terraform: two resources in one apply
In /root/tf describe two local_file resources: the first creates /opt/app/config.json with the content {"env":"prod"}, the second creates /opt/app/version.txt with the content 1.0. Run apply — both files must appear. There's no internet in the sandbox: only the hashicorp/local provider is available (it sits in a local mirror, terraform init will find it on its own). Write the config in the Editor tab (the /root/tf directory is already created) and run terraform in the terminal.
- terraform
- resource
- local_file
- string escaping
- jsonencode