clcdkcr

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler[I, O any] interface {
	Type() string
	Create(ctx context.Context, ev cfn.Event, in I) (string, O, bool, error)
	Update(ctx context.Context, ev cfn.Event, in I, inOld I) (string, O, bool, error)
	Delete(ctx context.Context, ev cfn.Event, in I) (O, bool, error)
}

Handler for CRUD operations.

type Output

type Output struct {
	// The allocated/assigned physical ID of the resource. If omitted for Create events, the event's RequestId
	// will be used. For Update, the current physical ID will be used. If a different value is returned,
	// CloudFormation will follow with a subsequent Delete for the previous ID (resource replacement).
	// For Delete, it will always return the current physical resource ID, and if the user returns a different one,
	// an error will occur.
	PhysicalResourceID string `json:"PhysicalResourceId"`
	// Resource attributes, which can later be retrieved through Fn::GetAtt on the custom resource object.
	Data map[string]any `json:"Data"`
	// Whether to mask the output of the custom resource when retrieved by using the Fn::GetAtt function.
	NoEcho bool `json:"NoEcho"`
}

Output as is expected to be returned from a custom resource handler implementation.

type Result

type Result struct {
	// Visited returns which handlers where visited.
	Visited []string
	// Handled is set to the resource that handled it.
	Handled string
	// Err holds any error while handling the event
	Err error
	// Output as returned from the lambda handler
	Output
}

Result of handling.

func Handle1

func Handle1[
	I1, O1 any,
](
	ctx context.Context,
	logs *zap.Logger,
	val *validator.Validate,
	ev cfn.Event,
	h1 Handler[I1, O1],
) (res Result, err error)

Handle1 handles custom resource events for 1 resource type.

func Handle2

func Handle2[
	I1, O1 any,
	I2, O2 any,
](
	ctx context.Context,
	logs *zap.Logger,
	val *validator.Validate,
	ev cfn.Event,
	h1 Handler[I1, O1],
	h2 Handler[I2, O2],
) (res Result, err error)

Handle2 handles custom resource events for 2 resource types.

func Handle3

func Handle3[
	I1, O1 any,
	I2, O2 any,
	I3, O3 any,
](
	ctx context.Context,
	logs *zap.Logger,
	val *validator.Validate,
	ev cfn.Event,
	h1 Handler[I1, O1],
	h2 Handler[I2, O2],
	h3 Handler[I3, O3],
) (res Result, err error)

Handle3 handles custom resource events for 3 resource types.

func Handle4

func Handle4[
	I1, O1 any,
	I2, O2 any,
	I3, O3 any,
	I4, O4 any,
](
	ctx context.Context,
	logs *zap.Logger,
	val *validator.Validate,
	ev cfn.Event,
	h1 Handler[I1, O1],
	h2 Handler[I2, O2],
	h3 Handler[I3, O3],
	h4 Handler[I4, O4],
) (res Result, err error)

Handle4 handles custom resource events for 4 resource types.

func Handle5

func Handle5[
	I1, O1 any,
	I2, O2 any,
	I3, O3 any,
	I4, O4 any,
	I5, O5 any,
](
	ctx context.Context,
	logs *zap.Logger,
	val *validator.Validate,
	ev cfn.Event,
	h1 Handler[I1, O1],
	h2 Handler[I2, O2],
	h3 Handler[I3, O3],
	h4 Handler[I4, O4],
	h5 Handler[I5, O5],
) (res Result, err error)

Handle5 handles custom resource events for 5 resource types.

func Handle6

func Handle6[
	I1, O1 any,
	I2, O2 any,
	I3, O3 any,
	I4, O4 any,
	I5, O5 any,
	I6, O6 any,
](
	ctx context.Context,
	logs *zap.Logger,
	val *validator.Validate,
	ev cfn.Event,
	h1 Handler[I1, O1],
	h2 Handler[I2, O2],
	h3 Handler[I3, O3],
	h4 Handler[I4, O4],
	h5 Handler[I5, O5],
	h6 Handler[I6, O6],
) (res Result, err error)

Handle6 handles custom resource events for 6 resource types.

type UnsupportedRequestTypeError

type UnsupportedRequestTypeError struct {
	// contains filtered or unexported fields
}

UnsupportedRequestTypeError is returned when the request is not supported.

func (UnsupportedRequestTypeError) Error

type UnsupportedResourceTypeError

type UnsupportedResourceTypeError struct {
	// contains filtered or unexported fields
}

UnsupportedResourceTypeError is returned when the resource is not supported.

func (UnsupportedResourceTypeError) Error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL