# Invalid value for input variable : Module inter-depedency

**URL:** <https://discuss.hashicorp.com/t/invalid-value-for-input-variable-module-inter-depedency/44859>\
**Category:** Terraform\
**Created:** [September 27, 2022, 10:13pm UTC](https://discuss.hashicorp.com/t/invalid-value-for-input-variable-module-inter-depedency/44859 "2022-09-27T22:13:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaeypatel](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jaeypatel/32/24100_2.png) [@jaeypatel](https://discuss.hashicorp.com/u/jaeypatel)\
**Post date:** [September 27, 2022, 10:13pm UTC](https://discuss.hashicorp.com/t/invalid-value-for-input-variable-module-inter-depedency/44859/1 "2022-09-27T22:13:07Z")

</div>

Hi,

I’m trying to use output value of one child module as input variable of another child module using some of the examples provided by Hashicorp. But I keep getting following error:

 ![image](https://global.discourse-cdn.com/hashicorp/original/3X/9/6/96efbc86e6df92d09005d7fcfb5eeefe3a3d9556.png)

Code snippets:

root main.tf

module “shared\_vpc\_subnets” {  
source = “./modules/subnets”

module “shared\_vpc\_ram\_shares” {  
source = “./modules/ram”  
resource\_arn\_id = module.shared\_vpc\_subnets.subnet\_arn\_id

root variables.tf

variable “subnet\_arn\_id” {  
type = string  
description = “”  
}

/modules/subnets/main.tf

resource “aws\_subnet” “vpc\_subnet” {  
}

/modules/subnets/outputs.tf

output “subnet\_arn\_id” {  
value = “${aws\_subnet.vpc\_subnet.arn}”  
}

I alternatively tried using value = aws\_subnet.vpc\_subnet.arn to no luck.

/modules/ram/main.tf

resource “aws\_ram\_resource\_association” “ram\_shares” {  
resource\_arn = var.resource\_arn\_id  
resource\_share\_arn = aws\_ram\_resource\_share.ram\_shares.arn  
}

/modules/ram/variables.tf

variable “resource\_arn\_id” {  
type = string  
description = “”  
}

Looks like there is some conversion of variable happening/required but I can’t figure why. Please let me know if I should provide further data.

---

<div class="post-metadata">

**Author:** ![jbardin](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jbardin/32/3325_2.png) [@jbardin](https://discuss.hashicorp.com/u/jbardin)\
**Post date:** [September 28, 2022, 12:58pm UTC](https://discuss.hashicorp.com/t/invalid-value-for-input-variable-module-inter-depedency/44859/2 "2022-09-28T12:58:52Z")

</div>

Hi @jaeypatel,

The correct syntax for the output is

```auto
output "subnet_arn_id" {
  value = aws_subnet.vpc_subnet.arn
}

```

Though of course the string conversion shouldn’t be a problem here, since the expected type is a string anyway.

I don’t see what the problem could be from the limited example, perhaps making a standalone example would highlight the problem. One tool you can use here is to comment out the problematic assignment, and use the `terraform console` [`type` function](https://www.terraform.io/language/functions/type) to inspect the module output to see exactly what you are dealing with.
