Skip to content

Problem with stdout, from terraform output command #149

@mmor0130

Description

@mmor0130

We have three steps each with a terraform output command, and only one output works as expected.

- name: Get address space
      id: get_address_space
      run: terraform output -json address_spaces

- name: get git tag
      id: get_git_tag
      run: terraform output git_tag_version

- name: Get Firewall Group Policy Priority Number
      id: get_policy_number
      run: terraform output rule_collection_group_priority

This should output respectively

["10.2.1.0/26"]
"0.0.1"
504

When we try to reference the output in another step, like this:

- name: Echo output
  run: |
    echo ${{ steps.get_address_space.ouputs.stdout }}
    echo ${{ steps.get_git_tag.ouputs.stdout }}
    echo ${{ steps.get_policy_number.outputs.stdout }}

the result is empty except for 'get_policy_number', which correctly give 504.

The output variable types in terraform are:

["10.2.1.0/26"] = list(string)
"0.0.1" = string
504 = number

What are we missing? Do we have to do anything else, when output is a string?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions