Integrating with PowerDown
PowerDown invokes user-defined hooks in response to resource lifecycle power up and down events. You can define one or more hooks per PowerDown cloud connection and then attach them to the appropriate resources.
Hooks are invoked only for resources that have attached to the hook and are called whenever the resource changes state. You can attach resources from the Modify Resource page once the hook has been created.
HTTP and Lambda hooks are invoked with context information regarding the resource and the resource state change.
When the HTTP or Lambda hook is invoked, a full resource context is passed as data. This context includes the following properties:
- account — account name
- desiredState — desired state for the resource
- details — extra resource details
- event — resource change event name
- id — resource unique numeric ID
- name — unique resource name
- rate — calculated cloud provider charge rate in $/hr
- region — cloud provider region
- scale — Auto Scale and container service scaling overrides
- state — actual state for the resource
- tags — cloud provider resource tags
- time — time of the event
- type — resource type
Before a resource is powered up or down, hooks are invoked with the resource/change/before event. After a resource has powered up or down, hooks are invoked with the resource/change/after event.