Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Feature: Show non-plan output #32

Closed
pecigonzalo opened this issue May 7, 2019 · 5 comments · May be fixed by #33
Closed

Feature: Show non-plan output #32

pecigonzalo opened this issue May 7, 2019 · 5 comments · May be fixed by #33
Labels
enhancement New feature or request

Comments

@pecigonzalo
Copy link

Can we add support so it does output the stuff that is not part of the plan text as is?

eg:

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.aws_iam_policy_document.assume_role: Refreshing state...
data.aws_iam_policy_document.login: Refreshing state...
data.aws_iam_policy_document.accounts: Refreshing state...

------------------------------------------------------------------------

[...]

------------------------------------------------------------------------

Note: You didn't specify an "-out" parameter to save this plan, so Terraform
can't guarantee that exactly these actions will be performed if
"terraform apply" is subsequently run.

This way we see immediate output of the plan running.

@pecigonzalo pecigonzalo changed the title Show non-plan output Feature:Show non-plan output May 7, 2019
@pecigonzalo pecigonzalo changed the title Feature:Show non-plan output Feature: Show non-plan output May 7, 2019
@dmlittle dmlittle added the enhancement New feature or request label May 9, 2019
@dmlittle
Copy link
Owner

dmlittle commented May 9, 2019

@pecigonzalo thanks for the feature suggestion!

The main goal of scenery is to show the output of a terraform plan execution in a clean and easy to digest manner. For that reason we strip everything outside of the plan output itself (such as refreshing state messages).

What's the main reasoning for wanting to display the rest of the text, is it purely to know that the terraform command is working as expected? I know that as terraform states get bigger and bigger, the command can take a lot longer just refreshing the state leaving you wondering if something has gone wrong. Currently scenery needs the entire output before being able to process it meaning we can't really show things as they happen in terraform. It is possible but it would require to change how it does the normalizing and parsing of the output into streams. It's possible but not trivial.

If the main reason for displaying the extra text is to know that terraform is running, would you be opposed as to having some sort of text or indicator showing that terraform is currently running and scenery is waiting for it to complete? I think there might be better way to answer the question that don't involve showing all the input text (after all we want to suppress it).

@pecigonzalo
Copy link
Author

Thanks for the extensive explanation, I actually wanted to expand on this. My use case is not only really about the status of the command starting (which would be helpful to add at least a "terraform is planning", altho it could be hard to correctly detect) but also other wrappers.
In our case, we wrap terraform output and command with a CLI helper, which has some custom sections before the terraform plan starts and we cant use this with scenery, or we have to hardcode scenery in our tool.
eg. wrapper terraform plan which does clean->init(set dynamic backend and etc)->load secrets->plan, when debugging or looking at IAM or other structures we locally might pipe it to scenery and we cant do it currently, so we have to do all manual when testing locally.

Hopefully this explains better the usecase, but in any case, I dont think changing the output you are not "improving" is a good idea.
As I could check, the plan starts on a ---- and ends on a ----, could we modify the behavior to only "buffer" when it detects that part?

@dmlittle
Copy link
Owner

Got it, that makes sense! We can probably add a flag (name tbd, maybe --full-output?) to do this. I'd welcome a PR implementing this functionality if you'd like to work on it. Otherwise I'll probably get to it eventually when I get some more free time to implement this feature.

@pecigonzalo
Copy link
Author

Ill give it a go as well when I have some free time.

@dmlittle
Copy link
Owner

dmlittle commented Mar 8, 2021

Scenery is not actively maintained and the repo will be archived momentarily. I no longer have the time to maintain this tool nor do I think it should be kept being used as Terraform 0.11 has been deprecated for over a year now (scenery can only parse Terraform 0.11 plan outputs). Terraform 0.14 has some plan output changes as well as introduced the concept of concise diff plan outputs which does most of what scenery currently does.

If you'd like to add new functionality as you cannot upgrade your terraform version feel free you fork the repo.

@dmlittle dmlittle closed this as completed Mar 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants