Skip to content

Commit d8ca58f

Browse files
authoredFeb 14, 2025··
fix instance-types filter and update readmes (#411)
* fix instance-types filter and update readmes * case insensitive selector evaluation for strings
1 parent 49a955b commit d8ca58f

File tree

10 files changed

+146
-139
lines changed

10 files changed

+146
-139
lines changed
 

‎.github/workflows/ci.yaml

+14-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: EC2 Instance Selector CI and Release
33
on: [push, pull_request, workflow_dispatch]
44

55
env:
6-
DEFAULT_GO_VERSION: ^1.23
76
GITHUB_USERNAME: ${{ secrets.EC2_BOT_GITHUB_USERNAME }}
87
GITHUB_TOKEN: ${{ secrets.EC2_BOT_GITHUB_TOKEN }}
98
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -16,13 +15,15 @@ jobs:
1615
name: Build and Test
1716
runs-on: ubuntu-20.04
1817
steps:
18+
- name: Check out code into the Go module directory
19+
uses: actions/checkout@v4
20+
1921
- name: Set up Go 1.x
20-
uses: actions/setup-go@v2
22+
uses: actions/setup-go@v5
2123
with:
22-
go-version: ${{ env.DEFAULT_GO_VERSION }}
23-
24-
- name: Check out code into the Go module directory
25-
uses: actions/checkout@v3
24+
go-version-file: 'go.mod'
25+
check-latest: true
26+
cache-dependency-path: '**/go.sum'
2627

2728
- name: Unit Tests
2829
run: make unit-test
@@ -57,13 +58,15 @@ jobs:
5758
needs: [buildAndTest]
5859
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
5960
steps:
61+
- name: Check out code into the Go module directory
62+
uses: actions/checkout@v4
63+
6064
- name: Set up Go 1.x
61-
uses: actions/setup-go@v2
65+
uses: actions/setup-go@v5
6266
with:
63-
go-version: ${{ env.DEFAULT_GO_VERSION }}
64-
65-
- name: Check out code into the Go module directory
66-
uses: actions/checkout@v2
67+
go-version-file: 'go.mod'
68+
check-latest: true
69+
cache-dependency-path: '**/go.sum'
6770

6871
- name: Release Assets
6972
run: make release

‎.github/workflows/golangci-lint.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-go@v5
1919
with:
20-
go-version: stable
20+
go-version-file: 'go.mod'
21+
check-latest: true
22+
cache-dependency-path: '**/go.sum'
2123
- name: golangci-lint
22-
uses: golangci/golangci-lint-action@v6
23-
with:
24-
version: v1.60
24+
uses: golangci/golangci-lint-action@v6

‎README.md

+34-33
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,21 @@ c6gn.16xlarge
106106
c6in.16xlarge
107107
c7gn.8xlarge
108108
dl1.24xlarge
109+
f2.48xlarge
109110
g4dn.metal
110111
g5.48xlarge
111112
g6.48xlarge
112113
g6e.12xlarge
113114
i3en.24xlarge
114115
i3en.metal
116+
i7ie.24xlarge
117+
i7ie.48xlarge
115118
im4gn.16xlarge
116119
inf1.24xlarge
117120
inf2.48xlarge
118121
m5dn.24xlarge
119122
m5dn.metal
120-
m5n.24xlarge
121-
m5n.metal
122-
m5zn.12xlarge
123-
NOTE: 19 entries were truncated, increase --max-results to see more
123+
NOTE: 22 entries were truncated, increase --max-results to see more
124124
```
125125

126126
**Short Table Output**
@@ -149,20 +149,20 @@ t3a.medium 2 4
149149
$ ec2-instance-selector --memory 4 --vcpus 2 --cpu-architecture x86_64 -r us-east-1 -o table-wide
150150
Instance Type VCPUs Mem (GiB) Hypervisor Current Gen Hibernation Support CPU Arch Network Performance ENIs GPUs GPU Mem (GiB) GPU Info On-Demand Price/Hr Spot Price/Hr
151151
------------- ----- --------- ---------- ----------- ------------------- -------- ------------------- ---- ---- ------------- -------- ------------------ -------------
152-
c5.large 2 4 nitro true true x86_64 Up to 10 Gigabit 3 0 0 none $0.085 $0.0405
153-
c5a.large 2 4 nitro true false x86_64 Up to 10 Gigabit 3 0 0 none $0.077 $0.0308
154-
c5ad.large 2 4 nitro true false x86_64 Up to 10 Gigabit 3 0 0 none $0.086 $0.0415
155-
c5d.large 2 4 nitro true true x86_64 Up to 10 Gigabit 3 0 0 none $0.096 $0.0281
156-
c6a.large 2 4 nitro true false x86_64 Up to 12.5 Gigabit 3 0 0 none $0.0765 $0.0285
157-
c6i.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.085 $0.0292
158-
c6id.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.1008 $0.0391
159-
c6in.large 2 4 nitro true false x86_64 Up to 25 Gigabit 3 0 0 none $0.1134 $0.0403
160-
c7a.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.10264 $0.0457
161-
c7i-flex.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.08479 $0.022
162-
c7i.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.08925 $0.0359
163-
t2.medium 2 4 xen true true i386, x86_64 Low to Moderate 3 0 0 none $0.0464 $0.0156
164-
t3.medium 2 4 nitro true true x86_64 Up to 5 Gigabit 3 0 0 none $0.0416 $0.015
165-
t3a.medium 2 4 nitro true true x86_64 Up to 5 Gigabit 3 0 0 none $0.0376 $0.0106
152+
c5.large 2 4 nitro true true x86_64 Up to 10 Gigabit 3 0 0 none $0.085 $0.0264
153+
c5a.large 2 4 nitro true false x86_64 Up to 10 Gigabit 3 0 0 none $0.077 $0.025
154+
c5ad.large 2 4 nitro true false x86_64 Up to 10 Gigabit 3 0 0 none $0.086 $0.0358
155+
c5d.large 2 4 nitro true true x86_64 Up to 10 Gigabit 3 0 0 none $0.096 $0.036
156+
c6a.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.0765 $0.0252
157+
c6i.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.085 $0.0252
158+
c6id.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.1008 $0.0359
159+
c6in.large 2 4 nitro true true x86_64 Up to 25 Gigabit 3 0 0 none $0.1134 $0.043
160+
c7a.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.10264 $0.0429
161+
c7i-flex.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.08479 $0.0245
162+
c7i.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.08925 $0.0367
163+
t2.medium 2 4 xen true true i386, x86_64 Low to Moderate 3 0 0 none $0.0464 $0.0135
164+
t3.medium 2 4 nitro true true x86_64 Up to 5 Gigabit 3 0 0 none $0.0416 $0.016
165+
t3a.medium 2 4 nitro true true x86_64 Up to 5 Gigabit 3 0 0 none $0.0376 $0.0108
166166
```
167167

168168
**Interactive Output**
@@ -176,17 +176,17 @@ https://user-images.githubusercontent.com/68402662/184218343-6b236d4a-3fe6-42ae-
176176
$ ec2-instance-selector -r us-east-1 -o table-wide --max-results 10 --sort-by memory --sort-direction asc
177177
Instance Type VCPUs Mem (GiB) Hypervisor Current Gen Hibernation Support CPU Arch Network Performance ENIs GPUs GPU Mem (GiB) GPU Info On-Demand Price/Hr Spot Price/Hr
178178
------------- ----- --------- ---------- ----------- ------------------- -------- ------------------- ---- ---- ------------- -------- ------------------ -------------
179-
t3a.nano 2 0.5 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0047 $0.0018
180179
t2.nano 1 0.5 xen true true i386, x86_64 Low to Moderate 2 0 0 none $0.0058 -Not Fetched-
181-
t4g.nano 2 0.5 nitro true true arm64 Up to 5 Gigabit 2 0 0 none $0.0042 $0.0018
182-
t3.nano 2 0.5 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0052 $0.0006
183-
t1.micro 1 0.6123 xen false false i386, x86_64 Very Low 2 0 0 none $0.02 $0.0021
184-
t3.micro 2 1 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0104 $0.0029
185-
t2.micro 1 1 xen true true i386, x86_64 Low to Moderate 2 0 0 none $0.0116 $0.0016
186-
t4g.micro 2 1 nitro true true arm64 Up to 5 Gigabit 2 0 0 none $0.0084 $0.0024
187-
t3a.micro 2 1 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0094 $0.0031
188-
m1.small 1 1.69922 xen false false i386, x86_64 Low 2 0 0 none $0.044 $0.0048
189-
NOTE: 832 entries were truncated, increase --max-results to see more
180+
t4g.nano 2 0.5 nitro true true arm64 Up to 5 Gigabit 2 0 0 none $0.0042 $0.0011
181+
t3.nano 2 0.5 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0052 $0.0011
182+
t3a.nano 2 0.5 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0047 $0.0022
183+
t1.micro 1 0.6123 xen false false i386, x86_64 Very Low 2 0 0 none $0.02 $0.0024
184+
t2.micro 1 1 xen true true i386, x86_64 Low to Moderate 2 0 0 none $0.0116 $0.0029
185+
t3a.micro 2 1 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0094 $0.0033
186+
t4g.micro 2 1 nitro true true arm64 Up to 5 Gigabit 2 0 0 none $0.0084 $0.0046
187+
t3.micro 2 1 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0104 $0.0028
188+
m1.small 1 1.69922 xen false false i386, x86_64 Low 2 0 0 none $0.044 $0.0115
189+
NOTE: 855 entries were truncated, increase --max-results to see more
190190
```
191191
Available shorthand flags: vcpus, memory, gpu-memory-total, network-interfaces, spot-price, on-demand-price, instance-storage, ebs-optimized-baseline-bandwidth, ebs-optimized-baseline-throughput, ebs-optimized-baseline-iops, gpus, inference-accelerators
192192

@@ -203,9 +203,9 @@ u7in-16tb.224xlarge 896 16,384 nitro true false
203203
u7i-12tb.224xlarge 896 12,288 nitro true false x86_64 100 Gigabit 15 0 0 none $152.88 -Not Fetched-
204204
u-12tb1.112xlarge 448 12,288 nitro true false x86_64 100 Gigabit 15 0 0 none $109.2 -Not Fetched-
205205
u-9tb1.112xlarge 448 9,216 nitro true false x86_64 100 Gigabit 15 0 0 none $81.9 -Not Fetched-
206+
u7i-8tb.112xlarge 448 8,192 nitro true false x86_64 100 Gigabit 15 0 0 none $83.72 -Not Fetched-
206207
u-6tb1.56xlarge 224 6,144 nitro true false x86_64 100 Gigabit 15 0 0 none $46.40391 -Not Fetched-
207-
u-6tb1.112xlarge 448 6,144 nitro true false x86_64 100 Gigabit 15 0 0 none $54.6 -Not Fetched-
208-
NOTE: 832 entries were truncated, increase --max-results to see more
208+
NOTE: 855 entries were truncated, increase --max-results to see more
209209
```
210210
JSON path must point to a field in the [instancetype.Details struct](https://github.com/aws/amazon-ec2-instance-selector/blob/5bffbf2750ee09f5f1308bdc8d4b635a2c6e2721/pkg/instancetypes/instancetypes.go#L37).
211211

@@ -367,7 +367,7 @@ NOTE: There were no transformations on the filters to display
367367
"SpotPrice": null
368368
}
369369
]
370-
NOTE: 841 entries were truncated, increase --max-results to see more
370+
NOTE: 864 entries were truncated, increase --max-results to see more
371371
```
372372
NOTE: Use this JSON format as reference when finding JSON paths for sorting
373373

@@ -395,8 +395,8 @@ Filter Flags:
395395
-z, --availability-zones strings Availability zones or zone ids to check EC2 capacity offered in specific AZs
396396
--baremetal Bare Metal instance types (.metal instances)
397397
-b, --burst-support Burstable instance types
398-
-a, --cpu-architecture string CPU architecture [x86_64, amd64, x86_64_mac, i386, or arm64]
399-
--cpu-manufacturer string CPU manufacturer [amd, intel, aws]
398+
-a, --cpu-architecture string CPU architecture [x86_64, amd64, x86_64_mac, i386, arm64, or arm64_mac]
399+
--cpu-manufacturer string CPU manufacturer [amd, intel, aws, apple]
400400
--current-generation Current generation instance types (explicitly set this to false to not return current generation instance types)
401401
--dedicated-hosts Dedicated Hosts supported
402402
--deny-list string List of instance types which should be excluded w/ regex syntax (Example: m[1-2]\.*)
@@ -437,6 +437,7 @@ Filter Flags:
437437
--instance-storage string Amount of local instance storage (Example: 4 GiB) (sets --instance-storage-min and -max to the same value)
438438
--instance-storage-max string Maximum Amount of local instance storage (Example: 4 GiB) If --instance-storage-min is not specified, the lower bound will be 0
439439
--instance-storage-min string Minimum Amount of local instance storage (Example: 4 GiB) If --instance-storage-max is not specified, the upper bound will be infinity
440+
--instance-types strings Instance Type names (must be exact, use allow-list for regex)
440441
--ipv6 Instance Types that support IPv6
441442
-m, --memory string Amount of Memory available (Example: 4 GiB) (sets --memory-min and -max to the same value)
442443
--memory-max string Maximum Amount of Memory available (Example: 4 GiB) If --memory-min is not specified, the lower bound will be 0

‎cmd/main.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ const (
104104
dedicatedHosts = "dedicated-hosts"
105105
debug = "debug"
106106
generation = "generation"
107+
instanceTypes = "instance-types"
107108
)
108109

109110
// Aggregate Filter Flags.
@@ -167,8 +168,8 @@ Full docs can be found at github.com/aws/amazon-` + binName
167168
cli.Int32MinMaxRangeFlags(vcpus, cli.StringMe("c"), nil, "Number of vcpus available to the instance type.")
168169
cli.ByteQuantityMinMaxRangeFlags(memory, cli.StringMe("m"), nil, "Amount of Memory available (Example: 4 GiB)")
169170
cli.RatioFlag(vcpusToMemoryRatio, nil, nil, "The ratio of vcpus to GiBs of memory. (Example: 1:2)")
170-
cli.StringOptionsFlag(cpuArchitecture, cli.StringMe("a"), nil, "CPU architecture [x86_64, amd64, x86_64_mac, i386, or arm64]", []string{"x86_64", "x86_64_mac", "amd64", "i386", "arm64"})
171-
cli.StringOptionsFlag(cpuManufacturer, nil, nil, "CPU manufacturer [amd, intel, aws]", []string{"amd", "intel", "aws"})
171+
cli.StringOptionsFlag(cpuArchitecture, cli.StringMe("a"), nil, "CPU architecture [x86_64, amd64, x86_64_mac, i386, arm64, or arm64_mac]", []string{"x86_64", "x86_64_mac", "amd64", "i386", "arm64", "arm64_mac"})
172+
cli.StringOptionsFlag(cpuManufacturer, nil, nil, "CPU manufacturer [amd, intel, aws, apple]", []string{"amd", "intel", "aws", "apple"})
172173
cli.Int32MinMaxRangeFlags(gpus, cli.StringMe("g"), nil, "Total Number of GPUs (Example: 4)")
173174
cli.ByteQuantityMinMaxRangeFlags(gpuMemoryTotal, nil, nil, "Number of GPUs' total memory (Example: 4 GiB)")
174175
cli.StringFlag(gpuManufacturer, nil, nil, "GPU Manufacturer name (Example: NVIDIA)", nil)
@@ -208,6 +209,7 @@ Full docs can be found at github.com/aws/amazon-` + binName
208209
cli.BoolFlag(autoRecovery, nil, nil, "EC2 Auto-Recovery supported")
209210
cli.BoolFlag(dedicatedHosts, nil, nil, "Dedicated Hosts supported")
210211
cli.IntMinMaxRangeFlags(generation, nil, nil, "Generation of the instance type (i.e. c7i.xlarge is 7)")
212+
cli.StringSliceFlag(instanceTypes, nil, nil, "Instance Type names (must be exact, use allow-list for regex)")
211213

212214
// Suite Flags - higher level aggregate filters that return opinionated result
213215

@@ -425,6 +427,7 @@ Full docs can be found at github.com/aws/amazon-` + binName
425427
AutoRecovery: cli.BoolMe(flags[autoRecovery]),
426428
DedicatedHosts: cli.BoolMe(flags[dedicatedHosts]),
427429
Generation: cli.IntRangeMe(flags[generation]),
430+
InstanceTypes: cli.StringSliceMe(flags[instanceTypes]),
428431
}
429432

