Skip to content

Commit

Permalink
added terraform module support
Browse files Browse the repository at this point in the history
  • Loading branch information
vijay patel committed Sep 20, 2019
1 parent 61bbfe2 commit acaf0ce
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
27 changes: 27 additions & 0 deletions terraform-module/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Demostration of pass agruments in module using variable
module "module-example" {
source = "github.com/Patelvijaykumar/terraform-aws-instance-template.git"

region = "${var.region}"
ami_id = "${var.ami_id}"
instance_type = "${var.instance_type}"
tag = "${var.tag}"

}

# # Demostration of pass agruments in module
# module "module-example" {
# source = "github.com/Patelvijaykumar/terraform-aws-instance-template.git"
#
# region = "us-east-1"
# ami_id = "ami-035b3c7efe6d061d5"
# instance_type = "t2.micro"
# tag = "module example"
#
# }



output "instance_public_ip_address"{
value="${module.module-example.instance_ip}"
}
15 changes: 15 additions & 0 deletions terraform-module/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
variable "region" {
default = "us-east-1"
}

variable "ami_id" {
default = "ami-035b3c7efe6d061d5"
}

variable "instance_type" {
default = "t2.micro"
}

variable "tag" {
default = "t2.micro"
}

0 comments on commit acaf0ce

Please sign in to comment.