Skip to main content
The Archil Terraform provider enables you to manage Archil resources using Infrastructure as Code. It supports creating and managing disks, API tokens, and disk user authorizations.

Installation

Add the provider to your required_providers block:
Then run terraform init to install the provider.

Provider configuration

Arguments

Store your API key securely. Use a terraform.tfvars file (and add it to .gitignore) or an environment variable rather than hardcoding the key in your configuration.

Resources

archil_disk

Creates and manages an Archil disk. A storage mount is optional.

Arguments

Mount block arguments

All disk attributes require replacement — changing any attribute will destroy and recreate the disk.

Attributes

S3 bucket resource policy

When an s3 mount has no access keys, Archil is authorized through a bucket resource policy. A policy attached to your bucket grants access to Archil’s IAM role, and an archilSessionId condition scopes that grant to this one disk.
The Principal ARN varies by Archil region, see S3 Object Storage for the full table and policy details. If your bucket’s policy is managed outside this configuration, either export the policy with an output and apply it separately or set session_id explicitly in the mount block.

archil_api_token

Creates and manages an Archil API token for programmatic access.

Arguments

Attributes


archil_disk_user

Adds an authorized user to an Archil disk. Supports token-based and AWS STS authentication. For token users the server generates a cryptographically secure mount token and returns it in the token attribute.

Arguments

Attributes

Data sources

archil_disk

Look up an existing Archil disk by ID or name.

Arguments

Exactly one of id or name must be set.

Attributes

Full example

This example creates a disk with an S3 mount authorized by static credentials, a disk user, and an API token. As with the provider’s api_key, pass real credentials in through variables rather than hardcoding them:
Mount the disk with the generated token:

Import

Disks can be imported using their ID:
API tokens are imported with the token value: