is there any other way to write outputs than expor...
# general
v
is there any other way to write outputs than exporting from index.ts?
m
I don’t think I’ve seen another way to do this in TS. You can of course move your declarations into other modules, export their outputs from there, and then export those exports from
index.ts
, but ultimately I believe any stack outputs need to be expressed as exports in
index.ts
. (Though I’d love to be wrong on this!)
v
I hope you are wrong 🙂 . I really find this very limiting
m
Is it just that your
index.ts
is becoming verbose?
v
yes
👍 1
m
I see. Yeah, I’ll sometimes use this approach:
Copy code
// my-module.ts
import * as aws from "@pulumi/aws";

const bucket = new aws.s3.Bucket("my-bucket");

export const bucketName = bucket.bucket;
and then
Copy code
// index.ts
export * from "./my-module";
… which can help keep things a bit tidier.
v
Well my index.ts has 105 lines of exports