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: Extended detail for unknown outputs #31235

Merged
merged 1 commit into from Jun 17, 2022

Commits on Jun 13, 2022

  1. json-output: Extended detail for unknown outputs

    Planned output changes are represented in the JSON output format using
    the same change object as planned resource changes. This structure
    includes an `after` value and a parallel `after_unknown` value, which
    can be combined to determine which specific parts of a value are known
    only at apply time.
    
    Previously, structured output values would be marked in the JSON plan as
    coarsely known or unknown, even if only some subset of the structure
    will be known only at apply time. This simplification was unnecessary,
    and this commit reuses the same logic for resource changes to give more
    information to consumers of this format.
    
    For example, consider this output:
    
        output "bar" {
          value = tolist([
            "hello",
            timestamp(),
            "world",
          ])
        }
    
    The plan output for this output would be:
    
        + bar = [
            + "hello",
            + (known after apply),
            + "world",
          ]
    
    For the same plan, the JSON output was previously:
    
        "bar": {
          "actions": [
            "create"
          ],
          "before": null,
          "after_unknown": true,
          "before_sensitive": false,
          "after_sensitive": false
        }
    
    After this commit, the output is instead:
    
        "bar": {
          "actions": [
            "create"
          ],
          "before": null,
          "after": [
            "hello",
            null,
            "world"
          ],
          "after_unknown": [
            false,
            true,
            false
          ],
          "before_sensitive": false,
          "after_sensitive": false
        }
    alisdair committed Jun 13, 2022
    Copy the full SHA
    48d64ea View commit details
    Browse the repository at this point in the history