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

Don't error on eventual IDs #591

Merged
merged 2 commits into from
Jun 21, 2024
Merged

Don't error on eventual IDs #591

merged 2 commits into from
Jun 21, 2024

Conversation

iwahbe
Copy link
Member

@iwahbe iwahbe commented Jun 14, 2024

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:
    ⚠️ [email protected]
        - [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.

Right now, this program errors:

```yaml
name: dev-yaml
runtime: yaml
resources:
  b1:
    type: aws:s3:Bucket
  b2:
    type: aws:s3:Bucket
    get:
      id: ${b1.id}
```

```console
$ 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:
    ⚠️ [email protected]
        - [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.
@iwahbe iwahbe requested a review from a team as a code owner June 14, 2024 06:47
Copy link
Contributor

@lunaris lunaris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome stuff; thanks Ian 💯

@iwahbe iwahbe merged commit 861f985 into main Jun 21, 2024
5 checks passed
@iwahbe iwahbe deleted the iwahbe/dont-error-on-eventual-ids branch June 21, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants