File tree 2 files changed +42
-0
lines changed
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments