Rahul, the main purpose of terraform data source is to read the resources created outside of terraform (Not in the same .tfstate file). If we create the resource using the same terraform file then we can read them directly e.g. value=aws-instance.myinstance.public_ip No need to go for data source. Or your intent was to create the resource outside of the terraform but you reduced the efforts and created using the same script? Correct me if I am wrong.
You mean outside of current configuration , we mostly use data source when we want to refer to the resources in other infra repos ( as we maintain different repo for each resource)
I had basic knowledge in terraform and always find difficulties to understand this to advance knowledge of terraform. You made it very simple .Good work keep it growing like this.
I am getting very much benefitted through your playlist. Examples are clear and very easy to understand.. would suggest to make a video of quick run up on certification questions, as there is fewer content on certifications aspect for Terraform. Thanks a lot :)
Noted. I will add to my checklist but to be honest the complete terraform playlist which i have prepared with the aim of sharing some practical knowledge and it will off course help you to get your terraform certification
Hi Sir, Thanks you for the video. I have small doubt for returning values we use data source but same this we can get through output also right? thank you
"myawsinstance" in the data section referring to which name? i mean already there a resource- EC2 instance created with the name "Ec2_example" in the previous section right? can you please clarify this point.
Excellent explanation with clear instructions. Thank you so much, Rahul. By the way, has anyone ever told you that you resemble Sundar Pichai? To me, you look just like him. :)😄😃
Question - How do you pass a parameter to aws lamda in terraform . Essentially I created aws managed active directory, I need to pass the directory_id as a parameter to aws lambda( created outside of terraform by some body) which creates aws log group and subscription. My question is how to pass the parameter to aws lambda using terraform with that parameter lambda executes
I have an vpc and subnet and I have a public IP in aws. I want to create an instance in the existing VPC and existing subnet and ec2 instance have attach my public Ip i have in aws. Could you please help me on that using terraform.
Hi rahul iam one of your subscriber learning terraform by watching your channel with that i have a question if we want to make changes in aws security group how can we do with terraform scripts? thanks in advance
Hi satish you can manage the aws security group but it is going to be a lot terraform script you need to write probably i could come up with some session. It would be really hard to explain everything in the comment section
Hi Rahul, Could you please help how to export data from one source to another using terraform with example( instead of AWS)? I am using commercetools with terraform in which import I run successfully.
Hi Rahul, thanks for the sharing. I'm using data source to fetch the instance ids. When I create cloudwatch dashboard and wanna refer to each values of data.aws_instances.XX.ids, how can I write the code? I use ${data.aws_instances.XX.ids[0]}, ${data.aws_instances.XX.ids[1]} and there should be a better way I guess.