Unable to resolve sts.us-east-1.api.aws #4347
-
Confirm by changing [ ] to [x] below:
Describe the question We've recently tried updating Go SDK to the latest version but came across a problem related to DNS resolution of STS. Unfortunately, when we set
Here's a simple program to reproduce this package main
import (
"fmt"
"log"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
)
const (
region = "us-east-1"
bucket = "your-bucket"
key = "your-s3-key-in-you-bucket"
)
func main() {
config := &aws.Config{
Region: aws.String("us-east-1"),
S3ForcePathStyle: aws.Bool(true),
CredentialsChainVerboseErrors: aws.Bool(true),
UseDualStackEndpoint: endpoints.DualStackEndpointStateEnabled,
}
sess, err := session.NewSession(config)
if err != nil {
log.Fatal(err)
}
svc := s3.New(sess)
input := &s3.ListObjectsV2Input{
Bucket: aws.String(bucket),
Prefix: aws.String(key),
}
resp, err := svc.ListObjectsV2(input)
if err != nil {
log.Fatal(err)
}
fmt.Println(resp)
} The version of the SDK can be seen int he
Now, what is interesting is, when instead of setting Now, it might be possible we are missing some EKS config, but it's strange we haven't been seeing these errors when using the old, now deprecated, option. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @milosgajdos ,
As a side note, is there a reason why you are setting
Don't think this is affecting your sample just, it tends to be problematic so unless required I'd avoid it. |
Beta Was this translation helpful? Give feedback.
-
But that's exactly what I'm doing in my code? Not sure I follow your response @KaibaLopez |
Beta Was this translation helpful? Give feedback.
-
Why has this been converted into a discussion? This is strange; I still havent got a tiny bit of explanation here 🤔 |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @milosgajdos ,
Sorry for the slow response here, what is happening here basically is
UseDualStack
only applied to s3 where asUseDualStackEndpoint
is generic for all services...It's not the best solution but try this as a workaround:
As a side note, is there a reason why you are setting
Don't think this is affecting your sample just, it tends to be problematic so unless required I'd avoid it.