pulumi / pulumi-yaml

YAML language provider for Pulumi
Apache License 2.0
38 stars 11 forks source link

Don't error on eventual IDs #591

Closed iwahbe closed 2 weeks ago

iwahbe commented 3 weeks ago

Right now, this program errors:

name: dev-yaml
runtime: yaml
resources:
  b1:
    type: aws:s3:Bucket
  b2:
    type: aws:s3:Bucket
    get:
      id: ${b1.id}
$ pulumi preview
Previewing update (dev)

View in Browser (Ctrl+O): https://app.pulumi.com/pulumi/dev-yaml/dev/previews/0e23b0b3-33f3-4a5d-abf9-15fb7fb9f23e

Loading policy packs...

     Type                 Name          Plan       Info
 +   pulumi:pulumi:Stack  dev-yaml-dev  create     2 errors
 +   └─ aws:s3:Bucket     b1            create

Policies:
    ⚠️ pulumi-internal-policies@v0.0.6
        - [advisory]  s3-bucket-replication-enabled  (aws:s3/bucket:Bucket: b1)
          Encourages use of cross-region replication for S3 buckets.
          S3 buckets should have cross-region replication.

Diagnostics:
  pulumi:pulumi:Stack (dev-yaml-dev):
    error: ${b1.id} must be a string, instead got type pulumi.StringOutput

      on Pulumi.yaml line 9:
       9:       id: ${b1.id}

    This indicates a bug in the Pulumi YAML type checker. Please open an issue at https://github.com/pulumi/pulumi-yaml/issues/new/choose
    error: Error registering resource [b2]: no diagnostics

This PR addresses the problem.