You shouldn't need to comment out the first Command resource, pulumi will only run it once provided the inputs don't change.
Commenting it out is expected to delete the resource
l
lemon-ambulance-1111
12/11/2023, 3:11 PM
In the first phase playbook I have some packages that need to be installed that will take hours . During the 1st phase i comment 2nd phase playbook and same vice versa
d
dry-keyboard-94795
12/11/2023, 3:14 PM
No need to do any commenting out.
What you can do is have the 1st command depend on the ec2 instance, and have the 2nd command depend on the 1st command.
This will make it so that pulumi runs everything in sequence, and the commands will only run once on the ec2 instance being created
dry-keyboard-94795
12/11/2023, 3:15 PM
If it's taking hours to run, it'd be worth creating a golden image for the ec2 instance to use instead of a stock AMI. Tools like Packer can help with this
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.