Description
Summary
When using the TokenFileWebIdentity, the data plane will successfully initialize with a token, but when a request is sent to refresh the token, an additional region is added to the hostname (Ex: sts.us-west-2.us-west-2.amazonaws.com). Rapid succession requests will continue to add regions to the host name as well (Ex: sts.us-west-2.us-west-2.us-west-2.us-west-2.us-west-2.amazonaws.com). This causes a DNS resolution error and the data plane is no longer authenticated with AWS.
The generate_service_methods will add additional regions if the region currently exists in the hostname, but I'm not certain that is causing the issue given that the function is called in init.lua and the class is only initialized once with no config passed as an argument.
Steps to Reproduce
- Initialize plugin with TokenFileWebIdentity
- Wait for token to expire (about an hour)
- Send requests to routes using the AWS SDK
- DNS Resolution error will appear with the additional regions in the hostname