@@ -25,7 +25,6 @@ import (
25
25
"github.com/aws/aws-sdk-go-v2/aws/ratelimit"
26
26
"github.com/aws/aws-sdk-go-v2/aws/retry"
27
27
"github.com/aws/aws-sdk-go-v2/config"
28
- awsv2cfg "github.com/aws/aws-sdk-go-v2/config"
29
28
"github.com/aws/aws-sdk-go/aws"
30
29
"github.com/aws/aws-sdk-go/aws/client"
31
30
"github.com/aws/aws-sdk-go/aws/credentials"
@@ -180,7 +179,7 @@ func UseV2(q url.Values) bool {
180
179
181
180
// NewDefaultV2Config returns a aws.Config for AWS SDK v2, using the default options.
182
181
func NewDefaultV2Config (ctx context.Context ) (awsv2.Config , error ) {
183
- return awsv2cfg .LoadDefaultConfig (ctx )
182
+ return config .LoadDefaultConfig (ctx )
184
183
}
185
184
186
185
// V2ConfigFromURLParams returns an aws.Config for AWS SDK v2 initialized based on the URL
@@ -208,7 +207,7 @@ func V2ConfigFromURLParams(ctx context.Context, q url.Values) (awsv2.Config, err
208
207
var endpoint string
209
208
var hostnameImmutable bool
210
209
var rateLimitCapacity int64
211
- var opts []func (* awsv2cfg .LoadOptions ) error
210
+ var opts []func (* config .LoadOptions ) error
212
211
for param , values := range q {
213
212
value := values [0 ]
214
213
switch param {
@@ -219,26 +218,26 @@ func V2ConfigFromURLParams(ctx context.Context, q url.Values) (awsv2.Config, err
219
218
return awsv2.Config {}, fmt .Errorf ("invalid value for hostname_immutable: %w" , err )
220
219
}
221
220
case "region" :
222
- opts = append (opts , awsv2cfg .WithRegion (value ))
221
+ opts = append (opts , config .WithRegion (value ))
223
222
case "endpoint" :
224
223
endpoint = value
225
224
case "profile" :
226
- opts = append (opts , awsv2cfg .WithSharedConfigProfile (value ))
225
+ opts = append (opts , config .WithSharedConfigProfile (value ))
227
226
case "dualstack" :
228
227
dualStack , err := strconv .ParseBool (value )
229
228
if err != nil {
230
229
return awsv2.Config {}, fmt .Errorf ("invalid value for dualstack: %w" , err )
231
230
}
232
231
if dualStack {
233
- opts = append (opts , awsv2cfg .WithUseDualStackEndpoint (awsv2 .DualStackEndpointStateEnabled ))
232
+ opts = append (opts , config .WithUseDualStackEndpoint (awsv2 .DualStackEndpointStateEnabled ))
234
233
}
235
234
case "fips" :
236
235
fips , err := strconv .ParseBool (value )
237
236
if err != nil {
238
237
return awsv2.Config {}, fmt .Errorf ("invalid value for fips: %w" , err )
239
238
}
240
239
if fips {
241
- opts = append (opts , awsv2cfg .WithUseFIPSEndpoint (awsv2 .FIPSEndpointStateEnabled ))
240
+ opts = append (opts , config .WithUseFIPSEndpoint (awsv2 .FIPSEndpointStateEnabled ))
242
241
}
243
242
case "rate_limiter_capacity" :
244
243
var err error
@@ -252,7 +251,7 @@ func V2ConfigFromURLParams(ctx context.Context, q url.Values) (awsv2.Config, err
252
251
return awsv2.Config {}, fmt .Errorf ("invalid value for anonymous: %w" , err )
253
252
}
254
253
if anon {
255
- opts = append (opts , awsv2cfg .WithCredentialsProvider (awsv2.AnonymousCredentials {}))
254
+ opts = append (opts , config .WithCredentialsProvider (awsv2.AnonymousCredentials {}))
256
255
}
257
256
case "awssdk" :
258
257
// ignore, should be handled before this
@@ -270,7 +269,7 @@ func V2ConfigFromURLParams(ctx context.Context, q url.Values) (awsv2.Config, err
270
269
HostnameImmutable : hostnameImmutable ,
271
270
}, nil
272
271
})
273
- opts = append (opts , awsv2cfg .WithEndpointResolverWithOptions (customResolver ))
272
+ opts = append (opts , config .WithEndpointResolverWithOptions (customResolver ))
274
273
}
275
274
276
275
var rateLimiter retry.RateLimiter
@@ -284,5 +283,5 @@ func V2ConfigFromURLParams(ctx context.Context, q url.Values) (awsv2.Config, err
284
283
})
285
284
}))
286
285
287
- return awsv2cfg .LoadDefaultConfig (ctx , opts ... )
286
+ return config .LoadDefaultConfig (ctx , opts ... )
288
287
}
0 commit comments