Hey all,

Is there a preferred way to add a single port firewall rule on GCE? We can
get an IllegalStateException exception when trying to add a rule as follows:
IpPermission.builder()
          .ipProtocol(protocol)
          .cidrBlock(Cidr.WORLD)
          .fromPort(number)
          .toPort(number)
          .build()

securityGroupsExtension.addIpPermission(ipPermission, securityGroup)


Exception:
java.lang.IllegalStateException: start of range must be lower than end of
range
at com.google.common.base.Preconditions.checkState(Preconditions.java:150)
~[poseidon-0.2-SNAPSHOT-jar-with-dependencies.jar:na]
at
org.jclouds.googlecomputeengine.domain.Firewall$Rule$Builder.addPortRange(Firewall.java:354)
~[poseidon-0.2-SNAPSHOT-jar-with-dependencies.jar:na]
at
org.jclouds.googlecomputeengine.compute.extensions.GoogleComputeEngineSecurityGroupExtension.addIpPermission(GoogleComputeEngineSecurityGroupExtension.java:224)
~[poseidon-0.2-SNAPSHOT-jar-with-dependencies.jar:na]

Thanks,

Sunil

Reply via email to