aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
AWS::CloudFormation::CustomResource - Custom::Custom HTTP Start Acknowledgement
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
When developing a Custom Resource for Directory Registration, I learned the not-easy-to-find detail that CF will retry the call 2x (once per minute, plus the initial request) if it doesn't get a response. As far as I can tell the only valid response is `SUCCESS` or `FAILURE` (which hadn't happened yet) so I'm stuck dealing with e.g. duplicate `delete` requests while the target resource is `DEREGISTERING`.
Within CF, there's a tension between idempotency and the initial state of a resource. For example, you can't delete a deleted nested stack. Is that a failure of idempotency (the stack is deleted i.e. in the idempotent end state) or a reasonable response since the stack was not in a valid state for delete? In theory, a directory in the `DEREGISTERED` state is an equivalent situation and `DEREGISTERING` is ambiguous but equivalent in my opinion. The system is not in the expected state so there isn't a resource available to deregister. And `DEREGISTERED` can definitely occur if a second call starts while the resource is `DEREGISTERED` but before the first request un-sleeps to report the state.
To reduce this complexity, I'd like a way to acknowledge that the CF method has started. This will suppress the retries so I can provide reasonable feedback based on the resource's state. After an adoption period, this could even be used to change the timeout for Custom Resources. If a resource doesn't acknowledge the start, it could be held to a much shorter timeout (perhaps 5m with the 2 retries). A Lambda that acknowledges (hopefully inside a bare error block so a response is guaranteed) gets the standard 1h delay -- and could even be given the option to request a longer timeout as part of that acknowledgement.
## 6. Category (required) - Will help with tagging and be easier to find by other users to +1
5. Management (CloudTrail, Config...)
Contributor guide
Assessment
This issue has not been assessed yet.