GitXplorerGitXplorer
j

miltons-red-stapler

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
63cc7d78ed630c0ba0a9c4bce61f6f272e5093c6

test template

jjaymccon committed 4 years ago
Unverified
2fea571e7fb5eef50e4a1da2ede77411e5b07f2c

async create handler

jjaymccon committed 4 years ago
Unverified
d5e90542171971cdd40e1931593da2a8e4ded036

simple handlers

jjaymccon committed 4 years ago
Unverified
ddd115d0b890e5ab6934ac92d8b88d24d4836272

cfn generate

jjaymccon committed 4 years ago
Unverified
1fc3b00c8da2a2346013efe9816e73157fe8c7f9

define schema

jjaymccon committed 4 years ago
Unverified
3a117c613f43d328c3f7179114d308222bb23447

cfn init

jjaymccon committed 4 years ago

README

The README file for this repository.

Miltons::Red::Stapler

Congratulations on starting development! Next steps:

  1. Write the JSON schema describing your resource, miltons-red-stapler.json
  2. Implement your resource handlers in miltons_red_stapler/handlers.py

Don't modify models.py by hand, any modifications will be overwritten when the generate or package commands are run.

Implement CloudFormation resource here. Each function must always return a ProgressEvent.

ProgressEvent(
    # Required
    # Must be one of OperationStatus.IN_PROGRESS, OperationStatus.FAILED, OperationStatus.SUCCESS
    status=OperationStatus.IN_PROGRESS,
    # Required on SUCCESS (except for LIST where resourceModels is required)
    # The current resource model after the operation; instance of ResourceModel class
    resourceModel=model,
    resourceModels=None,
    # Required on FAILED
    # Customer-facing message, displayed in e.g. CloudFormation stack events
    message="",
    # Required on FAILED: a HandlerErrorCode
    errorCode=HandlerErrorCode.InternalFailure,
    # Optional
    # Use to store any state between re-invocation via IN_PROGRESS
    callbackContext={},
    # Required on IN_PROGRESS
    # The number of seconds to delay before re-invocation
    callbackDelaySeconds=0,
)

Failures can be passed back to CloudFormation by either raising an exception from cloudformation_cli_python_lib.exceptions, or setting the ProgressEvent's status to OperationStatus.FAILED and errorCode to one of cloudformation_cli_python_lib.HandlerErrorCode. There is a static helper function, ProgressEvent.failed, for this common case.

What's with the type hints?

We hope they'll be useful for getting started quicker with an IDE that support type hints. Type hints are optional - if your code doesn't use them, it will still work.