{"modulePath":"github.com/grumpy-programmer/aws-lambda-go","version":"v1.10.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cfn\n\n## Types\n\n```go\ntype CustomResourceFunction func(context.Context, Event) (physicalResourceID string, data map[string]interface{}, err error)\n```\nCustomResourceFunction is a representation of the customer's Custom Resource function. LambdaWrap will take the returned values and turn them into a response to be sent to CloudFormation.\n\n```go\ntype CustomResourceLambdaFunction func(context.Context, Event) (reason string, err error)\n```\nCustomResourceLambdaFunction is a standard form Lambda for a Custom Resource.\n\n```go\nfunc LambdaWrap(lambdaFunction CustomResourceFunction) (fn CustomResourceLambdaFunction)\n```\nLambdaWrap returns a CustomResourceLambdaFunction which is something lambda.Start() will understand. The purpose of doing this is so that Response Handling boiler plate is taken away from the customer and it makes writing a Custom Resource simpler.\n\n\tfunc myLambda(ctx context.Context, event cfn.Event) (physicalResourceID string, data map[string]interface{}, err error) {\n\t\tphysicalResourceID = \"arn:....\"\n\t\treturn\n\t}\n\n\tfunc main() {\n\t\tlambda.Start(cfn.LambdaWrap(myLambda))\n\t}\n\n```go\ntype Event struct {\n\tRequestType           RequestType            `json:\"RequestType\"`\n\tRequestID             string                 `json:\"RequestId\"`\n\tResponseURL           string                 `json:\"ResponseURL\"`\n\tResourceType          string                 `json:\"ResourceType\"`\n\tPhysicalResourceID    string                 `json:\"PhysicalResourceId,omitempty\"`\n\tLogicalResourceID     string                 `json:\"LogicalResourceId\"`\n\tStackID               string                 `json:\"StackId\"`\n\tResourceProperties    map[string]interface{} `json:\"ResourceProperties\"`\n\tOldResourceProperties map[string]interface{} `json:\"OldResourceProperties,omitempty\"`\n}\n```\nEvent is a representation of a Custom Resource request\n\n```go\ntype RequestType string\n```\nRequestType represents the types of requests that come from a CloudFormation stack being run\n\n```go\nconst (\n\tRequestCreate RequestType = \"Create\"\n\tRequestUpdate RequestType = \"Update\"\n\tRequestDelete RequestType = \"Delete\"\n)\n```\n\n```go\ntype Response struct {\n\tStatus             StatusType             `json:\"Status\"`\n\tRequestID          string                 `json:\"RequestId\"`\n\tLogicalResourceID  string                 `json:\"LogicalResourceId\"`\n\tStackID            string                 `json:\"StackId\"`\n\tPhysicalResourceID string                 `json:\"PhysicalResourceId\"`\n\tReason             string                 `json:\"Reason,omitempty\"`\n\tNoEcho             bool                   `json:\"NoEcho,omitempty\"`\n\tData               map[string]interface{} `json:\"Data,omitempty\"`\n\t// contains filtered or unexported fields\n}\n```\nResponse is a representation of a Custom Resource response expected by CloudFormation.\n\n```go\nfunc NewResponse(r *Event) *Response\n```\nNewResponse creates a Response with the relevant verbatim copied data from a Event\n\n```go\nfunc (r *Response) Send() error\n```\nSend will send the Response to the given URL using the default HTTP client\n\n```go\ntype StatusType string\n```\nStatusType represents a CloudFormation response status\n\n```go\nconst (\n\tStatusSuccess StatusType = \"SUCCESS\"\n\tStatusFailed  StatusType = \"FAILED\"\n)\n```\n\n","path":"github.com/grumpy-programmer/aws-lambda-go/cfn","name":"cfn","synopsis":"","isRedistributable":true}
