https://pulumi.com logo
s

square-crayon-17656

09/28/2018, 10:47 PM
is there an easier way to get data from the state file? Very familiar with terraform and how their remote state works, figuring pulumi has something equivalent
c

creamy-potato-29402

09/29/2018, 1:42 AM
What do you have in mind, specifically @square-crayon-17656
b

big-piano-35669

09/29/2018, 2:22 AM
You can export the state using
pulumi stack export
. It's just a JSON file. Not quite the same as Terraform state files, but hopefully easier to grok and parse since it's just JSON. If you ever want to edit it, you can always import the resulting edits using
pulumi stack import
.
s

square-crayon-17656

09/29/2018, 4:07 PM
Here is my use case. Using the service broker and when you create a service binding it ends up creating a secret with the binding credentials. The secret is created out of band. By that I mean I would create the service binding object via pulumi, once it is bound the service broker creates the secret. As pulumi would not be involved in creating the secret it would not be in its state file. Is there a way for pulumi to query for existing k8s objects and import into its state file
b

big-piano-35669

09/29/2018, 6:16 PM
@creamy-potato-29402 may have a better idea here. I think you may be wanting https://github.com/pulumi/pulumi-kubernetes/issues/231. This would let you say
let s = k8s.Secret.get("my-existing-secret")
and then use it as an object in your program just like as if you'd used Pulumi to create it, except that Pulumi won't try to manage its lifecycle or anything, it's just a readonly snapshot of its state. Does that sound like what you're after here?
s

square-crayon-17656

09/30/2018, 12:37 AM
I believe .. let me experiment and get back to you. Thanks
@big-piano-35669 Ah, that isn’t implemented yet. But based on the description you gave, yes that sounds like what I want
c

creamy-potato-29402

10/01/2018, 5:20 PM
@square-crayon-17656 yeah this is definitely on the roadmap.