What is the recommended path to migrate from `kube...
# kubernetes
d
What is the recommended path to migrate from
kubernetes.yaml.ConfigGroup
to
kubernetes.yaml.v2.ConfigGroup
, without recreating all of the resources? I can't quite figure out if there is an alias I can specify that will work here.
Hm, I've hacked something together, but it isn't pretty!
Copy code
export function migrateManifest(
  parentUrn: pulumi.Input<string>,
  args: pulumi.ResourceTransformArgs
): pulumi.ResourceTransformResult {
  parentUrn = pulumi.output(parentUrn).apply((urn) => urn.split("::").slice(0, -1).join("::"));
  const oldName = args.name.split(":").slice(1).join(":");
  const aliases = [pulumi.interpolate`${parentUrn}$kubernetes:yaml:ConfigFile$${args.type}::${oldName}`];
  return { props: args.props, opts: pulumi.mergeOptions(args.opts, { aliases }) };
}