Documentation
¶
Index ¶
Constants ¶
View Source
const FALLBACK_STATE_TABLE_NAME string = "aws-fail-az-state-table"
The default table name to store resource states
View Source
const STATE_TABLE_SCHEMA_VERSION string = "2023-09-06"
The current schema version of the state table
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type QueryStatesInput ¶
Represents the input of a QueryStates operation
type ResourceState ¶
type ResourceState struct { Namespace string `dynamodbav:"namespace"` Key string `dynamodbav:"key"` ResourceKey string `dynamodbav:"resourceKey"` ResourceType string `dynamodbav:"resourceType"` CreatedTime int64 `dynamodbav:"createdTime"` State []byte `dynamodbav:"state"` }
A structure to represent an AWS resource's state
func (ResourceState) GetKey ¶
func (state ResourceState) GetKey() map[string]types.AttributeValue
GetKey returns a representation of the Dynamodb Table key of the main index
type StateManager ¶
type StateManager interface { // Initialize the state manager by establishing the connection with Dynamodb // This function only needs to be called once for every object that implements // StateManager. Further calls will have no effect Initialize() error // Save a new state in storage Save(resourceType string, resourceKey string, state []byte) error // Reads a single state object from storage // Returns a pointer to a ResourceState object or an error if the state is not found GetState(resourceType string, resourceKey string) (*ResourceState, error) // QueryStates finds state objects in storage by resourceType or resourceKey // Returns a list of ResourceState objects found in storage QueryStates(params *QueryStatesInput) ([]ResourceState, error) // Removes a single state object from storage RemoveState(stateObj ResourceState) error }
StateManager provides the API to manage resource states in Dynamodb
func NewStateManager ¶
func NewStateManager(provider awsapis.AWSProvider, namespace string) (StateManager, error)
Click to show internal directories.
Click to hide internal directories.