Hey all, been using pulumi for about 3 years now, ...
# general
f
Hey all, been using pulumi for about 3 years now, minimal stuff, docker swarm on azure and stuff like that but it’s always been great. When I started it all we had php mostly so I selected Python, typescript wasn’t available at that time. Now we’ve moved away from php and have mostly typescript for everything. For the sake of unifying everything (OCD I know…) I wanted to turn our python code to typescript. My question is: is it possible without having to rebuild everything? Is there a preferred way to go about it? any pitfalls I should be aware of? Thanks ;)
l
The state isn't different. If you hand-craft your TS code to match the shape of the Python code, and if you ensure your resources have the same names and same nesting (parents, component resources, etc.), then you can make it just work.
f
Thanks so much, I’ll get cracking then 😉
well, that was a fun rewrite, but I do get some pretty significant diffs, odd ones too.
Copy code
[provider: urn:pulumi:uat::ORG::pulumi:providers:azure::default_4_42_0::XXX-XXX-XXX-XXX-XXX => urn:pulumi:uat::ORG::pulumi:providers:azure::default_5_48_1::output<string>]
+ allowNestedItemsToBePublic     : true
+ defaultToOauthAuthentication   : false
~ infrastructureEncryptionEnabled: false => false
+ publicNetworkAccessEnabled     : true
~ queueEncryptionKeyType         : "Service" => "Service"
+ sftpEnabled                    : false
~ tableEncryptionKeyType         : "Service" => "Service"
Not yet sure what’s that about, doesn’t seem like a diff to me but it wants to recreate pretty much everything. I’ll dig into this further but any tips would be appreciated!
l
If you import a resource, that sort of thing should go away. There's an import opt that takes a resource-specific ID. If you import everything, all those diffs should go away. The diffs are often caused by different treatment of default properties. One SDK might leave them as null / undefined, and another might set them to the actual default advertised by Azure. I don't know why "Service" is changing to "Service" though... 😕
f
yeah or false to false, I’ll be able to check that next week if all goes well