-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Using Xray with stscreds is difficult and awkward #3213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I would go a little further and say that stscreds should use the context object passed into *WithContext methods when refreshing credentials. |
It looks like @jasdel just recently added a aws-sdk-go/aws/credentials/credentials.go Lines 228 to 235 in 6194da3
|
The reason The design change ensures that if a request to refresh credentials is currently in flight, all other calls to |
Thanks Sean. In that case, what's the recommended way to use X-Ray in the Go SDK when using credentials from an AssumeRoler? |
=== ### Service Client Updates * `service/gamelift`: Updates service API and documentation * Public preview of GameLift FleetIQ as a standalone feature. GameLift FleetIQ makes it possible to use low-cost Spot instances by limiting the chance of interruptions affecting game sessions. FleetIQ is a feature of the managed GameLift service, and can now be used with game hosting in EC2 Auto Scaling groups that you manage in your own account. * `service/medialive`: Updates service API, documentation, and waiters * AWS Elemental MediaLive now supports Automatic Input Failover. This feature provides resiliency upstream of the channel, before ingest starts. * `service/monitoring`: Updates service API and documentation * Amazon CloudWatch Contributor Insights adds support for tags and tagging on resource creation. * `service/rds`: Updates service documentation * Documentation updates for RDS: creating read replicas is now supported for SQL Server DB instances * `service/redshift`: Updates service documentation * Documentation updates for redshift ### SDK Enhancements * `aws/credentials`: `ProviderWithContext` optional interface has been added to support passing contexts on credential retrieval ([#3223](#3223)) * Credential providers that implement the optional `ProviderWithContext` will have context passed to them * `ec2rolecreds.EC2RoleProvider`, `endpointcreds.Provider`, `stscreds.AssumeRoleProvider`, `stscreds.WebIdentityRoleProvider` have been updated to support the `ProviderWithContext` interface * Fixes [#3213](#3213) * `aws/ec2metadata`: Context aware operations have been added `EC2Metadata` client ([#3223](#3223))
Release v1.30.3 (2020-04-02) === ### Service Client Updates * `service/gamelift`: Updates service API and documentation * Public preview of GameLift FleetIQ as a standalone feature. GameLift FleetIQ makes it possible to use low-cost Spot instances by limiting the chance of interruptions affecting game sessions. FleetIQ is a feature of the managed GameLift service, and can now be used with game hosting in EC2 Auto Scaling groups that you manage in your own account. * `service/medialive`: Updates service API, documentation, and waiters * AWS Elemental MediaLive now supports Automatic Input Failover. This feature provides resiliency upstream of the channel, before ingest starts. * `service/monitoring`: Updates service API and documentation * Amazon CloudWatch Contributor Insights adds support for tags and tagging on resource creation. * `service/rds`: Updates service documentation * Documentation updates for RDS: creating read replicas is now supported for SQL Server DB instances * `service/redshift`: Updates service documentation * Documentation updates for redshift ### SDK Enhancements * `aws/credentials`: `ProviderWithContext` optional interface has been added to support passing contexts on credential retrieval ([#3223](#3223)) * Credential providers that implement the optional `ProviderWithContext` will have context passed to them * `ec2rolecreds.EC2RoleProvider`, `endpointcreds.Provider`, `stscreds.AssumeRoleProvider`, `stscreds.WebIdentityRoleProvider` have been updated to support the `ProviderWithContext` interface * Fixes [#3213](#3213) * `aws/ec2metadata`: Context aware operations have been added `EC2Metadata` client ([#3223](#3223))
The Xray integration with this SDK seems to rely a lot on passing
Context
s around, which is easy in most cases, except when you need to go throughAssumeRole
withstscreds
, where the type signature doesn't really givestscreds
enough power to be able to callAssumeRoleWithContext
on the underlying STS client.It would be nice if there could be an endorsed way use
stscreds
with Xray, because if you just leave it alone right now, you get the following panic:In an ideal world, it seems like if an API call using the
stscreds
provider needs to refresh the credentials, then theAssumeRole
should use the context of the API triggering the refresh. That would allow it to respect timeouts and such, as well as obviously letting Xray see into the bowels of a request that triggers anAssumeRole
.I'd welcome ideas for workarounds. Right now we've had to just make an
AssumeRoler
that looks into a global variable for the context to use, and then we have remember to set the global properly.The text was updated successfully, but these errors were encountered: