Terraform contd..
- Lets create 3 security groups
- web security group: this should allow communications from anywhere (0.0.0.0/0) on tcp port 22 and 80
- app security group: this should allow all the communications within vpc range to port 8080 and 22
- db security group: this should allow all the communications with in vpc range to port 3306
- Manual creation
- Terraform aws provider has a resource for vpc security group Refer Here for documentation
- Now make changes in terraform template to create a websecurity group Refer Here and apply the template
- Now lets create app security group Refer Here for the changeset and apply the terraform template to create app security group
- Now lets create a db security group Refer Here for the changes
Exercise:
- Create a linux vm on any cloud (ubuntu )
- Install terraform
- Install aws cli
- Configure aws cli to use IAM Credentials
- initialize terraform and clone the git repo Refer Here
git clone https://github.com/asquarezone/TerraformZone.git
- Now execute the template Refer Here
Next Steps
- Creating an ec2 instances in app and web subnet
- Understanding taint and untaint
- Creating rds instance in db subnets
- Creating similar architecture in Azure
- Shared State/Remote Backends
- Terraform workspaces
- Packer