430433
if flags[verbose] != nil {

‎go.mod

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ go 1.23
44

55
require (
66
dario.cat/mergo v1.0.1
7-
github.com/aws/aws-sdk-go-v2 v1.32.6
8-
github.com/aws/aws-sdk-go-v2/config v1.28.0
9-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.186.0
10-
github.com/aws/aws-sdk-go-v2/service/pricing v1.32.7
7+
github.com/aws/aws-sdk-go-v2 v1.36.1
8+
github.com/aws/aws-sdk-go-v2/config v1.29.6
9+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.203.0
10+
github.com/aws/aws-sdk-go-v2/service/pricing v1.32.16
1111
github.com/blang/semver/v4 v4.0.0
1212
github.com/charmbracelet/bubbles v0.20.0
13-
github.com/charmbracelet/bubbletea v1.2.4
13+
github.com/charmbracelet/bubbletea v1.3.3
1414
github.com/charmbracelet/lipgloss v1.0.0
1515
github.com/evertras/bubble-table v0.17.1
1616
github.com/mitchellh/go-homedir v1.1.0
@@ -19,25 +19,25 @@ require (
1919
github.com/patrickmn/go-cache v2.1.0+incompatible
2020
github.com/samber/lo v1.47.0
2121
github.com/spf13/cobra v1.8.1
22-
github.com/spf13/pflag v1.0.5
22+
github.com/spf13/pflag v1.0.6
2323
go.uber.org/multierr v1.11.0
2424
)
2525

2626
require (
2727
github.com/atotto/clipboard v0.1.4 // indirect
28-
github.com/aws/aws-sdk-go-v2/credentials v1.17.41 // indirect
29-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect
30-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect
31-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect
32-
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
33-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
34-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect
35-
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 // indirect
36-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 // indirect
37-
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 // indirect
38-
github.com/aws/smithy-go v1.22.1 // indirect
28+
github.com/aws/aws-sdk-go-v2/credentials v1.17.59 // indirect
29+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.28 // indirect
30+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.32 // indirect
31+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.32 // indirect
32+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.2 // indirect
33+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.2 // indirect
34+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.13 // indirect
35+
github.com/aws/aws-sdk-go-v2/service/sso v1.24.15 // indirect
36+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.14 // indirect
37+
github.com/aws/aws-sdk-go-v2/service/sts v1.33.14 // indirect
38+
github.com/aws/smithy-go v1.22.2 // indirect
3939
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
40-
github.com/charmbracelet/x/ansi v0.4.5 // indirect
40+
github.com/charmbracelet/x/ansi v0.8.0 // indirect
4141
github.com/charmbracelet/x/term v0.2.1 // indirect
4242
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
4343
github.com/inconshreveable/mousetrap v1.1.0 // indirect
@@ -50,7 +50,7 @@ require (
5050
github.com/muesli/reflow v0.3.0 // indirect
5151
github.com/rivo/uniseg v0.4.7 // indirect
5252
github.com/sahilm/fuzzy v0.1.1 // indirect
53-
golang.org/x/sync v0.9.0 // indirect
54-
golang.org/x/sys v0.27.0 // indirect
55-
golang.org/x/text v0.16.0 // indirect
53+
golang.org/x/sync v0.11.0 // indirect
54+
golang.org/x/sys v0.30.0 // indirect
55+
golang.org/x/text v0.22.0 // indirect
5656
)

‎go.sum

+42-41
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,48 @@ dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
22
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
33
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
44
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
5-
github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4=
6-
github.com/aws/aws-sdk-go-v2 v1.32.6/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U=
7-
github.com/aws/aws-sdk-go-v2/config v1.28.0 h1:FosVYWcqEtWNxHn8gB/Vs6jOlNwSoyOCA/g/sxyySOQ=
8-
github.com/aws/aws-sdk-go-v2/config v1.28.0/go.mod h1:pYhbtvg1siOOg8h5an77rXle9tVG8T+BWLWAo7cOukc=
9-
github.com/aws/aws-sdk-go-v2/credentials v1.17.41 h1:7gXo+Axmp+R4Z+AK8YFQO0ZV3L0gizGINCOWxSLY9W8=
10-
github.com/aws/aws-sdk-go-v2/credentials v1.17.41/go.mod h1:u4Eb8d3394YLubphT4jLEwN1rLNq2wFOlT6OuxFwPzU=
11-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 h1:TMH3f/SCAWdNtXXVPPu5D6wrr4G5hI1rAxbcocKfC7Q=
12-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17/go.mod h1:1ZRXLdTpzdJb9fwTMXiLipENRxkGMTn1sfKexGllQCw=
13-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU=
14-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU=
15-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA=
16-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE=
17-
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ=
18-
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc=
19-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.186.0 h1:n2l2WeV+lEABrGwG/4MsE0WFEbd3j7yKsmZzbnEm5CY=
20-
github.com/aws/aws-sdk-go-v2/service/ec2 v1.186.0/go.mod h1:kYXaB4FzyhEJjvrJ84oPnMElLiEAjGxxUunVW2tBSng=
21-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g=
22-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ=
23-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 h1:s7NA1SOw8q/5c0wr8477yOPp0z+uBaXBnLE0XYb0POA=
24-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2/go.mod h1:fnjjWyAW/Pj5HYOxl9LJqWtEwS7W2qgcRLWP+uWbss0=
25-
github.com/aws/aws-sdk-go-v2/service/pricing v1.32.7 h1:9UDHX1ZgcXUTAGcyxmw04r/6OVG/aUpQ7dZUziR+vTM=
26-
github.com/aws/aws-sdk-go-v2/service/pricing v1.32.7/go.mod h1:68s1DYctoo30LibzEY6gLajXbQEhxpn49+zYFy+Q5Xs=
27-
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 h1:bSYXVyUzoTHoKalBmwaZxs97HU9DWWI3ehHSAMa7xOk=
28-
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2/go.mod h1:skMqY7JElusiOUjMJMOv1jJsP7YUg7DrhgqZZWuzu1U=
29-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 h1:AhmO1fHINP9vFYUE0LHzCWg/LfUWUF+zFPEcY9QXb7o=
30-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2/go.mod h1:o8aQygT2+MVP0NaV6kbdE1YnnIM8RRVQzoeUH45GOdI=
31-
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 h1:CiS7i0+FUe+/YY1GvIBLLrR/XNGZ4CtM1Ll0XavNuVo=
32-
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2/go.mod h1:HtaiBI8CjYoNVde8arShXb94UbQQi9L4EMr6D+xGBwo=
33-
github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro=
34-
github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
5+
github.com/aws/aws-sdk-go-v2 v1.36.1 h1:iTDl5U6oAhkNPba0e1t1hrwAo02ZMqbrGq4k5JBWM5E=
6+
github.com/aws/aws-sdk-go-v2 v1.36.1/go.mod h1:5PMILGVKiW32oDzjj6RU52yrNrDPUHcbZQYr1sM7qmM=
7+
github.com/aws/aws-sdk-go-v2/config v1.29.6 h1:fqgqEKK5HaZVWLQoLiC9Q+xDlSp+1LYidp6ybGE2OGg=
8+
github.com/aws/aws-sdk-go-v2/config v1.29.6/go.mod h1:Ft+WLODzDQmCTHDvqAH1JfC2xxbZ0MxpZAcJqmE1LTQ=
9+
github.com/aws/aws-sdk-go-v2/credentials v1.17.59 h1:9btwmrt//Q6JcSdgJOLI98sdr5p7tssS9yAsGe8aKP4=
10+
github.com/aws/aws-sdk-go-v2/credentials v1.17.59/go.mod h1:NM8fM6ovI3zak23UISdWidyZuI1ghNe2xjzUZAyT+08=
11+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.28 h1:KwsodFKVQTlI5EyhRSugALzsV6mG/SGrdjlMXSZSdso=
12+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.28/go.mod h1:EY3APf9MzygVhKuPXAc5H+MkGb8k/DOSQjWS0LgkKqI=
13+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.32 h1:BjUcr3X3K0wZPGFg2bxOWW3VPN8rkE3/61zhP+IHviA=
14+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.32/go.mod h1:80+OGC/bgzzFFTUmcuwD0lb4YutwQeKLFpmt6hoWapU=
15+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.32 h1:m1GeXHVMJsRsUAqG6HjZWx9dj7F5TR+cF1bjyfYyBd4=
16+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.32/go.mod h1:IitoQxGfaKdVLNg0hD8/DXmAqNy0H4K2H2Sf91ti8sI=
17+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.2 h1:Pg9URiobXy85kgFev3og2CuOZ8JZUBENF+dcgWBaYNk=
18+
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.2/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc=
19+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.203.0 h1:EDLBXOs5D0KUqDThg8ID63mK5E7lJ8pjHGBtix6O9j0=
20+
github.com/aws/aws-sdk-go-v2/service/ec2 v1.203.0/go.mod h1:nSbxgPGhyI9j/cMVSHUEEtNQzEYeNOkbHnHNeTuQqt0=
21+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.2 h1:D4oz8/CzT9bAEYtVhSBmFj2dNOtaHOtMKc2vHBwYizA=
22+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.2/go.mod h1:Za3IHqTQ+yNcRHxu1OFucBh0ACZT4j4VQFF0BqpZcLY=
23+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.13 h1:SYVGSFQHlchIcy6e7x12bsrxClCXSP5et8cqVhL8cuw=
24+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.13/go.mod h1:kizuDaLX37bG5WZaoxGPQR/LNFXpxp0vsUnqfkWXfNE=
25+
github.com/aws/aws-sdk-go-v2/service/pricing v1.32.16 h1:V6lgrFRz1B7+OE6NUMrccUBVSiSF0B4uwkldeWAGvnU=
26+
github.com/aws/aws-sdk-go-v2/service/pricing v1.32.16/go.mod h1:27xFxqZ5sSWdgfXEM8ixtw0qApX2bjsHNiJMbHwNDhc=
27+
github.com/aws/aws-sdk-go-v2/service/sso v1.24.15 h1:/eE3DogBjYlvlbhd2ssWyeuovWunHLxfgw3s/OJa4GQ=
28+
github.com/aws/aws-sdk-go-v2/service/sso v1.24.15/go.mod h1:2PCJYpi7EKeA5SkStAmZlF6fi0uUABuhtF8ILHjGc3Y=
29+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.14 h1:M/zwXiL2iXUrHputuXgmO94TVNmcenPHxgLXLutodKE=
30+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.14/go.mod h1:RVwIw3y/IqxC2YEXSIkAzRDdEU1iRabDPaYjpGCbCGQ=
31+
github.com/aws/aws-sdk-go-v2/service/sts v1.33.14 h1:TzeR06UCMUq+KA3bDkujxK1GVGy+G8qQN/QVYzGLkQE=
32+
github.com/aws/aws-sdk-go-v2/service/sts v1.33.14/go.mod h1:dspXf/oYWGWo6DEvj98wpaTeqt5+DMidZD0A9BYTizc=
33+
github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ=
34+
github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
3535
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
3636
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
3737
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
3838
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
3939
github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE=
4040
github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU=
41-
github.com/charmbracelet/bubbletea v1.2.4 h1:KN8aCViA0eps9SCOThb2/XPIlea3ANJLUkv3KnQRNCE=
42-
github.com/charmbracelet/bubbletea v1.2.4/go.mod h1:Qr6fVQw+wX7JkWWkVyXYk/ZUQ92a6XNekLXa3rR18MM=
41+
github.com/charmbracelet/bubbletea v1.3.3 h1:WpU6fCY0J2vDWM3zfS3vIDi/ULq3SYphZhkAGGvmEUY=
42+
github.com/charmbracelet/bubbletea v1.3.3/go.mod h1:dtcUCyCGEX3g9tosuYiut3MXgY/Jsv9nKVdibKKRRXo=
4343
github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg=
4444
github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo=
45-
github.com/charmbracelet/x/ansi v0.4.5 h1:LqK4vwBNaXw2AyGIICa5/29Sbdq58GbGdFngSexTdRM=
46-
github.com/charmbracelet/x/ansi v0.4.5/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw=
45+
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
46+
github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
4747
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
4848
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
4949
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
@@ -93,20 +93,21 @@ github.com/samber/lo v1.47.0 h1:z7RynLwP5nbyRscyvcD043DWYoOcYRv3mV8lBeqOCLc=
9393
github.com/samber/lo v1.47.0/go.mod h1:RmDH9Ct32Qy3gduHQuKJ3gW1fMHAnE/fAzQuf6He5cU=
9494
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
9595
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
96-
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
9796
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
97+
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
98+
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
9899
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
99100
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
100101
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
101102
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
102-
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
103-
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
103+
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
104+
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
104105
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
105106
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
106-
golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s=
107-
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
108-
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
109-
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
107+
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
108+
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
109+
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
110+
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
110111
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
111112
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
112113
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

‎pkg/cli/flags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ func (cl *CommandLineInterface) StringOptionsFlagOnFlagSet(flagSet *pflag.FlagSe
386386
return nil
387387
}
388388
for _, v := range validOpts {
389-
if v == *val.(*string) {
389+
if strings.EqualFold(v, *val.(*string)) {
390390
return nil
391391
}
392392
}

‎pkg/selector/comparators.go

+7-21
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const (
2929
)
3030

3131
var (
32-
amdRegex = regexp.MustCompile(`[a-zA-Z0-9]+a\\.[a-zA-Z0-9]`)
3332
networkPerfRE = regexp.MustCompile(`[0-9]+ Gigabit`)
3433
generationRE = regexp.MustCompile(`[a-zA-Z]+([0-9]+)`)
3534
)
@@ -41,7 +40,7 @@ func isSupportedFromString(instanceTypeValue *string, target *string) bool {
4140
if instanceTypeValue == nil {
4241
return false
4342
}
44-
return *instanceTypeValue == *target
43+
return strings.EqualFold(*instanceTypeValue, *target)
4544
}
4645

4746
func isSupportedFromStrings(instanceTypeValues []*string, target *string) bool {
@@ -83,7 +82,7 @@ func isSupportedUsageClassType(instanceTypeValue []ec2types.UsageClassType, targ
8382
}
8483

8584
for _, potentialType := range instanceTypeValue {
86-
if potentialType == *target {
85+
if strings.EqualFold(string(potentialType), string(*target)) {
8786
return true
8887
}
8988
}
@@ -102,7 +101,7 @@ func isSupportedArchitectureType(instanceTypeValue []ec2types.ArchitectureType,
102101
}
103102

104103
for _, potentialType := range instanceTypeValue {
105-
if potentialType == *target {
104+
if strings.EqualFold(string(potentialType), string(*target)) {
106105
return true
107106
}
108107
}
@@ -120,7 +119,7 @@ func isSupportedVirtualizationType(instanceTypeValue []ec2types.VirtualizationTy
120119
return true
121120
}
122121
for _, potentialType := range instanceTypeValue {
123-
if potentialType == *target {
122+
if strings.EqualFold(string(potentialType), string(*target)) {
124123
return true
125124
}
126125
}
@@ -134,7 +133,7 @@ func isSupportedInstanceTypeHypervisorType(instanceTypeValue ec2types.InstanceTy
134133
if reflect.ValueOf(*target).IsZero() {
135134
return true
136135
}
137-
if instanceTypeValue == *target {
136+
if strings.EqualFold(string(instanceTypeValue), string(*target)) {
138137
return true
139138
}
140139
return false
@@ -151,7 +150,7 @@ func isSupportedRootDeviceType(instanceTypeValue []ec2types.RootDeviceType, targ
151150
return true
152151
}
153152
for _, potentialType := range instanceTypeValue {
154-
if potentialType == *target {
153+
if strings.EqualFold(string(potentialType), string(*target)) {
155154
return true
156155
}
157156
}
@@ -165,7 +164,7 @@ func isMatchingCpuArchitecture(instanceTypeValue CPUManufacturer, target *CPUMan
165164
if reflect.ValueOf(*target).IsZero() {
166165
return true
167166
}
168-
if instanceTypeValue == *target {
167+
if strings.EqualFold(string(instanceTypeValue), string(*target)) {
169168
return true
170169
}
171170
return false
@@ -376,19 +375,6 @@ func getEBSOptimizedBaselineIOPS(ebsInfo *ec2types.EbsInfo) *int32 {
376375
return ebsInfo.EbsOptimizedInfo.BaselineIops
377376
}
378377

379-
func getCPUManufacturer(instanceTypeInfo *ec2types.InstanceTypeInfo) CPUManufacturer {
380-
for _, it := range instanceTypeInfo.ProcessorInfo.SupportedArchitectures {
381-
if it == ec2types.ArchitectureTypeArm64 {
382-
return CPUManufacturerAWS
383-
}
384-
}
385-
386-
if amdRegex.Match([]byte(instanceTypeInfo.InstanceType)) {
387-
return CPUManufacturerAMD
388-
}
389-
return CPUManufacturerIntel
390-
}
391-
392378
// getInstanceTypeGeneration returns the generation from an instance type name
393379
// i.e. c7i.xlarge -> 7
394380
// if any error occurs, 0 will be returned.

‎pkg/selector/selector.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,22 @@ func (s Selector) prepareFilter(ctx context.Context, filters Filters, instanceTy
303303
eneaSupport := string(instanceTypeInfo.NetworkInfo.EnaSupport)
304304
ebsOptimizedSupport := string(instanceTypeInfo.EbsInfo.EbsOptimizedSupport)
305305

306+
// If an empty slice is passed, treat the filter as nil
307+
filterInstanceTypes := filters.InstanceTypes
308+
if filterInstanceTypes != nil && len(*filterInstanceTypes) == 0 {
309+
filterInstanceTypes = nil
310+
}
311+
312+
var cpuManufacturerFilter *string
313+
if filters.CPUManufacturer != nil {
314+
cpuManufacturerFilter = aws.String(string(*filters.CPUManufacturer))
315+
}
316+
306317
// filterToInstanceSpecMappingPairs is a map of filter name [key] to filter pair [value].
307318
// A filter pair includes user input filter value and instance spec value retrieved from DescribeInstanceTypes
308319
filterToInstanceSpecMappingPairs := map[string]filterPair{
309320
cpuArchitecture: {filters.CPUArchitecture, instanceTypeInfo.ProcessorInfo.SupportedArchitectures},
310-
cpuManufacturer: {filters.CPUManufacturer, getCPUManufacturer(&instanceTypeInfo.InstanceTypeInfo)},
321+
cpuManufacturer: {cpuManufacturerFilter, instanceTypeInfo.ProcessorInfo.Manufacturer},
311322
usageClass: {filters.UsageClass, instanceTypeInfo.SupportedUsageClasses},
312323
rootDeviceType: {filters.RootDeviceType, instanceTypeInfo.SupportedRootDeviceTypes},
313324
hibernationSupported: {filters.HibernationSupported, instanceTypeInfo.HibernationSupported},
@@ -329,7 +340,7 @@ func (s Selector) prepareFilter(ctx context.Context, filters Filters, instanceTy
329340
networkPerformance: {filters.NetworkPerformance, getNetworkPerformance(instanceTypeInfo.NetworkInfo.NetworkPerformance)},
330341
networkEncryption: {filters.NetworkEncryption, instanceTypeInfo.NetworkInfo.EncryptionInTransitSupported},
331342
ipv6: {filters.IPv6, instanceTypeInfo.NetworkInfo.Ipv6Supported},
332-
instanceTypes: {filters.InstanceTypes, instanceTypeInfo.InstanceType},
343+
instanceTypes: {filterInstanceTypes, aws.String(string(instanceTypeInfo.InstanceType))},
333344
virtualizationType: {filters.VirtualizationType, instanceTypeInfo.SupportedVirtualizationTypes},
334345
pricePerHour: {filters.PricePerHour, &instanceTypeHourlyPriceForFilter},
335346
instanceStorageRange: {filters.InstanceStorageRange, getInstanceStorage(instanceTypeInfo.InstanceStorageInfo)},

‎test/e2e/run-test

+5-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ params=(
9393
)
9494
echo "${expected[*]}" | execute_test "24 VCPUs" "${params[@]}"
9595

96-
expected=(g3.16xlarge g4ad.16xlarge g4dn.12xlarge g5.12xlarge g5.24xlarge g6.12xlarge g6.24xlarge g6e.12xlarge g6e.24xlarge p3.8xlarge)
96+
expected=(g4ad.16xlarge g4dn.12xlarge g5.12xlarge g5.24xlarge g6.12xlarge g6.24xlarge g6e.12xlarge g6e.24xlarge p3.8xlarge)
9797
params=(
9898
"--gpus=4"
9999
"--gpus-min=4 --gpus-max=4"
@@ -119,8 +119,10 @@ params=(
119119
echo "${expected[*]}" | execute_test "96 GiB gpu-memory-total" "${params[@]}"
120120

121121

122-
expected=(a1.large c3.large c4.large c5.large c5a.large c5d.large c5n.large c6g.large c6gd.large \
123-
g4dn.2xlarge g4dn.4xlarge g4dn.xlarge i3.large i3en.large m1.large m3.large m5.large m5a.large m5ad.large m5d.large)
122+
expected=(a1.large c3.large c4.large c5.large c5a.large c5ad.large c5d.large c5n.large c6a.large c6g.large c6gd.large \
123+
c6gn.large c6i.large c6id.large c6in.large c7a.large c7g.large c7gd.large c7gn.large c7i-flex.large c7i.large \
124+
c8g.large d3.8xlarge d3en.12xlarge g4ad.4xlarge g4dn.2xlarge g4dn.4xlarge g4dn.xlarge i3.large i3en.large i4g.large \
125+
i4i.large i7ie.large i8g.large im4gn.large is4gen.large m1.large m3.large m5.large m5a.large)
124126
params=(
125127
"--network-interfaces=3"
126128
"--network-interfaces-min=3 --network-interfaces-max=3"

0 commit comments

Comments
 (0)
Please sign in to comment.