github.com/aws-cloudformation/cloudformation-cli-go-plugin@v1.2.0/python/rpdk/go/templates/stubHandler.go.tple (about)

     1  package resource
     2  
     3  import (
     4  	"errors"
     5  
     6  	"github.com/aws-cloudformation/cloudformation-cli-go-plugin/cfn/handler"
     7  )
     8  
     9  {% for method in ("Create", "Read", "Update", "Delete", "List") %}
    10  
    11  // {{ method }} handles the {{ method }} event from the Cloudformation service.
    12  func {{ method }}(req handler.Request, prevModel *Model, currentModel *Model) (handler.ProgressEvent, error) {
    13      // Add your code here:
    14      // * Make API calls (use req.Session)
    15      // * Mutate the model
    16      // * Check/set any callback context (req.CallbackContext / response.CallbackContext)
    17      // * Access the resource's configuration with the Configuration function. (c, err := Configuration(req))
    18  
    19      /*
    20          // Construct a new handler.ProgressEvent and return it
    21          response := handler.ProgressEvent{
    22              OperationStatus: handler.Success,
    23              Message: "{{ method }} complete",
    24              ResourceModel: currentModel,
    25          }
    26  
    27          return response, nil
    28      */
    29  
    30      // Not implemented, return an empty handler.ProgressEvent
    31      // and an error
    32      return handler.ProgressEvent{}, errors.New("Not implemented: {{ method }}")
    33  }
    34  {% endfor %}