diff --git a/aws/table_aws_ec2_instance_availability.go b/aws/table_aws_ec2_instance_availability.go index 0de8ffbcc..f507dbd68 100644 --- a/aws/table_aws_ec2_instance_availability.go +++ b/aws/table_aws_ec2_instance_availability.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/turbot/steampipe-plugin-sdk/v5/query_cache" "github.com/turbot/steampipe-plugin-sdk/v5/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v5/plugin" "github.com/turbot/steampipe-plugin-sdk/v5/plugin/transform" @@ -27,6 +28,11 @@ func tableAwsInstanceAvailability(_ context.Context) *plugin.Table { Name: "instance_type", Require: plugin.Optional, }, + { + Name: "location_type", + Require: plugin.Optional, + CacheMatch: query_cache.CacheMatchExact, + }, }, }, Columns: []*plugin.Column{ @@ -93,17 +99,23 @@ func listAwsAvailableInstanceTypes(ctx context.Context, d *plugin.QueryData, h * } input := &ec2.DescribeInstanceTypeOfferingsInput{ - MaxResults: aws.Int32(maxLimit), - LocationType: types.LocationTypeRegion, + MaxResults: aws.Int32(maxLimit), } var filters []types.Filter - filters = append(filters, types.Filter{Name: aws.String("location"), Values: []string{*region.RegionName}}) + + if d.EqualsQualString("location_type") != "" { + input.LocationType = types.LocationType(d.EqualsQualString("location_type")) + } else { + input.LocationType = types.LocationTypeRegion + filters = append(filters, types.Filter{Name: aws.String("location"), Values: []string{*region.RegionName}}) + } equalQuals := d.EqualsQuals if equalQuals["instance_type"] != nil { filters = append(filters, types.Filter{Name: aws.String("instance-type"), Values: []string{equalQuals["instance_type"].GetStringValue()}}) } + input.Filters = filters paginator := ec2.NewDescribeInstanceTypeOfferingsPaginator(svc, input, func(o *ec2.DescribeInstanceTypeOfferingsPaginatorOptions) { diff --git a/aws/table_aws_ec2_instance_type.go b/aws/table_aws_ec2_instance_type.go index 13bb6e291..42321091f 100644 --- a/aws/table_aws_ec2_instance_type.go +++ b/aws/table_aws_ec2_instance_type.go @@ -94,6 +94,18 @@ func tableAwsInstanceType(_ context.Context) *plugin.Table { Type: proto.ColumnType_BOOL, Hydrate: describeInstanceType, }, + { + Name: "nitro_enclaves_support", + Description: "Indicates whether instance storage is supported.", + Type: proto.ColumnType_STRING, + Hydrate: describeInstanceType, + }, + { + Name: "nitro_tpm_support", + Description: "Indicates whether NitroTPM is supported.", + Type: proto.ColumnType_STRING, + Hydrate: describeInstanceType, + }, { Name: "hypervisor", Description: "The hypervisor for the instance type.", @@ -167,6 +179,30 @@ func tableAwsInstanceType(_ context.Context) *plugin.Table { Type: proto.ColumnType_JSON, Hydrate: describeInstanceType, }, + { + Name: "fpga_info", + Description: "Describes the FPGA accelerator settings for the instance type.", + Type: proto.ColumnType_JSON, + Hydrate: describeInstanceType, + }, + { + Name: "inference_accelerator_info", + Description: "Describes the Inference accelerator settings for the instance type.", + Type: proto.ColumnType_JSON, + Hydrate: describeInstanceType, + }, + { + Name: "nitro_tpm_info", + Description: "Describes the supported NitroTPM versions for the instance type.", + Type: proto.ColumnType_JSON, + Hydrate: describeInstanceType, + }, + { + Name: "supported_boot_modes", + Description: "The supported boot modes.", + Type: proto.ColumnType_JSON, + Hydrate: describeInstanceType, + }, { Name: "title", Description: resourceInterfaceDescription("title"),