-
Hi! Field EndpointResolverWithOptions is has been declared deprecated in the Config. What is now the way to configure the endpoint for the config? Except for the endpoint configuration for each individual service. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Hi @RanVaknin ! Thanks. But I think you didn't quite understand the question. How do I configure the endpoint for the configuration and not for each individual client? Below I have given an example of the code: customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) {
if service == s3.ServiceID {
some code
}
return aws.Endpoint{}, fmt.Errorf("unknown endpoint requested")
})
// Loading configuration from ~/.aws/*
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithEndpointResolverWithOptions(customResolver))
if err != nil {
log.Fatal(err)
}
s3Client := s3.NewFromConfig(cfg)
// and all the other clients |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi,
Please check out to our documentation and examples for Endpoints2.0
https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/endpoints/
Please let me know if this helps.
Ran~
Answer: