private void deleteProfilingGroup()

in aws-codeguruprofiler-profilinggroup/src/main/java/software/amazon/codeguruprofiler/profilinggroup/CreateHandler.java [120:133]


    private void deleteProfilingGroup(AmazonWebServicesClientProxy proxy, Logger logger,
                                      String pgName, String awsAccountId, CodeGuruProfilerException exception) {
        DeleteProfilingGroupRequest deletePgRequest = DeleteProfilingGroupRequest.builder().profilingGroupName(pgName).build();
        try {
            proxy.injectCredentialsAndInvokeV2(deletePgRequest, profilerClient::deleteProfilingGroup);
            logger.log(format("%s [%s] for accountId [%s] has succeeded when deleting the profiling group!",
                ResourceModel.TYPE_NAME, pgName, awsAccountId));
        } catch (CodeGuruProfilerException deleteException) {
            logger.log(format("%s [%s] for accountId [%s] has failed when deleting the profiling group!",
                ResourceModel.TYPE_NAME, pgName, awsAccountId));
            exception.addSuppressed(deleteException);
            throw exception;
        }
    }