With this example, how do we handle subdirectories...
# general
w
With this example, how do we handle subdirectories ? https://pulumi.io/quickstart/aws/tutorial-s3-website.html Currently getting an error when bumping into a sub directory
2 UNKNOWN: failed to compute asset hash: asset path '../../build/images' is a directory; try using an archive
w
You would need to write a little recursive function in Node to walk the filesystem. Should be only a few more lines of code - but we left that out of the simple example here. There are also some libraries in NPM that can do this for you automatically.
👍 1
w
Thanks Luke, i was already starting to write the loop, was checking if there was a specific way.
Hey @white-balloon-205 I'm guessing we can't actually create folders with https://github.com/pulumi/pulumi-aws/blob/master/sdk/nodejs/s3/bucketObject.ts ?
w
You don’t need to create folders in s3 - just include
/
in the
key
.
🙏 1