Open wrightp opened 9 years ago
@tyler-ball @jkeiser
@patrick-wright I'm working on code right now in https://github.com/chef/chef-provisioning-aws/pull/152 to add a :purge
action to all the AWS resources. This will call :purge
on any dependent resources, call delete on self, and then wait until the delete on self is finished. The recursive nature of this should ensure that we successfully wait for dependent resources before deleting.
Quick update on this - I merged #152 but there are still some resources that need to be updated to support the purge action. Working on this now.
I'm going to close this for now since I got the aws_full
example working idempotently. I updated a lot of resources there to be idempotent. We can open issues for any new cases we come across.
This is more of a question on how we should best handle destroying dependent resources when the first resource hasn't reached the required state in order for the following resource to initiate a delete.
We may not always want to enforce waiting for resources to reach the expected state before moving on the next chef resource in a recipe.
For
aws_ebs_volumes
I added status waits https://github.com/chef/chef-provisioning-aws/blob/master/lib/chef/provider/aws_ebs_volume.rb#L43Perhaps deleting a resource shouldn't wait unless an attribute is set.
This is only an example of waiting for state, not resource dependency.
A solution for that would be to check for any dependent resources and add a :purge action to any resources where this applies and remove any dependent resources and wait for the required states. Or again, add a wait_for_status attribute to enable status waits.
Example recipe. See comments.