use of com.amazonaws.services.elasticloadbalancingv2.model.DeleteLoadBalancerResult in project cloudbreak by hortonworks.
the class AwsNativeLoadBalancerResourceBuilder method delete.
@Override
public CloudResource delete(AwsContext context, AuthenticatedContext auth, CloudResource resource) throws Exception {
LOGGER.info("Deleting load balancer ('{}') from provider side", resource.getReference());
AmazonElasticLoadBalancingClient loadBalancingClient = context.getLoadBalancingClient();
DeleteLoadBalancerRequest deleteLoadBalancerRequest = new DeleteLoadBalancerRequest().withLoadBalancerArn(resource.getReference());
DeleteLoadBalancerResult deleteResult = awsMethodExecutor.execute(() -> loadBalancingClient.deleteLoadBalancer(deleteLoadBalancerRequest), null);
return deleteResult != null ? resource : null;
}
Aggregations