Terraform & OpenTofu
Add the Files.com provider to your existing Terraform or OpenTofu configuration to manage Site resources through your team's established workflow. Both tools support the same Files.com resource model: accounts and Groups, folder permissions, sharing, Remote Servers, Syncs, Automations, and other administrative resources.
The Files.com Terraform Reference provides provider configuration, resource and data-source arguments, examples, and import syntax for both tools. The Terraform Registry and OpenTofu Registry publish provider releases and version-specific documentation. Use your organization's existing toolchain; the Terraform CLI and OpenTofu CLI references cover tool-specific commands.
Provider Connection
The provider authenticates with a Files.com API key. Its authority follows the key's account, permissions, and scope. Use a credential that can administer the resources in the configuration; a successful connection does not grant additional administrative access.
Supply the key through the FILES_API_KEY environment variable in your shell or deployment system's secret configuration. Keep it out of committed configuration files. Both tools use the following provider declaration, including the terraform block name:
terraform {
required_providers {
files = {
source = "Files-com/files"
}
}
}
provider "files" {
endpoint_override = "https://MYSITE.files.com"
}
Replace MYSITE.files.com with the intended Site address. Keep production and test endpoints, credentials, and state distinct. A Terraform or OpenTofu workspace separates state; it does not create a Files.com Workspace or Child Site, or change the provider's connection automatically.
Select a provider version constraint appropriate to your deployment and commit the dependency lock file. Review provider upgrades with a fresh plan before applying them. State and saved plans can contain sensitive values even when ordinary output hides them; protect those artifacts as well as the API key.
Resources and Dependencies
Files.com access combines accounts, memberships, and folder permissions. A permission grants a user, Group, or Partner access to a folder; creating a Group and assigning it a permission does not add users to that Group. A Sync similarly needs its source and destination configuration as well as the access required to transfer files.
Use resource references to connect those objects rather than hard-coding identifiers from a different Site. Repeatable Provisioning provides a complete arrangement of individual accounts, memberships, Groups, folders, and permissions. If those objects already exist, import them instead of trying to create them again.
Plans and Changes
Include the Files.com configuration in your existing validation and plan-review process. Review the intended Site, account access, folder paths, and connections as well as the resource changes. A valid configuration can still grant the wrong person access or point a workflow at a production destination.
After writing the provider and resource configuration, run the following commands in its directory. Use tofu in place of terraform for OpenTofu:
terraform init
terraform fmt
terraform validate
terraform plan -out=files.plan
Initialization installs the provider and initializes the configured state backend. Formatting standardizes the configuration, and validation checks its syntax and internal consistency. The plan reads the managed resources and proposes the API changes needed to match the declared settings; it does not apply those resource changes.
Review the saved plan for the correct Site and intended additions, updates, deletions, and replacements. Then apply that reviewed artifact:
terraform apply files.plan
Supply the API key through the protected environment for both planning and applying. Protect the saved plan as sensitive data, and keep state in your team's controlled backend. After applying, verify the intended Files.com configuration and effective access, then run a fresh plan to check for remaining differences in the declared settings. A partial apply can leave some changes completed even when the command reports an error.
Configuration Lifecycle explains ownership, omitted settings, resource identity, and recovery after a partial apply.