private void checkRouteTableExists(ServiceConfiguration configuration) throws Exception { DescribeRouteTablesType describeRouteTablesType = MessageHelper.createMessage(DescribeRouteTablesType.class, info.getEffectiveUserId()); describeRouteTablesType .getFilterSet() .add(Filter.filter("route-table-id", properties.getRouteTableId())); DescribeRouteTablesResponseType describeRouteTablesResponseType = AsyncRequests.sendSync(configuration, describeRouteTablesType); if (describeRouteTablesResponseType.getRouteTableSet() == null || describeRouteTablesResponseType.getRouteTableSet().getItem() == null || describeRouteTablesResponseType.getRouteTableSet().getItem().isEmpty()) { throw new ValidationErrorException( "No such route table with id '" + properties.getRouteTableId()); } }
@Override public UpdateType getUpdateType(ResourceAction resourceAction, boolean stackTagsChanged) { UpdateType updateType = info.supportsTags() && stackTagsChanged ? UpdateType.NO_INTERRUPTION : UpdateType.NONE; AWSEC2SubnetRouteTableAssociationResourceAction otherAction = (AWSEC2SubnetRouteTableAssociationResourceAction) resourceAction; if (!Objects.equals(properties.getRouteTableId(), otherAction.properties.getRouteTableId())) { updateType = UpdateType.max(updateType, UpdateType.NO_INTERRUPTION); } if (!Objects.equals(properties.getSubnetId(), otherAction.properties.getSubnetId())) { updateType = UpdateType.max(updateType, UpdateType.NEEDS_REPLACEMENT); } return updateType; }
private boolean routeTableExistsForDelete(ServiceConfiguration configuration) throws Exception { DescribeRouteTablesType describeRouteTablesType = MessageHelper.createMessage(DescribeRouteTablesType.class, info.getEffectiveUserId()); describeRouteTablesType .getFilterSet() .add(Filter.filter("route-table-id", properties.getRouteTableId())); DescribeRouteTablesResponseType describeRouteTablesResponseType = AsyncRequests.sendSync(configuration, describeRouteTablesType); if (describeRouteTablesResponseType.getRouteTableSet() == null || describeRouteTablesResponseType.getRouteTableSet().getItem() == null || describeRouteTablesResponseType.getRouteTableSet().getItem().isEmpty()) { return false; } return true; }