Commit 2c3e130
authored
Migrate AWS SDK for Go to v2 (#943)
* chore(deps): Migrate go.mod from AWS SDK v1 to v2
Replace aws-sdk-go v1.55.6 with aws-sdk-go-v2 and individual service
modules. Update both root and test/ module dependencies.
Key dependency changes:
- Remove github.com/aws/aws-sdk-go v1.55.6
- Add github.com/aws/aws-sdk-go-v2 v1.41.5
- Add github.com/aws/aws-sdk-go-v2/config v1.32.14
- Add github.com/aws/aws-sdk-go-v2/service/vpclattice v1.20.11
- Add github.com/aws/aws-sdk-go-v2/service/acm v1.38.1
- Add github.com/aws/smithy-go v1.24.3
- Add additional v2 service modules for integration tests
* refactor: Migrate production code from AWS SDK v1 to v2
Migrate all production code in pkg/ from aws-sdk-go v1 to
aws-sdk-go-v2. This is the core of the SDK migration.
Import convention follows idiomatic v2 patterns:
- vpclattice: service package (Input/Output types)
- types: types subpackage (model types, enums)
- apitypes: k8s apimachinery types (where conflict exists)
Key changes across all files:
- Replace v1 session-based clients with v2 config-based clients
- Replace *string fields with string for SDK model types
- Replace []*Type slices with []Type value slices
- Replace *int64 with *int32 for port/count fields
- Replace map[string]*string tags with map[string]string
- Replace WithContext method calls with context-first signatures
- Replace awserr error handling with smithy-go error types
- Replace string constants with typed enums
- Replace v1 Matcher/RuleAction structs with v2 union interfaces
- Remove unused gwlogAdapter and getMapValue dead code
- Fix printf format for struct pointer (%s -> %v)
* chore: Regenerate mocks for v2 SDK interfaces
Regenerate all gomock files via go generate to match updated
interface signatures using AWS SDK v2 types.
* test: Migrate unit tests from AWS SDK v1 to v2
Update all pkg/ unit tests to use v2 SDK types, matching the
production code migration. Changes mirror the production code
patterns: value types in slices, typed enums, *int32 ports,
map[string]string tags, and v2 union interfaces for Matcher
and RuleAction.
* test: Migrate integration tests from AWS SDK v1 to v2
Update all test/ integration tests and framework to use v2 SDK.
Key changes:
- Replace session.NewSession() with config.LoadDefaultConfig()
- Replace service.New(sess) with service.NewFromConfig(cfg)
- Migrate all AWS service clients (VPC Lattice, EC2, ACM, S3, IAM,
STS, Route53, CloudWatch Logs, Firehose, RAM)
- Update HealthCheckConfig assertions for v2 types (*int32, typed
enums, MatcherMemberHttpCode union interface)
- Update EC2 DescribeVpcs VpcIds from []*string to []string
* fixes
* fixes
* address comments, fix flaky tests
* fix: Restore shortened comments, remove test retry override
- Restore multi-line comments in drift_detection_test.go that were
accidentally shortened during rebase
- Remove RetryMaxAttempts=10 override in ram_share_test.go to match
v1 behavior (SDK default of 3 attempts)
- Add Serial to VpcAssociationPolicy drift test to prevent interference
- Fix flaky drift test: wait for associations to be ACTIVE before delete
- Increase association deletion timeout from 2min to 4min
* address review comments
* add more retries for ram share test
* Disable aws sdk built-in rate limiter
* fix flaky service drift detection test1 parent 6e1bd94 commit 2c3e130
114 files changed
Lines changed: 4574 additions & 6707 deletions
File tree
- pkg
- aws
- metrics
- services
- config
- controllers
- deploy/lattice
- gateway
- k8s
- model/lattice
- test
- pkg/test
- suites
- integration
- webhook
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
7 | 14 | | |
8 | 15 | | |
9 | 16 | | |
| |||
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
28 | 44 | | |
29 | 45 | | |
30 | 46 | | |
| |||
51 | 67 | | |
52 | 68 | | |
53 | 69 | | |
54 | | - | |
55 | 70 | | |
56 | 71 | | |
57 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
6 | 38 | | |
7 | 39 | | |
8 | 40 | | |
| |||
87 | 119 | | |
88 | 120 | | |
89 | 121 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | 122 | | |
95 | 123 | | |
96 | 124 | | |
| |||
247 | 275 | | |
248 | 276 | | |
249 | 277 | | |
250 | | - | |
251 | 278 | | |
252 | | - | |
253 | | - | |
254 | 279 | | |
255 | 280 | | |
256 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 6 | | |
10 | 7 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
65 | 76 | | |
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
| 101 | + | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
160 | | - | |
161 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | | - | |
183 | | - | |
| 183 | + | |
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
247 | 274 | | |
0 commit comments