Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated tables as per EC2 package version updated #2078

Merged
merged 3 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion aws/table_aws_ebs_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ func listAwsEBSSnapshots(ctx context.Context, d *plugin.QueryData, h *plugin.Hyd

// Build filter for ebs snapshot
filters := buildEbsSnapshotFilter(ctx, d, h, d.EqualsQuals, input)
input.Filters = filters
if len(filters) > 0 {
input.Filters = filters
}

paginator := ec2.NewDescribeSnapshotsPaginator(svc, input, func(o *ec2.DescribeSnapshotsPaginatorOptions) {
o.Limit = maxLimit
Expand Down
18 changes: 15 additions & 3 deletions aws/table_aws_ec2_instance_availability.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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{
Expand Down Expand Up @@ -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) {
Expand Down
36 changes: 36 additions & 0 deletions aws/table_aws_ec2_instance_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,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.",
Expand Down Expand Up @@ -159,6 +171,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"),
Expand Down
Loading