use of com.amazonaws.services.elasticloadbalancingv2.model.DeleteTargetGroupRequest in project cloudbreak by hortonworks.
the class AwsNativeLoadBalancerTargetGroupResourceBuilder method delete.
@Override
public CloudResource delete(AwsContext context, com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext auth, CloudResource resource) throws Exception {
LOGGER.info("Deleting load balancer's ('{}') target group with arn '{}'", resource.getReference(), resource.getInstanceId());
AmazonElasticLoadBalancingClient loadBalancingClient = context.getLoadBalancingClient();
DeleteTargetGroupRequest deleteTargetGroupRequest = new DeleteTargetGroupRequest().withTargetGroupArn(resource.getReference());
DeleteTargetGroupResult deleteResult = awsMethodExecutor.execute(() -> loadBalancingClient.deleteTargetGroup(deleteTargetGroupRequest), null);
return deleteResult != null ? resource : null;
}
Aggregations