if (getRootDeviceType() != null) sb.append("RootDeviceType: ").append(getRootDeviceType()).append(","); if (getSecurityGroups() != null) sb.append("SecurityGroups: ").append(getSecurityGroups()).append(","); if (getSourceDestCheck() != null) sb.append("SourceDestCheck: ").append(getSourceDestCheck()).append(",");
hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode()); hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode()); hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getSourceDestCheck() == null) ? 0 : getSourceDestCheck().hashCode()); hashCode = prime * hashCode + ((getSpotInstanceRequestId() == null) ? 0 : getSpotInstanceRequestId().hashCode());
/** * One or more security groups for the instance. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param securityGroups One or more security groups for the instance. * * @return A reference to this updated object so that method calls can be chained * together. */ public Instance withSecurityGroups(GroupIdentifier... securityGroups) { if (getSecurityGroups() == null) setSecurityGroups(new java.util.ArrayList<GroupIdentifier>(securityGroups.length)); for (GroupIdentifier value : securityGroups) { getSecurityGroups().add(value); } return this; }
if (other.getRootDeviceType() != null && other.getRootDeviceType().equals(this.getRootDeviceType()) == false) return false; if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null) return false; if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false) return false; if (other.getSourceDestCheck() == null ^ this.getSourceDestCheck() == null)
if (getClientToken() != null) sb.append("ClientToken: " + getClientToken() + ","); if (getTags() != null) sb.append("Tags: " + getTags() + ","); if (getSecurityGroups() != null) sb.append("SecurityGroups: " + getSecurityGroups() + ","); if (isSourceDestCheck() != null) sb.append("SourceDestCheck: " + isSourceDestCheck() + ","); if (getHypervisor() != null) sb.append("Hypervisor: " + getHypervisor() + ",");
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); hashCode = prime * hashCode + ((isSourceDestCheck() == null) ? 0 : isSourceDestCheck().hashCode()); hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode());
if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null) return false; if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false) return false; if (other.isSourceDestCheck() == null ^ this.isSourceDestCheck() == null) return false; if (other.isSourceDestCheck() != null && other.isSourceDestCheck().equals(this.isSourceDestCheck()) == false) return false;
private boolean verifySecurityGroups(Instance instance) { boolean result = false; List<String> expectedIds = new ArrayList<String>(); for (SecurityGroupRefTask group : getSecurityGroupRefs()) { expectedIds.add(group.fetchSecurityGroup().getId()); } List<String> foundIds = new ArrayList<String>(); List<GroupIdentifier> gids = instance.getSecurityGroups(); if (gids != null && !gids.isEmpty()) { for (GroupIdentifier gid : gids) { foundIds.add(gid.getGroupId()); } } return result; }
public Map<String, Instance> findExistingInstances(final String instanceType) { final Map<String, Instance> instances = new HashMap<>(); final DescribeInstancesResult describeInstancesResult = this.ec2client.describeInstances(new DescribeInstancesRequest() .withFilters(this.getInstanceFilters(instanceType))); // Check for existing EC2 instances that fit the filter criteria and use those. for (final Reservation reservation : describeInstancesResult.getReservations()) { for (final Instance instance : reservation.getInstances()) { // If we found any existing EC2 instances put them into the instances variable. System.out.format("Reservations %s (%s): %s%n", instance.getInstanceId(), instance.getState().getName(), instance.getSecurityGroups().get(0).getGroupName()); instances.put(instance.getInstanceId(), instance); } } return instances; }
.withTargetValues(instance.getSecurityGroups().stream() .map(sg -> createEc2Arn("security-group", sg.getGroupId())) .collect(Collectors.toList()));
if (getRootDeviceType() != null) sb.append("RootDeviceType: ").append(getRootDeviceType()).append(","); if (getSecurityGroups() != null) sb.append("SecurityGroups: ").append(getSecurityGroups()).append(","); if (getSourceDestCheck() != null) sb.append("SourceDestCheck: ").append(getSourceDestCheck()).append(",");
instance.getSecurityGroups().stream().map(GroupIdentifier::getGroupId).collect(toList()), account, getRegion(fromName(region)));
instance.getSecurityGroups().add(GroupIdentifierStaxUnmarshaller.getInstance().unmarshall(context)); continue;
hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode()); hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode()); hashCode = prime * hashCode + ((getSecurityGroups() == null) ? 0 : getSecurityGroups().hashCode()); hashCode = prime * hashCode + ((getSourceDestCheck() == null) ? 0 : getSourceDestCheck().hashCode()); hashCode = prime * hashCode + ((getSpotInstanceRequestId() == null) ? 0 : getSpotInstanceRequestId().hashCode());
for (GroupIdentifier g : this.instance.getSecurityGroups()) { IpPermission ip = new IpPermission(); ip.setIpProtocol("tcp");
List<GroupIdentifier> instanceSecurityGroups = instance.getSecurityGroups(); ArrayList<String> securityGroupNames = new ArrayList<String>(); ArrayList<String> securityGroupIds = new ArrayList<String>();
for (GroupIdentifier identifier : instance.getSecurityGroups()) { this.securityGroups.add(new SecurityGroup(identifier));
if (other.getRootDeviceType() != null && other.getRootDeviceType().equals(this.getRootDeviceType()) == false) return false; if (other.getSecurityGroups() == null ^ this.getSecurityGroups() == null) return false; if (other.getSecurityGroups() != null && other.getSecurityGroups().equals(this.getSecurityGroups()) == false) return false; if (other.getSourceDestCheck() == null ^ this.getSourceDestCheck() == null)