I am trying to understand how terraspace all up behaves when there are multiple non-dependant stacks in a project and one of them fails. Will it let the other stacks complete but have terraspace finish with non-zero exit code or will Terraspace send a kill signal to the other terraform apply commands running for the other stacks?
+1
(Iβm also interested in knowing what the behaviour would be too)
E.g. if I have
s3 (independent stack)
iam (independent stack)
vpc (parent stack)
subnets (child stack - dependent on the vpc stack)
ec2 (child stack - dependent on the subnets stack)
What happens if the iam stack fails (but not the s3, vpc, subnets or ec2 stacks)?
And perhaps still related to the original topicβ¦ Is it possible to target only the ec2 stack (and itβs dependencies i.e. the vpc and subnets stack, but not the s3 and iam stacks)? I.e. doing terraspace all up would run all stacks (including the independent s3 and iam stacks), but doing a terraspace up ec2 might fail due to dependencies on the vpc and subnet stacks?
RE: Will it let the other stacks complete but have terraspace finish with non-zero exit code or will Terraspace send a kill signal to the other terraform apply commands running for the other stacks?
@nmorey-ratehub When a stack fails, Terraspace will stop and exit with a non-zero error code after that batch is finished. For example:
batch 1: stack1, stack2, stack3
batch 2: stack4, stack5
Once batch1 starts, all stack1, stack2, stack3 run in parallel. Letβs say stack2 fails, no signals are sent to stack1 and stack3, they will finish. Stacks running in parallel are considered independent. Terraspace will exit with a non-zero exit code after batch1 is done, and batch2 will not run.
This is the default behavior. Additionally, this behavior can be changed with configs:
config/app.rb
Terraspace.configure do |config|
# These are the defaults
all.exit_on_fail.down = true
all.exit_on_fail.up = true
end