Skip to content

Commit 761bd1d

Browse files
authored
Merge pull request #1 from beckandros/master
EC2 edits
2 parents 6f5527a + 02bbaae commit 761bd1d

20 files changed

Lines changed: 73 additions & 77 deletions

javav2/example_code/ec2/src/main/java/com/example/ec2/AllocateAddress.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//snippet-sourcedescription:[AllocateAddress.java demonstrates how to allocate an elastic IP address for an Amazon EC2 instance.]
1+
//snippet-sourcedescription:[AllocateAddress.java demonstrates how to allocate an Elastic IP address for an Amazon EC2 instance.]
22
//snippet-keyword:[SDK for Java 2.0]
33
//snippet-keyword:[Code Sample]
44
//snippet-service:[Amazon EC2]
@@ -33,13 +33,13 @@
3333
// snippet-end:[ec2.java2.allocate_address.import]
3434

3535
/**
36-
* Allocates an elastic IP address for an EC2 instance
36+
* Allocates an Elastic IP address for an Amazon EC2 instance
3737
*/
3838
public class AllocateAddress {
3939

4040
public static void main(String[] args) {
4141
final String USAGE =
42-
"To run this example, supply an instance id that you can obtain from the AWS Console\n" +
42+
"To run this example, supply an instance ID obtained from the AWS Management Console.\n" +
4343
"Ex: AllocateAddress <instance_id>\n";
4444

4545
if (args.length != 1) {

javav2/example_code/ec2/src/main/java/com/example/ec2/CreateInstance.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
// snippet-end:[ec2.java2.create_instance.import]
3535

3636
/**
37-
* Creates an EC2 instance
37+
* Creates an Amazon EC2 instance
3838
*/
3939
public class CreateInstance {
4040
public static void main(String[] args) {
4141
final String USAGE =
42-
"To run this example, supply an instance name and AMI image id\n" +
43-
"Both values can be obtained from the AWS Console\n" +
42+
"To run this example, supply an instance name and Amazon Machine Image (AMI) ID.\n" +
43+
"Both values can be obtained from the AWS Management Console.\n" +
4444
"Ex: CreateInstance <instance-name> <ami-image-id>\n";
4545

4646
if (args.length != 2) {

javav2/example_code/ec2/src/main/java/com/example/ec2/CreateKeyPair.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
// snippet-end:[ec2.java2.create_key_pair.import]
3131

3232
/**
33-
* Creates an EC2 key pair
33+
* Creates an Amazon EC2 key pair
3434
*/
3535
public class CreateKeyPair {
3636

3737
public static void main(String[] args) {
3838
final String USAGE =
39-
"To run this example, supply a key pair name\n" +
39+
"To run this example, supply a key pair name.\n" +
4040
"Ex: CreateKeyPair <key-pair-name>\n";
4141

4242
if (args.length != 1) {
@@ -46,7 +46,7 @@ public static void main(String[] args) {
4646

4747
String keyName = args[0];
4848

49-
//Create an Ec2Client object
49+
// Create an Ec2Client object
5050
Region region = Region.US_WEST_2;
5151
Ec2Client ec2 = Ec2Client.builder()
5252
.region(region)

javav2/example_code/ec2/src/main/java/com/example/ec2/CreateSecurityGroup.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
// snippet-end:[ec2.java2.create_security_group.import]
3535

3636
/**
37-
* Creates an EC2 security group.
37+
* Creates an Amazon EC2 security group
3838
*/
3939
public class CreateSecurityGroup {
4040

4141
public static void main(String[] args) {
4242
final String USAGE =
43-
"To run this example, supply a group name, group description and vpc id\n" +
43+
"To run this example, supply a group name, group description, and VPC ID.\n" +
4444
"Ex: CreateSecurityGroup <group-name> <group-description> <vpc-id>\n";
4545

4646
if (args.length != 3) {
@@ -52,7 +52,7 @@ public static void main(String[] args) {
5252
String groupDesc = args[1];
5353
String vpcId = args[2];
5454

55-
//Create an Ec2Client object
55+
// Create an Ec2Client object
5656
Region region = Region.US_WEST_2;
5757
Ec2Client ec2 = Ec2Client.builder()
5858
.region(region)
@@ -113,4 +113,3 @@ public static void createEC2SecurityGroup( Ec2Client ec2,String groupName, Strin
113113
}
114114
}
115115
}
116-

javav2/example_code/ec2/src/main/java/com/example/ec2/DeleteKeyPair.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
// snippet-end:[ec2.java2.delete_key_pair.import]
3333

3434
/**
35-
* Deletes a key pair.
35+
* Deletes a key pair
3636
*/
3737
public class DeleteKeyPair {
3838

3939
public static void main(String[] args) {
4040
final String USAGE =
41-
"To run this example, supply a key pair name\n" +
41+
"To run this example, supply a key pair name.\n" +
4242
"Ex: DeleteKeyPair <key-pair-name>\n";
4343

4444
if (args.length != 1) {
@@ -48,7 +48,7 @@ public static void main(String[] args) {
4848

4949
String keyName = args[0];
5050

51-
//Create an Ec2Client object
51+
// Create an Ec2Client object
5252
Region region = Region.US_WEST_2;
5353
Ec2Client ec2 = Ec2Client.builder()
5454
.region(region)

javav2/example_code/ec2/src/main/java/com/example/ec2/DeleteSecurityGroup.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
import software.amazon.awssdk.services.ec2.model.Ec2Exception;
3030
// snippet-end:[ec2.java2.delete_security_group.import]
3131
/**
32-
* Deletes an EC2 security group
32+
* Deletes an Amazon EC2 security group
3333
*/
3434
public class DeleteSecurityGroup {
3535

3636
public static void main(String[] args) {
3737
final String USAGE =
38-
"To run this example, supply a security group id\n" +
38+
"To run this example, supply a security group ID.\n" +
3939
"Ex: DeleteSecurityGroup <security-group-id>\n";
4040

4141
if (args.length != 1) {
@@ -45,7 +45,7 @@ public static void main(String[] args) {
4545

4646
String groupId = args[0];
4747

48-
//Create an Ec2Client object
48+
// Create an Ec2Client object
4949
Region region = Region.US_WEST_2;
5050
Ec2Client ec2 = Ec2Client.builder()
5151
.region(region)
@@ -65,7 +65,7 @@ public static void deleteEC2SecGroup(Ec2Client ec2,String groupId) {
6565
DeleteSecurityGroupResponse response = ec2.deleteSecurityGroup(request);
6666

6767
System.out.printf(
68-
"Successfully deleted security group with id %s", groupId);
68+
"Successfully deleted security group with ID %s", groupId);
6969

7070
} catch (Ec2Exception e) {
7171
e.getStackTrace();

javav2/example_code/ec2/src/main/java/com/example/ec2/DescribeAccount.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//snippet-sourcedescription:[DescribeAccount.java demonstrates how to get information about the Amazon EC2 account.]
1+
//snippet-sourcedescription:[DescribeAccount.java demonstrates how to get information about an Amazon EC2 account.]
22
//snippet-keyword:[SDK for Java 2.0]
33
//snippet-keyword:[Code Sample]
44
//snippet-service:[Amazon EC2]
@@ -38,7 +38,7 @@ public class DescribeAccount {
3838

3939
public static void main(String[] args) {
4040

41-
//Create an Ec2Client object
41+
// Create an Ec2Client object
4242
Region region = Region.US_WEST_2;
4343
Ec2Client ec2 = Ec2Client.builder()
4444
.region(region)
@@ -62,7 +62,7 @@ public static void describeEC2Account(Ec2Client ec2) {
6262
System.out.print("\n The name of the attribute is "+attribute.attributeName());
6363
List<AccountAttributeValue> values = attribute.attributeValues();
6464

65-
//iterate through the attribute values
65+
// Iterate through the attribute values
6666
for (ListIterator iterVals = values.listIterator(); iterVals.hasNext(); ) {
6767
AccountAttributeValue myValue = (AccountAttributeValue) iterVals.next();
6868
System.out.print("\n The value of the attribute is "+myValue.attributeValue());

javav2/example_code/ec2/src/main/java/com/example/ec2/DescribeAddresses.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//snippet-sourcedescription:[DescribeAddresses.java demonstrates how to get information about elastic IP addresses.]
1+
//snippet-sourcedescription:[DescribeAddresses.java demonstrates how to get information about Elastic IP addresses.]
22
//snippet-keyword:[SDK for Java 2.0]
33
//snippet-keyword:[Code Sample]
44
//snippet-service:[Amazon EC2]
@@ -30,13 +30,13 @@
3030
// snippet-end:[ec2.java2.describe_addresses.import]
3131

3232
/**
33-
* Describes all elastic IP addresses
33+
* Describes all Elastic IP addresses
3434
*/
3535
public class DescribeAddresses {
3636

3737
public static void main(String[] args) {
3838

39-
//Create an Ec2Client object
39+
// Create an Ec2Client object
4040
Region region = Region.US_WEST_2;
4141
Ec2Client ec2 = Ec2Client.builder()
4242
.region(region)
@@ -54,8 +54,8 @@ public static void describeEC2Address(Ec2Client ec2 ) {
5454
System.out.printf(
5555
"Found address with public IP %s, " +
5656
"domain %s, " +
57-
"allocation id %s " +
58-
"and NIC id %s",
57+
"allocation ID %s " +
58+
"and NIC ID %s",
5959
address.publicIp(),
6060
address.domain(),
6161
address.allocationId(),

javav2/example_code/ec2/src/main/java/com/example/ec2/DescribeInstances.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//snippet-sourcedescription:[DescribeInstances.java demonstrates how to get information about all the EC2 instances associated with an AWS account.]
1+
//snippet-sourcedescription:[DescribeInstances.java demonstrates how to get information about all the Amazon EC2 instances associated with an AWS account.]
22
//snippet-keyword:[SDK for Java 2.0]
33
//snippet-keyword:[Code Sample]
44
//snippet-service:[Amazon EC2]
@@ -33,14 +33,14 @@
3333
// snippet-end:[ec2.java2.describe_instances.import]
3434

3535
/**
36-
* Describes all EC2 instances associated with an AWS account
36+
* Describes all Amazon EC2 instances associated with an AWS account
3737
*/
3838
public class DescribeInstances {
3939

4040
public static void main(String[] args) {
4141

4242

43-
//Create an Ec2Client object
43+
// Create an Ec2Client object
4444
Region region = Region.US_WEST_2;
4545
Ec2Client ec2 = Ec2Client.builder()
4646
.region(region)
@@ -64,7 +64,7 @@ public static void describeEC2Instances( Ec2Client ec2){
6464
for (Reservation reservation : response.reservations()) {
6565
for (Instance instance : reservation.instances()) {
6666
System.out.printf(
67-
"Found reservation with id %s, " +
67+
"Found reservation with ID %s, " +
6868
"AMI %s, " +
6969
"type %s, " +
7070
"state %s " +

javav2/example_code/ec2/src/main/java/com/example/ec2/DescribeKeyPairs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class DescribeKeyPairs {
3636

3737
public static void main(String[] args) {
3838

39-
//Create an Ec2Client object
39+
// Create an Ec2Client object
4040
Region region = Region.US_WEST_2;
4141
Ec2Client ec2 = Ec2Client.builder()
4242
.region(region)

0 commit comments

Comments
 (0)