Terraform: Terraform console - module interpolation not available

Created on 30 Jan 2017  ยท  3Comments  ยท  Source: hashicorp/terraform

Terraform Version

Terraform v0.8.5

Affected Resource(s)

terraform console > module

Terraform Configuration Files

terraform apply
aws_iam_user.user1: Refreshing state... (ID: me)
data.aws_subnet.default_subnet_a: Refreshing state...
module.vpc1.aws_vpc.vpc: Refreshing state... (ID: vpc-a48cc0c0)

terraform console
> aws_iam_user.user1.name
me
> data.aws_subnet.default_subnet_a.vpc_id
vpc-7953a81d
> module.vpc1.id
Couldn't find output "id" for module var: module.vpc1.id


Expected Behavior

module output value should be displayed

Actual Behavior

interpolation not accepted

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:
terraform console

module.vpc1.id
Couldn't find output "id" for module var: module.vpc1.id

bug core

All 3 comments

Hi @harkamals! Sorry this doesn't work as expected.

Just wanted to confirm: the module instantiated as module.vpc1 does have an output block named "id", right? This message seems to suggest that one doesn't exist.

If it does, it would be really helpful if you could share a cut down version of your config that exhibits this problem. For example, a root module that just contains the module "vpc1" block and the child module that just contains the output "id" block with some hard-coded value. If it works as expected with that minimal configuration then that would be useful information too!

Hi @harkamals!

Since I didn't hear back from you, I'm going to close this.

For reference if anyone else finds this in future: terraform console resolves expressions in the context of the root module, so only expressions that would be available in the configuration of the root module can be evaluated. In particular this means that only the outputs of child modules are accessible.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

phinze picture phinze  ยท  167Comments

radeksimko picture radeksimko  ยท  80Comments

nevir picture nevir  ยท  82Comments

phinze picture phinze  ยท  86Comments

lukehoersten picture lukehoersten  ยท  151Comments