sparse-intern-71089
06/11/2020, 11:20 AMcreamy-potato-29402
06/11/2020, 5:48 PMaverage-receptionist-65239
06/11/2020, 9:45 PMindex.ts
file. I had a similar experience where the Pulumi wants to delete 7 resources. If I place the new resource in one of my existing modules, then it works fine!creamy-potato-29402
06/11/2020, 10:00 PMaverage-receptionist-65239
06/11/2020, 10:03 PMnew
some k8s resource).
Quite a few of my existing modules to do not export anything. My index.ts looks something like:
import * as pulumi from "@pulumi/pulumi";
export * from "./namespace";
export * from "./credentials"
export * from "./tls";
export * from "./serviceA";
export * from "./serviceB";
export * from "./cronJobA;
export * from "./cronJobB";
Occasionally, I do export from those resource modules for debugging/learning purposes. Something like:
export const serviceaURN = serviceA.urn;
As I have gotten comfortable with Pulumi, I've been removing these exported constants.average-receptionist-65239
06/11/2020, 10:04 PMexport const useMe = 1;
to the top of every module, then everything seems fine. I can add my new module and Pulumi doesn't want to delete my old resources.average-receptionist-65239
06/11/2020, 10:09 PMpulumi preview --expect-no-changes
succeeds. Then, I remove the kx
import in my index.ts
and then pulumi preview --expect-no-changes
fails with the deletion of 7 resources.average-receptionist-65239
06/11/2020, 10:11 PMexport const namespaceNameX = namespace.metadata.name;
export const namespaceNameURN = namespace.urn;
average-receptionist-65239
06/11/2020, 10:12 PMaverage-receptionist-65239
06/11/2020, 10:16 PMaverage-receptionist-65239
06/11/2020, 10:23 PMcreamy-potato-29402
06/11/2020, 10:55 PMcreamy-potato-29402
06/11/2020, 10:55 PMaverage-receptionist-65239
06/11/2020, 11:06 PMimport "./serviceA"
for all modules that do not export anything works. This is the official TypeScript way to import for side-effects, AFAICS. The strange part is why, up to this point, the export * from "./serviceA"
was working. I'll see if I can work up a small repro over the weekend.creamy-potato-29402
06/12/2020, 12:31 AM