diff --git a/README.md b/README.md index 7a05457..59e854d 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,7 @@ Filter Flags: -a, --cpu-architecture string CPU architecture [x86_64/amd64, i386, or arm64] --current-generation Current generation instance types (explicitly set this to false to not return current generation instance types) --deny-list string List of instance types which should be excluded w/ regex syntax (Example: m[1-2]\.*) + --efa-support Instance types that support Elastic Fabric Adapters (EFA) -e, --ena-support Instance types where ENA is supported or required -f, --fpga-support FPGA instance types --gpu-memory-total string Number of GPUs' total memory (Example: 4 GiB) (sets --gpu-memory-total-min and -max to the same value) diff --git a/cmd/main.go b/cmd/main.go index e345bac..b6067c3 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -57,6 +57,7 @@ const ( usageClass = "usage-class" rootDeviceType = "root-device-type" enaSupport = "ena-support" + efaSupport = "efa-support" hibernationSupport = "hibernation-support" baremetal = "baremetal" fpgaSupport = "fpga-support" @@ -131,6 +132,7 @@ Full docs can be found at github.com/aws/amazon-` + binName cli.StringOptionsFlag(usageClass, cli.StringMe("u"), nil, "Usage class: [spot or on-demand]", []string{"spot", "on-demand"}) cli.StringOptionsFlag(rootDeviceType, nil, nil, "Supported root device types: [ebs or instance-store]", []string{"ebs", "instance-store"}) cli.BoolFlag(enaSupport, cli.StringMe("e"), nil, "Instance types where ENA is supported or required") + cli.BoolFlag(efaSupport, nil, nil, "Instance types that support Elastic Fabric Adapters (EFA)") cli.BoolFlag(hibernationSupport, nil, nil, "Hibernation supported") cli.BoolFlag(baremetal, nil, nil, "Bare Metal instance types (.metal instances)") cli.BoolFlag(fpgaSupport, cli.StringMe("f"), nil, "FPGA instance types") @@ -204,6 +206,7 @@ Full docs can be found at github.com/aws/amazon-` + binName UsageClass: cli.StringMe(flags[usageClass]), RootDeviceType: cli.StringMe(flags[rootDeviceType]), EnaSupport: cli.BoolMe(flags[enaSupport]), + EfaSupport: cli.BoolMe(flags[efaSupport]), HibernationSupported: cli.BoolMe(flags[hibernationSupport]), Hypervisor: cli.StringMe(flags[hypervisor]), BareMetal: cli.BoolMe(flags[baremetal]), diff --git a/pkg/selector/selector.go b/pkg/selector/selector.go index 7db9473..d4d4fbb 100644 --- a/pkg/selector/selector.go +++ b/pkg/selector/selector.go @@ -58,6 +58,7 @@ const ( burstable = "burstable" fpga = "fpga" enaSupport = "enaSupport" + efaSupport = "efaSupport" vcpusToMemoryRatio = "vcpusToMemoryRatio" currentGeneration = "currentGeneration" networkInterfaces = "networkInterfaces" @@ -223,6 +224,7 @@ func (itf Selector) rawFilter(filters Filters) ([]instancetypes.Details, error) burstable: {filters.Burstable, instanceTypeInfo.BurstablePerformanceSupported}, fpga: {filters.Fpga, &isFpga}, enaSupport: {filters.EnaSupport, supportSyntaxToBool(instanceTypeInfo.NetworkInfo.EnaSupport)}, + efaSupport: {filters.EfaSupport, instanceTypeInfo.NetworkInfo.EfaSupported}, vcpusToMemoryRatio: {filters.VCpusToMemoryRatio, calculateVCpusToMemoryRatio(instanceTypeInfo.VCpuInfo.DefaultVCpus, instanceTypeInfo.MemoryInfo.SizeInMiB)}, currentGeneration: {filters.CurrentGeneration, instanceTypeInfo.CurrentGeneration}, networkInterfaces: {filters.NetworkInterfaces, instanceTypeInfo.NetworkInfo.MaximumNetworkInterfaces}, diff --git a/pkg/selector/types.go b/pkg/selector/types.go index da4a9f6..ad8cccf 100644 --- a/pkg/selector/types.go +++ b/pkg/selector/types.go @@ -124,6 +124,9 @@ type Filters struct { // EnaSupport returns instances that can support an Elastic Network Adapter. EnaSupport *bool + // EfaSupport returns instances that can support an Elastic Fabric Adapter. + EfaSupport *bool + // FPGA is used to only return FPGA instance type results Fpga *bool