generated from pulumi/pulumi-provider-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
kind/enhancementImprovements or new featuresImprovements or new features
Description
Hello!
- Vote on this issue by adding a 👍 reaction
- If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)
Issue details
Right now, if I want to copy files to the remote, I need to create a path based asset and copy all of those files into a temporary directory. (The directory needs to be referenced as a local path that is relative to my pulumi root so that it works on different machines when it's state is stored).
This leads to lots of boilerplate that I think could be brought into the CopyToRemote Command. Ideally, it would be nice to make use of the AssetArchive class, have that class copied to a temporary directory and then
cleaned afterwards.
const myArchive = new pulumi.asset.AssetArchive({
file: new pulumi.asset.StringAsset('This is a dynamically created file'),
folder: someOtherAssetArchive,
})
new remote.CopyToRemote('copy-asset-archive', {
connection,
source: myArchive,
path: '/some/path',
// Required if the source is not path based
tmpCopyDir: './tmp',
})On the provider side this would look like:
- If source is non-path, verify that there is a
tmpCopyDir - If the tmpCopyDir is not relative throw an error since that will be non-deterministic on other machines
- make
<tmpCopyDir>/<id>, if non-empty clear the contents // Needs to be deterministic - iterate assets and create files in
<tmpCopyDir>/<id> - perform SFTP upoad
- defer
rm -rf <tmpCopyDir>/<id>
Affected area/feature
pulumi-command provider
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/enhancementImprovements or new featuresImprovements or new features