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);
}
}
Aggregations