Skip to main content
Resources are the infrastructure components that pragma-os manages: storage buckets, datasets, secrets, and more. You declare resources in YAML, and pragma-os handles provisioning, state tracking, and lifecycle management.

Resource Structure

Every resource has a consistent structure:
FieldDescriptionExample
providerThe provider that manages this resourcegcp
resourceThe type of resourcestorage
nameA unique identifier you assigndata-lake
configYour settings for this resourcelocation: EU
depends_onWhat it connects toOther resources
outputsWhat it exposes to other resourcesURLs, IDs, secrets

Configuration Example

Here’s a GCP storage bucket resource:
provider: gcp
resource: storage
name: data-lake
config:
  location: EU
  storage_class: STANDARD
After provisioning, the resource exposes outputs that other resources can reference:
# After provisioning, outputs become available:
# outputs:
#   bucket_url: "gs://pragma-data-lake-abc123"
#   self_link: "https://www.googleapis.com/storage/v1/b/pragma-data-lake-abc123"

Resource Lifecycle

Resources move through these states as pragma manages them:
StateDescription
draftCreated but not yet queued for processing (use --draft flag)
pendingQueued for provider to handle (default behavior)
processingCurrently being handled by the provider
readySuccessfully provisioned and operational
failedProcessing failed, error recorded
Updates and deletes reuse the same state flow: the resource transitions from readypendingprocessingready (or failed).

Dependencies

Resources can depend on other resources. When you reference another resource’s outputs, pragma automatically tracks the dependency:
provider: gcp
resource: bigquery_dataset
name: analytics
config:
  location: EU

---
provider: gcp
resource: bigquery_table
name: events
config:
  dataset: ${gcp.bigquery_dataset.analytics.dataset_id}
  schema:
    - name: event_id
      type: STRING
    - name: timestamp
      type: TIMESTAMP
When the dataset changes, pragma knows to update the table.

Applying Resources

Create and provision resources immediately:
pragma resources apply warehouse.yaml
Create resources in draft state (skip provisioning):
pragma resources apply --draft warehouse.yaml

Next Steps