Search in sources :

Example 1 with DeleteFunctionRequest

use of software.amazon.awssdk.services.lambda.model.DeleteFunctionRequest in project aws-doc-sdk-examples by awsdocs.

the class DeleteFunction method deleteLambdaFunction.

// snippet-start:[lambda.java2.delete.main]
public static void deleteLambdaFunction(LambdaClient awsLambda, String functionName) {
    try {
        // Setup an DeleteFunctionRequest
        DeleteFunctionRequest request = DeleteFunctionRequest.builder().functionName(functionName).build();
        awsLambda.deleteFunction(request);
        System.out.println("The " + functionName + " function was deleted");
    } catch (LambdaException e) {
        System.err.println(e.getMessage());
        System.exit(1);
    }
}
Also used : LambdaException(software.amazon.awssdk.services.lambda.model.LambdaException) DeleteFunctionRequest(software.amazon.awssdk.services.lambda.model.DeleteFunctionRequest)

Aggregations

DeleteFunctionRequest (software.amazon.awssdk.services.lambda.model.DeleteFunctionRequest)1 LambdaException (software.amazon.awssdk.services.lambda.model.LambdaException)1