Table: tfe_current_user - Query Terraform Enterprise Current User using SQL
Terraform Enterprise is an advanced version of Terraform that provides collaboration and governance features. It acts as a shared platform for teams to collaborate on infrastructure as code, providing a workspace for sharing and storing Terraform configurations. It also includes a private registry for sharing Terraform modules.
Table Usage Guide
The tfe_current_user
table provides insights into the authenticated users within Terraform Enterprise. As a system administrator, you can explore user-specific details through this table, including user's ID, username, email, and other associated metadata. Utilize it to uncover information about users, such as their verification status, two-factor authentication status, and whether they are a site administrator.
Examples
Get user information
Explore your current user profile details in Terraform Enterprise. This could be useful for auditing or troubleshooting purposes.
select *from tfe_current_user;
select *from tfe_current_user;
Check if this is a service account
Determine if the current user is a service account. This is useful for managing user access and identifying potential security risks.
select username, is_service_accountfrom tfe_current_user;
select username, is_service_accountfrom tfe_current_user;
Schema for tfe_current_user
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
avatar_url | text | URL of the user avatar. | |
text | User email address. | ||
id | text | ID of the user. | |
is_service_account | boolean | True if the user is a service account. | |
organization_name | text | =, !=, ~~, ~~*, !~~, !~~* | Name of the organization containing the organization member. |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
two_factor | jsonb | Details of two factor authentication for the user. | |
unconfirmed_email | text | Unconfirmed email address for the user. | |
username | text | Username of the user. | |
v2_only | boolean | If true, the user can only use v2. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- tfe
You can pass the configuration to the command with the --config
argument:
steampipe_export_tfe --config '<your_config>' tfe_current_user