polite-kite-18322
08/11/2023, 1:09 AMpulumi.yaml
pretokengeneration/dist/{bunch of files to archive}
What I need is to create an archive that ONLY includes the files in pretokengeneration/dist/
without the parent folder structure. Hoisting the files to the root of the zip file.
I keep getting this structure that includes all paths from "work dir" to where the files are and it blows up in aws lambda.
I've scoured the internets... and pulumi community. For some reason this is either so obvious that no one has ever asked this question, or I'm doing something really stupid.dir
to see if I could generate the desired zip file but to no avail:
const lambdaBuild = local.runOutput({
dir: "pretokengeneration",
command: `cd src && npm install && tsc`,
archivePaths: ["dist/**", "!dist/**/test/**"]
});
...
// then I provide it to pulumi.aws.Function like this
code: lambdaBuild.archive,
brave-planet-10645
08/11/2023, 4:02 PMconst fn = new aws.lambda.Function("fn", {
code: new pulumi.asset.AssetArchive({
".": new pulumi.asset.FileArchive("./dist")
},
... rest of lambda
});
polite-kite-18322
08/11/2023, 4:02 PMbrave-planet-10645
08/11/2023, 4:04 PMpolite-kite-18322
08/11/2023, 5:15 PMbrave-planet-10645
08/11/2023, 5:25 PMpolite-kite-18322
08/11/2023, 5:59 PMFileArchive
so not sure how to understand what they actually resolve to.So I think it’s the archive paths input in the command resource that’s doing this. Can you not use that and use the assets.archive bit in the function resource to zip it up?What is an "assets.archive" bit? What is a "function resource"? Is that the Lambda defn?
local.runOutput
approach.
const fn = new aws.lambda.Function("fn", {
code: new pulumi.asset.AssetArchive({
".": new pulumi.asset.FileArchive("./dist")
},
... rest of lambda
});
./dist
folder structure in it:
new pulumi.asset.AssetArchive({
".": new pulumi.asset.FileArchive("./dist")
},
should I just use bash and zip tooling that I understand? This is really frustrating.quaint-army-32339
08/11/2023, 8:19 PMpolite-kite-18322
08/11/2023, 8:20 PMpulumi.yaml
brave-planet-10645
08/11/2023, 8:24 PMapp
folder.polite-kite-18322
08/11/2023, 8:29 PMindex.js
and package.json
at the root?
Then my issue is somewhere else like:
• i'm not looking at the archive I think I'm looking at
• linux is doing something different than other platforms
• some other simple failure on my end.brave-planet-10645
08/11/2023, 8:31 PMpolite-kite-18322
08/11/2023, 8:32 PM./app
folder are appearing in the root of the archive and not in an app
folder in the archive.brave-planet-10645
08/11/2023, 8:39 PMpolite-kite-18322
08/14/2023, 4:19 PMaws
is misrepresenting what is in the package.
When I downloaded the archive (export function) it looks correct!!!tsc
step is triggered reliably before the archive is created. Trying to to figure out how a Output<runResult>
can be used as a DependsOn (it only accepts Input<Resource>
types).brave-planet-10645
08/14/2023, 4:43 PMpolite-kite-18322
08/14/2023, 5:20 PMbrave-planet-10645
08/15/2023, 9:36 AMrunResult
coming from?