aws / aws-sdk-js

AWS SDK for JavaScript in the browser and Node.js
https://aws.amazon.com/developer/language/javascript/
Apache License 2.0
7.57k stars 1.55k forks source link

Using useFipsEndpoint to true for Kinesis Client in Gov region builds incorrect fips-endpoint URL #4613

Closed sherpapasang closed 3 months ago

sherpapasang commented 3 months ago

Describe the bug

Kinesis DataStreams FIPS endpoint in AWS GovCloud(US) is kinesis.us-gov-west-1.amazonaws.com and kinesis.us-gov-east-1.amazonaws.com.

Setting kinesis client with useFipsEndpoint : true, it hits a non-existing endpoint when making any calls.

Expected Behavior

In AWS GovCloud(US) regions, it should hit the correct fips-endpoint URL if useFipsEndpoint is enabled.

Current Behavior

In AWS GovCloud(US) regions, it hits a non-existing endpoint if useFipsEndpoint is enabled. Specifically it hits kinesis-fips.us-gov-west-1.amazonaws.com for us-gov-west-1 region.

Below is the error from a lambda logs:

        {
            "name": "Error",
            "location": "node:internal/errors:496",
            "message": "getaddrinfo ENOTFOUND kinesis-fips.us-gov-west-1.amazonaws.com",
            "stack": "Error: getaddrinfo ENOTFOUND kinesis-fips.us-gov-west-1.amazonaws.com\n    at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)\n    at __node_internal_ (node:internal/errors:715:10)\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26)\n    at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17)"
        }

Reproduction Steps

Use the latest aws-sdk-js configure a kinesis client in any Gov region and set useFipsEndpoint to true Make any calls using the client - it will fail

Possible Solution

You can override the endpoint-url by using an environment variable AWS_ENDPOINT_URL or simple set useFipsEndpoint to false

Additional Information/Context

No response

SDK version used

v2.1578.0

Environment details (OS name and version, etc.)

AWS GovCloud (US) regions

sherpapasang commented 3 months ago

Seems like it was fixed in v2. Logged the issue under v3.