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

json-output: Add output changes to plan logs #29312

Merged
merged 1 commit into from
Aug 6, 2021

Conversation

alisdair
Copy link
Member

@alisdair alisdair commented Aug 5, 2021

Extend the outputs JSON log message to support an action field (and make the type and value fields optional). This allows us to emit a useful output change summary as part of the plan, bringing the JSON log output into parity with the text output.

While we do have access to the before/after values in the output changes, attempting to wedge those into a structured log message is not appropriate. That level of detail can be extracted from the JSON plan output from terraform show -json.

Proposed for backport to 1.0.x, as I consider this to be a bug of omission (this message should have been omitted for plans) and it has narrow scope.

Extend the outputs JSON log message to support an `action` field (and
make the `type` and `value` fields optional). This allows us to emit a
useful output change summary as part of the plan, bringing the JSON log
output into parity with the text output.

While we do have access to the before/after values in the output
changes, attempting to wedge those into a structured log message is not
appropriate. That level of detail can be extracted from the JSON plan
output from `terraform show -json`.
@alisdair alisdair added json-output 1.0-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged labels Aug 5, 2021
@alisdair alisdair requested a review from a team August 5, 2021 19:34
@alisdair alisdair self-assigned this Aug 5, 2021
@alisdair alisdair merged commit 10e4314 into main Aug 6, 2021
@alisdair alisdair deleted the alisdair/json-output-planned-output-change branch August 6, 2021 14:10
@github-actions
Copy link

github-actions bot commented Sep 6, 2021

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.0-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged json-output
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants