https://pulumi.com logo
#general
Title
# general
v

victorious-dusk-75271

09/01/2022, 11:53 PM
is there any other way to write outputs than exporting from index.ts?
m

miniature-musician-31262

09/02/2022, 12:01 AM
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

victorious-dusk-75271

09/02/2022, 12:03 AM
I hope you are wrong 🙂 . I really find this very limiting
m

miniature-musician-31262

09/02/2022, 12:03 AM
Is it just that your
index.ts
is becoming verbose?
v

victorious-dusk-75271

09/02/2022, 12:04 AM
yes
👍 1
m

miniature-musician-31262

09/02/2022, 12:15 AM
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

victorious-dusk-75271

09/02/2022, 7:13 AM
Well my index.ts has 105 lines of exports
5 Views