Skip to main content
Version: 0.6.x (Current)

Agent Tokens

An Agent Token is a credential used by tfc-agent processes to authenticate with Terraform Cloud/Enterprise. Tokens are scoped to an Agent Pool.

Available Queries

QueryDescription
agentTokens(poolId: ID!, filter: AgentTokenFilter)List all tokens for a pool
agentToken(id: ID!)Fetch a single token by ID

Example

query TokensForPool($poolId: ID!) {
agentTokens(poolId: $poolId) {
id
description
createdAt
lastUsedAt
}
}

Fields

FieldTypeDescription
idID!Token identifier
poolIdStringParent agent pool ID
createdAtDateTime!When the token was created
lastUsedAtDateTimeLast time the token was used (null if never used)
descriptionString!Human-readable description
createdByIdID!ID of the user who created this token

Filter Fields

FieldComparison Type
idStringComparisonExp
poolIdStringComparisonExp
createdAtDateTimeComparisonExp
lastUsedAtDateTimeComparisonExp
descriptionStringComparisonExp
createdByIdStringComparisonExp
  • Agent Pools — The pool this token belongs to
  • Agents — Agents that use these tokens to connect