Reservation class 在 AWS EC2 Java SDK 中的作用是什么?

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

当 运行 一个 DescribeInstancesRequest 我得到一个预订列表。每个预留都包含一个安全组列表和一个实例列表。

所以我的问题是:在预留中对实例进行分组的标准是什么,我可以指望预留返回的安全组是预留中实例的安全组。

预订基本上是一组实例。如果您一起启动这些实例,它们可以共享相同的预留 ID。

亚马逊文档:

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.

启动一个实例时,您可以通过一个启动请求启动多个实例。然后这些实例属于一个保留。预留可以理解为一个或多个实例的原子启动。

不要将 reservations 误认为 reserved instances。这是完全不同的概念。

关于你的另一个问题:是的,安全组与预留中每个实例的组匹配(都属于同一个安全组)。