hey guys, just wondering is there any support for ...
# general
b
hey guys, just wondering is there any support for exporting existing stacks to terraform ?
d
interesting question, as far as I know the state might be the same, I wonder what happens if you just do a terraform plan on a pulumi stack 🙂
b
the state file is a different structure to the TF state. We have a provider to read outputs from a TF state, but we don't have a way of moving to TF
b
Regardless of terraform i'm just looking for a way to share stack configurations for a given cloud to customers, without them having to have necessarily have a pulumi account
i just tried exporting a stack, and importing on another machine with my own personal aws account
using local filesystem as the 'backend'
but it seems to break on the fact that the secrets-provider in the stack is still pointing at app.pulumi.com i.e. my work pulumi account
b
b
so i presume i should do that before i export it ?
b
You can also export using
--show-secrets
when you export
b
when i import the stack, after it should just work with 'pulumi up' ?
it's not working here, has issue with imports on the main.go file that was autogenerated when i created the project
b
@bitter-application-91815 if you want to export a pulumi program in Go, your best bet is to wrap the program into a CLI tool with automation API
you can't just export the stack state and pass it to another user, they'll still need the dependencies for the program to run
you can't export to terraform because the state is incompatible and the language itself is too expressive for tf to understand
b
Thanks Jaxx, yeah trying to find a nice way to share our stack with our customers, without revealing our code or having to deal with their secrets. like it's a pretty simple aws arch for now, 1 eks, 1 postgres, s3 bucket etc
is this all possible with the automation tool ?
b
oh yeah absolutely
b
ok cool, will take a look
nice one.
b
this is an example CLI which deploys a Pulumi program: https://github.com/jaxxstorm/ploy/ the program is all here: https://github.com/jaxxstorm/ploy/tree/main/pkg/pulumi
b
sweet, thanks, taking a look
Does the other user need to have a pulumi org to make it work ?
was hoping that they didn't need to necessarily have to have that
b
nope, it just uses whatever you're logged in as, obviously as a Pulumi employee all my examples uses the pulumi org 🙂
but automation API works with any backend
b
ah nice, awesome.