Skip to content

Commit d2fba86

Browse files
committed
Fixed issues with create-security-group sample code.
1 parent d2dcfa1 commit d2fba86

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

doc_source/create-security-group.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ EC2 Security Groups <using-network-security>` in the |EC2-ug|.
5252
.. code-block:: java
5353
5454
CreateSecurityGroupResult createSecurityGroupResult =
55-
amazonEC2Client.createSecurityGroup(createSecurityGroupRequest);
55+
amazonEC2Client.createSecurityGroup(csgr);
5656
5757
If you attempt to create a security group with the same name as an existing security group,
5858
:code:`createSecurityGroup` throws an exception.
@@ -80,7 +80,10 @@ ports.
8080
IpPermission ipPermission =
8181
new IpPermission();
8282
83-
ipPermission.withIpRanges("111.111.111.111/32", "150.150.150.150/32")
83+
IpRange ipRange1 = new IpRange().withCidrIp("111.111.111.111/32");
84+
IpRange ipRange2 = new IpRange().withCidrIp("150.150.150.150/32");
85+
86+
ipPermission.withIpv4Ranges(Arrays.asList(new IpRange[] {ipRange1, ipRange2}))
8487
.withIpProtocol("tcp")
8588
.withFromPort(22)
8689
.withToPort(22);

0 commit comments

Comments
 (0)