Terraform Best Practices
- Refer Here for best practices
How enterprises use Terraform
- We write templates
- All the resusable templates are converted into modules and store in a registry
- Registry Options
- Terraform Cloud
- Jfrog
- Git
- Structure
template (folder)
|
---- providers.tf
---- main.tf # calling modules by passing values
- Security Scanning
terrascan
Terraform Registry (Public)
- Lets create a vpc, security group and an ec2 instance by using reusable community modules
- Refer Here for aws community modules
- Refer Here for changes done to use community modules
Terrraform Provisioners
- Refer Here for official docs
- Types
- file
- local-exec
- remote-exec
- Connection block: in this block we will pass credentials
- How to use provisioner in terraform to install nginx into ec2 instance.
- Refer Here for changes
