Apart from the AWS web console, AWS functionalities are also accessible via Command Line Interface (CLI), APIs or SDK. This blog post summarizes how to launch an EC2 instance and to test its running status via AWS SDK for Java.
The programming environment:
Eclipse Java EE IDE for Web Developers.
Version: Luna Release (4.4.0)
Install the AWS toolkit according to the instructions listed on http://aws.amazon.com/eclipse/.
Credentials are important for authentication.
The programming environment:
Eclipse Java EE IDE for Web Developers.
Version: Luna Release (4.4.0)
Install the AWS toolkit according to the instructions listed on http://aws.amazon.com/eclipse/.
Credentials are important for authentication.
AmazonEC2Client is the basis to call various APIs. (Since in this project I used the instance for load generation, I named it as runLoadGeneratorRequest/Result) To launch an instance, the key is the .runInstances() method. We can configure the RunInstancesRequest object as needed.
No comments:
Post a Comment