-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional mechanism to exclude files/subdirectories from FileArchive #9059
Comments
This would be very useful. My vote would be for a global |
this would be very useful, something like |
One approach that might help in the meantime would be to use import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as command from "@pulumi/command";
const result = command.local.run({
command: "echo '馃殌'",
dir: "../my-app",
archivePaths: [
"*",
"!node_modules",
],
});
const bucket = new aws.s3.Bucket("bucket");
const runner = new aws.s3.BucketObject("my-app.zip", {
bucket: bucket.id,
source: result.then(res => res.archive),
}); |
For this did not work when I wanted to include subdirectories (e.g. a src folder). I also tried something like |
Hello!
Issue details
When using a pulumi FileArchive that references a raw directory, it would be useful to be able to optionally specify a subset of contents of that directory to either include or exclude (via an additional string Attribute on the FileArchive class representing a regex or glob).
The specific use case that inspired this feature request is an AWS lambda function written in python where FileArchive is being used to upload a zip containing the source + requirements.txt files to AWS:
This works, but the
../server
directory also contains a virtual environment that gets included in the resulting.zip
file, bloating its size and causing this warning in the AWS interface:There are some workarounds:
pulumi up
command in a CI/CD system that doesn't contain the virtual environmentBut it would still be a useful feature.
Affected area/feature
Pulumi SDK (e.g.
pulumi/sdk/python/lib/pulumi/asset.py
Line 99 in 06ba63b
The text was updated successfully, but these errors were encountered: