important-appointment-55126
09/04/2020, 3:26 PMif
condition - if the resource is declared, Pulumi will ensure it exists.. if it isn’t declared but the condition evaluated to false, then Pulumi will remove it if it already exists in the same way it would if you deleted the resource from your program normallychilly-rainbow-79265
09/04/2020, 3:30 PMlemon-agent-27707
09/04/2020, 3:38 PMchilly-rainbow-79265
09/04/2020, 3:42 PMconfig:
azure:location: centralindia
vm:instance_spec:
# Cassandra Cluster
- count: 1
data_disk_size: 50
name: cassandra
resource_group: pu_demo
type: Standard_A8_v2
user_name: deployer
life_span: 5 # Lifespan in days, after this time, this machine will get autodelted
image_id: cassandra # From which image the machine should be created from
password:
secure: XXXXXX
life_span
field in yaml will create a tag called lifeSpan
in machine, along with the creationTime
in epoch.
every night, we'll run this pulumi program, which will check today - creationTime > lifespan
then take a snapshot and delete the VMlemon-agent-27707
09/04/2020, 3:50 PMchilly-rainbow-79265
09/04/2020, 3:51 PMlemon-agent-27707
09/04/2020, 3:54 PMchilly-rainbow-79265
09/04/2020, 3:54 PMlemon-agent-27707
09/04/2020, 4:17 PMchilly-rainbow-79265
09/04/2020, 4:19 PMlemon-agent-27707
09/04/2020, 11:43 PM