Terraform assignment-1 by Bharath Srinivas
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
provider “aws” {
region = “ap-south-1”
access_key = “”
secret_key = “”
}
provider “github” {
token = “”
organization = “”
}
variable “instance_count” {
type = number
description = “This is for demo of number variable”
default = 2
}
variable “users” {
type = “list”
default = [“bharath”, “sharath”, “nikhil”]
description = “This is for demo of list variable”
}
variable “amis” {
type = “map”
default = {
“us-east-1” = “ami-“
“us-west-2” = “ami-“
}
}
variable “reponame” {
type = string
description = “This is for demo of string variable”
default = “terraform”
}
resource “aws_iam_user” “iamuser” {
name = “${var.users[0]}”
}
resource “github_repository” “new” {
name = “${var.reponame}”
private = false
}
resource “aws_instance” “example” {
ami = var.amis[var.region]
instance_type = “t2.micro”
}