Skip to content
Snippets Groups Projects
Commit a1c167f7 authored by xiaohua guan's avatar xiaohua guan Committed by Yas Naoi
Browse files

Issue #3009878 by Xiaohua Guan, yas, baldwinlouie: Can't delete Elastic IP

parent 9d42c230
No related branches found
No related tags found
No related merge requests found
......@@ -31,10 +31,14 @@ class ElasticIpDeleteForm extends AwsDeleteForm {
$allocation_id = $entity->allocation_id();
$public_ip = $entity->public_ip();
if ($this->awsEc2Service->releaseAddress([
'AllocationId' => isset($allocation_id) ? $entity->allocation_id() : '',
'PublicIp' => isset($public_ip) ? $entity->public_ip() : '',
]) != NULL
$params = [];
if ($entity->domain() == 'standard' && !empty($public_ip)) {
$params['PublicIp'] = $public_ip;
}
else if ($entity->domain() == 'vpc' && !empty($allocation_id)) {
$params['AllocationId'] = $allocation_id;
}
if (!empty($params) && $this->awsEc2Service->releaseAddress($params) != NULL
) {
$message = $this->t('The @type "@label" has been deleted.', [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment