From 3e1eb41b07752e5903363a1a5f9f9f943127a42d Mon Sep 17 00:00:00 2001 From: Richard Downer Date: Wed, 14 Aug 2013 16:51:04 +0100 Subject: [PATCH] JCLOUDS-242: fix confusion between sg name and ID AWSEC2CreateSecurityGroupIfNeeded was invoking AWSSecurityGroupClient.authorizeSecurityGroupIngressInRegion with a group name, but this method takes a group ID. Fixed code to pass the ID instead. --- .../aws/ec2/compute/loaders/AWSEC2CreateSecurityGroupIfNeeded.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/loaders/AWSEC2CreateSecurityGroupIfNeeded.java b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/loaders/AWSEC2CreateSecurityGroupIfNeeded.java index ad14efe..3368ec8 100644 --- a/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/loaders/AWSEC2CreateSecurityGroupIfNeeded.java +++ b/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/loaders/AWSEC2CreateSecurityGroupIfNeeded.java @@ -117,8 +117,9 @@ public class AWSEC2CreateSecurityGroupIfNeeded extends CacheLoader perms = permissions.build(); if (perms.size() > 0) { + String id = Iterables.get(securityClient.describeSecurityGroupsInRegion(region, name), 0).getId(); logger.debug(">> authorizing securityGroup region(%s) name(%s) IpPermissions(%s)", region, name, perms); - securityClient.authorizeSecurityGroupIngressInRegion(region, name, perms); + securityClient.authorizeSecurityGroupIngressInRegion(region, id, perms); logger.debug("<< authorized securityGroup(%s)", name); } -- 1.8.3.1