Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform show from plan should show module details #21949

Closed
mattlawnz opened this issue Jul 1, 2019 · 4 comments
Closed

terraform show from plan should show module details #21949

mattlawnz opened this issue Jul 1, 2019 · 4 comments

Comments

@mattlawnz
Copy link

Current Terraform Version

Terraform v0.12.3
+ provider.aws v2.17.0

Use-cases

We are creating plans from our terraform files, which we are wanting to put into a git repo as human readable text. In order to get this in a human readable format, we are doing a "terraform show plan.tfplan"
Where we have terraform modules involved, the terraform show command from the precreated t.tfplan only shows the module summary lines instead of any details

e.g.

terraform show t.tfplan
  + module.db.module.db_instance.aws_db_instance.this[0]

  ? module.db.module.db_parameter_group.aws_db_parameter_group.this[0]

  ? module.db.module.db_subnet_group.aws_db_subnet_group.this[0]

Attempted Solutions

I think I found a way around, but its a bit clumsy at present

terraform12 plan -no-color > plan.txt

and then reading and importing that into git

Proposal

Would like options to be able to show module details.

References

@mildwonkey
Copy link
Contributor

Hi @mattlawnz, thank you for opening this enhancement request !

Can you please share some more information about what exact module details you are looking for, or what you'd like the output to look like?

You might be able to get the information you want from the output of terraform show -json plan.tfplan, which includes the plan, current state, and configuration.

@mattlawnz
Copy link
Author

Hi

Thanks for the response, you're right, I can get the output using that.
I was looking for a more human readable format that contains the details for the modules.
We would like to put the output into a git pull request in a human readable format.
If the plan doesn't contain any modules, we can create this human readable plan using our current method. If it does contain modules, it gets a bit messy

@apparentlymart
Copy link
Contributor

This was a bug, and was fixed in #23292. The fix should be included in the next minor release. Thanks for reporting this, @mattlawnz!

@ghost
Copy link

ghost commented Mar 29, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants