Skip to main content

almaforge_lock Data Source

Read an AlmaForge Lock resource by name.

This data source reads existing cluster resources. It does not create, change, or delete them. Authenticate using the Terraform setup guide. Your identity needs permission to read the selected resources.

See revoking access for lock targets and enforcement. An expired lock remains readable. Check spec.expires_at before treating a returned lock as active.

See the configuration reference for the resource manifest and field context.

Set name to the existing object's metadata.name. The result is available in metadata and spec. A missing object produces an error.

Example Usage​

Save this configuration in a new directory. Replace the example name with the existing object you want to read. Review the plan before applying it. Applying this data-only configuration saves the outputs without changing cluster resources.

Terminal
terraform initterraform plan -out=plan.tfplanterraform apply plan.tfplanterraform output
HCL
terraform {
required_providers {
almaforge = {
source = "get.almaforge.com/almaforge/almaforge"
}
}
}

provider "almaforge" {}

data "almaforge_lock" "existing" {
name = "maintenance"
}

output "name" {
value = data.almaforge_lock.existing.metadata.name
}

To manage changes instead of only reading, use the resource. Read resources versus data sources before choosing ownership.

Schema​

Required​

  • name (String) Name of the resource to read.

Read-Only​

Nested Schema for metadata​

Read-Only:

  • labels (Map of String) Labels attached to the resource.
  • name (String) Resource name. Changing this name replaces the resource.
  • resource_version (String) Server revision used to detect concurrent changes.

Nested Schema for spec​

Read-Only:

  • created_at (String) CreatedAt is the time the lock was created.
  • created_by (String) CreatedBy is the username of the lock author.
  • expires_at (String) ExpiresAt, if set, specifies when the lock ceases to be in force. Zero value (IsZero) means the lock has no expiry. Distinct from ObjectMeta lifecycle. The lock resource itself is not deleted when ExpiresAt elapses.
  • message (String) Message is the message displayed to locked-out users.
  • target (Attributes) Target describes the set of interactions that the lock applies to. (see below for nested schema)

Nested Schema for spec.target​

Read-Only:

  • access_request (String) AccessRequest is the UUID of an access request.
  • login (String) Login is the name of a local UNIX user.
  • role (String) Role is the name of an RBAC role known to the cluster.
  • server_id (String) ServerID is the host ID of the AlmaForge instance.
  • user (String) User is the name of an AlmaForge user.