https://pulumi.com logo
#typescript
Title
# typescript
b

bland-byte-34481

01/25/2021, 7:41 PM
Hello! How can I pass outputs to create a file based BucketObject? My example code looks like the following:
Copy code
export const bucketObjectWithInput = (bucket: Bucket, param: pulumi.Input<string>, param2: pulumi.Input<string>) => {
    const output: Output<string> = pulumi.all([
        param2,
        param2
    ]).apply<string>(async (args) => {
        const [
            param,
            param2
        ] = args;
        return JSON.stringify({
            param,
            param2
        });
    });
    const outputPromise = new Promise<string>(resolve => output.apply(resolve));
    const asset = new StringAsset(outputPromise);
    const bucketObject = new BucketObject("uniqueName", {
        bucket,
        source: asset,
    });
}
this throws the error that you get when a promise fails