-
Notifications
You must be signed in to change notification settings - Fork 377
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
AWS EC2 Auth:NameError: name 'load_vault_token' is not defined
#333
Comments
For what it is worth, this is the implementation for the aforementioned undefined method that was related to the documented example code: def load_vault_token(vault_client, ec2_role=None):
"""
Retrieves a vault token, first from a "VAULT_TOKEN" env var if available. If this env var is unavailable, we use a
Vault authentication backend to retrieve a token (currently limited to AWS EC2 authentication)
:param vault_client: hvac.Client
:param ec2_role: str, Name of the Vault AWS auth backend role to use when retrieving a token (if applicable)
:return: string, a vault token
"""
vault_token = os.environ.get('VAULT_TOKEN')
if vault_token is None and ec2_role is not None:
auth_ec2_resp = auth_ec2(
vault_client=vault_client,
role=ec2_role,
)
logger.debug('auth_ec2_resp:\n{}'.format(auth_ec2_resp))
vault_token = auth_ec2_resp['auth']['client_token']
return vault_token (Note: this specific implementation obviously is keyed on the AWS EC2 auth method as its default source for a Vault token.) That said, I figure this card could cover two potential issues:
With that said, apologies for the delay in responding to this issue and we'll try to implement resolution to the two action items raised as soon as possible! |
For the AWS EC2 Authentication Method I get the following error:
This is expected because
load_vault_token
is not defined:The text was updated successfully, but these errors were encountered: