Hands-on task
Terraform: variable and output
In /root/tf write a config with the local provider: a variable filename (defaulting to /opt/out/hello.txt) and a local_file resource that creates this file with the content hi. Add an output path that returns the path to the file. Run apply. 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
- variable
- output
- local_file
- terraform apply