Skip to content

Commit acaf0ce

Browse files
author
vijay patel
committed
added terraform module support
1 parent 61bbfe2 commit acaf0ce

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

Diff for: terraform-module/main.tf

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Demostration of pass agruments in module using variable
2+
module "module-example" {
3+
source = "github.com/Patelvijaykumar/terraform-aws-instance-template.git"
4+
5+
region = "${var.region}"
6+
ami_id = "${var.ami_id}"
7+
instance_type = "${var.instance_type}"
8+
tag = "${var.tag}"
9+
10+
}
11+
12+
# # Demostration of pass agruments in module
13+
# module "module-example" {
14+
# source = "github.com/Patelvijaykumar/terraform-aws-instance-template.git"
15+
#
16+
# region = "us-east-1"
17+
# ami_id = "ami-035b3c7efe6d061d5"
18+
# instance_type = "t2.micro"
19+
# tag = "module example"
20+
#
21+
# }
22+
23+
24+
25+
output "instance_public_ip_address"{
26+
value="${module.module-example.instance_ip}"
27+
}

Diff for: terraform-module/variables.tf

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
variable "region" {
2+
default = "us-east-1"
3+
}
4+
5+
variable "ami_id" {
6+
default = "ami-035b3c7efe6d061d5"
7+
}
8+
9+
variable "instance_type" {
10+
default = "t2.micro"
11+
}
12+
13+
variable "tag" {
14+
default = "t2.micro"
15+
}

0 commit comments

Comments
 (0)