Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the role of the Reservation class in the AWS EC2 Java SDK?

When running a DescribeInstancesRequest I get a list of reservations. Each reservation contains a list of security groups and a list of instances.

So my question is: What criteria are instances grouped in reservations and can I count on the security groups returned by the reservation being the security groups of the instances in the reservation.

like image 722
Dobromir Ivanov Avatar asked Nov 29 '25 14:11

Dobromir Ivanov


1 Answers

Reservation is basically a set of instances. These instances can share the same reservation ID if you launch them together.

Amazon documentations:

reservation-id - The ID of the instance's reservation. A reservation ID is created any time you launch an instance. A reservation ID has a one-to-one relationship with an instance launch request, but can be associated with more than one instance if you launch multiple instances using the same launch request.

When launching an instance, you can launch multiple instances with one launch request. These instances then belong to one reservation. A reservation can be understood as an atomic launch of one or many instances.

Do not mistake reservations with reserved instances. These are completely different concepts.

As for your other question: Yes, the security group matches the group of each instance in the reservation (all belong to the same security groups).

like image 65
Smajl Avatar answered Dec 01 '25 09:12

Smajl