In typescript it should not be the linter that enf...
# typescript
e
In typescript it should not be the linter that enforces your resource arguments. The IDE should be able to pick up issues from the ts definitions for pulumi objects and alert you to the problems. What are you using for IDE? I’m using Webstorm/IntelliJ and it gives me “some” amount of that but not everything. Even Pulumi preview doesn’t always work right and when I do “Pulumi Up” I get errors that should be caught sooner but they are not defined in the objects for whatever resource your using because the API has moved forward from when the resource in Pulumi was last updated.
s
I use VSCode, it does take care of lot things but doesn't catch minor things like I mentioned above
g
this is very vague description. There are times when you cannot get everything for several reasons. 1) Actual thing is only known at runtime 2) Provider does not implement it correctly. I use both IntelliJ and VSCode and haven't noticed any parity issues regarding typing. Do you have any specific examples?
s
• say you have a resource which depends on output of another resource, ideally you should use pulumi.interpolate() or .apply() but if you miss that you get errors during runtime - would be nice to catch this • Say if you're creating too many resources in multiple modules then it's easy to miss referencing a provider - it will pick default one but might not be the right one, will be good to catch if you are creating any resource which doesn't have a provider
g
I am not sure I understand the 1st point. What do you mean by
output
?
Output
types create resource dependencies in the state. To the second point: you can disable default providers altogether, put this in
Pulumi.yaml
Copy code
config:
    pulumi:disable-default-providers:
        - aws
        - kubernetes
        - aws-native
Also wrote a workaround function to check if this config is in place, at runtime, it is not ideal but 🤷, IMO you could make a custom eslint rule.
s
Thanks for the suggestions @great-sunset-355, will try to add the config and see if helps
b
Sometimes you won’t catch errors in preview that are produced by outputs as they aren’t evaluated until the output is ready. This is why sometimes you’ll see issues in
up
but not
preview
. I’ve been thinking about using pulumi policies to detect resources with missing providers / parents but haven’t checked it out yet.