-
Notifications
You must be signed in to change notification settings - Fork 53
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
unknown StringOutput Project on NewProvider() causes potential unwanted deletion/modification of many resources #2539
Comments
Hey @pdemagny. Sorry you've had trouble here. Looking at your code it looks like you are typing the Can you try changing that to: type (
ResourceArgs struct {
Name string
ProjectId string
Region string
} That should work much better as that promises pulumi that the project id configuration will always be available - it can not be unknown. |
When I modify my code with your suggestion, it demonstrates the expected behavior: error: rpc error: code = Unknown desc = expected a non-empty string: project was set to `` Thanks for the fix. |
Hey @pdemagny. Do you think the warning is insufficient here? Would you prefer it if we provided a flag for this to become a hard error? Unfortunately we can not do this by default as some user programs do depend on this behaviour and we'd like to avoid breaking them. |
Hi @VenelinMartinov. I think it would definitely be best if was an error instead of a warning, but not at the cost of a breaking change, and anyway that's not my place to tell 😅 |
Glad you managed to fix the issue on your end. Let me know if you run into any more troubles here! |
Describe what happened
After an upgrade of this provider and without any changes in my codebase (can't remember exactly but it was around may I think), I started having very weird previews:
I would get a lot of warnings:
And lots of values would end up unknown again:
And lots of occurences in the diff of:
And other randomly removed properties on resources ...
Sample program
I have this package that is overly complex for what it does, but it looks like this to maintain consistency with all our other packages in our codebase that all implements the Golang Functional Options Pattern.
As i said I can't find out what version it was, but a version of the Pulumi GCP Provider required me to add the Project option to the NewProvider() method.
But it doesn't seem to be a hard requirement, so when I create the provider like this:
It causes warnings and ultimately errors and panic (same result with both pulumi cli & automation api):
And it goes like this for all resources of this provider.
If I try to apply anyway:
When I remove only the Region instead of the Project, i get the expected:
Finally When I create the provider like this:
Everything works as expected !
I suspect that somehow with my code the Project ends up nil and it makes the provider loose his mind instead of just saying that it can't be empty (as it does when I don't provide the Region).
Log output
No response
Affected Resource(s)
Output of
pulumi about
❯ pulumi about
CLI
Version 3.137.0
Go Version go1.23.2
Go Compiler gc
Host
OS ubuntu
Version 22.04
Arch x86_64
Backend
Name pulumi.com
URL https://app.pulumi.com/pdemagny-blobr
User pdemagny-blobr
Organizations pdemagny-blobr, blobr-io, blobr-ai
Token type personal
Pulumi locates its logs in /tmp by default
Additional context
This is related to support ticket n°5654.
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).
The text was updated successfully, but these errors were encountered: