jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Svet <notificati...@github.com>
Subject Re: [jclouds/jclouds] JCLOUDS-1269; JCLOUDS-1120: ec2 subnet/securityGroups in non-default vpc (#1091)
Date Fri, 28 Apr 2017 15:09:52 GMT
neykov commented on this pull request.



> @@ -102,7 +104,17 @@ private String createSecurityGroupInRegion(String region, String
name, String vp
                                .build());
             }
 
-            String myOwnerId = Iterables.get(securityApi.describeSecurityGroupsInRegion(region,
name), 0).getOwnerId();
+            // Use filter (as per `SecurityGroupPresent`, in securityGroupEventualConsistencyDelay)
+            Set<SecurityGroup> securityGroups = securityApi.describeSecurityGroupsInRegionWithFilter(region,
+                  ImmutableMultimap.of("group-name", name));

You could use the `id` of the security group with a `group-id` filter here. Same for `securityGroupEventualConsistencyDelay`,
by passing `new RegionAndName(region, id)`. The ID is unique for the region, while the name
can be the same between VPCs - will guarantee that you don't get multiple results here.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/1091#pullrequestreview-35385538
Mime
View raw message