How to create terraform modules? - Part 9

preview_player
Показать описание
▬▬▬▬▬▬ * Instruction's Guides * ▬▬▬▬▬▬

Terraform is an IaC(infrastructure as Code) framework for managing and provisioning the infrastructure but have you ever thought of creating only a single terraform configuration file for managing the complete cloud infrastructure.

Well, it sounds insane because if you only have a single file for managing the complete infrastructure then it will grow in complexity as well the line of configuration code will be manifold. That is why terraform introduced a concept of the module that will help you to organize your terraform configuration so that you can re-use the configuration and keep your terraform code more clean and more modular.

In this Lab session, we will create two modules module-1 and module-2. Inside each module, we will install the apache httpd server with each module is having its home page.

Steps for Creating the module -

1. Create your first module
2. Module structure
3. Calling the module
4. Module best practices
5. Benefits of Modules

▬▬▬▬▬▬ ⭐️ 🕘Timestamps ⭐️ ▬▬▬▬▬▬
0:00 Intro
0:21Terraform Module with example
2:59 Terraform Module project walkthrough
4:51 Download the private key from AWS
5:50 Module-1and Module-2 walkthrough
12:43 Run terraform module-1 and module-2
14:45 Verify the modules

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.

#devops #aws #cloud #ec2 #ssh #keys

8:51
Рекомендации по теме
Комментарии
Автор

Perfect Explanation in video, Step by step . Many thanks Rahul

prasadrao
Автор

I have question regarding while creating private module it is necessary to specify transform version. If we specify transform version again module what we are used with another provider has some compatibility issue what need to done. Thank your for this Terraform video series.

kube_cntrl
Автор

Very neat and clear explanation. Sir kindly please make a session on nested modules and how can we access/read the variable input/output values from one module to another. It will be a great great help for those who are struggling with terraform like me😄. Thanks in advance!!

rekhashetty
Автор

Clear explanation. Is there a complete terraform session with GCP ?

DG-cdjb
Автор

module was tough for me but now I got it very clearly thank you sir

rohanrustagi
Автор

Thanks for taking time to make such wonderful video tutorials. Highly Appreciated!

azeemqatar
Автор

Nice explanation. It would be more helpful "How Modules have exposed the output variables" ?

vedaanish
Автор

Hi Rahul,

Can you suggest how we can prevent or safe to existing resources in AWS which may or may note created from terraform to delete or destroy or replaced when we reuse modules to create new resources like suppose we have 100+ ec2 and we want to provision via ec2 modules and run terraform plan and apply then previous one will not impact /delete/replaced.

Appreciate for you suggestions.

Kk-rlnv
Автор

Neat and clear explanation. Could you please prepare video on plumini IAC as well.

harishphapale
Автор

hi Rahul, thanks for your hardwor. how to deside sequence of module

sambhajikhune
Автор

Simplified tutorial as always, however appreciate if you could be help me on one small issue :) 

While creating this, its throwing this error - "creating Security Group (sg1): InvalidGroup.Duplicate: The security group 'sg1' already exists for VPC 'vpc-0a6bfddfe1c57ec20'" .

Which makes sense as module1 created the same security group . So was thinking whats the workaround for this incase I dont like to crease seperate security groups for each module . Cheers !

RahulSharmaSingularity
Автор

hi rahul, we have prebuilt modules in hashicorp, like vpc module, there are public and private subnets default in vpc module, now if you want to ignore or you dont want to create private subnets how to do it ?

Rakesh-fcwr
Автор

The goal of modules is DRY principle, but here module-1 and module-2 are exactly the same leading to code duplication. can't we use only one module and customize the module-1 and module-2 as variables?

santhoshkb
Автор

very good explanation it is easy way to understand keeep thanks

senthilkumar
Автор

Thanks for creating an amazing video and keen to know what command did you use to reduce the display path. (check on this state 13:00)

SinghBalraj
Автор

Hi Rahul, Can you kindly make few videos on ‘CDKTF’ using TypeScript language

eswarteja
Автор

Hi Rahul, Love your work! However, sometimes you need to give another example for macOS users who rely on amazon Linux. For example, it failed to load up the website and I found it was because of the Ubuntu commands in the user_data. Also in the provisioners, mac users need to write ec2-user in the connections block but again that was not mentioned had to figure it out.

usheeg
Автор

You have not explained what is in variables.tf, outputs.tf file. If they don't contain anything please mention. Your web-page can explain that too.

samyweee
Автор

Sir how can we state count here example I want to launch module 1 with 3 instances can I do it?

sandv
Автор

Thanks a lot for wonderful video very much helpful for new learner’s 👌👌

MPC