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

So I was using .describe_instances() to pull information about my companies EC2 instances. I noticed that for each instance under "NetworkInterfaces", it included "Groups" and "SecurityGroups". At a glance, they both seem to have the same GroupId and GroupName pairings. Why is this information duplicated? Or is there a reason why the "Groups" and "SecurityGroups" exist separately?



Solution 1:[1]

If you check the response section of the boto3 method you'll find the following description:

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

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

so Groups is used when referring to groups in the EC2-classic mode (which will soon be deprecated), whereas SecurityGroups is used when referring to groups in the more standard VPC configuration.

You can find more information on EC2-Classic here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1