Loading modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceEditForm.php +1 −0 Original line number Diff line number Diff line Loading @@ -586,6 +586,7 @@ class InstanceEditForm extends AwsCloudContentForm { '#default_value' => $is_user_data_binary ? $entity->getUserData() : $user_data_decoded, '#required' => FALSE, '#weight' => $weight++, '#disabled' => $disabled, ]; $form['options']['user_data_base64_encoded'] = [ Loading modules/cloud_service_providers/aws_cloud/src/Form/Ec2/SecurityGroupEditForm.php +0 −1 Original line number Diff line number Diff line Loading @@ -410,7 +410,6 @@ class SecurityGroupEditForm extends AwsCloudContentForm { $group = []; // Use GroupID if non-default VPC or EC2-Classic. // For other permissions, use Group Name. $vpc_id = $this->entity->getVpcId(); if (!empty($ip_permission->getGroupId())) { $group['GroupId'] = $ip_permission->getGroupId(); } Loading modules/cloud_service_providers/aws_cloud/src/Form/Vpc/InternetGatewayDetachForm.php +0 −35 Original line number Diff line number Diff line Loading @@ -33,12 +33,10 @@ class InternetGatewayDetachForm extends AwsDeleteForm { // Get module name. $module_name = $this->getModuleName($entity); $vpc = $this->getVpcName($entity->getVpcId(), $module_name, $entity->getCloudContext()); $msg = '<h2>Internet gateway information:</h2>'; $internet_gateway_id = $entity->getInternetGatewayId(); $name = $entity->getName(); $vpc_id = $entity->getVpcId(); $internet_gateway_link = $this->entityLinkRenderer->renderViewElement( Loading Loading @@ -157,37 +155,4 @@ class InternetGatewayDetachForm extends AwsDeleteForm { $this->clearCacheValues($entity->getCacheTags()); } /** * Helper method to get VPC name from database. * * @param string $vpc_id * The VPC ID. * @param string $module_name * Module name. * @param string $cloud_context * Cloud context. * * @return string * The VPC name. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ private function getVpcName($vpc_id, $module_name, $cloud_context): string { $name = ''; $vpcs = $this->entityTypeManager ->getStorage("{$module_name}_vpc") ->loadByProperties([ 'vpc_id' => $vpc_id, 'cloud_context' => $cloud_context, ]); if (count($vpcs)) { /** @var \Drupal\aws_cloud\Entity\Vpc\Vpc $vpc */ $vpc = array_shift($vpcs); $name = $vpc->getName(); } return $name; } } modules/cloud_service_providers/aws_cloud/src/Form/Vpc/VpcEditForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,7 @@ class VpcEditForm extends AwsCloudContentForm { $entity->save(); // Update the VPC. $result = $this->ec2Service->updateVpcs([ $this->ec2Service->updateVpcs([ 'VpcId' => $entity->getVpcId(), ], FALSE); Loading modules/cloud_service_providers/aws_cloud/src/Service/Ec2/Ec2BatchOperations.php +0 −2 Original line number Diff line number Diff line Loading @@ -1345,7 +1345,6 @@ class Ec2BatchOperations { : NULL; $timestamp = time(); $name = $ec2Service->getTagName($transit_gateway_route_table, $transit_gateway_route_table_id); $entity_id = \Drupal::service('cloud')->getEntityId($cloud_context, 'aws_cloud_transit_gateway_route', 'transit_gateway_route_table_id', $transit_gateway_route_table_id); $uid = $ec2Service->getUidTagValue($transit_gateway_route_table, 'aws_cloud_transit_gateway_route'); Loading Loading @@ -1473,7 +1472,6 @@ class Ec2BatchOperations { $zone_id = $availability_zone['ZoneId'] ?? NULL; $timestamp = time(); $name = $ec2Service->getTagName($availability_zone, $zone_id); $entity_id = \Drupal::service('cloud')->getEntityId($cloud_context, 'aws_cloud_availability_zone', 'zone_id', $zone_id); $uid = $ec2Service->getUidTagValue($availability_zone, 'aws_cloud_availability_zone'); Loading Loading
modules/cloud_service_providers/aws_cloud/src/Form/Ec2/InstanceEditForm.php +1 −0 Original line number Diff line number Diff line Loading @@ -586,6 +586,7 @@ class InstanceEditForm extends AwsCloudContentForm { '#default_value' => $is_user_data_binary ? $entity->getUserData() : $user_data_decoded, '#required' => FALSE, '#weight' => $weight++, '#disabled' => $disabled, ]; $form['options']['user_data_base64_encoded'] = [ Loading
modules/cloud_service_providers/aws_cloud/src/Form/Ec2/SecurityGroupEditForm.php +0 −1 Original line number Diff line number Diff line Loading @@ -410,7 +410,6 @@ class SecurityGroupEditForm extends AwsCloudContentForm { $group = []; // Use GroupID if non-default VPC or EC2-Classic. // For other permissions, use Group Name. $vpc_id = $this->entity->getVpcId(); if (!empty($ip_permission->getGroupId())) { $group['GroupId'] = $ip_permission->getGroupId(); } Loading
modules/cloud_service_providers/aws_cloud/src/Form/Vpc/InternetGatewayDetachForm.php +0 −35 Original line number Diff line number Diff line Loading @@ -33,12 +33,10 @@ class InternetGatewayDetachForm extends AwsDeleteForm { // Get module name. $module_name = $this->getModuleName($entity); $vpc = $this->getVpcName($entity->getVpcId(), $module_name, $entity->getCloudContext()); $msg = '<h2>Internet gateway information:</h2>'; $internet_gateway_id = $entity->getInternetGatewayId(); $name = $entity->getName(); $vpc_id = $entity->getVpcId(); $internet_gateway_link = $this->entityLinkRenderer->renderViewElement( Loading Loading @@ -157,37 +155,4 @@ class InternetGatewayDetachForm extends AwsDeleteForm { $this->clearCacheValues($entity->getCacheTags()); } /** * Helper method to get VPC name from database. * * @param string $vpc_id * The VPC ID. * @param string $module_name * Module name. * @param string $cloud_context * Cloud context. * * @return string * The VPC name. * * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ private function getVpcName($vpc_id, $module_name, $cloud_context): string { $name = ''; $vpcs = $this->entityTypeManager ->getStorage("{$module_name}_vpc") ->loadByProperties([ 'vpc_id' => $vpc_id, 'cloud_context' => $cloud_context, ]); if (count($vpcs)) { /** @var \Drupal\aws_cloud\Entity\Vpc\Vpc $vpc */ $vpc = array_shift($vpcs); $name = $vpc->getName(); } return $name; } }
modules/cloud_service_providers/aws_cloud/src/Form/Vpc/VpcEditForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,7 @@ class VpcEditForm extends AwsCloudContentForm { $entity->save(); // Update the VPC. $result = $this->ec2Service->updateVpcs([ $this->ec2Service->updateVpcs([ 'VpcId' => $entity->getVpcId(), ], FALSE); Loading
modules/cloud_service_providers/aws_cloud/src/Service/Ec2/Ec2BatchOperations.php +0 −2 Original line number Diff line number Diff line Loading @@ -1345,7 +1345,6 @@ class Ec2BatchOperations { : NULL; $timestamp = time(); $name = $ec2Service->getTagName($transit_gateway_route_table, $transit_gateway_route_table_id); $entity_id = \Drupal::service('cloud')->getEntityId($cloud_context, 'aws_cloud_transit_gateway_route', 'transit_gateway_route_table_id', $transit_gateway_route_table_id); $uid = $ec2Service->getUidTagValue($transit_gateway_route_table, 'aws_cloud_transit_gateway_route'); Loading Loading @@ -1473,7 +1472,6 @@ class Ec2BatchOperations { $zone_id = $availability_zone['ZoneId'] ?? NULL; $timestamp = time(); $name = $ec2Service->getTagName($availability_zone, $zone_id); $entity_id = \Drupal::service('cloud')->getEntityId($cloud_context, 'aws_cloud_availability_zone', 'zone_id', $zone_id); $uid = $ec2Service->getUidTagValue($availability_zone, 'aws_cloud_availability_zone'); Loading