actions icon indicating copy to clipboard operation
actions copied to clipboard

Fetching pulumi outputs returns no values

Open markodjukic opened this issue 10 months ago • 6 comments
trafficstars

What happened?

Unsure if this is the intended function of this command, but I am trying to use the command: output in order to access outputs from the stack, as follows:

      - name: Get Pulumi Outputs
        id: pulumi-outputs
        uses: pulumi/actions@v6
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: us-east-2
          PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
        with:
          command: output
          stack-name: ${{ env.environment }}
          cloud-url: s3://abc-${{ env.environment }}-pulumi-state
          work-dir: infra
      - name: Check outputs
        run: |
          echo "Private Subnet IDs: ${{ steps.pulumi-outputs.outputs.privateSubnetIds }}"
          echo "ECS Security Group ID: ${{ steps.pulumi-outputs.outputs.ecsSgId }}"
          echo "RDS Security Group ID: ${{ steps.pulumi-outputs.outputs.rdsSgId }}"

However, no output provided:

Run echo "Raw outputs: "
  echo "Raw outputs: "
  shell: /usr/bin/bash -e {0}
  env:
    environment: dev
    AWS_DEFAULT_REGION: us-east-2
    AWS_REGION: us-east-2
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
Raw outputs: <<<THIS IS BLANK
Run echo "Private Subnet IDs: "
  echo "Private Subnet IDs: "
  echo "ECS Security Group ID: "
  echo "RDS Security Group ID: "
  shell: /usr/bin/bash -e {0}
  env:
    environment: dev
    AWS_DEFAULT_REGION: us-east-2
    AWS_REGION: us-east-2
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin
Private Subnet IDs: <<<THIS IS BLANK
ECS Security Group ID: <<<THIS IS BLANK
RDS Security Group ID:<<<THIS IS BLANK

Example

Doing manual outputs like this works but I as hoping to avoid manual manipulation:

      - name: Debug Pulumi State
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
          AWS_REGION: us-east-2
          PULUMI_CONFIG_PASSPHRASE: ${{ secrets.PULUMI_CONFIG_PASSPHRASE }}
        run: |
          cd infra
          pulumi stack ls
          pulumi stack output --json || echo "Failed to get outputs"

Output of pulumi about

$ pulumi about
CLI          
Version      3.144.1
Go Version   go1.23.4
Go Compiler  gc

Plugins
KIND      NAME        VERSION
resource  aws         6.61.0
resource  awsx        2.19.0
language  nodejs      3.144.1
resource  postgresql  3.14.0

Host     
OS       debian
Version  12.8
Arch     x86_64

This project is written in nodejs: executable='/usr/local/bin/node' version='v22.12.0'

Current Stack: organization/abc-app/dev

TYPE                                                    URN
<<< REMOVED >>>

Found no pending operations associated with dev

Backend        
Name           e1eb7e53c9cd
URL            s3://abc-dev-pulumi-state
User           node
Organizations  
Token type     personal

Pulumi locates its logs in /tmp by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

markodjukic avatar Dec 30 '24 03:12 markodjukic

Hey! Thanks for reporting this.

It's been quite a while since I built (or worked with) the output functionality, so I don't immediately understand what is causing this for you.

Can you try something for me? Can you try to do any command other than output? The output object is set regardless.

simenandre avatar Dec 30 '24 20:12 simenandre

Not the reporter but I have the same bug. Don't know if it's exactly the same context as him, I'm trying to output stack from another project in the same backend. The preview and up on the current project work properly. The output doesn't seems to work at all. Not on the current project or on the referenced project.

sylvainpolicybook avatar Jan 03 '25 15:01 sylvainpolicybook

It might also be useful to see what's in steps.pulumi-outputs.outputs? Is that object empty?

tgummerer avatar Jan 03 '25 15:01 tgummerer

This may be addressed by https://github.com/pulumi/actions/pull/1327, but it hasn't been released yet.

justinvp avatar Jan 13 '25 00:01 justinvp

v6.0.1 of the action was released with the changes from https://github.com/pulumi/actions/pull/1327. Does this issue still repro?

justinvp avatar Jan 14 '25 01:01 justinvp

I can try it out. Give me a few days since I’ve had to refactor the code massively to avoid this.


From: Justin Van Patten @.> Sent: Monday, January 13, 2025 8:33:50 PM To: pulumi/actions @.> Cc: Marko Djukic @.>; Author @.> Subject: Re: [pulumi/actions] Fetching pulumi outputs returns no values (Issue #1330)

v6.0.1 of the action was released with the changes from #1327https://github.com/pulumi/actions/pull/1327. Does this issue still repro?

— Reply to this email directly, view it on GitHubhttps://github.com/pulumi/actions/issues/1330#issuecomment-2588572780, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC7VCPKOXBSTAVIO2ZGNELT2KRSP5AVCNFSM6AAAAABULN3BU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOBYGU3TENZYGA. You are receiving this because you authored the thread.Message ID: @.***>

markodjukic avatar Jan 14 '25 01:01 markodjukic