Terraform assignment-1 by Bharath Srinivas

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

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

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