public abstract class AbstractCustomResourceHandler extends java.lang.Object implements com.amazonaws.services.lambda.runtime.RequestHandler<com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent,Response>
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCustomResourceHandler()
Creates a new Handler that uses the default HTTP client for communicating with custom CloudFormation resources.
|
protected |
AbstractCustomResourceHandler(software.amazon.awssdk.http.SdkHttpClient client)
Creates a new Handler that uses the provided HTTP client for communicating with custom CloudFormation resources.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract Response |
create(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event,
com.amazonaws.services.lambda.runtime.Context context)
Returns the response object to send to the custom CloudFormation resource upon its creation.
|
protected abstract Response |
delete(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event,
com.amazonaws.services.lambda.runtime.Context context)
Returns the response object to send to the custom CloudFormation resource upon its deletion.
|
Response |
handleRequest(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event,
com.amazonaws.services.lambda.runtime.Context context)
Generates the appropriate response object based on the event type and sends it as a response to the custom
cloud formation resource using the URL provided within the event.
|
protected void |
onSendFailure(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event,
com.amazonaws.services.lambda.runtime.Context context,
Response response,
java.lang.Exception exception)
Invoked when there is an error sending a response to the custom cloud formation resource.
|
protected abstract Response |
update(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event,
com.amazonaws.services.lambda.runtime.Context context)
Returns the response object to send to the custom CloudFormation resource upon its modification.
|
protected AbstractCustomResourceHandler()
protected AbstractCustomResourceHandler(software.amazon.awssdk.http.SdkHttpClient client)
client - cannot be nullpublic final Response handleRequest(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event, com.amazonaws.services.lambda.runtime.Context context)
handleRequest in interface com.amazonaws.services.lambda.runtime.RequestHandler<com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent,Response>event - custom resources create/update/delete eventcontext - lambda execution contextprotected void onSendFailure(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event,
com.amazonaws.services.lambda.runtime.Context context,
Response response,
java.lang.Exception exception)
The method itself does nothing but subclasses may override to provide additional logging or handling logic. All arguments provided are for contextual purposes.
Exceptions should not be thrown by this method.
event - the eventcontext - execution contextresponse - the response object that was attempted to be sent to the custom resourceexception - the exception caught when attempting to call the custom resource URLprotected abstract Response create(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event, com.amazonaws.services.lambda.runtime.Context context)
event - an event of request type Createcontext - execution contextprotected abstract Response update(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event, com.amazonaws.services.lambda.runtime.Context context)
event - an event of request type Updatecontext - execution contextprotected abstract Response delete(com.amazonaws.services.lambda.runtime.events.CloudFormationCustomResourceEvent event, com.amazonaws.services.lambda.runtime.Context context)
event - an event of request type Deletecontext - execution contextCopyright © 2023. All rights reserved.