Preventing failures of multiple StackSet deployments using TAGs
When we want to deploy StackSets where stack instances in one StackSet depend on the stack instances in another , then we need to make sure that these deployments do not fail.
Although there is a failure-tolerance option in implementing StackSet operations, we need to catch and handle all possible exceptions before the actual operation.
StackSets have an optional feature called a target account gate. A target account gate (TAG) is a Lambda function that is executed on a target account before a StackSet operation and checks whether a target account is ready to perform this operation—for example, if the required resources exist, or if there is no other ongoing StackSet operation.
TAGs must be developed by us, but their outcome is quite simple: if all checks pass, then it should return SUCCESS
, or FAIL
if one or more checks do not pass.
For this chapter, we will develop a TAG function that will check the...