quaint-twilight-9254103/09/2023, 6:53 PM
files? I'd like to verify what I think of as idiomatic TypeScript and the preferred approach of the Pulumi community.
clever-sunset-7658503/09/2023, 7:19 PM
repo. Have you looked there? This is probably a good one to look at. It uses
; not that you must also encapsulate yours as components: https://github.com/pulumi/examples/tree/master/aws-ts-wordpress-fargate-rds I also have a couple of examples of my own that may be quite large to read through but may give you a general idea: https://github.com/cloudy-sky-software/FoldingInTheCloud, https://github.com/cloudy-sky-software/botpress-pulumi
I'd like to verify what I think of as idiomatic TypeScript the preferred approach of the Pulumi community.What are you looking to verify? 🙂
quaint-twilight-9254103/09/2023, 7:39 PM
... I'm trying to verify/refute an approach that uses top-level TS code in imported files, then simply references something exported so the transpiler won't throw away the require. This feels non-idiomatic to me, and largely side-effect driven. And, I don't see that pattern in these examples.
clever-sunset-7658503/09/2023, 7:48 PM
quaint-twilight-9254103/09/2023, 8:03 PM
clever-sunset-7658503/09/2023, 8:54 PM
so exports in top-level code in other files don't result in stack outputs; one would need to "re-export" from index, correct?I believe so, yes.
I guess I'm just trying to take an idiomatic TS approach and not foul the waters with style questions. Unfortunately, JS/TS is full of such things because it is so permissive (but golang is a bit too unweildly for IaC IMHO).To be fair, I think it is idiomatic for infrastructure code to have resources created through the side-effect import due to its imperative nature. However, if you are dealing with a large/rapidly growing codebase, that's probably not ideal. Or if you are writing a library for IaC resources, you should use component resources anyway.