Snapshots

Snapshots allow you to create a read-only archive of files at a specific point in time. You can define a snapshot, add files to it, and then finalize it. Once finalized, the snapshot’s contents are immutable.

Each snapshot may have an expiration date. When the expiration date is reached, the snapshot is automatically deleted from the Files.com platform.

Resource Schema

Optional

PropertyDescription
expires_at
String
When the snapshot expires.
name
String
A name for the snapshot.
workspace_id
Int64
Workspace ID. 0 means the default workspace.
paths
List
An array of paths to add to the snapshot.

Read Only

PropertyDescription
id
Int64
The snapshot's unique ID.
finalized_at
String
When the snapshot was finalized.
user_id
Int64
The user that created this snapshot, if applicable.
bundle_id
Int64
The bundle using this snapshot, if applicable.

Example Resource

resource "files_snapshot" "example_snapshot" {
  expires_at   = "2000-01-01T01:00:00Z"
  name         = "My Snapshot"
  workspace_id = 0
}

Resource Import

This Resource supports importing using the following syntax:

Example Import Command

# Snapshots can be imported by specifying the id.
terraform import files_snapshot.example_snapshot 1

Data Source Schema

Required

PropertyDescription
id
Int64
The snapshot's unique ID.

Read Only

PropertyDescription
expires_at
String
When the snapshot expires.
finalized_at
String
When the snapshot was finalized.
name
String
A name for the snapshot.
user_id
Int64
The user that created this snapshot, if applicable.
bundle_id
Int64
The bundle using this snapshot, if applicable.
workspace_id
Int64
Workspace ID. 0 means the default workspace.

Example Data Source

data "files_snapshot" "example_snapshot" {
  id = 1
}