hey all, is there a way to copy files to a vm in r...
# getting-started
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
Can you execute
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?
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
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 🙂
You might also be able to put your salt repo in CodeCommit and do a
git pull
in userdata. Arguable which approach is better.
@stocky-restaurant-98004 care to elaborate on that? im quite new to pulumi
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.
ah ok, thats not an option currently. the salt stuff (for now) only happens on our openstack instance. but thx anyway!