Terraform outputs are critical to understand when creating child modules that must return data to the parent modules. In this quick tutorial, I show an easy example that should make it easy to start using outputs in your child modules!
Can a child module call other child module, like so: root module -> child module -> child module? It this OK practice or something we should avoid doing?
Thanks for the video. If i have a for_each block how to take outputs from those and use them to create child resources. For example- i have to create folders and within that sub folders I have to create sub folders in some folders. How can i use known after apply values such as folder ids to create those sub folders. Thanks
great, q questoin imagien if yoou have 2 child modules, and yo want to send from child 1 to child 2 . Teorical will be like this Value= module.child1.child2.myoutpout, but of course child1.child2 does work, how can we do it , thanks
Having an issue and wondering if you mind helping? I am running an aws cli command through local-exec to pull the name of a snapshot for a redshift cluster and put that into a file. I am then trying to call the contents of that file with a data local_file and then use the snapshot name in a cluster build. It seems the data local_file is running before the local-exec, any pointers on how to get around this?
You can use this alias to make shortcuts for your commands: alias tf='terraform' alias tfa='terraform apply' alias tfc='terraform console' alias tfd='terraform destroy' alias tff='terraform fmt' alias tfg='terraform graph' alias tfim='terraform import' alias tfin='terraform init' alias tfo='terraform output' alias tfp='terraform plan' alias tfpr='terraform providers' alias tfr='terraform refresh' alias tfsh='terraform show' alias tft='terraform taint' alias tfut='terraform untaint' alias tfv='terraform validate' alias tfw='terraform workspace' alias tfs='terraform state' alias tffu='terraform force-unlock' alias tfwst='terraform workspace select' alias tfwsw='terraform workspace show' alias tfssw='terraform state show' alias tfwde='terraform workspace delete' alias tfwls='terraform workspace list' alias tfsls='terraform state list' alias tfwnw='terraform workspace new' alias tfsmv='terraform state mv' alias tfspl='terraform state pull' alias tfsph='terraform state push' alias tfsrm='terraform state rm' alias tfay='terraform apply -auto-approve' alias tfdy='terraform destroy -auto-approve' alias tfinu='terraform init -upgrade' alias tfpde='terraform plan --destroy' you have to put them under code . ~/bashrc when you type on this on your terminal it will open bashrc file and you could copy paste the commands and exit from instance and start using or without exit also could use them
Terraform outputs are critical to understand when creating child modules that must return data to the parent modules. In this quick tutorial, I show an easy example that should make it easy to start using outputs in your child modules!
Can a child module call other child module, like so: root module -> child module -> child module? It this OK practice or something we should avoid doing?
Nice one.. Got the concept on the first go watching this video! Cheers.
Great clear cut info! Thanks!
Great video. Thanks I was looking for this:)
Thanks for this video! Most of these tutorials out there show us how to print output variables but not do anything useful with them.
thanks for the useful information
Do you have any video about sending input parameters to the module?
Thanks for the video. If i have a for_each block how to take outputs from those and use them to create child resources.
For example- i have to create folders and within that sub folders I have to create sub folders in some folders. How can i use known after apply values such as folder ids to create those sub folders.
Thanks
thanks for your videos.. this is a huge help for beginners.. believe or not
great, q questoin imagien if yoou have 2 child modules, and yo want to send from child 1 to child 2 . Teorical will be like this Value= module.child1.child2.myoutpout, but of course child1.child2 does work, how can we do it , thanks
Having an issue and wondering if you mind helping? I am running an aws cli command through local-exec to pull the name of a snapshot for a redshift cluster and put that into a file. I am then trying to call the contents of that file with a data local_file and then use the snapshot name in a cluster build. It seems the data local_file is running before the local-exec, any pointers on how to get around this?
You could try making the data object dependent on the resource object by using 'depends_on'.
@@Wahlnetwork i did that still does the same thing
☹ That is a bummer. I have not made much use of provisioners - sorry!
I used to "terraform plan | terraform apply" commands. But you are using " tf plan | tf apply" how did you make short from "terraform" to "tf" ?
You can use this alias to make shortcuts for your commands:
alias tf='terraform'
alias tfa='terraform apply'
alias tfc='terraform console'
alias tfd='terraform destroy'
alias tff='terraform fmt'
alias tfg='terraform graph'
alias tfim='terraform import'
alias tfin='terraform init'
alias tfo='terraform output'
alias tfp='terraform plan'
alias tfpr='terraform providers'
alias tfr='terraform refresh'
alias tfsh='terraform show'
alias tft='terraform taint'
alias tfut='terraform untaint'
alias tfv='terraform validate'
alias tfw='terraform workspace'
alias tfs='terraform state'
alias tffu='terraform force-unlock'
alias tfwst='terraform workspace select'
alias tfwsw='terraform workspace show'
alias tfssw='terraform state show'
alias tfwde='terraform workspace delete'
alias tfwls='terraform workspace list'
alias tfsls='terraform state list'
alias tfwnw='terraform workspace new'
alias tfsmv='terraform state mv'
alias tfspl='terraform state pull'
alias tfsph='terraform state push'
alias tfsrm='terraform state rm'
alias tfay='terraform apply -auto-approve'
alias tfdy='terraform destroy -auto-approve'
alias tfinu='terraform init -upgrade'
alias tfpde='terraform plan --destroy'
you have to put them under code . ~/bashrc
when you type on this on your terminal it will open bashrc file and you could copy paste the commands and exit from instance and start using or without exit also could use them
alias tfplan='terraform plan'