This message was deleted.
# general
s
This message was deleted.
v
i dont have anything python specific, but i have a TS example which by looking at it should be simple to translate over:
Copy code
const updateCfLambdaResponseFunctionEtag = new local.Command(
  'update-cf-distro-response',
  {
    create: `../scripts/update-cf-distro.sh`,
    triggers: [responseFunction.version],
  },
  {
    dependsOn: responseFunction,
  }
);
this executes a script located in a scripts directory to update a cloudfront distribution, hope this helps
Copy code
@overload
def Command(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            create: 'path/to/script | command as a string',
            triggers: <pulumi-resource-to-trigger-run>
)
something like that
b
Thank you @victorious-church-57397. I was looking for a replacement of terraform code using python ... below is a piece of code which i want to convert into pulumi .. connection { type = "ssh" user = "root" password = var.root_pass host = vsphere_virtual_machine.vm.default_ip_address } provisioner "remote-exec" { inline = [ "sleep 60", "sudo apt-get update && sudo apt-get upgrade -y", "mkdir -p /home/fgdgdggd", "yum install -y python36 python36-pip" ] }
v
you probably want to use remote command rather than local command then? i havent used it too much so cant really help im afraid
b
@victorious-church-57397 understood . I think i just have to experiment a bit more figure it out . Thank you so much.
hi @victorious-church-57397, i was able to use remote.Command on vsphere exactly the way i wanted . thank you so much for the pointers.
v
hey @boundless-queen-72669, thats awesome! glad you managed to sort it