Skip to main content

tharsis_assigned_managed_identity

Defines and manages an assigned managed identity.

Example Usage​

resource "tharsis_assigned_managed_identity" "this" {
workspace_id = tharsis_workspace.this.id
managed_identity_id = tharsis_managed_identity.aws.id
}

Behavior​

  • A managed identity inherited from a group is not assigned to workspaces automatically. Each workspace that uses it must be assigned the identity.
  • Multiple AWS managed identities can be assigned to one workspace. In that case, each AWS provider block must set profile to the resource path of the identity it uses.
  • Other managed identity types are limited to one per workspace.

Schema​

Required​

  • managed_identity_id (String) The ID or TRN of the assigned managed identity.
  • workspace_id (String) The ID or TRN of the assigned-to workspace.

Read-Only​

  • id (String) An ID for this tharsis_assigned_managed_identity 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 workspace ID and the managed
# identity 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_assigned_managed_identity.this
id = "<workspace-id>/<managed-identity-id>"
}

# The workspace ID is shown by the "id" attribute of a tharsis_workspace
# resource, and the managed identity ID by the "id" attribute of a
# tharsis_managed_identity 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.