turbot / steampipe-plugin-aws

Use SQL to instantly query AWS resources across regions and accounts. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/aws
Apache License 2.0
188 stars 100 forks source link

aws_ec2_instance_type returns incorrect data #2202

Closed graza-io closed 4 months ago

graza-io commented 4 months ago

t2 instance types are not the current generation, however they're reported as such:

select * 
from aws_ec2_instance_type 
where instance_type like 't2.%'
Screenshot 2024-05-28 at 15 33 48
ParthaI commented 4 months ago

Hello @graza-io, I've been reviewing the aws_ec2_instance_type table and would like to share my findings regarding this issue.

Did you find any deviation between the results returned by AWS CLI, AWS Console, and Steampipe?

Note: The current implementation in the main branch for the aws_ec2_instance_type table returns data for the us-east-1 region. However, there's an open PR that updates this to retrieve results for all supported regions for an AWS account.

Thank you!

graza-io commented 4 months ago

Ah, looks like current_generation doesn't show if it's current as in latest as I thought it would... (cc: @e-gineer for reference)

A quick check in eu-north-1 only shows d2 as not being in current_generation but also equally doesn't even list the t2 options.

image

❯ aws ec2 describe-instance-types --query 'InstanceTypes[*].{InstanceType:InstanceType, CurrentGeneration:CurrentGeneration}' --region eu-north-1 | jq '[.[] | select(.InstanceType | startswith("t"))]'
[
  {
    "InstanceType": "t3.2xlarge",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t4g.nano",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t3.medium",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t4g.medium",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t4g.2xlarge",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t3.xlarge",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t3.large",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t3.micro",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t3.nano",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t4g.xlarge",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t4g.small",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t4g.micro",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t4g.large",
    "CurrentGeneration": true
  },
  {
    "InstanceType": "t3.small",
    "CurrentGeneration": true
  }
]

Thanks for digging into this @ParthaI - will close now as it appears the table is behaving as intended just not as desired ;)