eager-pillow-75917
04/13/2020, 12:35 PMindex.ts
. I am separating my infrastructure into separate file for sake of organization and separation. But I noticed that I not only have to import to index.ts, but I have to use it somehow. Even it is a simple export of output in the end for Pulumi to deploy whatever it is on the import. Is there a better way to do this? A best practice maybe that most of you are following?limited-rainbow-51650
04/13/2020, 2:50 PMindex.ts
. You can structure to multiple files, but you have to import
them in your index.ts
file.eager-pillow-75917
04/13/2020, 3:32 PMfaint-table-42725
04/13/2020, 3:46 PMmain
property in your package.json
— for example, you could have "main": "infrastructure.ts"
as your entry point instead of the default index.ts
white-balloon-205
But I noticed that I not only have to import to index.ts, but I have to use it somehowNote that if you use
import "./vpc"
syntax, you do not need to "use" the outputs of the imported module for it to be included. This is a slightly unfortunate TypeScript gotcha even outside of Pulumi.
https://github.com/microsoft/TypeScript/issues/9191#issuecomment-226258610