This message was deleted.
# general
s
This message was deleted.
c
I understood it to mean something built-in to Pulumi so far I just wrote my own code in
___main___.py
to get file contents
(I am 100% new to Pulumi, just writing my first code in it, haven't run anything yet)
b
Yeah unfortunately that isn’t correct :/ you’d have to use file open and file read I will ensure those docs are updated - I’m sorry about that!
c
no worries, thanks for quick reply 🙂
b
Happy to give you a hint on the code if you are not a python user
c
I'm experienced with Python the code examples for "look up an existing resource" are not 100% obvious e.g.
Copy code
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, ...) -> SshKey
raises the question... "staticmethod of what?" I understood this to mean I should do something like:
Copy code
import pulumi_digitalocean as do

key = do.SshKey.get(...)
slightly confusing because the "create resource" example shows
Copy code
def SshKey(resource_name: str, opts: Optional[ResourceOptions] = None, name: Optional[str] = None, public_key: Optional[str] = None)
so it looks like
do.SshKey
is a factory function rather than a class I couldn't think of any other way to interpret it though
b
Oh that’s interesting feedback! Would you mind opening an issue about this on GitHub.com/pulumi/pulumi It would be good for us to help reduce this confusion
The get function is a static method of SshKey There is an actual GetSshKey class https://www.pulumi.com/docs/reference/pkg/digitalocean/getsshkey/