Right now we can do anything in the bash command (Command parameter) - we can fetch values from e.g. RDS, we can use AWS CLI to get some information, initialise databases, make external calls, etc. But we can also create new resources.
For instance Cloudformation does not support Storage Gateway (yet). So I am using CommandRunner to register Storage Gateway programmatically via AWS CLI, e.g.:
Now suppose I want to remove the stack. The only thing Cloudformation will remove is the Output value from Parameter Store. But it won't deactivate Storage gateway, nor will it detach the nfs file share.
So what we can do, is along with the Command parameter we can introduce another parameter e.g. TeardownCommand where we can add some teardown logic (bash script) and start a new CommandRunner stack (inside DeleteHandler.java).
Right now we can do anything in the bash command (
Command
parameter) - we can fetch values from e.g. RDS, we can use AWS CLI to get some information, initialise databases, make external calls, etc. But we can also create new resources.For instance Cloudformation does not support Storage Gateway (yet). So I am using CommandRunner to register Storage Gateway programmatically via AWS CLI, e.g.:
Now suppose I want to remove the stack. The only thing Cloudformation will remove is the Output value from Parameter Store. But it won't deactivate Storage gateway, nor will it detach the nfs file share.
So what we can do, is along with the
Command
parameter we can introduce another parameter e.g.TeardownCommand
where we can add some teardown logic (bash script) and start a new CommandRunner stack (inside DeleteHandler.java).