.describe_instances() Boto3 AWS 中的 "Groups" 和 "SecurityGroups" 有什么区别?

What's the Difference between "Groups" and "SecurityGroups" in .describe_instances() Boto3 AWS?

所以我使用 .describe_instances() 来提取有关我公司 EC2 实例的信息。我注意到对于“NetworkInterfaces”下的每个实例,它都包含“Groups”和“SecurityGroups”。乍一看,它们似乎都具有相同的 GroupId 和 GroupName 配对。为什么此信息会重复?还是“组”和“安全组”分开存在的原因?

如果您查看 response section of the boto3 method,您会发现以下描述:

Groups (list) -- [EC2-Classic only] The security groups.

SecurityGroups (list) -- The security groups for the instance.

所以 Groups 用于引用 EC2-classic 模式(即将弃用)中的组,而 SecurityGroups 用于引用更标准的 VPC 配置中的组。

您可以找到有关 EC2-Classic here 的更多信息。