pulumi / pulumi-google-native

Apache License 2.0
70 stars 18 forks source link

Offer a seamless way to transition from legacy gcp #221

Open atrauzzi opened 2 years ago

atrauzzi commented 2 years ago

Issue details

If the current advice is to fall back on the legacy GCP provider until this one is fully populated, it probably would be nice to give people a way to transition resources using the legacy provider to this one.

I'd hate to get all up and running with a mix and then see the things I want land and then have to destroy/recreate/adopt tonnes of resources.

This might also be informed by the speed of progress and status of this provider...?

mikhailshilkov commented 2 years ago

It's a fair ask @atrauzzi but it's somewhat challenging to implement. The resource model of the resources doesn't match between two providers, so there may be a translation layer needed. Anyway, we should take a closer look at how many discrepancies we'd get in practice - maybe it wouldn't be too bad.

This will likely have lower priority than improving the provider itself, so don't expect such a tool in the short term...

atrauzzi commented 2 years ago

Could there be some documentation and boilerplate to remove resources from one provider in the deployment and readopt under the other?

mikhailshilkov commented 2 years ago

Something like this guide for Azure? https://www.pulumi.com/registry/packages/azure-native/from-classic/

(it applies to Google and AWS in principle)

atrauzzi commented 2 years ago

Cool, so that would leverage the resource state to generate the corresponding source code needed for the new resource?

I assume that if my prior setup was using conventions for string names, if I I'm still following a similar convention, I can programatically regenerate those same string names to match?

For example: resourceGroupName: "my-rgca05c9f8",

If for whatever reason, rgca05c9f8 was actually something I had assembled via a convention in my prior templates, if my new templates still have the capability to generate that name, I could substitute my-${thatResourceSuffix} and be on my way?

mikhailshilkov commented 2 years ago

I think so - if I understand you correctly. One complication for Google Native may be #190. To be honest, we haven't tested the migration flow here yet - feel free to report back if you do.