Skip to main content

tharsis_runner_service_account_assignment

Assigns a service account to a runner, letting the runner authenticate as it.

Example Usage​

resource "tharsis_runner_service_account_assignment" "this" {
runner_id = tharsis_runner.this.id
service_account_id = tharsis_service_account.this.id
}

Schema​

Required​

  • runner_id (String) The ID or TRN of the runner.
  • service_account_id (String) The ID or TRN of the service account to assign.

Read-Only​

  • id (String) An ID for this tharsis_runner_service_account_assignment resource.

Import​

Import is supported using the following syntax:

In Terraform v1.5.0 and later, the import block can be used with the id attribute, for example:

# An assignment has no identifier of its own in Tharsis. It is identified by the
# pair of resources it joins, so the id is the runner ID and the service account
# ID separated by a forward slash.
#
# Both halves must be IDs rather than TRNs. A TRN contains forward slashes of its
# own, which would make the two halves ambiguous, so TRNs are rejected with an
# explanatory error.
import {
to = tharsis_runner_service_account_assignment.this
id = "<runner-id>/<service-account-id>"
}

# The runner ID is shown by the "id" attribute of a tharsis_runner resource, and
# the service account ID by the "id" attribute of a tharsis_service_account
# resource. Both are also visible in the Tharsis UI.
#
# Note: the "id" attribute of this resource is generated by the provider and has
# no meaning to Tharsis, so importing produces a new value for it. That is
# expected and does not affect how the assignment is managed.