pulumi / pulumi-synced-folder

A Pulumi component that synchronizes a local folder to Amazon S3, Azure Blob Storage, or Google Cloud Storage.
Apache License 2.0
3 stars 2 forks source link

Add remote path input #21

Open jkodroff opened 1 year ago

jkodroff commented 1 year ago

Hello!

Issue details

It would be super helpful to allow us to specify the key under which our folder should be synced (asking specifically about S3 here). For example,

I want to be able to do this:

const folderSync = new syncedFolder.S3BucketFolder("environment-vpc", {
  acl: aws.s3.PublicReadAcl,
  bucketName: bucket.bucket,
  objectKey: "environment-vpc",
  path: "../environment-vpc",
}, {
  dependsOn: rmNodeModules,
});

In order to get local file ../environment-vpc/foo.txt to sync to s3://my-bucket/environment-vpc/foo.txt. Without the objectKey option, I have to reorg my code to move ../environment-vpc up a level to ../proton-templates/environment-vpc in my local filesystem and I have to sync all 3 planned folders now under proton-templates in a single S3BucketFolder resource. (I would prefer them to be separate.)