https://pulumi.com logo
Title
i

important-sugar-9877

09/02/2022, 1:47 PM
hey all, is there a way to copy files to a vm in rsync style? i only found remote.copyFile so far, that would be a bit cumbersome to use for many files
s

stocky-restaurant-98004

09/02/2022, 4:53 PM
Can you execute
rsync
in
local.Command
?
g

gorgeous-country-43026

09/02/2022, 5:23 PM
Just wondering out aloud, you have a full programming language at your hands, just do a simple function that does what you want with remote.copyFile?
a

ancient-car-89914

09/03/2022, 9:44 PM
I guess that would end up making a pulumi resource per file which could get very expensive if you're paying for them and have a large number of small files
i

important-sugar-9877

09/05/2022, 10:37 AM
for context: we use pulumi just to deploy resources on openstack and AWS. for config management on the VMs/EC2 we use saltstack. trying to do config management with pulumi commands like salt would be quite complicated and expensive regarding the number of commands to execute. so the idea is to have pulumi provision the vm, rsync a salt-repository onto the vm using pulumi, and then execute salt. i think the pulumi local.Command will do this just fine for me 🙂
s

stocky-restaurant-98004

09/05/2022, 8:02 PM
You might also be able to put your salt repo in CodeCommit and do a
git pull
in userdata. Arguable which approach is better.
i

important-sugar-9877

09/06/2022, 12:55 PM
@stocky-restaurant-98004 care to elaborate on that? im quite new to pulumi
s

stocky-restaurant-98004

09/06/2022, 1:00 PM
This is more of an AWS suggestion. If opening ports for rsync is inconvenient or a security concern, you should be able to create an AWS CodeCommit repo (their hosted git offering) and have it mirror your Saltstack repo. Then, you might be able to use the EC2 instance role to clone the repo. (In case you're not familiar, userdata is a script that runs exactly once after an EC2 instance is created.)
I'm not sure about CodeCommit being able to use an EC2 instance role - would need to check the docs.
i

important-sugar-9877

09/06/2022, 1:43 PM
ah ok, thats not an option currently. the salt stuff (for now) only happens on our openstack instance. but thx anyway!