# Token for a Spacelift workload.
# The system:bot role requires botName. Configure that bot's impersonation role
# separately so it can request the RBAC roles the run needs.
apiVersion: almaforge.com/v1
kind: Token
metadata:
  name: ci-tf-network # Spacelift run ALMA_CLIENT_ID value.
spec:
  roles:
    - system:bot # Automation joins as a bot, then impersonates allowed RBAC roles.
  botName: ci-tf-network # Existing Bot resource this token is scoped to.
  spacelift:
    hostname: example.app.spacelift.io # Tenant hostname, without scheme or path.
    allow:
      - spaceID: root # Spacelift space ID.
        callerID: network-prod # Stack or module ID.
        callerType: stack # Accepted values are stack or module.
        scope: write # Accepted values are read or write.
