Amazon AWS SDK Betriebsanweisung Seite 50

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 73
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 49
Related topics
What Is IAM? in Using IAM
AWS Security Credentials in AWS General Reference
Step 2: Setting Up a Security Group
A security group acts as a firewall that controls the traffic allowed in and out of a group of instances. By
default, an instance is started without any security group, which means that all incoming IP traffic, on any
TCP port will be denied. So, before submitting our Spot Request, we will set up a security group that
allows the necessary network traffic. For the purposes of this tutorial, we will create a new security group
called "GettingStarted" that allows Secure Shell (SSH) traffic from the IP address where you are running
your application from.To set up a new security group, you need to include or run the following code
sample that sets up the security group programmatically.
After we create an AmazonEC2 client object, we create a CreateSecurityGroupRequest object with
the name, "GettingStarted" and a description for the security group.Then we call the
ec2.createSecurityGroup API to create the group.
To enable access to the group, we create an ipPermission object with the IP address range set to the
CIDR representation of the subnet for the local computer; the "/10" suffix on the IP address indicates the
subnet for the specified IP address. We also configure the ipPermission object with the TCP protocol
and port 22 (SSH). The final step is to call ec2.authorizeSecurityGroupIngress with the name of
our security group and the ipPermission object.
(The following code is the same as what we used in the first tutorial.)
1
// Retrieves the credentials from an AWSCredentials.properties file.
AWSCredentials credentials = null;
try {
5 credentials = new PropertiesCredentials(
GettingStartedApp.class.getResourceAsStream("AwsCredentials.proper
ties"));
} catch (IOException e1) {
System.out.println("Credentials were not properly entered into AwsCreden
tials.properties.");
System.out.println(e1.getMessage());
10 System.exit(-1);
}
// Create the AmazonEC2Client object so we can call various APIs.
AmazonEC2 ec2 = new AmazonEC2Client(credentials);
15
// Create a new security group.
try {
CreateSecurityGroupRequest securityGroupRequest =
new CreateSecurityGroupRequest("GettingStartedGroup", "Getting
Started Security Group");
20 ec2.createSecurityGroup(securityGroupRequest);
} catch (AmazonServiceException ase) {
// Likely this means that the group is already created, so ignore.
System.out.println(ase.getMessage());
}
25
String ipAddr = "0.0.0.0/0";
Version v1.0.0
47
AWS SDK for Java Developer Guide
Tutorial: Advanced Amazon EC2 Spot Request
Management
Seitenansicht 49
1 2 ... 45 46 47 48 49 50 51 52 53 54 55 ... 72 73

Kommentare zu diesen Handbüchern

Keine Kommentare

Longacre 50100 Tirelief Kit manuály

Uživatelské manuály a uživatelské příručky pro Pro auto Longacre 50100 Tirelief Kit.
Poskytujeme 1 manuály pdf Longacre 50100 Tirelief Kit ke stažení zdarma podle typů dokumentů: Uživatelský manuál






Další produkty a příručky pro Pro auto Longacre

Modely Typ Dokumentu
50370 Temperature Compensated Tire Pressure Gauge Uživatelský manuál   Longacre 50370 Temperature Compensated Tire Pressure Gauge User Manual, 3 stránky
73512 Valve Spring Tester Uživatelský manuál   Longacre 73512 Valve Spring Tester User Manual, 2 stránky
72594 Computerscales Uživatelský manuál   Longacre 72594 Computerscales User Manual, 2 stránky
Adjustable Fuel Pressure and Oil Pressure Sender I Uživatelský manuál   Longacre Adjustable Fuel Pressure and Oil Pressure Sender Instructions User Manual, 1 stránky
45215 Brake Line Uživatelský manuál   Longacre 45215 Brake Line User Manual, 1 stránky
78250 Camber Gauge Uživatelský manuál   Longacre 78250 Camber Gauge User Manual, 1 stránky
Air Tank_Filler Gauge Uživatelský manuál   Longacre Air Tank_Filler Gauge User Manual, 1 stránky
72700 Computerscales Wireless Accuset Uživatelský manuál   Longacre 72700 Computerscales Wireless Accuset User Manual, 2 stránky
73014 Engine Leak Down Tester Uživatelský manuál   Longacre 73014 Engine Leak Down Tester User Manual, 1 stránky
50692 Deluxe Memory Tire Pyrometer Uživatelský manuál   Longacre 50692 Deluxe Memory Tire Pyrometer User Manual, 4 stránky
78310 AccuLevel Pro (version 4) Uživatelský manuál   Longacre 78310 AccuLevel Pro (version 4) User Manual, 1 stránky
78110 Digital Kart Camber Gauge with AccuLevel (ve Uživatelský manuál   Longacre 78110 Digital Kart Camber Gauge with AccuLevel (version 2) User Manual, 1 stránky
78110 Digital Kart Camber Gauge with AccuLevel (ve Uživatelský manuál   Longacre 78110 Digital Kart Camber Gauge with AccuLevel (version 3) User Manual, 1 stránky
50365 Ultimate Digital Tire Pressure Gauge Uživatelský manuál   Longacre 50365 Ultimate Digital Tire Pressure Gauge User Manual, 2 stránky
78290 Digital Caster_Camber Gauge with AccuLevel ( Uživatelský manuál   Longacre 78290 Digital Caster_Camber Gauge with AccuLevel (version 2) User Manual, 2 stránky
22548 Spot Mirror Uživatelský manuál   Longacre 22548 Spot Mirror User Manual, 1 stránky
45218 Brake Line Re-circulator Uživatelský manuál   Longacre 45218 Brake Line Re-circulator User Manual, 1 stránky
78310 AccuLevel (version 2) Uživatelský manuál   Longacre 78310 AccuLevel (version 2) User Manual, 2 stránky
72625 Computerscales Uživatelský manuál   Longacre 72625 Computerscales User Manual, 2 stránky
72583 Computerscales Uživatelský manuál   Longacre 72583 Computerscales User Manual, 2 stránky