https://pulumi.com logo
Title
i

icy-controller-6092

10/24/2022, 3:19 AM
Hi all, is there a way to get a nested archive to work? e.g.
new AssetArchive({ 'inner.zip': new FileArchive('dist/folder') })
this should produce a top-level zip, with another zip inside of it… but when I check the zip file uploaded to S3,
inner.zip
is a directory not a zip archive
e

echoing-dinner-19531

10/24/2022, 10:17 AM
What's the code your using to create the s3 object?
And is this using aws or aws-native, I think it's the provider itself that does the zipping not the engine so we need to look at the correct one.
i

icy-controller-6092

10/24/2022, 10:42 PM
Hi Fraser, a more complete example. When I download
outer.zip
from the S3 bucket and unzip its contents,
inner.zip
is a directory and not a zip archive
import * as aws from '@pulumi/aws'
import * as pulumi from '@pulumi/pulumi'

new aws.s3.BucketObject({
  bucket: 'xyz',
  key: 'outer.zip',
  source: new pulumi.asset.AssetArchive({
    'my.txt': new pulumi.asset.StringAsset('test'),
    'inner.zip': new pulumi.asset.FileArchive('dist/folder'),
  })
})
e

echoing-dinner-19531

10/25/2022, 9:00 AM
OK I can look into this
Looks like this is by design, inner archives get flattened out into their files in parent archives. I suspect a lot of things probably rely on that behaviour so we probably can't flip it around, but if you raise an issue at github.com/pulumi/pulumi/issues we can discuss what could be done to support this.