I want to get an autoscaling group name
variable in module_apps
and use it in other modules - for example module_init
. However when I try to run terraform plan
it does not work.
content of module_apps
resource "aws_autoscaling_group" "example"
{
name = "asg-ad"
}
output "asg_name"
{
value = "${aws_autoscaling_group.example.name}"
}
content of module_init
module "module_init"
{
source = "../module_apps"
asg_name = "${module.module_init.asg_name}"
}
Trying to run terraform plan
seems that it can't get the source module:
o:Get: file:///home/user/terraform/application/module_apps
o:Get: file:///home/user//terraform/application/module_init
o:Get: file:///home/user//terraform/application/module_elb
o:Get: file:///home/user//terraform/application/module_deloy
o:Get: file:///home/user/terraform/application/module_apps
o:Get: file:///home/user//terraform/application/module_init
o:Get: file:///home/user//terraform/application/module_elb
o:Get: file:///home/user//terraform/application/module_deloy
o:Get: file:///home/user//terraform/application/module_init
o:Get: file:///home/user//terraform/application/module_elb
o:Get: file:///home/user//terraform/application/module_deloy
o:Get: file:///home/user/terraform/application/module_apps
o:Get: file:///home/user//terraform/application/module_init
o:Get: file:///home/user//terraform/application/module_elb
o:Get: file:///home/user//terraform/application/module_deloy
o:Get: file:///home/user//terraform/application/module_init
o:Get: file:///home/user//terraform/application/module_elb
o:Get: file:///home/user//terraform/application/module_deloy
o:Get: file:///home/user/terraform/application/module_apps
o:Get: file:///home/user//terraform/application/module_init
o:Get: file:///home/user//terraform/application/module_elb
o:Get: file:///home/user//terraform/application/module_deloy
terraform apply
and not aterraform init
orterraform apply
?