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!

Enroll Now

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”
}

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x