Terraform Data Sources | How to Use Data Sources? - Part 12

preview_player
Показать описание
▬▬▬▬▬▬ ⭐️ Instruction guide ⭐️ ▬▬▬▬▬▬

Terraform data sources can be used to fetch information back from the Cloud service provider (AWS, Google Cloud, Azure etc..). Along with your terraform provisioning script you need to write the terraform data source resource block for creating the data sources.

Terraform data sources can help you to fetch -

1. Internal IP
2. External IP
3. Instance ID
4. Tags

and much more other information associated with your terraform resource which can help automate your infrastructure code.

In this lab session, we are going to create a Terraform Data source to fetch the public IP of an EC2 instance. But similar terraform script can be written for other cloud resources such as S3 Bucket, IAM Rule, etc.

▬▬▬▬▬▬ ⭐️ 🕘Timestamps ⭐️ ▬▬▬▬▬▬
0:00 What is Terraform Data Source?
2:44 How to write Terraform Data Source block?
06:57 Demo of Terraform Data source along with AWS EC2

Disclaimer/Policy: All the content/instructions are solely mine. The source is completely open-source.

Video is copyrighted and can not be re-distributed on any platform.
Рекомендации по теме
Комментарии
Автор

Excellent Video, not sure why the views are less, Perfect teaching, now i understand clearly about the data source

tarunsailguntupalli
Автор

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. 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.

pramodsakhare
Автор

This Playlist is awesome. Eagerly waiting for more topics. If possible please share a few demos over GCP as well.

vikaskhatri
Автор

Appreciate the playlist. Really helping me prepare for my interview

kushelg
Автор

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 :)

Devopsyed
Автор

Many thanks for great video, Simple and the Best

prasadrao
Автор

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.

rahulkumarshaw
Автор

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

mandlaanilbabu
Автор

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. :)😄😃

madhunallagarla
Автор

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]}, and there should be a better way I guess.

byronliu
Автор

Hey Why not use Output variables? than Data resource in this scenario

tirushv
Автор

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

karthik
Автор

can u please make a video on how we should handle keys in production environment

datainference
Автор

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.

gurpreetgill
Автор

can anyone tell me how to output list of ec2 instances of type t2.micro using data sources and filters, running on my aws account

nitmig
Автор

Could you please create a video on loops like count etc to create/refer multiple resources of same pattern .. Thanks very much for the videos

Midhunchowdary
Автор

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.

naanireddy
Автор

"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.

showripratury
Автор

Hi, how to increase ebs volume in terraform script?

nagamohan
Автор

Thanks for this video. It would have been wowww if you have explained where/how it is used...

thangamanikasi