Thanks for the video. It's clear and understandable. Is it also possible to pass a powershell script. eg. ps1 In place of the .sh in your video demonstration?
but we can do the same using remote-exec also right ? where my script having installation step will be executed while setting up EC2 instance .. can you please clarify ?
Here is my answer Terraform's user_data argument allows you to provide data to the instance at launch time, typically used to run scripts or set configuration on the instance. This data is passed to the instance in the form of a script, which is executed by the cloud-init process on the instance. The remote-exec provisioner in Terraform allows you to execute commands on a running resource after it has been created. This can be useful for running scripts or making configuration changes on the instance after it has been launched. Unlike user_data, the remote-exec provisioner requires a connection to the running instance in order to execute commands. In summary, user_data is used to configure the instance at launch time and remote-exec is used to configure the instance after it has been launched.
@@RahulWagh , Thanks for Terraform series. But, I am also bit confused between files, remote_exec and user_data. Could you please help us to differentiate between them, when to use them
How we can use user_data for for window instance. I am trying to create directory and pull the zip file from s3 to new instance the user data is not working. Please help
No user_data should always work irrespective of public and private subnet. May you are trying to access the ec2 present in the private subnet from outside of awe ?
Hello Rahul, thanks for the video. One quick question how we can achieve restart and resume in terraform along with this? e like I have to install IIS feature and do restart. then proceed to deploy application. Any thoughts? would be appreciated. Thank you
Hi Rahul, First of all I would like say Thanks to you, for such a wonderful terraform series you made and sharing in public, Thanks alot. I have one query, while spin up virtual machine does the ssh keys could save automatically in key vault? Is there any possibilities? Off course I'm spinning up vms through IAC (terraform).
Hey rahul, the apache2 was only able to work on port 80, not port 443. I tried so many ways yet It would not work and I did follow every single step of yours.
Hi @rahul Person having 3+ IT experience ,planning to switch domain to DevOps ,if he refers and practice all this 23 part session will it be sufficient?
Devops is too big to cover in 23 sessions but I promise these sessions will help you get started and put in a commanding situation to tackle new things
Sir these 23 videos of terraform is more than enough for fresher to crack the interview?????? Please reply sir , as I am a fresher I want to add terraform in my resume...
My doubt is how do i pass both the file and script. I requirement to install nginx and add some configuration for the upstream servers. How can i achieve that? @RahulWagh
@@RahulWagh Thanks for your reply. But, fortunately I found the below config working. user_data = /tmp/default < some shell scripts > EOF Would like to know if the same works for you. Just my curiosity 😄
Hi bro, your videos are awesome I have one doubt considering the scenario one client wants eks managed node and another one client wants self managed node before terraform apply user wants to decide which node you want to create , all should be in module Give me some examples about this
For self managed nodes you need to rely on user_data module so that you can write the script to provision the self managed nodes . But for eka managed nodes I guess there should terraform HCL which you can use to provision here is the reference- registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group
Thanks for showing how to insert user_data using file() function in Terraform. For some reason just writing it using 'EOF' did not work for me, some nonsense error was thrown in the logs that I did not declare Shebang symbol, even though it existed.
All the 23 videos on terraform are sufficient enough for you to start working on terraform. But there is as such no number because still there are a lot of topics which can be documented on terraform
Thanks Rahul . Just file function used to execute the script inside the EC2 instance . where file provisioner is used to just copy the files.
Hi Bro, your videos too good, very informative, please do videos on Devops tools also
I will try my best
Thanks for the video. It's clear and understandable. Is it also possible to pass a powershell script. eg. ps1 In place of the .sh in your video demonstration?
but we can do the same using remote-exec also right ? where my script having installation step will be executed while setting up EC2 instance .. can you please clarify ?
Here is my answer
Terraform's user_data argument allows you to provide data to the instance at launch time, typically used to run scripts or set configuration on the instance. This data is passed to the instance in the form of a script, which is executed by the cloud-init process on the instance.
The remote-exec provisioner in Terraform allows you to execute commands on a running resource after it has been created. This can be useful for running scripts or making configuration changes on the instance after it has been launched. Unlike user_data, the remote-exec provisioner requires a connection to the running instance in order to execute commands.
In summary, user_data is used to configure the instance at launch time and remote-exec is used to configure the instance after it has been launched.
@@RahulWagh , Thanks for Terraform series. But, I am also bit confused between files, remote_exec and user_data. Could you please help us to differentiate between them, when to use them
Excellent explanation - thank you
How we can use user_data for for window instance. I am trying to create directory and pull the zip file from s3 to new instance the user data is not working. Please help
I have a question that if the ec2 instance located in a private subnet without a public ip, it seems user_data does not execute the script.
No user_data should always work irrespective of public and private subnet. May you are trying to access the ec2 present in the private subnet from outside of awe ?
Hello Rahul, thanks for the video.
One quick question how we can achieve restart and resume in terraform along with this?
e
like I have to install IIS feature and do restart. then proceed to deploy application. Any thoughts? would be appreciated. Thank you
Amazing, that was really helpful, thank you (Y)
Cheers
Hi Rahul,
First of all I would like say Thanks to you, for such a wonderful terraform series you made and sharing in public, Thanks alot.
I have one query, while spin up virtual machine does the ssh keys could save automatically in key vault? Is there any possibilities? Off course I'm spinning up vms through IAC (terraform).
No SSH keys does not get save automatically in vault you have to handle it manually
Hey rahul, the apache2 was only able to work on port 80, not port 443. I tried so many ways yet It would not work and I did follow every single step of yours.
Hi @rahul
Person having 3+ IT experience ,planning to switch domain to DevOps ,if he refers and practice all this 23 part session will it be sufficient?
Devops is too big to cover in 23 sessions but I promise these sessions will help you get started and put in a commanding situation to tackle new things
Good session
Glad to know it is helpful for you
Hi , when I run a script it is getting executed as root user using user_data on new instance, is there any way I can execute as normal user.?
please add terraform functions like demostrate Terraform functions and use case as well
Surely i will add to my todo list
how to use variables in AWS EC2 userdata when deploying with terraform
Sir these 23 videos of terraform is more than enough for fresher to crack the interview??????
Please reply sir , as I am a fresher I want to add terraform in my resume...
I learn promotheus from your website's jhook
I am really glad to know that jhooq helped you to learn Prometheus
Hi Rahul Did you teach Terraform?
HyRahul. Is it a complete terraform playlist or more videos to come.
For getting yourself started with terraform this series is more then enough.
But there will be more similar sessions in upcoming weeks
Please can you make video on k8s deployments cicd Gitlab on aws eks
I can add into my list of todo hopefully I will prepare something around it soon
@@RahulWagh please do , thanks
My doubt is how do i pass both the file and script. I requirement to install nginx and add some configuration for the upstream servers. How can i achieve that? @RahulWagh
You can not pass both script and file using user-data.
Use user-data only for script part and file provisioners for file transfer
@@RahulWagh Thanks for your reply. But, fortunately I found the below config working.
user_data = /tmp/default
< some shell scripts >
EOF
Would like to know if the same works for you. Just my curiosity 😄
Hi bro, your videos are awesome
I have one doubt considering the scenario one client wants eks managed node and another one client wants self managed node before terraform apply user wants to decide which node you want to create , all should be in module
Give me some examples about this
For self managed nodes you need to rely on user_data module so that you can write the script to provision the self managed nodes .
But for eka managed nodes I guess there should terraform HCL which you can use to provision here is the reference- registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group
It is hard to explain everything in comments
@@RahulWagh thank you for your response anyway when you got time you can make separate video for this
Thanks for showing how to insert user_data using file() function in Terraform. For some reason just writing it using 'EOF' did not work for me, some nonsense error was thrown in the logs that I did not declare Shebang symbol, even though it existed.
you need to use
Please make video and use case on gitlabs or argoCD to deploy application on GCP thanks
How many concepts/videos are left to complete terraform playlist
All the 23 videos on terraform are sufficient enough for you to start working on terraform. But there is as such no number because still there are a lot of topics which can be documented on terraform
@Rahul Wagh is it sufficient to sit in an interview?