Closed ziktar closed 4 years ago
Hi @ziktar . Thank you for your commit ! Looks useful !
But, I think serverless ( and serverless-s3-sync ) should be declarative. So I think it is better not to add --bucket
option.
Thank you.
Understood; would you accept a pull request that adds a config option that to only sync if an environment variable is set then?
The use case is the same as that for the "sls deploy function". In my environment, I have a serverless setup that deploys multiple different microservices which have both backends running on AWS Lambda and front-ends of HTML/JS hosted on S3. In some cases of deploying to the test server, it is cheaper & faster to deploy only one of the microservices, which is a one function & one s3 bucket. The "sls deploy function" command allows for deploying just the lambda function, but as is, serverless-s3-sync will deploy all of the configured S3 buckets.
If not, I understand, and I'll just keep my fork. Thanks for your time & the product itself!
The use case is the same as that for the "sls deploy function". In my environment, ~
fmm...right.
Give me some time to think about the implementation. 🙏
@ziktar
I propose we make sls s3sync
to the same as sls deploy
commands.
All with CFn | One without CFn | |
---|---|---|
deploy | sls deploy |
sls deploy function -f functionName |
s3sync | sls s3sync |
sls s3sync bucket -b bucketName ( or sls s3sync dir -d localDir ) |
What do you think?
That makes a lot of sense! I'll take a look at updating my code to follow this format when I get a chance.
@ziktar any intention to work on this?
I updated the pull request to use the sub-command option, aka "sls s3sync bucket -b bucketName" will sync just the one bucket.
When updating the metadata syncing code to only sync the metadata for the given bucket, I noticed that the code was not updated to handle if the configuration had just a bucketNameKey instead of bucketName , so I updated that as well.
Let me know what you think of the update.
@ziktar GREAT!!! THANK YOU !!!!!
Released as v1.12.0.
I wanted to only sync certain buckets at certain times, thus added this option. Hope it's helpful.