You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using Vault with AWS EC2 authentication enabled and binding to the IAM instance profile ARN. This was working well for us until we deployed to our production environment and found 95p of logins went from ~1.5s to ~6s (spiking to over 20s). This causes some of our applications using Vault to timeout and require re-auth. The main difference between environments are the number on instances running in each.
Issue
AWS EC2 authentication takes a long time requiring clients to require to retry.
What I expect
Running the commands from aws CLI takes on the order of 0.5s. I expect that the login should be near that value.
In order to simulate Vault's EC2 authentication we instrumented the process and worked out that the below EC2 API call was taking the majority of the time.
Overview
We're using Vault with AWS EC2 authentication enabled and binding to the IAM instance profile ARN. This was working well for us until we deployed to our production environment and found 95p of logins went from ~1.5s to ~6s (spiking to over 20s). This causes some of our applications using Vault to timeout and require re-auth. The main difference between environments are the number on instances running in each.
Issue
AWS EC2 authentication takes a long time requiring clients to require to retry.
What I expect
Running the commands from
aws
CLI takes on the order of 0.5s. I expect that the login should be near that value.See PR: #2766
Investigation
In order to simulate Vault's EC2 authentication we instrumented the process and worked out that the below EC2 API call was taking the majority of the time.
From https://github.com/hashicorp/vault/blob/master/builtin/credential/aws/path_login.go#L172-L181
I then created a simple test case:
This confirmed that the login runs were taking ~6s to complete.
The AWS SDK documentation for
ec2.DescribeInstances
shows that it can take filters and/or instance IDs as parameters.According to AWS EC2 API documentation, this is expected behaviour:
I created a modified test case to use instance IDs instead of filters:
The API call now takes ~0.3s to complete.
The text was updated successfully, but these errors were encountered: