Skip to content

Commit 200b23d

Browse files
authored
support efa query (#98)
1 parent b6b7b2d commit 200b23d

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ Filter Flags:
165165
-a, --cpu-architecture string CPU architecture [x86_64/amd64, i386, or arm64]
166166
--current-generation Current generation instance types (explicitly set this to false to not return current generation instance types)
167167
--deny-list string List of instance types which should be excluded w/ regex syntax (Example: m[1-2]\.*)
168+
--efa-support Instance types that support Elastic Fabric Adapters (EFA)
168169
-e, --ena-support Instance types where ENA is supported or required
169170
-f, --fpga-support FPGA instance types
170171
--gpu-memory-total string Number of GPUs' total memory (Example: 4 GiB) (sets --gpu-memory-total-min and -max to the same value)

cmd/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const (
5757
usageClass = "usage-class"
5858
rootDeviceType = "root-device-type"
5959
enaSupport = "ena-support"
60+
efaSupport = "efa-support"
6061
hibernationSupport = "hibernation-support"
6162
baremetal = "baremetal"
6263
fpgaSupport = "fpga-support"
@@ -131,6 +132,7 @@ Full docs can be found at github.com/aws/amazon-` + binName
131132
cli.StringOptionsFlag(usageClass, cli.StringMe("u"), nil, "Usage class: [spot or on-demand]", []string{"spot", "on-demand"})
132133
cli.StringOptionsFlag(rootDeviceType, nil, nil, "Supported root device types: [ebs or instance-store]", []string{"ebs", "instance-store"})
133134
cli.BoolFlag(enaSupport, cli.StringMe("e"), nil, "Instance types where ENA is supported or required")
135+
cli.BoolFlag(efaSupport, nil, nil, "Instance types that support Elastic Fabric Adapters (EFA)")
134136
cli.BoolFlag(hibernationSupport, nil, nil, "Hibernation supported")
135137
cli.BoolFlag(baremetal, nil, nil, "Bare Metal instance types (.metal instances)")
136138
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
204206
UsageClass: cli.StringMe(flags[usageClass]),
205207
RootDeviceType: cli.StringMe(flags[rootDeviceType]),
206208
EnaSupport: cli.BoolMe(flags[enaSupport]),
209+
EfaSupport: cli.BoolMe(flags[efaSupport]),
207210
HibernationSupported: cli.BoolMe(flags[hibernationSupport]),
208211
Hypervisor: cli.StringMe(flags[hypervisor]),
209212
BareMetal: cli.BoolMe(flags[baremetal]),

pkg/selector/selector.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const (
5858
burstable = "burstable"
5959
fpga = "fpga"
6060
enaSupport = "enaSupport"
61+
efaSupport = "efaSupport"
6162
vcpusToMemoryRatio = "vcpusToMemoryRatio"
6263
currentGeneration = "currentGeneration"
6364
networkInterfaces = "networkInterfaces"
@@ -223,6 +224,7 @@ func (itf Selector) rawFilter(filters Filters) ([]instancetypes.Details, error)
223224
burstable: {filters.Burstable, instanceTypeInfo.BurstablePerformanceSupported},
224225
fpga: {filters.Fpga, &isFpga},
225226
enaSupport: {filters.EnaSupport, supportSyntaxToBool(instanceTypeInfo.NetworkInfo.EnaSupport)},
227+
efaSupport: {filters.EfaSupport, instanceTypeInfo.NetworkInfo.EfaSupported},
226228
vcpusToMemoryRatio: {filters.VCpusToMemoryRatio, calculateVCpusToMemoryRatio(instanceTypeInfo.VCpuInfo.DefaultVCpus, instanceTypeInfo.MemoryInfo.SizeInMiB)},
227229
currentGeneration: {filters.CurrentGeneration, instanceTypeInfo.CurrentGeneration},
228230
networkInterfaces: {filters.NetworkInterfaces, instanceTypeInfo.NetworkInfo.MaximumNetworkInterfaces},

pkg/selector/types.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ type Filters struct {
124124
// EnaSupport returns instances that can support an Elastic Network Adapter.
125125
EnaSupport *bool
126126

127+
// EfaSupport returns instances that can support an Elastic Fabric Adapter.
128+
EfaSupport *bool
129+
127130
// FPGA is used to only return FPGA instance type results
128131
Fpga *bool
129132

0 commit comments

Comments
 (0)