-
Notifications
You must be signed in to change notification settings - Fork 17
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
.get
can succeed and return empty result even when resource is missing
#262
Comments
Do you know if the return object had a non-empty |
Given that this was opened 9 months ago - I suspect someone will need to try to reproduce and investigate. I do believe I have seen/heard of other case of this sort of thing happening. |
Simple repro: import * as aws from "@pulumi/aws";
const role = aws.iam.Role.get("myrole", "abcdef");
export const roleArn = role.arn; Results in a successful deployment with an undefined output. Among other things, this violates the TypeScript typing for the resource (they do not mark Here's a small part of the debug logs:
This issue has led several users to second order failures where |
In particular - this looks like it may be the key thing we are not handling correctly:
|
We believe the issue is that we are not checking the |
Closed by pulumi/pulumi#3123. |
We saw an example of a Terraform Provider which returns empty results, but not an error, from
Read
even when the resource does not exist at all.This leads to code like the following in Pulumi triggering very surprising behaviour - where the
get
succeeds, but the resulting object has empty values for all it's properties:This is using this TF provider: https://github.com/terraform-providers/terraform-provider-google/blob/e95fa4674ce86246965fcf659086cedbfc6d1417/google/resource_container_cluster.go#L710
It's not clear if this is a common or technically supported pattern for Terraform providers, but the resulting behaviour of Pulumi
.get
is more problematic than what is likely to be observable as a result of this - so this may be something we need to handle better.The text was updated successfully, but these errors were encountered: