Documentation
¶
Overview ¶
Package handler contains types that are passed into and out of a resource provider's CRUDL functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProgressEvent ¶
type ProgressEvent struct {
// The status indicates whether the handler has reached a terminal state or is
// still computing and requires more time to complete.
OperationStatus Status
// If OperationStatus is FAILED or IN_PROGRESS, an error code should be provided.
HandlerErrorCode string
// The handler can (and should) specify a contextual information message which
// can be shown to callers to indicate the nature of a progress transition or
// callback delay; for example a message indicating "propagating to edge."
Message string
// The callback context is an arbitrary datum which the handler can return in an
// IN_PROGRESS event to allow the passing through of additional state or
// metadata between subsequent retries; for example to pass through a Resource
// identifier which can be used to continue polling for stabilization
CallbackContext map[string]interface{}
// A callback will be scheduled with an initial delay of no less than the number
// of seconds specified in the progress event. Set this value to <= 0 to
// indicate no callback should be made.
CallbackDelaySeconds int64
// The output resource instance populated by a READ/LIST for synchronous results
// and by CREATE/UPDATE/DELETE for final response validation/confirmation
ResourceModel interface{}
}
ProgressEvent represent the progress of CRUD handlers.
func NewFailedEvent ¶
func NewFailedEvent(err error) ProgressEvent
NewFailedEvent creates a generic failure progress event based on the error passed in.
func NewProgressEvent ¶
func NewProgressEvent() ProgressEvent
NewEvent creates a new event with a default OperationStatus of Unkown
type Request ¶
type Request struct {
// The logical ID of the resource in the CloudFormation stack
LogicalResourceID string
// The callback context is an arbitrary datum which the handler can return in an
// IN_PROGRESS event to allow the passing through of additional state or
// metadata between subsequent retries; for example to pass through a Resource
// identifier which can be used to continue polling for stabilization
CallbackContext map[string]interface{}
// An authenticated AWS session that can be used with the AWS Go SDK
Session *session.Session
// contains filtered or unexported fields
}
Request is passed to actions with customer related data such as resource states
func NewRequest ¶
func NewRequest(id string, ctx map[string]interface{}, sess *session.Session, previousBody, body []byte) Request
NewRequest returns a new Request based on the provided parameters
func (*Request) Unmarshal ¶
Unmarshal populates the provided interface with the current properties of the resource
func (*Request) UnmarshalPrevious ¶
UnmarshalPrevious populates the provided interface with the previous properties of the resource
type Status ¶
type Status string
Status represents the status of the handler.
const ( // UnknownStatus represents all states that aren't covered // elsewhere UnknownStatus Status = "UNKNOWN" // InProgress should be returned when a resource provider // is in the process of being operated on. InProgress Status = "IN_PROGRESS" // Success should be returned when the resource provider // has finished it's operation. Success Status = "SUCCESS" // Failed should be returned when the resource provider // has failed Failed Status = "FAILED" )