pulumi / pulumi-yaml

YAML language provider for Pulumi
Apache License 2.0
39 stars 12 forks source link

`pulumi convert` only converts Outputs #422

Closed guineveresaenger closed 1 year ago

guineveresaenger commented 1 year ago

What happened?

I have a YAML source file:

name: image-yaml
description: A minimal Pulumi YAML program
runtime: yaml
config: {}
variables: {}
resources:
  guins-image:
    type: docker:Image
    properties:
      imageName: gsaenger/test-yaml:tag1
      skipPush: true
      build:
        dockerfile: Dockerfile
        context: .
outputs:
  imageName: ${guins-image.imageName}

I ran the following:

$ pulumi convert --language typescript --out ts-image
$ cat ts-image/index.ts 
import * as pulumi from "@pulumi/pulumi";

export const imageName = guinsImage.imageName;

Steps to reproduce

Create a Pulumi YAML file with the above content. Run pulumi convert as above.

Expected Behavior

I would expect my index.ts to look something like this:

import * as pulumi from "@pulumi/pulumi";
const img = new docker.Image("guins-image", {
        imageName: "gsaenger/test-yaml:tag1",
        skipPush: true,
        build: {
           context: ".",
           dockerfile: "Dockerfile",
         }
export const imageName = guinsImage.imageName;

Actual Behavior

Only dependency and package output is generated:

import * as pulumi from "@pulumi/pulumi";

export const imageName = guinsImage.imageName;

Output of pulumi about

n/a

Additional context

PCL also generates only the output block

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).

aq17 commented 1 year ago

Fixed via https://github.com/pulumi/pulumi-yaml/pull/423