Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

FIPSEndpointStateEnabled option results in incorrect endpoint for us-gov-west-1 region #268

Closed
@bjs-code

Description

@bjs-code

Confirm by changing [ ] to [x] below to ensure that it's a bug:

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingresponse-requestedThis issue requires a response to continueservice-apiThis issue pertains to the AWS API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions