From 75dbd3548cd3a05ea0022411ea26988684da2817 Mon Sep 17 00:00:00 2001 From: Brandon Wagner Date: Fri, 27 Jan 2023 14:07:59 -0600 Subject: [PATCH 01/58] dependabot config (#166) --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..19896109 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" From b55aee360275a8822ae1359edeb22d33bb94d5ba Mon Sep 17 00:00:00 2001 From: Brandon Wagner Date: Fri, 27 Jan 2023 14:10:49 -0600 Subject: [PATCH 02/58] =?UTF-8?q?=F0=9F=A5=91=F0=9F=A4=96=20v2.4.1=20relea?= =?UTF-8?q?se=20prep=20=F0=9F=A4=96=F0=9F=A5=91=20(#165)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd9574bc..766a14f3 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ brew install ec2-instance-selector #### Install w/ Curl for Linux/Mac ``` -curl -Lo ec2-instance-selector https://github.com/aws/amazon-ec2-instance-selector/releases/download/v2.4.0/ec2-instance-selector-`uname | tr '[:upper:]' '[:lower:]'`-amd64 && chmod +x ec2-instance-selector +curl -Lo ec2-instance-selector https://github.com/aws/amazon-ec2-instance-selector/releases/download/v2.4.1/ec2-instance-selector-`uname | tr '[:upper:]' '[:lower:]'`-amd64 && chmod +x ec2-instance-selector ``` To execute the CLI, you will need AWS credentials configured. Take a look at the [AWS CLI configuration documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#config-settings-and-precedence) for details on the various ways to configure credentials. An easy way to try out the ec2-instance-selector CLI is to populate the following environment variables with your AWS API credentials. From 1ed7f684319c79153363c03dce24dc71f9ce2c58 Mon Sep 17 00:00:00 2001 From: Brandon Wagner Date: Mon, 30 Jan 2023 17:22:44 -0600 Subject: [PATCH 03/58] fix gh action dependabot tests (#172) --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2eb66ccb..ceecfba3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,7 @@ jobs: go-version: ${{ env.DEFAULT_GO_VERSION }} - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Unit Tests run: make unit-test @@ -43,7 +43,7 @@ jobs: run: make build-docker-images - name: Integration Tests - if: github.event_name == 'push' + if: ${{ github.event_name == 'push' && !contains(github.ref, 'dependabot') }} run: make integ-test env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} From 512f855d2630338298447d45ea9696aadf24b665 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 17:23:55 -0600 Subject: [PATCH 04/58] Bump gopkg.in/ini.v1 from 1.57.0 to 1.67.0 (#171) Bumps [gopkg.in/ini.v1](https://github.com/go-ini/ini) from 1.57.0 to 1.67.0. - [Release notes](https://github.com/go-ini/ini/releases) - [Commits](https://github.com/go-ini/ini/compare/v1.57.0...v1.67.0) --- updated-dependencies: - dependency-name: gopkg.in/ini.v1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 3 +-- go.sum | 16 +++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 94097483..1dc93c20 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/spf13/cobra v0.0.7 github.com/spf13/pflag v1.0.3 go.uber.org/multierr v1.1.0 - gopkg.in/ini.v1 v1.57.0 + gopkg.in/ini.v1 v1.67.0 ) require ( @@ -33,7 +33,6 @@ require ( github.com/muesli/reflow v0.3.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect - github.com/smartystreets/goconvey v1.6.4 // indirect go.uber.org/atomic v1.4.0 // indirect golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect diff --git a/go.sum b/go.sum index 3e5ec054..6caab396 100644 --- a/go.sum +++ b/go.sum @@ -13,8 +13,6 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/charmbracelet/bubbles v0.11.0 h1:fBLyY0PvJnd56Vlu5L84JJH6f4axhgIJ9P3NET78f0Q= -github.com/charmbracelet/bubbles v0.11.0/go.mod h1:bbeTiXwPww4M031aGi8UK2HT9RDWoiNibae+1yCMtcc= github.com/charmbracelet/bubbles v0.13.0 h1:zP/ROH3wJEBqZWKIsD50ZKKlx3ydLInq3LdD/Nrlb8w= github.com/charmbracelet/bubbles v0.13.0/go.mod h1:bbeTiXwPww4M031aGi8UK2HT9RDWoiNibae+1yCMtcc= github.com/charmbracelet/bubbletea v0.21.0 h1:f3y+kanzgev5PA916qxmDybSHU3N804uOnKnhRPXTcI= @@ -53,8 +51,6 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -69,8 +65,6 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -79,6 +73,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= @@ -132,10 +127,6 @@ github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -195,7 +186,6 @@ golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -203,8 +193,8 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= -gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 7a1425dde4d5e33cea960280e43e0a48151a4b6f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 22:23:03 -0600 Subject: [PATCH 05/58] Bump github.com/aws/aws-sdk-go from 1.44.59 to 1.44.190 (#173) --- go.mod | 6 +++--- go.sum | 30 ++++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 1dc93c20..9bc39238 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.18 require ( - github.com/aws/aws-sdk-go v1.44.59 + github.com/aws/aws-sdk-go v1.44.190 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.13.0 github.com/charmbracelet/bubbletea v0.21.0 @@ -34,6 +34,6 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect go.uber.org/atomic v1.4.0 // indirect - golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/sys v0.1.0 // indirect + golang.org/x/term v0.1.0 // indirect ) diff --git a/go.sum b/go.sum index 6caab396..5461c2fa 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.59 h1:bkdnNsMvMhFmNLqKDAJ6rKR+S0hjOt/3AIJp2mxOK9o= -github.com/aws/aws-sdk-go v1.44.59/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.190 h1:QC+Pf/Ooj7Waf2obOPZbIQOqr00hy4h54j3ZK9mvHcc= +github.com/aws/aws-sdk-go v1.44.190/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= @@ -145,6 +145,7 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -153,39 +154,56 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= From c646fb8f6a98484ed3ad10b0b961fd41c7bd0f22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 09:52:00 -0600 Subject: [PATCH 06/58] Bump github.com/spf13/pflag from 1.0.3 to 1.0.5 (#170) --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 9bc39238..25891f53 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/spf13/cobra v0.0.7 - github.com/spf13/pflag v1.0.3 + github.com/spf13/pflag v1.0.5 go.uber.org/multierr v1.1.0 gopkg.in/ini.v1 v1.67.0 ) diff --git a/go.sum b/go.sum index 5461c2fa..25dec8c3 100644 --- a/go.sum +++ b/go.sum @@ -134,8 +134,9 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cobra v0.0.7 h1:FfTH+vuMXOas8jmfb5/M7dzEYx7LpcLb7a0LPe34uOU= github.com/spf13/cobra v0.0.7/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From d8d47aa8f35ac486a31c226e7da1609dfcef8594 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 10:11:36 -0600 Subject: [PATCH 07/58] Bump github.com/imdario/mergo from 0.3.11 to 0.3.13 (#168) Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.11 to 0.3.13. - [Release notes](https://github.com/imdario/mergo/releases) - [Commits](https://github.com/imdario/mergo/compare/v0.3.11...v0.3.13) --- updated-dependencies: - dependency-name: github.com/imdario/mergo dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 25891f53..1f29b895 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/charmbracelet/bubbletea v0.21.0 github.com/charmbracelet/lipgloss v0.5.0 github.com/evertras/bubble-table v0.14.4 - github.com/imdario/mergo v0.3.11 + github.com/imdario/mergo v0.3.13 github.com/mitchellh/go-homedir v1.1.0 github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 diff --git a/go.sum b/go.sum index 25dec8c3..f65574ee 100644 --- a/go.sum +++ b/go.sum @@ -56,8 +56,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmg github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= +github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -218,8 +218,8 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From e5b7f677f7bbca34b3630cc2a20a206767f1876a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 12:18:16 -0600 Subject: [PATCH 08/58] Bump github.com/charmbracelet/lipgloss from 0.5.0 to 0.6.0 (#167) Bumps [github.com/charmbracelet/lipgloss](https://github.com/charmbracelet/lipgloss) from 0.5.0 to 0.6.0. - [Release notes](https://github.com/charmbracelet/lipgloss/releases) - [Commits](https://github.com/charmbracelet/lipgloss/compare/v0.5.0...v0.6.0) --- updated-dependencies: - dependency-name: github.com/charmbracelet/lipgloss dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 1f29b895..f3f506d7 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.13.0 github.com/charmbracelet/bubbletea v0.21.0 - github.com/charmbracelet/lipgloss v0.5.0 + github.com/charmbracelet/lipgloss v0.6.0 github.com/evertras/bubble-table v0.14.4 github.com/imdario/mergo v0.3.13 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index f65574ee..aeca6791 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,9 @@ github.com/charmbracelet/bubbles v0.13.0/go.mod h1:bbeTiXwPww4M031aGi8UK2HT9RDWo github.com/charmbracelet/bubbletea v0.21.0 h1:f3y+kanzgev5PA916qxmDybSHU3N804uOnKnhRPXTcI= github.com/charmbracelet/bubbletea v0.21.0/go.mod h1:GgmJMec61d08zXsOhqRC/AiOx4K4pmz+VIcRIm1FKr4= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= -github.com/charmbracelet/lipgloss v0.5.0 h1:lulQHuVeodSgDez+3rGiuxlPVXSnhth442DATR2/8t8= github.com/charmbracelet/lipgloss v0.5.0/go.mod h1:EZLha/HbzEt7cYqdFPovlqy5FZPj0xFhg5SaqxScmgs= +github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY= +github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= From 3234bcffce498624a5399f7dc79a034caff6296b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 14:44:19 -0600 Subject: [PATCH 09/58] Bump github.com/evertras/bubble-table from 0.14.4 to 0.14.8 (#183) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f3f506d7..f1b2d58a 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/charmbracelet/bubbles v0.13.0 github.com/charmbracelet/bubbletea v0.21.0 github.com/charmbracelet/lipgloss v0.6.0 - github.com/evertras/bubble-table v0.14.4 + github.com/evertras/bubble-table v0.14.8 github.com/imdario/mergo v0.3.13 github.com/mitchellh/go-homedir v1.1.0 github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 diff --git a/go.sum b/go.sum index aeca6791..8ac71195 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/evertras/bubble-table v0.14.4 h1:UHUiPfsJ+lqbPSHIM1n7O8Ie2tbK0r9ReicXFnLg44I= -github.com/evertras/bubble-table v0.14.4/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= +github.com/evertras/bubble-table v0.14.8 h1:ULK7H/iReQKCElUVvtr99itywOCyIvFR0OvfsPvzwEs= +github.com/evertras/bubble-table v0.14.8/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= From 875b76fdf63aa34b6c59489c5baf531aaefc3ecd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 14:44:51 -0600 Subject: [PATCH 10/58] Bump github.com/aws/aws-sdk-go from 1.44.190 to 1.44.204 (#182) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f1b2d58a..79959a5d 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.18 require ( - github.com/aws/aws-sdk-go v1.44.190 + github.com/aws/aws-sdk-go v1.44.204 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.13.0 github.com/charmbracelet/bubbletea v0.21.0 diff --git a/go.sum b/go.sum index 8ac71195..24031a42 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.190 h1:QC+Pf/Ooj7Waf2obOPZbIQOqr00hy4h54j3ZK9mvHcc= -github.com/aws/aws-sdk-go v1.44.190/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.204 h1:7/tPUXfNOHB390A63t6fJIwmlwVQAkAwcbzKsU2/6OQ= +github.com/aws/aws-sdk-go v1.44.204/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= From ed26e393ce1874c7dbb95b939e1071b5cc8126fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Feb 2023 15:03:22 -0600 Subject: [PATCH 11/58] Bump github.com/spf13/cobra from 0.0.7 to 1.6.1 (#175) --- go.mod | 4 +- go.sum | 129 ++++----------------------------------------------------- 2 files changed, 11 insertions(+), 122 deletions(-) diff --git a/go.mod b/go.mod index 79959a5d..a31f6152 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/spf13/cobra v0.0.7 + github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 go.uber.org/multierr v1.1.0 gopkg.in/ini.v1 v1.67.0 @@ -23,7 +23,7 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/containerd/console v1.0.3 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-isatty v0.0.14 // indirect diff --git a/go.sum b/go.sum index 24031a42..6e8cac92 100644 --- a/go.sum +++ b/go.sum @@ -1,18 +1,9 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.204 h1:7/tPUXfNOHB390A63t6fJIwmlwVQAkAwcbzKsU2/6OQ= github.com/aws/aws-sdk-go v1.44.204/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/charmbracelet/bubbles v0.13.0 h1:zP/ROH3wJEBqZWKIsD50ZKKlx3ydLInq3LdD/Nrlb8w= github.com/charmbracelet/bubbles v0.13.0/go.mod h1:bbeTiXwPww4M031aGi8UK2HT9RDWoiNibae+1yCMtcc= github.com/charmbracelet/bubbletea v0.21.0 h1:f3y+kanzgev5PA916qxmDybSHU3N804uOnKnhRPXTcI= @@ -21,74 +12,33 @@ github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJ github.com/charmbracelet/lipgloss v0.5.0/go.mod h1:EZLha/HbzEt7cYqdFPovlqy5FZPj0xFhg5SaqxScmgs= github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY= github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/evertras/bubble-table v0.14.8 h1:ULK7H/iReQKCElUVvtr99itywOCyIvFR0OvfsPvzwEs= github.com/evertras/bubble-table v0.14.8/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTdcDo2ie1pzzhwjt6RHqzpMU34= github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= github.com/muesli/cancelreader v0.2.0 h1:SOpr+CfyVNce341kKqvbhhzQhBPyJRXQaCtn03Pae1Q= @@ -99,86 +49,39 @@ github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKt github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 h1:QANkGiGr39l1EESqrE0gZw0/AJNYzIvoGLhIoVYtluI= github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.7 h1:FfTH+vuMXOas8jmfb5/M7dzEYx7LpcLb7a0LPe34uOU= -github.com/spf13/cobra v0.0.7/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -198,29 +101,15 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 9aa648e8e6468b740cb92435e3719a87d1bc7f63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 5 Mar 2023 12:02:44 -0600 Subject: [PATCH 12/58] Bump go.uber.org/multierr from 1.1.0 to 1.9.0 (#185) Bumps [go.uber.org/multierr](https://github.com/uber-go/multierr) from 1.1.0 to 1.9.0. - [Release notes](https://github.com/uber-go/multierr/releases) - [Changelog](https://github.com/uber-go/multierr/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/multierr/compare/v1.1.0...v1.9.0) --- updated-dependencies: - dependency-name: go.uber.org/multierr dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index a31f6152..796f71c1 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 - go.uber.org/multierr v1.1.0 + go.uber.org/multierr v1.9.0 gopkg.in/ini.v1 v1.67.0 ) @@ -33,7 +33,7 @@ require ( github.com/muesli/reflow v0.3.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect - go.uber.org/atomic v1.4.0 // indirect + go.uber.org/atomic v1.7.0 // indirect golang.org/x/sys v0.1.0 // indirect golang.org/x/term v0.1.0 // indirect ) diff --git a/go.sum b/go.sum index 6e8cac92..dc5bd6c6 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,9 @@ github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/evertras/bubble-table v0.14.8 h1:ULK7H/iReQKCElUVvtr99itywOCyIvFR0OvfsPvzwEs= github.com/evertras/bubble-table v0.14.8/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= @@ -67,12 +68,13 @@ github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUq github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= From 60da7b37af410f74dfb50375a053fd69ba5ffbd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 09:04:11 -0600 Subject: [PATCH 13/58] Bump github.com/aws/aws-sdk-go from 1.44.204 to 1.44.214 (#187) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.204 to 1.44.214. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.204...v1.44.214) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 796f71c1..f6baec9c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.18 require ( - github.com/aws/aws-sdk-go v1.44.204 + github.com/aws/aws-sdk-go v1.44.214 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.13.0 github.com/charmbracelet/bubbletea v0.21.0 diff --git a/go.sum b/go.sum index dc5bd6c6..5611303b 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.204 h1:7/tPUXfNOHB390A63t6fJIwmlwVQAkAwcbzKsU2/6OQ= -github.com/aws/aws-sdk-go v1.44.204/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.214 h1:YzDuC+9UtrAOUkItlK7l3BvKI9o6qAog9X8i289HORc= +github.com/aws/aws-sdk-go v1.44.214/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/charmbracelet/bubbles v0.13.0 h1:zP/ROH3wJEBqZWKIsD50ZKKlx3ydLInq3LdD/Nrlb8w= From 9a458934b9907fc5057867d2c51e9855b6da5a44 Mon Sep 17 00:00:00 2001 From: Brandon Wagner Date: Mon, 20 Mar 2023 10:55:54 -0500 Subject: [PATCH 14/58] deprecate --service eks (#191) --- README.md | 4 +- cmd/main.go | 6 +- pkg/selector/eks.go | 134 --------------------------------------- pkg/selector/eks_test.go | 130 ------------------------------------- pkg/selector/services.go | 3 +- 5 files changed, 8 insertions(+), 269 deletions(-) delete mode 100644 pkg/selector/eks.go delete mode 100644 pkg/selector/eks_test.go diff --git a/README.md b/README.md index 766a14f3..71ab0eb6 100644 --- a/README.md +++ b/README.md @@ -294,7 +294,7 @@ $ ec2-instance-selector --help ``` ```bash#help -ec2-instance-selector is a CLI tool to filter EC2 instance types based on resource criteria. +ec2-instance-selector is a CLI tool to filter EC2 instance types based on resource criteria. Filtering allows you to select all the instance types that match your application requirements. Full docs can be found at github.com/aws/amazon-ec2-instance-selector @@ -378,7 +378,7 @@ Filter Flags: Suite Flags: --base-instance-type string Instance Type used to retrieve similarly spec'd instance types --flexible Retrieves a group of instance types spanning multiple generations based on opinionated defaults and user overridden resource filters - --service string Filter instance types based on service support (Example: eks, eks-20201211, or emr-5.20.0) + --service string Filter instance types based on service support (Example: emr-5.20.0) Global Flags: diff --git a/cmd/main.go b/cmd/main.go index c2dfede4..5c1bdf75 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -210,7 +210,7 @@ Full docs can be found at github.com/aws/amazon-` + binName cli.SuiteStringFlag(instanceTypeBase, nil, nil, "Instance Type used to retrieve similarly spec'd instance types", nil) cli.SuiteBoolFlag(flexible, nil, nil, "Retrieves a group of instance types spanning multiple generations based on opinionated defaults and user overridden resource filters") - cli.SuiteStringFlag(service, nil, nil, "Filter instance types based on service support (Example: eks, eks-20201211, or emr-5.20.0)", nil) + cli.SuiteStringFlag(service, nil, nil, "Filter instance types based on service support (Example: emr-5.20.0)", nil) // Configuration Flags - These will be grouped at the bottom of the help flags @@ -242,6 +242,10 @@ Full docs can be found at github.com/aws/amazon-` + binName os.Exit(0) } + if flags[service] != nil { + log.Println("--service eks is deprecated. EKS generally supports all instance types") + } + sess, err := getRegionAndProfileAWSSession(cli.StringMe(flags[region]), cli.StringMe(flags[profile])) if err != nil { fmt.Println(err) diff --git a/pkg/selector/eks.go b/pkg/selector/eks.go deleted file mode 100644 index 184131fc..00000000 --- a/pkg/selector/eks.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"). You may -// not use this file except in compliance with the License. A copy of the -// License is located at -// -// http://aws.amazon.com/apache2.0/ -// -// or in the "license" file accompanying this file. This file is distributed -// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -// express or implied. See the License for the specific language governing -// permissions and limitations under the License. - -package selector - -import ( - "archive/zip" - "bytes" - "fmt" - "io/ioutil" - "log" - "net/http" - "strings" - - "github.com/aws/aws-sdk-go/aws" -) - -const ( - eksAMIRepoURL = "https://github.com/awslabs/amazon-eks-ami" - eksFallbackLatestAMIVersion = "v20210125" - eksInstanceTypesFile = "eni-max-pods.txt" -) - -// EKS is a Service type for a custom service filter transform -type EKS struct { - AMIRepoURL string -} - -// Filters implements the Service interface contract for EKS -func (e *EKS) Filters(version string) (Filters, error) { - if e.AMIRepoURL == "" { - e.AMIRepoURL = eksAMIRepoURL - } - var filters Filters - - if version == "" { - var err error - version, err = e.getLatestAMIVersion() - if err != nil { - log.Printf("There was a problem fetching the latest EKS AMI version, using hardcoded fallback version %s\n", eksFallbackLatestAMIVersion) - version = eksFallbackLatestAMIVersion - } - } - supportedInstanceTypes, err := e.getSupportedInstanceTypes(version) - if err != nil { - log.Printf("Unable to retrieve EKS supported instance types for version %s: %v", version, err) - return filters, err - } - filters.InstanceTypes = &supportedInstanceTypes - filters.VirtualizationType = aws.String("hvm") - return filters, nil -} - -func (e *EKS) getSupportedInstanceTypes(version string) ([]string, error) { - supportedInstanceTypes := []string{} - resp, err := http.Get(fmt.Sprintf("%s/archive/%s.zip", e.AMIRepoURL, version)) - if err != nil { - return supportedInstanceTypes, err - } - - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - return supportedInstanceTypes, fmt.Errorf("Unable to retrieve EKS supported instance types, got non-200 status code: %d", resp.StatusCode) - } - - body, err := ioutil.ReadAll(resp.Body) - if err != nil { - return supportedInstanceTypes, err - } - - zipReader, err := zip.NewReader(bytes.NewReader(body), int64(len(body))) - if err != nil { - return supportedInstanceTypes, err - } - - // Read all the files from zip archive - for _, zipFile := range zipReader.File { - filePathParts := strings.Split(zipFile.Name, "/") - fileName := filePathParts[len(filePathParts)-1] - if fileName == eksInstanceTypesFile { - unzippedFileBytes, err := readZipFile(zipFile) - if err != nil { - log.Println(err) - continue - } - supportedInstanceTypesFileBody := string(unzippedFileBytes) - for _, line := range strings.Split(strings.Replace(supportedInstanceTypesFileBody, "\r\n", "\n", -1), "\n") { - if !strings.HasPrefix(line, "#") { - instanceType := strings.Split(line, " ")[0] - supportedInstanceTypes = append(supportedInstanceTypes, instanceType) - } - } - } - } - return supportedInstanceTypes, nil -} - -func (e EKS) getLatestAMIVersion() (string, error) { - client := &http.Client{ - CheckRedirect: func(req *http.Request, via []*http.Request) error { - return http.ErrUseLastResponse - }, - } - // Get latest version - resp, err := client.Get(fmt.Sprintf("%s/releases/latest", e.AMIRepoURL)) - if err != nil { - return "", err - } - if resp.StatusCode != http.StatusFound { - return "", fmt.Errorf("Can't retrieve latest release from github because redirect was not sent") - } - versionRedirect := resp.Header.Get("location") - pathParts := strings.Split(versionRedirect, "/") - return pathParts[len(pathParts)-1], nil -} - -func readZipFile(zf *zip.File) ([]byte, error) { - f, err := zf.Open() - if err != nil { - return nil, err - } - defer f.Close() - return ioutil.ReadAll(f) -} diff --git a/pkg/selector/eks_test.go b/pkg/selector/eks_test.go deleted file mode 100644 index 3da4380d..00000000 --- a/pkg/selector/eks_test.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"). You may -// not use this file except in compliance with the License. A copy of the -// License is located at -// -// http://aws.amazon.com/apache2.0/ -// -// or in the "license" file accompanying this file. This file is distributed -// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -// express or implied. See the License for the specific language governing -// permissions and limitations under the License. - -package selector_test - -import ( - "fmt" - "io/ioutil" - "net/http" - "net/http/httptest" - "testing" - - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" -) - -const ( - githubStaticReleasesDir = "GithubEKSAMIRelease" - githubReleaseVersion = "20210125" - githubZipFileName = "amazon-eks-ami-20210125.zip" -) - -// Tests - -func TestEKSDefaultService(t *testing.T) { - ghServer := eksGithubReleaseHTTPServer(false, false) - defer ghServer.Close() - - registry := selector.NewRegistry() - registry.Register("eks", &selector.EKS{ - AMIRepoURL: ghServer.URL, - }) - - eks := "eks" - filters := selector.Filters{ - Service: &eks, - } - - transformedFilters, err := registry.ExecuteTransforms(filters) - h.Ok(t, err) - h.Assert(t, transformedFilters != filters, " Filters should have been modified") - h.Assert(t, len(*transformedFilters.InstanceTypes) == 389, "389 instance types should be supported, but got %d", len(*transformedFilters.InstanceTypes)) - h.Assert(t, *transformedFilters.VirtualizationType == "hvm", "eks should only support hvm") - - eks = "eks-v" + githubReleaseVersion - filters.Service = &eks - transformedFilters, err = registry.ExecuteTransforms(filters) - h.Ok(t, err) - h.Assert(t, transformedFilters != filters, " Filters should have been modified") - h.Assert(t, len(*transformedFilters.InstanceTypes) == 389, "389 instance types should be supported, but got %d", len(*transformedFilters.InstanceTypes)) - h.Assert(t, *transformedFilters.VirtualizationType == "hvm", "eks should only support hvm") -} - -func TestEKSDefaultService_FailLatestReleaseUseFallbackStaticVersion(t *testing.T) { - ghServer := eksGithubReleaseHTTPServer(true, false) - defer ghServer.Close() - - registry := selector.NewRegistry() - registry.Register("eks", &selector.EKS{ - AMIRepoURL: ghServer.URL, - }) - - eks := "eks" - filters := selector.Filters{ - Service: &eks, - } - - transformedFilters, err := registry.ExecuteTransforms(filters) - h.Ok(t, err) - h.Assert(t, transformedFilters != filters, " Filters should have been modified") - h.Assert(t, len(*transformedFilters.InstanceTypes) == 389, "389 instance types should be supported, but got %d", len(*transformedFilters.InstanceTypes)) - h.Assert(t, *transformedFilters.VirtualizationType == "hvm", "eks should only support hvm") -} - -func TestEKSDefaultService_FailLatestReleaseAndFailExactVersionLookup(t *testing.T) { - ghServer := eksGithubReleaseHTTPServer(true, true) - defer ghServer.Close() - - registry := selector.NewRegistry() - registry.Register("eks", &selector.EKS{ - AMIRepoURL: ghServer.URL, - }) - - eks := "eks" - filters := selector.Filters{ - Service: &eks, - } - - _, err := registry.ExecuteTransforms(filters) - h.Nok(t, err) -} - -// Test Helpers Functions - -func eksGithubReleaseHTTPServer(failLatestRelease bool, failExactRelease bool) *httptest.Server { - return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path == "/releases/latest" { - if failLatestRelease { - w.WriteHeader(404) - return - } - w.Header().Add("location", "/releases/tag/v"+githubReleaseVersion) - w.WriteHeader(302) - return - } - if r.URL.Path == "/archive/v"+githubReleaseVersion+".zip" { - if failExactRelease { - w.WriteHeader(404) - return - } - ghReleaseZipPath := fmt.Sprintf("%s/%s/%s", mockFilesPath, githubStaticReleasesDir, githubZipFileName) - eksAMIReleaseZipFile, err := ioutil.ReadFile(ghReleaseZipPath) - if err != nil { - panic("Could not read EKS AMI release zip file") - } - w.Write(eksAMIReleaseZipFile) - return - } - })) -} diff --git a/pkg/selector/services.go b/pkg/selector/services.go index b1ddf8af..b46495c0 100644 --- a/pkg/selector/services.go +++ b/pkg/selector/services.go @@ -59,14 +59,13 @@ func (sr *ServiceRegistry) Register(name string, service Service) { // RegisterAWSServices registers the built-in AWS service filter transforms func (sr *ServiceRegistry) RegisterAWSServices() { - sr.Register("eks", &EKS{}) sr.Register("emr", &EMR{}) } // ExecuteTransforms will execute the ServiceRegistry's registered service filter transforms // Filters.Service will be parsed as - and passed to Service.Filters func (sr *ServiceRegistry) ExecuteTransforms(filters Filters) (Filters, error) { - if filters.Service == nil || *filters.Service == "" { + if filters.Service == nil || *filters.Service == "" || *filters.Service == "eks" { return filters, nil } serviceAndVersion := strings.ToLower(*filters.Service) From 7e0310030079630bc8223e619cae84a78dee6500 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 08:39:47 -0500 Subject: [PATCH 15/58] Bump github.com/aws/aws-sdk-go from 1.44.214 to 1.44.234 (#195) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.214 to 1.44.234. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.214...v1.44.234) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f6baec9c..88622990 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.18 require ( - github.com/aws/aws-sdk-go v1.44.214 + github.com/aws/aws-sdk-go v1.44.234 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.13.0 github.com/charmbracelet/bubbletea v0.21.0 diff --git a/go.sum b/go.sum index 5611303b..10e9d749 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.214 h1:YzDuC+9UtrAOUkItlK7l3BvKI9o6qAog9X8i289HORc= -github.com/aws/aws-sdk-go v1.44.214/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.234 h1:8YbQ5AhpgV/cC7jYX8qS34Am/vcn2ZoIFJ1qIgwOL+0= +github.com/aws/aws-sdk-go v1.44.234/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/charmbracelet/bubbles v0.13.0 h1:zP/ROH3wJEBqZWKIsD50ZKKlx3ydLInq3LdD/Nrlb8w= From ed6dd0a4e2aa5ef62398712ac4175d8955768130 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 13:07:54 -0500 Subject: [PATCH 16/58] Bump github.com/imdario/mergo from 0.3.13 to 0.3.15 (#197) Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.13 to 0.3.15. - [Release notes](https://github.com/imdario/mergo/releases) - [Commits](https://github.com/imdario/mergo/compare/v0.3.13...v0.3.15) --- updated-dependencies: - dependency-name: github.com/imdario/mergo dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 88622990..97b68ced 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/charmbracelet/bubbletea v0.21.0 github.com/charmbracelet/lipgloss v0.6.0 github.com/evertras/bubble-table v0.14.8 - github.com/imdario/mergo v0.3.13 + github.com/imdario/mergo v0.3.15 github.com/mitchellh/go-homedir v1.1.0 github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 diff --git a/go.sum b/go.sum index 10e9d749..0e873b70 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/evertras/bubble-table v0.14.8 h1:ULK7H/iReQKCElUVvtr99itywOCyIvFR0OvfsPvzwEs= github.com/evertras/bubble-table v0.14.8/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= @@ -112,6 +112,5 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 929d4a3fe7f898075ffa7de19016b3e492ab6af8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 11:01:54 -0500 Subject: [PATCH 17/58] Bump github.com/charmbracelet/bubbles from 0.13.0 to 0.15.0 (#176) * Bump github.com/charmbracelet/bubbles from 0.13.0 to 0.15.0 Bumps [github.com/charmbracelet/bubbles](https://github.com/charmbracelet/bubbles) from 0.13.0 to 0.15.0. - [Release notes](https://github.com/charmbracelet/bubbles/releases) - [Commits](https://github.com/charmbracelet/bubbles/compare/v0.13.0...v0.15.0) --- updated-dependencies: - dependency-name: github.com/charmbracelet/bubbles dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * add missing third party licenses --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jerad C --- THIRD_PARTY_LICENSES | 4 ++++ go.mod | 15 +++++++++------ go.sum | 30 ++++++++++++++++++------------ 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/THIRD_PARTY_LICENSES b/THIRD_PARTY_LICENSES index 8760d32f..96d2630c 100644 --- a/THIRD_PARTY_LICENSES +++ b/THIRD_PARTY_LICENSES @@ -318,6 +318,10 @@ Copyright (c) 2012-2019 Patrick Mylund Nielsen and the go-cache contributors Copyright (c) 2017-2021 Uber Technologies, Inc. ** atomic; version v1.4.0 -- https://go.uber.org/atomic Copyright (c) 2017-2021 Uber Technologies, Inc. +** go-localereader; version v0.0.1 -- https://github.com/mattn/go-localereader +Copyright (c) 2022 Yasuhiro Matsumoto +** go-osc52; version v1.0.3 -- https://github.com/aymanbagabas/go-osc52 +Copyright (c) 2022 Ayman Bagabas The MIT License (MIT) diff --git a/go.mod b/go.mod index 97b68ced..8fc3b99d 100644 --- a/go.mod +++ b/go.mod @@ -5,13 +5,13 @@ go 1.18 require ( github.com/aws/aws-sdk-go v1.44.234 github.com/blang/semver/v4 v4.0.0 - github.com/charmbracelet/bubbles v0.13.0 - github.com/charmbracelet/bubbletea v0.21.0 + github.com/charmbracelet/bubbles v0.15.0 + github.com/charmbracelet/bubbletea v0.23.1 github.com/charmbracelet/lipgloss v0.6.0 github.com/evertras/bubble-table v0.14.8 github.com/imdario/mergo v0.3.15 github.com/mitchellh/go-homedir v1.1.0 - github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 + github.com/muesli/termenv v0.13.0 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/spf13/cobra v1.6.1 @@ -22,18 +22,21 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect + github.com/aymanbagabas/go-osc52 v1.0.3 // indirect github.com/containerd/console v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mattn/go-runewidth v0.0.13 // indirect + github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-localereader v0.0.1 // indirect + github.com/mattn/go-runewidth v0.0.14 // indirect github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect - github.com/muesli/cancelreader v0.2.0 // indirect + github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/reflow v0.3.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect go.uber.org/atomic v1.7.0 // indirect golang.org/x/sys v0.1.0 // indirect golang.org/x/term v0.1.0 // indirect + golang.org/x/text v0.4.0 // indirect ) diff --git a/go.sum b/go.sum index 0e873b70..7f0b9936 100644 --- a/go.sum +++ b/go.sum @@ -2,14 +2,15 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.234 h1:8YbQ5AhpgV/cC7jYX8qS34Am/vcn2ZoIFJ1qIgwOL+0= github.com/aws/aws-sdk-go v1.44.234/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aymanbagabas/go-osc52 v1.0.3 h1:DTwqENW7X9arYimJrPeGZcV0ln14sGMt3pHZspWD+Mg= +github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/charmbracelet/bubbles v0.13.0 h1:zP/ROH3wJEBqZWKIsD50ZKKlx3ydLInq3LdD/Nrlb8w= -github.com/charmbracelet/bubbles v0.13.0/go.mod h1:bbeTiXwPww4M031aGi8UK2HT9RDWoiNibae+1yCMtcc= -github.com/charmbracelet/bubbletea v0.21.0 h1:f3y+kanzgev5PA916qxmDybSHU3N804uOnKnhRPXTcI= -github.com/charmbracelet/bubbletea v0.21.0/go.mod h1:GgmJMec61d08zXsOhqRC/AiOx4K4pmz+VIcRIm1FKr4= +github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= +github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= +github.com/charmbracelet/bubbletea v0.23.1 h1:CYdteX1wCiCzKNUlwm25ZHBIc1GXlYFyUIte8WPvhck= +github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= -github.com/charmbracelet/lipgloss v0.5.0/go.mod h1:EZLha/HbzEt7cYqdFPovlqy5FZPj0xFhg5SaqxScmgs= github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY= github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= @@ -32,24 +33,28 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= +github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTdcDo2ie1pzzhwjt6RHqzpMU34= github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= -github.com/muesli/cancelreader v0.2.0 h1:SOpr+CfyVNce341kKqvbhhzQhBPyJRXQaCtn03Pae1Q= -github.com/muesli/cancelreader v0.2.0/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= +github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= +github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= -github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739 h1:QANkGiGr39l1EESqrE0gZw0/AJNYzIvoGLhIoVYtluI= -github.com/muesli/termenv v0.11.1-0.20220212125758-44cd13922739/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= +github.com/muesli/termenv v0.13.0 h1:wK20DRpJdDX8b7Ek2QfhvqhRQFZ237RGRO0RQ/Iqdy0= +github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= @@ -90,9 +95,9 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -102,6 +107,7 @@ golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= From e67f15df013264dbb13c63357c47c6745b059879 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 13:26:30 -0500 Subject: [PATCH 18/58] Bump github.com/charmbracelet/lipgloss from 0.6.0 to 0.7.1 (#189) * Bump github.com/charmbracelet/lipgloss from 0.6.0 to 0.7.1 Bumps [github.com/charmbracelet/lipgloss](https://github.com/charmbracelet/lipgloss) from 0.6.0 to 0.7.1. - [Release notes](https://github.com/charmbracelet/lipgloss/releases) - [Commits](https://github.com/charmbracelet/lipgloss/compare/v0.6.0...v0.7.1) --- updated-dependencies: - dependency-name: github.com/charmbracelet/lipgloss dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * update function signature --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jerad C --- go.mod | 10 +++++----- go.sum | 15 ++++++++++----- pkg/selector/outputs/sortingView.go | 7 +++++-- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 8fc3b99d..ce8e6e70 100644 --- a/go.mod +++ b/go.mod @@ -7,11 +7,11 @@ require ( github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.15.0 github.com/charmbracelet/bubbletea v0.23.1 - github.com/charmbracelet/lipgloss v0.6.0 + github.com/charmbracelet/lipgloss v0.7.1 github.com/evertras/bubble-table v0.14.8 github.com/imdario/mergo v0.3.15 github.com/mitchellh/go-homedir v1.1.0 - github.com/muesli/termenv v0.13.0 + github.com/muesli/termenv v0.15.1 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/spf13/cobra v1.6.1 @@ -22,12 +22,12 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect - github.com/aymanbagabas/go-osc52 v1.0.3 // indirect + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect @@ -36,7 +36,7 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect go.uber.org/atomic v1.7.0 // indirect - golang.org/x/sys v0.1.0 // indirect + golang.org/x/sys v0.6.0 // indirect golang.org/x/term v0.1.0 // indirect golang.org/x/text v0.4.0 // indirect ) diff --git a/go.sum b/go.sum index 7f0b9936..9d4c5ff9 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,9 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.234 h1:8YbQ5AhpgV/cC7jYX8qS34Am/vcn2ZoIFJ1qIgwOL+0= github.com/aws/aws-sdk-go v1.44.234/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aymanbagabas/go-osc52 v1.0.3 h1:DTwqENW7X9arYimJrPeGZcV0ln14sGMt3pHZspWD+Mg= github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= @@ -11,8 +12,9 @@ github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p github.com/charmbracelet/bubbletea v0.23.1 h1:CYdteX1wCiCzKNUlwm25ZHBIc1GXlYFyUIte8WPvhck= github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= -github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY= github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= +github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= +github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -34,8 +36,9 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= @@ -53,8 +56,9 @@ github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIW github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= -github.com/muesli/termenv v0.13.0 h1:wK20DRpJdDX8b7Ek2QfhvqhRQFZ237RGRO0RQ/Iqdy0= github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc= +github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs= +github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= @@ -98,8 +102,9 @@ golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= diff --git a/pkg/selector/outputs/sortingView.go b/pkg/selector/outputs/sortingView.go index 082a5ed0..671b4d4e 100644 --- a/pkg/selector/outputs/sortingView.go +++ b/pkg/selector/outputs/sortingView.go @@ -91,8 +91,11 @@ func (d itemDelegate) Render(w io.Writer, m list.Model, index int, listItem list fn := listItemStyle.Render if index == m.Index() { - fn = func(s string) string { - return selectedItemStyle.Render("> " + s) + fn = func(s ...string) string { + t := make([]string, 0, len(s)+1) + t = append(t, "> ") + t = append(t, s...) + return selectedItemStyle.Render(t...) } } From 9fb645b9190f974115855e959a5f18bdd231cf4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 May 2023 12:48:28 -0500 Subject: [PATCH 19/58] Bump github.com/charmbracelet/bubbletea from 0.23.1 to 0.24.0 (#198) * Bump github.com/charmbracelet/bubbletea from 0.23.1 to 0.24.0 Bumps [github.com/charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) from 0.23.1 to 0.24.0. - [Release notes](https://github.com/charmbracelet/bubbletea/releases) - [Commits](https://github.com/charmbracelet/bubbletea/compare/v0.23.1...v0.24.0) --- updated-dependencies: - dependency-name: github.com/charmbracelet/bubbletea dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * add missing third party license --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jerad C --- THIRD_PARTY_LICENSES | 1 + go.mod | 9 +++++---- go.sum | 15 ++++++++++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/THIRD_PARTY_LICENSES b/THIRD_PARTY_LICENSES index 96d2630c..63c4043c 100644 --- a/THIRD_PARTY_LICENSES +++ b/THIRD_PARTY_LICENSES @@ -1071,6 +1071,7 @@ SOFTWARE. ** golang.org/x/sys; v0.0.0-20220727055044-e65921a090b8 -- https://cs.opensource.google/go/x/sys +** golang.org/x/sync; v0.1.0 -- https://cs.opensource.google/go/x/sync Copyright (c) 2009 The Go Authors. All rights reserved. diff --git a/go.mod b/go.mod index ce8e6e70..9f35adfc 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go v1.44.234 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.15.0 - github.com/charmbracelet/bubbletea v0.23.1 + github.com/charmbracelet/bubbletea v0.24.0 github.com/charmbracelet/lipgloss v0.7.1 github.com/evertras/bubble-table v0.14.8 github.com/imdario/mergo v0.3.15 @@ -23,11 +23,11 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/containerd/console v1.0.3 // indirect + github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.18 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect @@ -36,7 +36,8 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect go.uber.org/atomic v1.7.0 // indirect + golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.1.0 // indirect + golang.org/x/term v0.6.0 // indirect golang.org/x/text v0.4.0 // indirect ) diff --git a/go.sum b/go.sum index 9d4c5ff9..67c3ea3c 100644 --- a/go.sum +++ b/go.sum @@ -9,14 +9,16 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= -github.com/charmbracelet/bubbletea v0.23.1 h1:CYdteX1wCiCzKNUlwm25ZHBIc1GXlYFyUIte8WPvhck= github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= +github.com/charmbracelet/bubbletea v0.24.0 h1:l8PHrft/GIeikDPCUhQe53AJrDD8xGSn0Agirh8xbe8= +github.com/charmbracelet/bubbletea v0.24.0/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= -github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= +github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= +github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -37,8 +39,8 @@ github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69 github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= +github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= @@ -93,6 +95,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -107,8 +111,9 @@ golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= From 7864aa51fbd6866f2d67963c08db50fce909ff16 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 08:26:40 -0500 Subject: [PATCH 20/58] Bump github.com/evertras/bubble-table from 0.14.8 to 0.15.2 (#202) Bumps [github.com/evertras/bubble-table](https://github.com/evertras/bubble-table) from 0.14.8 to 0.15.2. - [Release notes](https://github.com/evertras/bubble-table/releases) - [Commits](https://github.com/evertras/bubble-table/compare/v0.14.8...v0.15.2) --- updated-dependencies: - dependency-name: github.com/evertras/bubble-table dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9f35adfc..7cc73061 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/charmbracelet/bubbles v0.15.0 github.com/charmbracelet/bubbletea v0.24.0 github.com/charmbracelet/lipgloss v0.7.1 - github.com/evertras/bubble-table v0.14.8 + github.com/evertras/bubble-table v0.15.2 github.com/imdario/mergo v0.3.15 github.com/mitchellh/go-homedir v1.1.0 github.com/muesli/termenv v0.15.1 diff --git a/go.sum b/go.sum index 67c3ea3c..fb9b2611 100644 --- a/go.sum +++ b/go.sum @@ -23,8 +23,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/evertras/bubble-table v0.14.8 h1:ULK7H/iReQKCElUVvtr99itywOCyIvFR0OvfsPvzwEs= -github.com/evertras/bubble-table v0.14.8/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= +github.com/evertras/bubble-table v0.15.2 h1:hVj27V9tk5TD5p6mVv0RK/KJu2sHq0U+mBMux/HptkU= +github.com/evertras/bubble-table v0.15.2/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= From c938198a0c6d22617a58089b04c0590baf75f894 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 08:27:18 -0500 Subject: [PATCH 21/58] Bump github.com/aws/aws-sdk-go from 1.44.234 to 1.44.262 (#200) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.234 to 1.44.262. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.234...v1.44.262) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7cc73061..6dee9514 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.18 require ( - github.com/aws/aws-sdk-go v1.44.234 + github.com/aws/aws-sdk-go v1.44.262 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.15.0 github.com/charmbracelet/bubbletea v0.24.0 diff --git a/go.sum b/go.sum index fb9b2611..94a5e21a 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.234 h1:8YbQ5AhpgV/cC7jYX8qS34Am/vcn2ZoIFJ1qIgwOL+0= -github.com/aws/aws-sdk-go v1.44.234/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.262 h1:gyXpcJptWoNkK+DiAiaBltlreoWKQXjAIh6FRh60F+I= +github.com/aws/aws-sdk-go v1.44.262/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= From 6211b5257156b49f5d6c1d9249f5f033e6fa3ccb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 08:27:46 -0500 Subject: [PATCH 22/58] Bump github.com/spf13/cobra from 1.6.1 to 1.7.0 (#201) Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.6.1 to 1.7.0. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.6.1...v1.7.0) --- updated-dependencies: - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 6dee9514..9f773ca9 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/muesli/termenv v0.15.1 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/spf13/cobra v1.6.1 + github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 go.uber.org/multierr v1.9.0 gopkg.in/ini.v1 v1.67.0 @@ -24,7 +24,7 @@ require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-isatty v0.0.18 // indirect diff --git a/go.sum b/go.sum index 94a5e21a..4578d48d 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/evertras/bubble-table v0.15.2 h1:hVj27V9tk5TD5p6mVv0RK/KJu2sHq0U+mBMu github.com/evertras/bubble-table v0.15.2/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= @@ -74,8 +74,8 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From 0b7e1fb1ac642fc52d64fd67294503ae61ab7e92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 10:58:52 -0500 Subject: [PATCH 23/58] Bump github.com/imdario/mergo from 0.3.15 to 0.3.16 (#204) Bumps [github.com/imdario/mergo](https://github.com/imdario/mergo) from 0.3.15 to 0.3.16. - [Release notes](https://github.com/imdario/mergo/releases) - [Commits](https://github.com/imdario/mergo/compare/v0.3.15...v0.3.16) --- updated-dependencies: - dependency-name: github.com/imdario/mergo dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9f773ca9..0c0088e6 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/charmbracelet/bubbletea v0.24.0 github.com/charmbracelet/lipgloss v0.7.1 github.com/evertras/bubble-table v0.15.2 - github.com/imdario/mergo v0.3.15 + github.com/imdario/mergo v0.3.16 github.com/mitchellh/go-homedir v1.1.0 github.com/muesli/termenv v0.15.1 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 diff --git a/go.sum b/go.sum index 4578d48d..5d9fa16e 100644 --- a/go.sum +++ b/go.sum @@ -25,8 +25,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/evertras/bubble-table v0.15.2 h1:hVj27V9tk5TD5p6mVv0RK/KJu2sHq0U+mBMux/HptkU= github.com/evertras/bubble-table v0.15.2/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= -github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= -github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= +github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= From 2475add2cfc89bcbac33943b951d3b9fee7227b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 10:59:42 -0500 Subject: [PATCH 24/58] Bump github.com/aws/aws-sdk-go from 1.44.262 to 1.44.271 (#206) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.262 to 1.44.271. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.262...v1.44.271) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0c0088e6..669f1e81 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.18 require ( - github.com/aws/aws-sdk-go v1.44.262 + github.com/aws/aws-sdk-go v1.44.271 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.15.0 github.com/charmbracelet/bubbletea v0.24.0 diff --git a/go.sum b/go.sum index 5d9fa16e..94fa44fd 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.262 h1:gyXpcJptWoNkK+DiAiaBltlreoWKQXjAIh6FRh60F+I= -github.com/aws/aws-sdk-go v1.44.262/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.271 h1:aa+Nu2JcnFmW1TLIz/67SS7KPq1I1Adl4RmExSMjGVo= +github.com/aws/aws-sdk-go v1.44.271/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= From 992e27930622e4bb20ed4b79cc51534d096b099f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 11:16:35 -0500 Subject: [PATCH 25/58] Bump github.com/charmbracelet/bubbletea from 0.24.0 to 0.24.1 (#205) Bumps [github.com/charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) from 0.24.0 to 0.24.1. - [Release notes](https://github.com/charmbracelet/bubbletea/releases) - [Commits](https://github.com/charmbracelet/bubbletea/compare/v0.24.0...v0.24.1) --- updated-dependencies: - dependency-name: github.com/charmbracelet/bubbletea dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 669f1e81..884aece7 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go v1.44.271 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.15.0 - github.com/charmbracelet/bubbletea v0.24.0 + github.com/charmbracelet/bubbletea v0.24.1 github.com/charmbracelet/lipgloss v0.7.1 github.com/evertras/bubble-table v0.15.2 github.com/imdario/mergo v0.3.16 diff --git a/go.sum b/go.sum index 94fa44fd..f7bb519e 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,8 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= -github.com/charmbracelet/bubbletea v0.24.0 h1:l8PHrft/GIeikDPCUhQe53AJrDD8xGSn0Agirh8xbe8= -github.com/charmbracelet/bubbletea v0.24.0/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= +github.com/charmbracelet/bubbletea v0.24.1 h1:LpdYfnu+Qc6XtvMz6d/6rRY71yttHTP5HtrjMgWvixc= +github.com/charmbracelet/bubbletea v0.24.1/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= From 74e721cb8c1e70efd5388afa5267c1fe5e352769 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Thu, 1 Jun 2023 12:58:05 -0500 Subject: [PATCH 26/58] migrate to aws-sdk-go-v2 (#158) Co-authored-by: Jerad C --- README.md | 24 +- THIRD_PARTY_LICENSES | 20 +- cmd/examples/example1.go | 28 +- cmd/main.go | 174 +- go.mod | 15 +- go.sum | 32 +- pkg/awsapi/selectorec2.go | 12 + pkg/cli/cli.go | 13 + pkg/cli/flags.go | 40 + pkg/cli/types.go | 40 + pkg/ec2pricing/ec2pricing.go | 66 +- pkg/ec2pricing/ec2pricing_test.go | 112 +- pkg/ec2pricing/odpricing.go | 174 +- pkg/ec2pricing/spotpricing.go | 55 +- pkg/instancetypes/instancetypes.go | 46 +- pkg/selector/aggregates.go | 57 +- pkg/selector/aggregates_test.go | 12 +- pkg/selector/comparators.go | 187 +- pkg/selector/comparators_internal_test.go | 12 +- pkg/selector/emr.go | 8 +- .../outputs/bubbletea_internal_test.go | 11 +- pkg/selector/outputs/outputs.go | 26 +- pkg/selector/outputs/outputs_test.go | 4 +- pkg/selector/outputs/tableView.go | 4 +- pkg/selector/outputs/verboseView.go | 5 +- pkg/selector/selector.go | 250 ++- pkg/selector/selector_test.go | 273 +-- pkg/selector/services_test.go | 2 +- pkg/selector/types.go | 61 +- pkg/selector/types_test.go | 3 +- pkg/sorter/sorter.go | 17 +- pkg/sorter/sorter_test.go | 2 +- .../g2_2xlarge_group.json | 0 .../pv_instances.json | 0 .../25_instances.json | 1736 ----------------- .../g2_2xlarge.json | 91 - .../DescribeInstanceTypesPages/m4_xlarge.json | 64 - .../DescribeInstanceTypesPages/t3_micro.json | 62 - .../t3_micro_and_p3_16xl.json | 149 -- .../m5_large.json | 0 .../m5_large.json | 0 41 files changed, 1142 insertions(+), 2745 deletions(-) create mode 100644 pkg/awsapi/selectorec2.go rename test/static/{DescribeInstanceTypesPages => DescribeInstanceTypes}/g2_2xlarge_group.json (100%) rename test/static/{DescribeInstanceTypesPages => DescribeInstanceTypes}/pv_instances.json (100%) delete mode 100644 test/static/DescribeInstanceTypesPages/25_instances.json delete mode 100644 test/static/DescribeInstanceTypesPages/g2_2xlarge.json delete mode 100644 test/static/DescribeInstanceTypesPages/m4_xlarge.json delete mode 100644 test/static/DescribeInstanceTypesPages/t3_micro.json delete mode 100644 test/static/DescribeInstanceTypesPages/t3_micro_and_p3_16xl.json rename test/static/{DescribeSpotPriceHistoryPages => DescribeSpotPriceHistory}/m5_large.json (100%) rename test/static/{GetProductsPages => GetProducts}/m5_large.json (100%) diff --git a/README.md b/README.md index 71ab0eb6..cf079dce 100644 --- a/README.md +++ b/README.md @@ -405,30 +405,32 @@ This is a minimal example of using the instance selector go package directly: package main import ( + "context" "fmt" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go-v2/config" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) func main() { + // Initialize a context for the application + ctx := context.Background() + // Load an AWS session by looking at shared credentials or environment variables - // https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("us-east-2"), - }) + // https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk + cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion("us-east-2")) if err != nil { fmt.Printf("Oh no, AWS session credentials cannot be found: %v", err) return } // Instantiate a new instance of a selector with the AWS session - instanceSelector := selector.New(sess) + instanceSelector := selector.New(ctx, cfg) // Instantiate an int range filter to specify min and max vcpus - vcpusRange := selector.IntRangeFilter{ + vcpusRange := selector.Int32RangeFilter{ LowerBound: 2, UpperBound: 4, } @@ -437,9 +439,9 @@ func main() { LowerBound: bytequantity.FromGiB(2), UpperBound: bytequantity.FromGiB(4), } - // Create a string for the CPU Architecture so that it can be passed as a pointer + // Create a variable for the CPU Architecture so that it can be passed as a pointer // when creating the Filter struct - cpuArch := "x86_64" + cpuArch := ec2types.ArchitectureTypeX8664 // Create a Filter struct with criteria you would like to filter // The full struct definition can be found here for all of the supported filters: @@ -451,7 +453,7 @@ func main() { } // Pass the Filter struct to the Filter function of your selector instance - instanceTypesSlice, err := instanceSelector.Filter(filters) + instanceTypesSlice, err := instanceSelector.Filter(ctx, filters) if err != nil { fmt.Printf("Oh no, there was an error :( %v", err) return diff --git a/THIRD_PARTY_LICENSES b/THIRD_PARTY_LICENSES index 63c4043c..c88ce953 100644 --- a/THIRD_PARTY_LICENSES +++ b/THIRD_PARTY_LICENSES @@ -5,6 +5,24 @@ github.com/aws/amazon-ec2-instance-selector (Apache-2.0) Third Party Licenses: AWS SDK for Go Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. Copyright 2014-2015 Stripe, Inc. +** aws-sdk-go-v2; version v1.29.33 -- https://github.com/aws/aws-sdk-go-v2 +AWS SDK for Go +Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2014-2015 Stripe, Inc. +** smithy-go; version v1.13.3 -- https://github.com/aws/smithy-go +Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +** configsources; version v1.1.22 -- https://github.com/aws/aws-sdk-go-v2/internal/configsources +** ini; version v1.13.23 -- https://github.com/aws/aws-sdk-go-v2/internal/ini +** endpoints; version v2.4.16 -- https://github.com/aws/aws-sdk-go-v2/internal/endpoints +** config; version v1.17.6 -- https://github.com/aws/aws-sdk-go-v2/config +** ec2; version v1.57.0 -- https://github.com/aws/aws-sdk-go-v2/service/ec2 +** presigned-url; version v1.9.16 -- https://github.com/aws/aws-sdk-go-v2/service/internal/presigned-url +** ssooidc; version v1.13.4 -- https://github.com/aws/aws-sdk-go-v2/service/ssooidc +** credentials; version v1.12.19 -- https://github.com/aws/aws-sdk-go-v2/credentials +** imds; version v1.12.16 -- https://github.com/aws/aws-sdk-go-v2/feature/ec2/imds +** pricing; version v1.17.0 -- https://github.com/aws/aws-sdk-go-v2/service/pricing +** sso; version v1.11.22 -- https://github.com/aws/aws-sdk-go-v2/service/sso +** sts; version v1.16.18 -- https://github.com/aws/aws-sdk-go-v2/service/sts ** cobra; version 0.0.6 -- https://github.com/spf13/cobra Copyright © 2015 Steve Francia ** go-yaml/yaml; version v2.2.2 -- https://github.com/go-yaml/yaml @@ -1483,4 +1501,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/cmd/examples/example1.go b/cmd/examples/example1.go index 31b44b09..48d44666 100644 --- a/cmd/examples/example1.go +++ b/cmd/examples/example1.go @@ -1,30 +1,36 @@ package main import ( + "context" "fmt" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go-v2/config" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) func main() { + // Initialize a context for the application + ctx := context.Background() + // Load an AWS session by looking at shared credentials or environment variables - // https://docs.aws.amazon.com/sdk-for-go/api/aws/session/ - sess, err := session.NewSession(&aws.Config{ - Region: aws.String("us-east-2"), - }) + // https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk + cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion("us-east-2")) if err != nil { fmt.Printf("Oh no, AWS session credentials cannot be found: %v", err) return } // Instantiate a new instance of a selector with the AWS session - instanceSelector := selector.New(sess) + instanceSelector, err := selector.New(ctx, cfg) + if err != nil { + fmt.Printf("Oh no, there was an error :( %v", err) + return + } // Instantiate an int range filter to specify min and max vcpus - vcpusRange := selector.IntRangeFilter{ + vcpusRange := selector.Int32RangeFilter{ LowerBound: 2, UpperBound: 4, } @@ -33,9 +39,9 @@ func main() { LowerBound: bytequantity.FromGiB(2), UpperBound: bytequantity.FromGiB(4), } - // Create a string for the CPU Architecture so that it can be passed as a pointer + // Create a variable for the CPU Architecture so that it can be passed as a pointer // when creating the Filter struct - cpuArch := "x86_64" + cpuArch := ec2types.ArchitectureTypeX8664 // Create a Filter struct with criteria you would like to filter // The full struct definition can be found here for all of the supported filters: @@ -47,7 +53,7 @@ func main() { } // Pass the Filter struct to the Filter function of your selector instance - instanceTypesSlice, err := instanceSelector.Filter(filters) + instanceTypesSlice, err := instanceSelector.Filter(ctx, filters) if err != nil { fmt.Printf("Oh no, there was an error :( %v", err) return diff --git a/cmd/main.go b/cmd/main.go index 5c1bdf75..31a56f61 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -14,7 +14,9 @@ package main import ( + "context" "fmt" + "github.com/aws/aws-sdk-go-v2/config" "log" "os" "os/signal" @@ -29,12 +31,10 @@ import ( "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter" - "github.com/aws/aws-sdk-go/aws/session" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" tea "github.com/charmbracelet/bubbletea" - homedir "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" "go.uber.org/multierr" - "gopkg.in/ini.v1" ) const ( @@ -162,12 +162,12 @@ Full docs can be found at github.com/aws/amazon-` + binName // Registers flags with specific input types from the cli pkg // Filter Flags - These will be grouped at the top of the help flags - cli.IntMinMaxRangeFlags(vcpus, cli.StringMe("c"), nil, "Number of vcpus available to the instance type.") + cli.Int32MinMaxRangeFlags(vcpus, cli.StringMe("c"), nil, "Number of vcpus available to the instance type.") cli.ByteQuantityMinMaxRangeFlags(memory, cli.StringMe("m"), nil, "Amount of Memory available (Example: 4 GiB)") cli.RatioFlag(vcpusToMemoryRatio, nil, nil, "The ratio of vcpus to GiBs of memory. (Example: 1:2)") 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"}) cli.StringOptionsFlag(cpuManufacturer, nil, nil, "CPU manufacturer [amd, intel, aws]", []string{"amd", "intel", "aws"}) - cli.IntMinMaxRangeFlags(gpus, cli.StringMe("g"), nil, "Total Number of GPUs (Example: 4)") + cli.Int32MinMaxRangeFlags(gpus, cli.StringMe("g"), nil, "Total Number of GPUs (Example: 4)") cli.ByteQuantityMinMaxRangeFlags(gpuMemoryTotal, nil, nil, "Number of GPUs' total memory (Example: 4 GiB)") cli.StringFlag(gpuManufacturer, nil, nil, "GPU Manufacturer name (Example: NVIDIA)", nil) cli.StringFlag(gpuModel, nil, nil, "GPU Model name (Example: K520)", nil) @@ -186,7 +186,7 @@ Full docs can be found at github.com/aws/amazon-` + binName cli.StringOptionsFlag(hypervisor, nil, nil, "Hypervisor: [xen or nitro]", []string{"xen", "nitro"}) cli.StringSliceFlag(availabilityZones, cli.StringMe("z"), nil, "Availability zones or zone ids to check EC2 capacity offered in specific AZs") cli.BoolFlag(currentGeneration, nil, nil, "Current generation instance types (explicitly set this to false to not return current generation instance types)") - cli.IntMinMaxRangeFlags(networkInterfaces, nil, nil, "Number of network interfaces (ENIs) that can be attached to the instance") + cli.Int32MinMaxRangeFlags(networkInterfaces, nil, nil, "Number of network interfaces (ENIs) that can be attached to the instance") cli.IntMinMaxRangeFlags(networkPerformance, nil, nil, "Bandwidth in Gib/s of network performance (Example: 100)") cli.BoolFlag(networkEncryption, nil, nil, "Instance Types that support automatic network encryption in-transit") cli.BoolFlag(ipv6, nil, nil, "Instance Types that support IPv6") @@ -246,14 +246,21 @@ Full docs can be found at github.com/aws/amazon-` + binName log.Println("--service eks is deprecated. EKS generally supports all instance types") } - sess, err := getRegionAndProfileAWSSession(cli.StringMe(flags[region]), cli.StringMe(flags[profile])) + ctx := context.Background() + cfg, err := config.LoadDefaultConfig(ctx) if err != nil { - fmt.Println(err) + fmt.Printf("Failed to load default AWS configuration: %s\n", err.Error()) os.Exit(1) } - flags[region] = sess.Config.Region + + flags[region] = cfg.Region + cacheTTLDuration := time.Hour * time.Duration(*cli.IntMe(flags[cacheTTL])) - instanceSelector := selector.NewWithCache(sess, cacheTTLDuration, *cli.StringMe(flags[cacheDir])) + instanceSelector, err := selector.NewWithCache(ctx, cfg, cacheTTLDuration, *cli.StringMe(flags[cacheDir])) + if err != nil { + fmt.Printf("An error occurred when initialising the ec2 selector: %v", err) + os.Exit(1) + } shutdown := func() { if err := instanceSelector.Save(); err != nil { log.Printf("There was an error saving pricing caches: %v", err) @@ -268,7 +275,7 @@ Full docs can be found at github.com/aws/amazon-` + binName // If output type is `table-wide`, simply print both prices for better comparison, // even if the actual filter is applied on any one of those based on usage class // Save time by hydrating all caches in parallel - if err := hydrateCaches(*instanceSelector); err != nil { + if err := hydrateCaches(ctx, *instanceSelector); err != nil { log.Printf("%v", err) } } else { @@ -276,13 +283,13 @@ Full docs can be found at github.com/aws/amazon-` + binName if flags[pricePerHour] != nil { if flags[usageClass] == nil || *cli.StringMe(flags[usageClass]) == "on-demand" { if instanceSelector.EC2Pricing.OnDemandCacheCount() == 0 { - if err := instanceSelector.EC2Pricing.RefreshOnDemandCache(); err != nil { + if err := instanceSelector.EC2Pricing.RefreshOnDemandCache(ctx); err != nil { log.Printf("There was a problem refreshing the on-demand pricing cache: %v", err) } } } else { if instanceSelector.EC2Pricing.SpotCacheCount() == 0 { - if err := instanceSelector.EC2Pricing.RefreshSpotCache(spotPricingDaysBack); err != nil { + if err := instanceSelector.EC2Pricing.RefreshSpotCache(ctx, spotPricingDaysBack); err != nil { log.Printf("There was a problem refreshing the spot pricing cache: %v", err) } } @@ -293,13 +300,13 @@ Full docs can be found at github.com/aws/amazon-` + binName if strings.Contains(lowercaseSortField, "price") { if strings.Contains(lowercaseSortField, "spot") { if instanceSelector.EC2Pricing.SpotCacheCount() == 0 { - if err := instanceSelector.EC2Pricing.RefreshSpotCache(spotPricingDaysBack); err != nil { + if err := instanceSelector.EC2Pricing.RefreshSpotCache(ctx, spotPricingDaysBack); err != nil { log.Printf("There was a problem refreshing the spot pricing cache: %v", err) } } } else { if instanceSelector.EC2Pricing.OnDemandCacheCount() == 0 { - if err := instanceSelector.EC2Pricing.RefreshOnDemandCache(); err != nil { + if err := instanceSelector.EC2Pricing.RefreshOnDemandCache(ctx); err != nil { log.Printf("There was a problem refreshing the on-demand pricing cache: %v", err) } } @@ -307,13 +314,55 @@ Full docs can be found at github.com/aws/amazon-` + binName } } + var cpuArchitectureFilterValue *ec2types.ArchitectureType + + if arch, ok := flags[cpuArchitecture].(*string); ok && arch != nil { + value := ec2types.ArchitectureType(*arch) + cpuArchitectureFilterValue = &value + } + + var cpuManufacturerFilterValue *selector.CPUManufacturer + + if cpuMan, ok := flags[cpuManufacturer].(*string); ok && cpuMan != nil { + value := selector.CPUManufacturer(*cpuMan) + cpuManufacturerFilterValue = &value + } + + var virtualizationTypeFilterValue *ec2types.VirtualizationType + + if virtType, ok := flags[virtualizationType].(*string); ok && virtType != nil { + value := ec2types.VirtualizationType(*virtType) + virtualizationTypeFilterValue = &value + } + + var deviceTypeFilterValue *ec2types.RootDeviceType + + if rootDev, ok := flags[rootDeviceType].(*string); ok && rootDev != nil { + value := ec2types.RootDeviceType(*rootDev) + deviceTypeFilterValue = &value + } + + var usageClassFilterValue *ec2types.UsageClassType + + if useClass, ok := flags[usageClass].(*string); ok && useClass != nil { + value := ec2types.UsageClassType(*useClass) + usageClassFilterValue = &value + } + + var hypervisorFilterValue *ec2types.InstanceTypeHypervisor + + if hype, ok := flags[hypervisor].(*string); ok && hype != nil { + value := ec2types.InstanceTypeHypervisor(*hype) + hypervisorFilterValue = &value + } + filters := selector.Filters{ - VCpusRange: cli.IntRangeMe(flags[vcpus]), + VCpusRange: cli.Int32RangeMe(flags[vcpus]), MemoryRange: cli.ByteQuantityRangeMe(flags[memory]), VCpusToMemoryRatio: cli.Float64Me(flags[vcpusToMemoryRatio]), - CPUArchitecture: cli.StringMe(flags[cpuArchitecture]), - CPUManufacturer: cli.StringMe(flags[cpuManufacturer]), - GpusRange: cli.IntRangeMe(flags[gpus]), + CPUArchitecture: cpuArchitectureFilterValue, + CPUManufacturer: cpuManufacturerFilterValue, + GpusRange: cli.Int32RangeMe(flags[gpus]), GpuMemoryRange: cli.ByteQuantityRangeMe(flags[gpuMemoryTotal]), GPUManufacturer: cli.StringMe(flags[gpuManufacturer]), GPUModel: cli.StringMe(flags[gpuModel]), @@ -321,12 +370,12 @@ Full docs can be found at github.com/aws/amazon-` + binName InferenceAcceleratorManufacturer: cli.StringMe(flags[inferenceAcceleratorManufacturer]), InferenceAcceleratorModel: cli.StringMe(flags[inferenceAcceleratorModel]), PlacementGroupStrategy: cli.StringMe(flags[placementGroupStrategy]), - UsageClass: cli.StringMe(flags[usageClass]), - RootDeviceType: cli.StringMe(flags[rootDeviceType]), + UsageClass: usageClassFilterValue, + RootDeviceType: deviceTypeFilterValue, EnaSupport: cli.BoolMe(flags[enaSupport]), EfaSupport: cli.BoolMe(flags[efaSupport]), HibernationSupported: cli.BoolMe(flags[hibernationSupport]), - Hypervisor: cli.StringMe(flags[hypervisor]), + Hypervisor: hypervisorFilterValue, BareMetal: cli.BoolMe(flags[baremetal]), Fpga: cli.BoolMe(flags[fpgaSupport]), Burstable: cli.BoolMe(flags[burstSupport]), @@ -334,7 +383,7 @@ Full docs can be found at github.com/aws/amazon-` + binName AvailabilityZones: cli.StringSliceMe(flags[availabilityZones]), CurrentGeneration: cli.BoolMe(flags[currentGeneration]), MaxResults: cli.IntMe(flags[maxResults]), - NetworkInterfaces: cli.IntRangeMe(flags[networkInterfaces]), + NetworkInterfaces: cli.Int32RangeMe(flags[networkInterfaces]), NetworkPerformance: cli.IntRangeMe(flags[networkPerformance]), NetworkEncryption: cli.BoolMe(flags[networkEncryption]), IPv6: cli.BoolMe(flags[ipv6]), @@ -343,7 +392,7 @@ Full docs can be found at github.com/aws/amazon-` + binName InstanceTypeBase: cli.StringMe(flags[instanceTypeBase]), Flexible: cli.BoolMe(flags[flexible]), Service: cli.StringMe(flags[service]), - VirtualizationType: cli.StringMe(flags[virtualizationType]), + VirtualizationType: virtualizationTypeFilterValue, PricePerHour: cli.Float64RangeMe(flags[pricePerHour]), InstanceStorageRange: cli.ByteQuantityRangeMe(flags[instanceStorage]), DiskType: cli.StringMe(flags[diskType]), @@ -360,7 +409,7 @@ Full docs can be found at github.com/aws/amazon-` + binName if flags[verbose] != nil { resultsOutputFn = outputs.VerboseInstanceTypeOutput - transformedFilters, err := instanceSelector.AggregateFilterTransform(filters) + transformedFilters, err := instanceSelector.AggregateFilterTransform(ctx, filters) if err != nil { fmt.Printf("An error occurred while transforming the aggregate filters") os.Exit(1) @@ -386,7 +435,7 @@ Full docs can be found at github.com/aws/amazon-` + binName // fetch instance types without truncating results prevMaxResults := filters.MaxResults filters.MaxResults = nil - instanceTypesDetails, err := instanceSelector.FilterVerbose(filters) + instanceTypesDetails, err := instanceSelector.FilterVerbose(ctx, filters) if err != nil { fmt.Printf("An error occurred when filtering instance types: %v", err) os.Exit(1) @@ -437,13 +486,13 @@ Full docs can be found at github.com/aws/amazon-` + binName shutdown() } -func hydrateCaches(instanceSelector selector.Selector) (errs error) { +func hydrateCaches(ctx context.Context, instanceSelector selector.Selector) (errs error) { wg := &sync.WaitGroup{} hydrateTasks := []func(*sync.WaitGroup) error{ func(waitGroup *sync.WaitGroup) error { defer waitGroup.Done() if instanceSelector.EC2Pricing.OnDemandCacheCount() == 0 { - if err := instanceSelector.EC2Pricing.RefreshOnDemandCache(); err != nil { + if err := instanceSelector.EC2Pricing.RefreshOnDemandCache(ctx); err != nil { return multierr.Append(errs, fmt.Errorf("There was a problem refreshing the on-demand pricing cache: %w", err)) } } @@ -452,7 +501,7 @@ func hydrateCaches(instanceSelector selector.Selector) (errs error) { func(waitGroup *sync.WaitGroup) error { defer waitGroup.Done() if instanceSelector.EC2Pricing.SpotCacheCount() == 0 { - if err := instanceSelector.EC2Pricing.RefreshSpotCache(spotPricingDaysBack); err != nil { + if err := instanceSelector.EC2Pricing.RefreshSpotCache(ctx, spotPricingDaysBack); err != nil { return multierr.Append(errs, fmt.Errorf("There was a problem refreshing the spot pricing cache: %w", err)) } } @@ -461,7 +510,7 @@ func hydrateCaches(instanceSelector selector.Selector) (errs error) { func(waitGroup *sync.WaitGroup) error { defer waitGroup.Done() if instanceSelector.InstanceTypesProvider.CacheCount() == 0 { - if _, err := instanceSelector.InstanceTypesProvider.Get(nil); err != nil { + if _, err := instanceSelector.InstanceTypesProvider.Get(ctx, nil); err != nil { return multierr.Append(errs, fmt.Errorf("There was a problem refreshing the instance types cache: %w", err)) } } @@ -491,71 +540,6 @@ func getOutputFn(outputFlag *string, currentFn selector.InstanceTypesOutputFn) s return outputFn } -func getRegionAndProfileAWSSession(regionName *string, profileName *string) (*session.Session, error) { - sessOpts := session.Options{SharedConfigState: session.SharedConfigEnable} - if regionName != nil { - sessOpts.Config.Region = regionName - } - - if profileName != nil { - sessOpts.Profile = *profileName - if sessOpts.Config.Region == nil { - if profileRegion, err := getProfileRegion(*profileName); err != nil { - log.Println(err) - } else { - sessOpts.Config.Region = &profileRegion - } - } - } - - sess := session.Must(session.NewSessionWithOptions(sessOpts)) - if sess.Config.Region != nil && *sess.Config.Region != "" { - return sess, nil - } - if defaultProfileRegion, err := getProfileRegion(defaultProfile); err == nil { - sess.Config.Region = &defaultProfileRegion - return sess, nil - } - - if defaultRegion, ok := os.LookupEnv(defaultRegionEnvVar); ok && defaultRegion != "" { - sess.Config.Region = &defaultRegion - return sess, nil - } - - errorMsg := "Unable to find a region in the usual places: \n" - errorMsg = errorMsg + "\t - --region flag\n" - errorMsg = errorMsg + fmt.Sprintf("\t - %s environment variable\n", awsRegionEnvVar) - if profileName != nil { - errorMsg = errorMsg + fmt.Sprintf("\t - profile region in %s\n", awsConfigFile) - } - errorMsg = errorMsg + fmt.Sprintf("\t - default profile region in %s\n", awsConfigFile) - errorMsg = errorMsg + fmt.Sprintf("\t - %s environment variable\n", defaultRegionEnvVar) - return sess, fmt.Errorf(errorMsg) -} - -func getProfileRegion(profileName string) (string, error) { - if profileName != defaultProfile { - profileName = fmt.Sprintf("profile %s", profileName) - } - awsConfigPath, err := homedir.Expand(awsConfigFile) - if err != nil { - return "", fmt.Errorf("Warning: unable to find home directory to parse aws config file") - } - awsConfigIni, err := ini.Load(awsConfigPath) - if err != nil { - return "", fmt.Errorf("Warning: unable to load aws config file for profile at path: %s", awsConfigPath) - } - section, err := awsConfigIni.GetSection(profileName) - if err != nil { - return "", fmt.Errorf("Warning: there is no configuration for the specified aws profile %s at %s", profileName, awsConfigPath) - } - regionConfig, err := section.GetKey("region") - if err != nil || regionConfig.String() == "" { - return "", fmt.Errorf("Warning: there is no region configured for the specified aws profile %s at %s", profileName, awsConfigPath) - } - return regionConfig.String(), nil -} - func registerShutdown(shutdown func()) { sigs := make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM) diff --git a/go.mod b/go.mod index 884aece7..1625f7e0 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,10 @@ go 1.18 require ( github.com/aws/aws-sdk-go v1.44.271 + github.com/aws/aws-sdk-go-v2 v1.16.15 + github.com/aws/aws-sdk-go-v2/config v1.17.6 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.57.0 + github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.15.0 github.com/charmbracelet/bubbletea v0.24.1 @@ -17,11 +21,20 @@ require ( github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 go.uber.org/multierr v1.9.0 - gopkg.in/ini.v1 v1.67.0 ) require ( github.com/atotto/clipboard v0.1.4 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.12.19 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.11.22 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.16.18 // indirect + github.com/aws/smithy-go v1.13.3 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index f7bb519e..8eb0bf0d 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,34 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.271 h1:aa+Nu2JcnFmW1TLIz/67SS7KPq1I1Adl4RmExSMjGVo= github.com/aws/aws-sdk-go v1.44.271/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go-v2 v1.16.15 h1:2sInOWGE4HV54R90Pj8QgqBBw3Qf1I0husqbqjPZzys= +github.com/aws/aws-sdk-go-v2 v1.16.15/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= +github.com/aws/aws-sdk-go-v2/config v1.17.6 h1:0xHMch3eQ2C8CByMEi0iJOLF+pTLoAQeHVfhFxN7eyk= +github.com/aws/aws-sdk-go-v2/config v1.17.6/go.mod h1:CrxsoI/AcKUoWyL9Zo0YaDxRlBfSnDZKBYKDdkNYDQ0= +github.com/aws/aws-sdk-go-v2/credentials v1.12.19 h1:fYtSz4Fd0lUavtj4FAtvol9G2k0lh1TK4LfeP1hdnLw= +github.com/aws/aws-sdk-go-v2/credentials v1.12.19/go.mod h1:fRQMbLwSHPr0XRzuez6x7BX5+0nNQs5BzG+oR4bQKyY= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16 h1:LX38v4cqSqrBETHUBnc8B+N6p5YA41GaPQ3jwICjetI= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16/go.mod h1:lnJ8tKos2s7JeBdLVFknwVSlQZAKzkgrFNQmUaTWwRQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22 h1:pE27/u2A7JlwICjOvONQDob8PToShRTkuiUE74ymVWg= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22/go.mod h1:/vNv5Al0bpiF8YdX2Ov6Xy05VTiXsql94yUqJMYaj0w= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16 h1:L5LKGHHXOl4t7+5QZMTl38GIzSAq07XUTRtEquiHGMA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16/go.mod h1:62dsXI0BqTIGomDl8Hpm33dv0OntGaVblri3ZRParVQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23 h1:Sy266MXyLZZbObFhStGF9dyJm5nFyA8LINTgNm4Q6Ds= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23/go.mod h1:XtEkQMmxls+Tb5dZLmpa1QAk0OzSIFDAXanC9Jkf81E= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.57.0 h1:Ci3E3f2lGRXc+9djl/72LIaOkUnrJsW65P+j4rIlS0M= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.57.0/go.mod h1:Bl5Z601fnOyT/kXwCNwGS2tceQRuaJqwGhaMjd3c2v8= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16 h1:9jysIwpUt7KGdsKOl+zA+0pG+7MpSsi0KQUcbE48n38= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16/go.mod h1:faBcf/4ZB4FRc17geaXWOxgzktotyJgBcUBZoHqvdfM= +github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 h1:RQOMvPwte2H4ZqsiZmrla1crhBWDFnW8bZynkec5cGU= +github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0/go.mod h1:LJyh9figH3ZpSiVjR5umzbl6V3EpQdZR4Se1ayoUtfI= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.22 h1:LrEyMbp0gMiXVaXpJ67jJkkqKCxivZvOd6wgXem0bWA= +github.com/aws/aws-sdk-go-v2/service/sso v1.11.22/go.mod h1:B2nDzX7lppT8j4EV2/WhT20SnRDp/LdNyqxyGYY46Ow= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4 h1:d7Wh4xMQVVYfrJ1KHFGQ6jY/O51LjnTCWJgh85RT+TQ= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4/go.mod h1:mOofcMJCDSJwmtZykUE/i6tWGNwMnkextriwzY1zcbc= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.18 h1:TqEvnK8OceCKNQaDK9d5Ir2bOtC0S0dRQCwSbkV1rz0= +github.com/aws/aws-sdk-go-v2/service/sts v1.16.18/go.mod h1:AE4zMc8qCw1JnDvy0ZrDVb/OXRuuweG3BcT2Nv7Qh3E= +github.com/aws/smithy-go v1.13.3 h1:l7LYxGuzK6/K+NzJ2mC+VvLUbae0sL3bXU//04MkmnA= +github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= @@ -25,6 +53,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/evertras/bubble-table v0.15.2 h1:hVj27V9tk5TD5p6mVv0RK/KJu2sHq0U+mBMux/HptkU= github.com/evertras/bubble-table v0.15.2/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -124,8 +154,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/awsapi/selectorec2.go b/pkg/awsapi/selectorec2.go new file mode 100644 index 00000000..8523d291 --- /dev/null +++ b/pkg/awsapi/selectorec2.go @@ -0,0 +1,12 @@ +package awsapi + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/service/ec2" +) + +type SelectorInterface interface { + ec2.DescribeInstanceTypeOfferingsAPIClient + ec2.DescribeInstanceTypesAPIClient + DescribeAvailabilityZones(ctx context.Context, params *ec2.DescribeAvailabilityZonesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error) +} diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index a86d3257..77a4d0b8 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -178,6 +178,10 @@ func (cl *CommandLineInterface) SetUntouchedFlagValuesToNil() error { return } switch v := cl.Flags[f.Name].(type) { + case *int32: + if reflect.ValueOf(*v).IsZero() { + cl.Flags[f.Name] = nil + } case *int: if reflect.ValueOf(*v).IsZero() { cl.Flags[f.Name] = nil @@ -234,6 +238,8 @@ func (cl *CommandLineInterface) ProcessRangeFilterFlags() error { switch cl.Flags[rangeHelperMax].(type) { case *int: cl.Flags[rangeHelperMin] = cl.IntMe(0) + case *int32: + cl.Flags[rangeHelperMin] = cl.Int32Me(0) case *bytequantity.ByteQuantity: cl.Flags[rangeHelperMin] = cl.ByteQuantityMe(bytequantity.ByteQuantity{Quantity: 0}) case *float64: @@ -245,6 +251,8 @@ func (cl *CommandLineInterface) ProcessRangeFilterFlags() error { switch cl.Flags[rangeHelperMin].(type) { case *int: cl.Flags[rangeHelperMax] = cl.IntMe(maxInt) + case *int32: + cl.Flags[rangeHelperMax] = cl.Int32Me(max32Int) case *bytequantity.ByteQuantity: cl.Flags[rangeHelperMax] = cl.ByteQuantityMe(bytequantity.ByteQuantity{Quantity: maxUint64}) case *float64: @@ -260,6 +268,11 @@ func (cl *CommandLineInterface) ProcessRangeFilterFlags() error { LowerBound: *cl.IntMe(cl.Flags[rangeHelperMin]), UpperBound: *cl.IntMe(cl.Flags[rangeHelperMax]), } + case *int32: + cl.Flags[flagName] = &selector.Int32RangeFilter{ + LowerBound: *cl.Int32Me(cl.Flags[rangeHelperMin]), + UpperBound: *cl.Int32Me(cl.Flags[rangeHelperMax]), + } case *bytequantity.ByteQuantity: cl.Flags[flagName] = &selector.ByteQuantityRangeFilter{ LowerBound: *cl.ByteQuantityMe(cl.Flags[rangeHelperMin]), diff --git a/pkg/cli/flags.go b/pkg/cli/flags.go index cc727ba5..5b50221a 100644 --- a/pkg/cli/flags.go +++ b/pkg/cli/flags.go @@ -14,6 +14,7 @@ import ( const ( maxInt = int(^uint(0) >> 1) + max32Int = int(^uint32(0) >> 1) maxUint64 = math.MaxUint64 ) @@ -55,6 +56,11 @@ func (cl *CommandLineInterface) IntMinMaxRangeFlags(name string, shorthand *stri cl.IntMinMaxRangeFlagOnFlagSet(cl.Command.Flags(), name, shorthand, defaultValue, description) } +// Int32MinMaxRangeFlags creates and registers a min, max, and helper flag each accepting an int +func (cl *CommandLineInterface) Int32MinMaxRangeFlags(name string, shorthand *string, defaultValue *int32, description string) { + cl.Int32MinMaxRangeFlagOnFlagSet(cl.Command.Flags(), name, shorthand, defaultValue, description) +} + // ByteQuantityMinMaxRangeFlags creates and registers a min, max, and helper flag each accepting a byte quantity like 512mb func (cl *CommandLineInterface) ByteQuantityMinMaxRangeFlags(name string, shorthand *string, defaultValue *bytequantity.ByteQuantity, description string) { cl.ByteQuantityMinMaxRangeFlagOnFlagSet(cl.Command.Flags(), name, shorthand, defaultValue, description) @@ -200,6 +206,27 @@ func (cl *CommandLineInterface) IntMinMaxRangeFlagOnFlagSet(flagSet *pflag.FlagS cl.rangeFlags[name] = true } +// Int32MinMaxRangeFlagOnFlagSet creates and registers a min, max, and helper flag each accepting an int +func (cl *CommandLineInterface) Int32MinMaxRangeFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *int32, description string) { + cl.Int32FlagOnFlagSet(flagSet, name, shorthand, defaultValue, fmt.Sprintf("%s (sets --%s-min and -max to the same value)", description, name)) + cl.Int32FlagOnFlagSet(flagSet, name+"-min", nil, nil, fmt.Sprintf("Minimum %s If --%s-max is not specified, the upper bound will be infinity", description, name)) + cl.Int32FlagOnFlagSet(flagSet, name+"-max", nil, nil, fmt.Sprintf("Maximum %s If --%s-min is not specified, the lower bound will be 0", description, name)) + cl.validators[name] = func(val interface{}) error { + if cl.Flags[name+"-min"] == nil || cl.Flags[name+"-max"] == nil { + return nil + } + minArg := name + "-min" + maxArg := name + "-max" + minVal := cl.Flags[minArg].(*int32) + maxVal := cl.Flags[maxArg].(*int32) + if *minVal > *maxVal { + return fmt.Errorf("Invalid input for --%s and --%s. %s must be less than or equal to %s", minArg, maxArg, minArg, maxArg) + } + return nil + } + cl.rangeFlags[name] = true +} + // Float64MinMaxRangeFlagOnFlagSet creates and registers a min, max, and helper flag each accepting a float64 func (cl *CommandLineInterface) Float64MinMaxRangeFlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *float64, description string) { cl.Float64FlagOnFlagSet(flagSet, name, shorthand, defaultValue, fmt.Sprintf("%s (sets --%s-min and -max to the same value)", description, name)) @@ -296,6 +323,19 @@ func (cl *CommandLineInterface) IntFlagOnFlagSet(flagSet *pflag.FlagSet, name st cl.Flags[name] = flagSet.Int(name, *defaultValue, description) } +// Int32FlagOnFlagSet creates and registers a flag accepting an int +func (cl *CommandLineInterface) Int32FlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *int32, description string) { + if defaultValue == nil { + cl.nilDefaults[name] = true + defaultValue = cl.Int32Me(0) + } + if shorthand != nil { + cl.Flags[name] = flagSet.Int32P(name, string(*shorthand), *defaultValue, description) + return + } + cl.Flags[name] = flagSet.Int32(name, *defaultValue, description) +} + // Float64FlagOnFlagSet creates and registers a flag accepting a float64 func (cl *CommandLineInterface) Float64FlagOnFlagSet(flagSet *pflag.FlagSet, name string, shorthand *string, defaultValue *float64, description string) { if defaultValue == nil { diff --git a/pkg/cli/types.go b/pkg/cli/types.go index d2d059aa..97a4f22f 100644 --- a/pkg/cli/types.go +++ b/pkg/cli/types.go @@ -105,6 +105,29 @@ func (*CommandLineInterface) IntMe(i interface{}) *int { } } +// Int32Me takes an interface and returns a pointer to an int value +// If the underlying interface kind is not int or *int then nil is returned +func (*CommandLineInterface) Int32Me(i interface{}) *int32 { + if i == nil { + return nil + } + switch v := i.(type) { + case *int: + val := int32(*v) + return &val + case int: + val := int32(v) + return &val + case *int32: + return v + case int32: + return &v + default: + log.Printf("%s cannot be converted to an int32", i) + return nil + } +} + // IntRangeMe takes an interface and returns a pointer to an IntRangeFilter value // If the underlying interface kind is not IntRangeFilter or *IntRangeFilter then nil is returned func (*CommandLineInterface) IntRangeMe(i interface{}) *selector.IntRangeFilter { @@ -122,6 +145,23 @@ func (*CommandLineInterface) IntRangeMe(i interface{}) *selector.IntRangeFilter } } +// Int32RangeMe takes an interface and returns a pointer to an Int32RangeFilter value +// If the underlying interface kind is not Int32RangeFilter or *Int32RangeFilter then nil is returned +func (*CommandLineInterface) Int32RangeMe(i interface{}) *selector.Int32RangeFilter { + if i == nil { + return nil + } + switch v := i.(type) { + case *selector.Int32RangeFilter: + return v + case selector.Int32RangeFilter: + return &v + default: + log.Printf("%s cannot be converted to an Int32Range", i) + return nil + } +} + // ByteQuantityRangeMe takes an interface and returns a pointer to a ByteQuantityRangeFilter value // If the underlying interface kind is not ByteQuantityRangeFilter or *ByteQuantityRangeFilter then nil is returned func (*CommandLineInterface) ByteQuantityRangeMe(i interface{}) *selector.ByteQuantityRangeFilter { diff --git a/pkg/ec2pricing/ec2pricing.go b/pkg/ec2pricing/ec2pricing.go index d13c941d..18e7f5fc 100644 --- a/pkg/ec2pricing/ec2pricing.go +++ b/pkg/ec2pricing/ec2pricing.go @@ -14,12 +14,13 @@ package ec2pricing import ( + "context" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/pricing" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/aws-sdk-go-v2/service/pricing" "go.uber.org/multierr" ) @@ -40,32 +41,39 @@ type EC2Pricing struct { // EC2PricingIface is the EC2Pricing interface mainly used to mock out ec2pricing during testing type EC2PricingIface interface { - GetOnDemandInstanceTypeCost(instanceType string) (float64, error) - GetSpotInstanceTypeNDayAvgCost(instanceType string, availabilityZones []string, days int) (float64, error) - RefreshOnDemandCache() error - RefreshSpotCache(days int) error + GetOnDemandInstanceTypeCost(ctx context.Context, instanceType ec2types.InstanceType) (float64, error) + GetSpotInstanceTypeNDayAvgCost(ctx context.Context, instanceType ec2types.InstanceType, availabilityZones []string, days int) (float64, error) + RefreshOnDemandCache(ctx context.Context) error + RefreshSpotCache(ctx context.Context, days int) error OnDemandCacheCount() int SpotCacheCount() int Save() error } +// use us-east-1 since pricing only has endpoints in us-east-1 and ap-south-1 +// TODO: In the future we may want to allow the client to select which endpoint is used through some mechanism +// but that would likely happen through overriding this entire function as its signature is fixed +func modifyPricingRegion(opt *pricing.Options) { + opt.Region = "us-east-1" +} + // New creates an instance of instance-selector EC2Pricing -func New(sess *session.Session) *EC2Pricing { - // use us-east-1 since pricing only has endpoints in us-east-1 and ap-south-1 - pricingClient := pricing.New(sess.Copy(aws.NewConfig().WithRegion("us-east-1"))) +func New(ctx context.Context, cfg aws.Config) (*EC2Pricing, error) { + pricingClient := pricing.NewFromConfig(cfg, modifyPricingRegion) + ec2Client := ec2.NewFromConfig(cfg) return &EC2Pricing{ - ODPricing: LoadODCacheOrNew(pricingClient, *sess.Config.Region, 0, ""), - SpotPricing: LoadSpotCacheOrNew(ec2.New(sess), *sess.Config.Region, 0, "", DefaultSpotDaysBack), - } + ODPricing: LoadODCacheOrNew(ctx, pricingClient, cfg.Region, 0, ""), + SpotPricing: LoadSpotCacheOrNew(ctx, ec2Client, cfg.Region, 0, "", DefaultSpotDaysBack), + }, nil } -func NewWithCache(sess *session.Session, ttl time.Duration, cacheDir string) *EC2Pricing { - // use us-east-1 since pricing only has endpoints in us-east-1 and ap-south-1 - pricingClient := pricing.New(sess.Copy(aws.NewConfig().WithRegion("us-east-1"))) +func NewWithCache(ctx context.Context, cfg aws.Config, ttl time.Duration, cacheDir string) (*EC2Pricing, error) { + pricingClient := pricing.NewFromConfig(cfg, modifyPricingRegion) + ec2Client := ec2.NewFromConfig(cfg) return &EC2Pricing{ - ODPricing: LoadODCacheOrNew(pricingClient, *sess.Config.Region, ttl, cacheDir), - SpotPricing: LoadSpotCacheOrNew(ec2.New(sess), *sess.Config.Region, ttl, cacheDir, DefaultSpotDaysBack), - } + ODPricing: LoadODCacheOrNew(ctx, pricingClient, cfg.Region, ttl, cacheDir), + SpotPricing: LoadSpotCacheOrNew(ctx, ec2Client, cfg.Region, ttl, cacheDir, DefaultSpotDaysBack), + }, nil } // OnDemandCacheCount returns the number of items in the OD cache @@ -80,14 +88,14 @@ func (p *EC2Pricing) SpotCacheCount() int { // GetSpotInstanceTypeNDayAvgCost retrieves the spot price history for a given AZ from the past N days and averages the price // Passing an empty list for availabilityZones will retrieve avg cost for all AZs in the current AWSSession's region -func (p *EC2Pricing) GetSpotInstanceTypeNDayAvgCost(instanceType string, availabilityZones []string, days int) (float64, error) { +func (p *EC2Pricing) GetSpotInstanceTypeNDayAvgCost(ctx context.Context, instanceType ec2types.InstanceType, availabilityZones []string, days int) (float64, error) { if len(availabilityZones) == 0 { - return p.SpotPricing.Get(instanceType, "", days) + return p.SpotPricing.Get(ctx, instanceType, "", days) } costs := []float64{} var errs error for _, zone := range availabilityZones { - cost, err := p.SpotPricing.Get(instanceType, zone, days) + cost, err := p.SpotPricing.Get(ctx, instanceType, zone, days) if err != nil { errs = multierr.Append(errs, err) } @@ -101,18 +109,18 @@ func (p *EC2Pricing) GetSpotInstanceTypeNDayAvgCost(instanceType string, availab } // GetOnDemandInstanceTypeCost retrieves the on-demand hourly cost for the specified instance type -func (p *EC2Pricing) GetOnDemandInstanceTypeCost(instanceType string) (float64, error) { - return p.ODPricing.Get(instanceType) +func (p *EC2Pricing) GetOnDemandInstanceTypeCost(ctx context.Context, instanceType ec2types.InstanceType) (float64, error) { + return p.ODPricing.Get(ctx, instanceType) } // RefreshOnDemandCache makes a bulk request to the pricing api to retrieve all instance type pricing and stores them in a local cache -func (p *EC2Pricing) RefreshOnDemandCache() error { - return p.ODPricing.Refresh() +func (p *EC2Pricing) RefreshOnDemandCache(ctx context.Context) error { + return p.ODPricing.Refresh(ctx) } // RefreshSpotCache makes a bulk request to the ec2 api to retrieve all spot instance type pricing and stores them in a local cache -func (p *EC2Pricing) RefreshSpotCache(days int) error { - return p.SpotPricing.Refresh(days) +func (p *EC2Pricing) RefreshSpotCache(ctx context.Context, days int) error { + return p.SpotPricing.Refresh(ctx, days) } func (p *EC2Pricing) Save() error { diff --git a/pkg/ec2pricing/ec2pricing_test.go b/pkg/ec2pricing/ec2pricing_test.go index f4dfbac2..b1d67c96 100644 --- a/pkg/ec2pricing/ec2pricing_test.go +++ b/pkg/ec2pricing/ec2pricing_test.go @@ -14,128 +14,132 @@ package ec2pricing_test import ( + "context" "encoding/json" "fmt" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "io/ioutil" "testing" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing" h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - "github.com/aws/aws-sdk-go/service/pricing" - "github.com/aws/aws-sdk-go/service/pricing/pricingiface" + "github.com/aws/aws-sdk-go-v2/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/pricing" ) const ( - getProductsPages = "GetProductsPages" - describeSpotPriceHistoryPages = "DescribeSpotPriceHistoryPages" - mockFilesPath = "../../test/static" + getProducts = "GetProducts" + describeSpotPriceHistory = "DescribeSpotPriceHistory" + mockFilesPath = "../../test/static" ) -var sess = session.Session{ - Config: &aws.Config{ - Region: aws.String("us-east-1"), - }, -} - // Mocking helpers -type gpFn = func(page *pricing.GetProductsOutput, lastPage bool) bool -type dspFn = func(page *ec2.DescribeSpotPriceHistoryOutput, lastPage bool) bool - type mockedPricing struct { - pricingiface.PricingAPI - ec2iface.EC2API - GetProductsPagesResp pricing.GetProductsOutput - GetProductsPagesErr error - DescribeSpotPriceHistoryPagesResp ec2.DescribeSpotPriceHistoryOutput - DescribeSpotPriceHistoryPagesErr error + pricing.GetProductsAPIClient + GetProductsResp pricing.GetProductsOutput + GetProductsErr error } -func (m mockedPricing) GetProductsPages(input *pricing.GetProductsInput, fn gpFn) error { - fn(&m.GetProductsPagesResp, true) - return m.GetProductsPagesErr +func (m mockedPricing) GetProducts(ctx context.Context, input *pricing.GetProductsInput, optFns ...func(*pricing.Options)) (*pricing.GetProductsOutput, error) { + return &m.GetProductsResp, m.GetProductsErr } -func (m mockedPricing) DescribeSpotPriceHistoryPages(input *ec2.DescribeSpotPriceHistoryInput, fn dspFn) error { - fn(&m.DescribeSpotPriceHistoryPagesResp, true) - return m.DescribeSpotPriceHistoryPagesErr +type mockedSpotEC2 struct { + ec2.DescribeSpotPriceHistoryAPIClient + DescribeSpotPriceHistoryPagesResp ec2.DescribeSpotPriceHistoryOutput + DescribeSpotPriceHistoryPagesErr error +} + +func (m mockedSpotEC2) DescribeSpotPriceHistory(ctx context.Context, input *ec2.DescribeSpotPriceHistoryInput, optFns ...func(*ec2.Options)) (*ec2.DescribeSpotPriceHistoryOutput, error) { + return &m.DescribeSpotPriceHistoryPagesResp, m.DescribeSpotPriceHistoryPagesErr } -func setupMock(t *testing.T, api string, file string) mockedPricing { +func setupOdMock(t *testing.T, api string, file string) mockedPricing { mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, api, file) mockFile, err := ioutil.ReadFile(mockFilename) h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) switch api { - case getProductsPages: - var productsMap map[string]interface{} - err = json.Unmarshal(mockFile, &productsMap) - h.Assert(t, err == nil, "Error parsing mock json file contents "+mockFilename) + case getProducts: + priceList := []string{string(mockFile)} productsOutput := pricing.GetProductsOutput{ - PriceList: []aws.JSONValue{productsMap}, + PriceList: priceList, } return mockedPricing{ - GetProductsPagesResp: productsOutput, + GetProductsResp: productsOutput, } - case describeSpotPriceHistoryPages: + + default: + h.Assert(t, false, "Unable to mock the provided API type "+api) + } + return mockedPricing{} +} + +func setupEc2Mock(t *testing.T, api string, file string) mockedSpotEC2 { + mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, api, file) + mockFile, err := ioutil.ReadFile(mockFilename) + h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) + switch api { + case describeSpotPriceHistory: dspho := ec2.DescribeSpotPriceHistoryOutput{} err = json.Unmarshal(mockFile, &dspho) h.Assert(t, err == nil, "Error parsing mock json file contents"+mockFilename) - return mockedPricing{ + return mockedSpotEC2{ DescribeSpotPriceHistoryPagesResp: dspho, } default: h.Assert(t, false, "Unable to mock the provided API type "+api) } - return mockedPricing{} + return mockedSpotEC2{} } func TestGetOndemandInstanceTypeCost_m5large(t *testing.T) { - pricingMock := setupMock(t, getProductsPages, "m5_large.json") + pricingMock := setupOdMock(t, getProducts, "m5_large.json") + ctx := context.Background() ec2pricingClient := ec2pricing.EC2Pricing{ - ODPricing: ec2pricing.LoadODCacheOrNew(pricingMock, "us-east-1", 0, ""), + ODPricing: ec2pricing.LoadODCacheOrNew(ctx, pricingMock, "us-east-1", 0, ""), } - price, err := ec2pricingClient.GetOnDemandInstanceTypeCost("m5.large") + price, err := ec2pricingClient.GetOnDemandInstanceTypeCost(ctx, ec2types.InstanceTypeM5Large) h.Ok(t, err) h.Equals(t, float64(0.096), price) } func TestRefreshOnDemandCache(t *testing.T) { - pricingMock := setupMock(t, getProductsPages, "m5_large.json") + pricingMock := setupOdMock(t, getProducts, "m5_large.json") + ctx := context.Background() ec2pricingClient := ec2pricing.EC2Pricing{ - ODPricing: ec2pricing.LoadODCacheOrNew(pricingMock, "us-east-1", 0, ""), + ODPricing: ec2pricing.LoadODCacheOrNew(ctx, pricingMock, "us-east-1", 0, ""), } - err := ec2pricingClient.RefreshOnDemandCache() + err := ec2pricingClient.RefreshOnDemandCache(ctx) h.Ok(t, err) - price, err := ec2pricingClient.GetOnDemandInstanceTypeCost("m5.large") + price, err := ec2pricingClient.GetOnDemandInstanceTypeCost(ctx, ec2types.InstanceTypeM5Large) h.Ok(t, err) h.Equals(t, float64(0.096), price) } func TestGetSpotInstanceTypeNDayAvgCost(t *testing.T) { - ec2Mock := setupMock(t, describeSpotPriceHistoryPages, "m5_large.json") + ec2Mock := setupEc2Mock(t, describeSpotPriceHistory, "m5_large.json") + ctx := context.Background() ec2pricingClient := ec2pricing.EC2Pricing{ - SpotPricing: ec2pricing.LoadSpotCacheOrNew(ec2Mock, "us-east-1", 0, "", 30), + SpotPricing: ec2pricing.LoadSpotCacheOrNew(ctx, ec2Mock, "us-east-1", 0, "", 30), } - price, err := ec2pricingClient.GetSpotInstanceTypeNDayAvgCost("m5.large", []string{"us-east-1a"}, 30) + price, err := ec2pricingClient.GetSpotInstanceTypeNDayAvgCost(ctx, ec2types.InstanceTypeM5Large, []string{"us-east-1a"}, 30) h.Ok(t, err) h.Equals(t, float64(0.041486231229302666), price) } func TestRefreshSpotCache(t *testing.T) { - ec2Mock := setupMock(t, describeSpotPriceHistoryPages, "m5_large.json") + ec2Mock := setupEc2Mock(t, describeSpotPriceHistory, "m5_large.json") + ctx := context.Background() ec2pricingClient := ec2pricing.EC2Pricing{ - SpotPricing: ec2pricing.LoadSpotCacheOrNew(ec2Mock, "us-east-1", 0, "", 30), + SpotPricing: ec2pricing.LoadSpotCacheOrNew(ctx, ec2Mock, "us-east-1", 0, "", 30), } - err := ec2pricingClient.RefreshSpotCache(30) + err := ec2pricingClient.RefreshSpotCache(ctx, 30) h.Ok(t, err) - price, err := ec2pricingClient.GetSpotInstanceTypeNDayAvgCost("m5.large", []string{"us-east-1a"}, 30) + price, err := ec2pricingClient.GetSpotInstanceTypeNDayAvgCost(ctx, ec2types.InstanceTypeM5Large, []string{"us-east-1a"}, 30) h.Ok(t, err) h.Equals(t, float64(0.041486231229302666), price) } diff --git a/pkg/ec2pricing/odpricing.go b/pkg/ec2pricing/odpricing.go index 1cc99a6a..19cde3c7 100644 --- a/pkg/ec2pricing/odpricing.go +++ b/pkg/ec2pricing/odpricing.go @@ -14,6 +14,7 @@ package ec2pricing import ( + "context" "encoding/json" "errors" "fmt" @@ -26,10 +27,10 @@ import ( "sync" "time" - "github.com/aws/aws-sdk-go/aws" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/aws-sdk-go-v2/service/pricing" + pricingtypes "github.com/aws/aws-sdk-go-v2/service/pricing/types" "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/service/pricing" - "github.com/aws/aws-sdk-go/service/pricing/pricingiface" "github.com/mitchellh/go-homedir" "github.com/patrickmn/go-cache" "go.uber.org/multierr" @@ -44,11 +45,48 @@ type OnDemandPricing struct { FullRefreshTTL time.Duration DirectoryPath string cache *cache.Cache - pricingClient pricingiface.PricingAPI + pricingClient pricing.GetProductsAPIClient sync.RWMutex } -func LoadODCacheOrNew(pricingClient pricingiface.PricingAPI, region string, fullRefreshTTL time.Duration, directoryPath string) *OnDemandPricing { +type PricingList struct { + Product PricingListProduct `json:"product"` + ServiceCode string `json:"serviceCode"` + Terms ProductTerms `json:"terms"` + Version string `json:"version"` + PublicationDate string `json:"publicationDate"` +} + +type PricingListProduct struct { + ProductFamily string `json:"productFamily"` + ProductAttributes map[string]string `json:"attributes"` + SKU string `json:"sku"` +} + +type ProductTerms struct { + OnDemand map[string]ProductPricingInfo `json:"OnDemand"` + Reserved map[string]ProductPricingInfo `json:"Reserved"` +} + +type ProductPricingInfo struct { + PriceDimensions map[string]PriceDimensionInfo `json:"priceDimensions"` + SKU string `json:"sku"` + EffectiveDate string `json:"effectiveDate"` + OfferTermCode string `json:"offerTermCode"` + TermAttributes map[string]string `json:"termAttributes"` +} + +type PriceDimensionInfo struct { + Unit string `json:"unit"` + EndRange string `json:"endRange"` + Description string `json:"description"` + AppliesTo []string `json:"appliesTo"` + RateCode string `json:"rateCode"` + BeginRange string `json:"beginRange"` + PricePerUnit map[string]string `json:"pricePerUnit"` +} + +func LoadODCacheOrNew(ctx context.Context, pricingClient pricing.GetProductsAPIClient, region string, fullRefreshTTL time.Duration, directoryPath string) *OnDemandPricing { expandedDirPath, err := homedir.Expand(directoryPath) if err != nil { log.Printf("Unable to load on-demand pricing cache directory %s: %v", expandedDirPath, err) @@ -72,7 +110,7 @@ func LoadODCacheOrNew(pricingClient pricingiface.PricingAPI, region string, full return odPricing } // Start the cache refresh job - go odCacheRefreshJob(odPricing) + go odCacheRefreshJob(ctx, odPricing) odCache, err := loadODCacheFrom(fullRefreshTTL, region, expandedDirPath) if err != nil { if !errors.Is(err, os.ErrNotExist) { @@ -102,22 +140,22 @@ func getODCacheFilePath(region string, directoryPath string) string { return filepath.Join(directoryPath, fmt.Sprintf("%s-%s", region, ODCacheFileName)) } -func odCacheRefreshJob(odPricing *OnDemandPricing) { +func odCacheRefreshJob(ctx context.Context, odPricing *OnDemandPricing) { if odPricing.FullRefreshTTL <= 0 { return } refreshTicker := time.NewTicker(odPricing.FullRefreshTTL) for range refreshTicker.C { - if err := odPricing.Refresh(); err != nil { + if err := odPricing.Refresh(ctx); err != nil { log.Println(err) } } } -func (c *OnDemandPricing) Refresh() error { +func (c *OnDemandPricing) Refresh(ctx context.Context) error { c.Lock() defer c.Unlock() - odInstanceTypeCosts, err := c.fetchOnDemandPricing("") + odInstanceTypeCosts, err := c.fetchOnDemandPricing(ctx, "") if err != nil { return fmt.Errorf("there was a problem refreshing the on-demand instance type pricing cache: %v", err) } @@ -130,18 +168,18 @@ func (c *OnDemandPricing) Refresh() error { return nil } -func (c *OnDemandPricing) Get(instanceType string) (float64, error) { - if cost, ok := c.cache.Get(instanceType); ok { +func (c *OnDemandPricing) Get(ctx context.Context, instanceType ec2types.InstanceType) (float64, error) { + if cost, ok := c.cache.Get(string(instanceType)); ok { return cost.(float64), nil } c.RLock() defer c.RUnlock() - costs, err := c.fetchOnDemandPricing(instanceType) + costs, err := c.fetchOnDemandPricing(ctx, instanceType) if err != nil { return 0, fmt.Errorf("there was a problem fetching on-demand instance type pricing for %s: %v", instanceType, err) } - c.cache.SetDefault(instanceType, costs[instanceType]) - return costs[instanceType], nil + c.cache.SetDefault(string(instanceType), costs[string(instanceType)]) + return costs[string(instanceType)], nil } // Count of items in the cache @@ -157,7 +195,9 @@ func (c *OnDemandPricing) Save() error { if err != nil { return err } - os.Mkdir(c.DirectoryPath, 0755) + if err := os.Mkdir(c.DirectoryPath, 0755); err != nil && !errors.Is(err, os.ErrExist) { + return err + } return ioutil.WriteFile(getODCacheFilePath(c.Region, c.DirectoryPath), cacheBytes, 0644) } @@ -169,15 +209,24 @@ func (c *OnDemandPricing) Clear() error { } // fetchOnDemandPricing makes a bulk request to the pricing api to retrieve all instance type pricing if the instanceType is the empty string -// or, if instanceType is specified, it can request a specific instance type pricing -func (c *OnDemandPricing) fetchOnDemandPricing(instanceType string) (map[string]float64, error) { +// +// or, if instanceType is specified, it can request a specific instance type pricing +func (c *OnDemandPricing) fetchOnDemandPricing(ctx context.Context, instanceType ec2types.InstanceType) (map[string]float64, error) { odPricing := map[string]float64{} productInput := pricing.GetProductsInput{ - ServiceCode: aws.String(serviceCode), + ServiceCode: c.StringMe(serviceCode), Filters: c.getProductsInputFilters(instanceType), } var processingErr error - errAPI := c.pricingClient.GetProductsPages(&productInput, func(pricingOutput *pricing.GetProductsOutput, nextPage bool) bool { + + p := pricing.NewGetProductsPaginator(c.pricingClient, &productInput) + + for p.HasMorePages() { + pricingOutput, err := p.NextPage(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get a page, %w", err) + } + for _, priceDoc := range pricingOutput.PriceList { instanceTypeName, price, errParse := c.parseOndemandUnitPrice(priceDoc) if errParse != nil { @@ -186,26 +235,39 @@ func (c *OnDemandPricing) fetchOnDemandPricing(instanceType string) (map[string] } odPricing[instanceTypeName] = price } - return true - }) - if errAPI != nil { - return odPricing, errAPI } return odPricing, processingErr } -func (c *OnDemandPricing) getProductsInputFilters(instanceType string) []*pricing.Filter { +// StringMe takes an interface and returns a pointer to a string value +// If the underlying interface kind is not string or *string then nil is returned +func (*OnDemandPricing) StringMe(i interface{}) *string { + if i == nil { + return nil + } + switch v := i.(type) { + case *string: + return v + case string: + return &v + default: + log.Printf("%s cannot be converted to a string", i) + return nil + } +} + +func (c *OnDemandPricing) getProductsInputFilters(instanceType ec2types.InstanceType) []pricingtypes.Filter { regionDescription := c.getRegionForPricingAPI() - filters := []*pricing.Filter{ - {Type: aws.String(pricing.FilterTypeTermMatch), Field: aws.String("ServiceCode"), Value: aws.String(serviceCode)}, - {Type: aws.String(pricing.FilterTypeTermMatch), Field: aws.String("operatingSystem"), Value: aws.String("linux")}, - {Type: aws.String(pricing.FilterTypeTermMatch), Field: aws.String("location"), Value: aws.String(regionDescription)}, - {Type: aws.String(pricing.FilterTypeTermMatch), Field: aws.String("capacitystatus"), Value: aws.String("used")}, - {Type: aws.String(pricing.FilterTypeTermMatch), Field: aws.String("preInstalledSw"), Value: aws.String("NA")}, - {Type: aws.String(pricing.FilterTypeTermMatch), Field: aws.String("tenancy"), Value: aws.String("shared")}, + filters := []pricingtypes.Filter{ + {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("ServiceCode"), Value: c.StringMe(serviceCode)}, + {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("operatingSystem"), Value: c.StringMe("linux")}, + {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("location"), Value: c.StringMe(regionDescription)}, + {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("capacitystatus"), Value: c.StringMe("used")}, + {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("preInstalledSw"), Value: c.StringMe("NA")}, + {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("tenancy"), Value: c.StringMe("shared")}, } if instanceType != "" { - filters = append(filters, &pricing.Filter{Type: aws.String(pricing.FilterTypeTermMatch), Field: aws.String("instanceType"), Value: aws.String(instanceType)}) + filters = append(filters, pricingtypes.Filter{Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("instanceType"), Value: c.StringMe(string(instanceType))}) } return filters } @@ -235,43 +297,25 @@ func (c *OnDemandPricing) getRegionForPricingAPI() string { } // parseOndemandUnitPrice takes a priceList from the pricing API and parses its weirdness -func (c *OnDemandPricing) parseOndemandUnitPrice(priceList aws.JSONValue) (string, float64, error) { - // TODO: this could probably be cleaned up a bit by adding a couple structs with json tags - // We still need to some weird for-loops to get at elements under json keys that are IDs... - // But it would probably be cleaner than this. - attributes, ok := priceList["product"].(map[string]interface{})["attributes"] - if !ok { - return "", float64(-1.0), fmt.Errorf("unable to find product attributes") - } - instanceTypeName, ok := attributes.(map[string]interface{})["instanceType"].(string) - if !ok { - return "", float64(-1.0), fmt.Errorf("unable to find instance type name from product attributes") - } - terms, ok := priceList["terms"] - if !ok { - return instanceTypeName, float64(-1.0), fmt.Errorf("unable to find pricing terms") - } - ondemandTerms, ok := terms.(map[string]interface{})["OnDemand"] - if !ok { - return instanceTypeName, float64(-1.0), fmt.Errorf("unable to find on-demand pricing terms") +func (c *OnDemandPricing) parseOndemandUnitPrice(priceList string) (string, float64, error) { + var productPriceList PricingList + err := json.Unmarshal([]byte(priceList), &productPriceList) + if err != nil { + return "", float64(-1.0), fmt.Errorf("unable to parse pricing doc: %w", err) } - for _, priceDimensions := range ondemandTerms.(map[string]interface{}) { - dim, ok := priceDimensions.(map[string]interface{})["priceDimensions"] - if !ok { - return instanceTypeName, float64(-1.0), fmt.Errorf("unable to find on-demand pricing dimensions") - } - for _, dimension := range dim.(map[string]interface{}) { - dims := dimension.(map[string]interface{}) - pricePerUnit, ok := dims["pricePerUnit"] - if !ok { - return instanceTypeName, float64(-1.0), fmt.Errorf("unable to find on-demand price per unit in pricing dimensions") - } - pricePerUnitInUSDStr, ok := pricePerUnit.(map[string]interface{})["USD"] + attributes := productPriceList.Product.ProductAttributes + instanceTypeName := attributes["instanceType"] + + for _, priceDimensions := range productPriceList.Terms.OnDemand { + dim := priceDimensions.PriceDimensions + for _, dimension := range dim { + pricePerUnit := dimension.PricePerUnit + pricePerUnitInUSDStr, ok := pricePerUnit["USD"] if !ok { return instanceTypeName, float64(-1.0), fmt.Errorf("unable to find on-demand price per unit in USD") } var err error - pricePerUnitInUSD, err := strconv.ParseFloat(pricePerUnitInUSDStr.(string), 64) + pricePerUnitInUSD, err := strconv.ParseFloat(pricePerUnitInUSDStr, 64) if err != nil { return instanceTypeName, float64(-1.0), fmt.Errorf("could not convert price per unit in USD to a float64") } diff --git a/pkg/ec2pricing/spotpricing.go b/pkg/ec2pricing/spotpricing.go index 6f4bc6d5..cbf56e9f 100644 --- a/pkg/ec2pricing/spotpricing.go +++ b/pkg/ec2pricing/spotpricing.go @@ -14,6 +14,7 @@ package ec2pricing import ( + "context" "encoding/gob" "errors" "fmt" @@ -26,9 +27,8 @@ import ( "sync" "time" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/mitchellh/go-homedir" "github.com/patrickmn/go-cache" "go.uber.org/multierr" @@ -43,7 +43,7 @@ type SpotPricing struct { FullRefreshTTL time.Duration DirectoryPath string cache *cache.Cache - ec2Client ec2iface.EC2API + ec2Client ec2.DescribeSpotPriceHistoryAPIClient sync.RWMutex } @@ -53,7 +53,7 @@ type spotPricingEntry struct { Zone string } -func LoadSpotCacheOrNew(ec2Client ec2iface.EC2API, region string, fullRefreshTTL time.Duration, directoryPath string, days int) *SpotPricing { +func LoadSpotCacheOrNew(ctx context.Context, ec2Client ec2.DescribeSpotPriceHistoryAPIClient, region string, fullRefreshTTL time.Duration, directoryPath string, days int) *SpotPricing { expandedDirPath, err := homedir.Expand(directoryPath) if err != nil { log.Printf("Unable to load spot pricing cache directory %s: %v", expandedDirPath, err) @@ -78,7 +78,7 @@ func LoadSpotCacheOrNew(ec2Client ec2iface.EC2API, region string, fullRefreshTTL } gob.Register([]*spotPricingEntry{}) // Start the cache refresh job - go spotCacheRefreshJob(spotPricing, days) + go spotCacheRefreshJob(ctx, spotPricing, days) spotCache, err := loadSpotCacheFrom(fullRefreshTTL, region, expandedDirPath) if err != nil { if !errors.Is(err, os.ErrNotExist) { @@ -109,22 +109,22 @@ func getSpotCacheFilePath(region string, directoryPath string) string { return filepath.Join(directoryPath, fmt.Sprintf("%s-%s", region, SpotCacheFileName)) } -func spotCacheRefreshJob(spotPricing *SpotPricing, days int) { +func spotCacheRefreshJob(ctx context.Context, spotPricing *SpotPricing, days int) { if spotPricing.FullRefreshTTL <= 0 { return } refreshTicker := time.NewTicker(spotPricing.FullRefreshTTL) for range refreshTicker.C { - if err := spotPricing.Refresh(days); err != nil { + if err := spotPricing.Refresh(ctx, days); err != nil { log.Println(err) } } } -func (c *SpotPricing) Refresh(days int) error { +func (c *SpotPricing) Refresh(ctx context.Context, days int) error { c.Lock() defer c.Unlock() - spotInstanceTypeCosts, err := c.fetchSpotPricingTimeSeries("", days) + spotInstanceTypeCosts, err := c.fetchSpotPricingTimeSeries(ctx, "", days) if err != nil { return fmt.Errorf("there was a problem refreshing the spot instance type pricing cache: %v", err) } @@ -137,8 +137,8 @@ func (c *SpotPricing) Refresh(days int) error { return nil } -func (c *SpotPricing) Get(instanceType string, zone string, days int) (float64, error) { - entries, ok := c.cache.Get(instanceType) +func (c *SpotPricing) Get(ctx context.Context, instanceType ec2types.InstanceType, zone string, days int) (float64, error) { + entries, ok := c.cache.Get(string(instanceType)) if zone != "" && ok { if !c.contains(zone, entries.([]*spotPricingEntry)) { ok = false @@ -147,7 +147,7 @@ func (c *SpotPricing) Get(instanceType string, zone string, days int) (float64, if !ok { c.RLock() defer c.RUnlock() - zonalSpotPricing, err := c.fetchSpotPricingTimeSeries(instanceType, days) + zonalSpotPricing, err := c.fetchSpotPricingTimeSeries(ctx, instanceType, days) if err != nil { return -1, fmt.Errorf("there was a problem fetching spot instance type pricing for %s: %v", instanceType, err) } @@ -156,7 +156,7 @@ func (c *SpotPricing) Get(instanceType string, zone string, days int) (float64, } } - entries, ok = c.cache.Get(instanceType) + entries, ok = c.cache.Get(string(instanceType)) if !ok { return -1, fmt.Errorf("unable to get spot pricing for %s in zone %s for %d days back", instanceType, zone, days) } @@ -240,37 +240,42 @@ func (c *SpotPricing) Clear() error { // fetchSpotPricingTimeSeries makes a bulk request to the ec2 api to retrieve all spot instance type pricing for the past n days // If instanceType is empty, it will fetch for all instance types -func (c *SpotPricing) fetchSpotPricingTimeSeries(instanceType string, days int) (map[string][]*spotPricingEntry, error) { +func (c *SpotPricing) fetchSpotPricingTimeSeries(ctx context.Context, instanceType ec2types.InstanceType, days int) (map[string][]*spotPricingEntry, error) { spotTimeSeries := map[string][]*spotPricingEntry{} endTime := time.Now().UTC() startTime := endTime.Add(time.Hour * time.Duration(24*-1*days)) spotPriceHistInput := ec2.DescribeSpotPriceHistoryInput{ - ProductDescriptions: []*string{aws.String(productDescription)}, + ProductDescriptions: []string{productDescription}, StartTime: &startTime, EndTime: &endTime, } if instanceType != "" { - spotPriceHistInput.InstanceTypes = append(spotPriceHistInput.InstanceTypes, &instanceType) + spotPriceHistInput.InstanceTypes = append(spotPriceHistInput.InstanceTypes, instanceType) } var processingErr error - errAPI := c.ec2Client.DescribeSpotPriceHistoryPages(&spotPriceHistInput, func(dspho *ec2.DescribeSpotPriceHistoryOutput, b bool) bool { - for _, history := range dspho.SpotPriceHistory { + + p := ec2.NewDescribeSpotPriceHistoryPaginator(c.ec2Client, &spotPriceHistInput) + + // Iterate through the Amazon S3 object pages. + for p.HasMorePages() { + spotHistoryOutput, err := p.NextPage(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get a page, %w", err) + } + + for _, history := range spotHistoryOutput.SpotPriceHistory { spotPrice, errFloat := strconv.ParseFloat(*history.SpotPrice, 64) if errFloat != nil { processingErr = multierr.Append(processingErr, errFloat) continue } - instanceType := *history.InstanceType - spotTimeSeries[instanceType] = append(spotTimeSeries[instanceType], &spotPricingEntry{ + spotTimeSeries[string(history.InstanceType)] = append(spotTimeSeries[string(history.InstanceType)], &spotPricingEntry{ Timestamp: *history.Timestamp, SpotPrice: spotPrice, Zone: *history.AvailabilityZone, }) } - return true - }) - if errAPI != nil { - return spotTimeSeries, errAPI } + return spotTimeSeries, processingErr } diff --git a/pkg/instancetypes/instancetypes.go b/pkg/instancetypes/instancetypes.go index 4e83a846..f38512d3 100644 --- a/pkg/instancetypes/instancetypes.go +++ b/pkg/instancetypes/instancetypes.go @@ -14,6 +14,7 @@ package instancetypes import ( + "context" "encoding/json" "errors" "fmt" @@ -23,8 +24,8 @@ import ( "path/filepath" "time" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/mitchellh/go-homedir" "github.com/patrickmn/go-cache" ) @@ -35,7 +36,7 @@ var ( // Details hold all the information on an ec2 instance type type Details struct { - ec2.InstanceTypeInfo + ec2types.InstanceTypeInfo OndemandPricePerHour *float64 SpotPrice *float64 } @@ -45,11 +46,11 @@ type Provider struct { DirectoryPath string FullRefreshTTL time.Duration lastFullRefresh *time.Time - ec2Client ec2iface.EC2API + ec2Client ec2.DescribeInstanceTypesAPIClient cache *cache.Cache } -func NewProvider(directoryPath string, region string, ttl time.Duration, ec2Client ec2iface.EC2API) *Provider { +func NewProvider(directoryPath string, region string, ttl time.Duration, ec2Client ec2.DescribeInstanceTypesAPIClient) *Provider { expandedDirPath, err := homedir.Expand(directoryPath) if err != nil { log.Printf("Unable to expand instance type cache directory %s: %v", directoryPath, err) @@ -63,7 +64,7 @@ func NewProvider(directoryPath string, region string, ttl time.Duration, ec2Clie } } -func LoadFromOrNew(directoryPath string, region string, ttl time.Duration, ec2Client ec2iface.EC2API) *Provider { +func LoadFromOrNew(directoryPath string, region string, ttl time.Duration, ec2Client ec2.DescribeInstanceTypesAPIClient) *Provider { expandedDirPath, err := homedir.Expand(directoryPath) if err != nil { log.Printf("Unable to load instance-type cache directory %s: %v", expandedDirPath, err) @@ -106,17 +107,17 @@ func getCacheFilePath(region string, expandedDirPath string) string { return filepath.Join(expandedDirPath, fmt.Sprintf("%s-%s", region, CacheFileName)) } -func (p *Provider) Get(instanceTypes []string) ([]*Details, error) { +func (p *Provider) Get(ctx context.Context, instanceTypes []ec2types.InstanceType) ([]*Details, error) { instanceTypeDetails := []*Details{} describeInstanceTypeOpts := &ec2.DescribeInstanceTypesInput{} if len(instanceTypes) != 0 { for _, it := range instanceTypes { - if cachedIT, ok := p.cache.Get(it); ok { + if cachedIT, ok := p.cache.Get(string(it)); ok { instanceTypeDetails = append(instanceTypeDetails, cachedIT.(*Details)) } else { - // need to reassign so we're not sharing the loop iterators memory space + // need to reassign, so we're not sharing the loop iterators memory space instanceType := it - describeInstanceTypeOpts.InstanceTypes = append(describeInstanceTypeOpts.InstanceTypes, &instanceType) + describeInstanceTypeOpts.InstanceTypes = append(describeInstanceTypeOpts.InstanceTypes, instanceType) } } } else if p.lastFullRefresh != nil && !p.isFullRefreshNeeded() { @@ -125,17 +126,22 @@ func (p *Provider) Get(instanceTypes []string) ([]*Details, error) { } return instanceTypeDetails, nil } - if err := p.ec2Client.DescribeInstanceTypesPages(&ec2.DescribeInstanceTypesInput{}, func(page *ec2.DescribeInstanceTypesOutput, lastPage bool) bool { - for _, instanceTypeInfo := range page.InstanceTypes { - itDetails := &Details{InstanceTypeInfo: *instanceTypeInfo} + + s := ec2.NewDescribeInstanceTypesPaginator(p.ec2Client, &ec2.DescribeInstanceTypesInput{}) + + for s.HasMorePages() { + instanceTypeOutput, err := s.NextPage(ctx) + if err != nil { + return nil, fmt.Errorf("failed to get a page, %w", err) + } + + for _, instanceTypeInfo := range instanceTypeOutput.InstanceTypes { + itDetails := &Details{InstanceTypeInfo: instanceTypeInfo} instanceTypeDetails = append(instanceTypeDetails, itDetails) - p.cache.SetDefault(*instanceTypeInfo.InstanceType, itDetails) + p.cache.SetDefault(string(instanceTypeInfo.InstanceType), itDetails) } - // continue paging through instance types - return true - }); err != nil { - return instanceTypeDetails, err } + if len(instanceTypes) == 0 { now := time.Now().UTC() p.lastFullRefresh = &now @@ -158,7 +164,9 @@ func (p *Provider) Save() error { if err != nil { return err } - os.Mkdir(p.DirectoryPath, 0755) + if err := os.Mkdir(p.DirectoryPath, 0755); err != nil && !errors.Is(err, os.ErrExist) { + return err + } return ioutil.WriteFile(getCacheFilePath(p.Region, p.DirectoryPath), cacheBytes, 0644) } diff --git a/pkg/selector/aggregates.go b/pkg/selector/aggregates.go index b17bf062..b5f3e613 100644 --- a/pkg/selector/aggregates.go +++ b/pkg/selector/aggregates.go @@ -1,12 +1,12 @@ package selector import ( + "context" "fmt" - "regexp" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "regexp" ) const ( @@ -18,25 +18,27 @@ const ( // FiltersTransform can be implemented to provide custom transforms type FiltersTransform interface { - Transform(Filters) (Filters, error) + Transform(context.Context, Filters) (Filters, error) } // TransformFn is the func type definition for a FiltersTransform -type TransformFn func(Filters) (Filters, error) +type TransformFn func(context.Context, Filters) (Filters, error) // Transform implements FiltersTransform interface on TransformFn // This allows any TransformFn to be passed into funcs accepting FiltersTransform interface -func (fn TransformFn) Transform(filters Filters) (Filters, error) { - return fn(filters) +func (fn TransformFn) Transform(ctx context.Context, filters Filters) (Filters, error) { + return fn(ctx, filters) } // TransformBaseInstanceType transforms lower level filters based on the instanceTypeBase specs -func (itf Selector) TransformBaseInstanceType(filters Filters) (Filters, error) { +func (itf Selector) TransformBaseInstanceType(ctx context.Context, filters Filters) (Filters, error) { if filters.InstanceTypeBase == nil { return filters, nil } - instanceTypesOutput, err := itf.EC2.DescribeInstanceTypes(&ec2.DescribeInstanceTypesInput{ - InstanceTypes: []*string{filters.InstanceTypeBase}, + instanceTypesOutput, err := itf.EC2.DescribeInstanceTypes(ctx, &ec2.DescribeInstanceTypesInput{ + InstanceTypes: []ec2types.InstanceType{ + ec2types.InstanceType(*filters.InstanceTypeBase), + }, }) if err != nil { return filters, err @@ -49,18 +51,18 @@ func (itf Selector) TransformBaseInstanceType(filters Filters) (Filters, error) filters.BareMetal = instanceTypeInfo.BareMetal } if filters.CPUArchitecture == nil && len(instanceTypeInfo.ProcessorInfo.SupportedArchitectures) == 1 { - filters.CPUArchitecture = instanceTypeInfo.ProcessorInfo.SupportedArchitectures[0] + filters.CPUArchitecture = &instanceTypeInfo.ProcessorInfo.SupportedArchitectures[0] } if filters.Fpga == nil { isFpgaSupported := instanceTypeInfo.FpgaInfo != nil filters.Fpga = &isFpgaSupported } if filters.GpusRange == nil { - gpuCount := 0 + gpuCount := int32(0) if instanceTypeInfo.GpuInfo != nil { - gpuCount = int(*getTotalGpusCount(instanceTypeInfo.GpuInfo)) + gpuCount = *getTotalGpusCount(instanceTypeInfo.GpuInfo) } - filters.GpusRange = &IntRangeFilter{LowerBound: gpuCount, UpperBound: gpuCount} + filters.GpusRange = &Int32RangeFilter{LowerBound: gpuCount, UpperBound: gpuCount} } if filters.MemoryRange == nil { lowerBound := bytequantity.ByteQuantity{Quantity: uint64(float64(*instanceTypeInfo.MemoryInfo.SizeInMiB) * AggregateLowPercentile)} @@ -68,12 +70,12 @@ func (itf Selector) TransformBaseInstanceType(filters Filters) (Filters, error) filters.MemoryRange = &ByteQuantityRangeFilter{LowerBound: lowerBound, UpperBound: upperBound} } if filters.VCpusRange == nil { - lowerBound := int(float64(*instanceTypeInfo.VCpuInfo.DefaultVCpus) * AggregateLowPercentile) - upperBound := int(float64(*instanceTypeInfo.VCpuInfo.DefaultVCpus) * AggregateHighPercentile) - filters.VCpusRange = &IntRangeFilter{LowerBound: lowerBound, UpperBound: upperBound} + lowerBound := int32(float32(*instanceTypeInfo.VCpuInfo.DefaultVCpus) * AggregateLowPercentile) + upperBound := int32(float32(*instanceTypeInfo.VCpuInfo.DefaultVCpus) * AggregateHighPercentile) + filters.VCpusRange = &Int32RangeFilter{LowerBound: lowerBound, UpperBound: upperBound} } if filters.VirtualizationType == nil && len(instanceTypeInfo.SupportedVirtualizationTypes) == 1 { - filters.VirtualizationType = instanceTypeInfo.SupportedVirtualizationTypes[0] + filters.VirtualizationType = &instanceTypeInfo.SupportedVirtualizationTypes[0] } filters.InstanceTypeBase = nil @@ -81,18 +83,21 @@ func (itf Selector) TransformBaseInstanceType(filters Filters) (Filters, error) } // TransformFlexible transforms lower level filters based on a set of opinions -func (itf Selector) TransformFlexible(filters Filters) (Filters, error) { +func (itf Selector) TransformFlexible(ctx context.Context, filters Filters) (Filters, error) { if filters.Flexible == nil { return filters, nil } if filters.CPUArchitecture == nil { - filters.CPUArchitecture = aws.String("x86_64") + defaultArchitecture := ec2types.ArchitectureTypeX8664 + filters.CPUArchitecture = &defaultArchitecture } if filters.BareMetal == nil { - filters.BareMetal = aws.Bool(false) + bareMetalDefault := false + filters.BareMetal = &bareMetalDefault } if filters.Fpga == nil { - filters.Fpga = aws.Bool(false) + fpgaDefault := false + filters.Fpga = &fpgaDefault } if filters.AllowList == nil { @@ -104,14 +109,14 @@ func (itf Selector) TransformFlexible(filters Filters) (Filters, error) { } if filters.VCpusRange == nil && filters.MemoryRange == nil { - defaultVcpus := 4 - filters.VCpusRange = &IntRangeFilter{LowerBound: defaultVcpus, UpperBound: defaultVcpus} + defaultVcpus := int32(4) + filters.VCpusRange = &Int32RangeFilter{LowerBound: defaultVcpus, UpperBound: defaultVcpus} } return filters, nil } // TransformForService transforms lower level filters based on the service -func (itf Selector) TransformForService(filters Filters) (Filters, error) { +func (itf Selector) TransformForService(ctx context.Context, filters Filters) (Filters, error) { return itf.ServiceRegistry.ExecuteTransforms(filters) } diff --git a/pkg/selector/aggregates_test.go b/pkg/selector/aggregates_test.go index 17691dde..3211a031 100644 --- a/pkg/selector/aggregates_test.go +++ b/pkg/selector/aggregates_test.go @@ -14,6 +14,7 @@ package selector_test import ( + "context" "testing" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" @@ -25,7 +26,6 @@ import ( func TestTransformBaseInstanceType(t *testing.T) { ec2Mock := mockedEC2{ DescribeInstanceTypesResp: setupMock(t, describeInstanceTypes, "c4_large.json").DescribeInstanceTypesResp, - DescribeInstanceTypesPagesResp: setupMock(t, describeInstanceTypesPages, "25_instances.json").DescribeInstanceTypesPagesResp, DescribeInstanceTypeOfferingsResp: setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json").DescribeInstanceTypeOfferingsResp, } itf := selector.Selector{ @@ -35,7 +35,8 @@ func TestTransformBaseInstanceType(t *testing.T) { filters := selector.Filters{ InstanceTypeBase: &instanceTypeBase, } - filters, err := itf.TransformBaseInstanceType(filters) + ctx := context.Background() + filters, err := itf.TransformBaseInstanceType(ctx, filters) h.Ok(t, err) h.Assert(t, *filters.BareMetal == false, " should filter out bare metal instances") h.Assert(t, *filters.Fpga == false, "should filter out FPGA instances") @@ -46,7 +47,6 @@ func TestTransformBaseInstanceType(t *testing.T) { func TestTransformBaseInstanceTypeWithGPU(t *testing.T) { ec2Mock := mockedEC2{ DescribeInstanceTypesResp: setupMock(t, describeInstanceTypes, "g2_2xlarge.json").DescribeInstanceTypesResp, - DescribeInstanceTypesPagesResp: setupMock(t, describeInstanceTypesPages, "g2_2xlarge_group.json").DescribeInstanceTypesPagesResp, DescribeInstanceTypeOfferingsResp: setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json").DescribeInstanceTypeOfferingsResp, } itf := selector.Selector{ @@ -56,7 +56,8 @@ func TestTransformBaseInstanceTypeWithGPU(t *testing.T) { filters := selector.Filters{ InstanceTypeBase: &instanceTypeBase, } - filters, err := itf.TransformBaseInstanceType(filters) + ctx := context.Background() + filters, err := itf.TransformBaseInstanceType(ctx, filters) h.Ok(t, err) h.Assert(t, *filters.BareMetal == false, " should filter out bare metal instances") h.Assert(t, *filters.Fpga == false, "should filter out FPGA instances") @@ -70,7 +71,8 @@ func TestTransformFamilyFlexibile(t *testing.T) { filters := selector.Filters{ Flexible: &flexible, } - filters, err := itf.TransformFlexible(filters) + ctx := context.Background() + filters, err := itf.TransformFlexible(ctx, filters) h.Ok(t, err) h.Assert(t, *filters.BareMetal == false, " should filter out bare metal instances") h.Assert(t, *filters.Fpga == false, "should filter out FPGA instances") diff --git a/pkg/selector/comparators.go b/pkg/selector/comparators.go index d1070bae..eb639ecf 100644 --- a/pkg/selector/comparators.go +++ b/pkg/selector/comparators.go @@ -16,12 +16,13 @@ package selector import ( "log" "math" + "reflect" "regexp" "strconv" "strings" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go-v2/aws" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) const ( @@ -68,6 +69,106 @@ func isSupportedWithFloat64(instanceTypeValue *float64, target *float64) bool { return math.Floor(*instanceTypeValue*100)/100 == math.Floor(*target*100)/100 } +func isSupportedUsageClassType(instanceTypeValue []ec2types.UsageClassType, target *ec2types.UsageClassType) bool { + if target == nil { + return true + } + if instanceTypeValue == nil { + return false + } + if reflect.ValueOf(*target).IsZero() { + return true + } + + for _, potentialType := range instanceTypeValue { + if potentialType == *target { + return true + } + } + return false +} + +func isSupportedArchitectureType(instanceTypeValue []ec2types.ArchitectureType, target *ec2types.ArchitectureType) bool { + if target == nil { + return true + } + if instanceTypeValue == nil { + return false + } + if reflect.ValueOf(*target).IsZero() { + return true + } + + for _, potentialType := range instanceTypeValue { + if potentialType == *target { + return true + } + } + return false +} + +func isSupportedVirtualizationType(instanceTypeValue []ec2types.VirtualizationType, target *ec2types.VirtualizationType) bool { + if target == nil { + return true + } + if instanceTypeValue == nil { + return false + } + if reflect.ValueOf(*target).IsZero() { + return true + } + for _, potentialType := range instanceTypeValue { + if potentialType == *target { + return true + } + } + return false +} + +func isSupportedInstanceTypeHypervisorType(instanceTypeValue ec2types.InstanceTypeHypervisor, target *ec2types.InstanceTypeHypervisor) bool { + if target == nil { + return true + } + if reflect.ValueOf(*target).IsZero() { + return true + } + if instanceTypeValue == *target { + return true + } + return false +} + +func isSupportedRootDeviceType(instanceTypeValue []ec2types.RootDeviceType, target *ec2types.RootDeviceType) bool { + if target == nil { + return true + } + if instanceTypeValue == nil { + return false + } + if reflect.ValueOf(*target).IsZero() { + return true + } + for _, potentialType := range instanceTypeValue { + if potentialType == *target { + return true + } + } + return false +} + +func isMatchingCpuArchitecture(instanceTypeValue CPUManufacturer, target *CPUManufacturer) bool { + if target == nil { + return true + } + if reflect.ValueOf(*target).IsZero() { + return true + } + if instanceTypeValue == *target { + return true + } + return false +} + func isSupportedWithRangeInt64(instanceTypeValue *int64, target *IntRangeFilter) bool { if target == nil { return true @@ -79,6 +180,17 @@ func isSupportedWithRangeInt64(instanceTypeValue *int64, target *IntRangeFilter) return int(*instanceTypeValue) >= target.LowerBound && int(*instanceTypeValue) <= target.UpperBound } +func isSupportedWithRangeInt32(instanceTypeValue *int32, target *Int32RangeFilter) bool { + if target == nil { + return true + } else if instanceTypeValue == nil && target.LowerBound == 0 && target.UpperBound == 0 { + return true + } else if instanceTypeValue == nil { + return false + } + return *instanceTypeValue >= target.LowerBound && *instanceTypeValue <= target.UpperBound +} + func isSupportedWithRangeUint64(instanceTypeValue *int64, target *Uint64RangeFilter) bool { if target == nil { return true @@ -113,36 +225,36 @@ func isSupportedWithBool(instanceTypeValue *bool, target *bool) bool { // Helper functions for aggregating data parsed from AWS API calls -func getTotalAcceleratorsCount(acceleratorInfo *ec2.InferenceAcceleratorInfo) *int64 { +func getTotalAcceleratorsCount(acceleratorInfo *ec2types.InferenceAcceleratorInfo) *int32 { if acceleratorInfo == nil { return nil } - total := aws.Int64(0) + total := int32(0) for _, accel := range acceleratorInfo.Accelerators { - total = aws.Int64(*total + *accel.Count) + total = total + *accel.Count } - return total + return &total } -func getTotalGpusCount(gpusInfo *ec2.GpuInfo) *int64 { +func getTotalGpusCount(gpusInfo *ec2types.GpuInfo) *int32 { if gpusInfo == nil { return nil } - total := aws.Int64(0) + total := int32(0) for _, gpu := range gpusInfo.Gpus { - total = aws.Int64(*total + *gpu.Count) + total = total + *gpu.Count } - return total + return &total } -func getTotalGpuMemory(gpusInfo *ec2.GpuInfo) *int64 { +func getTotalGpuMemory(gpusInfo *ec2types.GpuInfo) *int64 { if gpusInfo == nil { return nil } - return gpusInfo.TotalGpuMemoryInMiB + return aws.Int64(int64(*gpusInfo.TotalGpuMemoryInMiB)) } -func getGPUManufacturers(gpusInfo *ec2.GpuInfo) []*string { +func getGPUManufacturers(gpusInfo *ec2types.GpuInfo) []*string { if gpusInfo == nil { return nil } @@ -153,7 +265,7 @@ func getGPUManufacturers(gpusInfo *ec2.GpuInfo) []*string { return manufacturers } -func getGPUModels(gpusInfo *ec2.GpuInfo) []*string { +func getGPUModels(gpusInfo *ec2types.GpuInfo) []*string { if gpusInfo == nil { return nil } @@ -164,7 +276,7 @@ func getGPUModels(gpusInfo *ec2.GpuInfo) []*string { return models } -func getInferenceAcceleratorManufacturers(acceleratorInfo *ec2.InferenceAcceleratorInfo) []*string { +func getInferenceAcceleratorManufacturers(acceleratorInfo *ec2types.InferenceAcceleratorInfo) []*string { if acceleratorInfo == nil { return nil } @@ -175,7 +287,7 @@ func getInferenceAcceleratorManufacturers(acceleratorInfo *ec2.InferenceAccelera return manufacturers } -func getInferenceAcceleratorModels(acceleratorInfo *ec2.InferenceAcceleratorInfo) []*string { +func getInferenceAcceleratorModels(acceleratorInfo *ec2types.InferenceAcceleratorInfo) []*string { if acceleratorInfo == nil { return nil } @@ -210,69 +322,74 @@ func getNetworkPerformance(networkPerformance *string) *int { return aws.Int(bandwidthNumber) } -func getInstanceStorage(instanceStorageInfo *ec2.InstanceStorageInfo) *int64 { +func getInstanceStorage(instanceStorageInfo *ec2types.InstanceStorageInfo) *int64 { if instanceStorageInfo == nil { return aws.Int64(0) } return aws.Int64(*instanceStorageInfo.TotalSizeInGB * 1024) } -func getDiskType(instanceStorageInfo *ec2.InstanceStorageInfo) *string { +func getDiskType(instanceStorageInfo *ec2types.InstanceStorageInfo) *string { if instanceStorageInfo == nil || len(instanceStorageInfo.Disks) == 0 { return nil } - return instanceStorageInfo.Disks[0].Type + return aws.String(string(instanceStorageInfo.Disks[0].Type)) } -func getNVMESupport(instanceStorageInfo *ec2.InstanceStorageInfo, ebsInfo *ec2.EbsInfo) *bool { +func getNVMESupport(instanceStorageInfo *ec2types.InstanceStorageInfo, ebsInfo *ec2types.EbsInfo) *bool { if instanceStorageInfo != nil { - return supportSyntaxToBool(instanceStorageInfo.NvmeSupport) + return supportSyntaxToBool(aws.String(string(instanceStorageInfo.NvmeSupport))) } if ebsInfo != nil { - return supportSyntaxToBool(ebsInfo.EbsOptimizedSupport) + return supportSyntaxToBool(aws.String(string(ebsInfo.EbsOptimizedSupport))) } return aws.Bool(false) } -func getDiskEncryptionSupport(instanceStorageInfo *ec2.InstanceStorageInfo, ebsInfo *ec2.EbsInfo) *bool { +func getDiskEncryptionSupport(instanceStorageInfo *ec2types.InstanceStorageInfo, ebsInfo *ec2types.EbsInfo) *bool { if instanceStorageInfo != nil { - return supportSyntaxToBool(instanceStorageInfo.EncryptionSupport) + encryptionSupport := string(instanceStorageInfo.EncryptionSupport) + return supportSyntaxToBool(&encryptionSupport) } if ebsInfo != nil { - return supportSyntaxToBool(ebsInfo.EncryptionSupport) + ebsEncryptionSupport := string(ebsInfo.EncryptionSupport) + return supportSyntaxToBool(&ebsEncryptionSupport) } return aws.Bool(false) } -func getEBSOptimizedBaselineBandwidth(ebsInfo *ec2.EbsInfo) *int64 { +func getEBSOptimizedBaselineBandwidth(ebsInfo *ec2types.EbsInfo) *int32 { if ebsInfo == nil || ebsInfo.EbsOptimizedInfo == nil { return nil } return ebsInfo.EbsOptimizedInfo.BaselineBandwidthInMbps } -func getEBSOptimizedBaselineThroughput(ebsInfo *ec2.EbsInfo) *float64 { +func getEBSOptimizedBaselineThroughput(ebsInfo *ec2types.EbsInfo) *float64 { if ebsInfo == nil || ebsInfo.EbsOptimizedInfo == nil { return nil } return ebsInfo.EbsOptimizedInfo.BaselineThroughputInMBps } -func getEBSOptimizedBaselineIOPS(ebsInfo *ec2.EbsInfo) *int64 { +func getEBSOptimizedBaselineIOPS(ebsInfo *ec2types.EbsInfo) *int32 { if ebsInfo == nil || ebsInfo.EbsOptimizedInfo == nil { return nil } return ebsInfo.EbsOptimizedInfo.BaselineIops } -func getCPUManufacturer(instanceTypeInfo *ec2.InstanceTypeInfo) *string { - if contains(instanceTypeInfo.ProcessorInfo.SupportedArchitectures, ec2.ArchitectureTypeArm64) { - return aws.String("aws") +func getCPUManufacturer(instanceTypeInfo *ec2types.InstanceTypeInfo) CPUManufacturer { + for _, it := range instanceTypeInfo.ProcessorInfo.SupportedArchitectures { + if it == ec2types.ArchitectureTypeArm64 { + return CPUManufacturerAWS + } } - if amdRegex.Match([]byte(*instanceTypeInfo.InstanceType)) { - return aws.String("amd") + + if amdRegex.Match([]byte(instanceTypeInfo.InstanceType)) { + return CPUManufacturerAMD } - return aws.String("intel") + return CPUManufacturerIntel } // supportSyntaxToBool takes an instance spec field that uses ["unsupported", "supported", "required", or "default"] @@ -287,7 +404,7 @@ func supportSyntaxToBool(instanceTypeSupport *string) *bool { return aws.Bool(false) } -func calculateVCpusToMemoryRatio(vcpusVal *int64, memoryVal *int64) *float64 { +func calculateVCpusToMemoryRatio(vcpusVal *int32, memoryVal *int64) *float64 { if vcpusVal == nil || *vcpusVal == 0 || memoryVal == nil { return nil } diff --git a/pkg/selector/comparators_internal_test.go b/pkg/selector/comparators_internal_test.go index 444f8636..80016313 100644 --- a/pkg/selector/comparators_internal_test.go +++ b/pkg/selector/comparators_internal_test.go @@ -18,7 +18,7 @@ import ( "testing" h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go-v2/aws" ) func TestIsSupportedFromStrings_Supported(t *testing.T) { @@ -261,22 +261,22 @@ func TestSupportSyntaxToBool_Nil(t *testing.T) { } func TestCalculateVCpusToMemoryRatio(t *testing.T) { - vcpus := aws.Int64(4) + vcpus := aws.Int32(4) memory := aws.Int64(4096) ratio := calculateVCpusToMemoryRatio(vcpus, memory) h.Assert(t, *ratio == 1.00, "ratio should equal 1:1") - vcpus = aws.Int64(2) + vcpus = aws.Int32(2) memory = aws.Int64(4096) ratio = calculateVCpusToMemoryRatio(vcpus, memory) h.Assert(t, *ratio == 2.00, "ratio should equal 1:2") - vcpus = aws.Int64(1) + vcpus = aws.Int32(1) memory = aws.Int64(512) ratio = calculateVCpusToMemoryRatio(vcpus, memory) h.Assert(t, *ratio == 1.0, "ratio should take the ceiling which equals 1:1") - vcpus = aws.Int64(0) + vcpus = aws.Int32(0) memory = aws.Int64(512) ratio = calculateVCpusToMemoryRatio(vcpus, memory) h.Assert(t, ratio == nil, "ratio should be nil when vcpus is 0") @@ -287,7 +287,7 @@ func TestCalculateVCpusToMemoryRatio_Nil(t *testing.T) { ratio := calculateVCpusToMemoryRatio(nil, memory) h.Assert(t, ratio == nil, "nil vcpus should evaluate to nil") - vcpus := aws.Int64(2) + vcpus := aws.Int32(2) ratio = calculateVCpusToMemoryRatio(vcpus, nil) h.Assert(t, ratio == nil, "nil memory should evaluate to nil") diff --git a/pkg/selector/emr.go b/pkg/selector/emr.go index 116f7c49..212f16f6 100644 --- a/pkg/selector/emr.go +++ b/pkg/selector/emr.go @@ -17,7 +17,7 @@ import ( "fmt" "strings" - "github.com/aws/aws-sdk-go/aws" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/blang/semver/v4" ) @@ -46,8 +46,10 @@ func (e EMR) Filters(version string) (Filters, error) { return filters, err } filters.InstanceTypes = &instanceTypes - filters.RootDeviceType = aws.String("ebs") - filters.VirtualizationType = aws.String("hvm") + ebsType := ec2types.RootDeviceTypeEbs + filters.RootDeviceType = &ebsType + hvmType := ec2types.VirtualizationTypeHvm + filters.VirtualizationType = &hvmType return filters, nil } diff --git a/pkg/selector/outputs/bubbletea_internal_test.go b/pkg/selector/outputs/bubbletea_internal_test.go index 7384995d..495b45a7 100644 --- a/pkg/selector/outputs/bubbletea_internal_test.go +++ b/pkg/selector/outputs/bubbletea_internal_test.go @@ -68,15 +68,6 @@ func TestNewBubbleTeaModel_Hypervisor(t *testing.T) { actualHypervisor := rows[0].Data["Hypervisor"] h.Assert(t, actualHypervisor == expectedHypervisor, fmt.Sprintf("Hypervisor should be %s but instead is %s", expectedHypervisor, actualHypervisor)) - - // test nil Hypervisor - instanceTypes[0].Hypervisor = nil - model = NewBubbleTeaModel(instanceTypes) - rows = model.tableModel.table.GetVisibleRows() - expectedHypervisor = "none" - actualHypervisor = rows[0].Data["Hypervisor"] - - h.Assert(t, actualHypervisor == expectedHypervisor, fmt.Sprintf("Hypervisor should be %s but instead is %s", expectedHypervisor, actualHypervisor)) } func TestNewBubbleTeaModel_CPUArchitectures(t *testing.T) { @@ -168,6 +159,6 @@ func TestNewBubbleTeaModel_Rows(t *testing.T) { currInstanceName := instanceTypes[i].InstanceType currRowName := rows[i].Data["Instance Type"] - h.Assert(t, *currInstanceName == currRowName, "Rows should be in following order: %s. Actual order: [%s]", OneLineOutput(instanceTypes), getRowsInstances(rows)) + h.Assert(t, string(currInstanceName) == currRowName, "Rows should be in following order: %s. Actual order: [%s]", OneLineOutput(instanceTypes), getRowsInstances(rows)) } } diff --git a/pkg/selector/outputs/outputs.go b/pkg/selector/outputs/outputs.go index 468073d2..319cf9fc 100644 --- a/pkg/selector/outputs/outputs.go +++ b/pkg/selector/outputs/outputs.go @@ -33,15 +33,15 @@ const columnTag = "column" // of a wide output row type wideColumnsData struct { instanceName string `column:"Instance Type"` - vcpu int64 `column:"VCPUs"` + vcpu int32 `column:"VCPUs"` memory string `column:"Mem (GiB)"` hypervisor string `column:"Hypervisor"` currentGen bool `column:"Current Gen"` hibernationSupport bool `column:"Hibernation Support"` cpuArch string `column:"CPU Arch"` networkPerformance string `column:"Network Performance"` - eni int64 `column:"ENIs"` - gpu int64 `column:"GPUs"` + eni int32 `column:"ENIs"` + gpu int32 `column:"GPUs"` gpuMemory string `column:"GPU Mem (GiB)"` gpuInfo string `column:"GPU Info"` odPrice string `column:"On-Demand Price/Hr"` @@ -52,7 +52,7 @@ type wideColumnsData struct { func SimpleInstanceTypeOutput(instanceTypeInfoSlice []*instancetypes.Details) []string { instanceTypeStrings := []string{} for _, instanceTypeInfo := range instanceTypeInfoSlice { - instanceTypeStrings = append(instanceTypeStrings, *instanceTypeInfo.InstanceType) + instanceTypeStrings = append(instanceTypeStrings, string(instanceTypeInfo.InstanceType)) } return instanceTypeStrings } @@ -97,7 +97,7 @@ func TableOutputShort(instanceTypeInfoSlice []*instancetypes.Details) []string { for _, instanceTypeInfo := range instanceTypeInfoSlice { fmt.Fprintf(w, "\n%s\t%d\t%s\t", - *instanceTypeInfo.InstanceType, + instanceTypeInfo.InstanceType, *instanceTypeInfo.VCpuInfo.DefaultVCpus, formatFloat(float64(*instanceTypeInfo.MemoryInfo.SizeInMiB)/1024.0), ) @@ -161,7 +161,7 @@ func TableOutputWide(instanceTypeInfoSlice []*instancetypes.Details) []string { func OneLineOutput(instanceTypeInfoSlice []*instancetypes.Details) []string { instanceTypeNames := []string{} for _, instanceType := range instanceTypeInfoSlice { - instanceTypeNames = append(instanceTypeNames, *instanceType.InstanceType) + instanceTypeNames = append(instanceTypeNames, string(instanceType.InstanceType)) } if len(instanceTypeNames) == 0 { return []string{} @@ -202,18 +202,14 @@ func getWideColumnsData(instanceTypes []*instancetypes.Details) []*wideColumnsDa for _, instanceType := range instanceTypes { none := "none" - hyperisor := instanceType.Hypervisor - if hyperisor == nil { - hyperisor = &none - } cpuArchitectures := []string{} for _, cpuArch := range instanceType.ProcessorInfo.SupportedArchitectures { - cpuArchitectures = append(cpuArchitectures, *cpuArch) + cpuArchitectures = append(cpuArchitectures, string(cpuArch)) } - gpus := int64(0) - gpuMemory := int64(0) + gpus := int32(0) + gpuMemory := int32(0) gpuType := []string{} if instanceType.GpuInfo != nil { gpuMemory = *instanceType.GpuInfo.TotalGpuMemoryInMiB @@ -235,10 +231,10 @@ func getWideColumnsData(instanceTypes []*instancetypes.Details) []*wideColumnsDa } newColumn := wideColumnsData{ - instanceName: *instanceType.InstanceType, + instanceName: string(instanceType.InstanceType), vcpu: *instanceType.VCpuInfo.DefaultVCpus, memory: formatFloat(float64(*instanceType.MemoryInfo.SizeInMiB) / 1024.0), - hypervisor: *hyperisor, + hypervisor: string(instanceType.Hypervisor), currentGen: *instanceType.CurrentGeneration, hibernationSupport: *instanceType.HibernationSupported, cpuArch: strings.Join(cpuArchitectures, ", "), diff --git a/pkg/selector/outputs/outputs_test.go b/pkg/selector/outputs/outputs_test.go index 6f484fdd..50d24fa8 100644 --- a/pkg/selector/outputs/outputs_test.go +++ b/pkg/selector/outputs/outputs_test.go @@ -23,7 +23,7 @@ import ( "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs" h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" - "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go-v2/service/ec2" ) const ( @@ -41,7 +41,7 @@ func getInstanceTypes(t *testing.T, file string) []*instancetypes.Details { instanceTypesDetails := []*instancetypes.Details{} for _, it := range dito.InstanceTypes { odPrice := float64(0.53) - instanceTypesDetails = append(instanceTypesDetails, &instancetypes.Details{InstanceTypeInfo: *it, OndemandPricePerHour: &odPrice}) + instanceTypesDetails = append(instanceTypesDetails, &instancetypes.Details{InstanceTypeInfo: it, OndemandPricePerHour: &odPrice}) } return instanceTypesDetails } diff --git a/pkg/selector/outputs/tableView.go b/pkg/selector/outputs/tableView.go index 07e52e81..9dc05bce 100644 --- a/pkg/selector/outputs/tableView.go +++ b/pkg/selector/outputs/tableView.go @@ -393,7 +393,7 @@ func (m tableModel) sortTable(sortFilter string, sortDirection string) (tableMod // get sorted rows from sorted instance types rows := []table.Row{} for _, instance := range instanceTypes { - currRow := rowMap[*instance.InstanceType] + currRow := rowMap[string(instance.InstanceType)] rows = append(rows, currRow) } @@ -431,7 +431,7 @@ func (m tableModel) getInstanceTypeFromRows() ([]*instancetypes.Details, map[str } instanceTypes = append(instanceTypes, currInstance) - rowMap[*currInstance.InstanceType] = row + rowMap[string(currInstance.InstanceType)] = row } return instanceTypes, rowMap diff --git a/pkg/selector/outputs/verboseView.go b/pkg/selector/outputs/verboseView.go index 721e3a39..0852f73d 100644 --- a/pkg/selector/outputs/verboseView.go +++ b/pkg/selector/outputs/verboseView.go @@ -19,6 +19,7 @@ import ( "strings" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/charmbracelet/bubbles/viewport" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" @@ -38,7 +39,7 @@ type verboseModel struct { viewport viewport.Model // the instance which the verbose output is focused on - focusedInstanceName *string + focusedInstanceName ec2types.InstanceType } // styling for viewport @@ -96,7 +97,7 @@ func (m verboseModel) view() string { outputStr := strings.Builder{} // format header for viewport - instanceName := titleStyle.Render(*m.focusedInstanceName) + instanceName := titleStyle.Render(string(m.focusedInstanceName)) line := strings.Repeat("─", int(math.Max(0, float64(m.viewport.Width-lipgloss.Width(instanceName))))) outputStr.WriteString(lipgloss.JoinHorizontal(lipgloss.Center, instanceName, line)) outputStr.WriteString("\n") diff --git a/pkg/selector/selector.go b/pkg/selector/selector.go index 9c8eb36d..897864c3 100644 --- a/pkg/selector/selector.go +++ b/pkg/selector/selector.go @@ -28,10 +28,10 @@ import ( "github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "go.uber.org/multierr" ) @@ -42,9 +42,9 @@ var ( const ( locationFilterKey = "location" - zoneIDLocationType = "availability-zone-id" - zoneNameLocationType = "availability-zone" - regionNameLocationType = "region" + zoneIDLocationType = ec2types.LocationTypeAvailabilityZoneId + zoneNameLocationType = ec2types.LocationTypeAvailabilityZone + regionNameLocationType = ec2types.LocationTypeRegion sdkName = "instance-selector" // Filter Keys @@ -93,37 +93,49 @@ const ( dedicatedHosts = "dedicatedHosts" cpuArchitectureAMD64 = "amd64" - cpuArchitectureX8664 = "x86_64" - virtualizationTypeParaVirtual = "paravirtual" - virtualizationTypePV = "pv" + virtualizationTypePV = "pv" pricePerHour = "pricePerHour" ) // New creates an instance of Selector provided an aws session -func New(sess *session.Session) *Selector { +func New(ctx context.Context, cfg aws.Config) (*Selector, error) { serviceRegistry := NewRegistry() serviceRegistry.RegisterAWSServices() - ec2Client := ec2.New(userAgentWith(sess)) + ec2Client := ec2.NewFromConfig(cfg, func(options *ec2.Options) { + options.APIOptions = append(options.APIOptions, middleware.AddUserAgentKeyValue(sdkName, versionID)) + }) + pricingClient, err := ec2pricing.New(ctx, cfg) + if err != nil { + return nil, err + } + return &Selector{ EC2: ec2Client, - EC2Pricing: ec2pricing.New(sess), - InstanceTypesProvider: instancetypes.LoadFromOrNew("", *sess.Config.Region, 0, ec2Client), + EC2Pricing: pricingClient, + InstanceTypesProvider: instancetypes.LoadFromOrNew("", cfg.Region, 0, ec2Client), ServiceRegistry: serviceRegistry, - } + }, nil } -func NewWithCache(sess *session.Session, ttl time.Duration, cacheDir string) *Selector { +func NewWithCache(ctx context.Context, cfg aws.Config, ttl time.Duration, cacheDir string) (*Selector, error) { serviceRegistry := NewRegistry() serviceRegistry.RegisterAWSServices() - ec2Client := ec2.New(userAgentWith(sess)) + ec2Client := ec2.NewFromConfig(cfg, func(options *ec2.Options) { + options.APIOptions = append(options.APIOptions, middleware.AddUserAgentKeyValue(sdkName, versionID)) + }) + pricingClient, err := ec2pricing.NewWithCache(ctx, cfg, ttl, cacheDir) + if err != nil { + return nil, err + } + return &Selector{ EC2: ec2Client, - EC2Pricing: ec2pricing.NewWithCache(sess, ttl, cacheDir), - InstanceTypesProvider: instancetypes.LoadFromOrNew(cacheDir, *sess.Config.Region, ttl, ec2Client), + EC2Pricing: pricingClient, + InstanceTypesProvider: instancetypes.LoadFromOrNew(cacheDir, cfg.Region, ttl, ec2Client), ServiceRegistry: serviceRegistry, - } + }, nil } func (itf Selector) Save() error { @@ -135,9 +147,9 @@ func (itf Selector) Save() error { // // Deprecated: This function will be replaced with GetFilteredInstanceTypes() and // OutputInstanceTypes() in the next major version. -func (itf Selector) Filter(filters Filters) ([]string, error) { +func (itf Selector) Filter(ctx context.Context, filters Filters) ([]string, error) { outputFn := InstanceTypesOutputFn(outputs.SimpleInstanceTypeOutput) - output, _, err := itf.FilterWithOutput(filters, outputFn) + output, _, err := itf.FilterWithOutput(ctx, filters, outputFn) return output, err } @@ -146,8 +158,8 @@ func (itf Selector) Filter(filters Filters) ([]string, error) { // // Deprecated: This function will be replaced with GetFilteredInstanceTypes() in the next // major version. -func (itf Selector) FilterVerbose(filters Filters) ([]*instancetypes.Details, error) { - instanceTypeInfoSlice, err := itf.rawFilter(filters) +func (itf Selector) FilterVerbose(ctx context.Context, filters Filters) ([]*instancetypes.Details, error) { + instanceTypeInfoSlice, err := itf.rawFilter(ctx, filters) if err != nil { return nil, err } @@ -160,8 +172,8 @@ func (itf Selector) FilterVerbose(filters Filters) ([]*instancetypes.Details, er // // Deprecated: This function will be replaced with GetFilteredInstanceTypes() and // OutputInstanceTypes() in the next major version. -func (itf Selector) FilterWithOutput(filters Filters, outputFn InstanceTypesOutput) ([]string, int, error) { - instanceTypeInfoSlice, err := itf.rawFilter(filters) +func (itf Selector) FilterWithOutput(ctx context.Context, filters Filters, outputFn InstanceTypesOutput) ([]string, int, error) { + instanceTypeInfoSlice, err := itf.rawFilter(ctx, filters) if err != nil { return nil, 0, err } @@ -182,7 +194,7 @@ func (itf Selector) truncateResults(maxResults *int, instanceTypeInfoSlice []*in } // AggregateFilterTransform takes higher level filters which are used to affect multiple raw filters in an opinionated way. -func (itf Selector) AggregateFilterTransform(filters Filters) (Filters, error) { +func (itf Selector) AggregateFilterTransform(ctx context.Context, filters Filters) (Filters, error) { transforms := []FiltersTransform{ TransformFn(itf.TransformBaseInstanceType), TransformFn(itf.TransformFlexible), @@ -190,7 +202,7 @@ func (itf Selector) AggregateFilterTransform(filters Filters) (Filters, error) { } var err error for _, transform := range transforms { - filters, err = transform.Transform(filters) + filters, err = transform.Transform(ctx, filters) if err != nil { return filters, err } @@ -200,18 +212,18 @@ func (itf Selector) AggregateFilterTransform(filters Filters) (Filters, error) { // rawFilter accepts a Filters struct which is used to select the available instance types // matching the criteria within Filters and returns the detailed specs of matching instance types -func (itf Selector) rawFilter(filters Filters) ([]*instancetypes.Details, error) { - filters, err := itf.AggregateFilterTransform(filters) +func (itf Selector) rawFilter(ctx context.Context, filters Filters) ([]*instancetypes.Details, error) { + filters, err := itf.AggregateFilterTransform(ctx, filters) if err != nil { return nil, err } var locations, availabilityZones []string if filters.CPUArchitecture != nil && *filters.CPUArchitecture == cpuArchitectureAMD64 { - *filters.CPUArchitecture = cpuArchitectureX8664 + *filters.CPUArchitecture = ec2types.ArchitectureTypeX8664 } if filters.VirtualizationType != nil && *filters.VirtualizationType == virtualizationTypePV { - *filters.VirtualizationType = virtualizationTypeParaVirtual + *filters.VirtualizationType = ec2types.VirtualizationTypeParavirtual } if filters.AvailabilityZones != nil { availabilityZones = *filters.AvailabilityZones @@ -219,12 +231,12 @@ func (itf Selector) rawFilter(filters Filters) ([]*instancetypes.Details, error) } else if filters.Region != nil { locations = []string{*filters.Region} } - locationInstanceOfferings, err := itf.RetrieveInstanceTypesSupportedInLocations(locations) + locationInstanceOfferings, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, locations) if err != nil { return nil, err } - instanceTypeDetails, err := itf.InstanceTypesProvider.Get(nil) + instanceTypeDetails, err := itf.InstanceTypesProvider.Get(ctx, nil) if err != nil { return nil, err } @@ -235,7 +247,7 @@ func (itf Selector) rawFilter(filters Filters) ([]*instancetypes.Details, error) wg.Add(1) go func(instanceTypeInfo instancetypes.Details) { defer wg.Done() - it, err := itf.prepareFilter(filters, instanceTypeInfo, availabilityZones, locationInstanceOfferings) + it, err := itf.prepareFilter(ctx, filters, instanceTypeInfo, availabilityZones, locationInstanceOfferings) if err != nil { log.Println(err) } @@ -252,14 +264,14 @@ func (itf Selector) rawFilter(filters Filters) ([]*instancetypes.Details, error) return sortInstanceTypeInfo(filteredInstanceTypes), nil } -func (itf Selector) prepareFilter(filters Filters, instanceTypeInfo instancetypes.Details, availabilityZones []string, locationInstanceOfferings map[string]string) (*instancetypes.Details, error) { - instanceTypeName := *instanceTypeInfo.InstanceType +func (itf Selector) prepareFilter(ctx context.Context, filters Filters, instanceTypeInfo instancetypes.Details, availabilityZones []string, locationInstanceOfferings map[ec2types.InstanceType]string) (*instancetypes.Details, error) { + instanceTypeName := instanceTypeInfo.InstanceType isFpga := instanceTypeInfo.FpgaInfo != nil var instanceTypeHourlyPriceForFilter float64 // Price used to filter based on usage class var instanceTypeHourlyPriceOnDemand, instanceTypeHourlyPriceSpot *float64 // If prices are fetched, populate the fields irrespective of the price filters if itf.EC2Pricing.OnDemandCacheCount() > 0 { - price, err := itf.EC2Pricing.GetOnDemandInstanceTypeCost(instanceTypeName) + price, err := itf.EC2Pricing.GetOnDemandInstanceTypeCost(ctx, instanceTypeName) if err != nil { log.Printf("Could not retrieve instantaneous hourly on-demand price for instance type %s - %s\n", instanceTypeName, err) } else { @@ -267,8 +279,16 @@ func (itf Selector) prepareFilter(filters Filters, instanceTypeInfo instancetype instanceTypeInfo.OndemandPricePerHour = instanceTypeHourlyPriceOnDemand } } - if itf.EC2Pricing.SpotCacheCount() > 0 && contains(instanceTypeInfo.SupportedUsageClasses, "spot") { - price, err := itf.EC2Pricing.GetSpotInstanceTypeNDayAvgCost(instanceTypeName, availabilityZones, 30) + + isSpotUsageClass := false + for _, it := range instanceTypeInfo.SupportedUsageClasses { + if it == ec2types.UsageClassTypeSpot { + isSpotUsageClass = true + } + } + + if itf.EC2Pricing.SpotCacheCount() > 0 && isSpotUsageClass { + price, err := itf.EC2Pricing.GetSpotInstanceTypeNDayAvgCost(ctx, instanceTypeName, availabilityZones, 30) if err != nil { log.Printf("Could not retrieve 30 day avg hourly spot price for instance type %s\n", instanceTypeName) } else { @@ -279,12 +299,14 @@ func (itf Selector) prepareFilter(filters Filters, instanceTypeInfo instancetype if filters.PricePerHour != nil { // If price filter is present, prices should be already fetched // If prices are not fetched, filter should fail and the corresponding error is already printed - if filters.UsageClass != nil && *filters.UsageClass == "spot" && instanceTypeHourlyPriceSpot != nil { + if filters.UsageClass != nil && *filters.UsageClass == ec2types.UsageClassTypeSpot && instanceTypeHourlyPriceSpot != nil { instanceTypeHourlyPriceForFilter = *instanceTypeHourlyPriceSpot } else if instanceTypeHourlyPriceOnDemand != nil { instanceTypeHourlyPriceForFilter = *instanceTypeHourlyPriceOnDemand } } + eneaSupport := string(instanceTypeInfo.NetworkInfo.EnaSupport) + ebsOptimizedSupport := string(instanceTypeInfo.EbsInfo.EbsOptimizedSupport) // filterToInstanceSpecMappingPairs is a map of filter name [key] to filter pair [value]. // A filter pair includes user input filter value and instance spec value retrieved from DescribeInstanceTypes @@ -304,7 +326,7 @@ func (itf Selector) prepareFilter(filters Filters, instanceTypeInfo instancetype baremetal: {filters.BareMetal, instanceTypeInfo.BareMetal}, burstable: {filters.Burstable, instanceTypeInfo.BurstablePerformanceSupported}, fpga: {filters.Fpga, &isFpga}, - enaSupport: {filters.EnaSupport, supportSyntaxToBool(instanceTypeInfo.NetworkInfo.EnaSupport)}, + enaSupport: {filters.EnaSupport, supportSyntaxToBool(&eneaSupport)}, efaSupport: {filters.EfaSupport, instanceTypeInfo.NetworkInfo.EfaSupported}, vcpusToMemoryRatio: {filters.VCpusToMemoryRatio, calculateVCpusToMemoryRatio(instanceTypeInfo.VCpuInfo.DefaultVCpus, instanceTypeInfo.MemoryInfo.SizeInMiB)}, currentGeneration: {filters.CurrentGeneration, instanceTypeInfo.CurrentGeneration}, @@ -318,7 +340,7 @@ func (itf Selector) prepareFilter(filters Filters, instanceTypeInfo instancetype instanceStorageRange: {filters.InstanceStorageRange, getInstanceStorage(instanceTypeInfo.InstanceStorageInfo)}, diskType: {filters.DiskType, getDiskType(instanceTypeInfo.InstanceStorageInfo)}, nvme: {filters.NVME, getNVMESupport(instanceTypeInfo.InstanceStorageInfo, instanceTypeInfo.EbsInfo)}, - ebsOptimized: {filters.EBSOptimized, supportSyntaxToBool(instanceTypeInfo.EbsInfo.EbsOptimizedSupport)}, + ebsOptimized: {filters.EBSOptimized, supportSyntaxToBool(&ebsOptimizedSupport)}, diskEncryption: {filters.DiskEncryption, getDiskEncryptionSupport(instanceTypeInfo.InstanceStorageInfo, instanceTypeInfo.EbsInfo)}, ebsOptimizedBaselineBandwidth: {filters.EBSOptimizedBaselineBandwidth, getEBSOptimizedBaselineBandwidth(instanceTypeInfo.EbsInfo)}, ebsOptimizedBaselineThroughput: {filters.EBSOptimizedBaselineThroughput, getEBSOptimizedBaselineThroughput(instanceTypeInfo.EbsInfo)}, @@ -341,7 +363,7 @@ func (itf Selector) prepareFilter(filters Filters, instanceTypeInfo instancetype } var isInstanceSupported bool - isInstanceSupported, err := itf.executeFilters(filterToInstanceSpecMappingPairs, instanceTypeName) + isInstanceSupported, err := itf.executeFilters(ctx, filterToInstanceSpecMappingPairs, instanceTypeName) if err != nil { return nil, err } @@ -359,17 +381,17 @@ func sortInstanceTypeInfo(instanceTypeInfoSlice []*instancetypes.Details) []*ins sort.Slice(instanceTypeInfoSlice, func(i, j int) bool { iInstanceInfo := instanceTypeInfoSlice[i] jInstanceInfo := instanceTypeInfoSlice[j] - return strings.Compare(aws.StringValue(iInstanceInfo.InstanceType), aws.StringValue(jInstanceInfo.InstanceType)) <= 0 + return strings.Compare(string(iInstanceInfo.InstanceType), string(jInstanceInfo.InstanceType)) <= 0 }) return instanceTypeInfoSlice } // executeFilters accepts a mapping of filter name to filter pairs which are iterated through // to determine if the instance type matches the filter values. -func (itf Selector) executeFilters(filterToInstanceSpecMapping map[string]filterPair, instanceType string) (bool, error) { - verdict := make(chan bool, len(filterToInstanceSpecMapping) + 1) +func (itf Selector) executeFilters(ctx context.Context, filterToInstanceSpecMapping map[string]filterPair, instanceType ec2types.InstanceType) (bool, error) { + verdict := make(chan bool, len(filterToInstanceSpecMapping)+1) errs := make(chan error) - ctx, cancel := context.WithCancel(context.Background()) + ctx, cancel := context.WithCancel(ctx) defer cancel() var wg sync.WaitGroup for filterName, filter := range filterToInstanceSpecMapping { @@ -410,15 +432,16 @@ func (itf Selector) executeFilters(filterToInstanceSpecMapping map[string]filter } } -func exec(instanceType string, filterName string, filter filterPair) (bool, error) { +func exec(instanceType ec2types.InstanceType, filterName string, filter filterPair) (bool, error) { filterVal := filter.filterValue instanceSpec := filter.instanceSpec + filterValReflection := reflect.ValueOf(filterVal) // if filter is nil, user did not specify a filter, so skip evaluation - if reflect.ValueOf(filterVal).IsNil() { + if filterValReflection.IsNil() { return true, nil } instanceSpecType := reflect.ValueOf(instanceSpec).Type() - filterType := reflect.ValueOf(filterVal).Type() + filterType := filterValReflection.Type() filterDetailsMsg := fmt.Sprintf("filter (%s: %s => %s) corresponding to instance spec (%s => %s) for instance type %s", filterName, filterVal, filterType, instanceSpec, instanceSpecType, instanceType) invalidInstanceSpecTypeMsg := fmt.Sprintf("Unable to process for %s", filterDetailsMsg) @@ -459,6 +482,15 @@ func exec(instanceType string, filterName string, filter filterPair) (bool, erro default: return false, fmt.Errorf(invalidInstanceSpecTypeMsg) } + case *Int32RangeFilter: + switch iSpec := instanceSpec.(type) { + case *int32: + if !isSupportedWithRangeInt32(iSpec, filter) { + return false, nil + } + default: + return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + } case *Float64RangeFilter: switch iSpec := instanceSpec.(type) { case *float64: @@ -507,6 +539,60 @@ func exec(instanceType string, filterName string, filter filterPair) (bool, erro default: return false, fmt.Errorf(invalidInstanceSpecTypeMsg) } + case *ec2types.ArchitectureType: + switch iSpec := instanceSpec.(type) { + case []ec2types.ArchitectureType: + if !isSupportedArchitectureType(iSpec, filter) { + return false, nil + } + default: + return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + } + case *ec2types.UsageClassType: + switch iSpec := instanceSpec.(type) { + case []ec2types.UsageClassType: + if !isSupportedUsageClassType(iSpec, filter) { + return false, nil + } + default: + return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + } + case *CPUManufacturer: + switch iSpec := instanceSpec.(type) { + case CPUManufacturer: + if !isMatchingCpuArchitecture(iSpec, filter) { + return false, nil + } + default: + return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + } + case *ec2types.VirtualizationType: + switch iSpec := instanceSpec.(type) { + case []ec2types.VirtualizationType: + if !isSupportedVirtualizationType(iSpec, filter) { + return false, nil + } + default: + return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + } + case *ec2types.InstanceTypeHypervisor: + switch iSpec := instanceSpec.(type) { + case ec2types.InstanceTypeHypervisor: + if !isSupportedInstanceTypeHypervisorType(iSpec, filter) { + return false, nil + } + default: + return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + } + case *ec2types.RootDeviceType: + switch iSpec := instanceSpec.(type) { + case []ec2types.RootDeviceType: + if !isSupportedRootDeviceType(iSpec, filter) { + return false, nil + } + default: + return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + } case *[]string: switch iSpec := instanceSpec.(type) { case *string: @@ -532,41 +618,45 @@ func exec(instanceType string, filterName string, filter filterPair) (bool, erro // RetrieveInstanceTypesSupportedInLocations returns a map of instance type -> AZ or Region for all instance types supported in the intersected locations passed in // The location can be a zone-id (ie. use1-az1), a zone-name (us-east-1a), or a region name (us-east-1). // Note that zone names are not necessarily the same across accounts -func (itf Selector) RetrieveInstanceTypesSupportedInLocations(locations []string) (map[string]string, error) { +func (itf Selector) RetrieveInstanceTypesSupportedInLocations(ctx context.Context, locations []string) (map[ec2types.InstanceType]string, error) { if len(locations) == 0 { return nil, nil } - availableInstanceTypes := map[string]int{} + availableInstanceTypes := map[ec2types.InstanceType]int{} for _, location := range locations { + locationType, err := itf.getLocationType(ctx, location) + if err != nil { + return nil, err + } + instanceTypeOfferingsInput := &ec2.DescribeInstanceTypeOfferingsInput{ - Filters: []*ec2.Filter{ + LocationType: locationType, + Filters: []ec2types.Filter{ { Name: aws.String(locationFilterKey), - Values: []*string{aws.String(location)}, + Values: []string{location}, }, }, } - locationType, err := itf.getLocationType(location) - if err != nil { - return nil, err - } - instanceTypeOfferingsInput.SetLocationType(locationType) - err = itf.EC2.DescribeInstanceTypeOfferingsPages(instanceTypeOfferingsInput, func(page *ec2.DescribeInstanceTypeOfferingsOutput, lastPage bool) bool { - for _, instanceType := range page.InstanceTypeOfferings { - if i, ok := availableInstanceTypes[*instanceType.InstanceType]; !ok { - availableInstanceTypes[*instanceType.InstanceType] = 1 + p := ec2.NewDescribeInstanceTypeOfferingsPaginator(itf.EC2, instanceTypeOfferingsInput) + + for p.HasMorePages() { + instanceTypeOfferings, err := p.NextPage(ctx) + if err != nil { + return nil, fmt.Errorf("Encountered an error when describing instance type offerings: %w", err) + } + + for _, instanceType := range instanceTypeOfferings.InstanceTypeOfferings { + if i, ok := availableInstanceTypes[instanceType.InstanceType]; !ok { + availableInstanceTypes[instanceType.InstanceType] = 1 } else { - availableInstanceTypes[*instanceType.InstanceType] = i + 1 + availableInstanceTypes[instanceType.InstanceType] = i + 1 } } - return true - }) - if err != nil { - return nil, fmt.Errorf("Encountered an error when describing instance type offerings: %w", err) } } - availableInstanceTypesAllLocations := map[string]string{} + availableInstanceTypesAllLocations := map[ec2types.InstanceType]string{} for instanceType, locationsSupported := range availableInstanceTypes { if locationsSupported == len(locations) { availableInstanceTypesAllLocations[instanceType] = "" @@ -576,8 +666,8 @@ func (itf Selector) RetrieveInstanceTypesSupportedInLocations(locations []string return availableInstanceTypesAllLocations, nil } -func (itf Selector) getLocationType(location string) (string, error) { - azs, err := itf.EC2.DescribeAvailabilityZones(&ec2.DescribeAvailabilityZonesInput{}) +func (itf Selector) getLocationType(ctx context.Context, location string) (ec2types.LocationType, error) { + azs, err := itf.EC2.DescribeAvailabilityZones(ctx, &ec2.DescribeAvailabilityZonesInput{}) if err != nil { return "", err } @@ -593,7 +683,7 @@ func (itf Selector) getLocationType(location string) (string, error) { return "", fmt.Errorf("The location passed in (%s) is not a valid zone-id, zone-name, or region name", location) } -func isSupportedInLocation(instanceOfferings map[string]string, instanceType string) bool { +func isSupportedInLocation(instanceOfferings map[ec2types.InstanceType]string, instanceType ec2types.InstanceType) bool { if instanceOfferings == nil { return true } @@ -601,22 +691,16 @@ func isSupportedInLocation(instanceOfferings map[string]string, instanceType str return ok } -func isInDenyList(denyRegex *regexp.Regexp, instanceTypeName string) bool { +func isInDenyList(denyRegex *regexp.Regexp, instanceTypeName ec2types.InstanceType) bool { if denyRegex == nil { return false } - return denyRegex.MatchString(instanceTypeName) + return denyRegex.MatchString(string(instanceTypeName)) } -func isInAllowList(allowRegex *regexp.Regexp, instanceTypeName string) bool { +func isInAllowList(allowRegex *regexp.Regexp, instanceTypeName ec2types.InstanceType) bool { if allowRegex == nil { return true } - return allowRegex.MatchString(instanceTypeName) -} - -func userAgentWith(sess *session.Session) *session.Session { - userAgentHandler := request.MakeAddToUserAgentFreeFormHandler(fmt.Sprintf("%s-%s", sdkName, versionID)) - sess.Handlers.Build.PushBack(userAgentHandler) - return sess + return allowRegex.MatchString(string(instanceTypeName)) } diff --git a/pkg/selector/selector_test.go b/pkg/selector/selector_test.go index a270938d..034424dd 100644 --- a/pkg/selector/selector_test.go +++ b/pkg/selector/selector_test.go @@ -14,6 +14,7 @@ package selector_test import ( + "context" "encoding/json" "errors" "fmt" @@ -22,18 +23,18 @@ import ( "strconv" "testing" + "github.com/aws/amazon-ec2-instance-selector/v2/pkg/awsapi" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/ec2/ec2iface" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/config" + "github.com/aws/aws-sdk-go-v2/service/ec2" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) const ( - describeInstanceTypesPages = "DescribeInstanceTypesPages" describeInstanceTypes = "DescribeInstanceTypes" describeInstanceTypeOfferings = "DescribeInstanceTypeOfferings" describeAvailabilityZones = "DescribeAvailabilityZones" @@ -41,43 +42,42 @@ const ( ) // Mocking helpers - -type itFn = func(page *ec2.DescribeInstanceTypesOutput, lastPage bool) bool -type ioFn = func(page *ec2.DescribeInstanceTypeOfferingsOutput, lastPage bool) bool - type mockedEC2 struct { - ec2iface.EC2API - DescribeInstanceTypesPagesResp ec2.DescribeInstanceTypesOutput - DescribeInstanceTypesPagesErr error + awsapi.SelectorInterface DescribeInstanceTypesResp ec2.DescribeInstanceTypesOutput + DescribeInstanceTypesRespFn func(instanceType []ec2types.InstanceType) ec2.DescribeInstanceTypesOutput DescribeInstanceTypesErr error - DescribeInstanceTypeOfferingsRespFn func(zone string) *ec2.DescribeInstanceTypeOfferingsOutput + DescribeInstanceTypeOfferingsRespFn func(zone string) ec2.DescribeInstanceTypeOfferingsOutput DescribeInstanceTypeOfferingsResp ec2.DescribeInstanceTypeOfferingsOutput DescribeInstanceTypeOfferingsErr error DescribeAvailabilityZonesResp ec2.DescribeAvailabilityZonesOutput DescribeAvailabilityZonesErr error } -func (m mockedEC2) DescribeAvailabilityZones(input *ec2.DescribeAvailabilityZonesInput) (*ec2.DescribeAvailabilityZonesOutput, error) { +func (m mockedEC2) DescribeAvailabilityZones(ctx context.Context, input *ec2.DescribeAvailabilityZonesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeAvailabilityZonesOutput, error) { return &m.DescribeAvailabilityZonesResp, m.DescribeAvailabilityZonesErr } -func (m mockedEC2) DescribeInstanceTypes(input *ec2.DescribeInstanceTypesInput) (*ec2.DescribeInstanceTypesOutput, error) { - return &m.DescribeInstanceTypesResp, m.DescribeInstanceTypesErr -} +func (m mockedEC2) DescribeInstanceTypes(ctx context.Context, input *ec2.DescribeInstanceTypesInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceTypesOutput, error) { + var response ec2.DescribeInstanceTypesOutput + if m.DescribeInstanceTypesRespFn != nil { + response = m.DescribeInstanceTypesRespFn(input.InstanceTypes) + } else { + response = m.DescribeInstanceTypesResp + } -func (m mockedEC2) DescribeInstanceTypesPages(input *ec2.DescribeInstanceTypesInput, fn itFn) error { - fn(&m.DescribeInstanceTypesPagesResp, true) - return m.DescribeInstanceTypesPagesErr + return &response, m.DescribeInstanceTypesErr } -func (m mockedEC2) DescribeInstanceTypeOfferingsPages(input *ec2.DescribeInstanceTypeOfferingsInput, fn ioFn) error { +func (m mockedEC2) DescribeInstanceTypeOfferings(ctx context.Context, input *ec2.DescribeInstanceTypeOfferingsInput, optFns ...func(*ec2.Options)) (*ec2.DescribeInstanceTypeOfferingsOutput, error) { + var response ec2.DescribeInstanceTypeOfferingsOutput if m.DescribeInstanceTypeOfferingsRespFn != nil { - fn(m.DescribeInstanceTypeOfferingsRespFn(*input.Filters[0].Values[0]), true) + response = m.DescribeInstanceTypeOfferingsRespFn(input.Filters[0].Values[0]) } else { - fn(&m.DescribeInstanceTypeOfferingsResp, true) + response = m.DescribeInstanceTypeOfferingsResp } - return m.DescribeInstanceTypeOfferingsErr + + return &response, m.DescribeInstanceTypeOfferingsErr } func mockMultiRespDescribeInstanceTypesOfferings(t *testing.T, locationToFile map[string]string) mockedEC2 { @@ -93,9 +93,9 @@ func mockMultiRespDescribeInstanceTypesOfferings(t *testing.T, locationToFile ma locationToResp[zone] = ditoo } return mockedEC2{ - DescribeInstanceTypeOfferingsRespFn: func(input string) *ec2.DescribeInstanceTypeOfferingsOutput { + DescribeInstanceTypeOfferingsRespFn: func(input string) ec2.DescribeInstanceTypeOfferingsOutput { resp := locationToResp[input] - return &resp + return resp }, } } @@ -112,13 +112,6 @@ func setupMock(t *testing.T, api string, file string) mockedEC2 { return mockedEC2{ DescribeInstanceTypesResp: dito, } - case describeInstanceTypesPages: - dito := ec2.DescribeInstanceTypesOutput{} - err = json.Unmarshal(mockFile, &dito) - h.Assert(t, err == nil, "Error parsing mock json file contents"+mockFilename) - return mockedEC2{ - DescribeInstanceTypesPagesResp: dito, - } case describeInstanceTypeOfferings: ditoo := ec2.DescribeInstanceTypeOfferingsOutput{} err = json.Unmarshal(mockFile, &ditoo) @@ -150,61 +143,67 @@ func getSelector(ec2Mock mockedEC2) selector.Selector { // Tests func TestNew(t *testing.T) { - itf := selector.New(session.Must(session.NewSession())) + ctx := context.Background() + cfg, _ := config.LoadDefaultConfig(ctx) + itf, _ := selector.New(ctx, cfg) h.Assert(t, itf != nil, "selector instance created without error") } func TestFilterVerbose(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 2, UpperBound: 2}, } - results, err := itf.FilterVerbose(filters) + ctx := context.Background() + results, err := itf.FilterVerbose(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, "Should only return 1 instance type with 2 vcpus but actually returned "+strconv.Itoa(len(results))) - h.Assert(t, *results[0].InstanceType == "t3.micro", "Should return t3.micro, got %s instead", results[0].InstanceType) + h.Assert(t, results[0].InstanceType == "t3.micro", "Should return t3.micro, got %s instead", results[0].InstanceType) } func TestFilterVerbose_NoResults(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 4, UpperBound: 4}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 4, UpperBound: 4}, } - results, err := itf.FilterVerbose(filters) + ctx := context.Background() + results, err := itf.FilterVerbose(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 0, "Should return 0 instance type with 4 vcpus") } func TestFilterVerbose_Failure(t *testing.T) { - itf := getSelector(mockedEC2{DescribeInstanceTypesPagesErr: errors.New("error")}) + ctx := context.Background() + itf := getSelector(mockedEC2{DescribeInstanceTypesErr: errors.New("error")}) filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 4, UpperBound: 4}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 4, UpperBound: 4}, } - results, err := itf.FilterVerbose(filters) + results, err := itf.FilterVerbose(ctx, filters) h.Assert(t, results == nil, "Results should be nil") h.Assert(t, err != nil, "An error should be returned") } func TestFilterVerbose_AZFilteredIn(t *testing.T) { ec2Mock := mockedEC2{ - DescribeInstanceTypesPagesResp: setupMock(t, describeInstanceTypesPages, "t3_micro.json").DescribeInstanceTypesPagesResp, + DescribeInstanceTypesResp: setupMock(t, describeInstanceTypes, "t3_micro.json").DescribeInstanceTypesResp, DescribeInstanceTypeOfferingsResp: setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json").DescribeInstanceTypeOfferingsResp, DescribeAvailabilityZonesResp: setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp, } itf := getSelector(ec2Mock) filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 2, UpperBound: 2}, AvailabilityZones: &[]string{"us-east-2a"}, } - results, err := itf.FilterVerbose(filters) + ctx := context.Background() + results, err := itf.FilterVerbose(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, "Should only return 1 instance type with 2 vcpus but actually returned "+strconv.Itoa(len(results))) - h.Assert(t, *results[0].InstanceType == "t3.micro", "Should return t3.micro, got %s instead", results[0].InstanceType) + h.Assert(t, results[0].InstanceType == "t3.micro", "Should return t3.micro, got %s instead", results[0].InstanceType) } func TestFilterVerbose_AZFilteredOut(t *testing.T) { ec2Mock := mockedEC2{ - DescribeInstanceTypesPagesResp: setupMock(t, describeInstanceTypesPages, "t3_micro.json").DescribeInstanceTypesPagesResp, + DescribeInstanceTypesResp: setupMock(t, describeInstanceTypes, "t3_micro.json").DescribeInstanceTypesResp, DescribeInstanceTypeOfferingsResp: setupMock(t, describeInstanceTypeOfferings, "us-east-2a_only_c5d12x.json").DescribeInstanceTypeOfferingsResp, DescribeAvailabilityZonesResp: setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp, } @@ -212,7 +211,8 @@ func TestFilterVerbose_AZFilteredOut(t *testing.T) { filters := selector.Filters{ AvailabilityZones: &[]string{"us-east-2a"}, } - results, err := itf.FilterVerbose(filters) + ctx := context.Background() + results, err := itf.FilterVerbose(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 0, "Should return 0 instance types in us-east-2a but actually returned "+strconv.Itoa(len(results))) } @@ -220,88 +220,96 @@ func TestFilterVerbose_AZFilteredOut(t *testing.T) { func TestFilterVerboseAZ_FilteredErr(t *testing.T) { itf := getSelector(mockedEC2{}) filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 2, UpperBound: 2}, AvailabilityZones: &[]string{"blah"}, } - _, err := itf.FilterVerbose(filters) + ctx := context.Background() + _, err := itf.FilterVerbose(ctx, filters) h.Assert(t, err != nil, "Should error since bad zone was passed in") } func TestFilterVerbose_Gpus(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro_and_p3_16xl.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro_and_p3_16xl.json")) gpuMemory, err := bytequantity.ParseToByteQuantity("128g") h.Ok(t, err) filters := selector.Filters{ - GpusRange: &selector.IntRangeFilter{LowerBound: 8, UpperBound: 8}, + GpusRange: &selector.Int32RangeFilter{LowerBound: 8, UpperBound: 8}, GpuMemoryRange: &selector.ByteQuantityRangeFilter{ LowerBound: gpuMemory, UpperBound: gpuMemory, }, } - results, err := itf.FilterVerbose(filters) + ctx := context.Background() + results, err := itf.FilterVerbose(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, "Should only return 1 instance type with 2 vcpus but actually returned "+strconv.Itoa(len(results))) - h.Assert(t, *results[0].InstanceType == "p3.16xlarge", "Should return p3.16xlarge, got %s instead", *results[0].InstanceType) + h.Assert(t, results[0].InstanceType == "p3.16xlarge", "Should return p3.16xlarge, got %s instead", results[0].InstanceType) } func TestFilter(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 2, UpperBound: 2}, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, "Should only return 1 instance type with 2 vcpus") h.Assert(t, results[0] == "t3.micro", "Should return t3.micro, got %s instead", results[0]) } func TestFilter_MoreFilters(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) + X8664Architecture := ec2types.ArchitectureTypeX8664 + NitroInstanceType := ec2types.InstanceTypeHypervisorNitro filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 2, UpperBound: 2}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 2, UpperBound: 2}, BareMetal: aws.Bool(false), - CPUArchitecture: aws.String("x86_64"), - Hypervisor: aws.String("nitro"), + CPUArchitecture: &X8664Architecture, + Hypervisor: &NitroInstanceType, EnaSupport: aws.Bool(true), } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, "Should only return 1 instance type with 2 vcpus") h.Assert(t, results[0] == "t3.micro", "Should return t3.micro, got %s instead", results[0]) } func TestFilter_TruncateToMaxResults(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "25_instances.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "25_instances.json")) filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 0, UpperBound: 100}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 0, UpperBound: 100}, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) > 1, "Should return > 1 instance types since max results is not set") filters = selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 0, UpperBound: 100}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 0, UpperBound: 100}, MaxResults: aws.Int(1), } - results, err = itf.Filter(filters) + results, err = itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, "Should return 1 instance types since max results is set") filters = selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 0, UpperBound: 100}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 0, UpperBound: 100}, MaxResults: aws.Int(30), } - results, err = itf.Filter(filters) + results, err = itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 25, fmt.Sprintf("Should return 25 instance types since max results is set to 30 but only %d are returned in total", len(results))) } func TestFilter_Failure(t *testing.T) { - itf := getSelector(mockedEC2{DescribeInstanceTypesPagesErr: errors.New("error")}) + itf := getSelector(mockedEC2{DescribeInstanceTypesErr: errors.New("error")}) filters := selector.Filters{ - VCpusRange: &selector.IntRangeFilter{LowerBound: 4, UpperBound: 4}, + VCpusRange: &selector.Int32RangeFilter{LowerBound: 4, UpperBound: 4}, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Assert(t, results == nil, "Results should be nil") h.Assert(t, err != nil, "An error should be returned") } @@ -310,7 +318,8 @@ func TestRetrieveInstanceTypesSupportedInAZ_WithZoneName(t *testing.T) { ec2Mock := setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json") ec2Mock.DescribeAvailabilityZonesResp = setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp itf := getSelector(ec2Mock) - results, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"us-east-2a"}) + ctx := context.Background() + results, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"us-east-2a"}) h.Ok(t, err) h.Assert(t, len(results) == 228, "Should return 228 entries in us-east-2a golden file w/ no resource filters applied") } @@ -319,7 +328,8 @@ func TestRetrieveInstanceTypesSupportedInAZ_WithZoneID(t *testing.T) { ec2Mock := setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json") ec2Mock.DescribeAvailabilityZonesResp = setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp itf := getSelector(ec2Mock) - results, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"use2-az1"}) + ctx := context.Background() + results, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"use2-az1"}) h.Ok(t, err) h.Assert(t, len(results) == 228, "Should return 228 entries in use2-az2 golden file w/ no resource filter applied") } @@ -328,7 +338,8 @@ func TestRetrieveInstanceTypesSupportedInAZ_WithRegion(t *testing.T) { ec2Mock := setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json") ec2Mock.DescribeAvailabilityZonesResp = setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp itf := getSelector(ec2Mock) - results, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"us-east-2"}) + ctx := context.Background() + results, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"us-east-2"}) h.Ok(t, err) h.Assert(t, len(results) == 228, "Should return 228 entries in us-east-2 golden file w/ no resource filter applied") } @@ -337,7 +348,8 @@ func TestRetrieveInstanceTypesSupportedInAZ_WithBadZone(t *testing.T) { ec2Mock := setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json") ec2Mock.DescribeAvailabilityZonesResp = setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp itf := getSelector(ec2Mock) - results, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"blah"}) + ctx := context.Background() + results, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"blah"}) h.Assert(t, err != nil, "Should return an error since a bad zone was passed in") h.Assert(t, results == nil, "Should return nil results due to error") } @@ -348,7 +360,8 @@ func TestRetrieveInstanceTypesSupportedInAZ_Error(t *testing.T) { DescribeAvailabilityZonesResp: setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp, } itf := getSelector(ec2Mock) - results, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"us-east-2a"}) + ctx := context.Background() + results, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"us-east-2a"}) h.Assert(t, err != nil, "Should return an error since ec2 api mock is configured to return an error") h.Assert(t, results == nil, "Should return nil results due to error") } @@ -359,7 +372,8 @@ func TestAggregateFilterTransform(t *testing.T) { filters := selector.Filters{ InstanceTypeBase: &g22Xlarge, } - filters, err := itf.AggregateFilterTransform(filters) + ctx := context.Background() + filters, err := itf.AggregateFilterTransform(ctx, filters) h.Ok(t, err) h.Assert(t, filters.GpusRange != nil, "g2.2Xlarge as a base instance type should filter out non-GPU instances") h.Assert(t, *filters.BareMetal == false, "g2.2Xlarge as a base instance type should filter out bare metal instances") @@ -373,14 +387,20 @@ func TestAggregateFilterTransform_InvalidInstanceType(t *testing.T) { filters := selector.Filters{ InstanceTypeBase: &t3Micro, } - _, err := itf.AggregateFilterTransform(filters) + ctx := context.Background() + _, err := itf.AggregateFilterTransform(ctx, filters) h.Nok(t, err) } func TestFilter_InstanceTypeBase(t *testing.T) { ec2Mock := mockedEC2{ - DescribeInstanceTypesResp: setupMock(t, describeInstanceTypes, "c4_large.json").DescribeInstanceTypesResp, - DescribeInstanceTypesPagesResp: setupMock(t, describeInstanceTypesPages, "25_instances.json").DescribeInstanceTypesPagesResp, + DescribeInstanceTypesRespFn: func(instanceTypes []ec2types.InstanceType) ec2.DescribeInstanceTypesOutput { + if len(instanceTypes) == 1 { + return setupMock(t, describeInstanceTypes, "c4_large.json").DescribeInstanceTypesResp + } else { + return setupMock(t, describeInstanceTypes, "25_instances.json").DescribeInstanceTypesResp + } + }, DescribeInstanceTypeOfferingsResp: setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json").DescribeInstanceTypeOfferingsResp, } itf := getSelector(ec2Mock) @@ -388,7 +408,8 @@ func TestFilter_InstanceTypeBase(t *testing.T) { filters := selector.Filters{ InstanceTypeBase: &c4Large, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 3, "c4.large should return 3 similar instance types") } @@ -400,12 +421,13 @@ func TestRetrieveInstanceTypesSupportedInAZs_Intersection(t *testing.T) { }) ec2Mock.DescribeAvailabilityZonesResp = setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp itf := getSelector(ec2Mock) - results, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"us-east-2a", "us-east-2b"}) + ctx := context.Background() + results, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"us-east-2a", "us-east-2b"}) h.Ok(t, err) h.Assert(t, len(results) == 3, "Should return instance types that are included in both files") // Check reversed zones to ensure order does not matter - results, err = itf.RetrieveInstanceTypesSupportedInLocations([]string{"us-east-2b", "us-east-2a"}) + results, err = itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"us-east-2b", "us-east-2a"}) h.Ok(t, err) h.Assert(t, len(results) == 3, "Should return instance types that are included in both files when passed in reverse order") } @@ -416,7 +438,8 @@ func TestRetrieveInstanceTypesSupportedInAZs_Duplicates(t *testing.T) { DescribeAvailabilityZonesResp: setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp, } itf := getSelector(ec2Mock) - results, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"us-east-2b", "us-east-2b"}) + ctx := context.Background() + results, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"us-east-2b", "us-east-2b"}) h.Ok(t, err) h.Assert(t, len(results) == 3, "Should return instance types that are included in both files") } @@ -427,19 +450,21 @@ func TestRetrieveInstanceTypesSupportedInAZs_GoodAndBadZone(t *testing.T) { DescribeAvailabilityZonesResp: setupMock(t, describeAvailabilityZones, "us-east-2.json").DescribeAvailabilityZonesResp, } itf := getSelector(ec2Mock) - _, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"us-weast-2k", "us-east-2a"}) + ctx := context.Background() + _, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"us-weast-2k", "us-east-2a"}) h.Nok(t, err) } func TestRetrieveInstanceTypesSupportedInAZs_DescribeAZErr(t *testing.T) { itf := getSelector(mockedEC2{DescribeAvailabilityZonesErr: fmt.Errorf("error")}) - _, err := itf.RetrieveInstanceTypesSupportedInLocations([]string{"us-east-2a"}) + ctx := context.Background() + _, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, []string{"us-east-2a"}) h.Nok(t, err) } func TestFilter_AllowList(t *testing.T) { ec2Mock := mockedEC2{ - DescribeInstanceTypesPagesResp: setupMock(t, describeInstanceTypesPages, "25_instances.json").DescribeInstanceTypesPagesResp, + DescribeInstanceTypesResp: setupMock(t, describeInstanceTypes, "25_instances.json").DescribeInstanceTypesResp, DescribeInstanceTypeOfferingsResp: setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json").DescribeInstanceTypeOfferingsResp, } itf := getSelector(ec2Mock) @@ -448,14 +473,15 @@ func TestFilter_AllowList(t *testing.T) { filters := selector.Filters{ AllowList: allowRegex, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, "Allow List Regex: 'c4.large' should return 1 instance type") } func TestFilter_DenyList(t *testing.T) { ec2Mock := mockedEC2{ - DescribeInstanceTypesPagesResp: setupMock(t, describeInstanceTypesPages, "25_instances.json").DescribeInstanceTypesPagesResp, + DescribeInstanceTypesResp: setupMock(t, describeInstanceTypes, "25_instances.json").DescribeInstanceTypesResp, DescribeInstanceTypeOfferingsResp: setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json").DescribeInstanceTypeOfferingsResp, } itf := getSelector(ec2Mock) @@ -464,14 +490,15 @@ func TestFilter_DenyList(t *testing.T) { filters := selector.Filters{ DenyList: denyRegex, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 24, "Deny List Regex: 'c4.large' should return 24 instance type matching regex but returned %d", len(results)) } func TestFilter_AllowAndDenyList(t *testing.T) { ec2Mock := mockedEC2{ - DescribeInstanceTypesPagesResp: setupMock(t, describeInstanceTypesPages, "25_instances.json").DescribeInstanceTypesPagesResp, + DescribeInstanceTypesResp: setupMock(t, describeInstanceTypes, "25_instances.json").DescribeInstanceTypesResp, DescribeInstanceTypeOfferingsResp: setupMock(t, describeInstanceTypeOfferings, "us-east-2a.json").DescribeInstanceTypeOfferingsResp, } itf := getSelector(ec2Mock) @@ -483,35 +510,41 @@ func TestFilter_AllowAndDenyList(t *testing.T) { AllowList: allowRegex, DenyList: denyRegex, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 4, "Allow/Deny List Regex: 'c4.large' should return 4 instance types matching the regex but returned %d", len(results)) } func TestFilter_X8664_AMD64(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) + ArchitectureType := selector.ArchitectureTypeAMD64 filters := selector.Filters{ - CPUArchitecture: aws.String("amd64"), + CPUArchitecture: &ArchitectureType, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, "Should only return 1 instance type with x86_64/amd64 cpu architecture") h.Assert(t, results[0] == "t3.micro", "Should return t3.micro, got %s instead", results[0]) } func TestFilter_VirtType_PV(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "pv_instances.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "pv_instances.json")) + pvType := selector.VirtualizationTypePv filters := selector.Filters{ - VirtualizationType: aws.String("pv"), + VirtualizationType: &pvType, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) > 0, "Should return at least 1 instance type when filtering with VirtualizationType: pv") + paravirtualType := ec2types.VirtualizationTypeParavirtual filters = selector.Filters{ - VirtualizationType: aws.String("paravirtual"), + VirtualizationType: ¶virtualType, } - results, err = itf.Filter(filters) + results, err = itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) > 0, "Should return at least 1 instance type when filtering with VirtualizationType: paravirtual") } @@ -527,19 +560,19 @@ type ec2PricingMock struct { spotCacheCount int } -func (p *ec2PricingMock) GetOnDemandInstanceTypeCost(instanceType string) (float64, error) { +func (p *ec2PricingMock) GetOnDemandInstanceTypeCost(ctx context.Context, instanceType ec2types.InstanceType) (float64, error) { return p.GetOndemandInstanceTypeCostResp, p.GetOndemandInstanceTypeCostErr } -func (p *ec2PricingMock) GetSpotInstanceTypeNDayAvgCost(instanceType string, availabilityZones []string, days int) (float64, error) { +func (p *ec2PricingMock) GetSpotInstanceTypeNDayAvgCost(ctx context.Context, instanceType ec2types.InstanceType, availabilityZones []string, days int) (float64, error) { return p.GetSpotInstanceTypeNDayAvgCostResp, p.GetSpotInstanceTypeNDayAvgCostErr } -func (p *ec2PricingMock) RefreshOnDemandCache() error { +func (p *ec2PricingMock) RefreshOnDemandCache(ctx context.Context) error { return p.RefreshOnDemandCacheErr } -func (p *ec2PricingMock) RefreshSpotCache(days int) error { +func (p *ec2PricingMock) RefreshSpotCache(ctx context.Context, days int) error { return p.RefreshSpotCacheErr } @@ -556,7 +589,7 @@ func (p *ec2PricingMock) Save() error { } func TestFilter_PricePerHour(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) itf.EC2Pricing = &ec2PricingMock{ GetOndemandInstanceTypeCostResp: 0.0104, onDemandCacheCount: 1, @@ -567,13 +600,14 @@ func TestFilter_PricePerHour(t *testing.T) { UpperBound: 0.0104, }, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, fmt.Sprintf("Should return 1 instance type; got %d", len(results))) } func TestFilter_PricePerHour_NoResults(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) itf.EC2Pricing = &ec2PricingMock{ GetOndemandInstanceTypeCostResp: 0.0104, onDemandCacheCount: 1, @@ -584,43 +618,48 @@ func TestFilter_PricePerHour_NoResults(t *testing.T) { UpperBound: 0.0105, }, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 0, "Should return 0 instance types") } func TestFilter_PricePerHour_OD(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) itf.EC2Pricing = &ec2PricingMock{ GetOndemandInstanceTypeCostResp: 0.0104, onDemandCacheCount: 1, } + onDemandUsage := ec2types.UsageClassTypeOnDemand filters := selector.Filters{ PricePerHour: &selector.Float64RangeFilter{ LowerBound: 0.0104, UpperBound: 0.0104, }, - UsageClass: aws.String("on-demand"), + UsageClass: &onDemandUsage, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, fmt.Sprintf("Should return 1 instance type; got %d", len(results))) } func TestFilter_PricePerHour_Spot(t *testing.T) { - itf := getSelector(setupMock(t, describeInstanceTypesPages, "t3_micro.json")) + itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) itf.EC2Pricing = &ec2PricingMock{ GetSpotInstanceTypeNDayAvgCostResp: 0.0104, spotCacheCount: 1, } + spotUsage := ec2types.UsageClassTypeSpot filters := selector.Filters{ PricePerHour: &selector.Float64RangeFilter{ LowerBound: 0.0104, UpperBound: 0.0104, }, - UsageClass: aws.String("spot"), + UsageClass: &spotUsage, } - results, err := itf.Filter(filters) + ctx := context.Background() + results, err := itf.Filter(ctx, filters) h.Ok(t, err) h.Assert(t, len(results) == 1, fmt.Sprintf("Should return 1 instance type; got %d", len(results))) } diff --git a/pkg/selector/services_test.go b/pkg/selector/services_test.go index 70a34311..de14f9ea 100644 --- a/pkg/selector/services_test.go +++ b/pkg/selector/services_test.go @@ -18,7 +18,7 @@ import ( "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go-v2/aws" ) // Tests diff --git a/pkg/selector/types.go b/pkg/selector/types.go index 95a634d6..60395ebc 100644 --- a/pkg/selector/types.go +++ b/pkg/selector/types.go @@ -15,12 +15,13 @@ package selector import ( "encoding/json" + "github.com/aws/amazon-ec2-instance-selector/v2/pkg/awsapi" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "regexp" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/aws-sdk-go/service/ec2/ec2iface" ) // InstanceTypesOutput can be implemented to provide custom output to instance type results @@ -39,7 +40,7 @@ func (fn InstanceTypesOutputFn) Output(instanceTypes []*instancetypes.Details) [ // Selector is used to filter instance type resource specs type Selector struct { - EC2 ec2iface.EC2API + EC2 awsapi.SelectorInterface EC2Pricing ec2pricing.EC2PricingIface InstanceTypesProvider *instancetypes.Provider ServiceRegistry ServiceRegistry @@ -52,6 +53,13 @@ type IntRangeFilter struct { LowerBound int } +// Int32RangeFilter holds an upper and lower bound int +// The lower and upper bound are used to range filter resource specs +type Int32RangeFilter struct { + UpperBound int32 + LowerBound int32 +} + // Uint64RangeFilter holds an upper and lower bound uint64 // The lower and upper bound are used to range filter resource specs type Uint64RangeFilter struct { @@ -122,11 +130,10 @@ type Filters struct { FreeTier *bool // CPUArchitecture of the EC2 instance type - // Possible values are: x86_64/amd64 or arm64 - CPUArchitecture *string + CPUArchitecture *ec2types.ArchitectureType // CPUManufacturer is used to filter instance types with a specific CPU manufacturer - CPUManufacturer *string + CPUManufacturer *CPUManufacturer // CurrentGeneration returns the latest generation of instance types CurrentGeneration *bool @@ -141,7 +148,7 @@ type Filters struct { Fpga *bool // GpusRange filter is a range of acceptable GPU count available to an EC2 instance type - GpusRange *IntRangeFilter + GpusRange *Int32RangeFilter // GpuMemoryRange filter is a range of acceptable GPU memory in Gibibytes (GiB) available to an EC2 instance type in aggreagte across all GPUs. GpuMemoryRange *ByteQuantityRangeFilter @@ -167,7 +174,7 @@ type Filters struct { // Hypervisor is used to return only a specific hypervisor backed instance type // Possibly values are: xen or nitro - Hypervisor *string + Hypervisor *ec2types.InstanceTypeHypervisor // MaxResults is the maximum number of instance types to return that match the filter criteria MaxResults *int @@ -176,7 +183,7 @@ type Filters struct { MemoryRange *ByteQuantityRangeFilter // NetworkInterfaces filter is a range of the number of ENI attachments an instance type can support - NetworkInterfaces *IntRangeFilter + NetworkInterfaces *Int32RangeFilter // NetworkPerformance filter is a range of network bandwidth an instance type can support NetworkPerformance *IntRangeFilter @@ -199,14 +206,14 @@ type Filters struct { // RootDeviceType is the backing device of the root storage volume // Possible values are: instance-store or ebs - RootDeviceType *string + RootDeviceType *ec2types.RootDeviceType // UsageClass of the instance EC2 instance type // Possible values are: spot or on-demand - UsageClass *string + UsageClass *ec2types.UsageClassType // VCpusRange filter is a range of acceptable VCpus for the instance type - VCpusRange *IntRangeFilter + VCpusRange *Int32RangeFilter // VcpusToMemoryRatio is a ratio of vcpus to memory expressed as a floating point VCpusToMemoryRatio *float64 @@ -232,7 +239,7 @@ type Filters struct { InstanceTypes *[]string // VirtualizationType is used to return instance types that match either hvm or pv virtualization types - VirtualizationType *string + VirtualizationType *ec2types.VirtualizationType // PricePerHour is used to return instance types that are equal to or cheaper than the specified price PricePerHour *Float64RangeFilter @@ -265,3 +272,33 @@ type Filters struct { // DedicatedHosts filters on instance types that support dedicated hosts tenancy DedicatedHosts *bool } + +type CPUManufacturer string + +// Enum values for CPUManufacturer +const ( + CPUManufacturerAWS CPUManufacturer = "aws" + CPUManufacturerAMD CPUManufacturer = "amd" + CPUManufacturerIntel CPUManufacturer = "intel" +) + +// Values returns all known values for CPUManufacturer. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (CPUManufacturer) Values() []CPUManufacturer { + return []CPUManufacturer{ + "aws", + "amd", + "intel", + } +} + +// ArchitectureTypeAMD64 is a legacy type we support for b/c that isn't in the API +const ( + ArchitectureTypeAMD64 ec2types.ArchitectureType = "amd64" +) + +// ArchitectureTypeAMD64 is a legacy type we support for b/c that isn't in the API +const ( + VirtualizationTypePv ec2types.VirtualizationType = "pv" +) diff --git a/pkg/selector/types_test.go b/pkg/selector/types_test.go index 5ad35a2e..3e115887 100644 --- a/pkg/selector/types_test.go +++ b/pkg/selector/types_test.go @@ -20,12 +20,13 @@ import ( "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) // Tests func TestMarshalIndent(t *testing.T) { - cpuArch := "x86_64" + cpuArch := ec2types.ArchitectureTypeX8664 allowRegex := "^abc$" denyRegex := "^zyx$" diff --git a/pkg/sorter/sorter.go b/pkg/sorter/sorter.go index 829a74ca..311145b0 100644 --- a/pkg/sorter/sorter.go +++ b/pkg/sorter/sorter.go @@ -21,7 +21,6 @@ import ( "strings" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/aws-sdk-go/aws" "github.com/oliveagle/jsonpath" ) @@ -349,34 +348,34 @@ func (s *sorter) instanceTypes() []*instancetypes.Details { // helper functions for special sorting fields // getTotalGpusCount calculates the number of gpus in the given instance type -func getTotalGpusCount(instanceType *instancetypes.Details) *int64 { +func getTotalGpusCount(instanceType *instancetypes.Details) *int32 { gpusInfo := instanceType.GpuInfo if gpusInfo == nil { return nil } - total := aws.Int64(0) + total := int32(0) for _, gpu := range gpusInfo.Gpus { - total = aws.Int64(*total + *gpu.Count) + total = total + *gpu.Count } - return total + return &total } // getTotalAcceleratorsCount calculates the total number of inference accelerators // in the given instance type -func getTotalAcceleratorsCount(instanceType *instancetypes.Details) *int64 { +func getTotalAcceleratorsCount(instanceType *instancetypes.Details) *int32 { acceleratorInfo := instanceType.InferenceAcceleratorInfo if acceleratorInfo == nil { return nil } - total := aws.Int64(0) + total := int32(0) for _, accel := range acceleratorInfo.Accelerators { - total = aws.Int64(*total + *accel.Count) + total = total + *accel.Count } - return total + return &total } diff --git a/pkg/sorter/sorter_test.go b/pkg/sorter/sorter_test.go index 776cf85c..75e5c38b 100644 --- a/pkg/sorter/sorter_test.go +++ b/pkg/sorter/sorter_test.go @@ -59,7 +59,7 @@ func checkSortResults(instanceTypes []*instancetypes.Details, expectedResult []s actualName := instanceTypes[i].InstanceTypeInfo.InstanceType expectedName := expectedResult[i] - if actualName == nil || *actualName != expectedName { + if string(actualName) != expectedName { return false } } diff --git a/test/static/DescribeInstanceTypesPages/g2_2xlarge_group.json b/test/static/DescribeInstanceTypes/g2_2xlarge_group.json similarity index 100% rename from test/static/DescribeInstanceTypesPages/g2_2xlarge_group.json rename to test/static/DescribeInstanceTypes/g2_2xlarge_group.json diff --git a/test/static/DescribeInstanceTypesPages/pv_instances.json b/test/static/DescribeInstanceTypes/pv_instances.json similarity index 100% rename from test/static/DescribeInstanceTypesPages/pv_instances.json rename to test/static/DescribeInstanceTypes/pv_instances.json diff --git a/test/static/DescribeInstanceTypesPages/25_instances.json b/test/static/DescribeInstanceTypesPages/25_instances.json deleted file mode 100644 index 45ca66a8..00000000 --- a/test/static/DescribeInstanceTypesPages/25_instances.json +++ /dev/null @@ -1,1736 +0,0 @@ -{ - "InstanceTypes": [ - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "a1.2xlarge", - "MemoryInfo": { - "SizeInMiB": 16384 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 15, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "arm64" - ], - "SustainedClockSpeedInGhz": 2.3 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": 8, - "DefaultThreadsPerCore": 1, - "DefaultVCpus": 8, - "ValidCores": [ - 8 - ], - "ValidThreadsPerCore": [ - 1 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "a1.4xlarge", - "MemoryInfo": { - "SizeInMiB": 32768 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "arm64" - ], - "SustainedClockSpeedInGhz": 2.3 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": 16, - "DefaultThreadsPerCore": 1, - "DefaultVCpus": 16, - "ValidCores": [ - 16 - ], - "ValidThreadsPerCore": [ - 1 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "a1.large", - "MemoryInfo": { - "SizeInMiB": 4096 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 10, - "Ipv6AddressesPerInterface": 10, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 3, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "arm64" - ], - "SustainedClockSpeedInGhz": 2.3 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": 2, - "DefaultThreadsPerCore": 1, - "DefaultVCpus": 2, - "ValidCores": [ - 2 - ], - "ValidThreadsPerCore": [ - 1 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "a1.medium", - "MemoryInfo": { - "SizeInMiB": 2048 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 4, - "Ipv6AddressesPerInterface": 4, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 2, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "arm64" - ], - "SustainedClockSpeedInGhz": 2.3 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": 1, - "DefaultThreadsPerCore": 1, - "DefaultVCpus": 1, - "ValidCores": [ - 1 - ], - "ValidThreadsPerCore": [ - 1 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": true, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": null, - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "a1.metal", - "MemoryInfo": { - "SizeInMiB": 32768 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "arm64" - ], - "SustainedClockSpeedInGhz": 2.3 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": null, - "DefaultThreadsPerCore": null, - "DefaultVCpus": 16, - "ValidCores": null, - "ValidThreadsPerCore": null - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "a1.xlarge", - "MemoryInfo": { - "SizeInMiB": 8192 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 15, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "arm64" - ], - "SustainedClockSpeedInGhz": 2.3 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": 4, - "DefaultThreadsPerCore": 1, - "DefaultVCpus": 4, - "ValidCores": [ - 4 - ], - "ValidThreadsPerCore": [ - 1 - ] - } - }, - { - "AutoRecoverySupported": false, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": false, - "DedicatedHostsSupported": false, - "EbsInfo": { - "EbsOptimizedSupport": "unsupported", - "EncryptionSupport": "unsupported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": { - "Disks": [ - { - "Count": 1, - "SizeInGB": 350, - "Type": "hdd" - } - ], - "TotalSizeInGB": 350 - }, - "InstanceStorageSupported": true, - "InstanceType": "c1.medium", - "MemoryInfo": { - "SizeInMiB": 1740 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 6, - "Ipv6AddressesPerInterface": 0, - "Ipv6Supported": false, - "MaximumNetworkInterfaces": 2, - "NetworkPerformance": "Moderate" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "i386", - "x86_64" - ], - "SustainedClockSpeedInGhz": null - }, - "SupportedRootDeviceTypes": [ - "ebs", - "instance-store" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": 2, - "DefaultThreadsPerCore": 1, - "DefaultVCpus": 2, - "ValidCores": [ - 1, - 2 - ], - "ValidThreadsPerCore": [ - 1 - ] - } - }, - { - "AutoRecoverySupported": false, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": false, - "DedicatedHostsSupported": false, - "EbsInfo": { - "EbsOptimizedSupport": "supported", - "EncryptionSupport": "unsupported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": { - "Disks": [ - { - "Count": 4, - "SizeInGB": 420, - "Type": "hdd" - } - ], - "TotalSizeInGB": 1680 - }, - "InstanceStorageSupported": true, - "InstanceType": "c1.xlarge", - "MemoryInfo": { - "SizeInMiB": 7168 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 0, - "Ipv6Supported": false, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "High" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": null - }, - "SupportedRootDeviceTypes": [ - "ebs", - "instance-store" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": 8, - "DefaultThreadsPerCore": 1, - "DefaultVCpus": 8, - "ValidCores": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8 - ], - "ValidThreadsPerCore": [ - 1 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": false, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "supported", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": { - "Disks": [ - { - "Count": 2, - "SizeInGB": 80, - "Type": "ssd" - } - ], - "TotalSizeInGB": 160 - }, - "InstanceStorageSupported": true, - "InstanceType": "c3.2xlarge", - "MemoryInfo": { - "SizeInMiB": 15360 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 15, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "High" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.8 - }, - "SupportedRootDeviceTypes": [ - "ebs", - "instance-store" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 4, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 8, - "ValidCores": [ - 1, - 2, - 3, - 4 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": false, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "supported", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": { - "Disks": [ - { - "Count": 2, - "SizeInGB": 160, - "Type": "ssd" - } - ], - "TotalSizeInGB": 320 - }, - "InstanceStorageSupported": true, - "InstanceType": "c3.4xlarge", - "MemoryInfo": { - "SizeInMiB": 30720 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "High" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.8 - }, - "SupportedRootDeviceTypes": [ - "ebs", - "instance-store" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 8, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 16, - "ValidCores": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": false, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "unsupported", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": { - "Disks": [ - { - "Count": 2, - "SizeInGB": 320, - "Type": "ssd" - } - ], - "TotalSizeInGB": 640 - }, - "InstanceStorageSupported": true, - "InstanceType": "c3.8xlarge", - "MemoryInfo": { - "SizeInMiB": 61440 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.8 - }, - "SupportedRootDeviceTypes": [ - "ebs", - "instance-store" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 16, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 32, - "ValidCores": [ - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": false, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "unsupported", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": { - "Disks": [ - { - "Count": 2, - "SizeInGB": 16, - "Type": "ssd" - } - ], - "TotalSizeInGB": 32 - }, - "InstanceStorageSupported": true, - "InstanceType": "c3.large", - "MemoryInfo": { - "SizeInMiB": 3840 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 10, - "Ipv6AddressesPerInterface": 10, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 3, - "NetworkPerformance": "Moderate" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "i386", - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.8 - }, - "SupportedRootDeviceTypes": [ - "ebs", - "instance-store" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 1, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 2, - "ValidCores": [ - 1 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": false, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "supported", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": { - "Disks": [ - { - "Count": 2, - "SizeInGB": 40, - "Type": "ssd" - } - ], - "TotalSizeInGB": 80 - }, - "InstanceStorageSupported": true, - "InstanceType": "c3.xlarge", - "MemoryInfo": { - "SizeInMiB": 7680 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 15, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "Moderate" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.8 - }, - "SupportedRootDeviceTypes": [ - "ebs", - "instance-store" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 2, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 4, - "ValidCores": [ - 1, - 2 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c4.2xlarge", - "MemoryInfo": { - "SizeInMiB": 15360 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 15, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "High" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.9 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 4, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 8, - "ValidCores": [ - 1, - 2, - 3, - 4 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c4.4xlarge", - "MemoryInfo": { - "SizeInMiB": 30720 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "High" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.9 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 8, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 16, - "ValidCores": [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c4.8xlarge", - "MemoryInfo": { - "SizeInMiB": 61440 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.9 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 18, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 36, - "ValidCores": [ - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c4.large", - "MemoryInfo": { - "SizeInMiB": 3840 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 10, - "Ipv6AddressesPerInterface": 10, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 3, - "NetworkPerformance": "Moderate" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.9 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 1, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 2, - "ValidCores": [ - 1 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c4.xlarge", - "MemoryInfo": { - "SizeInMiB": 7680 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 15, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "High" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.9 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 2, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 4, - "ValidCores": [ - 1, - 2 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": false, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c5.12xlarge", - "MemoryInfo": { - "SizeInMiB": 98304 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "12 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 3.6 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 24, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 48, - "ValidCores": [ - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18, - 20, - 22, - 24 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c5.18xlarge", - "MemoryInfo": { - "SizeInMiB": 147456 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 50, - "Ipv6AddressesPerInterface": 50, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 15, - "NetworkPerformance": "25 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 3.4 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 36, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 72, - "ValidCores": [ - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18, - 20, - 22, - 24, - 26, - 28, - 30, - 32, - 34, - 36 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": false, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": false, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c5.24xlarge", - "MemoryInfo": { - "SizeInMiB": 196608 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 50, - "Ipv6AddressesPerInterface": 50, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 15, - "NetworkPerformance": "25 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 3.6 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 48, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 96, - "ValidCores": [ - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18, - 20, - 22, - 24, - 26, - 28, - 30, - 32, - 34, - 36, - 38, - 40, - 42, - 44, - 46, - 48 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c5.2xlarge", - "MemoryInfo": { - "SizeInMiB": 16384 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 15, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 3.4 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 4, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 8, - "ValidCores": [ - 2, - 4 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c5.4xlarge", - "MemoryInfo": { - "SizeInMiB": 32768 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 3.4 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 8, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 16, - "ValidCores": [ - 2, - 4, - 6, - 8 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c5.9xlarge", - "MemoryInfo": { - "SizeInMiB": 73728 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 30, - "Ipv6AddressesPerInterface": 30, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 8, - "NetworkPerformance": "10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 3.4 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 18, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 36, - "ValidCores": [ - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - }, - { - "AutoRecoverySupported": true, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": null, - "HibernationSupported": true, - "Hypervisor": "nitro", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": null, - "InstanceStorageSupported": false, - "InstanceType": "c5.large", - "MemoryInfo": { - "SizeInMiB": 4096 - }, - "NetworkInfo": { - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 10, - "Ipv6AddressesPerInterface": 10, - "Ipv6Supported": true, - "MaximumNetworkInterfaces": 3, - "NetworkPerformance": "Up to 10 Gigabit" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 3.4 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "VCpuInfo": { - "DefaultCores": 1, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 2, - "ValidCores": [ - 1 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - } -] -} \ No newline at end of file diff --git a/test/static/DescribeInstanceTypesPages/g2_2xlarge.json b/test/static/DescribeInstanceTypesPages/g2_2xlarge.json deleted file mode 100644 index a28ec0f0..00000000 --- a/test/static/DescribeInstanceTypesPages/g2_2xlarge.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "InstanceTypes": [ - { - "AutoRecoverySupported": false, - "BareMetal": false, - "BurstablePerformanceSupported": false, - "CurrentGeneration": false, - "DedicatedHostsSupported": true, - "EbsInfo": { - "EbsOptimizedSupport": "supported", - "EncryptionSupport": "supported" - }, - "FpgaInfo": null, - "FreeTierEligible": false, - "GpuInfo": { - "Gpus": [ - { - "Count": 1, - "Manufacturer": "NVIDIA", - "MemoryInfo": { - "SizeInMiB": 4096 - }, - "Name": "K520" - } - ], - "TotalGpuMemoryInMiB": 4096 - }, - "HibernationSupported": false, - "Hypervisor": "xen", - "InferenceAcceleratorInfo": null, - "InstanceStorageInfo": { - "Disks": [ - { - "Count": 1, - "SizeInGB": 60, - "Type": "ssd" - } - ], - "TotalSizeInGB": 60 - }, - "InstanceStorageSupported": true, - "InstanceType": "g2.2xlarge", - "MemoryInfo": { - "SizeInMiB": 15360 - }, - "NetworkInfo": { - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 15, - "Ipv6AddressesPerInterface": 0, - "Ipv6Supported": false, - "MaximumNetworkInterfaces": 4, - "NetworkPerformance": "Moderate" - }, - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.6 - }, - "SupportedRootDeviceTypes": [ - "ebs", - "instance-store" - ], - "SupportedUsageClasses": [ - "on-demand" - ], - "VCpuInfo": { - "DefaultCores": 4, - "DefaultThreadsPerCore": 2, - "DefaultVCpus": 8, - "ValidCores": [ - 1, - 2, - 3, - 4 - ], - "ValidThreadsPerCore": [ - 1, - 2 - ] - } - } - ] -} \ No newline at end of file diff --git a/test/static/DescribeInstanceTypesPages/m4_xlarge.json b/test/static/DescribeInstanceTypesPages/m4_xlarge.json deleted file mode 100644 index eccbef82..00000000 --- a/test/static/DescribeInstanceTypesPages/m4_xlarge.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "InstanceTypes": [ - { - "FreeTierEligible": false, - "InstanceStorageSupported": false, - "Hypervisor": "xen", - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "MemoryInfo": { - "SizeInMiB": 16384 - }, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "VCpuInfo": { - "ValidThreadsPerCore": [ - 1, - 2 - ], - "DefaultCores": 2, - "DefaultVCpus": 4, - "ValidCores": [ - 1, - 2 - ], - "DefaultThreadsPerCore": 2 - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.4 - }, - "BareMetal": false, - "AutoRecoverySupported": true, - "NetworkInfo": { - "NetworkPerformance": "High", - "MaximumNetworkInterfaces": 4, - "Ipv6Supported": true, - "Ipv6AddressesPerInterface": 15, - "EnaSupport": "unsupported", - "Ipv4AddressesPerInterface": 15 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "HibernationSupported": true, - "BurstablePerformanceSupported": false, - "InstanceType": "m4.xlarge" - } - ] -} \ No newline at end of file diff --git a/test/static/DescribeInstanceTypesPages/t3_micro.json b/test/static/DescribeInstanceTypesPages/t3_micro.json deleted file mode 100644 index 37ca8c7c..00000000 --- a/test/static/DescribeInstanceTypesPages/t3_micro.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "InstanceTypes": [ - { - "FreeTierEligible": false, - "InstanceStorageSupported": false, - "Hypervisor": "nitro", - "PlacementGroupInfo": { - "SupportedStrategies": [ - "partition", - "spread" - ] - }, - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "MemoryInfo": { - "SizeInMiB": 1024 - }, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "VCpuInfo": { - "ValidThreadsPerCore": [ - 1, - 2 - ], - "DefaultCores": 1, - "DefaultVCpus": 2, - "ValidCores": [ - 1 - ], - "DefaultThreadsPerCore": 2 - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.5 - }, - "BareMetal": false, - "AutoRecoverySupported": true, - "NetworkInfo": { - "NetworkPerformance": "Up to 5 Gigabit", - "MaximumNetworkInterfaces": 2, - "Ipv6Supported": true, - "Ipv6AddressesPerInterface": 2, - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 2 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "HibernationSupported": false, - "BurstablePerformanceSupported": true, - "InstanceType": "t3.micro" - } - ] -} \ No newline at end of file diff --git a/test/static/DescribeInstanceTypesPages/t3_micro_and_p3_16xl.json b/test/static/DescribeInstanceTypesPages/t3_micro_and_p3_16xl.json deleted file mode 100644 index b95069ff..00000000 --- a/test/static/DescribeInstanceTypesPages/t3_micro_and_p3_16xl.json +++ /dev/null @@ -1,149 +0,0 @@ -{ - "InstanceTypes": [ - { - "FreeTierEligible": false, - "InstanceStorageSupported": false, - "Hypervisor": "nitro", - "PlacementGroupInfo": { - "SupportedStrategies": [ - "partition", - "spread" - ] - }, - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "MemoryInfo": { - "SizeInMiB": 1024 - }, - "CurrentGeneration": true, - "DedicatedHostsSupported": true, - "VCpuInfo": { - "ValidThreadsPerCore": [ - 1, - 2 - ], - "DefaultCores": 1, - "DefaultVCpus": 2, - "ValidCores": [ - 1 - ], - "DefaultThreadsPerCore": 2 - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.5 - }, - "BareMetal": false, - "AutoRecoverySupported": true, - "NetworkInfo": { - "NetworkPerformance": "Up to 5 Gigabit", - "MaximumNetworkInterfaces": 2, - "Ipv6Supported": true, - "Ipv6AddressesPerInterface": 2, - "EnaSupport": "required", - "Ipv4AddressesPerInterface": 2 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "HibernationSupported": false, - "BurstablePerformanceSupported": true, - "InstanceType": "t3.micro" - }, - { - "FreeTierEligible": false, - "InstanceStorageSupported": false, - "Hypervisor": "xen", - "PlacementGroupInfo": { - "SupportedStrategies": [ - "cluster", - "partition", - "spread" - ] - }, - "SupportedUsageClasses": [ - "on-demand", - "spot" - ], - "MemoryInfo": { - "SizeInMiB": 499712 - }, - "CurrentGeneration": true, - "GpuInfo": { - "Gpus": [ - { - "Count": 8, - "MemoryInfo": { - "SizeInMiB": 16384 - }, - "Name": "V100", - "Manufacturer": "NVIDIA" - } - ], - "TotalGpuMemoryInMiB": 131072 - }, - "VCpuInfo": { - "ValidThreadsPerCore": [ - 1, - 2 - ], - "DefaultCores": 32, - "DefaultVCpus": 64, - "ValidCores": [ - 2, - 4, - 6, - 8, - 10, - 12, - 14, - 16, - 18, - 20, - 22, - 24, - 26, - 28, - 30, - 32 - ], - "DefaultThreadsPerCore": 2 - }, - "ProcessorInfo": { - "SupportedArchitectures": [ - "x86_64" - ], - "SustainedClockSpeedInGhz": 2.7 - }, - "BareMetal": false, - "AutoRecoverySupported": true, - "NetworkInfo": { - "NetworkPerformance": "25 Gigabit", - "MaximumNetworkInterfaces": 8, - "Ipv6Supported": true, - "Ipv6AddressesPerInterface": 30, - "EnaSupport": "supported", - "Ipv4AddressesPerInterface": 30 - }, - "SupportedRootDeviceTypes": [ - "ebs" - ], - "EbsInfo": { - "EbsOptimizedSupport": "default", - "EncryptionSupport": "supported" - }, - "HibernationSupported": false, - "DedicatedHostsSupported": true, - "BurstablePerformanceSupported": false, - "InstanceType": "p3.16xlarge" - } - ] -} \ No newline at end of file diff --git a/test/static/DescribeSpotPriceHistoryPages/m5_large.json b/test/static/DescribeSpotPriceHistory/m5_large.json similarity index 100% rename from test/static/DescribeSpotPriceHistoryPages/m5_large.json rename to test/static/DescribeSpotPriceHistory/m5_large.json diff --git a/test/static/GetProductsPages/m5_large.json b/test/static/GetProducts/m5_large.json similarity index 100% rename from test/static/GetProductsPages/m5_large.json rename to test/static/GetProducts/m5_large.json From d0591b3207c12b85b1280a0ab98fd51a90e619cd Mon Sep 17 00:00:00 2001 From: Jerad C Date: Mon, 5 Jun 2023 14:17:18 -0500 Subject: [PATCH 27/58] fix README tests (#211) --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index cf079dce..7b5bd3a9 100644 --- a/README.md +++ b/README.md @@ -337,9 +337,9 @@ Filter Flags: --gpu-memory-total-max string Maximum Number of GPUs' total memory (Example: 4 GiB) If --gpu-memory-total-min is not specified, the lower bound will be 0 --gpu-memory-total-min string Minimum Number of GPUs' total memory (Example: 4 GiB) If --gpu-memory-total-max is not specified, the upper bound will be infinity --gpu-model string GPU Model name (Example: K520) - -g, --gpus int Total Number of GPUs (Example: 4) (sets --gpus-min and -max to the same value) - --gpus-max int Maximum Total Number of GPUs (Example: 4) If --gpus-min is not specified, the lower bound will be 0 - --gpus-min int Minimum Total Number of GPUs (Example: 4) If --gpus-max is not specified, the upper bound will be infinity + -g, --gpus int32 Total Number of GPUs (Example: 4) (sets --gpus-min and -max to the same value) + --gpus-max int32 Maximum Total Number of GPUs (Example: 4) If --gpus-min is not specified, the lower bound will be 0 + --gpus-min int32 Minimum Total Number of GPUs (Example: 4) If --gpus-max is not specified, the upper bound will be infinity --hibernation-support Hibernation supported --hypervisor string Hypervisor: [xen or nitro] --inference-accelerator-manufacturer string Inference Accelerator Manufacturer name (Example: AWS) @@ -355,9 +355,9 @@ Filter Flags: --memory-max string Maximum Amount of Memory available (Example: 4 GiB) If --memory-min is not specified, the lower bound will be 0 --memory-min string Minimum Amount of Memory available (Example: 4 GiB) If --memory-max is not specified, the upper bound will be infinity --network-encryption Instance Types that support automatic network encryption in-transit - --network-interfaces int Number of network interfaces (ENIs) that can be attached to the instance (sets --network-interfaces-min and -max to the same value) - --network-interfaces-max int Maximum Number of network interfaces (ENIs) that can be attached to the instance If --network-interfaces-min is not specified, the lower bound will be 0 - --network-interfaces-min int Minimum Number of network interfaces (ENIs) that can be attached to the instance If --network-interfaces-max is not specified, the upper bound will be infinity + --network-interfaces int32 Number of network interfaces (ENIs) that can be attached to the instance (sets --network-interfaces-min and -max to the same value) + --network-interfaces-max int32 Maximum Number of network interfaces (ENIs) that can be attached to the instance If --network-interfaces-min is not specified, the lower bound will be 0 + --network-interfaces-min int32 Minimum Number of network interfaces (ENIs) that can be attached to the instance If --network-interfaces-max is not specified, the upper bound will be infinity --network-performance int Bandwidth in Gib/s of network performance (Example: 100) (sets --network-performance-min and -max to the same value) --network-performance-max int Maximum Bandwidth in Gib/s of network performance (Example: 100) If --network-performance-min is not specified, the lower bound will be 0 --network-performance-min int Minimum Bandwidth in Gib/s of network performance (Example: 100) If --network-performance-max is not specified, the upper bound will be infinity @@ -368,9 +368,9 @@ Filter Flags: --price-per-hour-min float Minimum Price/hour in USD (Example: 0.09) If --price-per-hour-max is not specified, the upper bound will be infinity --root-device-type string Supported root device types: [ebs or instance-store] -u, --usage-class string Usage class: [spot or on-demand] - -c, --vcpus int Number of vcpus available to the instance type. (sets --vcpus-min and -max to the same value) - --vcpus-max int Maximum Number of vcpus available to the instance type. If --vcpus-min is not specified, the lower bound will be 0 - --vcpus-min int Minimum Number of vcpus available to the instance type. If --vcpus-max is not specified, the upper bound will be infinity + -c, --vcpus int32 Number of vcpus available to the instance type. (sets --vcpus-min and -max to the same value) + --vcpus-max int32 Maximum Number of vcpus available to the instance type. If --vcpus-min is not specified, the lower bound will be 0 + --vcpus-min int32 Minimum Number of vcpus available to the instance type. If --vcpus-max is not specified, the upper bound will be infinity --vcpus-to-memory-ratio string The ratio of vcpus to GiBs of memory. (Example: 1:2) --virtualization-type string Virtualization Type supported: [hvm or pv] @@ -427,7 +427,11 @@ func main() { } // Instantiate a new instance of a selector with the AWS session - instanceSelector := selector.New(ctx, cfg) + instanceSelector, err := selector.New(ctx, cfg) + if err != nil { + fmt.Printf("Oh no, there was an error :( %v", err) + return + } // Instantiate an int range filter to specify min and max vcpus vcpusRange := selector.Int32RangeFilter{ From c6a7eee44c1c1f8c3e449d1597edf1e553269046 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 10:07:36 -0500 Subject: [PATCH 28/58] Bump github.com/aws/aws-sdk-go-v2/service/ec2 from 1.57.0 to 1.98.0 (#210) Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.57.0 to 1.98.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.57.0...service/ec2/v1.98.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 12 ++++++------ go.sum | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 1625f7e0..4a214c95 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.18 require ( github.com/aws/aws-sdk-go v1.44.271 - github.com/aws/aws-sdk-go-v2 v1.16.15 + github.com/aws/aws-sdk-go-v2 v1.18.0 github.com/aws/aws-sdk-go-v2/config v1.17.6 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.57.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.15.0 @@ -27,14 +27,14 @@ require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.12.19 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.11.22 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.16.18 // indirect - github.com/aws/smithy-go v1.13.3 // indirect + github.com/aws/smithy-go v1.13.5 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index 8eb0bf0d..e5eab13e 100644 --- a/go.sum +++ b/go.sum @@ -2,24 +2,28 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.271 h1:aa+Nu2JcnFmW1TLIz/67SS7KPq1I1Adl4RmExSMjGVo= github.com/aws/aws-sdk-go v1.44.271/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.16.15 h1:2sInOWGE4HV54R90Pj8QgqBBw3Qf1I0husqbqjPZzys= github.com/aws/aws-sdk-go-v2 v1.16.15/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= +github.com/aws/aws-sdk-go-v2 v1.18.0 h1:882kkTpSFhdgYRKVZ/VCgf7sd0ru57p2JCxz4/oN5RY= +github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/config v1.17.6 h1:0xHMch3eQ2C8CByMEi0iJOLF+pTLoAQeHVfhFxN7eyk= github.com/aws/aws-sdk-go-v2/config v1.17.6/go.mod h1:CrxsoI/AcKUoWyL9Zo0YaDxRlBfSnDZKBYKDdkNYDQ0= github.com/aws/aws-sdk-go-v2/credentials v1.12.19 h1:fYtSz4Fd0lUavtj4FAtvol9G2k0lh1TK4LfeP1hdnLw= github.com/aws/aws-sdk-go-v2/credentials v1.12.19/go.mod h1:fRQMbLwSHPr0XRzuez6x7BX5+0nNQs5BzG+oR4bQKyY= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16 h1:LX38v4cqSqrBETHUBnc8B+N6p5YA41GaPQ3jwICjetI= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16/go.mod h1:lnJ8tKos2s7JeBdLVFknwVSlQZAKzkgrFNQmUaTWwRQ= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22 h1:pE27/u2A7JlwICjOvONQDob8PToShRTkuiUE74ymVWg= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22/go.mod h1:/vNv5Al0bpiF8YdX2Ov6Xy05VTiXsql94yUqJMYaj0w= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16 h1:L5LKGHHXOl4t7+5QZMTl38GIzSAq07XUTRtEquiHGMA= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 h1:kG5eQilShqmJbv11XL1VpyDbaEJzWxd4zRiCG30GSn4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16/go.mod h1:62dsXI0BqTIGomDl8Hpm33dv0OntGaVblri3ZRParVQ= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 h1:vFQlirhuM8lLlpI7imKOMsjdQLuN9CPi+k44F/OFVsk= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23 h1:Sy266MXyLZZbObFhStGF9dyJm5nFyA8LINTgNm4Q6Ds= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23/go.mod h1:XtEkQMmxls+Tb5dZLmpa1QAk0OzSIFDAXanC9Jkf81E= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.57.0 h1:Ci3E3f2lGRXc+9djl/72LIaOkUnrJsW65P+j4rIlS0M= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.57.0/go.mod h1:Bl5Z601fnOyT/kXwCNwGS2tceQRuaJqwGhaMjd3c2v8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16 h1:9jysIwpUt7KGdsKOl+zA+0pG+7MpSsi0KQUcbE48n38= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0 h1:WblDV33AG9dhv0zFEPEmGtD5UECSNpKMxtdENULfR8M= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0/go.mod h1:L3ZT0N/vBsw77mOAawXmRnREpEjcHd2v5Hzf7AkIH8M= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16/go.mod h1:faBcf/4ZB4FRc17geaXWOxgzktotyJgBcUBZoHqvdfM= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 h1:0iKliEXAcCa2qVtRs7Ot5hItA2MsufrphbRFlz1Owxo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 h1:RQOMvPwte2H4ZqsiZmrla1crhBWDFnW8bZynkec5cGU= github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0/go.mod h1:LJyh9figH3ZpSiVjR5umzbl6V3EpQdZR4Se1ayoUtfI= github.com/aws/aws-sdk-go-v2/service/sso v1.11.22 h1:LrEyMbp0gMiXVaXpJ67jJkkqKCxivZvOd6wgXem0bWA= @@ -28,8 +32,9 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4 h1:d7Wh4xMQVVYfrJ1KHFGQ6jY/ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4/go.mod h1:mOofcMJCDSJwmtZykUE/i6tWGNwMnkextriwzY1zcbc= github.com/aws/aws-sdk-go-v2/service/sts v1.16.18 h1:TqEvnK8OceCKNQaDK9d5Ir2bOtC0S0dRQCwSbkV1rz0= github.com/aws/aws-sdk-go-v2/service/sts v1.16.18/go.mod h1:AE4zMc8qCw1JnDvy0ZrDVb/OXRuuweG3BcT2Nv7Qh3E= -github.com/aws/smithy-go v1.13.3 h1:l7LYxGuzK6/K+NzJ2mC+VvLUbae0sL3bXU//04MkmnA= github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= +github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= From 3101b633e0121e7cbc16df0db40bcb13fedbfd52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:05:18 -0500 Subject: [PATCH 29/58] Bump github.com/aws/aws-sdk-go from 1.44.271 to 1.44.276 (#212) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.271 to 1.44.276. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.271...v1.44.276) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4a214c95..564c6385 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.18 require ( - github.com/aws/aws-sdk-go v1.44.271 + github.com/aws/aws-sdk-go v1.44.276 github.com/aws/aws-sdk-go-v2 v1.18.0 github.com/aws/aws-sdk-go-v2/config v1.17.6 github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0 diff --git a/go.sum b/go.sum index e5eab13e..6a7849ed 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.271 h1:aa+Nu2JcnFmW1TLIz/67SS7KPq1I1Adl4RmExSMjGVo= -github.com/aws/aws-sdk-go v1.44.271/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.276 h1:ywPlx9C5Yc482dUgAZ9bHpQ6onVvJvYE9FJWsNDCEy0= +github.com/aws/aws-sdk-go v1.44.276/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.16.15/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= github.com/aws/aws-sdk-go-v2 v1.18.0 h1:882kkTpSFhdgYRKVZ/VCgf7sd0ru57p2JCxz4/oN5RY= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From 20e3726f4a43de7aa7148d4a7db3f92c2c76e3b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:30:15 -0500 Subject: [PATCH 30/58] Bump github.com/charmbracelet/bubbles from 0.15.0 to 0.16.1 (#208) Bumps [github.com/charmbracelet/bubbles](https://github.com/charmbracelet/bubbles) from 0.15.0 to 0.16.1. - [Release notes](https://github.com/charmbracelet/bubbles/releases) - [Commits](https://github.com/charmbracelet/bubbles/compare/v0.15.0...v0.16.1) --- updated-dependencies: - dependency-name: github.com/charmbracelet/bubbles dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 21 ++------------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 564c6385..12db6ef3 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 github.com/blang/semver/v4 v4.0.0 - github.com/charmbracelet/bubbles v0.15.0 + github.com/charmbracelet/bubbles v0.16.1 github.com/charmbracelet/bubbletea v0.24.1 github.com/charmbracelet/lipgloss v0.7.1 github.com/evertras/bubble-table v0.15.2 diff --git a/go.sum b/go.sum index 6a7849ed..f59f0351 100644 --- a/go.sum +++ b/go.sum @@ -35,21 +35,16 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.16.18/go.mod h1:AE4zMc8qCw1JnDvy0ZrD github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI= -github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74= -github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU= +github.com/charmbracelet/bubbles v0.16.1 h1:6uzpAAaT9ZqKssntbvZMlksWHruQLNxg49H5WdeuYSY= +github.com/charmbracelet/bubbles v0.16.1/go.mod h1:2QCp9LFlEsBQMvIYERr7Ww2H2bA7xen1idUDIzm/+Xc= github.com/charmbracelet/bubbletea v0.24.1 h1:LpdYfnu+Qc6XtvMz6d/6rRY71yttHTP5HtrjMgWvixc= github.com/charmbracelet/bubbletea v0.24.1/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= -github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao= -github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk= github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -69,18 +64,13 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= -github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -89,11 +79,8 @@ github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTd github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= -github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= -github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc= github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs= github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= @@ -134,13 +121,9 @@ golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From cc9c47f871654f2a834690ff5698e573c8549ed8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 11:53:18 -0500 Subject: [PATCH 31/58] Bump github.com/aws/aws-sdk-go-v2/service/pricing from 1.17.0 to 1.19.6 (#207) Bumps [github.com/aws/aws-sdk-go-v2/service/pricing](https://github.com/aws/aws-sdk-go-v2) from 1.17.0 to 1.19.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.17.0...service/efs/v1.19.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/pricing dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 12db6ef3..39b74bd4 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.18.0 github.com/aws/aws-sdk-go-v2/config v1.17.6 github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0 - github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 + github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 github.com/charmbracelet/bubbletea v0.24.1 diff --git a/go.sum b/go.sum index f59f0351..fa0dbc45 100644 --- a/go.sum +++ b/go.sum @@ -24,8 +24,8 @@ github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0/go.mod h1:L3ZT0N/vBsw77mOAawXmR github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16/go.mod h1:faBcf/4ZB4FRc17geaXWOxgzktotyJgBcUBZoHqvdfM= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 h1:0iKliEXAcCa2qVtRs7Ot5hItA2MsufrphbRFlz1Owxo= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= -github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0 h1:RQOMvPwte2H4ZqsiZmrla1crhBWDFnW8bZynkec5cGU= -github.com/aws/aws-sdk-go-v2/service/pricing v1.17.0/go.mod h1:LJyh9figH3ZpSiVjR5umzbl6V3EpQdZR4Se1ayoUtfI= +github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 h1:K2Z0cgIAE7h8japUHg4GnIRZ+CzAlRA+Q76ghVE2Q5o= +github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6/go.mod h1:0M3RD4kWATK59uPAopcN+fPzFtLixgPuSJ2oXEUuX6E= github.com/aws/aws-sdk-go-v2/service/sso v1.11.22 h1:LrEyMbp0gMiXVaXpJ67jJkkqKCxivZvOd6wgXem0bWA= github.com/aws/aws-sdk-go-v2/service/sso v1.11.22/go.mod h1:B2nDzX7lppT8j4EV2/WhT20SnRDp/LdNyqxyGYY46Ow= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4 h1:d7Wh4xMQVVYfrJ1KHFGQ6jY/O51LjnTCWJgh85RT+TQ= From d6fa3c3a40ba958c5749c861ae6d35be6506a8d9 Mon Sep 17 00:00:00 2001 From: Jerad C Date: Tue, 6 Jun 2023 15:28:14 -0500 Subject: [PATCH 32/58] Go version update (#213) * Bump go.uber.org/multierr from 1.9.0 to 1.11.0 Bumps [go.uber.org/multierr](https://github.com/uber-go/multierr) from 1.9.0 to 1.11.0. - [Release notes](https://github.com/uber-go/multierr/releases) - [Changelog](https://github.com/uber-go/multierr/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/multierr/compare/v1.9.0...v1.11.0) --- updated-dependencies: - dependency-name: go.uber.org/multierr dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * upgrade to Go 1.20 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Dockerfile | 2 +- go.mod | 5 ++--- go.sum | 8 ++------ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index f39964fe..58e9b179 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18 as builder +FROM golang:1.20 as builder ## GOLANG env ARG GOPROXY="https://proxy.golang.org|direct" diff --git a/go.mod b/go.mod index 39b74bd4..0a048bfe 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/aws/amazon-ec2-instance-selector/v2 -go 1.18 +go 1.20 require ( github.com/aws/aws-sdk-go v1.44.276 @@ -20,7 +20,7 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 - go.uber.org/multierr v1.9.0 + go.uber.org/multierr v1.11.0 ) require ( @@ -48,7 +48,6 @@ require ( github.com/muesli/reflow v0.3.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect - go.uber.org/atomic v1.7.0 // indirect golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.6.0 // indirect golang.org/x/term v0.6.0 // indirect diff --git a/go.sum b/go.sum index fa0dbc45..e057d199 100644 --- a/go.sum +++ b/go.sum @@ -50,7 +50,6 @@ github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:Yyn github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/evertras/bubble-table v0.15.2 h1:hVj27V9tk5TD5p6mVv0RK/KJu2sHq0U+mBMux/HptkU= github.com/evertras/bubble-table v0.15.2/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= @@ -101,13 +100,10 @@ github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRM github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= -go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= From 50cfed4d3d5a2bde82bf86019ba318589e681bc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 10:46:24 -0500 Subject: [PATCH 33/58] Bump github.com/aws/aws-sdk-go from 1.44.276 to 1.44.280 (#216) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.276 to 1.44.280. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.276...v1.44.280) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0a048bfe..be8f6822 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.20 require ( - github.com/aws/aws-sdk-go v1.44.276 + github.com/aws/aws-sdk-go v1.44.280 github.com/aws/aws-sdk-go-v2 v1.18.0 github.com/aws/aws-sdk-go-v2/config v1.17.6 github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0 diff --git a/go.sum b/go.sum index e057d199..390340e5 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.276 h1:ywPlx9C5Yc482dUgAZ9bHpQ6onVvJvYE9FJWsNDCEy0= -github.com/aws/aws-sdk-go v1.44.276/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.280 h1:UYl/yxhDxP8naok6ftWyQ9/9ZzNwjC9dvEs/j8BkGhw= +github.com/aws/aws-sdk-go v1.44.280/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.16.15/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= github.com/aws/aws-sdk-go-v2 v1.18.0 h1:882kkTpSFhdgYRKVZ/VCgf7sd0ru57p2JCxz4/oN5RY= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From 90f4a0ea2661fc3fd63e3fa4653ecb6ef298e563 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 11:15:54 -0500 Subject: [PATCH 34/58] Bump github.com/charmbracelet/bubbletea from 0.24.1 to 0.24.2 (#218) Bumps [github.com/charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea) from 0.24.1 to 0.24.2. - [Release notes](https://github.com/charmbracelet/bubbletea/releases) - [Commits](https://github.com/charmbracelet/bubbletea/compare/v0.24.1...v0.24.2) --- updated-dependencies: - dependency-name: github.com/charmbracelet/bubbletea dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index be8f6822..32fc38a9 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 - github.com/charmbracelet/bubbletea v0.24.1 + github.com/charmbracelet/bubbletea v0.24.2 github.com/charmbracelet/lipgloss v0.7.1 github.com/evertras/bubble-table v0.15.2 github.com/imdario/mergo v0.3.16 diff --git a/go.sum b/go.sum index 390340e5..bcec389b 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/charmbracelet/bubbles v0.16.1 h1:6uzpAAaT9ZqKssntbvZMlksWHruQLNxg49H5WdeuYSY= github.com/charmbracelet/bubbles v0.16.1/go.mod h1:2QCp9LFlEsBQMvIYERr7Ww2H2bA7xen1idUDIzm/+Xc= -github.com/charmbracelet/bubbletea v0.24.1 h1:LpdYfnu+Qc6XtvMz6d/6rRY71yttHTP5HtrjMgWvixc= -github.com/charmbracelet/bubbletea v0.24.1/go.mod h1:rK3g/2+T8vOSEkNHvtq40umJpeVYDn6bLaqbgzhL/hg= +github.com/charmbracelet/bubbletea v0.24.2 h1:uaQIKx9Ai6Gdh5zpTbGiWpytMU+CfsPp06RaW2cx/SY= +github.com/charmbracelet/bubbletea v0.24.2/go.mod h1:XdrNrV4J8GiyshTtx3DNuYkR1FDaJmO3l2nejekbsgg= github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= From 4901c0b24bf7bf6ce7ba37b64030f9883bdbfa99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 11:25:53 -0500 Subject: [PATCH 35/58] Bump github.com/aws/aws-sdk-go-v2/service/ec2 from 1.98.0 to 1.99.0 (#217) Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.98.0 to 1.99.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.98.0...service/ec2/v1.99.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 32fc38a9..79e45597 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go v1.44.280 github.com/aws/aws-sdk-go-v2 v1.18.0 github.com/aws/aws-sdk-go-v2/config v1.17.6 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 diff --git a/go.sum b/go.sum index bcec389b..36cf6ea7 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 h1:vFQlirhuM8lLlpI7im github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23 h1:Sy266MXyLZZbObFhStGF9dyJm5nFyA8LINTgNm4Q6Ds= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23/go.mod h1:XtEkQMmxls+Tb5dZLmpa1QAk0OzSIFDAXanC9Jkf81E= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0 h1:WblDV33AG9dhv0zFEPEmGtD5UECSNpKMxtdENULfR8M= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.98.0/go.mod h1:L3ZT0N/vBsw77mOAawXmRnREpEjcHd2v5Hzf7AkIH8M= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0 h1:NXi4pNJWjAaiI56P1Rl8DC9A4jMNRE00WNBsDua5WRg= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0/go.mod h1:L3ZT0N/vBsw77mOAawXmRnREpEjcHd2v5Hzf7AkIH8M= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16/go.mod h1:faBcf/4ZB4FRc17geaXWOxgzktotyJgBcUBZoHqvdfM= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 h1:0iKliEXAcCa2qVtRs7Ot5hItA2MsufrphbRFlz1Owxo= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= From ff3505521ea3a62825f06ac0242d70c93c9bee98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 11:26:47 -0500 Subject: [PATCH 36/58] Bump github.com/aws/aws-sdk-go-v2/config from 1.17.6 to 1.18.25 (#215) Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.17.6 to 1.18.25. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.17.6...config/v1.18.25) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 14 +++++++------- go.sum | 33 ++++++++++++++------------------- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index 79e45597..c180f998 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.44.280 github.com/aws/aws-sdk-go-v2 v1.18.0 - github.com/aws/aws-sdk-go-v2/config v1.17.6 + github.com/aws/aws-sdk-go-v2/config v1.18.25 github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 github.com/blang/semver/v4 v4.0.0 @@ -25,15 +25,15 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.12.19 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.24 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.11.22 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.16.18 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.19.0 // indirect github.com/aws/smithy-go v1.13.5 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect diff --git a/go.sum b/go.sum index 36cf6ea7..1f6f733a 100644 --- a/go.sum +++ b/go.sum @@ -2,37 +2,32 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.280 h1:UYl/yxhDxP8naok6ftWyQ9/9ZzNwjC9dvEs/j8BkGhw= github.com/aws/aws-sdk-go v1.44.280/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.16.15/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= github.com/aws/aws-sdk-go-v2 v1.18.0 h1:882kkTpSFhdgYRKVZ/VCgf7sd0ru57p2JCxz4/oN5RY= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2/config v1.17.6 h1:0xHMch3eQ2C8CByMEi0iJOLF+pTLoAQeHVfhFxN7eyk= -github.com/aws/aws-sdk-go-v2/config v1.17.6/go.mod h1:CrxsoI/AcKUoWyL9Zo0YaDxRlBfSnDZKBYKDdkNYDQ0= -github.com/aws/aws-sdk-go-v2/credentials v1.12.19 h1:fYtSz4Fd0lUavtj4FAtvol9G2k0lh1TK4LfeP1hdnLw= -github.com/aws/aws-sdk-go-v2/credentials v1.12.19/go.mod h1:fRQMbLwSHPr0XRzuez6x7BX5+0nNQs5BzG+oR4bQKyY= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16 h1:LX38v4cqSqrBETHUBnc8B+N6p5YA41GaPQ3jwICjetI= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.16/go.mod h1:lnJ8tKos2s7JeBdLVFknwVSlQZAKzkgrFNQmUaTWwRQ= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.22/go.mod h1:/vNv5Al0bpiF8YdX2Ov6Xy05VTiXsql94yUqJMYaj0w= +github.com/aws/aws-sdk-go-v2/config v1.18.25 h1:JuYyZcnMPBiFqn87L2cRppo+rNwgah6YwD3VuyvaW6Q= +github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4= +github.com/aws/aws-sdk-go-v2/credentials v1.13.24 h1:PjiYyls3QdCrzqUN35jMWtUK1vqVZ+zLfdOa/UPFDp0= +github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 h1:jJPgroehGvjrde3XufFIJUZVK5A2L9a3KwSFgKy9n8w= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 h1:kG5eQilShqmJbv11XL1VpyDbaEJzWxd4zRiCG30GSn4= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.16/go.mod h1:62dsXI0BqTIGomDl8Hpm33dv0OntGaVblri3ZRParVQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 h1:vFQlirhuM8lLlpI7imKOMsjdQLuN9CPi+k44F/OFVsk= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23 h1:Sy266MXyLZZbObFhStGF9dyJm5nFyA8LINTgNm4Q6Ds= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.23/go.mod h1:XtEkQMmxls+Tb5dZLmpa1QAk0OzSIFDAXanC9Jkf81E= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 h1:gGLG7yKaXG02/jBlg210R7VgQIotiQntNhsCFejawx8= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0 h1:NXi4pNJWjAaiI56P1Rl8DC9A4jMNRE00WNBsDua5WRg= github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0/go.mod h1:L3ZT0N/vBsw77mOAawXmRnREpEjcHd2v5Hzf7AkIH8M= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.16/go.mod h1:faBcf/4ZB4FRc17geaXWOxgzktotyJgBcUBZoHqvdfM= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 h1:0iKliEXAcCa2qVtRs7Ot5hItA2MsufrphbRFlz1Owxo= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 h1:K2Z0cgIAE7h8japUHg4GnIRZ+CzAlRA+Q76ghVE2Q5o= github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6/go.mod h1:0M3RD4kWATK59uPAopcN+fPzFtLixgPuSJ2oXEUuX6E= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.22 h1:LrEyMbp0gMiXVaXpJ67jJkkqKCxivZvOd6wgXem0bWA= -github.com/aws/aws-sdk-go-v2/service/sso v1.11.22/go.mod h1:B2nDzX7lppT8j4EV2/WhT20SnRDp/LdNyqxyGYY46Ow= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4 h1:d7Wh4xMQVVYfrJ1KHFGQ6jY/O51LjnTCWJgh85RT+TQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.4/go.mod h1:mOofcMJCDSJwmtZykUE/i6tWGNwMnkextriwzY1zcbc= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.18 h1:TqEvnK8OceCKNQaDK9d5Ir2bOtC0S0dRQCwSbkV1rz0= -github.com/aws/aws-sdk-go-v2/service/sts v1.16.18/go.mod h1:AE4zMc8qCw1JnDvy0ZrDVb/OXRuuweG3BcT2Nv7Qh3E= -github.com/aws/smithy-go v1.13.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 h1:UBQjaMTCKwyUYwiVnUt6toEJwGXsLBI6al083tpjJzY= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10 h1:PkHIIJs8qvq0e5QybnZoG1K/9QTrLr9OsqCIo59jOBA= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk= +github.com/aws/aws-sdk-go-v2/service/sts v1.19.0 h1:2DQLAKDteoEDI8zpCzqBMaZlJuoE9iTYD0gFmXVax9E= +github.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= From af7dcaa9c800d56448313910ac8c71a3e39993b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 10:06:52 -0500 Subject: [PATCH 37/58] Bump github.com/aws/aws-sdk-go-v2/service/ec2 from 1.99.0 to 1.100.1 (#223) Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.99.0 to 1.100.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.99.0...service/ec2/v1.100.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 16 ++++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index c180f998..6bf14ff1 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.44.280 - github.com/aws/aws-sdk-go-v2 v1.18.0 + github.com/aws/aws-sdk-go-v2 v1.18.1 github.com/aws/aws-sdk-go-v2/config v1.18.25 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1 github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 @@ -27,10 +27,10 @@ require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.24 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.19.0 // indirect diff --git a/go.sum b/go.sum index 1f6f733a..4b6b9a38 100644 --- a/go.sum +++ b/go.sum @@ -2,24 +2,28 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.280 h1:UYl/yxhDxP8naok6ftWyQ9/9ZzNwjC9dvEs/j8BkGhw= github.com/aws/aws-sdk-go v1.44.280/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.18.0 h1:882kkTpSFhdgYRKVZ/VCgf7sd0ru57p2JCxz4/oN5RY= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2 v1.18.1 h1:+tefE750oAb7ZQGzla6bLkOwfcQCEtC5y2RqoqCeqKo= +github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/config v1.18.25 h1:JuYyZcnMPBiFqn87L2cRppo+rNwgah6YwD3VuyvaW6Q= github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4= github.com/aws/aws-sdk-go-v2/credentials v1.13.24 h1:PjiYyls3QdCrzqUN35jMWtUK1vqVZ+zLfdOa/UPFDp0= github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 h1:jJPgroehGvjrde3XufFIJUZVK5A2L9a3KwSFgKy9n8w= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33 h1:kG5eQilShqmJbv11XL1VpyDbaEJzWxd4zRiCG30GSn4= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27 h1:vFQlirhuM8lLlpI7imKOMsjdQLuN9CPi+k44F/OFVsk= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 h1:A5UqQEmPaCFpedKouS4v+dHCTUo2sKqhoKO9U5kxyWo= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 h1:srIVS45eQuewqz6fKKu6ZGXaq6FuFg5NzgQBAM6g8Y4= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 h1:gGLG7yKaXG02/jBlg210R7VgQIotiQntNhsCFejawx8= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0 h1:NXi4pNJWjAaiI56P1Rl8DC9A4jMNRE00WNBsDua5WRg= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.99.0/go.mod h1:L3ZT0N/vBsw77mOAawXmRnREpEjcHd2v5Hzf7AkIH8M= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27 h1:0iKliEXAcCa2qVtRs7Ot5hItA2MsufrphbRFlz1Owxo= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1 h1:AsLoN1zlf+PJ5DRzoegd8k/Zk9f/fBCMKxrZ4sXSE5k= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1/go.mod h1:tIctCeX9IbzsUTKHt53SVEcgyfxV2ElxJeEB+QUbc4M= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 h1:bkRyG4a929RCnpVSTvLM2j/T4ls015ZhhYApbmYs15s= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28/go.mod h1:jj7znCIg05jXlaGBlFMGP8+7UN3VtCkRBG2spnmRQkU= github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 h1:K2Z0cgIAE7h8japUHg4GnIRZ+CzAlRA+Q76ghVE2Q5o= github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6/go.mod h1:0M3RD4kWATK59uPAopcN+fPzFtLixgPuSJ2oXEUuX6E= github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 h1:UBQjaMTCKwyUYwiVnUt6toEJwGXsLBI6al083tpjJzY= From 403fab743d2ec1e0c424656a2f41590f8ee5f031 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 10:58:00 -0500 Subject: [PATCH 38/58] Bump github.com/aws/aws-sdk-go-v2/config from 1.18.25 to 1.18.27 (#221) Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.25 to 1.18.27. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.18.25...config/v1.18.27) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 14 +++++++------- go.sum | 29 ++++++++++++++--------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 6bf14ff1..9142b86e 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.44.280 github.com/aws/aws-sdk-go-v2 v1.18.1 - github.com/aws/aws-sdk-go-v2/config v1.18.25 + github.com/aws/aws-sdk-go-v2/config v1.18.27 github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1 github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 github.com/blang/semver/v4 v4.0.0 @@ -25,15 +25,15 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.24 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.26 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.19.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 // indirect github.com/aws/smithy-go v1.13.5 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect diff --git a/go.sum b/go.sum index 4b6b9a38..64f31495 100644 --- a/go.sum +++ b/go.sum @@ -5,33 +5,32 @@ github.com/aws/aws-sdk-go v1.44.280/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8 github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.1 h1:+tefE750oAb7ZQGzla6bLkOwfcQCEtC5y2RqoqCeqKo= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2/config v1.18.25 h1:JuYyZcnMPBiFqn87L2cRppo+rNwgah6YwD3VuyvaW6Q= -github.com/aws/aws-sdk-go-v2/config v1.18.25/go.mod h1:dZnYpD5wTW/dQF0rRNLVypB396zWCcPiBIvdvSWHEg4= -github.com/aws/aws-sdk-go-v2/credentials v1.13.24 h1:PjiYyls3QdCrzqUN35jMWtUK1vqVZ+zLfdOa/UPFDp0= -github.com/aws/aws-sdk-go-v2/credentials v1.13.24/go.mod h1:jYPYi99wUOPIFi0rhiOvXeSEReVOzBqFNOX5bXYoG2o= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3 h1:jJPgroehGvjrde3XufFIJUZVK5A2L9a3KwSFgKy9n8w= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.3/go.mod h1:4Q0UFP0YJf0NrsEuEYHpM9fTSEVnD16Z3uyEF7J9JGM= +github.com/aws/aws-sdk-go-v2/config v1.18.27 h1:Az9uLwmssTE6OGTpsFqOnaGpLnKDqNYOJzWuC6UAYzA= +github.com/aws/aws-sdk-go-v2/config v1.18.27/go.mod h1:0My+YgmkGxeqjXZb5BYme5pc4drjTnM+x1GJ3zv42Nw= +github.com/aws/aws-sdk-go-v2/credentials v1.13.26 h1:qmU+yhKmOCyujmuPY7tf5MxR/RKyZrOPO3V4DobiTUk= +github.com/aws/aws-sdk-go-v2/credentials v1.13.26/go.mod h1:GoXt2YC8jHUBbA4jr+W3JiemnIbkXOfxSXcisUsZ3os= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 h1:LxK/bitrAr4lnh9LnIS6i7zWbCOdMsfzKFBI6LUCS0I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4/go.mod h1:E1hLXN/BL2e6YizK1zFlYd8vsfi2GTjbjBazinMmeaM= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 h1:A5UqQEmPaCFpedKouS4v+dHCTUo2sKqhoKO9U5kxyWo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 h1:srIVS45eQuewqz6fKKu6ZGXaq6FuFg5NzgQBAM6g8Y4= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34 h1:gGLG7yKaXG02/jBlg210R7VgQIotiQntNhsCFejawx8= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.34/go.mod h1:Etz2dj6UHYuw+Xw830KfzCfWGMzqvUTCjUj5b76GVDc= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35/go.mod h1:0Eg1YjxE0Bhn56lx+SHJwCzhW+2JGtizsrx+lCqrfm0= github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1 h1:AsLoN1zlf+PJ5DRzoegd8k/Zk9f/fBCMKxrZ4sXSE5k= github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1/go.mod h1:tIctCeX9IbzsUTKHt53SVEcgyfxV2ElxJeEB+QUbc4M= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.27/go.mod h1:EOwBD4J4S5qYszS5/3DpkejfuK+Z5/1uzICfPaZLtqw= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 h1:bkRyG4a929RCnpVSTvLM2j/T4ls015ZhhYApbmYs15s= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28/go.mod h1:jj7znCIg05jXlaGBlFMGP8+7UN3VtCkRBG2spnmRQkU= github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 h1:K2Z0cgIAE7h8japUHg4GnIRZ+CzAlRA+Q76ghVE2Q5o= github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6/go.mod h1:0M3RD4kWATK59uPAopcN+fPzFtLixgPuSJ2oXEUuX6E= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.10 h1:UBQjaMTCKwyUYwiVnUt6toEJwGXsLBI6al083tpjJzY= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.10/go.mod h1:ouy2P4z6sJN70fR3ka3wD3Ro3KezSxU6eKGQI2+2fjI= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10 h1:PkHIIJs8qvq0e5QybnZoG1K/9QTrLr9OsqCIo59jOBA= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.10/go.mod h1:AFvkxc8xfBe8XA+5St5XIHHrQQtkxqrRincx4hmMHOk= -github.com/aws/aws-sdk-go-v2/service/sts v1.19.0 h1:2DQLAKDteoEDI8zpCzqBMaZlJuoE9iTYD0gFmXVax9E= -github.com/aws/aws-sdk-go-v2/service/sts v1.19.0/go.mod h1:BgQOMsg8av8jset59jelyPW7NoZcZXLVpDsXunGDrk8= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 h1:nneMBM2p79PGWBQovYO/6Xnc2ryRMw3InnDJq1FHkSY= +github.com/aws/aws-sdk-go-v2/service/sso v1.12.12/go.mod h1:HuCOxYsF21eKrerARYO6HapNeh9GBNq7fius2AcwodY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 h1:2qTR7IFk7/0IN/adSFhYu9Xthr0zVFTgBrmPldILn80= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12/go.mod h1:E4VrHCPzmVB/KFXtqBGKb3c8zpbNBgKe3fisDNLAW5w= +github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 h1:XFJ2Z6sNUUcAz9poj+245DMkrHE4h2j5I9/xD50RHfE= +github.com/aws/aws-sdk-go-v2/service/sts v1.19.2/go.mod h1:dp0yLPsLBOi++WTxzCjA/oZqi6NPIhoR+uF7GeMU9eg= github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= From 1b66bb21c562603839b5802919678d9d24534a7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 09:24:29 -0500 Subject: [PATCH 39/58] Bump github.com/aws/aws-sdk-go-v2/service/ec2 from 1.100.1 to 1.102.0 (#224) Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.100.1 to 1.102.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.100.1...service/ec2/v1.102.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9142b86e..f92c89a4 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go v1.44.280 github.com/aws/aws-sdk-go-v2 v1.18.1 github.com/aws/aws-sdk-go-v2/config v1.18.27 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 diff --git a/go.sum b/go.sum index 64f31495..1d0b3548 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 h1:srIVS45eQuewqz6fKK github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35/go.mod h1:0Eg1YjxE0Bhn56lx+SHJwCzhW+2JGtizsrx+lCqrfm0= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1 h1:AsLoN1zlf+PJ5DRzoegd8k/Zk9f/fBCMKxrZ4sXSE5k= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.100.1/go.mod h1:tIctCeX9IbzsUTKHt53SVEcgyfxV2ElxJeEB+QUbc4M= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0 h1:P4dyjm49F2kKws0FpouBC6fjVImACXKt752+CWa01lM= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0/go.mod h1:tIctCeX9IbzsUTKHt53SVEcgyfxV2ElxJeEB+QUbc4M= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 h1:bkRyG4a929RCnpVSTvLM2j/T4ls015ZhhYApbmYs15s= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28/go.mod h1:jj7znCIg05jXlaGBlFMGP8+7UN3VtCkRBG2spnmRQkU= github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 h1:K2Z0cgIAE7h8japUHg4GnIRZ+CzAlRA+Q76ghVE2Q5o= From 05b0acffde15e71f045d3f8ad930573f0ba7b505 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 09:47:07 -0500 Subject: [PATCH 40/58] Bump github.com/aws/aws-sdk-go from 1.44.280 to 1.44.289 (#226) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.280 to 1.44.289. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.280...v1.44.289) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f92c89a4..bb9cecc5 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.20 require ( - github.com/aws/aws-sdk-go v1.44.280 + github.com/aws/aws-sdk-go v1.44.289 github.com/aws/aws-sdk-go-v2 v1.18.1 github.com/aws/aws-sdk-go-v2/config v1.18.27 github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0 diff --git a/go.sum b/go.sum index 1d0b3548..5695a486 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.280 h1:UYl/yxhDxP8naok6ftWyQ9/9ZzNwjC9dvEs/j8BkGhw= -github.com/aws/aws-sdk-go v1.44.280/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.289 h1:5CVEjiHFvdiVlKPBzv0rjG4zH/21W/onT18R5AH/qx0= +github.com/aws/aws-sdk-go v1.44.289/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.1 h1:+tefE750oAb7ZQGzla6bLkOwfcQCEtC5y2RqoqCeqKo= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From bf9c1aebe15ae5bfe54f705314ed1a7acc362db5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 11:13:02 -0500 Subject: [PATCH 41/58] Bump github.com/aws/aws-sdk-go-v2/service/pricing from 1.19.6 to 1.20.0 (#225) Bumps [github.com/aws/aws-sdk-go-v2/service/pricing](https://github.com/aws/aws-sdk-go-v2) from 1.19.6 to 1.20.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/efs/v1.19.6...service/s3/v1.20.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/pricing dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index bb9cecc5..db270ca1 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.18.1 github.com/aws/aws-sdk-go-v2/config v1.18.27 github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0 - github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 + github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 github.com/charmbracelet/bubbletea v0.24.2 diff --git a/go.sum b/go.sum index 5695a486..ea548df9 100644 --- a/go.sum +++ b/go.sum @@ -2,7 +2,6 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.289 h1:5CVEjiHFvdiVlKPBzv0rjG4zH/21W/onT18R5AH/qx0= github.com/aws/aws-sdk-go v1.44.289/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.18.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.18.1 h1:+tefE750oAb7ZQGzla6bLkOwfcQCEtC5y2RqoqCeqKo= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/config v1.18.27 h1:Az9uLwmssTE6OGTpsFqOnaGpLnKDqNYOJzWuC6UAYzA= @@ -11,10 +10,8 @@ github.com/aws/aws-sdk-go-v2/credentials v1.13.26 h1:qmU+yhKmOCyujmuPY7tf5MxR/RK github.com/aws/aws-sdk-go-v2/credentials v1.13.26/go.mod h1:GoXt2YC8jHUBbA4jr+W3JiemnIbkXOfxSXcisUsZ3os= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 h1:LxK/bitrAr4lnh9LnIS6i7zWbCOdMsfzKFBI6LUCS0I= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4/go.mod h1:E1hLXN/BL2e6YizK1zFlYd8vsfi2GTjbjBazinMmeaM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.33/go.mod h1:7i0PF1ME/2eUPFcjkVIwq+DOygHEoK92t5cDqNgYbIw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 h1:A5UqQEmPaCFpedKouS4v+dHCTUo2sKqhoKO9U5kxyWo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.27/go.mod h1:UrHnn3QV/d0pBZ6QBAEQcqFLf8FAzLmoUfPVIueOvoM= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 h1:srIVS45eQuewqz6fKKu6ZGXaq6FuFg5NzgQBAM6g8Y4= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= @@ -23,8 +20,8 @@ github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0 h1:P4dyjm49F2kKws0FpouBC6fjVIm github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0/go.mod h1:tIctCeX9IbzsUTKHt53SVEcgyfxV2ElxJeEB+QUbc4M= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 h1:bkRyG4a929RCnpVSTvLM2j/T4ls015ZhhYApbmYs15s= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28/go.mod h1:jj7znCIg05jXlaGBlFMGP8+7UN3VtCkRBG2spnmRQkU= -github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6 h1:K2Z0cgIAE7h8japUHg4GnIRZ+CzAlRA+Q76ghVE2Q5o= -github.com/aws/aws-sdk-go-v2/service/pricing v1.19.6/go.mod h1:0M3RD4kWATK59uPAopcN+fPzFtLixgPuSJ2oXEUuX6E= +github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 h1:x5gKeerbKIQ/tdhmaAGNpivSfmb+p2rdt0wyjCGz+4Q= +github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0/go.mod h1:JjpnqJdEW/5An429Ou+5Kb3UkwjXv16gRD2ZdGA2Gw8= github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 h1:nneMBM2p79PGWBQovYO/6Xnc2ryRMw3InnDJq1FHkSY= github.com/aws/aws-sdk-go-v2/service/sso v1.12.12/go.mod h1:HuCOxYsF21eKrerARYO6HapNeh9GBNq7fius2AcwodY= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 h1:2qTR7IFk7/0IN/adSFhYu9Xthr0zVFTgBrmPldILn80= From bce98477424004ad6b7e7f9aba29e326232ea646 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Jul 2023 09:34:34 -0500 Subject: [PATCH 42/58] Bump github.com/muesli/termenv from 0.15.1 to 0.15.2 (#228) Bumps [github.com/muesli/termenv](https://github.com/muesli/termenv) from 0.15.1 to 0.15.2. - [Release notes](https://github.com/muesli/termenv/releases) - [Commits](https://github.com/muesli/termenv/compare/v0.15.1...v0.15.2) --- updated-dependencies: - dependency-name: github.com/muesli/termenv dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index db270ca1..dd2c1b72 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/evertras/bubble-table v0.15.2 github.com/imdario/mergo v0.3.16 github.com/mitchellh/go-homedir v1.1.0 - github.com/muesli/termenv v0.15.1 + github.com/muesli/termenv v0.15.2 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/spf13/cobra v1.7.0 @@ -49,7 +49,7 @@ require ( github.com/rivo/uniseg v0.2.0 // indirect github.com/sahilm/fuzzy v0.1.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.6.0 // indirect + golang.org/x/sys v0.7.0 // indirect golang.org/x/term v0.6.0 // indirect golang.org/x/text v0.4.0 // indirect ) diff --git a/go.sum b/go.sum index ea548df9..38d9cc03 100644 --- a/go.sum +++ b/go.sum @@ -75,8 +75,8 @@ github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELU github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs= -github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ= +github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= +github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= @@ -116,8 +116,9 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= From f6c1835fc59c31236d22ab31785a061f00bb3cb5 Mon Sep 17 00:00:00 2001 From: Jerad C Date: Thu, 13 Jul 2023 11:16:52 -0500 Subject: [PATCH 43/58] fix profile and region arguments (#234) --- cmd/main.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 31a56f61..e2490d07 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -16,7 +16,6 @@ package main import ( "context" "fmt" - "github.com/aws/aws-sdk-go-v2/config" "log" "os" "os/signal" @@ -31,6 +30,8 @@ import ( "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/config" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" tea "github.com/charmbracelet/bubbletea" "github.com/spf13/cobra" @@ -247,7 +248,18 @@ Full docs can be found at github.com/aws/amazon-` + binName } ctx := context.Background() - cfg, err := config.LoadDefaultConfig(ctx) + cfg, err := config.LoadDefaultConfig(ctx, + config.WithSharedConfigProfile( + aws.ToString( + cli.StringMe(flags[profile]), + ), + ), + config.WithRegion( + aws.ToString( + cli.StringMe(flags[region]), + ), + ), + ) if err != nil { fmt.Printf("Failed to load default AWS configuration: %s\n", err.Error()) os.Exit(1) From e3651b850cca9050a0c6f019191aec012e87ae06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:02:40 -0500 Subject: [PATCH 44/58] Bump github.com/aws/aws-sdk-go-v2/service/ec2 from 1.102.0 to 1.105.1 (#240) Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.102.0 to 1.105.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.102.0...service/ec2/v1.105.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 10 +++++----- go.sum | 16 ++++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index dd2c1b72..9dc8d8ed 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.44.289 - github.com/aws/aws-sdk-go-v2 v1.18.1 + github.com/aws/aws-sdk-go-v2 v1.19.0 github.com/aws/aws-sdk-go-v2/config v1.18.27 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 @@ -27,10 +27,10 @@ require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.26 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 // indirect diff --git a/go.sum b/go.sum index 38d9cc03..dafc4b42 100644 --- a/go.sum +++ b/go.sum @@ -2,24 +2,28 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.44.289 h1:5CVEjiHFvdiVlKPBzv0rjG4zH/21W/onT18R5AH/qx0= github.com/aws/aws-sdk-go v1.44.289/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.18.1 h1:+tefE750oAb7ZQGzla6bLkOwfcQCEtC5y2RqoqCeqKo= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= +github.com/aws/aws-sdk-go-v2 v1.19.0 h1:klAT+y3pGFBU/qVf1uzwttpBbiuozJYWzNLHioyDJ+k= +github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2/config v1.18.27 h1:Az9uLwmssTE6OGTpsFqOnaGpLnKDqNYOJzWuC6UAYzA= github.com/aws/aws-sdk-go-v2/config v1.18.27/go.mod h1:0My+YgmkGxeqjXZb5BYme5pc4drjTnM+x1GJ3zv42Nw= github.com/aws/aws-sdk-go-v2/credentials v1.13.26 h1:qmU+yhKmOCyujmuPY7tf5MxR/RKyZrOPO3V4DobiTUk= github.com/aws/aws-sdk-go-v2/credentials v1.13.26/go.mod h1:GoXt2YC8jHUBbA4jr+W3JiemnIbkXOfxSXcisUsZ3os= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 h1:LxK/bitrAr4lnh9LnIS6i7zWbCOdMsfzKFBI6LUCS0I= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4/go.mod h1:E1hLXN/BL2e6YizK1zFlYd8vsfi2GTjbjBazinMmeaM= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34 h1:A5UqQEmPaCFpedKouS4v+dHCTUo2sKqhoKO9U5kxyWo= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28 h1:srIVS45eQuewqz6fKKu6ZGXaq6FuFg5NzgQBAM6g8Y4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 h1:hMUCiE3Zi5AHrRNGf5j985u0WyqI6r2NULhUfo0N/No= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35/go.mod h1:ipR5PvpSPqIqL5Mi82BxLnfMkHVbmco8kUwO2xrCi0M= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 h1:yOpYx+FTBdpk/g+sBU6Cb1H0U/TLEcYYp66mYqsPpcc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29/go.mod h1:M/eUABlDbw2uVrdAn+UsI6M727qp2fxkp8K0ejcBDUY= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35/go.mod h1:0Eg1YjxE0Bhn56lx+SHJwCzhW+2JGtizsrx+lCqrfm0= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0 h1:P4dyjm49F2kKws0FpouBC6fjVImACXKt752+CWa01lM= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.102.0/go.mod h1:tIctCeX9IbzsUTKHt53SVEcgyfxV2ElxJeEB+QUbc4M= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28 h1:bkRyG4a929RCnpVSTvLM2j/T4ls015ZhhYApbmYs15s= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 h1:wqbUi9viWc1M5ycr75LnFUIOvWgE3EDFvExtGPF6DHI= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1/go.mod h1:/0btVmMZJ0sn9JQ2N96XszlQNeRCJhhXOS/sPZgDeew= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28/go.mod h1:jj7znCIg05jXlaGBlFMGP8+7UN3VtCkRBG2spnmRQkU= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29 h1:IiDolu/eLmuB18DRZibj77n1hHQT7z12jnGO7Ze3pLc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29/go.mod h1:fDbkK4o7fpPXWn8YAPmTieAMuB9mk/VgvW64uaUqxd4= github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 h1:x5gKeerbKIQ/tdhmaAGNpivSfmb+p2rdt0wyjCGz+4Q= github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0/go.mod h1:JjpnqJdEW/5An429Ou+5Kb3UkwjXv16gRD2ZdGA2Gw8= github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 h1:nneMBM2p79PGWBQovYO/6Xnc2ryRMw3InnDJq1FHkSY= From 99a43bfcd138986498d4e63a951db3350115cb5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:48:25 -0500 Subject: [PATCH 45/58] Bump github.com/aws/aws-sdk-go from 1.44.289 to 1.44.306 (#241) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.289 to 1.44.306. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.289...v1.44.306) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9dc8d8ed..be4b0a06 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.20 require ( - github.com/aws/aws-sdk-go v1.44.289 + github.com/aws/aws-sdk-go v1.44.306 github.com/aws/aws-sdk-go-v2 v1.19.0 github.com/aws/aws-sdk-go-v2/config v1.18.27 github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 diff --git a/go.sum b/go.sum index dafc4b42..c050f91e 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.289 h1:5CVEjiHFvdiVlKPBzv0rjG4zH/21W/onT18R5AH/qx0= -github.com/aws/aws-sdk-go v1.44.289/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.44.306 h1:H487V/1N09BDxeGR7oR+LloC2uUpmf4atmqJaBgQOIs= +github.com/aws/aws-sdk-go v1.44.306/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.19.0 h1:klAT+y3pGFBU/qVf1uzwttpBbiuozJYWzNLHioyDJ+k= github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From af8875da6def3c2e93d6b3a6721f33bc1ac69299 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 09:51:54 -0500 Subject: [PATCH 46/58] Bump github.com/aws/aws-sdk-go from 1.44.306 to 1.45.6 (#264) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.44.306 to 1.45.6. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.44.306...v1.45.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index be4b0a06..c19eaeef 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.20 require ( - github.com/aws/aws-sdk-go v1.44.306 + github.com/aws/aws-sdk-go v1.45.6 github.com/aws/aws-sdk-go-v2 v1.19.0 github.com/aws/aws-sdk-go-v2/config v1.18.27 github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 diff --git a/go.sum b/go.sum index c050f91e..236adbd5 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.44.306 h1:H487V/1N09BDxeGR7oR+LloC2uUpmf4atmqJaBgQOIs= -github.com/aws/aws-sdk-go v1.44.306/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= +github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.19.0 h1:klAT+y3pGFBU/qVf1uzwttpBbiuozJYWzNLHioyDJ+k= github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= From b358e0d1b452d29e7a6664e528fc325fe82749a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:12:57 -0500 Subject: [PATCH 47/58] Bump github.com/aws/aws-sdk-go-v2/config from 1.18.27 to 1.18.39 (#263) Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.27 to 1.18.39. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.18.27...config/v1.18.39) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 24 ++++++++++++------------ go.sum | 44 ++++++++++++++++++++++++-------------------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/go.mod b/go.mod index c19eaeef..85849a05 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.45.6 - github.com/aws/aws-sdk-go-v2 v1.19.0 - github.com/aws/aws-sdk-go-v2/config v1.18.27 + github.com/aws/aws-sdk-go-v2 v1.21.0 + github.com/aws/aws-sdk-go-v2/config v1.18.39 github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 github.com/blang/semver/v4 v4.0.0 @@ -25,16 +25,16 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.26 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 // indirect - github.com/aws/smithy-go v1.13.5 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.37 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 // indirect + github.com/aws/smithy-go v1.14.2 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index 236adbd5..221e814e 100644 --- a/go.sum +++ b/go.sum @@ -3,37 +3,41 @@ github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2 v1.19.0 h1:klAT+y3pGFBU/qVf1uzwttpBbiuozJYWzNLHioyDJ+k= github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= -github.com/aws/aws-sdk-go-v2/config v1.18.27 h1:Az9uLwmssTE6OGTpsFqOnaGpLnKDqNYOJzWuC6UAYzA= -github.com/aws/aws-sdk-go-v2/config v1.18.27/go.mod h1:0My+YgmkGxeqjXZb5BYme5pc4drjTnM+x1GJ3zv42Nw= -github.com/aws/aws-sdk-go-v2/credentials v1.13.26 h1:qmU+yhKmOCyujmuPY7tf5MxR/RKyZrOPO3V4DobiTUk= -github.com/aws/aws-sdk-go-v2/credentials v1.13.26/go.mod h1:GoXt2YC8jHUBbA4jr+W3JiemnIbkXOfxSXcisUsZ3os= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4 h1:LxK/bitrAr4lnh9LnIS6i7zWbCOdMsfzKFBI6LUCS0I= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.4/go.mod h1:E1hLXN/BL2e6YizK1zFlYd8vsfi2GTjbjBazinMmeaM= +github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= +github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= +github.com/aws/aws-sdk-go-v2/config v1.18.39 h1:oPVyh6fuu/u4OiW4qcuQyEtk7U7uuNBmHmJSLg1AJsQ= +github.com/aws/aws-sdk-go-v2/config v1.18.39/go.mod h1:+NH/ZigdPckFpgB1TRcRuWCB/Kbbvkxc/iNAKTq5RhE= +github.com/aws/aws-sdk-go-v2/credentials v1.13.37 h1:BvEdm09+ZEh2XtN+PVHPcYwKY3wIeB6pw7vPRM4M9/U= +github.com/aws/aws-sdk-go-v2/credentials v1.13.37/go.mod h1:ACLrdkd4CLZyXOghZ8IYumQbcooAcp2jo/s2xsFH8IM= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11/go.mod h1:TEPP4tENqBGO99KwVpV9MlOX4NSrSLP8u3KRy2CDwA8= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35 h1:hMUCiE3Zi5AHrRNGf5j985u0WyqI6r2NULhUfo0N/No= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35/go.mod h1:ipR5PvpSPqIqL5Mi82BxLnfMkHVbmco8kUwO2xrCi0M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29 h1:yOpYx+FTBdpk/g+sBU6Cb1H0U/TLEcYYp66mYqsPpcc= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29/go.mod h1:M/eUABlDbw2uVrdAn+UsI6M727qp2fxkp8K0ejcBDUY= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35 h1:LWA+3kDM8ly001vJ1X1waCuLJdtTl48gwkPKWy9sosI= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.35/go.mod h1:0Eg1YjxE0Bhn56lx+SHJwCzhW+2JGtizsrx+lCqrfm0= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 h1:GPUcE/Yq7Ur8YSUk6lVkoIMWnJNO0HT18GUzCWCgCI0= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42/go.mod h1:rzfdUlfA+jdgLDmPKjd3Chq9V7LVLYo1Nz++Wb91aRo= github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 h1:wqbUi9viWc1M5ycr75LnFUIOvWgE3EDFvExtGPF6DHI= github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1/go.mod h1:/0btVmMZJ0sn9JQ2N96XszlQNeRCJhhXOS/sPZgDeew= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.28/go.mod h1:jj7znCIg05jXlaGBlFMGP8+7UN3VtCkRBG2spnmRQkU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29 h1:IiDolu/eLmuB18DRZibj77n1hHQT7z12jnGO7Ze3pLc= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29/go.mod h1:fDbkK4o7fpPXWn8YAPmTieAMuB9mk/VgvW64uaUqxd4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 h1:CdzPW9kKitgIiLV1+MHobfR5Xg25iYnyzWZhyQuSlDI= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35/go.mod h1:QGF2Rs33W5MaN9gYdEQOBBFPLwTZkEhRwI33f7KIG0o= github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 h1:x5gKeerbKIQ/tdhmaAGNpivSfmb+p2rdt0wyjCGz+4Q= github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0/go.mod h1:JjpnqJdEW/5An429Ou+5Kb3UkwjXv16gRD2ZdGA2Gw8= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.12 h1:nneMBM2p79PGWBQovYO/6Xnc2ryRMw3InnDJq1FHkSY= -github.com/aws/aws-sdk-go-v2/service/sso v1.12.12/go.mod h1:HuCOxYsF21eKrerARYO6HapNeh9GBNq7fius2AcwodY= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12 h1:2qTR7IFk7/0IN/adSFhYu9Xthr0zVFTgBrmPldILn80= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.12/go.mod h1:E4VrHCPzmVB/KFXtqBGKb3c8zpbNBgKe3fisDNLAW5w= -github.com/aws/aws-sdk-go-v2/service/sts v1.19.2 h1:XFJ2Z6sNUUcAz9poj+245DMkrHE4h2j5I9/xD50RHfE= -github.com/aws/aws-sdk-go-v2/service/sts v1.19.2/go.mod h1:dp0yLPsLBOi++WTxzCjA/oZqi6NPIhoR+uF7GeMU9eg= -github.com/aws/smithy-go v1.13.5 h1:hgz0X/DX0dGqTYpGALqXJoRKRj5oQ7150i5FdTePzO8= +github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 h1:2PylFCfKCEDv6PeSN09pC/VUiRd10wi1VfHG5FrW0/g= +github.com/aws/aws-sdk-go-v2/service/sso v1.13.6/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 h1:pSB560BbVj9ZlJZF4WYj5zsytWHWKxg+NgyGV4B2L58= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4= +github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 h1:CQBFElb0LS8RojMJlxRSo/HXipvTZW2S44Lt9Mk2aYQ= +github.com/aws/aws-sdk-go-v2/service/sts v1.21.5/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= +github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= From 1b5ba39daf928ddd1aa0095a4912eaeff314eee5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:45:30 -0500 Subject: [PATCH 48/58] Bump github.com/aws/aws-sdk-go-v2/service/pricing from 1.20.0 to 1.21.6 (#258) Bumps [github.com/aws/aws-sdk-go-v2/service/pricing](https://github.com/aws/aws-sdk-go-v2) from 1.20.0 to 1.21.6. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.20.0...service/efs/v1.21.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/pricing dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 85849a05..ba4aa7d2 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.21.0 github.com/aws/aws-sdk-go-v2/config v1.18.39 github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 - github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 + github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 github.com/charmbracelet/bubbletea v0.24.2 diff --git a/go.sum b/go.sum index 221e814e..04027d66 100644 --- a/go.sum +++ b/go.sum @@ -2,7 +2,6 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.18.1/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= @@ -12,11 +11,9 @@ github.com/aws/aws-sdk-go-v2/credentials v1.13.37 h1:BvEdm09+ZEh2XtN+PVHPcYwKY3w github.com/aws/aws-sdk-go-v2/credentials v1.13.37/go.mod h1:ACLrdkd4CLZyXOghZ8IYumQbcooAcp2jo/s2xsFH8IM= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11/go.mod h1:TEPP4tENqBGO99KwVpV9MlOX4NSrSLP8u3KRy2CDwA8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.34/go.mod h1:wZpTEecJe0Btj3IYnDx/VlUzor9wm3fJHyvLpQF0VwY= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35/go.mod h1:ipR5PvpSPqIqL5Mi82BxLnfMkHVbmco8kUwO2xrCi0M= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.28/go.mod h1:7VRpKQQedkfIEXb4k52I7swUnZP0wohVajJMRn3vsUw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29/go.mod h1:M/eUABlDbw2uVrdAn+UsI6M727qp2fxkp8K0ejcBDUY= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= @@ -27,8 +24,8 @@ github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1/go.mod h1:/0btVmMZJ0sn9JQ2N96X github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29/go.mod h1:fDbkK4o7fpPXWn8YAPmTieAMuB9mk/VgvW64uaUqxd4= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 h1:CdzPW9kKitgIiLV1+MHobfR5Xg25iYnyzWZhyQuSlDI= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35/go.mod h1:QGF2Rs33W5MaN9gYdEQOBBFPLwTZkEhRwI33f7KIG0o= -github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0 h1:x5gKeerbKIQ/tdhmaAGNpivSfmb+p2rdt0wyjCGz+4Q= -github.com/aws/aws-sdk-go-v2/service/pricing v1.20.0/go.mod h1:JjpnqJdEW/5An429Ou+5Kb3UkwjXv16gRD2ZdGA2Gw8= +github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 h1:k/f3T13s7wx/By6aKovlVsjdNkRVT0QRR2RlZEvaTGg= +github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6/go.mod h1:9n3tkRCngy3+Iw/8vK3C69iXh22SCGsy3yn16nTxH+s= github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 h1:2PylFCfKCEDv6PeSN09pC/VUiRd10wi1VfHG5FrW0/g= github.com/aws/aws-sdk-go-v2/service/sso v1.13.6/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 h1:pSB560BbVj9ZlJZF4WYj5zsytWHWKxg+NgyGV4B2L58= From dc30b48e1334f5afbf0b097a2ecd0548f17d82bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:41:03 -0500 Subject: [PATCH 49/58] Bump github.com/aws/aws-sdk-go-v2/service/ec2 from 1.105.1 to 1.117.0 (#265) Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.105.1 to 1.117.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.105.1...service/ec2/v1.117.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index ba4aa7d2..1e872d9b 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/aws/aws-sdk-go v1.45.6 github.com/aws/aws-sdk-go-v2 v1.21.0 github.com/aws/aws-sdk-go-v2/config v1.18.39 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 diff --git a/go.sum b/go.sum index 04027d66..70eb39df 100644 --- a/go.sum +++ b/go.sum @@ -2,7 +2,6 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.19.0/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw= github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= github.com/aws/aws-sdk-go-v2/config v1.18.39 h1:oPVyh6fuu/u4OiW4qcuQyEtk7U7uuNBmHmJSLg1AJsQ= @@ -11,17 +10,14 @@ github.com/aws/aws-sdk-go-v2/credentials v1.13.37 h1:BvEdm09+ZEh2XtN+PVHPcYwKY3w github.com/aws/aws-sdk-go-v2/credentials v1.13.37/go.mod h1:ACLrdkd4CLZyXOghZ8IYumQbcooAcp2jo/s2xsFH8IM= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11/go.mod h1:TEPP4tENqBGO99KwVpV9MlOX4NSrSLP8u3KRy2CDwA8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.35/go.mod h1:ipR5PvpSPqIqL5Mi82BxLnfMkHVbmco8kUwO2xrCi0M= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.29/go.mod h1:M/eUABlDbw2uVrdAn+UsI6M727qp2fxkp8K0ejcBDUY= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 h1:GPUcE/Yq7Ur8YSUk6lVkoIMWnJNO0HT18GUzCWCgCI0= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42/go.mod h1:rzfdUlfA+jdgLDmPKjd3Chq9V7LVLYo1Nz++Wb91aRo= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1 h1:wqbUi9viWc1M5ycr75LnFUIOvWgE3EDFvExtGPF6DHI= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.105.1/go.mod h1:/0btVmMZJ0sn9JQ2N96XszlQNeRCJhhXOS/sPZgDeew= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.29/go.mod h1:fDbkK4o7fpPXWn8YAPmTieAMuB9mk/VgvW64uaUqxd4= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0 h1:Yq39vbwQX+Xw+Ubcsg/ElwO+TWAxAIAdrREtpjGnCHw= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0/go.mod h1:0FhI2Rzcv5BNM3dNnbcCx2qa2naFZoAidJi11cQgzL0= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 h1:CdzPW9kKitgIiLV1+MHobfR5Xg25iYnyzWZhyQuSlDI= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35/go.mod h1:QGF2Rs33W5MaN9gYdEQOBBFPLwTZkEhRwI33f7KIG0o= github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 h1:k/f3T13s7wx/By6aKovlVsjdNkRVT0QRR2RlZEvaTGg= @@ -32,7 +28,6 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 h1:pSB560BbVj9ZlJZF4WYj5zsy github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4= github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 h1:CQBFElb0LS8RojMJlxRSo/HXipvTZW2S44Lt9Mk2aYQ= github.com/aws/aws-sdk-go-v2/service/sts v1.21.5/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU= -github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= From d989c5d76f0efd358df4c5d1ad0bc0261ff53b95 Mon Sep 17 00:00:00 2001 From: Joel Vasquez Villalobos Date: Fri, 6 Oct 2023 09:02:57 -0500 Subject: [PATCH 50/58] Update README.md (#174) --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7b5bd3a9..fb985c8d 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,9 @@ brew install ec2-instance-selector #### Install w/ Curl for Linux/Mac ``` -curl -Lo ec2-instance-selector https://github.com/aws/amazon-ec2-instance-selector/releases/download/v2.4.1/ec2-instance-selector-`uname | tr '[:upper:]' '[:lower:]'`-amd64 && chmod +x ec2-instance-selector +$ curl -Lo ec2-instance-selector https://github.com/aws/amazon-ec2-instance-selector/releases/download/v2.4.1/ec2-instance-selector-`uname | tr '[:upper:]' '[:lower:]'`-amd64 && chmod +x ec2-instance-selector +$ sudo mv ec2-instance-selector /usr/local/bin/ +$ ec2-instance-selector --version ``` To execute the CLI, you will need AWS credentials configured. Take a look at the [AWS CLI configuration documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#config-settings-and-precedence) for details on the various ways to configure credentials. An easy way to try out the ec2-instance-selector CLI is to populate the following environment variables with your AWS API credentials. From b1a72420cbb18e310a85a2df89e64f22c087d1f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:13:02 -0500 Subject: [PATCH 51/58] Bump github.com/aws/aws-sdk-go from 1.45.6 to 1.46.6 (#286) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.45.6 to 1.46.6. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.45.6...v1.46.6) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1e872d9b..86df991e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/aws/amazon-ec2-instance-selector/v2 go 1.20 require ( - github.com/aws/aws-sdk-go v1.45.6 + github.com/aws/aws-sdk-go v1.46.6 github.com/aws/aws-sdk-go-v2 v1.21.0 github.com/aws/aws-sdk-go-v2/config v1.18.39 github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0 diff --git a/go.sum b/go.sum index 70eb39df..a04b6e84 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.45.6 h1:Y2isQQBZsnO15dzUQo9YQRThtHgrV200XCH05BRHVJI= -github.com/aws/aws-sdk-go v1.45.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.46.6 h1:6wFnNC9hETIZLMf6SOTN7IcclrOGwp/n9SLp8Pjt6E8= +github.com/aws/aws-sdk-go v1.46.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= github.com/aws/aws-sdk-go-v2/config v1.18.39 h1:oPVyh6fuu/u4OiW4qcuQyEtk7U7uuNBmHmJSLg1AJsQ= From fcb37fa5970181447ebb35bf946fddd99fb011d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:49:32 -0500 Subject: [PATCH 52/58] Bump github.com/aws/aws-sdk-go-v2/service/ec2 from 1.117.0 to 1.128.0 (#287) Bumps [github.com/aws/aws-sdk-go-v2/service/ec2](https://github.com/aws/aws-sdk-go-v2) from 1.117.0 to 1.128.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/ec2/v1.117.0...service/ec2/v1.128.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/ec2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 12 ++++++------ go.sum | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 86df991e..15b15548 100644 --- a/go.mod +++ b/go.mod @@ -4,9 +4,9 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.46.6 - github.com/aws/aws-sdk-go-v2 v1.21.0 + github.com/aws/aws-sdk-go-v2 v1.21.2 github.com/aws/aws-sdk-go-v2/config v1.18.39 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 github.com/blang/semver/v4 v4.0.0 github.com/charmbracelet/bubbles v0.16.1 @@ -27,14 +27,14 @@ require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.13.37 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 // indirect - github.com/aws/smithy-go v1.14.2 // indirect + github.com/aws/smithy-go v1.15.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index a04b6e84..7c486314 100644 --- a/go.sum +++ b/go.sum @@ -2,24 +2,28 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.46.6 h1:6wFnNC9hETIZLMf6SOTN7IcclrOGwp/n9SLp8Pjt6E8= github.com/aws/aws-sdk-go v1.46.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.21.0 h1:gMT0IW+03wtYJhRqTVYn0wLzwdnK9sRMcxmtfGzRdJc= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= +github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= +github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= github.com/aws/aws-sdk-go-v2/config v1.18.39 h1:oPVyh6fuu/u4OiW4qcuQyEtk7U7uuNBmHmJSLg1AJsQ= github.com/aws/aws-sdk-go-v2/config v1.18.39/go.mod h1:+NH/ZigdPckFpgB1TRcRuWCB/Kbbvkxc/iNAKTq5RhE= github.com/aws/aws-sdk-go-v2/credentials v1.13.37 h1:BvEdm09+ZEh2XtN+PVHPcYwKY3wIeB6pw7vPRM4M9/U= github.com/aws/aws-sdk-go-v2/credentials v1.13.37/go.mod h1:ACLrdkd4CLZyXOghZ8IYumQbcooAcp2jo/s2xsFH8IM= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11/go.mod h1:TEPP4tENqBGO99KwVpV9MlOX4NSrSLP8u3KRy2CDwA8= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41 h1:22dGT7PneFMx4+b3pz7lMTRyN8ZKH7M2cW4GP9yUS2g= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35 h1:SijA0mgjV8E+8G45ltVHs0fvKpTj8xmZJ3VwhGKtUSI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 h1:GPUcE/Yq7Ur8YSUk6lVkoIMWnJNO0HT18GUzCWCgCI0= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42/go.mod h1:rzfdUlfA+jdgLDmPKjd3Chq9V7LVLYo1Nz++Wb91aRo= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0 h1:Yq39vbwQX+Xw+Ubcsg/ElwO+TWAxAIAdrREtpjGnCHw= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.117.0/go.mod h1:0FhI2Rzcv5BNM3dNnbcCx2qa2naFZoAidJi11cQgzL0= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35 h1:CdzPW9kKitgIiLV1+MHobfR5Xg25iYnyzWZhyQuSlDI= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 h1:JCUTmTs7W1yvUCOdONMX7Hjgn7N9pj57y4/ibU4KFp4= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0/go.mod h1:raUdIDoNuDPn9dMG3cCmIm8RoWOmZUqQPzuw8xpmB8Y= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35/go.mod h1:QGF2Rs33W5MaN9gYdEQOBBFPLwTZkEhRwI33f7KIG0o= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 h1:k/f3T13s7wx/By6aKovlVsjdNkRVT0QRR2RlZEvaTGg= github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6/go.mod h1:9n3tkRCngy3+Iw/8vK3C69iXh22SCGsy3yn16nTxH+s= github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 h1:2PylFCfKCEDv6PeSN09pC/VUiRd10wi1VfHG5FrW0/g= @@ -28,8 +32,9 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 h1:pSB560BbVj9ZlJZF4WYj5zsy github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4= github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 h1:CQBFElb0LS8RojMJlxRSo/HXipvTZW2S44Lt9Mk2aYQ= github.com/aws/aws-sdk-go-v2/service/sts v1.21.5/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU= -github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= +github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= From 9a0ae7e7776cc51964b89eddc8df6ee8b56c6846 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:10:20 -0500 Subject: [PATCH 53/58] Bump github.com/aws/aws-sdk-go-v2/config from 1.18.39 to 1.19.1 (#288) Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.18.39 to 1.19.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/v1.19.1/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/config/v1.18.39...v1.19.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 14 +++++++------- go.sum | 29 ++++++++++++++--------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 15b15548..43ee5318 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.46.6 github.com/aws/aws-sdk-go-v2 v1.21.2 - github.com/aws/aws-sdk-go-v2/config v1.18.39 + github.com/aws/aws-sdk-go-v2/config v1.19.1 github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 github.com/blang/semver/v4 v4.0.0 @@ -25,15 +25,15 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.37 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.13.43 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect github.com/aws/smithy-go v1.15.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect diff --git a/go.sum b/go.sum index 7c486314..0feaec7a 100644 --- a/go.sum +++ b/go.sum @@ -5,33 +5,32 @@ github.com/aws/aws-sdk-go v1.46.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Ph github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= -github.com/aws/aws-sdk-go-v2/config v1.18.39 h1:oPVyh6fuu/u4OiW4qcuQyEtk7U7uuNBmHmJSLg1AJsQ= -github.com/aws/aws-sdk-go-v2/config v1.18.39/go.mod h1:+NH/ZigdPckFpgB1TRcRuWCB/Kbbvkxc/iNAKTq5RhE= -github.com/aws/aws-sdk-go-v2/credentials v1.13.37 h1:BvEdm09+ZEh2XtN+PVHPcYwKY3wIeB6pw7vPRM4M9/U= -github.com/aws/aws-sdk-go-v2/credentials v1.13.37/go.mod h1:ACLrdkd4CLZyXOghZ8IYumQbcooAcp2jo/s2xsFH8IM= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11 h1:uDZJF1hu0EVT/4bogChk8DyjSF6fof6uL/0Y26Ma7Fg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.11/go.mod h1:TEPP4tENqBGO99KwVpV9MlOX4NSrSLP8u3KRy2CDwA8= +github.com/aws/aws-sdk-go-v2/config v1.19.1 h1:oe3vqcGftyk40icfLymhhhNysAwk0NfiwkDi2GTPMXs= +github.com/aws/aws-sdk-go-v2/config v1.19.1/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= +github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8= +github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42 h1:GPUcE/Yq7Ur8YSUk6lVkoIMWnJNO0HT18GUzCWCgCI0= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.42/go.mod h1:rzfdUlfA+jdgLDmPKjd3Chq9V7LVLYo1Nz++Wb91aRo= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4= +github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 h1:JCUTmTs7W1yvUCOdONMX7Hjgn7N9pj57y4/ibU4KFp4= github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0/go.mod h1:raUdIDoNuDPn9dMG3cCmIm8RoWOmZUqQPzuw8xpmB8Y= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.35/go.mod h1:QGF2Rs33W5MaN9gYdEQOBBFPLwTZkEhRwI33f7KIG0o= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 h1:k/f3T13s7wx/By6aKovlVsjdNkRVT0QRR2RlZEvaTGg= github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6/go.mod h1:9n3tkRCngy3+Iw/8vK3C69iXh22SCGsy3yn16nTxH+s= -github.com/aws/aws-sdk-go-v2/service/sso v1.13.6 h1:2PylFCfKCEDv6PeSN09pC/VUiRd10wi1VfHG5FrW0/g= -github.com/aws/aws-sdk-go-v2/service/sso v1.13.6/go.mod h1:fIAwKQKBFu90pBxx07BFOMJLpRUGu8VOzLJakeY+0K4= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6 h1:pSB560BbVj9ZlJZF4WYj5zsytWHWKxg+NgyGV4B2L58= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.6/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4= -github.com/aws/aws-sdk-go-v2/service/sts v1.21.5 h1:CQBFElb0LS8RojMJlxRSo/HXipvTZW2S44Lt9Mk2aYQ= -github.com/aws/aws-sdk-go-v2/service/sts v1.21.5/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU= +github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k= +github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= +github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU= +github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= From 96881cf99d80b3bae0ce322051f54e872f2bbc7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Dec 2023 12:01:29 -0500 Subject: [PATCH 54/58] Bump github.com/aws/aws-sdk-go-v2 from 1.21.2 to 1.24.0 (#309) Bumps [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) from 1.21.2 to 1.24.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.21.2...v1.24.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 43ee5318..ef69ef5e 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.46.6 - github.com/aws/aws-sdk-go-v2 v1.21.2 + github.com/aws/aws-sdk-go-v2 v1.24.0 github.com/aws/aws-sdk-go-v2/config v1.19.1 github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 @@ -34,7 +34,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect - github.com/aws/smithy-go v1.15.0 // indirect + github.com/aws/smithy-go v1.19.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index 0feaec7a..6c78eb09 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,9 @@ github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn github.com/aws/aws-sdk-go v1.46.6 h1:6wFnNC9hETIZLMf6SOTN7IcclrOGwp/n9SLp8Pjt6E8= github.com/aws/aws-sdk-go v1.46.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= -github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= +github.com/aws/aws-sdk-go-v2 v1.24.0 h1:890+mqQ+hTpNuw0gGP6/4akolQkSToDJgHfQE7AwGuk= +github.com/aws/aws-sdk-go-v2 v1.24.0/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= github.com/aws/aws-sdk-go-v2/config v1.19.1 h1:oe3vqcGftyk40icfLymhhhNysAwk0NfiwkDi2GTPMXs= github.com/aws/aws-sdk-go-v2/config v1.19.1/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8= @@ -32,8 +33,9 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSW github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU= github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= +github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= From 14d4dfcbaadfe9a1c389c823df8eb7b142f2c997 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Dec 2023 12:05:52 -0500 Subject: [PATCH 55/58] Bump github.com/aws/aws-sdk-go-v2/config from 1.19.1 to 1.26.1 (#312) Bumps [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) from 1.19.1 to 1.26.1. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.19.1...config/v1.26.1) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/config dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 21 +++++++++++---------- go.sum | 39 ++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index ef69ef5e..8742f9fe 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/aws/aws-sdk-go v1.46.6 github.com/aws/aws-sdk-go-v2 v1.24.0 - github.com/aws/aws-sdk-go-v2/config v1.19.1 + github.com/aws/aws-sdk-go-v2/config v1.26.1 github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 github.com/blang/semver/v4 v4.0.0 @@ -25,15 +25,16 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.13.43 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.16.12 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 // indirect github.com/aws/smithy-go v1.19.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect diff --git a/go.sum b/go.sum index 6c78eb09..c8af1d45 100644 --- a/go.sum +++ b/go.sum @@ -6,32 +6,37 @@ github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pf github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= github.com/aws/aws-sdk-go-v2 v1.24.0 h1:890+mqQ+hTpNuw0gGP6/4akolQkSToDJgHfQE7AwGuk= github.com/aws/aws-sdk-go-v2 v1.24.0/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= -github.com/aws/aws-sdk-go-v2/config v1.19.1 h1:oe3vqcGftyk40icfLymhhhNysAwk0NfiwkDi2GTPMXs= -github.com/aws/aws-sdk-go-v2/config v1.19.1/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= +github.com/aws/aws-sdk-go-v2/config v1.26.1 h1:z6DqMxclFGL3Zfo+4Q0rLnAZ6yVkzCRxhRMsiRQnD1o= +github.com/aws/aws-sdk-go-v2/config v1.26.1/go.mod h1:ZB+CuKHRbb5v5F0oJtGdhFTelmrxd4iWO1lf0rQwSAg= +github.com/aws/aws-sdk-go-v2/credentials v1.16.12 h1:v/WgB8NxprNvr5inKIiVVrXPuuTegM+K8nncFkr1usU= +github.com/aws/aws-sdk-go-v2/credentials v1.16.12/go.mod h1:X21k0FjEJe+/pauud82HYiQbEr9jRKY3kXEIQ4hXeTQ= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 h1:w98BT5w+ao1/r5sUuiH6JkVzjowOKeOJRHERyy1vh58= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10/go.mod h1:K2WGI7vUvkIv1HoNbfBA1bvIZ+9kL3YVmWxeKuLQsiw= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 h1:v+HbZaCGmOwnTTVS86Fleq0vPzOd7tnJGbFhP0stNLs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9/go.mod h1:Xjqy+Nyj7VDLBtCMkQYOw1QYfAEZCVLrfI0ezve8wd4= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 h1:N94sVhRACtXyVcjXxrwK1SKFIJrA9pOJ5yu2eSHnmls= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9/go.mod h1:hqamLz7g1/4EJP+GH5NBhcUMLjW+gKLQabgyz6/7WAU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 h1:GrSw8s0Gs/5zZ0SX+gX4zQjRnRsMJDJ2sLur1gRBhEM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 h1:JCUTmTs7W1yvUCOdONMX7Hjgn7N9pj57y4/ibU4KFp4= github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0/go.mod h1:raUdIDoNuDPn9dMG3cCmIm8RoWOmZUqQPzuw8xpmB8Y= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 h1:Nf2sHxjMJR8CSImIVCONRi4g0Su3J+TSTbS7G0pUeMU= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9/go.mod h1:idky4TER38YIjr2cADF1/ugFMKvZV7p//pVeV5LZbF0= github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 h1:k/f3T13s7wx/By6aKovlVsjdNkRVT0QRR2RlZEvaTGg= github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6/go.mod h1:9n3tkRCngy3+Iw/8vK3C69iXh22SCGsy3yn16nTxH+s= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 h1:ldSFWz9tEHAwHNmjx2Cvy1MjP5/L9kNoR0skc6wyOOM= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.5/go.mod h1:CaFfXLYL376jgbP7VKC96uFcU8Rlavak0UlAwk1Dlhc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 h1:2k9KmFawS63euAkY4/ixVNsYYwrwnd5fIvgEKkfZFNM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5/go.mod h1:W+nd4wWDVkSUIox9bacmkBP5NMFQeTJ/xqNabpzSR38= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 h1:5UYvv8JUvllZsRnfrcMQ+hJ9jNICmcgKPAO1CER25Wg= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.5/go.mod h1:XX5gh4CB7wAs4KhcF46G6C8a2i7eupU19dcAAE+EydU= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= From fe73119e22985bd7194c8afa0b289de268ec50f5 Mon Sep 17 00:00:00 2001 From: "Manuel J. Bernal" Date: Mon, 14 Oct 2024 01:29:17 +0200 Subject: [PATCH 56/58] Update README.md (#335) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fb985c8d..f0b1e409 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,9 @@ brew install ec2-instance-selector #### Install w/ Curl for Linux/Mac ``` -$ curl -Lo ec2-instance-selector https://github.com/aws/amazon-ec2-instance-selector/releases/download/v2.4.1/ec2-instance-selector-`uname | tr '[:upper:]' '[:lower:]'`-amd64 && chmod +x ec2-instance-selector -$ sudo mv ec2-instance-selector /usr/local/bin/ -$ ec2-instance-selector --version +curl -Lo ec2-instance-selector https://github.com/aws/amazon-ec2-instance-selector/releases/download/v2.4.1/ec2-instance-selector-`uname | tr '[:upper:]' '[:lower:]'`-amd64 && chmod +x ec2-instance-selector +sudo mv ec2-instance-selector /usr/local/bin/ +ec2-instance-selector --version ``` To execute the CLI, you will need AWS credentials configured. Take a look at the [AWS CLI configuration documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#config-settings-and-precedence) for details on the various ways to configure credentials. An easy way to try out the ec2-instance-selector CLI is to populate the following environment variables with your AWS API credentials. From d938601a46c0f06d2de0d00fe76cecee18cb7b78 Mon Sep 17 00:00:00 2001 From: Brandon Wagner Date: Mon, 14 Oct 2024 11:40:57 -0400 Subject: [PATCH 57/58] fetch spot current price to speed up loading data without caching (#351) --- .github/workflows/ci.yaml | 2 +- Dockerfile | 2 +- README.md | 12 +- THIRD_PARTY_LICENSES | 266 +++++++++++++++++- cmd/main.go | 17 +- go.mod | 67 +++-- go.sum | 179 +++++------- pkg/ec2pricing/ec2pricing.go | 19 +- pkg/ec2pricing/ec2pricing_test.go | 9 +- pkg/ec2pricing/odpricing.go | 52 ++-- pkg/ec2pricing/spotpricing.go | 16 +- pkg/instancetypes/instancetypes.go | 29 +- pkg/selector/comparators.go | 30 +- .../outputs/bubbletea_internal_test.go | 8 +- pkg/selector/outputs/outputs.go | 2 +- pkg/selector/outputs/outputs_test.go | 4 +- pkg/selector/selector.go | 157 +++++------ pkg/selector/selector_test.go | 8 +- pkg/selector/services.go | 2 +- pkg/selector/types.go | 18 +- pkg/sorter/sorter_test.go | 4 +- test/e2e/run-test | 2 +- test/license-test/Dockerfile | 2 +- test/readme-test/readme-codeblocks.go | 3 +- test/readme-test/spellcheck-Dockerfile | 2 +- 25 files changed, 596 insertions(+), 316 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ceecfba3..873dfbac 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: EC2 Instance Selector CI and Release on: [push, pull_request, workflow_dispatch] env: - DEFAULT_GO_VERSION: ^1.18 + DEFAULT_GO_VERSION: ^1.23 GITHUB_USERNAME: ${{ secrets.EC2_BOT_GITHUB_USERNAME }} GITHUB_TOKEN: ${{ secrets.EC2_BOT_GITHUB_TOKEN }} DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/Dockerfile b/Dockerfile index 58e9b179..9195e802 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.20 as builder +FROM golang:1.23 as builder ## GOLANG env ARG GOPROXY="https://proxy.golang.org|direct" diff --git a/README.md b/README.md index f0b1e409..763a2030 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

A CLI tool and go library which recommends instance types based on resource criteria like vcpus and memory.

- + go-version @@ -25,7 +25,7 @@ ## Summary -There are over 270 different instance types available on EC2 which can make the process of selecting appropriate instance types difficult. Instance Selector helps you select compatible instance types for your application to run on. The command line interface can be passed resource criteria like vcpus, memory, network performance, and much more and then return the available, matching instance types. +There are over 800 different instance types available on EC2 which can make the process of selecting appropriate instance types difficult. Instance Selector helps you select compatible instance types for your application to run on. The command line interface can be passed resource criteria like vcpus, memory, network performance, and much more and then return the available, matching instance types. If you are using spot instances to save on costs, it is a best practice to use multiple instances types within your auto-scaling group (ASG) to ensure your application doesn't experience downtime due to one instance type being interrupted. Instance Selector will help to find a set of instance types that your application can run on. @@ -313,7 +313,7 @@ Filter Flags: -z, --availability-zones strings Availability zones or zone ids to check EC2 capacity offered in specific AZs --baremetal Bare Metal instance types (.metal instances) -b, --burst-support Burstable instance types - -a, --cpu-architecture string CPU architecture [x86_64/amd64, x86_64_mac, i386, or arm64] + -a, --cpu-architecture string CPU architecture [x86_64, amd64, x86_64_mac, i386, or arm64] --cpu-manufacturer string CPU manufacturer [amd, intel, aws] --current-generation Current generation instance types (explicitly set this to false to not return current generation instance types) --dedicated-hosts Dedicated Hosts supported @@ -334,6 +334,9 @@ Filter Flags: -e, --ena-support Instance types where ENA is supported or required -f, --fpga-support FPGA instance types --free-tier Free Tier supported + --generation int Generation of the instance type (i.e. c7i.xlarge is 7) (sets --generation-min and -max to the same value) + --generation-max int Maximum Generation of the instance type (i.e. c7i.xlarge is 7) If --generation-min is not specified, the lower bound will be 0 + --generation-min int Minimum Generation of the instance type (i.e. c7i.xlarge is 7) If --generation-max is not specified, the upper bound will be infinity --gpu-manufacturer string GPU Manufacturer name (Example: NVIDIA) --gpu-memory-total string Number of GPUs' total memory (Example: 4 GiB) (sets --gpu-memory-total-min and -max to the same value) --gpu-memory-total-max string Maximum Number of GPUs' total memory (Example: 4 GiB) If --gpu-memory-total-min is not specified, the lower bound will be 0 @@ -385,7 +388,8 @@ Suite Flags: Global Flags: --cache-dir string Directory to save the pricing and instance type caches (default "~/.ec2-instance-selector/") - --cache-ttl int Cache TTLs in hours for pricing and instance type caches. Setting the cache to 0 will turn off caching and cleanup any on-disk caches. (default 168) + --cache-ttl int Cache TTLs in hours for pricing and instance type caches. Setting the cache to 0 will turn off caching and cleanup any on-disk caches. + --debug Debug - prints debug log messages -h, --help Help --max-results int The maximum number of instance types that match your criteria to return (default 20) -o, --output string Specify the output format (table, table-wide, one-line, interactive) diff --git a/THIRD_PARTY_LICENSES b/THIRD_PARTY_LICENSES index c88ce953..a6b00ed2 100644 --- a/THIRD_PARTY_LICENSES +++ b/THIRD_PARTY_LICENSES @@ -818,8 +818,8 @@ THE SOFTWARE. ------ -** github.com/imdario/mergo; version v0.3.11 -- -https://github.com/imdario/mergo +** dario.cat/mergo; version v1.0.1 -- +dario.cat/mergo Copyright (c) 2013 Dario Castañé. All rights reserved. Copyright (c) 2012 The Go Authors. All rights reserved. @@ -1502,3 +1502,265 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------ + +** github.com/charmbracelet/x/term; v0.2.0 -- +github.com/charmbracelet/x/term + +MIT License + +Copyright (c) 2023 Charmbracelet, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +------ + +** github.com/charmbracelet/x/ansi; v0.2.3 -- +github.com/charmbracelet/x/ansi + +MIT License + +Copyright (c) 2023 Charmbracelet, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +------ + +** github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding; v1.12.0 -- +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/cmd/main.go b/cmd/main.go index e2490d07..a0d2f6fb 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -44,7 +44,9 @@ const ( defaultRegionEnvVar = "AWS_DEFAULT_REGION" defaultProfile = "default" awsConfigFile = "~/.aws/config" - spotPricingDaysBack = 30 + // 0 means the last price + // increasing this results in a lot more API calls to EC2 which can slow things down + spotPricingDaysBack = 0 tableOutput = "table" tableWideOutput = "table-wide" @@ -100,6 +102,8 @@ const ( freeTier = "free-tier" autoRecovery = "auto-recovery" dedicatedHosts = "dedicated-hosts" + debug = "debug" + generation = "generation" ) // Aggregate Filter Flags @@ -166,7 +170,7 @@ Full docs can be found at github.com/aws/amazon-` + binName cli.Int32MinMaxRangeFlags(vcpus, cli.StringMe("c"), nil, "Number of vcpus available to the instance type.") cli.ByteQuantityMinMaxRangeFlags(memory, cli.StringMe("m"), nil, "Amount of Memory available (Example: 4 GiB)") cli.RatioFlag(vcpusToMemoryRatio, nil, nil, "The ratio of vcpus to GiBs of memory. (Example: 1:2)") - 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"}) + 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"}) cli.StringOptionsFlag(cpuManufacturer, nil, nil, "CPU manufacturer [amd, intel, aws]", []string{"amd", "intel", "aws"}) cli.Int32MinMaxRangeFlags(gpus, cli.StringMe("g"), nil, "Total Number of GPUs (Example: 4)") cli.ByteQuantityMinMaxRangeFlags(gpuMemoryTotal, nil, nil, "Number of GPUs' total memory (Example: 4 GiB)") @@ -206,6 +210,7 @@ Full docs can be found at github.com/aws/amazon-` + binName cli.BoolFlag(freeTier, nil, nil, "Free Tier supported") cli.BoolFlag(autoRecovery, nil, nil, "EC2 Auto-Recovery supported") cli.BoolFlag(dedicatedHosts, nil, nil, "Dedicated Hosts supported") + cli.IntMinMaxRangeFlags(generation, nil, nil, "Generation of the instance type (i.e. c7i.xlarge is 7)") // Suite Flags - higher level aggregate filters that return opinionated result @@ -219,9 +224,10 @@ Full docs can be found at github.com/aws/amazon-` + binName cli.ConfigStringFlag(profile, nil, nil, "AWS CLI profile to use for credentials and config", nil) cli.ConfigStringFlag(region, cli.StringMe("r"), nil, "AWS Region to use for API requests (NOTE: if not passed in, uses AWS SDK default precedence)", nil) cli.ConfigStringFlag(output, cli.StringMe("o"), nil, fmt.Sprintf("Specify the output format (%s)", strings.Join(cliOutputTypes, ", ")), nil) - cli.ConfigIntFlag(cacheTTL, nil, env.WithDefaultInt("EC2_INSTANCE_SELECTOR_CACHE_TTL", 168), "Cache TTLs in hours for pricing and instance type caches. Setting the cache to 0 will turn off caching and cleanup any on-disk caches.") + cli.ConfigIntFlag(cacheTTL, nil, env.WithDefaultInt("EC2_INSTANCE_SELECTOR_CACHE_TTL", 0), "Cache TTLs in hours for pricing and instance type caches. Setting the cache to 0 will turn off caching and cleanup any on-disk caches.") cli.ConfigPathFlag(cacheDir, nil, env.WithDefaultString("EC2_INSTANCE_SELECTOR_CACHE_DIR", "~/.ec2-instance-selector/"), "Directory to save the pricing and instance type caches") cli.ConfigBoolFlag(verbose, cli.StringMe("v"), nil, "Verbose - will print out full instance specs") + cli.ConfigBoolFlag("debug", nil, nil, "Debug - prints debug log messages") cli.ConfigBoolFlag(help, cli.StringMe("h"), nil, "Help") cli.ConfigBoolFlag(version, nil, nil, "Prints CLI version") cli.ConfigStringOptionsFlag(sortDirection, nil, cli.StringMe(sorter.SortAscending), fmt.Sprintf("Specify the direction to sort in (%s)", strings.Join(cliSortDirections, ", ")), cliSortDirections) @@ -273,6 +279,10 @@ Full docs can be found at github.com/aws/amazon-` + binName fmt.Printf("An error occurred when initialising the ec2 selector: %v", err) os.Exit(1) } + if flags[debug] != nil { + debugLogger := log.New(os.Stdout, time.Now().UTC().Format(time.RFC3339)+" DEBUG ", 0) + instanceSelector.SetLogger(debugLogger) + } shutdown := func() { if err := instanceSelector.Save(); err != nil { log.Printf("There was an error saving pricing caches: %v", err) @@ -417,6 +427,7 @@ Full docs can be found at github.com/aws/amazon-` + binName FreeTier: cli.BoolMe(flags[freeTier]), AutoRecovery: cli.BoolMe(flags[autoRecovery]), DedicatedHosts: cli.BoolMe(flags[dedicatedHosts]), + Generation: cli.IntRangeMe(flags[generation]), } if flags[verbose] != nil { diff --git a/go.mod b/go.mod index 8742f9fe..f730ad02 100644 --- a/go.mod +++ b/go.mod @@ -1,56 +1,55 @@ module github.com/aws/amazon-ec2-instance-selector/v2 -go 1.20 +go 1.23 require ( - github.com/aws/aws-sdk-go v1.46.6 - github.com/aws/aws-sdk-go-v2 v1.24.0 - github.com/aws/aws-sdk-go-v2/config v1.26.1 - github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 - github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 + dario.cat/mergo v1.0.1 + github.com/aws/aws-sdk-go-v2 v1.32.2 + github.com/aws/aws-sdk-go-v2/config v1.27.43 + github.com/aws/aws-sdk-go-v2/service/ec2 v1.182.0 + github.com/aws/aws-sdk-go-v2/service/pricing v1.32.2 github.com/blang/semver/v4 v4.0.0 - github.com/charmbracelet/bubbles v0.16.1 - github.com/charmbracelet/bubbletea v0.24.2 - github.com/charmbracelet/lipgloss v0.7.1 - github.com/evertras/bubble-table v0.15.2 - github.com/imdario/mergo v0.3.16 + github.com/charmbracelet/bubbles v0.20.0 + github.com/charmbracelet/bubbletea v1.1.1 + github.com/charmbracelet/lipgloss v0.13.0 + github.com/evertras/bubble-table v0.17.0 github.com/mitchellh/go-homedir v1.1.0 github.com/muesli/termenv v0.15.2 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 go.uber.org/multierr v1.11.0 ) require ( github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.16.12 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 // indirect - github.com/aws/smithy-go v1.19.0 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.41 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 // indirect + github.com/aws/smithy-go v1.22.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect + github.com/charmbracelet/x/ansi v0.2.3 // indirect + github.com/charmbracelet/x/term v0.2.0 // indirect + github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-localereader v0.0.1 // indirect - github.com/mattn/go-runewidth v0.0.14 // indirect - github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect + github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/muesli/reflow v0.3.0 // indirect - github.com/rivo/uniseg v0.2.0 // indirect - github.com/sahilm/fuzzy v0.1.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.4.0 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/sahilm/fuzzy v0.1.1 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect + golang.org/x/text v0.16.0 // indirect ) diff --git a/go.sum b/go.sum index c8af1d45..debeb046 100644 --- a/go.sum +++ b/go.sum @@ -1,87 +1,75 @@ +dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= +dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4= github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/aws/aws-sdk-go v1.46.6 h1:6wFnNC9hETIZLMf6SOTN7IcclrOGwp/n9SLp8Pjt6E8= -github.com/aws/aws-sdk-go v1.46.6/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go-v2 v1.21.0/go.mod h1:/RfNgGmRxI+iFOB1OeJUyxiU+9s88k3pfHvDagGEp0M= -github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= -github.com/aws/aws-sdk-go-v2 v1.24.0 h1:890+mqQ+hTpNuw0gGP6/4akolQkSToDJgHfQE7AwGuk= -github.com/aws/aws-sdk-go-v2 v1.24.0/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= -github.com/aws/aws-sdk-go-v2/config v1.26.1 h1:z6DqMxclFGL3Zfo+4Q0rLnAZ6yVkzCRxhRMsiRQnD1o= -github.com/aws/aws-sdk-go-v2/config v1.26.1/go.mod h1:ZB+CuKHRbb5v5F0oJtGdhFTelmrxd4iWO1lf0rQwSAg= -github.com/aws/aws-sdk-go-v2/credentials v1.16.12 h1:v/WgB8NxprNvr5inKIiVVrXPuuTegM+K8nncFkr1usU= -github.com/aws/aws-sdk-go-v2/credentials v1.16.12/go.mod h1:X21k0FjEJe+/pauud82HYiQbEr9jRKY3kXEIQ4hXeTQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 h1:w98BT5w+ao1/r5sUuiH6JkVzjowOKeOJRHERyy1vh58= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10/go.mod h1:K2WGI7vUvkIv1HoNbfBA1bvIZ+9kL3YVmWxeKuLQsiw= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.41/go.mod h1:CrObHAuPneJBlfEJ5T3szXOUkLEThaGfvnhTf33buas= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 h1:v+HbZaCGmOwnTTVS86Fleq0vPzOd7tnJGbFhP0stNLs= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9/go.mod h1:Xjqy+Nyj7VDLBtCMkQYOw1QYfAEZCVLrfI0ezve8wd4= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.35/go.mod h1:SJC1nEVVva1g3pHAIdCp7QsRIkMmLAgoDquQ9Rr8kYw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 h1:N94sVhRACtXyVcjXxrwK1SKFIJrA9pOJ5yu2eSHnmls= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9/go.mod h1:hqamLz7g1/4EJP+GH5NBhcUMLjW+gKLQabgyz6/7WAU= -github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 h1:GrSw8s0Gs/5zZ0SX+gX4zQjRnRsMJDJ2sLur1gRBhEM= -github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0 h1:JCUTmTs7W1yvUCOdONMX7Hjgn7N9pj57y4/ibU4KFp4= -github.com/aws/aws-sdk-go-v2/service/ec2 v1.128.0/go.mod h1:raUdIDoNuDPn9dMG3cCmIm8RoWOmZUqQPzuw8xpmB8Y= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 h1:Nf2sHxjMJR8CSImIVCONRi4g0Su3J+TSTbS7G0pUeMU= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9/go.mod h1:idky4TER38YIjr2cADF1/ugFMKvZV7p//pVeV5LZbF0= -github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6 h1:k/f3T13s7wx/By6aKovlVsjdNkRVT0QRR2RlZEvaTGg= -github.com/aws/aws-sdk-go-v2/service/pricing v1.21.6/go.mod h1:9n3tkRCngy3+Iw/8vK3C69iXh22SCGsy3yn16nTxH+s= -github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 h1:ldSFWz9tEHAwHNmjx2Cvy1MjP5/L9kNoR0skc6wyOOM= -github.com/aws/aws-sdk-go-v2/service/sso v1.18.5/go.mod h1:CaFfXLYL376jgbP7VKC96uFcU8Rlavak0UlAwk1Dlhc= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 h1:2k9KmFawS63euAkY4/ixVNsYYwrwnd5fIvgEKkfZFNM= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5/go.mod h1:W+nd4wWDVkSUIox9bacmkBP5NMFQeTJ/xqNabpzSR38= -github.com/aws/aws-sdk-go-v2/service/sts v1.26.5 h1:5UYvv8JUvllZsRnfrcMQ+hJ9jNICmcgKPAO1CER25Wg= -github.com/aws/aws-sdk-go-v2/service/sts v1.26.5/go.mod h1:XX5gh4CB7wAs4KhcF46G6C8a2i7eupU19dcAAE+EydU= -github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= -github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= +github.com/aws/aws-sdk-go-v2 v1.32.2 h1:AkNLZEyYMLnx/Q/mSKkcMqwNFXMAvFto9bNsHqcTduI= +github.com/aws/aws-sdk-go-v2 v1.32.2/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo= +github.com/aws/aws-sdk-go-v2/config v1.27.43 h1:p33fDDihFC390dhhuv8nOmX419wjOSDQRb+USt20RrU= +github.com/aws/aws-sdk-go-v2/config v1.27.43/go.mod h1:pYhbtvg1siOOg8h5an77rXle9tVG8T+BWLWAo7cOukc= +github.com/aws/aws-sdk-go-v2/credentials v1.17.41 h1:7gXo+Axmp+R4Z+AK8YFQO0ZV3L0gizGINCOWxSLY9W8= +github.com/aws/aws-sdk-go-v2/credentials v1.17.41/go.mod h1:u4Eb8d3394YLubphT4jLEwN1rLNq2wFOlT6OuxFwPzU= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 h1:TMH3f/SCAWdNtXXVPPu5D6wrr4G5hI1rAxbcocKfC7Q= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17/go.mod h1:1ZRXLdTpzdJb9fwTMXiLipENRxkGMTn1sfKexGllQCw= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 h1:UAsR3xA31QGf79WzpG/ixT9FZvQlh5HY1NRqSHBNOCk= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21/go.mod h1:JNr43NFf5L9YaG3eKTm7HQzls9J+A9YYcGI5Quh1r2Y= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 h1:6jZVETqmYCadGFvrYEQfC5fAQmlo80CeL5psbno6r0s= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21/go.mod h1:1SR0GbLlnN3QUmYaflZNiH1ql+1qrSiB2vwcJ+4UM60= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.182.0 h1:LaeziEhHZ/SJZYBK223QVzl3ucHvA9IP4tQMcxGrc9I= +github.com/aws/aws-sdk-go-v2/service/ec2 v1.182.0/go.mod h1:kYXaB4FzyhEJjvrJ84oPnMElLiEAjGxxUunVW2tBSng= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 h1:s7NA1SOw8q/5c0wr8477yOPp0z+uBaXBnLE0XYb0POA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2/go.mod h1:fnjjWyAW/Pj5HYOxl9LJqWtEwS7W2qgcRLWP+uWbss0= +github.com/aws/aws-sdk-go-v2/service/pricing v1.32.2 h1:eBKzA9Te6JHD1TfVjuja7pa8iEdXVzW5z0QPcbrPhNs= +github.com/aws/aws-sdk-go-v2/service/pricing v1.32.2/go.mod h1:2Sg8KGFKp9zzUbY+XdUUEn7xjCzuRt8Zx4PHMwGzRvs= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 h1:bSYXVyUzoTHoKalBmwaZxs97HU9DWWI3ehHSAMa7xOk= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.2/go.mod h1:skMqY7JElusiOUjMJMOv1jJsP7YUg7DrhgqZZWuzu1U= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 h1:AhmO1fHINP9vFYUE0LHzCWg/LfUWUF+zFPEcY9QXb7o= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2/go.mod h1:o8aQygT2+MVP0NaV6kbdE1YnnIM8RRVQzoeUH45GOdI= +github.com/aws/aws-sdk-go-v2/service/sts v1.32.2 h1:CiS7i0+FUe+/YY1GvIBLLrR/XNGZ4CtM1Ll0XavNuVo= +github.com/aws/aws-sdk-go-v2/service/sts v1.32.2/go.mod h1:HtaiBI8CjYoNVde8arShXb94UbQQi9L4EMr6D+xGBwo= +github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM= +github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/charmbracelet/bubbles v0.16.1 h1:6uzpAAaT9ZqKssntbvZMlksWHruQLNxg49H5WdeuYSY= -github.com/charmbracelet/bubbles v0.16.1/go.mod h1:2QCp9LFlEsBQMvIYERr7Ww2H2bA7xen1idUDIzm/+Xc= -github.com/charmbracelet/bubbletea v0.24.2 h1:uaQIKx9Ai6Gdh5zpTbGiWpytMU+CfsPp06RaW2cx/SY= -github.com/charmbracelet/bubbletea v0.24.2/go.mod h1:XdrNrV4J8GiyshTtx3DNuYkR1FDaJmO3l2nejekbsgg= -github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= -github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= -github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 h1:q2hJAaP1k2wIvVRd/hEHD7lacgqrCPS+k8g1MndzfWY= -github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE= +github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU= +github.com/charmbracelet/bubbletea v1.1.1 h1:KJ2/DnmpfqFtDNVTvYZ6zpPFL9iRCRr0qqKOCvppbPY= +github.com/charmbracelet/bubbletea v1.1.1/go.mod h1:9Ogk0HrdbHolIKHdjfFpyXJmiCzGwy+FesYkZr7hYU4= +github.com/charmbracelet/lipgloss v0.13.0 h1:4X3PPeoWEDCMvzDvGmTajSyYPcZM4+y8sCA/SsA3cjw= +github.com/charmbracelet/lipgloss v0.13.0/go.mod h1:nw4zy0SBX/F/eAO1cWdcvy6qnkDUxr8Lw7dvFrAIbbY= +github.com/charmbracelet/x/ansi v0.2.3 h1:VfFN0NUpcjBRd4DnKfRaIRo53KRgey/nhOoEqosGDEY= +github.com/charmbracelet/x/ansi v0.2.3/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= +github.com/charmbracelet/x/term v0.2.0/go.mod h1:GVxgxAbjUrmpvIINHIQnJJKpMlHiZ4cktEQCN6GWyF0= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/evertras/bubble-table v0.15.2 h1:hVj27V9tk5TD5p6mVv0RK/KJu2sHq0U+mBMux/HptkU= -github.com/evertras/bubble-table v0.15.2/go.mod h1:SPOZKbIpyYWPHBNki3fyNpiPBQkvkULAtOT7NTD5fKY= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= -github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= +github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= +github.com/evertras/bubble-table v0.17.0 h1:qQU4bi3IRxuZ5+Fvm3esyU/ucH9ufRXWhWL0fFuMn9c= +github.com/evertras/bubble-table v0.17.0/go.mod h1:ifHujS1YxwnYSOgcR2+m3GnJ84f7CVU/4kUOxUCjEbQ= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= -github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b h1:1XF24mVaiu7u+CFywTdcDo2ie1pzzhwjt6RHqzpMU34= -github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= +github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= @@ -92,60 +80,31 @@ github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjG github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI= -github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/sahilm/fuzzy v0.1.1 h1:ceu5RHF8DGgoi+/dR5PsECjCDH1BE3Fnmpo7aVXOdRA= +github.com/sahilm/fuzzy v0.1.1/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/ec2pricing/ec2pricing.go b/pkg/ec2pricing/ec2pricing.go index 18e7f5fc..527713bf 100644 --- a/pkg/ec2pricing/ec2pricing.go +++ b/pkg/ec2pricing/ec2pricing.go @@ -15,6 +15,7 @@ package ec2pricing import ( "context" + "log" "time" "github.com/aws/aws-sdk-go-v2/aws" @@ -37,6 +38,7 @@ var ( type EC2Pricing struct { ODPricing *OnDemandPricing SpotPricing *SpotPricing + logger *log.Logger } // EC2PricingIface is the EC2Pricing interface mainly used to mock out ec2pricing during testing @@ -48,23 +50,20 @@ type EC2PricingIface interface { OnDemandCacheCount() int SpotCacheCount() int Save() error + SetLogger(*log.Logger) } // use us-east-1 since pricing only has endpoints in us-east-1 and ap-south-1 // TODO: In the future we may want to allow the client to select which endpoint is used through some mechanism -// but that would likely happen through overriding this entire function as its signature is fixed +// +// but that would likely happen through overriding this entire function as its signature is fixed func modifyPricingRegion(opt *pricing.Options) { opt.Region = "us-east-1" } // New creates an instance of instance-selector EC2Pricing func New(ctx context.Context, cfg aws.Config) (*EC2Pricing, error) { - pricingClient := pricing.NewFromConfig(cfg, modifyPricingRegion) - ec2Client := ec2.NewFromConfig(cfg) - return &EC2Pricing{ - ODPricing: LoadODCacheOrNew(ctx, pricingClient, cfg.Region, 0, ""), - SpotPricing: LoadSpotCacheOrNew(ctx, ec2Client, cfg.Region, 0, "", DefaultSpotDaysBack), - }, nil + return NewWithCache(ctx, cfg, 0, "") } func NewWithCache(ctx context.Context, cfg aws.Config, ttl time.Duration, cacheDir string) (*EC2Pricing, error) { @@ -76,6 +75,12 @@ func NewWithCache(ctx context.Context, cfg aws.Config, ttl time.Duration, cacheD }, nil } +func (p *EC2Pricing) SetLogger(logger *log.Logger) { + p.logger = logger + p.ODPricing.SetLogger(logger) + p.SpotPricing.SetLogger(logger) +} + // OnDemandCacheCount returns the number of items in the OD cache func (p *EC2Pricing) OnDemandCacheCount() int { return p.ODPricing.Count() diff --git a/pkg/ec2pricing/ec2pricing_test.go b/pkg/ec2pricing/ec2pricing_test.go index b1d67c96..cb695ab5 100644 --- a/pkg/ec2pricing/ec2pricing_test.go +++ b/pkg/ec2pricing/ec2pricing_test.go @@ -17,10 +17,11 @@ import ( "context" "encoding/json" "fmt" - ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "io/ioutil" + "os" "testing" + ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing" h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" "github.com/aws/aws-sdk-go-v2/service/ec2" @@ -57,7 +58,7 @@ func (m mockedSpotEC2) DescribeSpotPriceHistory(ctx context.Context, input *ec2. func setupOdMock(t *testing.T, api string, file string) mockedPricing { mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, api, file) - mockFile, err := ioutil.ReadFile(mockFilename) + mockFile, err := os.ReadFile(mockFilename) h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) switch api { case getProducts: @@ -77,7 +78,7 @@ func setupOdMock(t *testing.T, api string, file string) mockedPricing { func setupEc2Mock(t *testing.T, api string, file string) mockedSpotEC2 { mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, api, file) - mockFile, err := ioutil.ReadFile(mockFilename) + mockFile, err := os.ReadFile(mockFilename) h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) switch api { case describeSpotPriceHistory: diff --git a/pkg/ec2pricing/odpricing.go b/pkg/ec2pricing/odpricing.go index 19cde3c7..7d1a0eeb 100644 --- a/pkg/ec2pricing/odpricing.go +++ b/pkg/ec2pricing/odpricing.go @@ -18,19 +18,17 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "log" "os" "path/filepath" "strconv" - "strings" "sync" "time" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/aws/aws-sdk-go-v2/service/pricing" pricingtypes "github.com/aws/aws-sdk-go-v2/service/pricing/types" - "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/mitchellh/go-homedir" "github.com/patrickmn/go-cache" "go.uber.org/multierr" @@ -46,6 +44,7 @@ type OnDemandPricing struct { DirectoryPath string cache *cache.Cache pricingClient pricing.GetProductsAPIClient + logger *log.Logger sync.RWMutex } @@ -96,6 +95,7 @@ func LoadODCacheOrNew(ctx context.Context, pricingClient pricing.GetProductsAPIC DirectoryPath: directoryPath, cache: cache.New(fullRefreshTTL, fullRefreshTTL), pricingClient: pricingClient, + logger: log.New(io.Discard, "", 0), } } odPricing := &OnDemandPricing{ @@ -104,6 +104,7 @@ func LoadODCacheOrNew(ctx context.Context, pricingClient pricing.GetProductsAPIC DirectoryPath: expandedDirPath, pricingClient: pricingClient, cache: cache.New(fullRefreshTTL, fullRefreshTTL), + logger: log.New(io.Discard, "", 0), } if fullRefreshTTL <= 0 { odPricing.Clear() @@ -152,6 +153,10 @@ func odCacheRefreshJob(ctx context.Context, odPricing *OnDemandPricing) { } } +func (c *OnDemandPricing) SetLogger(logger *log.Logger) { + c.logger = logger +} + func (c *OnDemandPricing) Refresh(ctx context.Context) error { c.Lock() defer c.Unlock() @@ -198,7 +203,7 @@ func (c *OnDemandPricing) Save() error { if err := os.Mkdir(c.DirectoryPath, 0755); err != nil && !errors.Is(err, os.ErrExist) { return err } - return ioutil.WriteFile(getODCacheFilePath(c.Region, c.DirectoryPath), cacheBytes, 0644) + return os.WriteFile(getODCacheFilePath(c.Region, c.DirectoryPath), cacheBytes, 0644) } func (c *OnDemandPricing) Clear() error { @@ -212,6 +217,11 @@ func (c *OnDemandPricing) Clear() error { // // or, if instanceType is specified, it can request a specific instance type pricing func (c *OnDemandPricing) fetchOnDemandPricing(ctx context.Context, instanceType ec2types.InstanceType) (map[string]float64, error) { + start := time.Now() + calls := 0 + defer func() { + c.logger.Printf("Took %s and %d calls to collect OD pricing", time.Since(start), calls) + }() odPricing := map[string]float64{} productInput := pricing.GetProductsInput{ ServiceCode: c.StringMe(serviceCode), @@ -222,9 +232,10 @@ func (c *OnDemandPricing) fetchOnDemandPricing(ctx context.Context, instanceType p := pricing.NewGetProductsPaginator(c.pricingClient, &productInput) for p.HasMorePages() { + calls++ pricingOutput, err := p.NextPage(ctx) if err != nil { - return nil, fmt.Errorf("failed to get a page, %w", err) + return nil, fmt.Errorf("failed to get next OD pricing page, %w", err) } for _, priceDoc := range pricingOutput.PriceList { @@ -241,7 +252,7 @@ func (c *OnDemandPricing) fetchOnDemandPricing(ctx context.Context, instanceType // StringMe takes an interface and returns a pointer to a string value // If the underlying interface kind is not string or *string then nil is returned -func (*OnDemandPricing) StringMe(i interface{}) *string { +func (c *OnDemandPricing) StringMe(i interface{}) *string { if i == nil { return nil } @@ -251,17 +262,16 @@ func (*OnDemandPricing) StringMe(i interface{}) *string { case string: return &v default: - log.Printf("%s cannot be converted to a string", i) + c.logger.Printf("%s cannot be converted to a string", i) return nil } } func (c *OnDemandPricing) getProductsInputFilters(instanceType ec2types.InstanceType) []pricingtypes.Filter { - regionDescription := c.getRegionForPricingAPI() filters := []pricingtypes.Filter{ {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("ServiceCode"), Value: c.StringMe(serviceCode)}, {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("operatingSystem"), Value: c.StringMe("linux")}, - {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("location"), Value: c.StringMe(regionDescription)}, + {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("regionCode"), Value: c.StringMe(c.Region)}, {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("capacitystatus"), Value: c.StringMe("used")}, {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("preInstalledSw"), Value: c.StringMe("NA")}, {Type: pricingtypes.FilterTypeTermMatch, Field: c.StringMe("tenancy"), Value: c.StringMe("shared")}, @@ -272,30 +282,6 @@ func (c *OnDemandPricing) getProductsInputFilters(instanceType ec2types.Instance return filters } -// getRegionForPricingAPI attempts to retrieve the region description based on the AWS session used to create -// the ec2pricing struct. It then uses the endpoints package in the aws sdk to retrieve the region description -// This is necessary because the pricing API uses the region description rather than a region ID -func (c *OnDemandPricing) getRegionForPricingAPI() string { - endpointResolver := endpoints.DefaultResolver() - partitions := endpointResolver.(endpoints.EnumPartitions).Partitions() - - // use us-east-1 as the default - regionDescription := "US East (N. Virginia)" - for _, partition := range partitions { - regions := partition.Regions() - if region, ok := regions[c.Region]; ok { - regionDescription = region.Description() - } - } - - // endpoints package returns European regions with the word "Europe," but the pricing API expects the word "EU." - // This formatting mismatch is only present with European regions. - // So replace "Europe" with "EU" if it exists in the regionDescription string. - regionDescription = strings.ReplaceAll(regionDescription, "Europe", "EU") - - return regionDescription -} - // parseOndemandUnitPrice takes a priceList from the pricing API and parses its weirdness func (c *OnDemandPricing) parseOndemandUnitPrice(priceList string) (string, float64, error) { var productPriceList PricingList diff --git a/pkg/ec2pricing/spotpricing.go b/pkg/ec2pricing/spotpricing.go index cbf56e9f..1f4d85d1 100644 --- a/pkg/ec2pricing/spotpricing.go +++ b/pkg/ec2pricing/spotpricing.go @@ -18,6 +18,7 @@ import ( "encoding/gob" "errors" "fmt" + "io" "log" "math" "os" @@ -44,6 +45,7 @@ type SpotPricing struct { DirectoryPath string cache *cache.Cache ec2Client ec2.DescribeSpotPriceHistoryAPIClient + logger *log.Logger sync.RWMutex } @@ -63,6 +65,7 @@ func LoadSpotCacheOrNew(ctx context.Context, ec2Client ec2.DescribeSpotPriceHist DirectoryPath: directoryPath, cache: cache.New(fullRefreshTTL, fullRefreshTTL), ec2Client: ec2Client, + logger: log.New(io.Discard, "", 0), } } spotPricing := &SpotPricing{ @@ -71,6 +74,7 @@ func LoadSpotCacheOrNew(ctx context.Context, ec2Client ec2.DescribeSpotPriceHist DirectoryPath: expandedDirPath, ec2Client: ec2Client, cache: cache.New(fullRefreshTTL, fullRefreshTTL), + logger: log.New(io.Discard, "", 0), } if fullRefreshTTL <= 0 { spotPricing.Clear() @@ -121,6 +125,10 @@ func spotCacheRefreshJob(ctx context.Context, spotPricing *SpotPricing, days int } } +func (c *SpotPricing) SetLogger(logger *log.Logger) { + c.logger = logger +} + func (c *SpotPricing) Refresh(ctx context.Context, days int) error { c.Lock() defer c.Unlock() @@ -241,6 +249,11 @@ func (c *SpotPricing) Clear() error { // fetchSpotPricingTimeSeries makes a bulk request to the ec2 api to retrieve all spot instance type pricing for the past n days // If instanceType is empty, it will fetch for all instance types func (c *SpotPricing) fetchSpotPricingTimeSeries(ctx context.Context, instanceType ec2types.InstanceType, days int) (map[string][]*spotPricingEntry, error) { + start := time.Now() + calls := 0 + defer func() { + c.logger.Printf("Took %s and %d calls to collect Spot pricing", time.Since(start), calls) + }() spotTimeSeries := map[string][]*spotPricingEntry{} endTime := time.Now().UTC() startTime := endTime.Add(time.Hour * time.Duration(24*-1*days)) @@ -258,9 +271,10 @@ func (c *SpotPricing) fetchSpotPricingTimeSeries(ctx context.Context, instanceTy // Iterate through the Amazon S3 object pages. for p.HasMorePages() { + calls++ spotHistoryOutput, err := p.NextPage(ctx) if err != nil { - return nil, fmt.Errorf("failed to get a page, %w", err) + return nil, fmt.Errorf("failed to get a spot pricing page, %w", err) } for _, history := range spotHistoryOutput.SpotPriceHistory { diff --git a/pkg/instancetypes/instancetypes.go b/pkg/instancetypes/instancetypes.go index f38512d3..fa44f538 100644 --- a/pkg/instancetypes/instancetypes.go +++ b/pkg/instancetypes/instancetypes.go @@ -18,7 +18,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "log" "os" "path/filepath" @@ -48,8 +48,10 @@ type Provider struct { lastFullRefresh *time.Time ec2Client ec2.DescribeInstanceTypesAPIClient cache *cache.Cache + logger *log.Logger } +// NewProvider creates a new Instance Types provider used to fetch Instance Type information from EC2 func NewProvider(directoryPath string, region string, ttl time.Duration, ec2Client ec2.DescribeInstanceTypesAPIClient) *Provider { expandedDirPath, err := homedir.Expand(directoryPath) if err != nil { @@ -61,9 +63,11 @@ func NewProvider(directoryPath string, region string, ttl time.Duration, ec2Clie FullRefreshTTL: ttl, ec2Client: ec2Client, cache: cache.New(ttl, ttl), + logger: log.New(io.Discard, "", 0), } } +// NewProvider creates a new Instance Types provider used to fetch Instance Type information from EC2 and optionally cache func LoadFromOrNew(directoryPath string, region string, ttl time.Duration, ec2Client ec2.DescribeInstanceTypesAPIClient) *Provider { expandedDirPath, err := homedir.Expand(directoryPath) if err != nil { @@ -87,6 +91,7 @@ func LoadFromOrNew(directoryPath string, region string, ttl time.Duration, ec2Cl DirectoryPath: expandedDirPath, ec2Client: ec2Client, cache: itCache, + logger: log.New(io.Discard, "", 0), } } @@ -107,7 +112,17 @@ func getCacheFilePath(region string, expandedDirPath string) string { return filepath.Join(expandedDirPath, fmt.Sprintf("%s-%s", region, CacheFileName)) } +func (p *Provider) SetLogger(logger *log.Logger) { + p.logger = logger +} + func (p *Provider) Get(ctx context.Context, instanceTypes []ec2types.InstanceType) ([]*Details, error) { + p.logger.Printf("Getting instance types %v", instanceTypes) + start := time.Now() + calls := 0 + defer func() { + p.logger.Printf("Took %s and %d calls to collect Instance Types", time.Since(start), calls) + }() instanceTypeDetails := []*Details{} describeInstanceTypeOpts := &ec2.DescribeInstanceTypesInput{} if len(instanceTypes) != 0 { @@ -120,6 +135,10 @@ func (p *Provider) Get(ctx context.Context, instanceTypes []ec2types.InstanceTyp describeInstanceTypeOpts.InstanceTypes = append(describeInstanceTypeOpts.InstanceTypes, instanceType) } } + // if we were able to retrieve all from cache, return here, else continue to do a remote lookup + if len(describeInstanceTypeOpts.InstanceTypes) == 0 { + return instanceTypeDetails, nil + } } else if p.lastFullRefresh != nil && !p.isFullRefreshNeeded() { for _, item := range p.cache.Items() { instanceTypeDetails = append(instanceTypeDetails, item.Object.(*Details)) @@ -127,14 +146,14 @@ func (p *Provider) Get(ctx context.Context, instanceTypes []ec2types.InstanceTyp return instanceTypeDetails, nil } - s := ec2.NewDescribeInstanceTypesPaginator(p.ec2Client, &ec2.DescribeInstanceTypesInput{}) + s := ec2.NewDescribeInstanceTypesPaginator(p.ec2Client, describeInstanceTypeOpts) for s.HasMorePages() { + calls++ instanceTypeOutput, err := s.NextPage(ctx) if err != nil { - return nil, fmt.Errorf("failed to get a page, %w", err) + return nil, fmt.Errorf("failed to get next instance types page, %w", err) } - for _, instanceTypeInfo := range instanceTypeOutput.InstanceTypes { itDetails := &Details{InstanceTypeInfo: instanceTypeInfo} instanceTypeDetails = append(instanceTypeDetails, itDetails) @@ -167,7 +186,7 @@ func (p *Provider) Save() error { if err := os.Mkdir(p.DirectoryPath, 0755); err != nil && !errors.Is(err, os.ErrExist) { return err } - return ioutil.WriteFile(getCacheFilePath(p.Region, p.DirectoryPath), cacheBytes, 0644) + return os.WriteFile(getCacheFilePath(p.Region, p.DirectoryPath), cacheBytes, 0644) } func (p *Provider) Clear() error { diff --git a/pkg/selector/comparators.go b/pkg/selector/comparators.go index eb639ecf..94236bf8 100644 --- a/pkg/selector/comparators.go +++ b/pkg/selector/comparators.go @@ -14,7 +14,6 @@ package selector import ( - "log" "math" "reflect" "regexp" @@ -30,7 +29,11 @@ const ( required = "required" ) -var amdRegex = regexp.MustCompile("[a-zA-Z0-9]+a\\.[a-zA-Z0-9]") +var ( + amdRegex = regexp.MustCompile(`[a-zA-Z0-9]+a\\.[a-zA-Z0-9]`) + networkPerfRE = regexp.MustCompile(`[0-9]+ Gigabit`) + generationRE = regexp.MustCompile(`[a-zA-Z]+([0-9]+)`) +) func isSupportedFromString(instanceTypeValue *string, target *string) bool { if target == nil { @@ -302,12 +305,7 @@ func getNetworkPerformance(networkPerformance *string) *int { if networkPerformance == nil { return aws.Int(-1) } - re, err := regexp.Compile(`[0-9]+ Gigabit`) - if err != nil { - log.Printf("Unable to compile regexp to parse network performance: %s\n", *networkPerformance) - return nil - } - networkBandwidth := re.FindString(*networkPerformance) + networkBandwidth := networkPerfRE.FindString(*networkPerformance) if networkBandwidth == "" { return aws.Int(-1) } @@ -392,6 +390,22 @@ func getCPUManufacturer(instanceTypeInfo *ec2types.InstanceTypeInfo) CPUManufact return CPUManufacturerIntel } +// getInstanceTypeGeneration returns the generation from an instance type name +// i.e. c7i.xlarge -> 7 +// if any error occurs, 0 will be returned +func getInstanceTypeGeneration(instanceTypeName string) *int { + zero := 0 + matches := generationRE.FindStringSubmatch(instanceTypeName) + if len(matches) < 2 { + return &zero + } + gen, err := strconv.Atoi(matches[1]) + if err != nil { + return &zero + } + return &gen +} + // supportSyntaxToBool takes an instance spec field that uses ["unsupported", "supported", "required", or "default"] // and transforms it to a *bool to use in filter execution func supportSyntaxToBool(instanceTypeSupport *string) *bool { diff --git a/pkg/selector/outputs/bubbletea_internal_test.go b/pkg/selector/outputs/bubbletea_internal_test.go index 495b45a7..8decdb40 100644 --- a/pkg/selector/outputs/bubbletea_internal_test.go +++ b/pkg/selector/outputs/bubbletea_internal_test.go @@ -16,7 +16,7 @@ package outputs import ( "encoding/json" "fmt" - "io/ioutil" + "os" "strings" "testing" @@ -36,7 +36,7 @@ const ( func getInstanceTypeDetails(t *testing.T, file string) []*instancetypes.Details { folder := "FilterVerbose" mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, folder, file) - mockFile, err := ioutil.ReadFile(mockFilename) + mockFile, err := os.ReadFile(mockFilename) h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) instanceTypes := []*instancetypes.Details{} @@ -133,7 +133,7 @@ func TestNewBubbleTeaModel_SpotPricing(t *testing.T) { model := NewBubbleTeaModel(instanceTypes) rows := model.tableModel.table.GetVisibleRows() expectedODPrice := "$1.368" - actualODPrice := fmt.Sprintf("%v", rows[0].Data["Spot Price/Hr (30d avg)"]) + actualODPrice := fmt.Sprintf("%v", rows[0].Data["Spot Price/Hr"]) h.Assert(t, actualODPrice == expectedODPrice, "Actual spot price should be %s, but is actually %s", expectedODPrice, actualODPrice) @@ -142,7 +142,7 @@ func TestNewBubbleTeaModel_SpotPricing(t *testing.T) { model = NewBubbleTeaModel(instanceTypes) rows = model.tableModel.table.GetVisibleRows() expectedODPrice = "-Not Fetched-" - actualODPrice = fmt.Sprintf("%v", rows[0].Data["Spot Price/Hr (30d avg)"]) + actualODPrice = fmt.Sprintf("%v", rows[0].Data["Spot Price/Hr"]) h.Assert(t, actualODPrice == expectedODPrice, "Actual spot price should be %s, but is actually %s", expectedODPrice, actualODPrice) } diff --git a/pkg/selector/outputs/outputs.go b/pkg/selector/outputs/outputs.go index 319cf9fc..dd16ec7a 100644 --- a/pkg/selector/outputs/outputs.go +++ b/pkg/selector/outputs/outputs.go @@ -45,7 +45,7 @@ type wideColumnsData struct { gpuMemory string `column:"GPU Mem (GiB)"` gpuInfo string `column:"GPU Info"` odPrice string `column:"On-Demand Price/Hr"` - spotPrice string `column:"Spot Price/Hr (30d avg)"` + spotPrice string `column:"Spot Price/Hr"` } // SimpleInstanceTypeOutput is an OutputFn which outputs a slice of instance type names diff --git a/pkg/selector/outputs/outputs_test.go b/pkg/selector/outputs/outputs_test.go index 50d24fa8..a5fbe939 100644 --- a/pkg/selector/outputs/outputs_test.go +++ b/pkg/selector/outputs/outputs_test.go @@ -16,7 +16,7 @@ package outputs_test import ( "encoding/json" "fmt" - "io/ioutil" + "os" "strings" "testing" @@ -33,7 +33,7 @@ const ( func getInstanceTypes(t *testing.T, file string) []*instancetypes.Details { mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, describeInstanceTypes, file) - mockFile, err := ioutil.ReadFile(mockFilename) + mockFile, err := os.ReadFile(mockFilename) h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) dito := ec2.DescribeInstanceTypesOutput{} err = json.Unmarshal(mockFile, &dito) diff --git a/pkg/selector/selector.go b/pkg/selector/selector.go index 897864c3..91ead91a 100644 --- a/pkg/selector/selector.go +++ b/pkg/selector/selector.go @@ -17,6 +17,7 @@ package selector import ( "context" "fmt" + "io" "log" "reflect" "regexp" @@ -91,6 +92,7 @@ const ( freeTier = "freeTier" autoRecovery = "autoRecovery" dedicatedHosts = "dedicatedHosts" + generation = "generation" cpuArchitectureAMD64 = "amd64" @@ -101,24 +103,10 @@ const ( // New creates an instance of Selector provided an aws session func New(ctx context.Context, cfg aws.Config) (*Selector, error) { - serviceRegistry := NewRegistry() - serviceRegistry.RegisterAWSServices() - ec2Client := ec2.NewFromConfig(cfg, func(options *ec2.Options) { - options.APIOptions = append(options.APIOptions, middleware.AddUserAgentKeyValue(sdkName, versionID)) - }) - pricingClient, err := ec2pricing.New(ctx, cfg) - if err != nil { - return nil, err - } - - return &Selector{ - EC2: ec2Client, - EC2Pricing: pricingClient, - InstanceTypesProvider: instancetypes.LoadFromOrNew("", cfg.Region, 0, ec2Client), - ServiceRegistry: serviceRegistry, - }, nil + return NewWithCache(ctx, cfg, 0, "") } +// NewWithCache creates an instance of Selector backed by an on-disk cache provided an aws session and cache configuration parameters func NewWithCache(ctx context.Context, cfg aws.Config, ttl time.Duration, cacheDir string) (*Selector, error) { serviceRegistry := NewRegistry() serviceRegistry.RegisterAWSServices() @@ -135,54 +123,56 @@ func NewWithCache(ctx context.Context, cfg aws.Config, ttl time.Duration, cacheD EC2Pricing: pricingClient, InstanceTypesProvider: instancetypes.LoadFromOrNew(cacheDir, cfg.Region, ttl, ec2Client), ServiceRegistry: serviceRegistry, + Logger: log.New(io.Discard, "", 0), }, nil } -func (itf Selector) Save() error { - return multierr.Append(itf.EC2Pricing.Save(), itf.InstanceTypesProvider.Save()) +// SetLogger can be called to log more detailed logs about what selector is doing +// including things like API timings +// If SetLogger is not called, no logs will be displayed +func (s *Selector) SetLogger(logger *log.Logger) { + s.Logger = logger + s.InstanceTypesProvider.SetLogger(logger) + s.EC2Pricing.SetLogger(logger) +} + +// Save persists the selector cache data to disk if caching is configured +func (s Selector) Save() error { + return multierr.Append(s.EC2Pricing.Save(), s.InstanceTypesProvider.Save()) } // Filter accepts a Filters struct which is used to select the available instance types // matching the criteria within Filters and returns a simple list of instance type strings -// -// Deprecated: This function will be replaced with GetFilteredInstanceTypes() and -// OutputInstanceTypes() in the next major version. -func (itf Selector) Filter(ctx context.Context, filters Filters) ([]string, error) { +func (s Selector) Filter(ctx context.Context, filters Filters) ([]string, error) { outputFn := InstanceTypesOutputFn(outputs.SimpleInstanceTypeOutput) - output, _, err := itf.FilterWithOutput(ctx, filters, outputFn) + output, _, err := s.FilterWithOutput(ctx, filters, outputFn) return output, err } // FilterVerbose accepts a Filters struct which is used to select the available instance types // matching the criteria within Filters and returns a list instanceTypeInfo -// -// Deprecated: This function will be replaced with GetFilteredInstanceTypes() in the next -// major version. -func (itf Selector) FilterVerbose(ctx context.Context, filters Filters) ([]*instancetypes.Details, error) { - instanceTypeInfoSlice, err := itf.rawFilter(ctx, filters) +func (s Selector) FilterVerbose(ctx context.Context, filters Filters) ([]*instancetypes.Details, error) { + instanceTypeInfoSlice, err := s.rawFilter(ctx, filters) if err != nil { return nil, err } - instanceTypeInfoSlice, _ = itf.truncateResults(filters.MaxResults, instanceTypeInfoSlice) + instanceTypeInfoSlice, _ = s.truncateResults(filters.MaxResults, instanceTypeInfoSlice) return instanceTypeInfoSlice, nil } // FilterWithOutput accepts a Filters struct which is used to select the available instance types // matching the criteria within Filters and returns a list of strings based on the custom outputFn -// -// Deprecated: This function will be replaced with GetFilteredInstanceTypes() and -// OutputInstanceTypes() in the next major version. -func (itf Selector) FilterWithOutput(ctx context.Context, filters Filters, outputFn InstanceTypesOutput) ([]string, int, error) { - instanceTypeInfoSlice, err := itf.rawFilter(ctx, filters) +func (s Selector) FilterWithOutput(ctx context.Context, filters Filters, outputFn InstanceTypesOutput) ([]string, int, error) { + instanceTypeInfoSlice, err := s.rawFilter(ctx, filters) if err != nil { return nil, 0, err } - instanceTypeInfoSlice, numOfItemsTruncated := itf.truncateResults(filters.MaxResults, instanceTypeInfoSlice) + instanceTypeInfoSlice, numOfItemsTruncated := s.truncateResults(filters.MaxResults, instanceTypeInfoSlice) output := outputFn.Output(instanceTypeInfoSlice) return output, numOfItemsTruncated, nil } -func (itf Selector) truncateResults(maxResults *int, instanceTypeInfoSlice []*instancetypes.Details) ([]*instancetypes.Details, int) { +func (s Selector) truncateResults(maxResults *int, instanceTypeInfoSlice []*instancetypes.Details) ([]*instancetypes.Details, int) { if maxResults == nil { return instanceTypeInfoSlice, 0 } @@ -194,11 +184,11 @@ func (itf Selector) truncateResults(maxResults *int, instanceTypeInfoSlice []*in } // AggregateFilterTransform takes higher level filters which are used to affect multiple raw filters in an opinionated way. -func (itf Selector) AggregateFilterTransform(ctx context.Context, filters Filters) (Filters, error) { +func (s Selector) AggregateFilterTransform(ctx context.Context, filters Filters) (Filters, error) { transforms := []FiltersTransform{ - TransformFn(itf.TransformBaseInstanceType), - TransformFn(itf.TransformFlexible), - TransformFn(itf.TransformForService), + TransformFn(s.TransformBaseInstanceType), + TransformFn(s.TransformFlexible), + TransformFn(s.TransformForService), } var err error for _, transform := range transforms { @@ -212,8 +202,8 @@ func (itf Selector) AggregateFilterTransform(ctx context.Context, filters Filter // rawFilter accepts a Filters struct which is used to select the available instance types // matching the criteria within Filters and returns the detailed specs of matching instance types -func (itf Selector) rawFilter(ctx context.Context, filters Filters) ([]*instancetypes.Details, error) { - filters, err := itf.AggregateFilterTransform(ctx, filters) +func (s Selector) rawFilter(ctx context.Context, filters Filters) ([]*instancetypes.Details, error) { + filters, err := s.AggregateFilterTransform(ctx, filters) if err != nil { return nil, err } @@ -231,12 +221,12 @@ func (itf Selector) rawFilter(ctx context.Context, filters Filters) ([]*instance } else if filters.Region != nil { locations = []string{*filters.Region} } - locationInstanceOfferings, err := itf.RetrieveInstanceTypesSupportedInLocations(ctx, locations) + locationInstanceOfferings, err := s.RetrieveInstanceTypesSupportedInLocations(ctx, locations) if err != nil { return nil, err } - instanceTypeDetails, err := itf.InstanceTypesProvider.Get(ctx, nil) + instanceTypeDetails, err := s.InstanceTypesProvider.Get(ctx, nil) if err != nil { return nil, err } @@ -247,33 +237,35 @@ func (itf Selector) rawFilter(ctx context.Context, filters Filters) ([]*instance wg.Add(1) go func(instanceTypeInfo instancetypes.Details) { defer wg.Done() - it, err := itf.prepareFilter(ctx, filters, instanceTypeInfo, availabilityZones, locationInstanceOfferings) + it, err := s.prepareFilter(ctx, filters, instanceTypeInfo, availabilityZones, locationInstanceOfferings) if err != nil { - log.Println(err) + s.Logger.Printf("Unable to prepare filter for %s, %v", instanceTypeInfo.InstanceType, err) } if it != nil { instanceTypes <- it } }(*instanceTypeInfo) } - wg.Wait() - close(instanceTypes) + go func() { + wg.Wait() + close(instanceTypes) + }() for it := range instanceTypes { filteredInstanceTypes = append(filteredInstanceTypes, it) } return sortInstanceTypeInfo(filteredInstanceTypes), nil } -func (itf Selector) prepareFilter(ctx context.Context, filters Filters, instanceTypeInfo instancetypes.Details, availabilityZones []string, locationInstanceOfferings map[ec2types.InstanceType]string) (*instancetypes.Details, error) { +func (s Selector) prepareFilter(ctx context.Context, filters Filters, instanceTypeInfo instancetypes.Details, availabilityZones []string, locationInstanceOfferings map[ec2types.InstanceType]string) (*instancetypes.Details, error) { instanceTypeName := instanceTypeInfo.InstanceType isFpga := instanceTypeInfo.FpgaInfo != nil var instanceTypeHourlyPriceForFilter float64 // Price used to filter based on usage class var instanceTypeHourlyPriceOnDemand, instanceTypeHourlyPriceSpot *float64 // If prices are fetched, populate the fields irrespective of the price filters - if itf.EC2Pricing.OnDemandCacheCount() > 0 { - price, err := itf.EC2Pricing.GetOnDemandInstanceTypeCost(ctx, instanceTypeName) + if s.EC2Pricing.OnDemandCacheCount() > 0 { + price, err := s.EC2Pricing.GetOnDemandInstanceTypeCost(ctx, instanceTypeName) if err != nil { - log.Printf("Could not retrieve instantaneous hourly on-demand price for instance type %s - %s\n", instanceTypeName, err) + s.Logger.Printf("Could not retrieve instantaneous hourly on-demand price for instance type %s - %s\n", instanceTypeName, err) } else { instanceTypeHourlyPriceOnDemand = &price instanceTypeInfo.OndemandPricePerHour = instanceTypeHourlyPriceOnDemand @@ -287,10 +279,10 @@ func (itf Selector) prepareFilter(ctx context.Context, filters Filters, instance } } - if itf.EC2Pricing.SpotCacheCount() > 0 && isSpotUsageClass { - price, err := itf.EC2Pricing.GetSpotInstanceTypeNDayAvgCost(ctx, instanceTypeName, availabilityZones, 30) + if s.EC2Pricing.SpotCacheCount() > 0 && isSpotUsageClass { + price, err := s.EC2Pricing.GetSpotInstanceTypeNDayAvgCost(ctx, instanceTypeName, availabilityZones, 30) if err != nil { - log.Printf("Could not retrieve 30 day avg hourly spot price for instance type %s\n", instanceTypeName) + s.Logger.Printf("Could not retrieve 30 day avg hourly spot price for instance type %s\n", instanceTypeName) } else { instanceTypeHourlyPriceSpot = &price instanceTypeInfo.SpotPrice = instanceTypeHourlyPriceSpot @@ -352,6 +344,7 @@ func (itf Selector) prepareFilter(ctx context.Context, filters Filters, instance inferenceAcceleratorManufacturer: {filters.InferenceAcceleratorManufacturer, getInferenceAcceleratorManufacturers(instanceTypeInfo.InferenceAcceleratorInfo)}, inferenceAcceleratorModel: {filters.InferenceAcceleratorModel, getInferenceAcceleratorModels(instanceTypeInfo.InferenceAcceleratorInfo)}, dedicatedHosts: {filters.DedicatedHosts, instanceTypeInfo.DedicatedHostsSupported}, + generation: {filters.Generation, getInstanceTypeGeneration(string(instanceTypeInfo.InstanceType))}, } if isInDenyList(filters.DenyList, instanceTypeName) || !isInAllowList(filters.AllowList, instanceTypeName) { @@ -363,7 +356,7 @@ func (itf Selector) prepareFilter(ctx context.Context, filters Filters, instance } var isInstanceSupported bool - isInstanceSupported, err := itf.executeFilters(ctx, filterToInstanceSpecMappingPairs, instanceTypeName) + isInstanceSupported, err := s.executeFilters(ctx, filterToInstanceSpecMappingPairs, instanceTypeName) if err != nil { return nil, err } @@ -388,9 +381,9 @@ func sortInstanceTypeInfo(instanceTypeInfoSlice []*instancetypes.Details) []*ins // executeFilters accepts a mapping of filter name to filter pairs which are iterated through // to determine if the instance type matches the filter values. -func (itf Selector) executeFilters(ctx context.Context, filterToInstanceSpecMapping map[string]filterPair, instanceType ec2types.InstanceType) (bool, error) { +func (s Selector) executeFilters(ctx context.Context, filterToInstanceSpecMapping map[string]filterPair, instanceType ec2types.InstanceType) (bool, error) { verdict := make(chan bool, len(filterToInstanceSpecMapping)+1) - errs := make(chan error) + errs := make(chan error, len(filterToInstanceSpecMapping)) ctx, cancel := context.WithCancel(ctx) defer cancel() var wg sync.WaitGroup @@ -432,6 +425,8 @@ func (itf Selector) executeFilters(ctx context.Context, filterToInstanceSpecMapp } } +// exec executes a specific filterPair (user value & instance spec) with a specific instance type +// If the filterPair matches, true is returned func exec(instanceType ec2types.InstanceType, filterName string, filter filterPair) (bool, error) { filterVal := filter.filterValue instanceSpec := filter.instanceSpec @@ -443,7 +438,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa instanceSpecType := reflect.ValueOf(instanceSpec).Type() filterType := filterValReflection.Type() filterDetailsMsg := fmt.Sprintf("filter (%s: %s => %s) corresponding to instance spec (%s => %s) for instance type %s", filterName, filterVal, filterType, instanceSpec, instanceSpecType, instanceType) - invalidInstanceSpecTypeMsg := fmt.Sprintf("Unable to process for %s", filterDetailsMsg) + errInvalidInstanceSpec := fmt.Errorf("unable to process for %s", filterDetailsMsg) // Determine appropriate filter comparator by switching on filter type switch filter := filterVal.(type) { @@ -458,7 +453,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *bool: switch iSpec := instanceSpec.(type) { @@ -467,7 +462,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *IntRangeFilter: switch iSpec := instanceSpec.(type) { @@ -480,7 +475,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *Int32RangeFilter: switch iSpec := instanceSpec.(type) { @@ -489,7 +484,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *Float64RangeFilter: switch iSpec := instanceSpec.(type) { @@ -498,7 +493,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *ByteQuantityRangeFilter: mibRange := Uint64RangeFilter{ @@ -528,7 +523,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *float64: switch iSpec := instanceSpec.(type) { @@ -537,7 +532,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *ec2types.ArchitectureType: switch iSpec := instanceSpec.(type) { @@ -546,7 +541,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *ec2types.UsageClassType: switch iSpec := instanceSpec.(type) { @@ -555,7 +550,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *CPUManufacturer: switch iSpec := instanceSpec.(type) { @@ -564,7 +559,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *ec2types.VirtualizationType: switch iSpec := instanceSpec.(type) { @@ -573,7 +568,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *ec2types.InstanceTypeHypervisor: switch iSpec := instanceSpec.(type) { @@ -582,7 +577,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *ec2types.RootDeviceType: switch iSpec := instanceSpec.(type) { @@ -591,7 +586,7 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } case *[]string: switch iSpec := instanceSpec.(type) { @@ -607,10 +602,10 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa return false, nil } default: - return false, fmt.Errorf(invalidInstanceSpecTypeMsg) + return false, errInvalidInstanceSpec } default: - return false, fmt.Errorf("No filter handler found for %s", filterDetailsMsg) + return false, fmt.Errorf("no filter handler found for %s", filterDetailsMsg) } return true, nil } @@ -618,13 +613,13 @@ func exec(instanceType ec2types.InstanceType, filterName string, filter filterPa // RetrieveInstanceTypesSupportedInLocations returns a map of instance type -> AZ or Region for all instance types supported in the intersected locations passed in // The location can be a zone-id (ie. use1-az1), a zone-name (us-east-1a), or a region name (us-east-1). // Note that zone names are not necessarily the same across accounts -func (itf Selector) RetrieveInstanceTypesSupportedInLocations(ctx context.Context, locations []string) (map[ec2types.InstanceType]string, error) { +func (s Selector) RetrieveInstanceTypesSupportedInLocations(ctx context.Context, locations []string) (map[ec2types.InstanceType]string, error) { if len(locations) == 0 { return nil, nil } availableInstanceTypes := map[ec2types.InstanceType]int{} for _, location := range locations { - locationType, err := itf.getLocationType(ctx, location) + locationType, err := s.getLocationType(ctx, location) if err != nil { return nil, err } @@ -639,12 +634,12 @@ func (itf Selector) RetrieveInstanceTypesSupportedInLocations(ctx context.Contex }, } - p := ec2.NewDescribeInstanceTypeOfferingsPaginator(itf.EC2, instanceTypeOfferingsInput) + p := ec2.NewDescribeInstanceTypeOfferingsPaginator(s.EC2, instanceTypeOfferingsInput) for p.HasMorePages() { instanceTypeOfferings, err := p.NextPage(ctx) if err != nil { - return nil, fmt.Errorf("Encountered an error when describing instance type offerings: %w", err) + return nil, fmt.Errorf("encountered an error when describing instance type offerings: %w", err) } for _, instanceType := range instanceTypeOfferings.InstanceTypeOfferings { @@ -666,8 +661,8 @@ func (itf Selector) RetrieveInstanceTypesSupportedInLocations(ctx context.Contex return availableInstanceTypesAllLocations, nil } -func (itf Selector) getLocationType(ctx context.Context, location string) (ec2types.LocationType, error) { - azs, err := itf.EC2.DescribeAvailabilityZones(ctx, &ec2.DescribeAvailabilityZonesInput{}) +func (s Selector) getLocationType(ctx context.Context, location string) (ec2types.LocationType, error) { + azs, err := s.EC2.DescribeAvailabilityZones(ctx, &ec2.DescribeAvailabilityZonesInput{}) if err != nil { return "", err } @@ -680,7 +675,7 @@ func (itf Selector) getLocationType(ctx context.Context, location string) (ec2ty return zoneIDLocationType, nil } } - return "", fmt.Errorf("The location passed in (%s) is not a valid zone-id, zone-name, or region name", location) + return "", fmt.Errorf("the location passed in (%s) is not a valid zone-id, zone-name, or region name", location) } func isSupportedInLocation(instanceOfferings map[ec2types.InstanceType]string, instanceType ec2types.InstanceType) bool { diff --git a/pkg/selector/selector_test.go b/pkg/selector/selector_test.go index 034424dd..22fca820 100644 --- a/pkg/selector/selector_test.go +++ b/pkg/selector/selector_test.go @@ -18,7 +18,8 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "log" + "os" "regexp" "strconv" "testing" @@ -85,7 +86,7 @@ func mockMultiRespDescribeInstanceTypesOfferings(t *testing.T, locationToFile ma locationToResp := map[string]ec2.DescribeInstanceTypeOfferingsOutput{} for zone, file := range locationToFile { mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, api, file) - mockFile, err := ioutil.ReadFile(mockFilename) + mockFile, err := os.ReadFile(mockFilename) h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) ditoo := ec2.DescribeInstanceTypeOfferingsOutput{} err = json.Unmarshal(mockFile, &ditoo) @@ -102,7 +103,7 @@ func mockMultiRespDescribeInstanceTypesOfferings(t *testing.T, locationToFile ma func setupMock(t *testing.T, api string, file string) mockedEC2 { mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, api, file) - mockFile, err := ioutil.ReadFile(mockFilename) + mockFile, err := os.ReadFile(mockFilename) h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) switch api { case describeInstanceTypes: @@ -587,6 +588,7 @@ func (p *ec2PricingMock) SpotCacheCount() int { func (p *ec2PricingMock) Save() error { return nil } +func (p *ec2PricingMock) SetLogger(_ *log.Logger) {} func TestFilter_PricePerHour(t *testing.T) { itf := getSelector(setupMock(t, describeInstanceTypes, "t3_micro.json")) diff --git a/pkg/selector/services.go b/pkg/selector/services.go index b46495c0..c9d460ee 100644 --- a/pkg/selector/services.go +++ b/pkg/selector/services.go @@ -17,7 +17,7 @@ import ( "fmt" "strings" - "github.com/imdario/mergo" + "dario.cat/mergo" ) // Service is used to write custom service filter transforms diff --git a/pkg/selector/types.go b/pkg/selector/types.go index 60395ebc..dd0900bd 100644 --- a/pkg/selector/types.go +++ b/pkg/selector/types.go @@ -15,9 +15,11 @@ package selector import ( "encoding/json" + "log" + "regexp" + "github.com/aws/amazon-ec2-instance-selector/v2/pkg/awsapi" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "regexp" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" "github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing" @@ -44,6 +46,7 @@ type Selector struct { EC2Pricing ec2pricing.EC2PricingIface InstanceTypesProvider *instancetypes.Provider ServiceRegistry ServiceRegistry + Logger *log.Logger } // IntRangeFilter holds an upper and lower bound int @@ -271,6 +274,13 @@ type Filters struct { // DedicatedHosts filters on instance types that support dedicated hosts tenancy DedicatedHosts *bool + + // Generation filters on the instance type generation + // i.e. c7i.xlarge is 7 + // NOTE that generation is only comparable per instance family + // For example, i3 and c5 are both 5th generation, but the Generation filter will + // only filter on the number in the instance type name. + Generation *IntRangeFilter } type CPUManufacturer string @@ -287,9 +297,9 @@ const ( // ordering of this slice is not guaranteed to be stable across updates. func (CPUManufacturer) Values() []CPUManufacturer { return []CPUManufacturer{ - "aws", - "amd", - "intel", + CPUManufacturerAWS, + CPUManufacturerAMD, + CPUManufacturerIntel, } } diff --git a/pkg/sorter/sorter_test.go b/pkg/sorter/sorter_test.go index 75e5c38b..8a59b0bf 100644 --- a/pkg/sorter/sorter_test.go +++ b/pkg/sorter/sorter_test.go @@ -16,7 +16,7 @@ package sorter_test import ( "encoding/json" "fmt" - "io/ioutil" + "os" "strings" "testing" @@ -38,7 +38,7 @@ const ( func getInstanceTypeDetails(t *testing.T, file string) []*instancetypes.Details { folder := "FilterVerbose" mockFilename := fmt.Sprintf("%s/%s/%s", mockFilesPath, folder, file) - mockFile, err := ioutil.ReadFile(mockFilename) + mockFile, err := os.ReadFile(mockFilename) h.Assert(t, err == nil, "Error reading mock file "+string(mockFilename)) instanceTypes := []*instancetypes.Details{} diff --git a/test/e2e/run-test b/test/e2e/run-test index 74b6f5dd..23206884 100755 --- a/test/e2e/run-test +++ b/test/e2e/run-test @@ -93,7 +93,7 @@ params=( ) echo "${expected[*]}" | execute_test "24 VCPUs" "${params[@]}" -expected=(g2.8xlarge g3.16xlarge g4dn.12xlarge p3.8xlarge) +expected=(g3.16xlarge g4ad.16xlarge g4dn.12xlarge g5.12xlarge g5.24xlarge g6.12xlarge g6.24xlarge g6e.12xlarge g6e.24xlarge p3.8xlarge) params=( "--gpus=4" "--gpus-min=4 --gpus-max=4" diff --git a/test/license-test/Dockerfile b/test/license-test/Dockerfile index 2b346b02..08ed3f92 100644 --- a/test/license-test/Dockerfile +++ b/test/license-test/Dockerfile @@ -1,4 +1,4 @@ -FROM public.ecr.aws/docker/library/golang:1.17 +FROM public.ecr.aws/docker/library/golang:1.23 WORKDIR /app diff --git a/test/readme-test/readme-codeblocks.go b/test/readme-test/readme-codeblocks.go index 32cea4ab..0fadb5fe 100644 --- a/test/readme-test/readme-codeblocks.go +++ b/test/readme-test/readme-codeblocks.go @@ -5,7 +5,6 @@ import ( "encoding/json" "flag" "fmt" - "io/ioutil" "log" "os" "strings" @@ -59,7 +58,7 @@ func main() { } func compareBlockWithFile(codeBlock string, codePath string) bool { - fileContents, err := ioutil.ReadFile(codePath) + fileContents, err := os.ReadFile(codePath) if err != nil { log.Fatalf("Unable to read file contents at %s", codePath) } diff --git a/test/readme-test/spellcheck-Dockerfile b/test/readme-test/spellcheck-Dockerfile index cd36641b..974f58ae 100644 --- a/test/readme-test/spellcheck-Dockerfile +++ b/test/readme-test/spellcheck-Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.16 +FROM golang:1.23 RUN go install github.com/client9/misspell/cmd/misspell@v0.3.4 From 62ddeb21d00096aedb54114676a286aca7f2dcf2 Mon Sep 17 00:00:00 2001 From: Brandon Wagner Date: Mon, 14 Oct 2024 15:19:13 -0400 Subject: [PATCH 58/58] upgrade to v3 (#357) --- Makefile | 4 +- README.md | 206 ++++++++++++------ cmd/examples/example1.go | 4 +- cmd/main.go | 12 +- go.mod | 2 +- pkg/bytequantity/bytequantity_test.go | 4 +- pkg/cli/cli.go | 4 +- pkg/cli/cli_internal_test.go | 2 +- pkg/cli/cli_test.go | 8 +- pkg/cli/flags.go | 2 +- pkg/cli/flags_test.go | 4 +- pkg/cli/types.go | 4 +- pkg/cli/types_test.go | 6 +- pkg/ec2pricing/ec2pricing_test.go | 4 +- pkg/selector/aggregates.go | 5 +- pkg/selector/aggregates_test.go | 4 +- pkg/selector/comparators_internal_test.go | 2 +- pkg/selector/emr_test.go | 4 +- pkg/selector/outputs/bubbletea.go | 4 +- .../outputs/bubbletea_internal_test.go | 4 +- pkg/selector/outputs/outputs.go | 2 +- pkg/selector/outputs/outputs_test.go | 6 +- pkg/selector/outputs/sortingView.go | 4 +- pkg/selector/outputs/tableView.go | 4 +- pkg/selector/outputs/verboseView.go | 2 +- pkg/selector/selector.go | 6 +- pkg/selector/selector_test.go | 10 +- pkg/selector/services_test.go | 4 +- pkg/selector/types.go | 8 +- pkg/selector/types_test.go | 4 +- pkg/sorter/sorter.go | 2 +- pkg/sorter/sorter_test.go | 8 +- test/readme-test/run-readme-codeblocks | 6 +- 33 files changed, 219 insertions(+), 136 deletions(-) diff --git a/Makefile b/Makefile index 6dd1b60d..6af8ca16 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ GOPROXY ?= "https://proxy.golang.org,direct/" MAKEFILE_PATH = $(dir $(realpath -s $(firstword $(MAKEFILE_LIST)))) BUILD_DIR_PATH = ${MAKEFILE_PATH}/build SUPPORTED_PLATFORMS ?= "windows/amd64,darwin/amd64,darwin/arm64,linux/amd64,linux/arm64,linux/arm" -SELECTOR_PKG_VERSION_VAR=github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector.versionID +SELECTOR_PKG_VERSION_VAR=github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector.versionID LATEST_RELEASE_TAG=$(shell git describe --tags --abbrev=0) PREVIOUS_RELEASE_TAG=$(shell git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`) @@ -85,7 +85,7 @@ sync-readme-to-dockerhub: ${MAKEFILE_PATH}/scripts/sync-readme-to-dockerhub unit-test: - go test -bench=. ${MAKEFILE_PATH}/... -v -coverprofile=coverage.out -covermode=atomic -outputdir=${BUILD_DIR_PATH} + go test -bench=. ./... -v -coverprofile=coverage.out -covermode=atomic -outputdir=${BUILD_DIR_PATH} ## requires aws credentials e2e-test: build diff --git a/README.md b/README.md index 763a2030..3f7db4df 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ Instance Selector can also be consumed as a go library for direct integration in - Filter AWS Instance Types using declarative resource criteria like vcpus, memory, network performance, and much more! - Aggregate filters allow for more opinionated instance selections like `--base-instance-type` and `--flexible` -- Consumable as a go library +- Consumable as a go library or CLI +- Interactive TUI w/ `--output interactive` ## Installation and Configuration @@ -86,6 +87,11 @@ c5ad.large c5d.large c6a.large c6i.large +c6id.large +c6in.large +c7a.large +c7i-flex.large +c7i.large t2.medium t3.medium t3a.medium @@ -97,56 +103,66 @@ $ ec2-instance-selector --network-performance 100 --usage-class spot -r us-east- c5n.18xlarge c5n.metal c6gn.16xlarge +c6in.16xlarge +c7gn.8xlarge dl1.24xlarge g4dn.metal g5.48xlarge +g6.48xlarge +g6e.12xlarge i3en.24xlarge i3en.metal im4gn.16xlarge inf1.24xlarge +inf2.48xlarge m5dn.24xlarge m5dn.metal m5n.24xlarge m5n.metal m5zn.12xlarge -m5zn.metal -p3dn.24xlarge -p4d.24xlarge -r5dn.24xlarge -r5dn.metal +NOTE: 19 entries were truncated, increase --max-results to see more ``` **Short Table Output** ``` $ ec2-instance-selector --memory 4 --vcpus 2 --cpu-architecture x86_64 -r us-east-1 -o table -Instance Type VCPUs Mem (GiB) -------------- ----- --------- -c5.large 2 4 -c5a.large 2 4 -c5ad.large 2 4 -c5d.large 2 4 -c6a.large 2 4 -c6i.large 2 4 -t2.medium 2 4 -t3.medium 2 4 -t3a.medium 2 4 +Instance Type VCPUs Mem (GiB) +------------- ----- --------- +c5.large 2 4 +c5a.large 2 4 +c5ad.large 2 4 +c5d.large 2 4 +c6a.large 2 4 +c6i.large 2 4 +c6id.large 2 4 +c6in.large 2 4 +c7a.large 2 4 +c7i-flex.large 2 4 +c7i.large 2 4 +t2.medium 2 4 +t3.medium 2 4 +t3a.medium 2 4 ``` **Wide Table Output** ``` $ ec2-instance-selector --memory 4 --vcpus 2 --cpu-architecture x86_64 -r us-east-1 -o table-wide -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 (30d avg) -------------- ----- --------- ---------- ----------- ------------------- -------- ------------------- ---- ---- ------------- -------- ------------------ ----------------------- -c5.large 2 4 nitro true true x86_64 Up to 10 Gigabit 3 0 0 none -Not Fetched- $0.03932 -c5a.large 2 4 nitro true false x86_64 Up to 10 Gigabit 3 0 0 none -Not Fetched- $0.03822 -c5ad.large 2 4 nitro true false x86_64 Up to 10 Gigabit 3 0 0 none -Not Fetched- $0.03449 -c5d.large 2 4 nitro true true x86_64 Up to 10 Gigabit 3 0 0 none $0.096 $0.03983 -c6a.large 2 4 nitro true false x86_64 Up to 12.5 Gigabit 3 0 0 none $0.0765 $0.034 -c6i.large 2 4 nitro true false x86_64 Up to 12.5 Gigabit 3 0 0 none $0.085 $0.03605 -c6id.large 2 4 nitro true false x86_64 Up to 12.5 Gigabit 3 0 0 none -Not Fetched- $0.034 -t2.medium 2 4 xen true true i386, x86_64 Low to Moderate 3 0 0 none $0.0464 $0.0139 -t3.medium 2 4 nitro true true x86_64 Up to 5 Gigabit 3 0 0 none $0.0416 $0.0125 -t3a.medium 2 4 nitro true true x86_64 Up to 5 Gigabit 3 0 0 none -Not Fetched- $0.01246 +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 +------------- ----- --------- ---------- ----------- ------------------- -------- ------------------- ---- ---- ------------- -------- ------------------ ------------- +c5.large 2 4 nitro true true x86_64 Up to 10 Gigabit 3 0 0 none $0.085 $0.0405 +c5a.large 2 4 nitro true false x86_64 Up to 10 Gigabit 3 0 0 none $0.077 $0.0308 +c5ad.large 2 4 nitro true false x86_64 Up to 10 Gigabit 3 0 0 none $0.086 $0.0415 +c5d.large 2 4 nitro true true x86_64 Up to 10 Gigabit 3 0 0 none $0.096 $0.0281 +c6a.large 2 4 nitro true false x86_64 Up to 12.5 Gigabit 3 0 0 none $0.0765 $0.0285 +c6i.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.085 $0.0292 +c6id.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.1008 $0.0391 +c6in.large 2 4 nitro true false x86_64 Up to 25 Gigabit 3 0 0 none $0.1134 $0.0403 +c7a.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.10264 $0.0457 +c7i-flex.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.08479 $0.022 +c7i.large 2 4 nitro true true x86_64 Up to 12.5 Gigabit 3 0 0 none $0.08925 $0.0359 +t2.medium 2 4 xen true true i386, x86_64 Low to Moderate 3 0 0 none $0.0464 $0.0156 +t3.medium 2 4 nitro true true x86_64 Up to 5 Gigabit 3 0 0 none $0.0416 $0.015 +t3a.medium 2 4 nitro true true x86_64 Up to 5 Gigabit 3 0 0 none $0.0376 $0.0106 ``` **Interactive Output** @@ -158,44 +174,99 @@ https://user-images.githubusercontent.com/68402662/184218343-6b236d4a-3fe6-42ae- **Sort by memory in ascending order using shorthand** ``` $ ec2-instance-selector -r us-east-1 -o table-wide --max-results 10 --sort-by memory --sort-direction asc -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 (30d avg) -------------- ----- --------- ---------- ----------- ------------------- -------- ------------------- ---- ---- ------------- -------- ------------------ ----------------------- -t2.nano 1 0.5 xen true true i386, x86_64 Low to Moderate 2 0 0 none $0.0058 -Not Fetched- -t4g.nano 2 0.5 nitro true false arm64 Up to 5 Gigabit 2 0 0 none $0.0042 $0.0013 -t3a.nano 2 0.5 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none -Not Fetched- $0.00328 -t3.nano 2 0.5 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0052 $0.0016 -t1.micro 1 0.6123 xen false false i386, x86_64 Very Low 2 0 0 none -Not Fetched- $0.00205 -t3a.micro 2 1 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none -Not Fetched- $0.00284 -t3.micro 2 1 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0104 $0.0031 -t2.micro 1 1 xen true true i386, x86_64 Low to Moderate 2 0 0 none -Not Fetched- $0.0035 -t4g.micro 2 1 nitro true false arm64 Up to 5 Gigabit 2 0 0 none -Not Fetched- $0.0025 -m1.small 1 1.69922 xen false false i386, x86_64 Low 2 0 0 none -Not Fetched- $0.01876 -NOTE: 547 entries were truncated, increase --max-results to see more +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 +------------- ----- --------- ---------- ----------- ------------------- -------- ------------------- ---- ---- ------------- -------- ------------------ ------------- +t3a.nano 2 0.5 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0047 $0.0018 +t2.nano 1 0.5 xen true true i386, x86_64 Low to Moderate 2 0 0 none $0.0058 -Not Fetched- +t4g.nano 2 0.5 nitro true true arm64 Up to 5 Gigabit 2 0 0 none $0.0042 $0.0018 +t3.nano 2 0.5 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0052 $0.0006 +t1.micro 1 0.6123 xen false false i386, x86_64 Very Low 2 0 0 none $0.02 $0.0021 +t3.micro 2 1 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0104 $0.0029 +t2.micro 1 1 xen true true i386, x86_64 Low to Moderate 2 0 0 none $0.0116 $0.0016 +t4g.micro 2 1 nitro true true arm64 Up to 5 Gigabit 2 0 0 none $0.0084 $0.0024 +t3a.micro 2 1 nitro true true x86_64 Up to 5 Gigabit 2 0 0 none $0.0094 $0.0031 +m1.small 1 1.69922 xen false false i386, x86_64 Low 2 0 0 none $0.044 $0.0048 +NOTE: 832 entries were truncated, increase --max-results to see more ``` 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 **Sort by memory in descending order using JSON path** ``` $ ec2-instance-selector -r us-east-1 -o table-wide --max-results 10 --sort-by .MemoryInfo.SizeInMiB --sort-direction desc -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 (30d avg) -------------- ----- --------- ---------- ----------- ------------------- -------- ------------------- ---- ---- ------------- -------- ------------------ ----------------------- -u-12tb1.112xlarge 448 12,288 nitro true false x86_64 100 Gigabit 15 0 0 none $109.2 -Not Fetched- -u-9tb1.112xlarge 448 9,216 nitro true false x86_64 100 Gigabit 15 0 0 none -Not Fetched- -Not Fetched- -u-6tb1.112xlarge 448 6,144 nitro true false x86_64 100 Gigabit 15 0 0 none $54.6 -Not Fetched- -u-6tb1.56xlarge 224 6,144 nitro true false x86_64 100 Gigabit 15 0 0 none $46.40391 -Not Fetched- -x2iedn.metal 128 4,096 none true false x86_64 100 Gigabit 15 0 0 none $26.676 $20.92296 -x2iedn.32xlarge 128 4,096 nitro true false x86_64 100 Gigabit 15 0 0 none $26.676 $8.70294 -x1e.32xlarge 128 3,904 xen true false x86_64 25 Gigabit 8 0 0 none $26.688 $8.0064 -x2iedn.24xlarge 96 3,072 nitro true false x86_64 75 Gigabit 15 0 0 none $20.007 $6.0021 -u-3tb1.56xlarge 224 3,072 nitro true false x86_64 50 Gigabit 8 0 0 none $27.3 -Not Fetched- -x2idn.metal 128 2,048 none true false x86_64 100 Gigabit 15 0 0 none $13.338 $7.46603 -NOTE: 547 entries were truncated, increase --max-results to see more +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 +------------- ----- --------- ---------- ----------- ------------------- -------- ------------------- ---- ---- ------------- -------- ------------------ ------------- +u7in-32tb.224xlarge 896 32,768 nitro true false x86_64 200 Gigabit 16 0 0 none $407.68 -Not Fetched- +u7in-24tb.224xlarge 896 24,576 nitro true false x86_64 200 Gigabit 16 0 0 none $305.76 -Not Fetched- +u-24tb1.112xlarge 448 24,576 nitro true false x86_64 100 Gigabit 15 0 0 none $218.4 -Not Fetched- +u-18tb1.112xlarge 448 18,432 nitro true false x86_64 100 Gigabit 15 0 0 none $163.8 -Not Fetched- +u7in-16tb.224xlarge 896 16,384 nitro true false x86_64 200 Gigabit 16 0 0 none $203.84 -Not Fetched- +u7i-12tb.224xlarge 896 12,288 nitro true false x86_64 100 Gigabit 15 0 0 none $152.88 -Not Fetched- +u-12tb1.112xlarge 448 12,288 nitro true false x86_64 100 Gigabit 15 0 0 none $109.2 -Not Fetched- +u-9tb1.112xlarge 448 9,216 nitro true false x86_64 100 Gigabit 15 0 0 none $81.9 -Not Fetched- +u-6tb1.56xlarge 224 6,144 nitro true false x86_64 100 Gigabit 15 0 0 none $46.40391 -Not Fetched- +u-6tb1.112xlarge 448 6,144 nitro true false x86_64 100 Gigabit 15 0 0 none $54.6 -Not Fetched- +NOTE: 832 entries were truncated, increase --max-results to see more ``` 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). **Example output of instance type object using Verbose output** ``` $ ec2-instance-selector --max-results 1 -v +NOTE: + +"Filters": { + "AllowList": null, + "DenyList": null, + "AvailabilityZones": [], + "BareMetal": null, + "Burstable": null, + "AutoRecovery": null, + "FreeTier": null, + "CPUArchitecture": null, + "CPUManufacturer": null, + "CurrentGeneration": null, + "EnaSupport": null, + "EfaSupport": null, + "Fpga": null, + "GpusRange": null, + "GpuMemoryRange": null, + "GPUManufacturer": null, + "GPUModel": null, + "InferenceAcceleratorsRange": null, + "InferenceAcceleratorManufacturer": null, + "InferenceAcceleratorModel": null, + "HibernationSupported": null, + "Hypervisor": null, + "MaxResults": 1, + "MemoryRange": null, + "NetworkInterfaces": null, + "NetworkPerformance": null, + "NetworkEncryption": null, + "IPv6": null, + "PlacementGroupStrategy": null, + "Region": "us-east-1", + "RootDeviceType": null, + "UsageClass": null, + "VCpusRange": null, + "VCpusToMemoryRatio": null, + "InstanceTypeBase": null, + "Flexible": null, + "Service": null, + "InstanceTypes": null, + "VirtualizationType": null, + "PricePerHour": null, + "InstanceStorageRange": null, + "DiskType": null, + "NVME": null, + "EBSOptimized": null, + "DiskEncryption": null, + "EBSOptimizedBaselineBandwidth": null, + "EBSOptimizedBaselineThroughput": null, + "EBSOptimizedBaselineIOPS": null, + "DedicatedHosts": null, + "Generation": null +} +NOTE: There were no transformations on the filters to display [ { "AutoRecoverySupported": true, @@ -225,6 +296,7 @@ $ ec2-instance-selector --max-results 1 -v "InstanceStorageInfo": null, "InstanceStorageSupported": false, "InstanceType": "a1.2xlarge", + "MediaAcceleratorInfo": null, "MemoryInfo": { "SizeInMiB": 16384 }, @@ -232,6 +304,7 @@ $ ec2-instance-selector --max-results 1 -v "DefaultNetworkCardIndex": 0, "EfaInfo": null, "EfaSupported": false, + "EnaSrdSupported": false, "EnaSupport": "required", "EncryptionInTransitSupported": false, "Ipv4AddressesPerInterface": 15, @@ -241,13 +314,20 @@ $ ec2-instance-selector --max-results 1 -v "MaximumNetworkInterfaces": 4, "NetworkCards": [ { + "BaselineBandwidthInGbps": 2.5, "MaximumNetworkInterfaces": 4, "NetworkCardIndex": 0, - "NetworkPerformance": "Up to 10 Gigabit" + "NetworkPerformance": "Up to 10 Gigabit", + "PeakBandwidthInGbps": 10 } ], "NetworkPerformance": "Up to 10 Gigabit" }, + "NeuronInfo": null, + "NitroEnclavesSupport": "unsupported", + "NitroTpmInfo": null, + "NitroTpmSupport": "unsupported", + "PhcSupport": "unsupported", "PlacementGroupInfo": { "SupportedStrategies": [ "cluster", @@ -256,9 +336,11 @@ $ ec2-instance-selector --max-results 1 -v ] }, "ProcessorInfo": { + "Manufacturer": "AWS", "SupportedArchitectures": [ "arm64" ], + "SupportedFeatures": null, "SustainedClockSpeedInGhz": 2.3 }, "SupportedBootModes": [ @@ -281,11 +363,11 @@ $ ec2-instance-selector --max-results 1 -v "ValidCores": null, "ValidThreadsPerCore": null }, - "OndemandPricePerHour": 0.204, - "SpotPrice": 0.03939999999999999 + "OndemandPricePerHour": null, + "SpotPrice": null } ] -NOTE: 497 entries were truncated, increase --max-results to see more +NOTE: 841 entries were truncated, increase --max-results to see more ``` NOTE: Use this JSON format as reference when finding JSON paths for sorting @@ -414,8 +496,8 @@ import ( "context" "fmt" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" "github.com/aws/aws-sdk-go-v2/config" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) @@ -480,7 +562,7 @@ func main() { $ git clone https://github.com/aws/amazon-ec2-instance-selector.git $ cd amazon-ec2-instance-selector/ $ go run cmd/examples/example1.go -[c4.large c5.large c5a.large c5ad.large c5d.large c6i.large t2.medium t3.medium t3.small t3a.medium t3a.small] +[c4.large c5.large c5a.large c5ad.large c5d.large c6a.large c6i.large c6id.large c6in.large c7a.large c7i-flex.large c7i.large t2.medium t3.medium t3.small t3a.medium t3a.small] ``` ## Building diff --git a/cmd/examples/example1.go b/cmd/examples/example1.go index 48d44666..b4760361 100644 --- a/cmd/examples/example1.go +++ b/cmd/examples/example1.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" "github.com/aws/aws-sdk-go-v2/config" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) diff --git a/cmd/main.go b/cmd/main.go index a0d2f6fb..a7cacce3 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -24,12 +24,12 @@ import ( "syscall" "time" - commandline "github.com/aws/amazon-ec2-instance-selector/v2/pkg/cli" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/env" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter" + commandline "github.com/aws/amazon-ec2-instance-selector/v3/pkg/cli" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/env" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector/outputs" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/sorter" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" diff --git a/go.mod b/go.mod index f730ad02..e3163bbb 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/aws/amazon-ec2-instance-selector/v2 +module github.com/aws/amazon-ec2-instance-selector/v3 go 1.23 diff --git a/pkg/bytequantity/bytequantity_test.go b/pkg/bytequantity/bytequantity_test.go index 7a110873..2cae9b7e 100644 --- a/pkg/bytequantity/bytequantity_test.go +++ b/pkg/bytequantity/bytequantity_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" ) func TestParseToByteQuantity(t *testing.T) { diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index 77a4d0b8..5b244dae 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -21,8 +21,8 @@ import ( "reflect" "strings" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" "github.com/spf13/cobra" "github.com/spf13/pflag" ) diff --git a/pkg/cli/cli_internal_test.go b/pkg/cli/cli_internal_test.go index 019100bf..34ab1916 100644 --- a/pkg/cli/cli_internal_test.go +++ b/pkg/cli/cli_internal_test.go @@ -17,7 +17,7 @@ import ( "os" "testing" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" "github.com/spf13/pflag" ) diff --git a/pkg/cli/cli_test.go b/pkg/cli/cli_test.go index a3ed2535..8e7155c1 100644 --- a/pkg/cli/cli_test.go +++ b/pkg/cli/cli_test.go @@ -20,10 +20,10 @@ import ( "reflect" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/cli" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/cli" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" "github.com/spf13/cobra" ) diff --git a/pkg/cli/flags.go b/pkg/cli/flags.go index 5b50221a..1e235a17 100644 --- a/pkg/cli/flags.go +++ b/pkg/cli/flags.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" "github.com/mitchellh/go-homedir" "github.com/spf13/pflag" ) diff --git a/pkg/cli/flags_test.go b/pkg/cli/flags_test.go index ab737f93..6f15aa0b 100644 --- a/pkg/cli/flags_test.go +++ b/pkg/cli/flags_test.go @@ -17,8 +17,8 @@ import ( "fmt" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" ) // Tests diff --git a/pkg/cli/types.go b/pkg/cli/types.go index 97a4f22f..ea23a992 100644 --- a/pkg/cli/types.go +++ b/pkg/cli/types.go @@ -18,8 +18,8 @@ import ( "log" "regexp" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" "github.com/spf13/cobra" "github.com/spf13/pflag" ) diff --git a/pkg/cli/types_test.go b/pkg/cli/types_test.go index 20ebaef5..2763181f 100644 --- a/pkg/cli/types_test.go +++ b/pkg/cli/types_test.go @@ -18,9 +18,9 @@ import ( "regexp" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" ) // Tests diff --git a/pkg/ec2pricing/ec2pricing_test.go b/pkg/ec2pricing/ec2pricing_test.go index cb695ab5..72d2c64e 100644 --- a/pkg/ec2pricing/ec2pricing_test.go +++ b/pkg/ec2pricing/ec2pricing_test.go @@ -22,8 +22,8 @@ import ( ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/ec2pricing" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/aws/aws-sdk-go-v2/service/pricing" ) diff --git a/pkg/selector/aggregates.go b/pkg/selector/aggregates.go index b5f3e613..16e8a49f 100644 --- a/pkg/selector/aggregates.go +++ b/pkg/selector/aggregates.go @@ -3,10 +3,11 @@ package selector import ( "context" "fmt" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" + "regexp" + + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" "github.com/aws/aws-sdk-go-v2/service/ec2" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "regexp" ) const ( diff --git a/pkg/selector/aggregates_test.go b/pkg/selector/aggregates_test.go index 3211a031..84d5549f 100644 --- a/pkg/selector/aggregates_test.go +++ b/pkg/selector/aggregates_test.go @@ -17,8 +17,8 @@ import ( "context" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" ) // Tests diff --git a/pkg/selector/comparators_internal_test.go b/pkg/selector/comparators_internal_test.go index 80016313..40beb1a6 100644 --- a/pkg/selector/comparators_internal_test.go +++ b/pkg/selector/comparators_internal_test.go @@ -17,7 +17,7 @@ import ( "math" "testing" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" "github.com/aws/aws-sdk-go-v2/aws" ) diff --git a/pkg/selector/emr_test.go b/pkg/selector/emr_test.go index 37f278e9..504951fa 100644 --- a/pkg/selector/emr_test.go +++ b/pkg/selector/emr_test.go @@ -16,8 +16,8 @@ package selector_test import ( "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" ) // Tests diff --git a/pkg/selector/outputs/bubbletea.go b/pkg/selector/outputs/bubbletea.go index 74076874..e1e82104 100644 --- a/pkg/selector/outputs/bubbletea.go +++ b/pkg/selector/outputs/bubbletea.go @@ -14,8 +14,8 @@ package outputs import ( - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/sorter" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" "github.com/muesli/termenv" diff --git a/pkg/selector/outputs/bubbletea_internal_test.go b/pkg/selector/outputs/bubbletea_internal_test.go index 8decdb40..e2f9f82d 100644 --- a/pkg/selector/outputs/bubbletea_internal_test.go +++ b/pkg/selector/outputs/bubbletea_internal_test.go @@ -20,8 +20,8 @@ import ( "strings" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" "github.com/evertras/bubble-table/table" ) diff --git a/pkg/selector/outputs/outputs.go b/pkg/selector/outputs/outputs.go index dd16ec7a..4fe1da4c 100644 --- a/pkg/selector/outputs/outputs.go +++ b/pkg/selector/outputs/outputs.go @@ -24,7 +24,7 @@ import ( "strings" "text/tabwriter" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" ) const columnTag = "column" diff --git a/pkg/selector/outputs/outputs_test.go b/pkg/selector/outputs/outputs_test.go index a5fbe939..e7b2a001 100644 --- a/pkg/selector/outputs/outputs_test.go +++ b/pkg/selector/outputs/outputs_test.go @@ -20,9 +20,9 @@ import ( "strings" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector/outputs" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" "github.com/aws/aws-sdk-go-v2/service/ec2" ) diff --git a/pkg/selector/outputs/sortingView.go b/pkg/selector/outputs/sortingView.go index 671b4d4e..f873a26c 100644 --- a/pkg/selector/outputs/sortingView.go +++ b/pkg/selector/outputs/sortingView.go @@ -18,8 +18,8 @@ import ( "io" "strings" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/sorter" "github.com/charmbracelet/bubbles/key" "github.com/charmbracelet/bubbles/list" "github.com/charmbracelet/bubbles/textinput" diff --git a/pkg/selector/outputs/tableView.go b/pkg/selector/outputs/tableView.go index 9dc05bce..4c337256 100644 --- a/pkg/selector/outputs/tableView.go +++ b/pkg/selector/outputs/tableView.go @@ -18,8 +18,8 @@ import ( "reflect" "strings" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/sorter" "github.com/charmbracelet/bubbles/key" "github.com/charmbracelet/bubbles/textinput" tea "github.com/charmbracelet/bubbletea" diff --git a/pkg/selector/outputs/verboseView.go b/pkg/selector/outputs/verboseView.go index 0852f73d..7201aaf4 100644 --- a/pkg/selector/outputs/verboseView.go +++ b/pkg/selector/outputs/verboseView.go @@ -18,7 +18,7 @@ import ( "math" "strings" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/charmbracelet/bubbles/viewport" tea "github.com/charmbracelet/bubbletea" diff --git a/pkg/selector/selector.go b/pkg/selector/selector.go index 91ead91a..1032dfee 100644 --- a/pkg/selector/selector.go +++ b/pkg/selector/selector.go @@ -26,9 +26,9 @@ import ( "sync" "time" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/ec2pricing" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector/outputs" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/service/ec2" diff --git a/pkg/selector/selector_test.go b/pkg/selector/selector_test.go index 22fca820..16fdd838 100644 --- a/pkg/selector/selector_test.go +++ b/pkg/selector/selector_test.go @@ -24,11 +24,11 @@ import ( "strconv" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/awsapi" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/awsapi" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/ec2" diff --git a/pkg/selector/services_test.go b/pkg/selector/services_test.go index de14f9ea..cd14af9e 100644 --- a/pkg/selector/services_test.go +++ b/pkg/selector/services_test.go @@ -16,8 +16,8 @@ package selector_test import ( "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" "github.com/aws/aws-sdk-go-v2/aws" ) diff --git a/pkg/selector/types.go b/pkg/selector/types.go index dd0900bd..23a017bd 100644 --- a/pkg/selector/types.go +++ b/pkg/selector/types.go @@ -18,12 +18,12 @@ import ( "log" "regexp" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/awsapi" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/awsapi" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/bytequantity" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/ec2pricing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/bytequantity" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/ec2pricing" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" ) // InstanceTypesOutput can be implemented to provide custom output to instance type results diff --git a/pkg/selector/types_test.go b/pkg/selector/types_test.go index 3e115887..c61bff8c 100644 --- a/pkg/selector/types_test.go +++ b/pkg/selector/types_test.go @@ -18,8 +18,8 @@ import ( "strings" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) diff --git a/pkg/sorter/sorter.go b/pkg/sorter/sorter.go index 311145b0..418fc195 100644 --- a/pkg/sorter/sorter.go +++ b/pkg/sorter/sorter.go @@ -20,7 +20,7 @@ import ( "sort" "strings" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" "github.com/oliveagle/jsonpath" ) diff --git a/pkg/sorter/sorter_test.go b/pkg/sorter/sorter_test.go index 8a59b0bf..25e8cfa8 100644 --- a/pkg/sorter/sorter_test.go +++ b/pkg/sorter/sorter_test.go @@ -20,10 +20,10 @@ import ( "strings" "testing" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/instancetypes" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/selector/outputs" - "github.com/aws/amazon-ec2-instance-selector/v2/pkg/sorter" - h "github.com/aws/amazon-ec2-instance-selector/v2/pkg/test" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/instancetypes" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/selector/outputs" + "github.com/aws/amazon-ec2-instance-selector/v3/pkg/sorter" + h "github.com/aws/amazon-ec2-instance-selector/v3/pkg/test" ) const ( diff --git a/test/readme-test/run-readme-codeblocks b/test/readme-test/run-readme-codeblocks index b58bb523..ebdf1181 100755 --- a/test/readme-test/run-readme-codeblocks +++ b/test/readme-test/run-readme-codeblocks @@ -22,8 +22,8 @@ interpreters=($(echo $rundoc_output | jq -r '.code_blocks[] | .interpreter')) ## Execute --help check which compares the help codeblock in the README to the actual output of the binary rd list-blocks -T "bash#help" /aeis/README.md | jq -r '.code_blocks[0] .code' > $BUILD_DIR/readme_help.out -docker run -t --rm codeblocks build/ec2-instance-selector --help > $BUILD_DIR/actual_help.out -diff --ignore-all-space --ignore-blank-lines "$BUILD_DIR/actual_help.out" "$BUILD_DIR/readme_help.out" +docker run -t --rm codeblocks build/ec2-instance-selector --help | perl -pe 's/\e\[?.*?[a-zA-Z]//g' > $BUILD_DIR/actual_help.out +diff --ignore-all-space --ignore-blank-lines --ignore-trailing-space "$BUILD_DIR/actual_help.out" "$BUILD_DIR/readme_help.out" echo "✅ README help section matches actual binary output!" ## Execute go codeblocks example tests which checks the go codeblocks in the readme with a source file path @@ -35,7 +35,7 @@ for i in "${!example_files[@]}"; do example_file="${example_files[$i]}" example_bin=$(echo $example_file | cut -d'.' -f1) mkdir -p $BUILD_DIR/examples - docker run -i -e GOOS=$OS -e GOARCH=amd64 -v $BUILD_DIR:/amazon-ec2-instance-selector/build --rm codeblocks go build -o build/examples/$example_bin $example_file + docker run -i -e GOOS=$OS -e GOARCH=amd64 -e CGO_ENABLED=0 -v $BUILD_DIR:/amazon-ec2-instance-selector/build --rm codeblocks go build -o build/examples/$example_bin $example_file $BUILD_DIR/examples/$example_bin echo "✅ $example_file Executed Successfully!" fi