The configuration type for this custom stack handler
The state type that extends CustomStackState, representing the current state of the stack
ReadonlycreateCreates a new instance of the custom stack in the target environment.
This function should:
The implementation should ensure idempotency where possible and provide detailed error information if the creation fails.
Configuration, parameters, tags, and context for creation
A promise resolving to the created stack state or an error result
ReadonlydeleteRemoves the custom stack and all its associated resources from the target environment.
This function should:
The implementation should be as thorough as possible in cleanup while being resilient to partial failures and resource dependencies.
Current state, configuration, and context for deletion
A promise resolving to success or detailed error information
Optional ReadonlygetAnalyzes and returns the changes that would be applied to bring the stack from its current state to the desired state defined by the configuration.
This function is invoked during deployment of existing stacks to:
The implementation should compare the current stack state with the desired configuration and return a detailed list of changes that would be applied. The format and granularity of changes is up to the implementation.
Implementing this function is optional; if not provided, Takomo will assume that changes are always present but no detailed change information is available.
Current state, desired configuration, and context for comparison
A promise resolving to the detected changes or an error result
Optional ReadonlygetRetrieves the current state of the custom stack from the target environment.
This function is crucial for determining the stack's lifecycle operations:
The implementation should query the actual infrastructure to determine the real state, not just return cached or assumed values.
Implementing this function is optional; if not provided, the stack will be assumed to be in a "UNKNOWN" state.
Configuration and context needed to query the stack state
A promise resolving to the current state or an error result
ReadonlyparseValidates and parses the raw configuration for this custom stack type.
This function is responsible for:
The parsed configuration object will be passed to all subsequent operations, such as create, update, and delete.
Raw configuration data and parsing context
A promise resolving to the parsed configuration or validation errors
ReadonlytypeThe type identifier for this custom stack handler.
This unique identifier is used to match custom stack configurations with their corresponding handler implementation. It should be a descriptive string that clearly identifies the type of infrastructure or deployment tool this handler manages.
ReadonlyupdateUpdates an existing custom stack to match the desired configuration.
This function should:
The implementation should handle update conflicts gracefully and provide detailed information about what changes were actually applied.
Current state, desired configuration, and context for update
A promise resolving to the updated stack state or an error result
Interface for handling custom stack operations in Takomo.
A custom stack handler provides the core functionality for managing custom stacks throughout their lifecycle, including creation, updates, deletion, and state management. Custom stack handlers enable extending Takomo's capabilities beyond standard CloudFormation stacks to support other infrastructure provisioning tools or custom deployment logic.