sparse-intern-71089
05/19/2021, 8:20 PMwitty-candle-66007
05/19/2021, 8:28 PMnum_desired_servers
set to 1 or whatever and in the “prod” config file this would be set to 5 or whatever. Pulumi then manages the stacks separately.witty-candle-66007
05/19/2021, 8:28 PMwitty-candle-66007
05/19/2021, 8:29 PMgentle-monitor-55086
05/19/2021, 8:35 PMnum_desired_servers = 1
and then scale it up on another "up" command later to maybe 3.
I also wanted to be able to scale down as well.I would just use
protect
but it seemed tedious to me to have to unprotect the servers to be able to destroy the stack
in hindsight it probably wouldn't have been that big of a deal
witty-candle-66007
05/19/2021, 8:46 PMconst instanceCount = config.getNumber("instanceCount");
for (let i = 0; i < instanceCount; i++) {
// Create servers here
}
If the config file for, say the staging stack, has instanceCount
set to, say, 2, this code will create 2 servers.
Then later, if the config for staging is changed so that instanceCount
is now set to, say, 3, Pulumi will create 1 more server and leave the original 2 servers as-is.witty-candle-66007
05/19/2021, 8:48 PM