IResourceAction <T>
Type parameters
- T: UnknownResource
Hierarchy
- ANodeAction
- IResourceAction
Index
Properties
Methods
Properties
optionalactionTimeoutInMs
How long the action may run before Octo aborts it.
readonlyinheritedcontainer
The container, for resolving whatever services or SDK clients the action needs.
Methods
filter
Whether this action handles the given diff. Typically a check on the diff's resource, field, and action.
Parameters
diff: Diff
Returns boolean
handle
Performs the change against the cloud provider.
Parameters
diff: Diff
Returns Promise<void> | Promise<T[response]>
What the provider reported back, which Octo records as the resource's
response. Return nothing when the action has no output, e.g. a delete.
inheritedlog
To report what the action is doing for
diff, the diff itshandle()was given. The message is emitted as an ActionEvent, so it is picked up by whatever listeners the command has, rather than written straight to the console.Parameters
diff: Diff
message: string
metadata: Record<string, unknown> = {}
Returns void
A resource action creates, updates, or destroys one piece of real infrastructure.
Actions belong to external resources - the ones Octo drives itself through a cloud provider's SDK. A resource whose lifecycle terraform manages (ATerraformResource) must not have one; registering an action for it throws.
The class extends ANodeAction, which gives it the container and
log(). Register it with Action, and a Factory to construct it.Resources
Definition of Actions.