https://pulumi.com logo
Title
b

bitter-application-91815

05/26/2021, 9:38 AM
hey guys, just wondering is there any support for exporting existing stacks to terraform ?
d

damp-school-17708

05/26/2021, 9:39 AM
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

brave-planet-10645

05/26/2021, 9:43 AM
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

bitter-application-91815

05/26/2021, 10:55 AM
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

brave-planet-10645

05/26/2021, 10:58 AM
b

bitter-application-91815

05/26/2021, 11:04 AM
so i presume i should do that before i export it ?
b

brave-planet-10645

05/26/2021, 11:10 AM
You can also export using
--show-secrets
when you export
b

bitter-application-91815

05/26/2021, 3:37 PM
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

billowy-army-68599

05/26/2021, 3:47 PM
@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

bitter-application-91815

05/26/2021, 3:49 PM
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

billowy-army-68599

05/26/2021, 3:50 PM
oh yeah absolutely
b

bitter-application-91815

05/26/2021, 3:50 PM
ok cool, will take a look
nice one.
b

billowy-army-68599

05/26/2021, 3:51 PM
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

bitter-application-91815

05/26/2021, 3:52 PM
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

billowy-army-68599

05/26/2021, 3:57 PM
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

bitter-application-91815

05/26/2021, 3:57 PM
ah nice, awesome.