Code example for Function

Methods: apply

   // base EC2 driver currently does not support key import 
   protected String createOrImportKeyPair(String region, String group, TemplateOptions options) { 
      RegionAndName regionAndGroup = new RegionAndName(region, group); 
      KeyPair keyPair = makeKeyPair.apply(new RegionAndName(region, group)); 
      // make sure that we don't request multiple keys simultaneously 
      // if there is already a keypair for the group specified, use it 
      // otherwise create a new keypair and key it under the group and also the regular keyname 
      KeyPair origValue = credentialsMap.putIfAbsent(regionAndGroup, keyPair); 
      if (origValue != null) { 
         return origValue.getKeyName(); 
      credentialsMap.put(new RegionAndName(region, keyPair.getKeyName()), keyPair); 
      return keyPair.getKeyName(); 
   public Set<String> getSecurityGroupsForTagAndOptions(String region, @Nullable String group, TemplateOptions options) {