EC2 instance type specifications
Looks up the specifications of a named EC2 instance type in a region. The main operational use is the architecture check before a launch: Graviton types (t4g, c7g, m8g and similar) need an arm64 AMI while Intel and AMD types need x86_64, and a mismatch fails the launch. Type availability varies by region, so the region parameter is a real filter here, not just routing.
Query
SELECT
instance_type,
json_extract(v_cpu_info, '$.defaultVCpus') + 0 as vcpus,
json_extract(memory_info, '$.sizeInMiB') + 0 as memory_mib,
json_extract(processor_info, '$.supportedArchitectures.item') as architecture,
json_extract(processor_info, '$.manufacturer') as processor,
current_generation,
burstable_performance_supported,
free_tier_eligible,
hibernation_supported
FROM aws.ec2.instance_types
WHERE region = '{{region}}'
AND InstanceType = '{{instance_type}}';
Variation: compare several types
Pass a list to compare candidates side by side; the filter is pushed to the API so every named type is returned:
SELECT
instance_type,
json_extract(v_cpu_info, '$.defaultVCpus') + 0 as vcpus,
json_extract(memory_info, '$.sizeInMiB') + 0 as memory_mib,
json_extract(processor_info, '$.supportedArchitectures.item') as architecture
FROM aws.ec2.instance_types
WHERE region = '{{region}}'
AND InstanceType IN ('t4g.nano', 't4g.micro', 't3.micro')
ORDER BY memory_mib;
Notes
Always name the types you want with InstanceType: an unfiltered select returns only the first page of about 100 types out of roughly 850, with no error and no indication of truncation, so filtering that result client-side silently produces incomplete answers - never use it to search for types matching a size or architecture. The Filter input param is declared on the resource but returns an empty result rather than filtering, so avoid it. json_extract returns text, so numeric comparisons need the + 0 coercion shown above; without it memory_mib <= 2048 compares lexicographically and quietly excludes matches (CAST(x AS INTEGER) does not parse in stackql). architecture comes back as a bare string for single-architecture types and as a JSON array for types supporting several (older types report ["i386","x86_64"]). Instance sizing detail beyond these columns is available in the network_info, ebs_info, gpu_info and instance_storage_info JSON columns.