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

Fetching pulumi outputs returns no values #1330

Open
markodjukic opened this issue Dec 30, 2024 · 3 comments
Open

Fetching pulumi outputs returns no values #1330

markodjukic opened this issue Dec 30, 2024 · 3 comments
Labels
kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team

Comments

@markodjukic
Copy link

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 markodjukic added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Dec 30, 2024
@simenandre
Copy link
Contributor

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.

@sylvain-pb
Copy link

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.

@tgummerer
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team
Projects
None yet
Development

No branches or pull requests

4 participants