Document

SUBSCRIBE TO GET FULL ACCESS TO THE E-BOOKS FOR FREE 🎁SUBSCRIBE NOW

Professional Dropdown with Icon

SUBSCRIBE NOW TO GET FREE ACCESS TO EBOOKS

Category Uncategorized

Terraform IAM

Terraform IAM     Resource: aws_iam_group_policy Provides an IAM policy attached to a group. Example Usage resource “aws_iam_group_policy” “my_developer_policy” { name = “my_developer_policy” group = aws_iam_group.my_developers.name # Terraform’s “jsonencode” function converts a # Terraform expression result to valid JSON syntax.…

Terraform RDS

Terraform RDS    RDS resource “aws_db_instance” “default” { allocated_storage = 10 engine = “mysql” engine_version = “5.7” instance_class = “db.t3.micro” name = “mydb” username = “foo” password = “foobarbaz” parameter_group_name = “default.mysql5.7” skip_final_snapshot = true allocated_storage = 20 max_allocated_storage =…

Terraform Workspace

Terraform Workspace   Terraform worksapces is a very logical concept where you can have multiple states of your infrastructure configuration. To put this in simple words if you are running an infrastructure configuration in development environment then the same infrastructure can…

Terraform Provisioner

Terraform Provisioner     Terraform Provisioners Provisioners are used to performing certain custom actions and tasks either on the local machine or on the remote machine. File Provisioner Example1(Amazon EC2) – Upload the file to an EC2 instance provider “aws”…

Terraform ELB

Terraform ELB     provider “aws” {  region = “us-east-1”}resource “aws_instance” “myFirstInstance” {    ami = “ami-05fa00d4c63e32376”    instance_type = “t2.micro”    key_name= “newkey”    vpc_security_group_ids = [aws_security_group.main.id]    count=2    tags = {      “Name” = “UserData command…

Terraform-EBS Volume

Terraform-EBS Volume     Create EBS Volume provider “aws” {   region     = “us-east-1”   }resource “aws_ebs_volume” “ebsvolume” {  availability_zone = “us-east-1d”  size = 1  encrypted = false  tags = {    Name = “raman test vol”  }}   Attach…

Terraform DataSource

Terraform DataSource     Terraform Data Sources Terraform Data Sources are a kind of an API that fetches the data/information from the resources running under the cloud infra and sending it back to terraform configuration for further use. filter: Although we…

Terraform conditional statements

Exmaple :- Create a EC2 instance if the env is prod provider”aws” { region =”us-east-1″ } variable”env” { default=”prod” } resource”aws_instance””name” { ami =var.ami instance_type=var.instance_type count = “${var.env==”prod” ? 1 :0}” }

Terraform Loops (for, for each)

Terraform Loops (for, for each)      1. Loops with count As the name suggests we need to use count but to use the count first we need to declare collections inside our terraform file. Let’s create a collection variable of type list(string) – variable “user_names” {…