Small demo of the EC2 part of the AWS SDK for Java
$ ./gradlew clean build
Make sure you have configured the access key locally. See Getting Started with the AWS SDK for Java for more information.
$ ./gradlew service:bootRun
- GET http://localhost:8080/rest/ec2/frankfurt/instances
- Lists all instances in Frankfurt (eu-central-1)
- GET http://localhost:8080/rest/ec2/frankfurt/securityGroups
- Lists all security groups in Frankfurt (eu-central-1)
- GET http://localhost:8080/rest/ec2/frankfurt/availabilityZones
- Lists all availability zones in Frankfurt (eu-central-1)
- POST http://localhost:8080/rest/ec2/frankfurt/instance
- Provision a new instance in Frankfurt (eu-central-1) based on the AMI ami-5b06d634 (t2.micro) and with the security group specified in the request body.
- Request body:
{"securityGroupsIds" : "sg-b1234567"}
- GET http://localhost:8080/rest/ec2/defaultRegion/availabilityZones
- Lists all availability zones in the default region. See Automatically Determine the AWS Region from the Environment