FIPSEndpointStateEnabled option results in incorrect endpoint for us-gov-west-1 region #268
Description
Confirm by changing [ ] to [x] below to ensure that it's a bug:
- I've gone though Developer Guide and API reference
- I've checked AWS Forums and StackOverflow for answers
- I've searched for previous similar issues and didn't find any solution
Describe the bug
Incorrect FIPS endpoint chosen for us-gov-west-1 region.
This appears to have been introduced with aws/aws-sdk-go#3938
We are attempting to use the UseFIPSEndpoint
option introduced in the PR above, and targeting an ec2 endpoint in us-gov-west-1. According to both the documentation, and endpoints.json
, the correct endpoint should be.
ec2.us-gov-west-1.amazonaws.com
However, with the flag in place the endpoint chosen is:
ec2-fips.us-gov-west-1.amazonaws.com
which doesn't resolve
Version of AWS SDK for Go?
v1.42.1
Version of Go (go version
)?
go1.16.3 darwin/amd64
To Reproduce (observed behavior)
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ec2"
)
func main() {
config := &aws.Config{
Region: aws.String("us-west-gov-1"),
CredentialsChainVerboseErrors: aws.Bool(true),
UseFIPSEndpoint: endpoints.FIPSEndpointStateEnabled,
}
sess := session.Must(session.NewSession(config))
svc := ec2.New(sess)
output, err := svc.DescribeImages(&ec2.DescribeImagesInput{
ImageIds: []*string{aws.String("ami-12345678")},
})
fmt.Println(output, err)
}
Expected behavior
SDK uses correct endpoint, however
go run main.go
results in
{
} RequestError: send request failed
caused by: Post "https://ec2-fips.us-west-gov-1.amazonaws.com/": dial tcp: lookup ec2-fips.us-west-gov-1.amazonaws.com: no such host
Additional context